blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
390
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
35
| license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 539
values | visit_date
timestamp[us]date 2016-08-02 21:09:20
2023-09-06 10:10:07
| revision_date
timestamp[us]date 1990-01-30 01:55:47
2023-09-05 21:45:37
| committer_date
timestamp[us]date 2003-07-12 18:48:29
2023-09-05 21:45:37
| github_id
int64 7.28k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 13
values | gha_event_created_at
timestamp[us]date 2012-06-11 04:05:37
2023-09-14 21:59:18
⌀ | gha_created_at
timestamp[us]date 2008-05-22 07:58:19
2023-08-28 02:39:21
⌀ | gha_language
stringclasses 62
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 128
12.8k
| extension
stringclasses 11
values | content
stringlengths 128
8.19k
| authors
listlengths 1
1
| author_id
stringlengths 1
79
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
61480656743fbab61a6436e14aa45cda23ab4657
|
e8cd24201cbfadef0f267151ea5b8a90cc505766
|
/group27/772642286/test/QueueTest.java
|
f104fea2c6c8e65e5a7663bb5069579e058f4a2a
|
[] |
no_license
|
XMT-CN/coding2017-s1
|
30dd4ee886dd0a021498108353c20360148a6065
|
382f6bfeeeda2e76ffe27b440df4f328f9eafbe2
|
refs/heads/master
| 2021-01-21T21:38:42.199253
| 2017-06-25T07:44:21
| 2017-06-25T07:44:21
| 94,863,023
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 809
|
java
|
package week01.test;
import org.junit.Assert;
import org.junit.Before;
import week01.basic.Queue;
public class QueueTest {
private Queue queue;
@Before
public void init(){
queue = new Queue();
for(int i=1;i<=500;i++){
queue.enQueue(i);
}
}
public void enQueueTest(){
Assert.assertEquals(500, queue.size());
}
public void deQueue(){
for(int i=500;i>=1 ;i--){
Assert.assertEquals(i, queue.deQueue());
}
}
public void isEmpty(){
Assert.assertEquals(false, queue.isEmpty());
for(int i=500;i>=1 ;i--){
Assert.assertEquals(i, queue.deQueue());
}
Assert.assertEquals(true, queue.isEmpty());
}
public void size(){
for(int i=499;i>0 ;i--){
queue.deQueue();
Assert.assertEquals(i, queue.size());
}
}
}
|
[
"542194147@qq.com"
] |
542194147@qq.com
|
776a32122b316538d1655f6205343aa4aad2faa8
|
620a39fe25cc5fbd0ed09218b62ccbea75863cda
|
/wfj_front/src/shop/product/service/imp/ProductParametersService.java
|
a2c7747d660a59c4622bb72e8b6431966d6e5eb1
|
[] |
no_license
|
hukeling/wfj
|
f9d2a1dc731292acfc67b1371f0f6933b0af1d17
|
0aed879a73b1349d74948efd74dadd97616d8fb8
|
refs/heads/master
| 2021-01-16T18:34:47.111453
| 2017-08-12T07:48:58
| 2017-08-12T07:48:58
| 100,095,588
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 680
|
java
|
package shop.product.service.imp;
import shop.product.dao.IProductParametersDao;
import shop.product.pojo.ProductParameters;
import shop.product.service.IProductParametersService;
import util.service.BaseService;
/**
* IProductParametersService - 商品详细参数service接口实现类
* @author 孟琦瑞
*/
public class ProductParametersService extends BaseService <ProductParameters> implements IProductParametersService{
@SuppressWarnings("unused")
private IProductParametersDao productParametersDao;
public void setProductParametersDao(IProductParametersDao productParametersDao) {
this.baseDao =this.productParametersDao= productParametersDao;
}
}
|
[
"hukelingwork@163.com"
] |
hukelingwork@163.com
|
59b12d17a40e978b0229a8f4ef8427cb0ba39896
|
838fe21048f4da4ba6a2ec1679e2a9e3aff188c9
|
/Base/Bridge/app/src/main/java/com/bridgellc/bridge/swipemenu/SwipeMenuItem.java
|
93a7499645468746bdbefc38662310d068a7820d
|
[] |
no_license
|
PrithivDharmarajan/Projects
|
03b162e0666dc08888d73bd3c6fa7771525677c7
|
1548b60025adc4f7a0570d51950c144a1cacce3a
|
refs/heads/master
| 2020-03-30T22:36:22.465572
| 2018-11-12T16:39:01
| 2018-11-12T16:39:01
| 151,672,600
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,569
|
java
|
package com.bridgellc.bridge.swipemenu;
import android.content.Context;
import android.graphics.drawable.Drawable;
/**
*
* @author baoyz
* @date 2014-8-23
*
*/
public class SwipeMenuItem {
private int id;
private Context mContext;
private String title;
private Drawable icon;
private Drawable background;
private int titleColor;
private int titleSize;
private int width;
public SwipeMenuItem(Context context) {
mContext = context;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getTitleColor() {
return titleColor;
}
public int getTitleSize() {
return titleSize;
}
public void setTitleSize(int titleSize) {
this.titleSize = titleSize;
}
public void setTitleColor(int titleColor) {
this.titleColor = titleColor;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public void setTitle(int resId) {
setTitle(mContext.getString(resId));
}
public Drawable getIcon() {
return icon;
}
public void setIcon(Drawable icon) {
this.icon = icon;
}
public void setIcon(int resId) {
this.icon = mContext.getResources().getDrawable(resId);
}
public Drawable getBackground() {
return background;
}
public void setBackground(Drawable background) {
this.background = background;
}
public void setBackground(int resId) {
this.background = mContext.getResources().getDrawable(resId);
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
}
|
[
"prithiviraj@smaatapps.com"
] |
prithiviraj@smaatapps.com
|
b221c57b9a6099310c03188ccec40c708f1cf750
|
d6239df5794450837e69f015c4a0819a47908a52
|
/app/src/main/java/com/semicolon/librarians/libraryguide/Models/LibraryModel.java
|
7d621fb0907eeead51f378cc264bb31f7327298a
|
[] |
no_license
|
MotawroonProjects/AppLibrary
|
fc16343c4f107dc87adf7e206e54fe1cefabaab3
|
26317fabcf772fcd2859debb49188ae4ebea9b27
|
refs/heads/master
| 2021-10-09T08:51:31.864110
| 2018-12-24T23:11:02
| 2018-12-24T23:11:02
| 114,511,812
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,297
|
java
|
package com.semicolon.librarians.libraryguide.Models;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
/**
* Created by Delta on 06/01/2018.
*/
public class LibraryModel implements Serializable {
@SerializedName("user_type")
private String user_type;
@SerializedName("library_photo")
private String user_photo;
@SerializedName("library_name")
private String lib_name;
@SerializedName("library_email")
private String lib_email;
@SerializedName("library_country")
private String lib_country;
@SerializedName("library_address")
private String lib_address;
@SerializedName("library_phone")
private String lib_phone;
//@SerializedName("type_title")
private String type_title;
@SerializedName("user_username")
private String lib_username;
private String lib_password;
@SerializedName("library_google_lat")
private String lat;
@SerializedName("library_google_lng")
private String lng;
private String title;
private String type;
private String user_token;
private int success;
public LibraryModel() {
}
public String getUser_type() {
return user_type;
}
public String getUser_photo() {
return user_photo;
}
public String getLib_name() {
return lib_name;
}
public String getLib_email() {
return lib_email;
}
public String getLib_country() {
return lib_country;
}
public String getLib_address() {
return lib_address;
}
public String getLib_phone() {
return lib_phone;
}
public String getType_title() {
return type_title;
}
public String getLib_username() {
return lib_username;
}
public String getLib_password() {
return lib_password;
}
public String getLat() {
return lat;
}
public String getLng() {
return lng;
}
public String getUser_token() {
return user_token;
}
public int getSuccess() {
return success;
}
public void setUser_type(String user_type) {
this.user_type = user_type;
}
public void setUser_photo(String user_photo) {
this.user_photo = user_photo;
}
public void setLib_name(String lib_name) {
this.lib_name = lib_name;
}
public void setLib_email(String lib_email) {
this.lib_email = lib_email;
}
public void setLib_country(String lib_country) {
this.lib_country = lib_country;
}
public void setLib_address(String lib_address) {
this.lib_address = lib_address;
}
public void setLib_phone(String lib_phone) {
this.lib_phone = lib_phone;
}
public void setType_title(String type_title) {
this.type_title = type_title;
}
public void setLib_username(String lib_username) {
this.lib_username = lib_username;
}
public void setLib_password(String lib_password) {
this.lib_password = lib_password;
}
public void setLat(String lat) {
this.lat = lat;
}
public void setLng(String lng) {
this.lng = lng;
}
public void setUser_token(String user_token) {
this.user_token = user_token;
}
public void setType(String type) {
this.type = type;
}
public String getType() {
return type;
}
public String getTitle() {
return title;
}
/* public String getUser_photo() {
return user_photo;
}
public void setUser_photo(String user_photo) {
this.user_photo = user_photo;
}
*/
/* public LibraryModel(String user_type, String user_photo, String lib_name, String lib_email, String lib_country, String lib_address, String lib_phone, String lib_type, String lib_username, String lib_password, String lat, String lng) {
this.user_type = user_type;
this.user_photo = user_photo;
this.lib_name = lib_name;
this.lib_email = lib_email;
this.lib_country = lib_country;
this.lib_address = lib_address;
this.lib_phone = lib_phone;
this.lib_type = lib_type;
this.lib_username = lib_username;
this.lib_password = lib_password;
this.lat = lat;
this.lng = lng;
}*/
/*
public String getUser_type() {
return user_type;
}
public void setUser_type(String user_type) {
this.user_type = user_type;
}
public String getLib_name() {
return lib_name;
}
public void setLib_name(String lib_name) {
this.lib_name = lib_name;
}
public String getLib_email() {
return lib_email;
}
public void setLib_email(String lib_email) {
this.lib_email = lib_email;
}
public String getLib_country() {
return lib_country;
}
public void setLib_country(String lib_country) {
this.lib_country = lib_country;
}
public String getLib_address() {
return lib_address;
}
public void setLib_address(String lib_address) {
this.lib_address = lib_address;
}
public String getLib_phone() {
return lib_phone;
}
public void setLib_phone(String lib_phone) {
this.lib_phone = lib_phone;
}
public String getLib_type() {
return lib_type;
}
public void setLib_type(String lib_type) {
this.lib_type = lib_type;
}
public String getLib_username() {
return lib_username;
}
public void setLib_username(String lib_username) {
this.lib_username = lib_username;
}
public String getLib_password() {
return lib_password;
}
public void setLib_password(String lib_password) {
this.lib_password = lib_password;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getLng() {
return lng;
}
public void setLng(String lng) {
this.lng = lng;
}
public String getUser_token() {
return user_token;
}
public void setUser_token(String user_token) {
this.user_token = user_token;
}
public int getSuccess() {
return success;
}*/
}
|
[
"emadmagdi.151995@gmai.com"
] |
emadmagdi.151995@gmai.com
|
69f34ac481966189a36541cf1c49468c5f587e29
|
8b46b9c92e7b35919618b0696b3657ee13010945
|
/src/main/java/org/codelibs/fione/h2o/bindings/pojos/IOEvent.java
|
540f6e05ec58c6a41315b3d723065dfd4fd6c23d
|
[
"Apache-2.0"
] |
permissive
|
fireae/fione
|
837bebc22f7b7d42ed3079ff212eaf17cbcfebc6
|
b26f74d2fff6b9c34f64446503dd45edf0716ed8
|
refs/heads/master
| 2021-03-11T05:02:53.309517
| 2020-03-09T20:49:31
| 2020-03-09T20:49:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,056
|
java
|
/*
* Copyright 2012-2020 CodeLibs Project and the Others.
*
* 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.codelibs.fione.h2o.bindings.pojos;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.SerializedName;
public class IOEvent extends EventV3 {
/**
* flavor of the recorded io (ice/hdfs/...)
*/
@SerializedName("io_flavor")
public String ioFlavor;
/**
* node where this io event happened
*/
public String node;
/**
* data info
*/
public String data;
/*------------------------------------------------------------------------------------------------------------------
// INHERITED
//------------------------------------------------------------------------------------------------------------------
// Time when the event was recorded. Format is hh:mm:ss:ms
public String date;
// Time in nanos
public long nanos;
// type of recorded event
public TimelineEventEventType type;
*/
/**
* Public constructor
*/
public IOEvent() {
ioFlavor = "unknown";
node = "unknown";
data = "unknown";
date = "23:59:59:999";
nanos = -1L;
type = TimelineEventEventType.io;
}
/**
* Return the contents of this object as a JSON String.
*/
@Override
public String toString() {
return new GsonBuilder().serializeSpecialFloatingPointValues().create().toJson(this);
}
}
|
[
"shinsuke@apache.org"
] |
shinsuke@apache.org
|
d135249864f9b06bdb05efb5cae5f0b950a73dba
|
9358184d4b9c44d3326a25b75e3dc6d4a1d01b77
|
/blog-comment/src/main/java/xyz/yuzh/spring/boot/blog/service/BlogServiceImpl.java
|
98316f2bf4bf9a7c613ca0c9bff26f7b0fbda8c7
|
[] |
no_license
|
yuzh233/spring-boot-blog
|
ab56dc0024e7dbe178012fce77be82d1eccbe7d3
|
7b52a91ae688633d1add7e5b232855aa1d60a34f
|
refs/heads/master
| 2020-03-29T19:49:21.066714
| 2018-11-04T14:18:54
| 2018-11-04T14:18:54
| 150,282,534
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,423
|
java
|
package xyz.yuzh.spring.boot.blog.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import xyz.yuzh.spring.boot.blog.domain.Blog;
import xyz.yuzh.spring.boot.blog.domain.Comment;
import xyz.yuzh.spring.boot.blog.domain.User;
import xyz.yuzh.spring.boot.blog.domain.Vote;
import xyz.yuzh.spring.boot.blog.repository.BlogRepository;
import javax.transaction.Transactional;
/**
* @author yu.zh [yuzh233@gmail.com]
* @date 2018/10/25
*/
@Service
public class BlogServiceImpl implements BlogService {
@Autowired
private BlogRepository blogRepository;
@Transactional
@Override
public Blog saveBlog(Blog blog) {
return blogRepository.save(blog);
}
@Transactional
@Override
public void removeBlog(Long id) {
blogRepository.delete(id);
}
@Transactional
@Override
public Blog updateBlog(Blog blog) {
return blogRepository.save(blog);
}
@Override
public Blog getBlogById(Long id) {
return blogRepository.findOne(id);
}
@Override
public Page<Blog> listBlogsByTitleLike(User user, String title, Pageable pageable) {
// 模糊查询
title = "%" + title + "%";
Page<Blog> blogs = blogRepository.findByUserAndTitleLikeOrderByCreateTimeDesc(user, title, pageable);
return blogs;
}
@Override
public Page<Blog> listBlogsByTitleLikeAndSort(User user, String title, Pageable pageable) {
// 模糊查询
title = "%" + title + "%";
Page<Blog> blogs = blogRepository.findByUserAndTitleLike(user, title, pageable);
return blogs;
}
@Override
public void readingIncrease(Long id) {
Blog blog = blogRepository.findOne(id);
blog.setReadSize(blog.getReadSize() + 1);
blogRepository.save(blog);
}
/******** 评论管理 *********/
@Override
public Blog createComment(Long blogId, String commentContent) {
Blog originalBlog = blogRepository.findOne(blogId);
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
Comment comment = new Comment(user, commentContent);
originalBlog.addComment(comment);
return blogRepository.save(originalBlog);
}
@Override
public void removeComment(Long blogId, Long commentId) {
Blog originalBlog = blogRepository.findOne(blogId);
originalBlog.removeComment(commentId);
blogRepository.save(originalBlog);
}
/******** 点赞管理 *********/
@Override
public Blog createVote(Long blogId) {
Blog originalBlog = blogRepository.findOne(blogId);
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
Vote vote = new Vote(user);
boolean isExist = originalBlog.addVote(vote);
if (isExist) {
throw new IllegalArgumentException("已顶~");
}
return blogRepository.save(originalBlog);
}
@Override
public void removeVote(Long blogId, Long voteId) {
Blog originalBlog = blogRepository.findOne(blogId);
originalBlog.removeVote(voteId);
blogRepository.save(originalBlog);
}
}
|
[
"yuzh233@gmail.com"
] |
yuzh233@gmail.com
|
fff3f0ada7afb9ced358caaf571df531294c0e13
|
2bc2eadc9b0f70d6d1286ef474902466988a880f
|
/tags/mule-1.3/mule/tests/core/src/test/java/org/mule/test/routing/outbound/StaticRecipientListRouterTestCase.java
|
a20242197f3004d2fd8719738079bf0cf53f84c0
|
[] |
no_license
|
OrgSmells/codehaus-mule-git
|
085434a4b7781a5def2b9b4e37396081eaeba394
|
f8584627c7acb13efdf3276396015439ea6a0721
|
refs/heads/master
| 2022-12-24T07:33:30.190368
| 2020-02-27T19:10:29
| 2020-02-27T19:10:29
| 243,593,543
| 0
| 0
| null | 2022-12-15T23:30:00
| 2020-02-27T18:56:48
| null |
UTF-8
|
Java
| false
| false
| 4,203
|
java
|
/*
* $Id: StaticRecipientListRouterTestCase.java 2656 2006-08-10 02:35:05 +0000 (Thu, 10 Aug 2006) holger $
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
*
* The software in this package is published under the terms of the MuleSource MPL
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.test.routing.outbound;
import com.mockobjects.dynamic.C;
import com.mockobjects.dynamic.Mock;
import org.mule.impl.MuleMessage;
import org.mule.routing.outbound.StaticRecipientList;
import org.mule.tck.AbstractMuleTestCase;
import org.mule.tck.MuleTestUtils;
import org.mule.umo.UMOMessage;
import org.mule.umo.UMOSession;
import org.mule.umo.endpoint.UMOEndpoint;
import org.mule.umo.routing.RoutingException;
import java.util.ArrayList;
import java.util.List;
/**
* @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
* @version $Revision: 2656 $
*/
public class StaticRecipientListRouterTestCase extends AbstractMuleTestCase
{
public void testRecipientListRouter() throws Exception
{
Mock session = MuleTestUtils.getMockSession();
UMOEndpoint endpoint1 = getTestEndpoint("Test1Provider", UMOEndpoint.ENDPOINT_TYPE_SENDER);
assertNotNull(endpoint1);
List recipients = new ArrayList();
recipients.add("test://recipient1");
recipients.add("test://recipient2");
StaticRecipientList router = new StaticRecipientList();
router.setRecipients(recipients);
List endpoints = new ArrayList();
endpoints.add(endpoint1);
router.setEndpoints(endpoints);
assertEquals(2, router.getRecipients().size());
UMOMessage message = new MuleMessage("test event");
assertTrue(router.isMatch(message));
// note this router clones endpoints so that the endpointUri can be
// changed
//The static recipient list router duplicates the message for each endpoint so we can't
//check for equality on the arguments passed to the dispatch / send methods
session.expect("dispatchEvent", C.args(C.isA(UMOMessage.class), C.isA(UMOEndpoint.class)));
session.expect("dispatchEvent", C.args(C.isA(UMOMessage.class), C.isA(UMOEndpoint.class)));
router.route(message, (UMOSession) session.proxy(), false);
session.verify();
message = new MuleMessage("test event");
router.getRecipients().add("test://recipient3");
session.expectAndReturn("sendEvent", C.args(C.isA(UMOMessage.class), C.isA(UMOEndpoint.class)), message);
session.expectAndReturn("sendEvent", C.args(C.isA(UMOMessage.class), C.isA(UMOEndpoint.class)), message);
session.expectAndReturn("sendEvent", C.args(C.isA(UMOMessage.class), C.isA(UMOEndpoint.class)), message);
UMOMessage result = router.route(message, (UMOSession) session.proxy(), true);
assertNotNull(result);
assertTrue(result.getPayload() instanceof List);
assertEquals(3, ((List) result.getPayload()).size());
session.verify();
}
public void testBadRecipientListRouter() throws Exception
{
Mock session = MuleTestUtils.getMockSession();
UMOEndpoint endpoint1 = getTestEndpoint("Test1Provider", UMOEndpoint.ENDPOINT_TYPE_SENDER);
assertNotNull(endpoint1);
List recipients = new ArrayList();
recipients.add("malformed-endpointUri-recipient1");
StaticRecipientList router = new StaticRecipientList();
router.setRecipients(recipients);
List endpoints = new ArrayList();
endpoints.add(endpoint1);
router.setEndpoints(endpoints);
assertEquals(1, router.getRecipients().size());
UMOMessage message = new MuleMessage("test event");
assertTrue(router.isMatch(message));
try {
router.route(message, (UMOSession) session.proxy(), false);
fail("Should not allow malformed endpointUri");
} catch (RoutingException e) {
// ignore
}
session.verify();
}
}
|
[
"tcarlson@bf997673-6b11-0410-b953-e057580c5b09"
] |
tcarlson@bf997673-6b11-0410-b953-e057580c5b09
|
942751a6c4ffd8d60a9571d9bd4749a557bee2c0
|
f7f9d7fa841e856927e02513ecc74dc00c935f8a
|
/libs/core/src/test/java/org/codelibs/fesen/core/CharArraysTests.java
|
5138b8940e0f44d00da6e5f53ddadd00b1534c2e
|
[
"CDDL-1.0",
"MIT",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"NAIST-2003",
"LicenseRef-scancode-generic-export-compliance",
"ICU",
"SunPro",
"Python-2.0",
"CC-BY-SA-3.0",
"MPL-1.1",
"GPL-2.0-only",
"CPL-1.0",
"LicenseRef-scancode-other-copyleft",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"CC-PDDC",
"BSD-2-Clause",
"LicenseRef-scancode-unicode-mappings",
"LicenseRef-scancode-unicode",
"CC0-1.0",
"Apache-1.1",
"EPL-1.0",
"Classpath-exception-2.0"
] |
permissive
|
codelibs/fesen
|
3f949fd3533e8b25afc3d3475010d1b1a0d95c09
|
b2440fbda02e32f7abe77d2be95ead6a16c8af06
|
refs/heads/main
| 2022-07-27T21:14:02.455938
| 2021-12-21T23:54:20
| 2021-12-21T23:54:20
| 330,334,670
| 4
| 0
|
Apache-2.0
| 2022-05-17T01:54:31
| 2021-01-17T07:07:56
|
Java
|
UTF-8
|
Java
| false
| false
| 4,338
|
java
|
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.codelibs.fesen.core;
import java.nio.charset.StandardCharsets;
import org.codelibs.fesen.core.CharArrays;
import org.codelibs.fesen.test.ESTestCase;
import static org.hamcrest.Matchers.is;
public class CharArraysTests extends ESTestCase {
public void testCharsToBytes() {
final String originalValue = randomUnicodeOfCodepointLengthBetween(0, 32);
final byte[] expectedBytes = originalValue.getBytes(StandardCharsets.UTF_8);
final char[] valueChars = originalValue.toCharArray();
final byte[] convertedBytes = CharArrays.toUtf8Bytes(valueChars);
assertArrayEquals(expectedBytes, convertedBytes);
}
public void testBytesToUtf8Chars() {
final String originalValue = randomUnicodeOfCodepointLengthBetween(0, 32);
final byte[] bytes = originalValue.getBytes(StandardCharsets.UTF_8);
final char[] expectedChars = originalValue.toCharArray();
final char[] convertedChars = CharArrays.utf8BytesToChars(bytes);
assertArrayEquals(expectedChars, convertedChars);
}
public void testCharsBeginsWith() {
assertFalse(CharArrays.charsBeginsWith(randomAlphaOfLength(4), null));
assertFalse(CharArrays.charsBeginsWith(null, null));
assertFalse(CharArrays.charsBeginsWith(null, randomAlphaOfLength(4).toCharArray()));
final String undesiredPrefix = randomAlphaOfLength(2);
assertFalse(CharArrays.charsBeginsWith(undesiredPrefix, randomAlphaOfLengthNotBeginningWith(undesiredPrefix, 3, 8)));
final String prefix = randomAlphaOfLengthBetween(2, 4);
assertTrue(CharArrays.charsBeginsWith(prefix, prefix.toCharArray()));
final char[] prefixedValue = prefix.concat(randomAlphaOfLengthBetween(1, 12)).toCharArray();
assertTrue(CharArrays.charsBeginsWith(prefix, prefixedValue));
final String modifiedPrefix = randomBoolean() ? prefix.substring(1) : prefix.substring(0, prefix.length() - 1);
char[] nonMatchingValue;
do {
nonMatchingValue = modifiedPrefix.concat(randomAlphaOfLengthBetween(0, 12)).toCharArray();
} while (new String(nonMatchingValue).startsWith(prefix));
assertFalse(CharArrays.charsBeginsWith(prefix, nonMatchingValue));
assertTrue(CharArrays.charsBeginsWith(modifiedPrefix, nonMatchingValue));
}
public void testConstantTimeEquals() {
final String value = randomAlphaOfLengthBetween(0, 32);
assertTrue(CharArrays.constantTimeEquals(value, value));
assertTrue(CharArrays.constantTimeEquals(value.toCharArray(), value.toCharArray()));
// we want a different string, so ensure the first character is different, but the same overall length
final int length = value.length();
final String other = length > 0 ? new String(randomAlphaOfLengthNotBeginningWith(value.substring(0, 1), length, length)) : "";
final boolean expectedEquals = length == 0;
assertThat("value: " + value + ", other: " + other, CharArrays.constantTimeEquals(value, other), is(expectedEquals));
assertThat(CharArrays.constantTimeEquals(value.toCharArray(), other.toCharArray()), is(expectedEquals));
}
private char[] randomAlphaOfLengthNotBeginningWith(String undesiredPrefix, int min, int max) {
char[] nonMatchingValue;
do {
nonMatchingValue = randomAlphaOfLengthBetween(min, max).toCharArray();
} while (new String(nonMatchingValue).startsWith(undesiredPrefix));
return nonMatchingValue;
}
}
|
[
"shinsuke@apache.org"
] |
shinsuke@apache.org
|
2aad28b96baa0650c6b0de470f4e301a5e97ff14
|
12271cdd522f6526ce940a147e4d1c5c7e2a17a4
|
/src/java/xAOG.java
|
4cd5c10da748af08b4b1392f9c2de37cc3bd5b60
|
[] |
no_license
|
arjunakula/Explainable-AI-Interface-for-Videos
|
3ba06d87f0bfc9e057515c01a129d0493a0c7e84
|
60cf794d9489284f087ca190660cc9ebd55310c2
|
refs/heads/master
| 2020-05-02T09:22:40.614681
| 2019-03-26T21:37:13
| 2019-03-26T21:37:13
| 177,870,142
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 822
|
java
|
package edu.ucla.xai.parser;
public class xAOG {
int turnId;
String explanationType;
String focusEntityName;
String focusEntityNeo4jID;
public int getTurnId() {
return turnId;
}
public void setTurnId(int turnId) {
this.turnId = turnId;
}
public String getExplanationType() {
return explanationType;
}
public void setExplanationType(String explanationType) {
this.explanationType = explanationType;
}
public String getFocusEntityName() {
return focusEntityName;
}
public void setFocusEntityName(String focusEntityName) {
this.focusEntityName = focusEntityName;
}
public String getFocusEntityNeo4jID() {
return focusEntityNeo4jID;
}
public void setFocusEntityNeo4jID(String focusEntityNeo4jID) {
this.focusEntityNeo4jID = focusEntityNeo4jID;
}
}
|
[
"akula.arjun@gmail.com"
] |
akula.arjun@gmail.com
|
318d50f7846db4994a2ea8e21b69303dc179a5b3
|
b00c54389a95d81a22e361fa9f8bdf5a2edc93e3
|
/external/droiddriver/src/com/google/android/droiddriver/Poller.java
|
548f1ade8f61194750572c10ea4af74d00d96524
|
[] |
no_license
|
mirek190/x86-android-5.0
|
9d1756fa7ff2f423887aa22694bd737eb634ef23
|
eb1029956682072bb7404192a80214189f0dc73b
|
refs/heads/master
| 2020-05-27T01:09:51.830208
| 2015-10-07T22:47:36
| 2015-10-07T22:47:36
| 41,942,802
| 15
| 20
| null | 2020-03-09T00:21:03
| 2015-09-05T00:11:19
| null |
UTF-8
|
Java
| false
| false
| 4,636
|
java
|
/*
* Copyright (C) 2013 DroidDriver committers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.droiddriver;
import com.google.android.droiddriver.exceptions.ElementNotFoundException;
import com.google.android.droiddriver.finders.Finder;
/**
* Interface for polling mechanism.
*/
public interface Poller {
/**
* Interface for a callback to be invoked when {@link #pollFor} times out.
*/
interface TimeoutListener {
/**
* Called when {@link #pollFor} times out. Should return quickly (no
* polling).
*/
void onTimeout(DroidDriver driver, Finder finder);
}
/**
* Interface for a callback to be invoked when {@link #pollFor} polls.
*/
interface PollingListener {
/**
* Called when {@link #pollFor} polls. Should return quickly (no polling).
*/
void onPolling(DroidDriver driver, Finder finder);
}
/**
* Interface for removing a listener.
*/
interface ListenerRemover {
/**
* A ListenerRemover that does nothing. Can be used as initial value for
* ListenerRemovers.
*/
ListenerRemover NOP_LISTENER_REMOVER = new ListenerRemover() {
@Override
public void remove() {}
};
/**
* Removes the associated listener.
*/
void remove();
}
/**
* Used by Poller to check conditions.
*
* @param <T> type of the value returned by {@link #check}
*/
interface ConditionChecker<T> {
/**
* Checks condition that overriding methods provide.
*
* @throws UnsatisfiedConditionException If the condition is not met
*/
T check(DroidDriver driver, Finder finder) throws UnsatisfiedConditionException;
}
/** Thrown to indicate condition not met. Used in {@link ConditionChecker}. */
@SuppressWarnings("serial")
class UnsatisfiedConditionException extends Exception {
}
/**
* A ConditionChecker that returns the matching {@link UiElement}.
*/
ConditionChecker<UiElement> EXISTS = new ConditionChecker<UiElement>() {
@Override
public UiElement check(DroidDriver driver, Finder finder) throws UnsatisfiedConditionException {
try {
return driver.find(finder);
} catch (ElementNotFoundException e) {
throw new UnsatisfiedConditionException();
}
}
@Override
public String toString() {
return "to appear";
}
};
/**
* A ConditionChecker that does not throw only if the matching
* {@link UiElement} is gone.
*/
ConditionChecker<Void> GONE = new ConditionChecker<Void>() {
@Override
public Void check(DroidDriver driver, Finder finder) throws UnsatisfiedConditionException {
try {
// "find" does not call refreshUiElementTree, while "has" calls
driver.find(finder);
throw new UnsatisfiedConditionException();
} catch (ElementNotFoundException enfe) {
return null;
}
}
@Override
public String toString() {
return "to disappear";
}
};
/**
* Polls until {@code checker} does not throw
* {@link UnsatisfiedConditionException}, up to the default timeout.
*
* @return An object of type T returned by {@code checker}
*/
<T> T pollFor(DroidDriver driver, Finder finder, ConditionChecker<T> checker);
/**
* Polls until {@code checker} does not throw
* {@link UnsatisfiedConditionException}, up to {@code timeoutMillis}.
*
* @return An object of type T returned by {@code checker}
*/
<T> T pollFor(DroidDriver driver, Finder finder, ConditionChecker<T> checker, long timeoutMillis);
/**
* Adds a {@link TimeoutListener}.
*/
ListenerRemover addListener(TimeoutListener timeoutListener);
/**
* Adds a {@link PollingListener}.
*/
ListenerRemover addListener(PollingListener pollingListener);
/**
* Sets default timeoutMillis.
*/
void setTimeoutMillis(long timeoutMillis);
/**
* @return default timeoutMillis
*/
long getTimeoutMillis();
/**
* Sets intervalMillis.
*/
void setIntervalMillis(long intervalMillis);
/**
* @return intervalMillis
*/
long getIntervalMillis();
}
|
[
"mirek190@gmail.com"
] |
mirek190@gmail.com
|
181b5bcf330c8745edacb06617afb4bca3d16f18
|
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
|
/SQuirrel_SQL/rev5082-5351/base-branch-5082/test/src/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPreferencesTest.java
|
d2af3105552f8236425aea6baf5b8391f156bbbb
|
[] |
no_license
|
joliebig/featurehouse_fstmerge_examples
|
af1b963537839d13e834f829cf51f8ad5e6ffe76
|
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
|
refs/heads/master
| 2016-09-05T10:24:50.974902
| 2013-03-28T16:28:47
| 2013-03-28T16:28:47
| 9,080,611
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,601
|
java
|
package net.sourceforge.squirrel_sql.plugins.syntax;
import static org.junit.Assert.assertEquals;
import net.sourceforge.squirrel_sql.AbstractSerializableTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class SyntaxPreferencesTest extends AbstractSerializableTest {
SyntaxPreferences classUnderTest = new SyntaxPreferences();
SyntaxStyle testStyle = new SyntaxStyle();
@Before
public void setUp() {
super.serializableToTest = new SyntaxPreferences();
}
@After
public void tearDown() {
super.serializableToTest = null;
}
@Test
public void testGetUseOsterTextControl() throws Exception
{
classUnderTest.setUseOsterTextControl(true);
assertEquals(true, classUnderTest.getUseOsterTextControl());
}
@Test
public void testGetUseNetbeansTextControl() throws Exception
{
classUnderTest.setUseNetbeansTextControl(true);
assertEquals(true, classUnderTest.getUseNetbeansTextControl());
}
@Test
public void testGetUsePlainTextControl() throws Exception
{
classUnderTest.setUsePlainTextControl(true);
assertEquals(true, classUnderTest.getUsePlainTextControl());
}
@Test
public void testIsTextLimitLineVisible() throws Exception
{
classUnderTest.setTextLimitLineVisible(true);
assertEquals(true, classUnderTest.isTextLimitLineVisible());
}
@Test
public void testGetTextLimitLineWidth() throws Exception
{
classUnderTest.setTextLimitLineWidth(10);
assertEquals(10, classUnderTest.getTextLimitLineWidth());
}
@Test
public void testGetCommentStyle() throws Exception
{
classUnderTest.setCommentStyle(testStyle);
assertEquals(testStyle, classUnderTest.getCommentStyle());
}
@Test
public void testGetDataTypeStyle() throws Exception
{
classUnderTest.setDataTypeStyle(testStyle);
assertEquals(testStyle, classUnderTest.getDataTypeStyle());
}
@Test
public void testGetErrorStyle() throws Exception
{
classUnderTest.setErrorStyle(testStyle);
assertEquals(testStyle, classUnderTest.getErrorStyle());
}
@Test
public void testGetFunctionStyle() throws Exception
{
classUnderTest.setFunctionStyle(testStyle);
assertEquals(testStyle, classUnderTest.getFunctionStyle());
}
@Test
public void testGetIdentifierStyle() throws Exception
{
classUnderTest.setIdentifierStyle(testStyle);
assertEquals(testStyle, classUnderTest.getIdentifierStyle());
}
@Test
public void testGetLiteralStyle() throws Exception
{
classUnderTest.setLiteralStyle(testStyle);
assertEquals(testStyle, classUnderTest.getLiteralStyle());
}
@Test
public void testGetTableStyle() throws Exception
{
classUnderTest.setTableStyle(testStyle);
assertEquals(testStyle, classUnderTest.getTableStyle());
}
@Test
public void testGetColumnStyle() throws Exception
{
classUnderTest.setColumnStyle(testStyle);
assertEquals(testStyle, classUnderTest.getColumnStyle());
}
@Test
public void testGetOperatorStyle() throws Exception
{
classUnderTest.setOperatorStyle(testStyle);
assertEquals(testStyle, classUnderTest.getOperatorStyle());
}
@Test
public void testGetReservedWordStyle() throws Exception
{
classUnderTest.setReservedWordStyle(testStyle);
assertEquals(testStyle, classUnderTest.getReservedWordStyle());
}
@Test
public void testGetSeparatorStyle() throws Exception
{
classUnderTest.setSeparatorStyle(testStyle);
assertEquals(testStyle, classUnderTest.getSeparatorStyle());
}
@Test
public void testGetWhiteSpaceStyle() throws Exception
{
classUnderTest.setWhiteSpaceStyle(testStyle);
assertEquals(testStyle, classUnderTest.getWhiteSpaceStyle());
}
}
|
[
"joliebig@fim.uni-passau.de"
] |
joliebig@fim.uni-passau.de
|
e672803c733709980b25d304c25f06c446a21984
|
c67b82cc356f9d81a595ac3ffd7a3165d966e30a
|
/src/test/java/com/aparapi/codegen/test/CharAsParameter.java
|
1685d49eb8a0e31d7df592dee2c1a89f66374a27
|
[
"Apache-2.0"
] |
permissive
|
Gleethos/aparapi
|
2912c6f91214773b81152137cab2e4386457ed1c
|
a07b107d3a93d3db13c43410b43bff9954a9fb45
|
refs/heads/master
| 2020-07-25T14:48:31.477171
| 2019-08-22T16:31:53
| 2019-08-22T16:31:53
| 208,328,376
| 2
| 0
|
Apache-2.0
| 2019-09-13T18:59:20
| 2019-09-13T18:59:20
| null |
UTF-8
|
Java
| false
| false
| 1,323
|
java
|
/**
* Copyright (c) 2016 - 2018 Syncleus, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aparapi.codegen.test;
public class CharAsParameter {
public char doIt(char x) {
return x;
}
public void run() {
byte b = 0x1;
doIt('A');
doIt((char) b);
}
}
/**{OpenCL{
typedef struct This_s{
int passid;
}This;
int get_pass_id(This *this){
return this->passid;
}
unsigned short com_amd_aparapi_test_CharAsParameter__doIt(This *this, unsigned short x){
return(x);
}
__kernel void run(
int passid
){
This thisStruct;
This* this=&thisStruct;
this->passid = passid;
{
char b = 1;
com_amd_aparapi_test_CharAsParameter__doIt(this, 65);
com_amd_aparapi_test_CharAsParameter__doIt(this, (unsigned short )b);
return;
}
}
}OpenCL}**/
|
[
"jeffrey.freeman@syncleus.com"
] |
jeffrey.freeman@syncleus.com
|
51fd7cb8a068629dd47a8d63edff9a4a0aeda3d4
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_cdbeefa533fcfc7d4796f7d7587549e22b0e31ca/AbstractPropertyReader/2_cdbeefa533fcfc7d4796f7d7587549e22b0e31ca_AbstractPropertyReader_t.java
|
ada93074abf17522695593c7ac7a604f5780b573
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 3,440
|
java
|
/*
* $Id$
*
* Copyright 2004 Wanadoo Nederland B.V.
* See the COPYRIGHT file for redistribution and use restrictions.
*/
package org.xins.common.collections;
import java.util.Iterator;
import java.util.Map;
import org.xins.common.MandatoryArgumentChecker;
/**
* Base for <code>PropertyReader</code> implementations that use an underlying
* <code>Map</code> instance.
*
* @version $Revision$ $Date$
* @author Ernst de Haan (<a href="mailto:ernst.dehaan@nl.wanadoo.com">ernst.dehaan@nl.wanadoo.com</a>)
* @author Anthony Goubard (<a href="mailto:anthony.goubard@nl.wanadoo.com">anthony.goubard@nl.wanadoo.com</a>)
*
* @since XINS 1.0.0
*/
public abstract class AbstractPropertyReader
implements PropertyReader {
//-------------------------------------------------------------------------
// Class fields
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Class functions
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Constructors
//-------------------------------------------------------------------------
/**
* Constructs a new <code>AbstractPropertyReader</code>.
*
* @param map
* the map containing the data of this <code>PropertyReader</code>,
* cannot be <code>null</code>.
*/
public AbstractPropertyReader(Map map) {
_properties = map;
}
//-------------------------------------------------------------------------
// Fields
//-------------------------------------------------------------------------
/**
* The mappings from property keys to values.
*/
private final Map _properties;
//-------------------------------------------------------------------------
// Methods
//-------------------------------------------------------------------------
/**
* Gets the value of the property with the specified name.
*
* @param name
* the name of the property, cannot be <code>null</code>.
*
* @return
* the value of the property, or <code>null</code> if it is not set.
*
* @throws IllegalArgumentException
* if <code>name == null</code>.
*/
public String get(String name) throws IllegalArgumentException {
MandatoryArgumentChecker.check("name", name);
Object value = _properties.get(name);
return (String) value;
}
/**
* Gets an iterator that iterates over all the property names. The
* {@link Iterator} will return only {@link String} instances.
*
* @return
* the {@link Iterator} that will iterate over all the names, never
* <code>null</code>.
*/
public Iterator getNames() {
return _properties.keySet().iterator();
}
/**
* Returns the number of entries.
*
* @return
* the size, always >= 0.
*/
public int size() {
return _properties.size();
}
/**
* Returns the <code>Map</code> that contains the properties.
*
* @return
* the {@link Map} used to store the properties in, cannot be
* <code>null</code>.
*/
protected Map getPropertiesMap() {
return _properties;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
494a3a8f0ae56e470b48528e84796cbd6d9e915b
|
59ae3a253219275f9535cc4c8647633ef0887aaf
|
/Extra Credit/Extra Credit/advCS_indstudy/slides_and_javacode/07.exceptions/ExceptionThree.java
|
9bf502274079626865254333d13603bd953a4d20
|
[] |
no_license
|
tfbninja/APCS_Extra_Credit
|
1c8799cd8d84ab445572987963d562dddbf90168
|
c7b0d220da840d379bf57f4509a3b43798a7e2ee
|
refs/heads/master
| 2020-05-18T02:50:42.559036
| 2019-04-30T19:02:59
| 2019-04-30T19:02:59
| 184,128,471
| 0
| 0
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 272
|
java
|
//© A+ Computer Science
// www.apluscompsci.com
//exception example 3
public class ExceptionThree
{
public static void main(String args[])
{
int num=32;
if(num==32)
throw new RuntimeException("num==32");
//RunTimeException is not a checked Excpetion
}
}
|
[
"tfbninja@users.noreply.github.com"
] |
tfbninja@users.noreply.github.com
|
3385726da2c2d8f5112e49f6bbf42c8a4a78f1b3
|
e010f83b9d383a958fc73654162758bda61f8290
|
/src/main/java/com/alipay/api/response/AlipayOpenMiniVersionUploadResponse.java
|
1101e3852234bba2468b88ea2c339b4fb8bce107
|
[
"Apache-2.0"
] |
permissive
|
10088/alipay-sdk-java
|
3a7984dc591eaf196576e55e3ed657a88af525a6
|
e82aeac7d0239330ee173c7e393596e51e41c1cd
|
refs/heads/master
| 2022-01-03T15:52:58.509790
| 2018-04-03T15:50:35
| 2018-04-03T15:50:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,614
|
java
|
package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.open.mini.version.upload response.
*
* @author auto create
* @since 1.0, 2018-03-14 14:01:35
*/
public class AlipayOpenMiniVersionUploadResponse extends AlipayResponse {
private static final long serialVersionUID = 7854735746998451477L;
/**
* 构建的状态,0-构建排队中;1-正在构建;2-构建成功;3-构建失败;5-构建超时
*/
@ApiField("build_status")
private String buildStatus;
/**
* 创建版本的状态,0-构建排队中;1-正在构建;2-构建成功;3-构建失败;5-构建超时;6-版本创建成功
*/
@ApiField("create_status")
private String createStatus;
/**
* 是否需要轮询
*/
@ApiField("need_rotation")
private String needRotation;
/**
* 是否创建了版本
*/
@ApiField("version_created")
private String versionCreated;
public void setBuildStatus(String buildStatus) {
this.buildStatus = buildStatus;
}
public String getBuildStatus( ) {
return this.buildStatus;
}
public void setCreateStatus(String createStatus) {
this.createStatus = createStatus;
}
public String getCreateStatus( ) {
return this.createStatus;
}
public void setNeedRotation(String needRotation) {
this.needRotation = needRotation;
}
public String getNeedRotation( ) {
return this.needRotation;
}
public void setVersionCreated(String versionCreated) {
this.versionCreated = versionCreated;
}
public String getVersionCreated( ) {
return this.versionCreated;
}
}
|
[
"liuqun.lq@alibaba-inc.com"
] |
liuqun.lq@alibaba-inc.com
|
94308cbdd132deda85c319d8029a6e67d4124268
|
73ddf37cb32504a6f504fe7bff8ef7842b15550a
|
/src/test/java/com/alibaba/druid/bvt/sql/postgresql/PGInsertTest10.java
|
b2e9990ce67aa7fd3e6d35f3ef696d097f5ed5ef
|
[
"Apache-2.0"
] |
permissive
|
onlyscorpion/scorpion-sql-parser
|
2c0ecd4758d5bc5e6f1a50e0fadcfcb012e3524f
|
a55f9597c7a3a8b9c610cacc5a957a41d3ea018a
|
refs/heads/master
| 2021-08-19T14:15:55.462593
| 2017-11-26T15:47:17
| 2017-11-26T15:47:17
| 112,094,653
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,142
|
java
|
/*
* Copyright 1999-2017 Alibaba Group Holding Ltd.
*
* 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.alibaba.druid.bvt.sql.postgresql;
import com.alibaba.druid.sql.PGTest;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.postgresql.parser.PGSQLStatementParser;
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGSchemaStatVisitor;
import com.alibaba.druid.stat.TableStat;
import java.util.List;
public class PGInsertTest10 extends PGTest {
public void test_0() throws Exception {
String sql = "INSERT INTO test VALUES (B'101', B'00');";
PGSQLStatementParser parser = new PGSQLStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
SQLStatement stmt = statementList.get(0);
// print(statementList);
assertEquals(1, statementList.size());
PGSchemaStatVisitor visitor = new PGSchemaStatVisitor();
stmt.accept(visitor);
System.out.println("Tables : " + visitor.getTables());
System.out.println("fields : " + visitor.getColumns());
// System.out.println("coditions : " + visitor.getConditions());
assertTrue(visitor.getTables().containsKey(new TableStat.Name("test")));
assertEquals(0, visitor.getColumns().size());
//
// assertTrue(visitor.getColumns().contains(new TableStat.Column("distributors", "did")));
// assertTrue(visitor.getColumns().contains(new TableStat.Column("distributors", "dname")));
assertEquals("INSERT INTO test\n" +
"VALUES (B'101', B'00');", stmt.toString());
}
}
|
[
"zhengchenglei@jd.com"
] |
zhengchenglei@jd.com
|
20410ba794dadc64e40e8c980cdfb698613a7a5f
|
a94bfc1fbf7cb150028300f7479358dc70804089
|
/Etomo/src/etomo/type/ParsedElement.java
|
cbacd8fa78a6c29bdfadb43535d7260634815be8
|
[] |
no_license
|
imod-mirror/IMOD
|
29f2a0d3f2c2156dc8624c917b9b36b3f23a38ec
|
499d656bc7784a23c9614380234511e5c758be4f
|
refs/heads/master
| 2021-01-02T08:47:39.133329
| 2015-08-25T06:42:46
| 2015-08-25T06:42:46
| 41,421,626
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,368
|
java
|
package etomo.type;
import java.io.IOException;
import etomo.storage.LogFile;
import etomo.ui.swing.Token;
import etomo.util.PrimativeTokenizer;
/**
* <p>Description: </p>
*
* <p>Copyright: Copyright 2006</p>
*
* <p>Organization:
* Boulder Laboratory for 3-Dimensional Electron Microscopy of Cells (BL3DEMC),
* University of Colorado</p>
*
* @author $Author$
*
* @version $Revision$
*
* <p> $Log$
* <p> Revision 1.15 2009/02/04 23:30:30 sueh
* <p> bug# 1158 Changed id and exception classes in LogFile.
* <p>
* <p> Revision 1.14 2008/09/10 21:06:34 sueh
* <p> bug# 1135 Check for null when calling ParsedElementList.get(int). Check
* <p> for null when calling ParsedElement.getElement or getRawNumber.
* <p> arsedElementList will no longer create an empty element, so null returns
* <p> will happen. Remove all the array size functionality because the array descriptor will not automatically be padded out to three.
* <p>
* <p> Revision 1.13 2008/04/15 21:23:32 sueh
* <p> bug# 1105 Simplified setting the default. Move setDebug() to child
* <p> classes.
* <p>
* <p> Revision 1.12 2008/04/08 23:58:03 sueh
* <p> bug# 1105 Changed the array used in getParsedNumberExpandedArray
* <p> to a ParsedElementList because it always holds ParsedNumbers.
* <p>
* <p> Revision 1.11 2008/04/02 02:17:49 sueh
* <p> bug# 1097 Matching Matlab's syntax. This simplifies many of the
* <p> ParsedElement classes because there where too many special cases.
* <p> Now it just follows Matlab's syntax instead of trying to immitate exactly
* <p> how a field happened to be entered by hand in the .prm file.
* <p>
* <p> Revision 1.10 2007/11/06 19:48:05 sueh
* <p> bug# 1047 Made class compatible with ParsedIteratorDescriptor.
* <p>
* <p> Revision 1.9 2007/07/31 20:40:10 sueh
* <p> bug# 1028 added ge(int).
* <p>
* <p> Revision 1.8 2007/05/11 16:03:17 sueh
* <p> bug# 964 Added getArray(List), which adds itself to the list, if it is not
* <p> empty.
* <p>
* <p> Revision 1.7 2007/04/26 02:47:15 sueh
* <p> bug# 964 Fixed problems with defaultValue. Added ParsedArray.compact
* <p> when empty array elements should not be displayed (lstThresholds).
* <p>
* <p> Revision 1.6 2007/04/19 21:43:48 sueh
* <p> bug# 964 Added getRawString(int), moveElement(int, int), setRawString(int,
* <p> float), setRawString(int, String).
* <p>
* <p> Revision 1.5 2007/04/13 21:51:17 sueh
* <p> bug# 964 Not returning ConstEtomoNumber from ParsedElement, because it
* <p> must be returned with a getDefaulted... function to be accurate.
* <p> GetReferenceVolume is returning ParsedElement instead.
* <p>
* <p> Revision 1.4 2007/04/13 20:15:56 sueh
* <p> bug# 964 Added setRawString(String).
* <p>
* <p> Revision 1.3 2007/04/09 21:01:33 sueh
* <p> bug# 964 Placed createTokenizer(String) in the parent class, since it is used
* <p> everywhere.
* <p>
* <p> Revision 1.2 2007/03/31 02:54:34 sueh
* <p> bug# 964 Added isCollection().
* <p>
* <p> Revision 1.1 2007/03/30 23:42:20 sueh
* <p> bug# 964 Abstract class to act as an interface for elements stored in ParsedElementList.
* <p> </p>
*/
public abstract class ParsedElement {
public static final String rcsid = "$Id$";
private boolean failed = false;
private String failedMessage = null;
private boolean missingAttribute = false;
final String descr;
public abstract String getRawString();
public abstract String getRawString(int index);
public abstract void setDefault(int input);
public abstract void setDebug(boolean input);
public abstract boolean equals(int number);
abstract void setRawString(String number, int lineNum);
abstract ParsedElement getElement(int index);
abstract void setRawString(int index, double number);
abstract void setRawString(int index, String string, int lineNum);
abstract String validate(int lineNum);
abstract Token parse(Token token, PrimativeTokenizer tokenizer, int lineNum);
abstract int size();
abstract String getParsableString();
abstract boolean isCollection();
abstract boolean isDescriptor();
abstract void setDefault(EtomoNumber input);
abstract void removeElement(int index);
abstract boolean ge(int number);
abstract void clear();
public final void setRawString(String number) {
setRawString(number, 0);
}
public final void setRawString(int index, String string) {
setRawString(index, string, 0);
}
public final boolean isValid() {
return validate() == null;
}
public final String validate() {
return validate(0);
}
ParsedElement(final String descr) {
this.descr = descr;
}
/**
* Append non-null ParsedNumbers to parsedNumberExpandedArray. Create
* parsedNumberExpandedArray if parsedNumberExpandedArray == null.
* @param parsedNumberExpandedArray
* @return parsedNumberExpandedArray
*/
abstract ParsedElementList getParsedNumberExpandedArray(
ParsedElementList parsedNumberExpandedArray);
public boolean isEmpty() {
if (size() == 0) {
return true;
}
for (int i = 0; i < size(); i++) {
ParsedElement element = getElement(i);
if (element != null && !element.isEmpty()) {
return false;
}
}
return true;
}
public Number getRawNumber() {
ParsedElement element = getElement(0);
if (element != null) {
return element.getRawNumber();
}
return null;
}
boolean isDefaultedEmpty() {
if (size() == 0) {
return true;
}
for (int i = 0; i < size(); i++) {
ParsedElement element = getElement(i);
if (element != null && !element.isDefaultedEmpty()) {
return false;
}
}
return true;
}
final PrimativeTokenizer createTokenizer(final String value, final int lineNum) {
PrimativeTokenizer tokenizer = PrimativeTokenizer.getStringInstance(value, false);
try {
tokenizer.initialize();
}
catch (IOException e) {
e.printStackTrace();
fail(e.getMessage(), lineNum);
}
catch (LogFile.LockException e) {
e.printStackTrace();
fail(e.getMessage(), lineNum);
}
return tokenizer;
}
final void fail(final String message, final int lineNum) {
failed = true;
failedMessage = (descr != null ? descr : "") + ": " + message
+ (lineNum > 0 ? " Line# " + lineNum : "");
}
public final boolean isMissingAttribute() {
return missingAttribute;
}
final void setMissingAttribute() {
missingAttribute = true;
}
final void resetFailed() {
failed = false;
failedMessage = null;
}
final void setFailed(final boolean failed, final String failedMessage, final int lineNum) {
this.failed = failed;
if (failed) {
this.failedMessage = (descr != null ? descr : "") + ": " + failedMessage
+ (lineNum > 0 ? " Line# " + lineNum : "");
}
else {
this.failedMessage = null;
}
}
final boolean isFailed() {
return failed;
}
/**
* Returns null if not failed, otherwise returns a string.
* @return
*/
final String getFailedMessage(final int lineNum) {
if (!failed) {
return null;
}
if (failedMessage == null) {
return (descr != null ? descr : "") + ": Unable to parse."
+ (lineNum > 0 ? " Line# " + lineNum : "");
}
return failedMessage;
}
}
|
[
"mast@localhost"
] |
mast@localhost
|
d76b114fa4134f490cd568f4cb3215c784445ff2
|
c474b03758be154e43758220e47b3403eb7fc1fc
|
/apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/google/android/gms/ads/internal/gmsg/C3741f.java
|
7b54c8d87d98ac9d3341ff491f76f01df37b3413
|
[] |
no_license
|
EstebanDalelR/tinderAnalysis
|
f80fe1f43b3b9dba283b5db1781189a0dd592c24
|
941e2c634c40e5dbf5585c6876ef33f2a578b65c
|
refs/heads/master
| 2020-04-04T09:03:32.659099
| 2018-11-23T20:41:28
| 2018-11-23T20:41:28
| 155,805,042
| 0
| 0
| null | 2018-11-18T16:02:45
| 2018-11-02T02:44:34
| null |
UTF-8
|
Java
| false
| false
| 1,271
|
java
|
package com.google.android.gms.ads.internal.gmsg;
import android.text.TextUtils;
import com.google.android.gms.internal.ec;
import com.google.android.gms.internal.zzaeq;
import com.google.android.gms.internal.zzzv;
import com.tinder.api.ManagerWebServices;
import java.util.Map;
@zzzv
/* renamed from: com.google.android.gms.ads.internal.gmsg.f */
public final class C3741f implements zzt<Object> {
/* renamed from: a */
private final zzag f11801a;
public C3741f(zzag zzag) {
this.f11801a = zzag;
}
public final void zza(Object obj, Map<String, String> map) {
String str = (String) map.get("action");
if ("grant".equals(str)) {
zzaeq zzaeq = null;
try {
int parseInt = Integer.parseInt((String) map.get(ManagerWebServices.PARAM_AMOUNT));
String str2 = (String) map.get("type");
if (!TextUtils.isEmpty(str2)) {
zzaeq = new zzaeq(str2, parseInt);
}
} catch (Throwable e) {
ec.c("Unable to parse reward amount.", e);
}
this.f11801a.zzb(zzaeq);
return;
}
if ("video_start".equals(str)) {
this.f11801a.zzdl();
}
}
}
|
[
"jdguzmans@hotmail.com"
] |
jdguzmans@hotmail.com
|
ffc9d299eac0ab70d09c1d529e8a2fafa1cb3264
|
514a2fe6511db2504ad6b2e8782c4daeb2f25a86
|
/lion-id/src/main/java/com/lion/id/controller/IdController.java
|
27ef5c95c69067493e25044efab100e6f486fc71
|
[
"MIT"
] |
permissive
|
tandingbo/lion
|
a9e5be649f1ed0b145aa482a56f96173923c8e08
|
a6473f4386fb66324ca37db135d0233684f83d98
|
refs/heads/master
| 2021-02-10T12:43:13.187056
| 2020-02-18T04:34:34
| 2020-02-18T04:34:34
| 244,383,236
| 2
| 3
|
MIT
| 2020-03-02T13:53:13
| 2020-03-02T13:53:12
| null |
UTF-8
|
Java
| false
| false
| 3,645
|
java
|
package com.lion.id.controller;
import com.lion.common.base.controller.BaseController;
import com.lion.common.exception.LionException;
import com.lion.id.entity.SysId;
import com.lion.id.service.IdService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
/**
* IdController
* 双 buffer 自增序列生成
*
* @author Yanzheng https://github.com/micyo202
* @date 2019/04/28
* Copyright 2019 Yanzheng. All rights reserved.
*/
@Api("双buffer自增序列生成")
@RestController
public class IdController extends BaseController {
private static int buffer = 1;
private static SysId sysId = new SysId();
private static SysId sysId_buffer_1 = new SysId(); // buffer_1
private static SysId sysId_buffer_2 = new SysId(); // buffer_2
private static Future<SysId> futureSysId;
private static int maxId;
private static int step;
private static boolean isChange;
private static final String CODE = "user";
@Autowired
private IdService idService;
@ApiOperation("自增序列生成方法")
@RequestMapping(value = "/generator", method = {RequestMethod.GET, RequestMethod.POST})
public Integer generator() {
Integer id;
// 初始化 或 超出 Range 范围时,从数据库获取 Range
if (null == sysId.getId()) {
buffer = 1;
sysId_buffer_1 = idService.getSynSysId(CODE);
maxId = sysId_buffer_1.getMaxId();
step = sysId_buffer_1.getStep();
BeanUtils.copyProperties(sysId_buffer_1, sysId);
}
if (sysId.getMaxId() >= sysId.getStep()) {
isChange = true;
if (1 == buffer) {
buffer = 2;
} else {
buffer = 1;
}
}
if (1 == buffer && isChange) {
isChange = false;
try {
sysId_buffer_1 = futureSysId.get();
} catch (InterruptedException | ExecutionException e) {
throw new LionException(100, e.getMessage());
}
maxId = sysId_buffer_1.getMaxId();
step = sysId_buffer_1.getStep();
BeanUtils.copyProperties(sysId_buffer_1, sysId);
}
if (2 == buffer && isChange) {
isChange = false;
try {
sysId_buffer_2 = futureSysId.get();
} catch (InterruptedException | ExecutionException e) {
throw new LionException(100, e.getMessage());
}
maxId = sysId_buffer_2.getMaxId();
step = sysId_buffer_2.getStep();
BeanUtils.copyProperties(sysId_buffer_2, sysId);
}
id = sysId.getMaxId() + 1;
sysId.setMaxId(id);
int increaseRange = step - maxId;
int increaseCount = step / (step - maxId);
int increaseRate = (int) (increaseRange * .5f); // 50%
int threshold = increaseRange * (increaseCount - 1) + increaseRate;
if (id == threshold) {
if (1 == buffer) {
futureSysId = idService.getAsynSysId(CODE);
}
if (2 == buffer) {
futureSysId = idService.getAsynSysId(CODE);
}
}
return id;
}
}
|
[
"micyo202@163.com"
] |
micyo202@163.com
|
a33fef2483d76f6bf52b70c57a828a7bd9215a7c
|
5ec06dab1409d790496ce082dacb321392b32fe9
|
/clients/java-inflector/generated/src/gen/java/org/openapitools/model/OrgApacheHttpProxyconfiguratorInfo.java
|
0f7a2a8dfaa90f6eaef10a6f387e364ba6179b45
|
[
"Apache-2.0"
] |
permissive
|
shinesolutions/swagger-aem-osgi
|
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
|
c2f6e076971d2592c1cbd3f70695c679e807396b
|
refs/heads/master
| 2022-10-29T13:07:40.422092
| 2021-04-09T07:46:03
| 2021-04-09T07:46:03
| 190,217,155
| 3
| 3
|
Apache-2.0
| 2022-10-05T03:26:20
| 2019-06-04T14:23:28
| null |
UTF-8
|
Java
| false
| false
| 3,748
|
java
|
package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.OrgApacheHttpProxyconfiguratorProperties;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen", date = "2019-08-05T00:53:46.291Z[GMT]")
public class OrgApacheHttpProxyconfiguratorInfo {
@JsonProperty("pid")
private String pid = null;
@JsonProperty("title")
private String title = null;
@JsonProperty("description")
private String description = null;
@JsonProperty("properties")
private OrgApacheHttpProxyconfiguratorProperties properties = null;
/**
**/
public OrgApacheHttpProxyconfiguratorInfo pid(String pid) {
this.pid = pid;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("pid")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
/**
**/
public OrgApacheHttpProxyconfiguratorInfo title(String title) {
this.title = title;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("title")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
**/
public OrgApacheHttpProxyconfiguratorInfo description(String description) {
this.description = description;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
**/
public OrgApacheHttpProxyconfiguratorInfo properties(OrgApacheHttpProxyconfiguratorProperties properties) {
this.properties = properties;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("properties")
public OrgApacheHttpProxyconfiguratorProperties getProperties() {
return properties;
}
public void setProperties(OrgApacheHttpProxyconfiguratorProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrgApacheHttpProxyconfiguratorInfo orgApacheHttpProxyconfiguratorInfo = (OrgApacheHttpProxyconfiguratorInfo) o;
return Objects.equals(pid, orgApacheHttpProxyconfiguratorInfo.pid) &&
Objects.equals(title, orgApacheHttpProxyconfiguratorInfo.title) &&
Objects.equals(description, orgApacheHttpProxyconfiguratorInfo.description) &&
Objects.equals(properties, orgApacheHttpProxyconfiguratorInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrgApacheHttpProxyconfiguratorInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"cliffano@gmail.com"
] |
cliffano@gmail.com
|
82af03ceb7e23707c0d3b5c9ff3d5c598e1f7764
|
040554b3d616dd5ca8da73547ae77f1acbf23533
|
/GetWords/app/src/main/java/com/sherman/getwords/videoplayer/videomanage/controller/ViewGestureListener.java
|
26405ec23cd4fb1a92aa69c6ac37286be85b1557
|
[] |
no_license
|
wisekingokok/testshshhsh
|
b36f71a5387c37d014a4ce5c34bf813243982d5e
|
ceef9a5e1f4ff050786c1da80f1ee2acee81dc09
|
refs/heads/master
| 2020-03-19T16:47:58.704530
| 2018-06-10T17:36:26
| 2018-06-10T17:36:26
| 136,730,561
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,569
|
java
|
package com.sherman.getwords.videoplayer.videomanage.controller;
import android.content.Context;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.WindowManager;
/**
* Created by Brucetoo
* On 2015/10/21
* At 9:58
*/
public class ViewGestureListener extends GestureDetector.SimpleOnGestureListener {
private static final String TAG = "ViewGestureListener";
private static final int SWIPE_THRESHOLD = 60;//threshold of swipe
public static final int SWIPE_LEFT = 1;
public static final int SWIPE_RIGHT = 2;
private VideoGestureListener listener;
private Context context;
public ViewGestureListener(Context context, VideoGestureListener listener) {
this.context = context;
this.listener = listener;
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
listener.onSingleTap();
return true;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
float deltaX = e1.getRawX() - e2.getRawX();
float deltaY = e1.getRawY() - e2.getRawY();
if (Math.abs(deltaX) > Math.abs(deltaY)) {
if (Math.abs(deltaX) > SWIPE_THRESHOLD) {
listener.onHorizontalScroll(deltaX < 0);
}
} else {
if (Math.abs(deltaY) > SWIPE_THRESHOLD) {
Log.i(TAG, "deltaY->" + deltaY);
if (e1.getX() < getDeviceWidth(context) * 1.0 / 2) {//left edge
listener.onVerticalScroll(deltaY / getDeviceHeight(context), SWIPE_LEFT);
} else if (e1.getX() > getDeviceWidth(context) * 1.0 / 2) {//right edge
listener.onVerticalScroll(deltaY / getDeviceHeight(context), SWIPE_RIGHT);
}
}
}
return true;
}
public static int getDeviceWidth(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics mDisplayMetrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(mDisplayMetrics);
return mDisplayMetrics.widthPixels;
}
public static int getDeviceHeight(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics mDisplayMetrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(mDisplayMetrics);
return mDisplayMetrics.heightPixels;
}
}
|
[
"wisekingokok@126.com"
] |
wisekingokok@126.com
|
01c0484c5dd352f261a2e0308abba51c1d055b39
|
bff449a67bde60eb42d58b6e81d592bccada40e5
|
/InventoryBusiness/srv-impl/com/viettel/bccs/inventory/service/StockDeliverDetailServiceImpl.java
|
3caf3a44b5523696bbe93467d6ec29cb65f8d776
|
[] |
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
| 3,022
|
java
|
package com.viettel.bccs.inventory.service;
import com.google.common.collect.Lists;
import com.viettel.bccs.inventory.repo.StockDeliverDetailRepo;
import com.viettel.bccs.inventory.dto.StockDeliverDetailDTO;
import com.viettel.bccs.inventory.model.StockDeliverDetail;
import com.viettel.bccs.inventory.service.StockDeliverDetailService;
import com.viettel.fw.dto.BaseMessage;
import com.viettel.fw.common.util.mapper.BaseMapper;
import com.viettel.fw.common.util.extjs.FilterRequest;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.viettel.fw.service.BaseServiceImpl;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.primefaces.model.LazyDataModel;
import org.primefaces.model.SortOrder;
import org.springframework.data.domain.Sort;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import javax.jws.WebMethod;
import org.springframework.transaction.annotation.Transactional;
@Service
public class StockDeliverDetailServiceImpl extends BaseServiceImpl implements StockDeliverDetailService {
private final BaseMapper<StockDeliverDetail, StockDeliverDetailDTO> mapper = new BaseMapper<>(StockDeliverDetail.class, StockDeliverDetailDTO.class);
@Autowired
private StockDeliverDetailRepo repository;
public static final Logger logger = Logger.getLogger(StockDeliverDetailService.class);
@WebMethod
public Long count(List<FilterRequest> filters) throws Exception {
return repository.count(repository.toPredicate(filters));
}
@WebMethod
public StockDeliverDetailDTO findOne(Long id) throws Exception {
return mapper.toDtoBean(repository.findOne(id));
}
@WebMethod
public List<StockDeliverDetailDTO> findAll() throws Exception {
return mapper.toDtoBean(repository.findAll());
}
@WebMethod
public List<StockDeliverDetailDTO> findByFilter(List<FilterRequest> filters) throws Exception {
return mapper.toDtoBean(repository.findAll(repository.toPredicate(filters)));
}
@WebMethod
@Transactional(rollbackFor = Exception.class)
public StockDeliverDetailDTO save(StockDeliverDetailDTO dto) throws Exception {
return mapper.toDtoBean(repository.save(mapper.toPersistenceBean(dto)));
}
@WebMethod
@Transactional(rollbackFor = Exception.class)
public BaseMessage update(StockDeliverDetailDTO dto) throws Exception {
throw new NotImplementedException();
}
public List<StockDeliverDetailDTO> viewStockTotalFull(Long ownerId, Long ownerType) throws Exception {
return repository.viewStockTotalFull(ownerId, ownerType);
}
public List<StockDeliverDetailDTO> getLstDetailByStockDeliverId(Long stockDeliverId) throws Exception {
return repository.getLstDetailByStockDeliverId(stockDeliverId);
}
}
|
[
"tiendat.fet4@gmail.com"
] |
tiendat.fet4@gmail.com
|
74184f9b3b6b45f0cc008e9ea5b91e41b2f89d18
|
ce7f089378d817e242793649785b097c9be3f96b
|
/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/site/Card4_324.java
|
c9fdb48e6dce37c89a58d91e2003e04584c0efe6
|
[] |
no_license
|
TheSkyGold/gemp-lotr
|
aaba1f461a3d9237d12ca340a7e899b00e4151e4
|
aab299c87fc9cabd10b284c25b699f10a84fe622
|
refs/heads/master
| 2021-01-11T07:39:27.678795
| 2014-11-21T00:44:25
| 2014-11-21T00:44:25
| 32,382,766
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,509
|
java
|
package com.gempukku.lotro.cards.set4.site;
import com.gempukku.lotro.cards.AbstractSite;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.common.Block;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseAndDiscardCardsFromHandEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: The Two Towers
* Type: Site
* Site: 1T
* Game Text: Each time you play a companion here, you must discard 2 cards from hand.
*/
public class Card4_324 extends AbstractSite {
public Card4_324() {
super("Eastemnet Downs", Block.TWO_TOWERS, 1, 0, Direction.LEFT);
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, CardType.COMPANION)
&& game.getGameState().getCurrentSite() == self) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new ChooseAndDiscardCardsFromHandEffect(action, game.getGameState().getCurrentPlayerId(), true, 2));
return Collections.singletonList(action);
}
return null;
}
}
|
[
"marcins78@gmail.com@eb7970ca-0f6f-de4b-2938-835b230b9d1f"
] |
marcins78@gmail.com@eb7970ca-0f6f-de4b-2938-835b230b9d1f
|
a27c6809e2331fb33bcda36d324b39aa518ff7b9
|
0d64e2fc3a022516c4ce0aa21182ee8fd14469d0
|
/src/java/fuck/you/jewtricks/mixins/MixinGuiToast.java
|
89252e6858cebce1b63c16b112636609a87acec2
|
[] |
no_license
|
yunusborazan/jewtricks
|
b3f99da545be2639346baa54d271255d5aa6b916
|
8519ec25884e64527d43125243310fdbc944224e
|
refs/heads/main
| 2023-08-29T09:33:42.963830
| 2021-10-30T08:11:15
| 2021-10-30T08:11:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 773
|
java
|
//Deobfuscated with https://github.com/SimplyProgrammer/Minecraft-Deobfuscator3000 using mappings "C:\Users\Admin\Desktop\Minecraft-Deobfuscator3000-1.2.2\1.12 stable mappings"!
//Decompiled by Procyon!
package fuck.you.jewtricks.mixins;
import org.spongepowered.asm.mixin.*;
import net.minecraft.client.gui.toasts.*;
import org.spongepowered.asm.mixin.injection.callback.*;
import org.spongepowered.asm.mixin.injection.*;
@Mixin({ GuiToast.class })
public class MixinGuiToast
{
@Inject(method = { "add" }, at = { @At("HEAD") }, cancellable = true)
public void add(final IToast toastIn, final CallbackInfo info) {
final String from = toastIn.getClass().toString();
if (from.contains(".tutorial.")) {
info.cancel();
}
}
}
|
[
"81470009+kisman2000@users.noreply.github.com"
] |
81470009+kisman2000@users.noreply.github.com
|
64815458eddbdf3bcad4354c27eb3ec7610ebcd7
|
6253283b67c01a0d7395e38aeeea65e06f62504b
|
/decompile/app/HwSystemManager/src/main/java/android/support/v13/app/FragmentCompat.java
|
73044f2cf1b5712ae2a165653da9cda4bd170dfa
|
[] |
no_license
|
sufadi/decompile-hw
|
2e0457a0a7ade103908a6a41757923a791248215
|
4c3efd95f3e997b44dd4ceec506de6164192eca3
|
refs/heads/master
| 2023-03-15T15:56:03.968086
| 2017-11-08T03:29:10
| 2017-11-08T03:29:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,891
|
java
|
package android.support.v13.app;
import android.app.Fragment;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build.VERSION;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.v4.os.BuildCompat;
import java.util.Arrays;
public class FragmentCompat {
static final FragmentCompatImpl IMPL;
interface FragmentCompatImpl {
void requestPermissions(Fragment fragment, String[] strArr, int i);
void setMenuVisibility(Fragment fragment, boolean z);
void setUserVisibleHint(Fragment fragment, boolean z);
boolean shouldShowRequestPermissionRationale(Fragment fragment, String str);
}
static class BaseFragmentCompatImpl implements FragmentCompatImpl {
BaseFragmentCompatImpl() {
}
public void setMenuVisibility(Fragment f, boolean visible) {
}
public void setUserVisibleHint(Fragment f, boolean deferStart) {
}
public void requestPermissions(final Fragment fragment, final String[] permissions, final int requestCode) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
public void run() {
int[] grantResults = new int[permissions.length];
Context context = fragment.getActivity();
if (context != null) {
PackageManager packageManager = context.getPackageManager();
String packageName = context.getPackageName();
int permissionCount = permissions.length;
for (int i = 0; i < permissionCount; i++) {
grantResults[i] = packageManager.checkPermission(permissions[i], packageName);
}
} else {
Arrays.fill(grantResults, -1);
}
((OnRequestPermissionsResultCallback) fragment).onRequestPermissionsResult(requestCode, permissions, grantResults);
}
});
}
public boolean shouldShowRequestPermissionRationale(Fragment fragment, String permission) {
return false;
}
}
static class ICSFragmentCompatImpl extends BaseFragmentCompatImpl {
ICSFragmentCompatImpl() {
}
public void setMenuVisibility(Fragment f, boolean visible) {
FragmentCompatICS.setMenuVisibility(f, visible);
}
}
static class ICSMR1FragmentCompatImpl extends ICSFragmentCompatImpl {
ICSMR1FragmentCompatImpl() {
}
public void setUserVisibleHint(Fragment f, boolean deferStart) {
FragmentCompatICSMR1.setUserVisibleHint(f, deferStart);
}
}
static class MncFragmentCompatImpl extends ICSMR1FragmentCompatImpl {
MncFragmentCompatImpl() {
}
public void requestPermissions(Fragment fragment, String[] permissions, int requestCode) {
FragmentCompat23.requestPermissions(fragment, permissions, requestCode);
}
public boolean shouldShowRequestPermissionRationale(Fragment fragment, String permission) {
return FragmentCompat23.shouldShowRequestPermissionRationale(fragment, permission);
}
}
static class NFragmentCompatImpl extends MncFragmentCompatImpl {
NFragmentCompatImpl() {
}
public void setUserVisibleHint(Fragment f, boolean deferStart) {
FragmentCompatApi24.setUserVisibleHint(f, deferStart);
}
}
public interface OnRequestPermissionsResultCallback {
void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr);
}
static {
if (BuildCompat.isAtLeastN()) {
IMPL = new NFragmentCompatImpl();
} else if (VERSION.SDK_INT >= 23) {
IMPL = new MncFragmentCompatImpl();
} else if (VERSION.SDK_INT >= 15) {
IMPL = new ICSMR1FragmentCompatImpl();
} else if (VERSION.SDK_INT >= 14) {
IMPL = new ICSFragmentCompatImpl();
} else {
IMPL = new BaseFragmentCompatImpl();
}
}
public static void setMenuVisibility(Fragment f, boolean visible) {
IMPL.setMenuVisibility(f, visible);
}
public static void setUserVisibleHint(Fragment f, boolean deferStart) {
IMPL.setUserVisibleHint(f, deferStart);
}
public static void requestPermissions(@NonNull Fragment fragment, @NonNull String[] permissions, int requestCode) {
IMPL.requestPermissions(fragment, permissions, requestCode);
}
public static boolean shouldShowRequestPermissionRationale(@NonNull Fragment fragment, @NonNull String permission) {
return IMPL.shouldShowRequestPermissionRationale(fragment, permission);
}
}
|
[
"liming@droi.com"
] |
liming@droi.com
|
6cd351fc5b2cf09b0472546d590730b566fd4574
|
901aec9c9408a737cf382d6c3549e44eb3d0f167
|
/framework-core3/src/main/java/com/transilink/framework/core/rest/BaseRepresention.java
|
d1c1cf51c39800fd40a2dda30244835632a901d1
|
[] |
no_license
|
zhangjunfang/architecture
|
a32f1d3e5dfd528517ed8dc4fd2e6b32a0a12e2d
|
709cbc68a8381d93e7af779470025a1d8a27de4e
|
refs/heads/master
| 2016-09-15T08:41:37.899666
| 2016-03-05T11:23:52
| 2016-03-05T11:23:52
| 33,911,525
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,075
|
java
|
package com.transilink.framework.core.rest;
import java.io.IOException;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.restlet.data.CharacterSet;
import org.restlet.data.MediaType;
import org.restlet.resource.Representation;
import org.restlet.resource.StringRepresentation;
import com.transilink.framework.core.model.variant.Variant;
/**
*
* @author ocean(zhangjufang0505@163.com)
*
*/
public class BaseRepresention extends StringRepresentation {
public BaseRepresention(Msg message) {
super(message.toJSONObject().toString(), MediaType.TEXT_PLAIN, null,
CharacterSet.UTF_8);
}
public BaseRepresention(boolean flag, String msg) {
super(new Msg(flag, msg).toJSONObject().toString(),
MediaType.TEXT_PLAIN, null, CharacterSet.UTF_8);
}
public BaseRepresention(boolean flag, String msg, Object data) {
super(new Msg(flag, msg, data).toJSONObject().toString(),
MediaType.TEXT_PLAIN, null, CharacterSet.UTF_8);
}
public BaseRepresention(String msg, Object data) {
super(new Msg(true, msg).setData(data).toJSONObject().toString(),
MediaType.TEXT_PLAIN, null, CharacterSet.UTF_8);
}
public BaseRepresention(org.json.JSONObject jsonObject) {
this(jsonObject.toString());
}
public BaseRepresention(Map<Object, Object> map) {
super(new Msg().setData(map).toJSONObject().toString(),
MediaType.TEXT_PLAIN, null, CharacterSet.UTF_8);
}
public BaseRepresention(Variant variant) {
super(new Msg().setData(variant).toJSONObject().toString(),
MediaType.TEXT_PLAIN, null, CharacterSet.UTF_8);
}
public BaseRepresention(Object data) {
super(new Msg().setData(data).toJSONObject().toString(),
MediaType.TEXT_PLAIN, null, CharacterSet.UTF_8);
}
public BaseRepresention(Representation jsonRepresentation)
throws IOException {
this(jsonRepresentation.getText());
}
public JSONArray toJsonArray() throws Exception {
return new JSONArray(getText());
}
public org.json.JSONObject toJsonObject() throws JSONException {
return new org.json.JSONObject(getText());
}
}
|
[
"zhangjunfang0505@163.com"
] |
zhangjunfang0505@163.com
|
5e42b71b3cabad1fdf960c314834bf8b3f3e8b97
|
85d590e865d4f5369e82baa78bf766a96a52c866
|
/src/InterviewJava/Vid_Counter.java
|
e6ee793346105a9e4b320cf627dc5b2727e53be8
|
[] |
no_license
|
rumachakraborty/JAVAPractice
|
104175509335d8a00dbed0e486b9845e470725fd
|
e5817cb0f58453d786c1f1901c5b18b9cc6348e5
|
refs/heads/master
| 2022-11-10T05:34:12.444008
| 2020-07-01T23:45:05
| 2020-07-01T23:45:05
| 276,504,888
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 361
|
java
|
package InterviewJava;
public class Vid_Counter {
int count=0;//instance variable
Vid_Counter(){
count++;//increment the value
System.out.println(count);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Vid_Counter c1=new Vid_Counter();
Vid_Counter c2=new Vid_Counter();
Vid_Counter c3=new Vid_Counter();
}
}
|
[
"you@example.com"
] |
you@example.com
|
1aa1245e70bb6f0e9d99a07a831df7c8928ad463
|
48db6215d4a077a6b345dbba77a406212d1492ae
|
/Java8NewFeatures/src/lambdaExpression/initialExample/UseRunnabeWithLambda.java
|
b3e5d24380325c489f23d05d2473c1982b661e4a
|
[] |
no_license
|
edneyRoldao/logicaDeProgramacaoComJava
|
f8fbed5727f743a6057e135d78f2c8d591634577
|
bff503a9915aaec958e6e732e4146693854d3fba
|
refs/heads/master
| 2020-04-05T23:47:54.318998
| 2016-09-19T14:25:58
| 2016-09-19T14:25:58
| 47,906,350
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 523
|
java
|
package lambdaExpression.initialExample;
public class UseRunnabeWithLambda {
public static void main(String[] args) {
//Thread 01 e 02
Runnable r1 = () -> System.out.println("Running thread 1");
Runnable r2 = () -> System.out.println("Running thread 2");
Runnable r3 = () -> {
try {
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Running thread 3");
};
new Thread(r1).start();
new Thread(r2).start();
new Thread(r3).start();
}
}
|
[
"edneyroldao@gmail.com"
] |
edneyroldao@gmail.com
|
9c8547c8d0fa096f4cd9c8b6c885cf58f12e8026
|
745b525c360a2b15b8d73841b36c1e8d6cdc9b03
|
/jun_java_plugins/jun_gzip/jun_compress_client/src/test/java/GzipTest.java
|
0fc7b64d229e58ccb34b6abee0fb22bedf0c0cc2
|
[] |
no_license
|
wujun728/jun_java_plugin
|
1f3025204ef5da5ad74f8892adead7ee03f3fe4c
|
e031bc451c817c6d665707852308fc3b31f47cb2
|
refs/heads/master
| 2023-09-04T08:23:52.095971
| 2023-08-18T06:54:29
| 2023-08-18T06:54:29
| 62,047,478
| 117
| 42
| null | 2023-08-21T16:02:15
| 2016-06-27T10:23:58
|
Java
|
UTF-8
|
Java
| false
| false
| 1,879
|
java
|
import java.io.IOException;
import com.jun.plugin.gzip.compressclient.compress.CompressUtils;
import com.jun.plugin.gzip.compressclient.encrypt.AESUtils;
/**
*
* @author Wujun
*
*/
public class GzipTest {
public static void main(String [] args){
String content=" ";
System.out.println("Step1 压缩前长度:" + content.length());
try{
// 压缩
String afterCompressStr = CompressUtils.compress(content);
System.out.println("Step2 压缩后长度:" + afterCompressStr.length());
// 加密
String afterEncryptStr = AESUtils.encrypt(afterCompressStr);
System.out.println("Step3 先压缩后加密的长度:" + afterEncryptStr.length());
System.out.println("Step3 先压缩后加密的content:" + afterEncryptStr);
// 先加密后压缩
String _afterEncryptStr = AESUtils.encrypt(content);
System.out.println("先加密的长度:" +_afterEncryptStr);
String _afterCompressStr = CompressUtils.compress(_afterEncryptStr);
System.out.println("先加密后压缩的长度:" + _afterCompressStr.length());
// 解密
String afterEncryptStrVal=afterEncryptStr;
// String afterEncryptStrVal="abcde";
String afterDecryptStr = AESUtils.decrypt(afterEncryptStrVal);
System.out.println("Step4 解密:" + afterDecryptStr.length());
// 解压缩
String afterDecryptContent = CompressUtils.decompressToStr(afterDecryptStr);
System.out.println("Step5 解压缩:" + afterDecryptContent.length());
System.out.println("Step5 解压缩:" + afterDecryptContent);
}catch (IOException e){
System.out.println(e.getMessage());
}
}
}
|
[
"wujun728@163.com"
] |
wujun728@163.com
|
a4b7d9408ea40236de0b97afaa27a01aa8fb2bfa
|
19b0ddc45e90a6d938bacc65648d805a941fc90d
|
/Server/RuleEngine-Common/src/engine/rule/domain/WelcomeCallPhoneAnswererResultForPDLForPDL.java
|
d925833b3b58bcc3d55f1539b60f80b03b1206d6
|
[] |
no_license
|
dachengzi-software/ap
|
bec5371a4004eb318258646a7e34fc0352e641c2
|
ccca3d6c4fb86a698a064c3005eba2b405e8d822
|
refs/heads/master
| 2021-12-23T09:26:24.595456
| 2017-11-10T02:33:18
| 2017-11-10T02:33:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 402
|
java
|
package engine.rule.domain;
import com.huateng.toprules.core.annotation.ModelDomainInstance;
@ModelDomainInstance(label = "PDL-欢迎电话审核V3_通话人接听情况", type = "number", adapter = "engine.rule.domain.adapter.EnumDomainAdapter", params = "X_WelcomeCallPhoneAnswererResultForPDL,Catfish.Platform.ManualJobV4.PDLHandlers")
public class WelcomeCallPhoneAnswererResultForPDLForPDL{
}
|
[
"gum@fenqi.im"
] |
gum@fenqi.im
|
f915eaa2b1b8728baf5ce95e46e7252b6a21fa99
|
d2a6f18f24fe4866ec687f82fdde2a98fa9df368
|
/Filemaker/src/test/java/org/openestate/io/filemaker/FilemakerResultDocumentTest.java
|
6249582c59dcbc5750163e594662f849265de9b8
|
[
"Apache-2.0"
] |
permissive
|
jcelmeta14/OpenEstate-IO
|
0255ec398cfaa55233e5e6e6d322a4410c82c3fb
|
180e62a1c23596e5e284ce7fc6d07081918b0a38
|
refs/heads/master
| 2023-07-14T22:51:46.528402
| 2021-08-16T00:50:09
| 2021-08-16T00:50:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,418
|
java
|
/*
* Copyright 2015-2021 OpenEstate.org.
*
* 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.openestate.io.filemaker;
import java.math.BigInteger;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.openestate.io.core.XmlUtils;
import org.openestate.io.filemaker.xml.result.FMPXMLRESULT;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
/**
* @author Andreas Rudolph
*/
@RunWith(JUnit4.class)
public class FilemakerResultDocumentTest {
@SuppressWarnings("unused")
private final static Logger LOGGER = LoggerFactory.getLogger(FilemakerResultDocumentTest.class);
private static Document buildExampleDocument() throws Exception {
return XmlUtils.newDocument("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<FMPXMLRESULT xmlns=\"http://www.filemaker.com/fmpxmlresult\">\n"
+ " <ERRORCODE>0</ERRORCODE>\n"
+ " <PRODUCT BUILD=\"03-20-2006\" NAME=\"FileMaker Pro\" VERSION=\"8.0v3\"/>\n"
+ " <DATABASE DATEFORMAT=\"D.m.yyyy\" LAYOUT=\"fmmedia2universal\" NAME=\"AngGes\" RECORDS=\"13723\" TIMEFORMAT=\"k:mm:ss \"/>\n"
+ " <METADATA>\n"
+ " <FIELD EMPTYOK=\"YES\" MAXREPEAT=\"1\" NAME=\"aNumericField\" TYPE=\"NUMBER\"/>\n"
+ " <FIELD EMPTYOK=\"YES\" MAXREPEAT=\"1\" NAME=\"aTextField\" TYPE=\"TEXT\"/>\n"
+ " </METADATA>\n"
+ " <RESULTSET FOUND=\"2\">\n"
+ " <ROW MODID=\"1\" RECORDID=\"1\">\n"
+ " <COL>\n"
+ " <DATA>123</DATA>\n"
+ " </COL>\n"
+ " <COL>\n"
+ " <DATA>this is a text</DATA>\n"
+ " </COL>\n"
+ " </ROW>\n"
+ " <ROW MODID=\"2\" RECORDID=\"2\">\n"
+ " <COL>\n"
+ " <DATA>456</DATA>\n"
+ " </COL>\n"
+ " <COL>\n"
+ " <DATA>this is another text</DATA>\n"
+ " </COL>\n"
+ " </ROW>\n"
+ " </RESULTSET>\n"
+ "</FMPXMLRESULT>");
}
@Test
public void testToMapping() {
try {
FilemakerResultDocument doc = new FilemakerResultDocument(buildExampleDocument());
FilemakerResultMapping mapping = doc.toMapping();
Assert.assertNotNull(
"Created mapping for transfer document.", mapping);
} catch (Exception ex) {
LOGGER.error("Test of FilemakerResultDocument.toMapping failed!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
Assert.fail("Test of FilemakerResultDocument.toMapping failed!");
}
}
@Test
public void testToObject() {
try {
FilemakerResultDocument doc = new FilemakerResultDocument(buildExampleDocument());
FMPXMLRESULT obj = doc.toObject();
Assert.assertNotNull(
"Created object for transfer document.", obj);
} catch (Exception ex) {
LOGGER.error("Test of FilemakerResultDocument.toObject failed!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
Assert.fail("Test of FilemakerResultDocument.toObject failed!");
}
}
@Test
@Ignore
public void testToXml() {
FMPXMLRESULT result = FilemakerUtils.getFactoryForResult().createFMPXMLRESULT();
result.setERRORCODE("0");
result.setPRODUCT(FilemakerUtils.getFactoryForResult().createProductType());
result.getPRODUCT().setNAME("OpenEstate-IO");
result.getPRODUCT().setVERSION("1.0");
result.getPRODUCT().setBUILD("123");
result.setDATABASE(FilemakerUtils.getFactoryForResult().createDatabaseType());
result.getDATABASE().setNAME("example database");
result.getDATABASE().setLAYOUT("fmmedia2universal");
result.getDATABASE().setDATEFORMAT("D.m.yyyy");
result.getDATABASE().setTIMEFORMAT("k:mm:ss");
result.getDATABASE().setRECORDS(BigInteger.ZERO);
result.setMETADATA(FilemakerUtils.getFactoryForResult().createMetaDataType());
result.setRESULTSET(FilemakerUtils.getFactoryForResult().createResultSetType());
try {
FilemakerResultDocument doc = FilemakerResultDocument.newDocument(result);
String xml = doc.toXmlString(true);
LOGGER.info("XML: " + xml);
} catch (Exception ex) {
LOGGER.error("Test of FilemakerResultDocument.toXml failed!");
LOGGER.error("> " + ex.getLocalizedMessage(), ex);
Assert.fail("Test of FilemakerResultDocument.toXml failed!");
}
}
}
|
[
"andy@openindex.de"
] |
andy@openindex.de
|
fd0c45e832ee04a099154c944a6e027192b62590
|
99bd3fa9696c6b0cb077df4316958c852a6de806
|
/src/main/java/com/node/system/controller/LoginController.java
|
eeaa8f5f3a1528639fc9385c87106700fbe7518e
|
[
"Apache-2.0"
] |
permissive
|
WilliamMajanja-zz/node-eduoa
|
16894e924656a4e2f5b2066622fc6e5c440a3fdf
|
815363656d66677ec8c7c2acebab6f8643749457
|
refs/heads/master
| 2022-09-09T15:06:52.114339
| 2013-08-23T02:17:39
| 2013-08-23T02:17:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,589
|
java
|
/**
* <pre>
* Copyright: Copyright(C) 2011-2012, node.com
* Filename: com.node.system.controller.LoginController.java
* Class: LoginController
* Date: 2012-8-2
* Author: <a href="mailto:node@gmail.com">node</a>
* Version 1.1.0
* Description:
*
* </pre>
**/
package com.node.system.controller;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.DisabledAccountException;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springside.modules.utils.Exceptions;
import com.node.system.SecurityConstants;
import com.node.system.log.Log;
import com.node.system.shiro.IncorrectCaptchaException;
import com.node.system.shiro.ShiroDbRealm;
import com.node.system.util.dwz.AjaxObject;
/**
*
* @author <a href="mailto:node@gmail.com">node</a> Version 1.1.0
* @since 2012-8-2 下午5:29:01
*/
@Controller
@RequestMapping("/login")
public class LoginController {
private static final Logger LOG = LoggerFactory.getLogger(LoginController.class);
private static final String LOGIN_PAGE = "login";
private static final String LOGIN_DIALOG = "management/index/loginDialog";
@RequestMapping(method = RequestMethod.GET)
public String login(HttpServletRequest request) {
return LOGIN_PAGE;
}
@RequestMapping(method = { RequestMethod.GET, RequestMethod.HEAD }, headers = "x-requested-with=XMLHttpRequest")
public @ResponseBody
String loginDialog(HttpServletRequest request) {
return AjaxObject.newTimeout("会话超时,请重新登录。").toString();
}
@RequestMapping(value = "/timeout", method = { RequestMethod.GET })
public String timeout() {
return LOGIN_DIALOG;
}
@Log(message="会话超时, 该用户重新登录系统。")
@RequestMapping(value = "/timeout/success", method = {RequestMethod.GET})
public @ResponseBody
String timeoutSuccess(HttpServletRequest request) {
Subject subject = SecurityUtils.getSubject();
ShiroDbRealm.ShiroUser shiroUser = (ShiroDbRealm.ShiroUser)subject.getPrincipal();
// 加入ipAddress
shiroUser.setIpAddress(request.getRemoteAddr());
// 这个是放入user还是shiroUser呢?
request.getSession().setAttribute(SecurityConstants.LOGIN_USER, shiroUser.getUser());
return AjaxObject.newOk("登录成功。").toString();
}
@RequestMapping(method = RequestMethod.POST)
public String fail(
@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM) String username,
Map<String, Object> map, HttpServletRequest request) {
String msg = parseException(request);
map.put("msg", msg);
map.put("username", username);
return LOGIN_PAGE;
}
@RequestMapping(method = { RequestMethod.POST, RequestMethod.HEAD }, headers = "x-requested-with=XMLHttpRequest")
public @ResponseBody
String failDialog(HttpServletRequest request) {
String msg = parseException(request);
AjaxObject ajaxObject = new AjaxObject(msg);
ajaxObject.setStatusCode(AjaxObject.STATUS_CODE_FAILURE);
ajaxObject.setCallbackType("");
return ajaxObject.toString();
}
private String parseException(HttpServletRequest request) {
String errorString = (String)request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
Class<?> error = null;
try {
if (errorString != null) {
error = Class.forName(errorString);
}
} catch (ClassNotFoundException e) {
LOG.error(Exceptions.getStackTraceAsString(e));
}
String msg = "其他错误!";
if (error != null) {
if (error.equals(UnknownAccountException.class))
msg = "未知帐号错误!";
else if (error.equals(IncorrectCredentialsException.class))
msg = "密码错误!";
else if (error.equals(IncorrectCaptchaException.class))
msg = "验证码错误!";
else if (error.equals(AuthenticationException.class))
msg = "认证失败!";
else if (error.equals(DisabledAccountException.class))
msg = "账号被冻结!";
}
return "登录失败," + msg;
}
}
|
[
"scstlinfeng@yahoo.cn"
] |
scstlinfeng@yahoo.cn
|
7dd3c360d206f408c7894d392f6fd98095ccca1e
|
e498e9af6eeefd02b7e3f5d1e4647dc14cfa95c8
|
/src/com/facebook/buck/util/autosparse/AutoSparseProjectFilesystemDelegate.java
|
7cf790e29e6469c0de64ca95bd36c5c1d7b1fb22
|
[
"Apache-2.0"
] |
permissive
|
asareh/buck
|
03a2734c46177d57cad708cf7e23feb32a2f41bb
|
dd1d3ab55077d859c94789e4a1262de60929fd7b
|
refs/heads/master
| 2021-07-05T23:41:59.187999
| 2017-09-30T06:38:59
| 2017-10-01T04:33:38
| 105,420,391
| 1
| 0
| null | 2017-10-01T05:01:35
| 2017-10-01T05:01:35
| null |
UTF-8
|
Java
| false
| false
| 5,035
|
java
|
/*
* Copyright 2016-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.util.autosparse;
import com.facebook.buck.event.BuckEventBus;
import com.facebook.buck.io.filesystem.ProjectFilesystemDelegate;
import com.facebook.buck.log.Logger;
import com.facebook.buck.util.HumanReadableException;
import com.facebook.buck.util.sha1.Sha1HashCode;
import com.facebook.buck.util.versioncontrol.SparseSummary;
import java.io.IOException;
import java.nio.file.LinkOption;
import java.nio.file.Path;
/**
* Virtual project filesystem that answers questions about files via the source control manifest.
* This removes the need to have all files checked out while Buck parses (a so-called
* <em>sparse</em> profile.
*
* <p>The source control system state is tracked by in an {@link AutoSparseState} instance. Any
* files queries about files outside the source control system manifest are forwarded to the
* provided {@link ProjectFilesystemDelegate}.
*/
public final class AutoSparseProjectFilesystemDelegate implements ProjectFilesystemDelegate {
private static final Logger LOG = Logger.get(AutoSparseProjectFilesystemDelegate.class);
private final AutoSparseState autoSparseState;
private final Path scRoot;
/** Delegate to forward requests to for files that are outside of the hg root. */
private final ProjectFilesystemDelegate delegate;
public AutoSparseProjectFilesystemDelegate(
AutoSparseState autoSparseState, ProjectFilesystemDelegate delegate)
throws InterruptedException {
this.autoSparseState = autoSparseState;
this.scRoot = autoSparseState.getSCRoot();
this.delegate = delegate;
}
@Override
public String getDetailsForLogging() {
return String.format("AutoSparseProjectFilesystemDelegate{root=%s}", scRoot);
}
@Override
public void ensureConcreteFilesExist(BuckEventBus eventBus) {
LOG.debug("Materialising the sparse profile");
AutoSparseStateEvents.SparseRefreshStarted started =
new AutoSparseStateEvents.SparseRefreshStarted();
eventBus.post(started);
SparseSummary sparseSummary = SparseSummary.of();
try {
sparseSummary = autoSparseState.materialiseSparseProfile();
} catch (IOException | InterruptedException e) {
Throwable cause = e.getCause();
String details = cause == null ? e.getMessage() : cause.getMessage();
AutoSparseStateEvents.SparseRefreshFailed failed =
new AutoSparseStateEvents.SparseRefreshFailed(started, details);
eventBus.post(failed);
throw new HumanReadableException(
e,
"Sparse profile could not be materialised. "
+ "Try again or disable the project.enable_autosparse option.");
} finally {
eventBus.post(new AutoSparseStateEvents.SparseRefreshFinished(started, sparseSummary));
}
}
@Override
public Sha1HashCode computeSha1(Path pathRelativeToProjectRootOrJustAbsolute) throws IOException {
// compute absolute path to ensure it is listed in the sparse profile
Path path = getPathForRelativePath(pathRelativeToProjectRootOrJustAbsolute);
return delegate.computeSha1(path);
}
@Override
public Path getPathForRelativePath(Path pathRelativeToProjectRootOrJustAbsolute) {
Path path = delegate.getPathForRelativePath(pathRelativeToProjectRootOrJustAbsolute);
if (path.startsWith(scRoot)) {
includeInSparse(path);
}
return path;
}
@Override
public boolean isExecutable(Path child) {
ManifestInfo manifestentry = autoSparseState.getManifestInfoForFile(child);
if (manifestentry != null) {
return manifestentry.isExecutable();
}
return delegate.isExecutable(child);
}
@Override
public boolean isSymlink(Path path) {
path = getPathForRelativePath(path);
ManifestInfo manifestentry = autoSparseState.getManifestInfoForFile(path);
if (manifestentry != null) {
return manifestentry.isLink();
} else if (autoSparseState.existsInManifest(path)) {
// it is a directory that exists in the manifest
return false;
}
return delegate.isSymlink(path);
}
@Override
public boolean exists(Path pathRelativeToProjectRoot, LinkOption... options) {
Path path = getPathForRelativePath(pathRelativeToProjectRoot);
boolean existsInManifest = autoSparseState.existsInManifest(path);
return existsInManifest || delegate.exists(path);
}
private void includeInSparse(Path path) {
autoSparseState.addToSparseProfile(path);
}
}
|
[
"facebook-github-bot@users.noreply.github.com"
] |
facebook-github-bot@users.noreply.github.com
|
a51d9d17d1aad1973c3a9a01fd0ab0bac6b892a9
|
e690de5109667215d5879573a10e0c1cc38883b1
|
/app/src/main/java/com/tianjian/hellochartsdemo/lecho/lib/hellocharts/samples/PreviewColumnChartActivity.java
|
2cca5d72db55cbc40a835f76ece1cea7bee99039
|
[] |
no_license
|
tequiero777/HelloChartsDemo
|
d1f182072a196bf3026f878caf1b114265737c24
|
9fb67679e80d0266f5527516c5c28fdd16410904
|
refs/heads/master
| 2021-01-12T05:46:53.618744
| 2016-12-23T03:38:10
| 2016-12-23T03:38:10
| 77,195,055
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,286
|
java
|
package com.tianjian.hellochartsdemo.lecho.lib.hellocharts.samples;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
import lecho.lib.hellocharts.gesture.ZoomType;
import lecho.lib.hellocharts.listener.ViewportChangeListener;
import lecho.lib.hellocharts.model.Axis;
import lecho.lib.hellocharts.model.Column;
import lecho.lib.hellocharts.model.ColumnChartData;
import lecho.lib.hellocharts.model.SubcolumnValue;
import lecho.lib.hellocharts.model.Viewport;
import lecho.lib.hellocharts.util.ChartUtils;
import lecho.lib.hellocharts.view.ColumnChartView;
import lecho.lib.hellocharts.view.PreviewColumnChartView;
public class PreviewColumnChartActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_preview_column_chart);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit();
}
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
private ColumnChartView chart;
private PreviewColumnChartView previewChart;
private ColumnChartData data;
/**
* Deep copy of data.
*/
private ColumnChartData previewData;
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setHasOptionsMenu(true);
View rootView = inflater.inflate(R.layout.fragment_preview_column_chart, container, false);
chart = (ColumnChartView) rootView.findViewById(R.id.chart);
previewChart = (PreviewColumnChartView) rootView.findViewById(R.id.chart_preview);
// Generate data for previewed chart and copy of that data for preview chart.
generateDefaultData();
chart.setColumnChartData(data);
// Disable zoom/scroll for previewed chart, visible chart ranges depends on preview chart viewport so
// zoom/scroll is unnecessary.
chart.setZoomEnabled(false);
chart.setScrollEnabled(false);
previewChart.setColumnChartData(previewData);
previewChart.setViewportChangeListener(new ViewportListener());
previewX(false);
return rootView;
}
// MENU
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.preview_column_chart, menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_reset) {
generateDefaultData();
chart.setColumnChartData(data);
previewChart.setColumnChartData(previewData);
previewX(true);
return true;
}
if (id == R.id.action_preview_both) {
previewXY();
previewChart.setZoomType(ZoomType.HORIZONTAL_AND_VERTICAL);
return true;
}
if (id == R.id.action_preview_horizontal) {
previewX(true);
return true;
}
if (id == R.id.action_preview_vertical) {
previewY();
return true;
}
if (id == R.id.action_change_color) {
int color = ChartUtils.pickColor();
while (color == previewChart.getPreviewColor()) {
color = ChartUtils.pickColor();
}
previewChart.setPreviewColor(color);
return true;
}
return super.onOptionsItemSelected(item);
}
private void generateDefaultData() {
int numSubcolumns = 1;
int numColumns = 50;
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
values.add(new SubcolumnValue((float) Math.random() * 50f + 5, ChartUtils.pickColor()));
}
columns.add(new Column(values));
}
data = new ColumnChartData(columns);
data.setAxisXBottom(new Axis());
data.setAxisYLeft(new Axis().setHasLines(true));
// prepare preview data, is better to use separate deep copy for preview chart.
// set color to grey to make preview area more visible.
previewData = new ColumnChartData(data);
for (Column column : previewData.getColumns()) {
for (SubcolumnValue value : column.getValues()) {
value.setColor(ChartUtils.DEFAULT_DARKEN_COLOR);
}
}
}
private void previewY() {
Viewport tempViewport = new Viewport(chart.getMaximumViewport());
float dy = tempViewport.height() / 4;
tempViewport.inset(0, dy);
previewChart.setCurrentViewportWithAnimation(tempViewport);
previewChart.setZoomType(ZoomType.VERTICAL);
}
private void previewX(boolean animate) {
Viewport tempViewport = new Viewport(chart.getMaximumViewport());
float dx = tempViewport.width() / 4;
tempViewport.inset(dx, 0);
if (animate) {
previewChart.setCurrentViewportWithAnimation(tempViewport);
} else {
previewChart.setCurrentViewport(tempViewport);
}
previewChart.setZoomType(ZoomType.HORIZONTAL);
}
private void previewXY() {
// Better to not modify viewport of any chart directly so create a copy.
Viewport tempViewport = new Viewport(chart.getMaximumViewport());
// Make temp viewport smaller.
float dx = tempViewport.width() / 4;
float dy = tempViewport.height() / 4;
tempViewport.inset(dx, dy);
previewChart.setCurrentViewportWithAnimation(tempViewport);
}
/**
* Viewport listener for preview chart(lower one). in {@link #onViewportChanged(Viewport)} method change
* viewport of upper chart.
*/
private class ViewportListener implements ViewportChangeListener {
@Override
public void onViewportChanged(Viewport newViewport) {
// don't use animation, it is unnecessary when using preview chart because usually viewport changes
// happens to often.
chart.setCurrentViewport(newViewport);
}
}
}
}
|
[
"yhmsn2008@hotmail.com"
] |
yhmsn2008@hotmail.com
|
f1e174354225fa52f86b5fdfe3f3c8e1a67a058d
|
bd827d030076afb64c89e2abd96a197b21c4e1fe
|
/05.模仿win10进度条/src/main/java/com/atsgg/win10progress/MainActivity.java
|
e4954d4525c051f3e9670239c71be7b0882a1fd4
|
[] |
no_license
|
lizhenqiang/MyCustomView
|
43003034b8a9a7f502f69d6eaef1725bd938537d
|
e3d024a0ecd20c18981ef3f728b207ad251e4b1f
|
refs/heads/master
| 2021-04-03T08:50:12.868618
| 2016-12-12T15:12:08
| 2016-12-12T15:12:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 404
|
java
|
package com.atsgg.win10progress;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
|
[
"1024057635@qq.com"
] |
1024057635@qq.com
|
0d690d24a33ab57f149ac2ac00f016b2bb2c0b16
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/5/5_a7bc29241be52498c76433ebc4fbdcb046966325/LessEngine/5_a7bc29241be52498c76433ebc4fbdcb046966325_LessEngine_t.java
|
9c72ff67a2c8661a3fe3ab2d09c696b319f34eb4
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 7,095
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.asual.lesscss;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.JavaScriptException;
import org.mozilla.javascript.NativeArray;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
import org.mozilla.javascript.tools.shell.Global;
/**
* @author Rostislav Hristov
* @author Uriah Carpenter
* @author Noah Sloan
*/
public class LessEngine {
private final Log logger = LogFactory.getLog(getClass());
private Scriptable scope;
private Function cs;
private Function cf;
public LessEngine() {
this(LessEngine.class.getClassLoader().getResource("META-INF/less.js"));
}
public LessEngine(URL less) {
try {
logger.debug("Initializing LESS Engine.");
URL browser = LessEngine.class.getClassLoader().getResource("META-INF/browser.js");
URL engine = LessEngine.class.getClassLoader().getResource("META-INF/engine.js");
Context cx = Context.enter();
logger.warn("Using implementation version: " + cx.getImplementationVersion());
cx.setOptimizationLevel(9);
Global global = new Global();
global.init(cx);
scope = cx.initStandardObjects(global);
cx.evaluateReader(scope, new InputStreamReader(browser.openConnection().getInputStream()), browser.getFile(), 1, null);
cx.evaluateReader(scope, new InputStreamReader(less.openConnection().getInputStream()), less.getFile(), 1, null);
cx.evaluateReader(scope, new InputStreamReader(engine.openConnection().getInputStream()), engine.getFile(), 1, null);
cs = (Function) scope.get("compileString", scope);
cf = (Function) scope.get("compileFile", scope);
Context.exit();
} catch (Exception e) {
logger.error("LESS Engine intialization failed.", e);
}
}
public String compile(String input) throws LessException {
try {
long time = System.currentTimeMillis();
String result = call(cs, new Object[] {input});
logger.debug("The compilation of '" + input + "' took " + (System.currentTimeMillis () - time) + " ms.");
return result;
} catch (Exception e) {
throw parseLessException(e);
}
}
public String compile(URL input) throws LessException {
try {
long time = System.currentTimeMillis();
logger.debug("Compiling URL: " + input.getProtocol() + ":" + input.getFile());
String result = call(cf, new Object[] {input.getProtocol() + ":" + input.getFile(), getClass().getClassLoader()});
logger.debug("The compilation of '" + input + "' took " + (System.currentTimeMillis () - time) + " ms.");
return result;
} catch (Exception e) {
throw parseLessException(e);
}
}
public String compile(File input) throws LessException {
try {
long time = System.currentTimeMillis();
logger.debug("Compiling File: " + "file:" + input.getAbsolutePath());
String result = call(cf, new Object[] {"file:" + input.getAbsolutePath(), getClass().getClassLoader()});
logger.debug("The compilation of '" + input + "' took " + (System.currentTimeMillis () - time) + " ms.");
return result;
} catch (Exception e) {
throw parseLessException(e);
}
}
public void compile(File input, File output) throws LessException, IOException {
try {
String content = compile(input);
if (!output.exists()) {
output.createNewFile();
}
BufferedWriter bw = new BufferedWriter(new FileWriter(output));
bw.write(content);
bw.close();
} catch (Exception e) {
throw parseLessException(e);
}
}
private synchronized String call(Function fn, Object[] args) {
return (String) Context.call(null, fn, scope, scope, args);
}
private LessException parseLessException(Exception root) throws LessException {
logger.debug("Parsing LESS Exception", root);
if (root instanceof JavaScriptException) {
Scriptable value = (Scriptable) ((JavaScriptException) root).getValue();
boolean hasName = ScriptableObject.hasProperty(value, "name");
boolean hasType = ScriptableObject.hasProperty(value, "type");
if (hasName || hasType) {
String errorType = "Error";
if (hasName) {
String type = (String) ScriptableObject.getProperty(value, "name");
if ("ParseError".equals(type)) {
errorType = "Parse Error";
} else {
errorType = type + " Error";
}
} else if (hasType) {
Object prop = ScriptableObject.getProperty(value, "type");
if (prop instanceof String) {
errorType = (String) prop + " Error";
}
}
String message = (String) ScriptableObject.getProperty(value, "message");
String filename = "";
if (ScriptableObject.hasProperty(value, "filename")) {
filename = (String) ScriptableObject.getProperty(value, "filename");
}
int line = -1;
if (ScriptableObject.hasProperty(value, "line")) {
line = ((Double) ScriptableObject.getProperty(value, "line")).intValue();
}
int column = -1;
if (ScriptableObject.hasProperty(value, "column")) {
column = ((Double) ScriptableObject.getProperty(value, "column")).intValue();
}
List<String> extractList = new ArrayList<String>();
if (ScriptableObject.hasProperty(value, "extract")) {
NativeArray extract = (NativeArray) ScriptableObject.getProperty(value, "extract");
for (int i = 0; i < extract.getLength(); i++) {
if (extract.get(i, extract) instanceof String) {
extractList.add(((String) extract.get(i, extract)).replace("\t", " "));
}
}
}
throw new LessException(message, errorType, filename, line, column, extractList);
}
}
throw new LessException(root);
}
public static void main(String[] args) throws LessException, IOException {
LessEngine engine = new LessEngine();
if (args.length == 1) {
System.out.println(engine.compile(new File(args[0])));
} else if (args.length == 2) {
engine.compile(new File(args[0]), new File(args[1]));
} else {
System.err.println("Usage: java -jar lesscss-engine.jar <input_file> [<output_file>]");
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
570237fe08290afcaedab1a92afd357980851054
|
a00326c0e2fc8944112589cd2ad638b278f058b9
|
/src/main/java/000/134/423/CWE23_Relative_Path_Traversal__getQueryString_Servlet_52c.java
|
52e03031ec65860e828b9f2cd0772a56763fddde
|
[] |
no_license
|
Lanhbao/Static-Testing-for-Juliet-Test-Suite
|
6fd3f62713be7a084260eafa9ab221b1b9833be6
|
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
|
refs/heads/master
| 2020-08-24T13:34:04.004149
| 2019-10-25T09:26:00
| 2019-10-25T09:26:00
| 216,822,684
| 0
| 1
| null | 2019-11-08T09:51:54
| 2019-10-22T13:37:13
|
Java
|
UTF-8
|
Java
| false
| false
| 6,374
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE23_Relative_Path_Traversal__getQueryString_Servlet_52c.java
Label Definition File: CWE23_Relative_Path_Traversal.label.xml
Template File: sources-sink-52c.tmpl.java
*/
/*
* @description
* CWE: 23 Relative Path Traversal
* BadSource: getQueryString_Servlet Parse id param out of the URL query string (without using getParameter())
* GoodSource: A hardcoded string
* Sinks: readFile
* BadSink : no validation
* Flow Variant: 52 Data flow: data passed as an argument from one method to another to another in three different classes in the same package
*
* */
import java.io.*;
import javax.servlet.http.*;
import java.util.logging.Level;
public class CWE23_Relative_Path_Traversal__getQueryString_Servlet_52c
{
public void badSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String root;
if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
{
/* running on Windows */
root = "C:\\uploads\\";
}
else
{
/* running on non-Windows */
root = "/home/user/uploads/";
}
if (data != null)
{
/* POTENTIAL FLAW: no validation of concatenated value */
File file = new File(root + data);
FileInputStream streamFileInputSink = null;
InputStreamReader readerInputStreamSink = null;
BufferedReader readerBufferdSink = null;
if (file.exists() && file.isFile())
{
try
{
streamFileInputSink = new FileInputStream(file);
readerInputStreamSink = new InputStreamReader(streamFileInputSink, "UTF-8");
readerBufferdSink = new BufferedReader(readerInputStreamSink);
IO.writeLine(readerBufferdSink.readLine());
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* Close stream reading objects */
try
{
if (readerBufferdSink != null)
{
readerBufferdSink.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO);
}
try
{
if (readerInputStreamSink != null)
{
readerInputStreamSink.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO);
}
try
{
if (streamFileInputSink != null)
{
streamFileInputSink.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO);
}
}
}
}
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String root;
if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
{
/* running on Windows */
root = "C:\\uploads\\";
}
else
{
/* running on non-Windows */
root = "/home/user/uploads/";
}
if (data != null)
{
/* POTENTIAL FLAW: no validation of concatenated value */
File file = new File(root + data);
FileInputStream streamFileInputSink = null;
InputStreamReader readerInputStreamSink = null;
BufferedReader readerBufferdSink = null;
if (file.exists() && file.isFile())
{
try
{
streamFileInputSink = new FileInputStream(file);
readerInputStreamSink = new InputStreamReader(streamFileInputSink, "UTF-8");
readerBufferdSink = new BufferedReader(readerInputStreamSink);
IO.writeLine(readerBufferdSink.readLine());
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* Close stream reading objects */
try
{
if (readerBufferdSink != null)
{
readerBufferdSink.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO);
}
try
{
if (readerInputStreamSink != null)
{
readerInputStreamSink.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO);
}
try
{
if (streamFileInputSink != null)
{
streamFileInputSink.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO);
}
}
}
}
}
}
|
[
"anhtluet12@gmail.com"
] |
anhtluet12@gmail.com
|
7be3213b0567d0e99a37d731ddb33dd560ce57f5
|
e9f75246d9ab15d01d8370feca390d73b81f70ac
|
/wechat-sdk/src/main/java/com/wowfilm/wechatsdk/api/wechatmp/WxBaseService.java
|
9129676006503fdda80ea40d7551702e90f2ab63
|
[] |
no_license
|
wuyongwen/microservice
|
7096da2d4a022a224be340b552127075b0d94578
|
bc44850360dfc6c492fea09366e256ac72b82895
|
refs/heads/master
| 2021-01-20T21:00:53.054421
| 2016-07-29T09:19:05
| 2016-07-29T09:19:05
| 63,325,744
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 611
|
java
|
package com.wowfilm.wechatsdk.api.wechatmp;
import com.wowfilm.wechatsdk.store.WxMpConfigStorage;
/**
* The type Wx base service.
*
* @author warden
* @version v1.0
* @date Created on 2016-07-14 11:54:27
*/
public class WxBaseService{
protected TokenAccessor tokenAccessor;
protected WxServiceExecutor executor;
protected WxBaseService() {
}
public void init(WxMpConfigStorage config){
tokenAccessor = new TokenAccessor();
executor = new WxServiceExecutor();
tokenAccessor.setWxMpConfigStorage(config);
executor.setAccessor(tokenAccessor);
}
}
|
[
"wuyongwen@gmail.com"
] |
wuyongwen@gmail.com
|
e803e4879dd21f9a4f38da2167303bc7dcc9a889
|
136264d27911b54402406f35c041fc7a3f6210cc
|
/jeeweb-ui/jeeweb-beetl-tag/src/main/java/cn/jeeweb/beetl/tags/dict/Dict.java
|
3b36a0152bf7bda808a76f94b6ad9b4e89b4bc0e
|
[
"Apache-2.0"
] |
permissive
|
iteryijiang/jeeweb
|
41e525dd240c6855bf3fca5fd9105a0a8b0abd40
|
bf540eb4daf1b8889514b4f135e4820e2ebcb1fc
|
refs/heads/master
| 2022-11-26T03:52:03.372666
| 2019-08-01T12:45:05
| 2019-08-01T12:45:05
| 162,131,820
| 2
| 1
|
Apache-2.0
| 2022-11-24T02:52:51
| 2018-12-17T13:05:47
|
Java
|
UTF-8
|
Java
| false
| false
| 529
|
java
|
package cn.jeeweb.beetl.tags.dict;
import java.io.Serializable;
public class Dict implements Serializable {
/** 键值名称 */
private String label;
/** 值 */
private String value;
public Dict() {
}
public Dict(String label, String value) {
this.label = label;
this.value = value;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
|
[
"502079461@qq.com"
] |
502079461@qq.com
|
5f17a23605aba196bb6b342c74a8de009bbf6f6e
|
ca183b96a176e07ad24ec0c4d3b928ce1ca839bf
|
/Week-3/CR-MesoLabs-Interfaces-FarmerFroilan/src/main/java/com/zipcodewilmington/froilansfarm/Crops/Cornstalk.java
|
b6796177a6ef9717693a5a12fc66a4dfd4c36dd0
|
[] |
no_license
|
trtong/Labs_ZCW
|
cb343e0584dd2868ed882f9e1e104f25264f07a7
|
39f554fdf0385176c96e8a2e81727eb5186b5526
|
refs/heads/master
| 2020-04-17T13:25:39.044799
| 2019-01-20T03:02:25
| 2019-01-20T03:02:25
| 166,615,393
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 427
|
java
|
package com.zipcodewilmington.froilansfarm.Crops;
import com.zipcodewilmington.froilansfarm.Fertilizeable;
import com.zipcodewilmington.froilansfarm.Produce;
import com.zipcodewilmington.froilansfarm.ProduceResult;
public class Cornstalk extends Crop implements Produce, Fertilizeable {
public Cornstalk() {
super("Cornstalk");
}
public ProduceResult yield() {
return new EarOfCorn();
}
}
|
[
"trt.tong@gmail.com"
] |
trt.tong@gmail.com
|
11191113c97aa69fbd33feaa453a4875320a1c76
|
04a863701d531423a430beacd12bf84fe4763e1e
|
/tags/v1.0/src/com/google/code/jdde/event/ErrorEvent.java
|
1f70c124e29d840c999d3a77aebd8ff953373bbf
|
[] |
no_license
|
BGCX067/falcon-hab-svn-to-git
|
62755dd124b4c1a69abfe60aeb553c47368562f5
|
63497dca16ed2a1bd818d6eb274faa7953526586
|
refs/heads/master
| 2016-09-01T08:56:07.749449
| 2015-12-28T14:27:36
| 2015-12-28T14:27:36
| 48,870,886
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,127
|
java
|
/*
* Copyright 2008 Vitor Costa
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.code.jdde.event;
import com.google.code.jdde.client.ClientConversation;
import com.google.code.jdde.client.DdeClient;
import com.google.code.jdde.ddeml.CallbackParameters;
import com.google.code.jdde.ddeml.constants.DmlError;
import com.google.code.jdde.misc.Conversation;
import com.google.code.jdde.misc.DdeApplication;
import com.google.code.jdde.server.DdeServer;
import com.google.code.jdde.server.ServerConversation;
/**
*
* @author Vitor Costa
*
* @param <A>
* @param <C>
*/
public abstract class ErrorEvent<A extends DdeApplication, C extends Conversation>
extends ConversationEvent<A, C> {
private final DmlError error;
public ErrorEvent(A application, C conversation, CallbackParameters parameters) {
super(application, conversation);
Integer errorCode = (Integer) parameters.getDwData1();
error = DmlError.findErrorByNativeValue(errorCode);
}
public DmlError getError() {
return error;
}
public static class ClientErrorEvent extends ErrorEvent<DdeClient, ClientConversation> {
public ClientErrorEvent(DdeClient client,
ClientConversation conversation, CallbackParameters parameters) {
super(client, conversation, parameters);
}
}
public static class ServerErrorEvent extends ErrorEvent<DdeServer, ServerConversation> {
public ServerErrorEvent(DdeServer server,
ServerConversation conversation, CallbackParameters parameters) {
super(server, conversation, parameters);
}
}
}
|
[
"you@example.com"
] |
you@example.com
|
8c41cceb9324b8936bdbb2eb45c52edaa01c11fe
|
0cacbeb95527b889373cd8398ee728150d1ad2e3
|
/src/main/java/org/ssssssss/magicapi/model/FunctionInfo.java
|
72a57c9440663188ca0ae245d401675d8b0fb240
|
[
"MIT"
] |
permissive
|
leon1509/magic-api
|
a114863f156432f11fc9f85778f203459897aa3f
|
db363a7590052f8fdd0f3cca865cc00bb84e1fbb
|
refs/heads/master
| 2023-03-08T10:29:36.524778
| 2021-02-28T07:17:52
| 2021-02-28T07:17:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,206
|
java
|
package org.ssssssss.magicapi.model;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
public class FunctionInfo extends MagicEntity {
private String path;
private String description;
private String parameter;
private String returnType;
private String mappingPath;
private List<String> parameterNames = Collections.emptyList();
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getParameter() {
return parameter;
}
public void setParameter(String parameter) {
this.parameter = parameter;
try {
this.parameterNames = new ObjectMapper().readTree(parameter).findValues("name")
.stream().map(JsonNode::asText)
.collect(Collectors.toList());
} catch (Throwable ignored) {
}
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getMappingPath() {
return mappingPath;
}
public void setMappingPath(String mappingPath) {
this.mappingPath = mappingPath;
}
public List<String> getParameterNames() {
return parameterNames;
}
public String getReturnType() {
return returnType;
}
public void setReturnType(String returnType) {
this.returnType = returnType;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FunctionInfo functionInfo = (FunctionInfo) o;
return Objects.equals(id, functionInfo.id) &&
Objects.equals(path, functionInfo.path) &&
Objects.equals(script, functionInfo.script) &&
Objects.equals(name, functionInfo.name) &&
Objects.equals(groupId, functionInfo.groupId) &&
Objects.equals(description, functionInfo.description) &&
Objects.equals(parameter, functionInfo.parameter) &&
Objects.equals(returnType, functionInfo.returnType);
}
@Override
public int hashCode() {
return Objects.hash(id, path, script, name, groupId, parameter, description, returnType);
}
}
|
[
"838425805@qq.com"
] |
838425805@qq.com
|
a4b22eef7339e8dd287be88f546d00e9814dc23e
|
7626c8fc8742859f369834eaab3a6120dd2c5f6f
|
/src/main/java/org/rcsb/cif/model/generated/RefineOccupancy.java
|
f86ed4f02ab19bb36b3bdd911caa4591d85c00d5
|
[
"MIT"
] |
permissive
|
BobHanson/ciftools-SwingJS
|
58c02723827c7c2b6e7716b7cd9c870076ce0f54
|
e5266a8bfe6e6d5feeab85dc97b0f67e6b0e2594
|
refs/heads/master
| 2020-09-12T10:28:07.592153
| 2019-11-29T21:18:43
| 2019-11-29T21:18:43
| 222,393,459
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,452
|
java
|
package org.rcsb.cif.model.generated;
import org.rcsb.cif.model.*;
import javax.annotation.Generated;
import java.util.Map;
/**
* Data items in the REFINE_OCCUPANCY category record details
* about the treatment of atom occupancies during refinement.
*/
@Generated("org.rcsb.cif.generator.SchemaGenerator")
public class RefineOccupancy extends BaseCategory {
public RefineOccupancy(String name, Map<String, Column> columns) {
super(name, columns);
}
public RefineOccupancy(String name, int rowCount, Object[] encodedColumns) {
super(name, rowCount, encodedColumns);
}
public RefineOccupancy(String name) {
super(name);
}
/**
* This data item uniquely identifies a refinement within an entry.
* _refine_occupancy.pdbx_refine_id can be used to distinguish the results
* of joint refinements.
* @return StrColumn
*/
public StrColumn getPdbxRefineId() {
return (StrColumn) (isText ? textFields.computeIfAbsent("pdbx_refine_id", StrColumn::new) :
getBinaryColumn("pdbx_refine_id"));
}
/**
* The class of atoms treated similarly for occupancy refinement.
* @return StrColumn
*/
public StrColumn getClazz() {
return (StrColumn) (isText ? textFields.computeIfAbsent("class", StrColumn::new) :
getBinaryColumn("class"));
}
/**
* A description of special aspects of the occupancy refinement for
* a class of atoms described in _refine_occupancy.class.
* @return StrColumn
*/
public StrColumn getDetails() {
return (StrColumn) (isText ? textFields.computeIfAbsent("details", StrColumn::new) :
getBinaryColumn("details"));
}
/**
* The treatment of occupancies for a class of atoms
* described in _refine_occupancy.class.
* @return StrColumn
*/
public StrColumn getTreatment() {
return (StrColumn) (isText ? textFields.computeIfAbsent("treatment", StrColumn::new) :
getBinaryColumn("treatment"));
}
/**
* The value of occupancy assigned to a class of atoms defined in
* _refine_occupancy.class. Meaningful only for atoms with fixed
* occupancy.
* @return FloatColumn
*/
public FloatColumn getValue() {
return (FloatColumn) (isText ? textFields.computeIfAbsent("value", FloatColumn::new) :
getBinaryColumn("value"));
}
}
|
[
"bittrich@hs-mittweida.de"
] |
bittrich@hs-mittweida.de
|
85a9143953f4107923a04c36958e55765f5e9966
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/30/30_c0ed418b1329fc74aed8ca2b0e9fb132c17a68b9/LEGrid/30_c0ed418b1329fc74aed8ca2b0e9fb132c17a68b9_LEGrid_s.java
|
356fd06a689dafd1c6812574cf06582b49a0cf11
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 6,834
|
java
|
package vooga.scroller.level_editor;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;
import java.util.HashSet;
import java.util.Set;
import javax.swing.Scrollable;
import util.Location;
import vooga.scroller.scrollingmanager.ScrollingManager;
import vooga.scroller.util.Editable;
import vooga.scroller.util.Sprite;
import vooga.scroller.view.View;
import vooga.scroller.viewUtil.Renderable;
public class LEGrid implements Editable, Renderable, Scrollable {
public static final int DEFAULT_SPRITE_SIZE = 32;
private int mySpriteSize;
private SpriteBox[][] myGrid;
private Dimension mySize;
private Set<SpriteBox> myPaintableBoxes;
private ScrollingManager myScrollingManager;
private StartPoint myStartPoint;
public LEGrid (int numWidthBlocks, int numHeightBlocks) {
mySpriteSize = DEFAULT_SPRITE_SIZE;
mySize = new Dimension(numWidthBlocks, numHeightBlocks);
myGrid = new SpriteBox[numWidthBlocks][numHeightBlocks];
initializeGrid();
myPaintableBoxes = new HashSet<SpriteBox>();
}
public int getSpriteSize () {
return mySpriteSize;
}
@Override
public Object getState () {
// TODO Auto-generated method stub
return null;
}
@Override
public void paint (Graphics2D pen) {
for(int i = 0; i < mySize.width; i++){
for( int j = 0; j < mySize.height; j++){
myGrid[i][j].paint(pen);
}
}
}
@Override
public void addSprite (Sprite spr, int x, int y) {
SpriteBox currentBox = getBox(x, y);
addToBox(spr, currentBox);
}
public void addSpriteToBox(int xcoor, int ycoor, Sprite sprite){
addToBox(sprite,getBoxFromCoor(xcoor,ycoor));
}
/**
* @param spr
* @param currentBox
*/
private void addToBox (Sprite spr, SpriteBox currentBox) {
if (checkAvailable(currentBox, spr.getWidth(), spr.getHeight())) {
currentBox.addSprite(spr);
myPaintableBoxes.add(currentBox);
combineBoxes(currentBox, currentBox, spr.getWidth(), spr.getHeight());
}
else {
// TODO send Unavailable feedback
}
}
@Override
public void deleteSprite (int x, int y) {
SpriteBox currentBox = getBox(x, y);
currentBox.deleteSprite();
myPaintableBoxes.remove(currentBox);
}
@Override
public void changeBackground () {
//TODO
}
public Level createLevel (int id,
ScrollingManager sm,
View v) {
//TODO need to refactor. Editable Level.
Level lev = new Level(id, sm, v);
for (SpriteBox box : myPaintableBoxes) {
lev.addSprite(box.getSprite());
}
return lev;
}
public SpriteBox getBoxFromCoor(int xcoor, int ycoor){
return myGrid[xcoor][ycoor];
}
public Sprite getSprite(int xcoor, int ycoor){
return getBoxFromCoor(xcoor,ycoor).getSprite();
}
public Dimension getSize(){
return mySize;
}
private boolean checkAvailable (SpriteBox current, double width, double height) {
if (!current.isAvailable()) { return false; }
boolean bool1 = true;
boolean bool2 = true;
if (width > mySpriteSize) {
SpriteBox next = getBox(current.getX() + mySpriteSize, current.getY());
bool1 = checkAvailable(next, width - mySpriteSize, height);
}
if (height > mySpriteSize && bool1) {
SpriteBox nextBox = getBox(current.getX(), current.getY() + mySpriteSize);
bool2 = checkAvailable(nextBox, width, height - mySpriteSize);
}
return bool1 && bool2;
}
private void combineBoxes (SpriteBox initial, SpriteBox current, double width, double height) {
if (width > mySpriteSize) {
SpriteBox next = getBox(current.getX() + mySpriteSize, current.getY());
initial.combineWith(next);
combineBoxes(initial, next, width - mySpriteSize, height);
}
if (height > mySpriteSize) {
SpriteBox next = getBox(current.getX(), current.getY() + mySpriteSize);
initial.combineWith(next);
combineBoxes(initial, next, width, height - mySpriteSize);
}
}
private SpriteBox getBox (double x, double y) {
int xCoord = (int) Math.floor(x / mySpriteSize);
int yCoord = (int) Math.floor(y / mySpriteSize);
return myGrid[xCoord][yCoord];
}
private void initializeGrid () {
for (int x = 0; x < mySize.getWidth(); x++) {
for (int y = 0; y < mySize.getHeight(); y++) {
myGrid[x][y] = new SpriteBox(this, x, y);
}
}
}
@Override
public Dimension getPreferredScrollableViewportSize () {
// TODO Auto-generated method stub
return null;
}
@Override
public int getScrollableUnitIncrement (Rectangle visibleRect, int orientation, int direction) {
return DEFAULT_SPRITE_SIZE;
}
@Override
public int getScrollableBlockIncrement (Rectangle visibleRect, int orientation, int direction) {
return DEFAULT_SPRITE_SIZE;
}
@Override
public boolean getScrollableTracksViewportWidth () {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean getScrollableTracksViewportHeight () {
// TODO Auto-generated method stub
return false;
}
/**
* Get the overall pixels size of this LEGrid.
* @return
*/
public Dimension getPixelSize () {
Dimension res= new Dimension(
mySize.width*DEFAULT_SPRITE_SIZE,
mySize.height*DEFAULT_SPRITE_SIZE);
return res;
}
public boolean isValidForSimulation () {
// TODO Check for valid starting and exit points.
return false;
}
@Override
public void addStartPoint (int x, int y) {
if(myStartPoint == null){
myStartPoint = new StartPoint();
}
else{
deleteSprite((int) myStartPoint.getX(),(int) myStartPoint.getY());
}
addSprite(myStartPoint, x, y);
}
public Location removeStartPoint(){
Location center = myStartPoint.getCenter();
deleteSprite((int) center.getX(),(int) center.getY());
return myStartPoint.getCenter();
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
72776fac76f631aeb574205a45106e8a8b24081c
|
e8f9fe2285f1598fee5860d2447fd1a1f6557306
|
/MPC/temp/src/minecraft/net/minecraft/src/StepSoundStone.java
|
8a064e6a21c66c7f4dd14cb81cbea2b66efae8f7
|
[] |
no_license
|
pedroreisuft/minecraft
|
8e71c74ee37ffbf863b0e89c7051ed2b3ce80a7f
|
64ba09bce02603abea3270e4030be2aac4555822
|
refs/heads/master
| 2016-09-06T01:24:36.812128
| 2012-11-30T19:34:19
| 2012-11-30T19:34:19
| 6,943,629
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 383
|
java
|
package net.minecraft.src;
import net.minecraft.src.StepSound;
final class StepSoundStone extends StepSound {
StepSoundStone(String p_i4006_1_, float p_i4006_2_, float p_i4006_3_) {
super(p_i4006_1_, p_i4006_2_, p_i4006_3_);
}
public String func_72676_a() {
return "random.glass";
}
public String func_82593_b() {
return "step.stone";
}
}
|
[
"phsmreis@gmail.com"
] |
phsmreis@gmail.com
|
f52e47c03d61c1e147b1b33ebf286bbd29ad8518
|
699655755607101a4b4dc6d9adf149a1ef567573
|
/src/infra/renderer/AnimationPlayer.java
|
5858e9dfd60eb2eae71fa482ed09c0e23914e876
|
[] |
no_license
|
sbyt2/JavaDigDugGame
|
460f13b9bf393610e85104705f95ea7f7e4d8695
|
88fea5e52c62045d6dc0a6b2fb1b78180645064e
|
refs/heads/master
| 2023-03-19T14:19:32.653369
| 2020-11-19T11:41:35
| 2020-11-19T11:41:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,175
|
java
|
package infra.renderer;
import infra.Direction;
import java.awt.Graphics2D;
import java.util.HashMap;
import java.util.Map;
/**
* AnimationPlayer class.
*
* @author Leonardo Ono (ono.leo80@gmail.com)
*/
public class AnimationPlayer {
public static class Animation {
public String name;
public int startFrame;
public int endFrame;
public double speed;
public boolean looping;
public double currentFrame;
public boolean finished;
public boolean paused;
public Animation(String name, int startFrame
, int endFrame, double speed, boolean looping) {
this.name = name;
this.currentFrame = startFrame;
this.startFrame = startFrame;
this.endFrame = endFrame;
this.looping = looping;
this.speed = speed;
}
}
private final Map<String, Animation> animations = new HashMap<>();
private final Sprite sprite;
private Animation currentAnimation;
public AnimationPlayer(String resource, int size) {
sprite = new Sprite(resource, size);
}
public Sprite getSprite() {
return sprite;
}
public Animation getCurrentAnimation() {
return currentAnimation;
}
public boolean isFinished() {
return currentAnimation != null ? currentAnimation.finished : true;
}
public void addAnimation(String animationName, int startFrame
, int endFrame, double speed, boolean looping) {
animations.put(animationName, new Animation(animationName
, startFrame, endFrame, speed, looping));
}
public void play(String animationName, boolean restartFrame) {
currentAnimation = animations.get(animationName);
if (restartFrame) {
currentAnimation.currentFrame = currentAnimation.startFrame;
}
currentAnimation.finished = false;
currentAnimation.paused = false;
}
public void play(String animationName) {
play(animationName, false);
}
public void update() {
if (currentAnimation != null) {
if (currentAnimation.paused) {
return;
}
currentAnimation.currentFrame += currentAnimation.speed;
if (currentAnimation.currentFrame >= currentAnimation.endFrame + 1){
if (currentAnimation.looping) {
currentAnimation.currentFrame = currentAnimation.startFrame;
}
else {
currentAnimation.currentFrame = currentAnimation.endFrame;
currentAnimation.finished = true;
}
}
sprite.setFrame((int) currentAnimation.currentFrame);
}
}
public void draw(Graphics2D g, int x, int y) {
sprite.draw(g, x, y);
}
public void setDirection(Direction direction) {
sprite.setDirection(direction);
}
public void pause() {
if (currentAnimation != null) {
currentAnimation.paused = true;
}
}
}
|
[
"ono.leo@gmail.com"
] |
ono.leo@gmail.com
|
13c8941bfc04785b349dc69ac6c3a0af621db02d
|
f538b56104c45e04f70ef3473a971d4a67e1b089
|
/java/nebula/org.netxms.nebula.widgets.gallery.tests/src/org/netxms/nebula/widgets/gallery/tests/AllTests.java
|
4ac82ed5ef23712358491745341f2dca30c27836
|
[] |
no_license
|
phongtran0715/SpiderClient
|
85d5d0559c6af0393cd058c25584074d80f8df9a
|
fdc264a85b7ff52c5dc2b6bb3cc83da62aad2aff
|
refs/heads/master
| 2020-03-20T20:07:12.075655
| 2018-08-10T08:37:10
| 2018-08-10T08:37:10
| 137,671,006
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 631
|
java
|
package org.netxms.nebula.widgets.gallery.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite(
"Test for org.netxms.nebula.widgets.gallery.tests");
// $JUnit-BEGIN$
suite.addTestSuite(GalleryVirtualBehaviorTest.class);
suite.addTestSuite(Bug212182Test.class);
suite.addTestSuite(GalleryTest.class);
suite.addTestSuite(Bug217988Test.class);
suite.addTestSuite(Bug216204Test.class);
suite.addTestSuite(Bug276435Test.class);
suite.addTestSuite(Bug280635Test.class);
// $JUnit-END$
return suite;
}
}
|
[
"phongtran0715@gmail.com"
] |
phongtran0715@gmail.com
|
77fc345f1c2e8519a46f6fb4e6c7d011b6f2724c
|
1b30fbe42980eb42a7e3e5af7110ebfbea88cb20
|
/src/main/java/org/scijava/ItemIO.java
|
eacc2395825fd4243a87163c07112a25fff45078
|
[
"Apache-2.0",
"BSD-2-Clause"
] |
permissive
|
hinerm/scijava-common
|
d70c96a7b480e4e08fa8de8eb0197d10fcfb30c7
|
de88c632368bf6310757373693596f2f683fc4ee
|
refs/heads/master
| 2023-06-11T05:26:26.900281
| 2021-06-22T16:05:47
| 2021-06-28T19:59:17
| 343,931,804
| 0
| 1
|
BSD-2-Clause
| 2021-06-22T18:26:06
| 2021-03-02T22:35:34
|
Java
|
UTF-8
|
Java
| false
| false
| 1,901
|
java
|
/*
* #%L
* SciJava Common shared library for SciJava software.
* %%
* Copyright (C) 2009 - 2020 SciJava developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package org.scijava;
/**
* Defines the input/output type of a module.
* <p>
* Choices are:
* </p>
* <ul>
* <li>INPUT: item is an input for the module.</li>
* <li>OUTPUT: item is an output for the module.</li>
* <li>BOTH: item is both an input and an output for the module. This type is
* used to indicate an object that is mutated somehow during execution.</li>
* </ul>
*
* @author Curtis Rueden
*/
public enum ItemIO {
INPUT, OUTPUT, BOTH
}
|
[
"ctrueden@wisc.edu"
] |
ctrueden@wisc.edu
|
c59c7b44bff6e24cb20f5af5aa5bcebfb881df49
|
70f7a06017ece67137586e1567726579206d71c7
|
/alimama/src/main/java/com/vivo/push/b/aa.java
|
eea4bfb198377f7d88e1e1543a45bb3191f6efad
|
[] |
no_license
|
liepeiming/xposed_chatbot
|
5a3842bd07250bafaffa9f468562021cfc38ca25
|
0be08fc3e1a95028f8c074f02ca9714dc3c4dc31
|
refs/heads/master
| 2022-12-20T16:48:21.747036
| 2020-10-14T02:37:49
| 2020-10-14T02:37:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 983
|
java
|
package com.vivo.push.b;
import com.taobao.weex.el.parse.Operators;
import com.vivo.push.a;
import com.vivo.push.y;
import java.io.Serializable;
import java.util.HashMap;
/* compiled from: ReporterCommand */
public final class aa extends y {
private HashMap<String, String> a;
private long b;
public aa() {
super(2012);
}
public aa(long j) {
this();
this.b = j;
}
public final void a(HashMap<String, String> hashMap) {
this.a = hashMap;
}
public final void c(a aVar) {
aVar.a("ReporterCommand.EXTRA_PARAMS", (Serializable) this.a);
aVar.a("ReporterCommand.EXTRA_REPORTER_TYPE", this.b);
}
public final void d(a aVar) {
this.a = (HashMap) aVar.c("ReporterCommand.EXTRA_PARAMS");
this.b = aVar.b("ReporterCommand.EXTRA_REPORTER_TYPE", this.b);
}
public final String toString() {
return "ReporterCommand(" + this.b + Operators.BRACKET_END_STR;
}
}
|
[
"zhangquan@snqu.com"
] |
zhangquan@snqu.com
|
afe5a51f2e3701e3cf7f17389505f50d5e1f743d
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/single-large-project/src/test/java/org/gradle/test/performancenull_378/Testnull_37791.java
|
bfd3c79dea385b0e1a7d111c35a40644378d6eec
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276
| 2022-11-24T05:18:33
| 2022-11-24T05:18:33
| 80,121,268
| 17
| 15
| null | 2022-09-30T08:04:35
| 2017-01-26T14:25:33
| null |
UTF-8
|
Java
| false
| false
| 308
|
java
|
package org.gradle.test.performancenull_378;
import static org.junit.Assert.*;
public class Testnull_37791 {
private final Productionnull_37791 production = new Productionnull_37791("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
13c6c63d4c6b2dc6a616c73fa488cd078d6b735c
|
0c452901bc9eb53bc1f6661d8eb44cfb0eb71ada
|
/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/valuesets/PatientContactRelationshipEnumFactory.java
|
74b91a16185ae1a0ddca46cd11ce78807457eaaf
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] |
permissive
|
sac10nikam/hapi-fhir
|
08d5dd9ef74b846c795965dc10450a5833199b3d
|
78776a3e79f319ec28111d679068d9208ee585d7
|
refs/heads/master
| 2021-01-16T22:59:19.067021
| 2015-08-10T19:59:57
| 2015-08-10T19:59:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,050
|
java
|
package org.hl7.fhir.instance.model.valuesets;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Fri, Aug 7, 2015 06:45-0400 for FHIR v0.5.0
import org.hl7.fhir.instance.model.EnumFactory;
public class PatientContactRelationshipEnumFactory implements EnumFactory<PatientContactRelationship> {
public PatientContactRelationship fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("emergency".equals(codeString))
return PatientContactRelationship.EMERGENCY;
if ("family".equals(codeString))
return PatientContactRelationship.FAMILY;
if ("guardian".equals(codeString))
return PatientContactRelationship.GUARDIAN;
if ("friend".equals(codeString))
return PatientContactRelationship.FRIEND;
if ("partner".equals(codeString))
return PatientContactRelationship.PARTNER;
if ("work".equals(codeString))
return PatientContactRelationship.WORK;
if ("caregiver".equals(codeString))
return PatientContactRelationship.CAREGIVER;
if ("agent".equals(codeString))
return PatientContactRelationship.AGENT;
if ("guarantor".equals(codeString))
return PatientContactRelationship.GUARANTOR;
if ("owner".equals(codeString))
return PatientContactRelationship.OWNER;
if ("parent".equals(codeString))
return PatientContactRelationship.PARENT;
throw new IllegalArgumentException("Unknown PatientContactRelationship code '"+codeString+"'");
}
public String toCode(PatientContactRelationship code) {
if (code == PatientContactRelationship.EMERGENCY)
return "emergency";
if (code == PatientContactRelationship.FAMILY)
return "family";
if (code == PatientContactRelationship.GUARDIAN)
return "guardian";
if (code == PatientContactRelationship.FRIEND)
return "friend";
if (code == PatientContactRelationship.PARTNER)
return "partner";
if (code == PatientContactRelationship.WORK)
return "work";
if (code == PatientContactRelationship.CAREGIVER)
return "caregiver";
if (code == PatientContactRelationship.AGENT)
return "agent";
if (code == PatientContactRelationship.GUARANTOR)
return "guarantor";
if (code == PatientContactRelationship.OWNER)
return "owner";
if (code == PatientContactRelationship.PARENT)
return "parent";
return "?";
}
}
|
[
"jamesagnew@gmail.com"
] |
jamesagnew@gmail.com
|
e99ad0fc1e66997d3263ddea1d8e9dcb10cf12ff
|
847ef9c1ebfc1cb85eb63cec8b20ac1d2ff9d3d9
|
/src/main/java/top/itning/yunshu/classscheduleserver/entity/AppUpdate.java
|
6457ba1a93410b20410c5309f3ee272cf7d468a4
|
[
"Apache-2.0"
] |
permissive
|
itning/YunShuClassScheduleServer
|
b6b268357481c095c5c3a852ef8d497bb1b1113c
|
d4bf9e6bb615a90366d6c3bddc179c10240942ad
|
refs/heads/master
| 2020-03-27T20:28:21.708124
| 2019-03-30T08:39:19
| 2019-03-30T08:39:19
| 146,391,510
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,707
|
java
|
package top.itning.yunshu.classscheduleserver.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
/**
* 应用升级实体信息
*
* @author itning
*/
@Entity
public class AppUpdate implements Serializable {
/**
* 版本号
*/
@Id
private int versionCode;
/**
* 版本名
*/
@Column(unique = true, nullable = false)
private String versionName;
/**
* 描述
*/
@Column(unique = true, nullable = false)
private String versionDesc;
/**
* 下载地址
*/
@Column(unique = true, nullable = false)
private String downloadUrl;
public int getVersionCode() {
return versionCode;
}
public void setVersionCode(int versionCode) {
this.versionCode = versionCode;
}
public String getVersionName() {
return versionName;
}
public void setVersionName(String versionName) {
this.versionName = versionName;
}
public String getVersionDesc() {
return versionDesc;
}
public void setVersionDesc(String versionDesc) {
this.versionDesc = versionDesc;
}
public String getDownloadUrl() {
return downloadUrl;
}
public void setDownloadUrl(String downloadUrl) {
this.downloadUrl = downloadUrl;
}
@Override
public String toString() {
return "AppUpdate{" +
"versionCode='" + versionCode + '\'' +
", versionName='" + versionName + '\'' +
", versionDesc='" + versionDesc + '\'' +
", downloadUrl='" + downloadUrl + '\'' +
'}';
}
}
|
[
"itning@itning.top"
] |
itning@itning.top
|
a46d0b98293736c5adbbd72d26addc24bbabecb9
|
a54bb73655149773e2a884e7bff518c902a3a5b2
|
/java-core/src/com/source/org/omg/DynamicAny/NameValuePairSeqHelper.java
|
f0bc9597ff4d803fd3d27172c3b1b37a606330a4
|
[] |
no_license
|
fredomli/java-standard
|
071823b680555039f1284ce55a2909397392c989
|
c6e296c8d8e4a8626faa69bf0732e0ac4b3bb360
|
refs/heads/main
| 2023-08-29T22:43:53.023691
| 2021-11-05T15:31:14
| 2021-11-05T15:31:14
| 390,624,004
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,082
|
java
|
package org.omg.DynamicAny;
/**
* org/omg/DynamicAny/NameValuePairSeqHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/jenkins/workspace/8-2-build-windows-amd64-cygwin/jdk8u291/1294/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl
* Friday, April 9, 2021 12:03:37 AM PDT
*/
abstract public class NameValuePairSeqHelper
{
private static String _id = "IDL:omg.org/DynamicAny/NameValuePairSeq:1.0";
public static void insert (org.omg.CORBA.Any a, org.omg.DynamicAny.NameValuePair[] that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static org.omg.DynamicAny.NameValuePair[] extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = org.omg.DynamicAny.NameValuePairHelper.type ();
__typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.DynamicAny.NameValuePairSeqHelper.id (), "NameValuePairSeq", __typeCode);
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static org.omg.DynamicAny.NameValuePair[] read (org.omg.CORBA.portable.InputStream istream)
{
org.omg.DynamicAny.NameValuePair value[] = null;
int _len0 = istream.read_long ();
value = new org.omg.DynamicAny.NameValuePair[_len0];
for (int _o1 = 0;_o1 < value.length; ++_o1)
value[_o1] = org.omg.DynamicAny.NameValuePairHelper.read (istream);
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.DynamicAny.NameValuePair[] value)
{
ostream.write_long (value.length);
for (int _i0 = 0;_i0 < value.length; ++_i0)
org.omg.DynamicAny.NameValuePairHelper.write (ostream, value[_i0]);
}
}
|
[
"fredomli@163.com"
] |
fredomli@163.com
|
20b2a9852ec7e63dd2a35c8596b78614cbc17a98
|
55dca62e858f1a44c2186774339823a301b48dc7
|
/code/my-app/functions/8/remove_Map.java
|
831a69e8fc8392490d716ed253a16e29f0777b14
|
[] |
no_license
|
jwiszowata/code_reaper
|
4fff256250299225879d1412eb1f70b136d7a174
|
17dde61138cec117047a6ebb412ee1972886f143
|
refs/heads/master
| 2022-12-15T14:46:30.640628
| 2022-02-10T14:02:45
| 2022-02-10T14:02:45
| 84,747,455
| 0
| 0
| null | 2022-12-07T23:48:18
| 2017-03-12T18:26:11
|
Java
|
UTF-8
|
Java
| false
| false
| 217
|
java
|
public boolean remove(Locatable locatable) {
if (locatable instanceof Unit) {
Tile tile = locatable.getTile();
if (tile != null)
return tile.remove(locatable);
}
return false;
}
|
[
"wiszowata.joanna@gmail.com"
] |
wiszowata.joanna@gmail.com
|
4be5a4d22112eeac5814dc6e9e2ea0166d0fe7b2
|
a129386863ccf46cab82819db1dcffac78dd73a0
|
/target/generated-sources/jooq/org/jooq/sources/udt/pojos/Reclassarg.java
|
740526b9ddbfa1f28419f29c9ee2c7d3999257dd
|
[] |
no_license
|
alsamancov/jooqzkgis
|
5f01ef8cebfb9c3a9e6e535080987d94fad3290d
|
9082a66c349a1715e5ecdff41671e535eaa45ce4
|
refs/heads/master
| 2021-09-08T12:31:49.647475
| 2018-03-09T16:48:24
| 2018-03-09T16:48:24
| 124,567,389
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| true
| 2,127
|
java
|
/*
* This file is generated by jOOQ.
*/
package org.jooq.sources.udt.pojos;
import java.io.Serializable;
import javax.annotation.Generated;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.10.3"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Reclassarg implements Serializable {
private static final long serialVersionUID = 2009525128;
private Integer nband;
private String reclassexpr;
private String pixeltype;
private Double nodataval;
public Reclassarg() {}
public Reclassarg(Reclassarg value) {
this.nband = value.nband;
this.reclassexpr = value.reclassexpr;
this.pixeltype = value.pixeltype;
this.nodataval = value.nodataval;
}
public Reclassarg(
Integer nband,
String reclassexpr,
String pixeltype,
Double nodataval
) {
this.nband = nband;
this.reclassexpr = reclassexpr;
this.pixeltype = pixeltype;
this.nodataval = nodataval;
}
public Integer getNband() {
return this.nband;
}
public void setNband(Integer nband) {
this.nband = nband;
}
public String getReclassexpr() {
return this.reclassexpr;
}
public void setReclassexpr(String reclassexpr) {
this.reclassexpr = reclassexpr;
}
public String getPixeltype() {
return this.pixeltype;
}
public void setPixeltype(String pixeltype) {
this.pixeltype = pixeltype;
}
public Double getNodataval() {
return this.nodataval;
}
public void setNodataval(Double nodataval) {
this.nodataval = nodataval;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Reclassarg (");
sb.append(nband);
sb.append(", ").append(reclassexpr);
sb.append(", ").append(pixeltype);
sb.append(", ").append(nodataval);
sb.append(")");
return sb.toString();
}
}
|
[
"alsamancov@gmail.com"
] |
alsamancov@gmail.com
|
d58bdae63ebfb4eb539bee8f4cff50ed7670fe6c
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/JetBrains--intellij-community/b0408c935492cebf0357e24f03450ec3c72acbc9/before/ToggleDumbModeAction.java
|
086694badabb13b8a1c1ca49309d53b07966c98e
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,334
|
java
|
/*
* Copyright 2000-2014 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.internal;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.DumbModeTask;
import com.intellij.openapi.project.DumbServiceImpl;
import com.intellij.openapi.project.Project;
import com.intellij.util.TimeoutUtil;
import org.jetbrains.annotations.NotNull;
/**
* @author peter
*/
public class ToggleDumbModeAction extends AnAction implements DumbAware {
private volatile boolean myDumb = false;
public void actionPerformed(final AnActionEvent e) {
if (myDumb) {
myDumb = false;
}
else {
myDumb = true;
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) return;
DumbServiceImpl.getInstance(project).queueTask(new DumbModeTask() {
@Override
public void performInDumbMode(@NotNull ProgressIndicator indicator) {
while (myDumb) {
indicator.checkCanceled();
TimeoutUtil.sleep(100);
}
}
});
}
}
@Override
public void update(final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
presentation.setEnabled(project != null && myDumb == DumbServiceImpl.getInstance(project).isDumb());
if (myDumb) {
presentation.setText("Exit dumb mode");
}
else {
presentation.setText("Enter dumb mode");
}
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
425cae469af7999d2e454c93b927dd6b7b3c8734
|
56540ad45b01b1086eb2a79099723a49a0d49347
|
/bbc/JavaProject/MR/485/src/CreatePDF.java
|
859e64d556acf9c66ec61a0a8e333eeb72af33f8
|
[] |
no_license
|
xicpio/bbc
|
6d475a9a7f487f4fd5a0fd8d2ac67dfcfade083b
|
c23f4336a9c48c4c07d77af93be738108ee2e1c8
|
refs/heads/master
| 2021-01-23T21:53:36.609031
| 2017-02-25T06:53:09
| 2017-02-25T06:53:09
| 83,112,243
| 1
| 1
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,788
|
java
|
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.*;
public class CreatePDF {
/**
* @param args
*/
public void writePDF(String fileName) {
File file = new File(fileName); // 根据参数创建File对象
FileOutputStream out = null; // 创建FileOutputStream实例
Document documentPDF = new Document(PageSize.A5, 50, 50, 50, 50); // 创建PDF文档对象
try {
out = new FileOutputStream(file); // 实例化FileOutputStream对象
PdfWriter writer = PdfWriter.getInstance(documentPDF, out); // 为Document对象创建写入器
documentPDF.open(); // 打开与目标文件的连接
Font font = FontFactory.getFont(FontFactory.HELVETICA, 18.2f,
Font.BOLDITALIC, new BaseColor(255, 0, 0));// 定义字体
Paragraph chapter = new Paragraph(); // 定义段落对象
Chapter chapter1 = new Chapter(chapter, 1); // 创建章节对象
chapter1.setNumberDepth(0); // 将编号级别设置为0,表示不会在页面中显示章节编号
font = FontFactory.getFont(FontFactory.HELVETICA, 16.0f, Font.BOLD,
new BaseColor(255, 0, 0)); // 定义字体与字体颜色
Paragraph section1_title1 = new Paragraph("frist itxt PDF", font); // 向文档中插入内容
Section section1 = chapter1.addSection(section1_title1);
Paragraph text = new Paragraph("this is frist text");
section1.add(text); // 向文档中添加章节
documentPDF.add(chapter1);
documentPDF.close(); // 关闭文档
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
CreatePDF paf = new CreatePDF();
paf.writePDF("C://temp.pdf");
}
}
|
[
"15262673025@163.com"
] |
15262673025@163.com
|
7f949bbfa4de4b51aa00eda8671d4a7288b210f3
|
a6da8bbf46ffdf292537ff80306d0e5d80433d9c
|
/src/test/java/io/test/nio/NioTest.java
|
3e8766f5de23d3ef674daa2d22280ca5b811a4d4
|
[] |
no_license
|
cugxdy/InitNettyServer
|
eef9903a94a500c8784bb104af192b7c513a31ce
|
dd86754d8ca571815ed4d0e41dec5801992f1d5b
|
refs/heads/master
| 2021-07-05T20:46:42.928710
| 2019-06-10T06:05:19
| 2019-06-10T06:05:19
| 190,327,704
| 1
| 0
| null | 2020-10-13T13:41:35
| 2019-06-05T04:49:34
|
Java
|
UTF-8
|
Java
| false
| false
| 692
|
java
|
package io.test.nio;
import java.io.IOException;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.channels.spi.SelectorProvider;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
public class NioTest {
// private static final Selector selector;
// private static final SocketChannel server;
//
// static {
// selector = SelectorProvider.provider().openSelector();
// server = SocketChannel.open();
// }
//
@Test
public void test() throws IOException {
// ServerSocketChannel serverSocket = ServerSocketChannel.open();
System.out.println(TimeUnit.SECONDS.toNanos(1));
}
}
|
[
"cugxdy@163.com"
] |
cugxdy@163.com
|
69815841538c4cbe602c3948147d85679578ec87
|
ee461488c62d86f729eda976b421ac75a964114c
|
/tags/HtmlUnit-1dot1/htmlunit/src/java/com/gargoylesoftware/htmlunit/html/HtmlDefinitionTerm.java
|
e236a9749079ff4e271bc02f74cd35fe2931b710
|
[] |
no_license
|
svn2github/htmlunit
|
2c56f7abbd412e6d9e0efd0934fcd1277090af74
|
6fc1a7d70c08fb50fef1800673671fd9cada4899
|
refs/heads/master
| 2023-09-03T10:35:41.987099
| 2015-07-26T13:12:45
| 2015-07-26T13:12:45
| 37,107,064
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,080
|
java
|
/*
* Copyright (C) 2002 Gargoyle Software Inc. All rights reserved.
*
* This file is part of HtmlUnit. For details on use and redistribution
* please refer to the license.html file included with these sources.
*/
package com.gargoylesoftware.htmlunit.html;
import org.w3c.dom.Element;
/**
* Wrapper for the html element "dt".
*
* @version $Revision$
* @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
*/
public class HtmlDefinitionTerm extends HtmlElement {
/**
* Create an instance of HtmlDefinitionTerm
*
* @param page The HtmlPage that contains this element.
* @param xmlElement The actual html element that we are wrapping.
*/
HtmlDefinitionTerm( final HtmlPage page, final Element xmlElement ) {
super(page, xmlElement);
}
/**
* Return the value of the attribute "id". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "id"
* or an empty string if that attribute isn't defined.
*/
public final String getIdAttribute() {
return getAttributeValue("id");
}
/**
* Return the value of the attribute "class". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "class"
* or an empty string if that attribute isn't defined.
*/
public final String getClassAttribute() {
return getAttributeValue("class");
}
/**
* Return the value of the attribute "style". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "style"
* or an empty string if that attribute isn't defined.
*/
public final String getStyleAttribute() {
return getAttributeValue("style");
}
/**
* Return the value of the attribute "title". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "title"
* or an empty string if that attribute isn't defined.
*/
public final String getTitleAttribute() {
return getAttributeValue("title");
}
/**
* Return the value of the attribute "lang". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "lang"
* or an empty string if that attribute isn't defined.
*/
public final String getLangAttribute() {
return getAttributeValue("lang");
}
/**
* Return the value of the attribute "xml:lang". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "xml:lang"
* or an empty string if that attribute isn't defined.
*/
public final String getXmlLangAttribute() {
return getAttributeValue("xml:lang");
}
/**
* Return the value of the attribute "dir". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "dir"
* or an empty string if that attribute isn't defined.
*/
public final String getTextDirectionAttribute() {
return getAttributeValue("dir");
}
/**
* Return the value of the attribute "onclick". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onclick"
* or an empty string if that attribute isn't defined.
*/
public final String getOnClickAttribute() {
return getAttributeValue("onclick");
}
/**
* Return the value of the attribute "ondblclick". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "ondblclick"
* or an empty string if that attribute isn't defined.
*/
public final String getOnDblClickAttribute() {
return getAttributeValue("ondblclick");
}
/**
* Return the value of the attribute "onmousedown". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onmousedown"
* or an empty string if that attribute isn't defined.
*/
public final String getOnMouseDownAttribute() {
return getAttributeValue("onmousedown");
}
/**
* Return the value of the attribute "onmouseup". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onmouseup"
* or an empty string if that attribute isn't defined.
*/
public final String getOnMouseUpAttribute() {
return getAttributeValue("onmouseup");
}
/**
* Return the value of the attribute "onmouseover". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onmouseover"
* or an empty string if that attribute isn't defined.
*/
public final String getOnMouseOverAttribute() {
return getAttributeValue("onmouseover");
}
/**
* Return the value of the attribute "onmousemove". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onmousemove"
* or an empty string if that attribute isn't defined.
*/
public final String getOnMouseMoveAttribute() {
return getAttributeValue("onmousemove");
}
/**
* Return the value of the attribute "onmouseout". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onmouseout"
* or an empty string if that attribute isn't defined.
*/
public final String getOnMouseOutAttribute() {
return getAttributeValue("onmouseout");
}
/**
* Return the value of the attribute "onkeypress". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onkeypress"
* or an empty string if that attribute isn't defined.
*/
public final String getOnKeyPressAttribute() {
return getAttributeValue("onkeypress");
}
/**
* Return the value of the attribute "onkeydown". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onkeydown"
* or an empty string if that attribute isn't defined.
*/
public final String getOnKeyDownAttribute() {
return getAttributeValue("onkeydown");
}
/**
* Return the value of the attribute "onkeyup". Refer to the
* <a href='http://www.w3.org/TR/html401/'>HTML 4.01</a>
* documentation for details on the use of this attribute.
*
* @return The value of the attribute "onkeyup"
* or an empty string if that attribute isn't defined.
*/
public final String getOnKeyUpAttribute() {
return getAttributeValue("onkeyup");
}
}
|
[
"(no author)@5f5364db-9458-4db8-a492-e30667be6df6"
] |
(no author)@5f5364db-9458-4db8-a492-e30667be6df6
|
7db337c410207f63383856c70223f58e60900237
|
53d677a55e4ece8883526738f1c9d00fa6560ff7
|
/com/tencent/mm/plugin/emoji/ui/BaseEmojiStoreUI$1.java
|
061382f53a119b15aa94cd2523ae39f676de96ba
|
[] |
no_license
|
0jinxing/wechat-apk-source
|
544c2d79bfc10261eb36389c1edfdf553d8f312a
|
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
|
refs/heads/master
| 2020-06-07T20:06:03.580028
| 2019-06-21T09:17:26
| 2019-06-21T09:17:26
| 193,069,132
| 9
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,084
|
java
|
package com.tencent.mm.plugin.emoji.ui;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.ab;
final class BaseEmojiStoreUI$1
implements DialogInterface.OnClickListener
{
BaseEmojiStoreUI$1(BaseEmojiStoreUI paramBaseEmojiStoreUI, String paramString1, String paramString2, String paramString3)
{
}
public final void onClick(DialogInterface paramDialogInterface, int paramInt)
{
AppMethodBeat.i(53213);
this.kYA.j(this.kUJ, this.kYy, this.kYz, null);
this.kYA.bkZ();
ab.i("MicroMsg.emoji.BaseEmojiStoreUI", "Retry doScene ExchangeEmotionPackNetScene productId:%s", new Object[] { this.kUJ });
BaseEmojiStoreUI.a(this.kYA, this.kUJ);
AppMethodBeat.o(53213);
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes6-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.emoji.ui.BaseEmojiStoreUI.1
* JD-Core Version: 0.6.2
*/
|
[
"172601673@qq.com"
] |
172601673@qq.com
|
5681c74cfa0b2ef2ba0eed72e765429821c63207
|
09c87efdb3f10da99c9189403baf1ef54a924602
|
/src/test/java/pl/redheadsolutions/lg/lets/vote/web/rest/TestUtil.java
|
f8231e9d93e602934510a036e6eeeb217050986f
|
[] |
no_license
|
Viwritis/rhs-lets-vote
|
46d8de9bc4f0ad689b6abe929fc153997319ff82
|
c48e9ecaf70d695d2d376a4ca83cbe769f817fb3
|
refs/heads/master
| 2022-12-29T05:44:23.529383
| 2020-10-18T10:10:59
| 2020-10-18T10:10:59
| 305,069,005
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,017
|
java
|
package pl.redheadsolutions.lg.lets.vote.web.rest;
import static org.assertj.core.api.Assertions.assertThat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import java.io.IOException;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
import org.springframework.format.support.DefaultFormattingConversionService;
import org.springframework.format.support.FormattingConversionService;
/**
* Utility class for testing REST controllers.
*/
public final class TestUtil {
private static final ObjectMapper mapper = createObjectMapper();
private static ObjectMapper createObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false);
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
mapper.registerModule(new JavaTimeModule());
return mapper;
}
/**
* Convert an object to JSON byte array.
*
* @param object the object to convert.
* @return the JSON byte array.
* @throws IOException
*/
public static byte[] convertObjectToJsonBytes(Object object) throws IOException {
return mapper.writeValueAsBytes(object);
}
/**
* Create a byte array with a specific size filled with specified data.
*
* @param size the size of the byte array.
* @param data the data to put in the byte array.
* @return the JSON byte array.
*/
public static byte[] createByteArray(int size, String data) {
byte[] byteArray = new byte[size];
for (int i = 0; i < size; i++) {
byteArray[i] = Byte.parseByte(data, 2);
}
return byteArray;
}
/**
* A matcher that tests that the examined string represents the same instant as the reference datetime.
*/
public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher<String> {
private final ZonedDateTime date;
public ZonedDateTimeMatcher(ZonedDateTime date) {
this.date = date;
}
@Override
protected boolean matchesSafely(String item, Description mismatchDescription) {
try {
if (!date.isEqual(ZonedDateTime.parse(item))) {
mismatchDescription.appendText("was ").appendValue(item);
return false;
}
return true;
} catch (DateTimeParseException e) {
mismatchDescription.appendText("was ").appendValue(item).appendText(", which could not be parsed as a ZonedDateTime");
return false;
}
}
@Override
public void describeTo(Description description) {
description.appendText("a String representing the same Instant as ").appendValue(date);
}
}
/**
* Creates a matcher that matches when the examined string represents the same instant as the reference datetime.
*
* @param date the reference datetime against which the examined string is checked.
*/
public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) {
return new ZonedDateTimeMatcher(date);
}
/**
* Verifies the equals/hashcode contract on the domain object.
*/
public static <T> void equalsVerifier(Class<T> clazz) throws Exception {
T domainObject1 = clazz.getConstructor().newInstance();
assertThat(domainObject1.toString()).isNotNull();
assertThat(domainObject1).isEqualTo(domainObject1);
assertThat(domainObject1.hashCode()).isEqualTo(domainObject1.hashCode());
// Test with an instance of another class
Object testOtherObject = new Object();
assertThat(domainObject1).isNotEqualTo(testOtherObject);
assertThat(domainObject1).isNotEqualTo(null);
// Test with an instance of the same class
T domainObject2 = clazz.getConstructor().newInstance();
assertThat(domainObject1).isNotEqualTo(domainObject2);
// HashCodes are equals because the objects are not persisted yet
assertThat(domainObject1.hashCode()).isEqualTo(domainObject2.hashCode());
}
/**
* Create a {@link FormattingConversionService} which use ISO date format, instead of the localized one.
* @return the {@link FormattingConversionService}.
*/
public static FormattingConversionService createFormattingConversionService() {
DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService();
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(dfcs);
return dfcs;
}
/**
* Makes a an executes a query to the EntityManager finding all stored objects.
* @param <T> The type of objects to be searched
* @param em The instance of the EntityManager
* @param clss The class type to be searched
* @return A list of all found objects
*/
public static <T> List<T> findAll(EntityManager em, Class<T> clss) {
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<T> cq = cb.createQuery(clss);
Root<T> rootEntry = cq.from(clss);
CriteriaQuery<T> all = cq.select(rootEntry);
TypedQuery<T> allQuery = em.createQuery(all);
return allQuery.getResultList();
}
private TestUtil() {}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
e890605980c7a8a5836caf6e7f78b6b362453959
|
86f44f6597536a882b7150375680ca6bd74bd0f8
|
/src/main/java/org/springblade/system/model/Parameter.java
|
7bc1f5f11260e89186ffe65d5acb938608291eb6
|
[
"Apache-2.0"
] |
permissive
|
suntinghui/Blade
|
77e310693fc4a5ad5adde1fb520d6aa092bc05c9
|
f8f1932c729aff159510ad394f00f30ec77f1be7
|
refs/heads/master
| 2021-05-14T01:52:49.129493
| 2018-01-11T07:33:30
| 2018-01-11T07:33:30
| 116,577,855
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,428
|
java
|
/**
* Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springblade.system.model;
import org.beetl.sql.core.annotatoin.AutoID;
import org.beetl.sql.core.annotatoin.SeqID;
import org.beetl.sql.core.annotatoin.Table;
import org.springblade.core.annotation.BindID;
import org.springblade.core.base.model.BaseModel;
@Table(name = "blade_parameter")
@BindID(name = "id")
@SuppressWarnings("serial")
/**
* 参数表
* @author zhuangqian
*/
public class Parameter extends BaseModel {
/**
* 主键
*/
private Integer id;
/**
* 参数编号
*/
private String code;
/**
* 参数名
*/
private String name;
/**
* 排序号
*/
private Integer num;
/**
* 参数值
*/
private String para;
/**
* 状态
*/
private Integer status;
/**
* 备注
*/
private String tips;
/**
* 版本号
*/
private Integer version;
@AutoID
@SeqID(name = "SEQ_PARAMETER")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public String getPara() {
return para;
}
public void setPara(String para) {
this.para = para;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getTips() {
return tips;
}
public void setTips(String tips) {
this.tips = tips;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
|
[
"tinghuisun@163.com"
] |
tinghuisun@163.com
|
5cfa73632d230e40a1db326afe33212b11942e4a
|
b7936f9a99afb096bc6d68448c32631d7416e177
|
/build/tmp/recompileMc/sources/net/minecraft/world/gen/feature/WorldGenEndIsland.java
|
88bcb8442fa2e8b627697d8963d2343220c02568
|
[] |
no_license
|
AlphaWolf21/JATMA
|
ff786893893879d1f158a549659bbf13a5e0763c
|
93cf49cca9e23fa1660099999b2b46ce26fb3bbb
|
refs/heads/master
| 2021-01-19T02:43:34.989869
| 2016-11-07T04:06:16
| 2016-11-07T04:06:16
| 73,483,501
| 2
| 0
| null | 2016-11-11T14:20:06
| 2016-11-11T14:20:05
| null |
UTF-8
|
Java
| false
| false
| 1,071
|
java
|
package net.minecraft.world.gen.feature;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
public class WorldGenEndIsland extends WorldGenerator
{
public boolean generate(World worldIn, Random rand, BlockPos position)
{
float f = (float)(rand.nextInt(3) + 4);
for (int i = 0; f > 0.5F; --i)
{
for (int j = MathHelper.floor_float(-f); j <= MathHelper.ceiling_float_int(f); ++j)
{
for (int k = MathHelper.floor_float(-f); k <= MathHelper.ceiling_float_int(f); ++k)
{
if ((float)(j * j + k * k) <= (f + 1.0F) * (f + 1.0F))
{
this.setBlockAndNotifyAdequately(worldIn, position.add(j, i, k), Blocks.END_STONE.getDefaultState());
}
}
}
f = (float)((double)f - ((double)rand.nextInt(2) + 0.5D));
}
return true;
}
}
|
[
"techperson71@gmail.com"
] |
techperson71@gmail.com
|
0f5ca2e3ef78bba8a1e1e8fa71cce17891bdd334
|
8b6856b3ec10fb77c8af5980bd9beb6aa2e2d4a3
|
/common/hessian/src/main/java/com/alibaba/citrus/hessian/io/HessianSerializerOutput.java
|
1f41c0c7459266c26cae26df496afb3a0fdfe2df
|
[
"Apache-2.0"
] |
permissive
|
huxiaohang/citrus
|
400a528895cd051ccd24b1ec690817c70aa067a5
|
f915cc1bb0389899adaaabb2eaf4e301517dbfa1
|
refs/heads/master
| 2020-12-25T12:27:43.092996
| 2011-11-05T09:18:10
| 2011-11-05T09:18:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,463
|
java
|
/*
* Copyright 2010 Alibaba Group Holding Limited.
* 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.
*/
/*
* Copyright (c) 2001-2004 Caucho Technology, Inc. All rights reserved.
*
* The Apache Software License, Version 1.1
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Caucho Technology (http://www.caucho.com/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "Hessian", "Resin", and "Caucho" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* info@caucho.com.
*
* 5. Products derived from this software may not be called "Resin"
* nor may "Resin" appear in their names without prior written
* permission of Caucho Technology.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL CAUCHO TECHNOLOGY OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @author Scott Ferguson
*/
package com.alibaba.citrus.hessian.io;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
/**
* Output stream for Hessian requests.
*
* <p>HessianOutput is unbuffered, so any client needs to provide
* its own buffering.
*
* <h3>Serialization</h3>
*
* <pre>
* OutputStream os = new FileOutputStream("test.xml");
* HessianOutput out = new HessianSerializerOutput(os);
*
* out.writeObject(obj);
* os.close();
* </pre>
*
* <h3>Writing an RPC Call</h3>
*
* <pre>
* OutputStream os = ...; // from http connection
* HessianOutput out = new HessianSerializerOutput(os);
* String value;
*
* out.startCall("hello"); // start hello call
* out.writeString("arg1"); // write a string argument
* out.completeCall(); // complete the call
* </pre>
*/
public class HessianSerializerOutput extends Hessian2Output {
/**
* Creates a new Hessian output stream, initialized with an
* underlying output stream.
*
* @param os the underlying output stream.
*/
public HessianSerializerOutput(OutputStream os)
{
super(os);
}
/**
* Creates an uninitialized Hessian output stream.
*/
public HessianSerializerOutput()
{
super(null);
}
/**
* Applications which override this can do custom serialization.
*
* @param object the object to write.
*/
public void writeObjectImpl(Object obj)
throws IOException
{
Class cl = obj.getClass();
try {
Method method = cl.getMethod("writeReplace", new Class[0]);
Object repl = method.invoke(obj, new Object[0]);
writeObject(repl);
return;
} catch (Exception e) {
}
try {
writeMapBegin(cl.getName());
for (; cl != null; cl = cl.getSuperclass()) {
Field []fields = cl.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
Field field = fields[i];
if (Modifier.isTransient(field.getModifiers()) ||
Modifier.isStatic(field.getModifiers()))
continue;
// XXX: could parameterize the handler to only deal with public
field.setAccessible(true);
writeString(field.getName());
writeObject(field.get(obj));
}
}
writeMapEnd();
} catch (IllegalAccessException e) {
throw new IOExceptionWrapper(e);
}
}
}
|
[
"yizhi@taobao.com"
] |
yizhi@taobao.com
|
0da3f0020939f23b1bc62a467971f31712093822
|
fe711416301bdc8fcd798a5c20d7a02f37f61362
|
/hibernate_day02/src/main/java/cn/itheima/domain/Customer.java
|
6737ad1561fb7a6b77bce7400ffefdb9c924088b
|
[] |
no_license
|
chaiguolong/javaweb_step1
|
e9175521485813c40e763a95629c1ef929405010
|
e9e8d3e70fd5d9495b6675c60e35d8ca12eefdc2
|
refs/heads/master
| 2022-07-07T18:10:59.431906
| 2020-04-28T05:41:51
| 2020-04-28T05:41:51
| 143,223,415
| 1
| 0
| null | 2022-06-21T00:55:31
| 2018-08-02T00:53:40
|
Java
|
UTF-8
|
Java
| false
| false
| 2,314
|
java
|
package cn.itheima.domain;
public class Customer {
/*
* CREATE TABLE `cst_customer` (
`cust_id` BIGINT(32) NOT NULL AUTO_INCREMENT COMMENT '客户编号(主键)',
`cust_name` VARCHAR(32) NOT NULL COMMENT '客户名称(公司名称)',
`cust_source` VARCHAR(32) DEFAULT NULL COMMENT '客户信息来源',
`cust_industry` VARCHAR(32) DEFAULT NULL COMMENT '客户所属行业',
`cust_level` VARCHAR(32) DEFAULT NULL COMMENT '客户级别',
`cust_linkman` VARCHAR(64) DEFAULT NULL COMMENT '联系人',
`cust_phone` VARCHAR(64) DEFAULT NULL COMMENT '固定电话',
`cust_mobile` VARCHAR(16) DEFAULT NULL COMMENT '移动电话',
PRIMARY KEY (`cust_id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
*/
private Long cust_id;
private String cust_name;
private String cust_source;
private String cust_industry;
private String cust_level;
private String cust_linkman;
private String cust_phone;
private String cust_mobile;
public Long getCust_id() {
return cust_id;
}
public void setCust_id(Long cust_id) {
this.cust_id = cust_id;
}
public String getCust_name() {
return cust_name;
}
public void setCust_name(String cust_name) {
this.cust_name = cust_name;
}
public String getCust_source() {
return cust_source;
}
public void setCust_source(String cust_source) {
this.cust_source = cust_source;
}
public String getCust_industry() {
return cust_industry;
}
public void setCust_industry(String cust_industry) {
this.cust_industry = cust_industry;
}
public String getCust_level() {
return cust_level;
}
public void setCust_level(String cust_level) {
this.cust_level = cust_level;
}
public String getCust_linkman() {
return cust_linkman;
}
public void setCust_linkman(String cust_linkman) {
this.cust_linkman = cust_linkman;
}
public String getCust_phone() {
return cust_phone;
}
public void setCust_phone(String cust_phone) {
this.cust_phone = cust_phone;
}
public String getCust_mobile() {
return cust_mobile;
}
public void setCust_mobile(String cust_mobile) {
this.cust_mobile = cust_mobile;
}
@Override
public String toString() {
return "Customer [cust_id=" + cust_id + ", cust_name=" + cust_name + "]";
}
}
|
[
"584238433@qq.com"
] |
584238433@qq.com
|
863b4e3fa791abda8598f5d89e877fccb440e241
|
fbe92552cdb3859ff76a83229fd01497e7ac7bbc
|
/gameoflife-gwt/src/main/java/edu/pdx/cs410J/whitlock/server/PingServiceImpl.java
|
b34aaeda7efe2cff3477fa46bcd72f88c5dd5ff1
|
[
"Apache-2.0"
] |
permissive
|
Ensath/PortlandStateJavaSummer2016
|
04e2e277339aaa40dc119ee2e4f2f07e85415046
|
3af18482d9aacefc2991388a53bce2bc60c5693b
|
refs/heads/master
| 2021-01-24T22:03:16.183787
| 2016-08-04T02:19:31
| 2016-08-04T02:19:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 734
|
java
|
package edu.pdx.cs410J.whitlock.server;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import edu.pdx.cs410J.whitlock.client.Appointment;
import edu.pdx.cs410J.whitlock.client.AppointmentBook;
import edu.pdx.cs410J.whitlock.client.PingService;
/**
* The server-side implementation of the division service
*/
public class PingServiceImpl extends RemoteServiceServlet implements PingService
{
@Override
public AppointmentBook ping() {
AppointmentBook book = new AppointmentBook();
book.addAppointment(new Appointment());
return book;
}
@Override
protected void doUnexpectedFailure(Throwable unhandled) {
unhandled.printStackTrace(System.err);
super.doUnexpectedFailure(unhandled);
}
}
|
[
"david.m.whitlock@gmail.com"
] |
david.m.whitlock@gmail.com
|
f64007bc3939f3ec66a0e3cf026449f5712c9353
|
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
|
/methods/Method_12307.java
|
5f7016a3a75d982f7f6a3695a6f59e5a6925c9ac
|
[] |
no_license
|
P79N6A/icse_20_user_study
|
5b9c42c6384502fdc9588430899f257761f1f506
|
8a3676bc96059ea2c4f6d209016f5088a5628f3c
|
refs/heads/master
| 2020-06-24T08:25:22.606717
| 2019-07-25T15:31:16
| 2019-07-25T15:31:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 401
|
java
|
/**
* Appropriate constructor wrapper. Must be preceded by on of {@code from()} calls.
* @return new drawable instance
* @throws IOException when creation fails
*/
public GifDrawable build() throws IOException {
if (mInputSource == null) {
throw new NullPointerException("Source is not set");
}
return mInputSource.build(mOldDrawable,mExecutor,mIsRenderingTriggeredOnDraw,mOptions);
}
|
[
"sonnguyen@utdallas.edu"
] |
sonnguyen@utdallas.edu
|
9527a86e092456ad4c4a548ab165436306e18486
|
13cd80448e703d012049b0f28b6aaacf4f341a22
|
/controller/src/jrat/controller/packets/outgoing/Packet83ServerUploadSound.java
|
01927648ae505c31044782610cd85d9c84317539
|
[] |
no_license
|
wille/jrat
|
89e96998b90ca4d11a3cfc72665f2d4e81fc5779
|
f54d3032897db337f57514d7ab8733b874192cd1
|
refs/heads/master
| 2022-06-29T21:05:02.795926
| 2018-08-28T15:55:39
| 2018-08-28T15:55:39
| 208,027,992
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 548
|
java
|
package jrat.controller.packets.outgoing;
import jrat.controller.Slave;
public class Packet83ServerUploadSound implements OutgoingPacket {
private byte[] data;
private int read;
private int quality;
public Packet83ServerUploadSound(byte[] data, int read, int quality) {
this.data = data;
this.read = read;
this.quality = quality;
}
@Override
public void write(Slave slave) throws Exception {
slave.writeInt(quality);
slave.writeInt(read);
slave.write(data);
}
@Override
public short getPacketId() {
return 83;
}
}
|
[
"red@cmail.nu"
] |
red@cmail.nu
|
9e51be409f69a5fa81abfb487079d9d481e464ed
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/JetBrains--kotlin/087eec45211fa3ba37cb6c49eb35589517e849ba/after/DataFlowValueRenderingTestGenerated.java
|
891c398673ec3c63f16e2f3a13728edde9203976
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,377
|
java
|
/*
* Copyright 2010-2014 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 org.jetbrains.jet.completion;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("idea/testData/dataFlowValueRendering")
public class DataFlowValueRenderingTestGenerated extends AbstractDataFlowValueRenderingTest {
public void testAllFilesPresentInDataFlowValueRendering() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/dataFlowValueRendering"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("classProperty.kt")
public void testClassProperty() throws Exception {
doTest("idea/testData/dataFlowValueRendering/classProperty.kt");
}
@TestMetadata("complexIdentifier.kt")
public void testComplexIdentifier() throws Exception {
doTest("idea/testData/dataFlowValueRendering/complexIdentifier.kt");
}
@TestMetadata("complexIdentifierWithImplicitReceiver.kt")
public void testComplexIdentifierWithImplicitReceiver() throws Exception {
doTest("idea/testData/dataFlowValueRendering/complexIdentifierWithImplicitReceiver.kt");
}
@TestMetadata("complexIdentifierWithInitiallyNullableReceiver.kt")
public void testComplexIdentifierWithInitiallyNullableReceiver() throws Exception {
doTest("idea/testData/dataFlowValueRendering/complexIdentifierWithInitiallyNullableReceiver.kt");
}
@TestMetadata("complexIdentifierWithReceiver.kt")
public void testComplexIdentifierWithReceiver() throws Exception {
doTest("idea/testData/dataFlowValueRendering/complexIdentifierWithReceiver.kt");
}
@TestMetadata("multipleVariables.kt")
public void testMultipleVariables() throws Exception {
doTest("idea/testData/dataFlowValueRendering/multipleVariables.kt");
}
@TestMetadata("packageProperty.kt")
public void testPackageProperty() throws Exception {
doTest("idea/testData/dataFlowValueRendering/packageProperty.kt");
}
@TestMetadata("receivers.kt")
public void testReceivers() throws Exception {
doTest("idea/testData/dataFlowValueRendering/receivers.kt");
}
@TestMetadata("smartCast.kt")
public void testSmartCast() throws Exception {
doTest("idea/testData/dataFlowValueRendering/smartCast.kt");
}
@TestMetadata("smartNotNull.kt")
public void testSmartNotNull() throws Exception {
doTest("idea/testData/dataFlowValueRendering/smartNotNull.kt");
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
ae9b05d8337fe2122dbfc2e812b929fefb0e035c
|
dd3aa8ef4f470cc2ccf708389c8dc9c98c687cf2
|
/choosecityview/src/main/java/foora/perevozka/com/choosecityview/SpinnerItem.java
|
ab599a5c748b0f1b342194e52d33300bf6d59501
|
[] |
no_license
|
matvapps/Trucker
|
e986b45347bf38d86e319d376d6179cf6effd73c
|
a4f32ffad8fae90b10c2dd40dd32eecbebf86179
|
refs/heads/master
| 2020-04-12T18:54:43.519584
| 2019-06-19T09:57:12
| 2019-06-19T09:57:12
| 162,693,845
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 495
|
java
|
package foora.perevozka.com.choosecityview;
/**
* Created by Alexandr.
*/
public class SpinnerItem {
private String name;
private int id;
public SpinnerItem(String name, int id) {
this.name = name;
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
|
[
"alex____98@hotmail.com"
] |
alex____98@hotmail.com
|
a4bf013aa060448c5e5063e4d007d9ce98c61699
|
ead5a617b23c541865a6b57cf8cffcc1137352f2
|
/decompiled/sources/androidx/appcompat/view/menu/C0549o.java
|
1494fad630fe8150d0fa7e8cc0268159c6ae9d37
|
[] |
no_license
|
erred/uva-ssn
|
73a6392a096b38c092482113e322fdbf9c3c4c0e
|
4fb8ea447766a735289b96e2510f5a8d93345a8c
|
refs/heads/master
| 2022-02-26T20:52:50.515540
| 2019-10-14T12:30:33
| 2019-10-14T12:30:33
| 210,376,140
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 982
|
java
|
package androidx.appcompat.view.menu;
import android.content.Context;
import android.os.Parcelable;
/* renamed from: androidx.appcompat.view.menu.o */
/* compiled from: MenuPresenter */
public interface C0549o {
/* renamed from: androidx.appcompat.view.menu.o$a */
/* compiled from: MenuPresenter */
public interface C0550a {
/* renamed from: a */
void mo1030a(C0533h hVar, boolean z);
/* renamed from: a */
boolean mo1031a(C0533h hVar);
}
boolean collapseItemActionView(C0533h hVar, C0537j jVar);
boolean expandItemActionView(C0533h hVar, C0537j jVar);
boolean flagActionItems();
int getId();
void initForMenu(Context context, C0533h hVar);
void onCloseMenu(C0533h hVar, boolean z);
void onRestoreInstanceState(Parcelable parcelable);
Parcelable onSaveInstanceState();
boolean onSubMenuSelected(C0559u uVar);
void setCallback(C0550a aVar);
void updateMenuView(boolean z);
}
|
[
"seankhliao@gmail.com"
] |
seankhliao@gmail.com
|
ff59bb04cb784b419a88efc1b2dfcc99583871e0
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XWIKI-12482-10-5-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/query/internal/ScriptQuery_ESTest_scaffolding.java
|
f64d0bde5f907d84d959c285da5e4543f215a3b3
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 440
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Apr 02 18:35:23 UTC 2020
*/
package org.xwiki.query.internal;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class ScriptQuery_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
4229fb1c8e548427d3a09663bfb84ce0c370a823
|
2716460e2241dfed68f5b338b3fc5a1f7bc45b8d
|
/tillerinobot/src/main/java/tillerino/tillerinobot/diff/PercentageEstimatesImpl.java
|
9960d815c3ec8b11d686720f1cc63cccb55d2090
|
[] |
no_license
|
blimmo/Tillerinobot
|
d96f42a3a1d03006d3f2367af18a41eefab13fea
|
6645728c5062114218db12c09525c38b887979e3
|
refs/heads/master
| 2021-01-21T20:53:43.318684
| 2017-06-21T08:58:54
| 2017-06-21T08:58:54
| 94,757,811
| 0
| 0
| null | 2017-06-19T09:08:33
| 2017-06-19T09:08:33
| null |
UTF-8
|
Java
| false
| false
| 1,677
|
java
|
package tillerino.tillerinobot.diff;
import org.tillerino.osuApiModel.types.BitwiseMods;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Data
@NoArgsConstructor(onConstructor = @__(@Deprecated))
public class PercentageEstimatesImpl implements PercentageEstimates {
private CBeatmapImpl beatmap;
@Setter(onParam = @__(@BitwiseMods))
private @BitwiseMods long mods;
public PercentageEstimatesImpl(CBeatmapImpl beatmap, @BitwiseMods long mods) {
super();
this.beatmap = beatmap;
this.mods = mods;
}
@Override
public double getPPForAcc(double acc) {
AccuracyDistribution dist = AccuracyDistribution.get(getBeatmap().getObjectCount(), 0, acc);
CStandardScore score = new CStandardScore((int) getBeatmap().DifficultyAttribute(getMods(), CBeatmap.MaxCombo),
dist.get_300(), dist.get_100(), dist.get_50(), dist.getMiss(), getMods());
return score.getPP(getBeatmap());
}
@Override
public double getPP(double acc, int combo, int misses) {
AccuracyDistribution dist = AccuracyDistribution.get(getBeatmap().getObjectCount(), misses, acc);
CStandardScore score = new CStandardScore(combo, dist.get_300(), dist.get_100(), dist.get_50(), dist.getMiss(),
getMods());
return score.getPP(getBeatmap());
}
@Override
public boolean isShaky() {
return beatmap.isShaky();
}
@Override
public Double getStarDiff() {
if (!beatmap.isStable()) {
return null;
}
return beatmap.getStarDiff();
}
@Override
public boolean isOppaiOnly() {
return beatmap.isOppaiOnly();
}
@Override
public boolean isRanked() {
return beatmap.getBeatmap().getApproved() > 0 && beatmap.getBeatmap().getApproved() != 3;
}
}
|
[
"tillmann.gaida@gmail.com"
] |
tillmann.gaida@gmail.com
|
bc0f5f41ddcb5375f8cd65dcaac371fd9ac05361
|
78c696de905e3f1a699b106c6f23893bd0e96fa3
|
/src/org/eclipse/help/internal/validation/TocValidator.java
|
95a348a1d8285faa7bffee3d5f28398fd48b220a
|
[] |
no_license
|
jiangyu2015/eclipse-4.5.2-source
|
71d1e0b45e744ce0038e5ba17b6c3c12fd3634c5
|
e4a90a19989564e28d73ff64a4a2ffc2cbfeaf9e
|
refs/heads/master
| 2021-01-10T09:07:58.554745
| 2016-03-03T13:18:11
| 2016-03-03T13:18:11
| 52,862,391
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,935
|
java
|
package org.eclipse.help.internal.validation;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.help.IHelpResource;
import org.eclipse.help.ILink;
import org.eclipse.help.IToc;
import org.eclipse.help.IUAElement;
import org.eclipse.help.internal.protocols.HelpURLConnection;
import org.eclipse.help.internal.toc.TocContribution;
import org.eclipse.help.internal.toc.TocFile;
import org.eclipse.help.internal.toc.TocFileParser;
import org.xml.sax.SAXException;
/*******************************************************************************
* Copyright (c) 2007, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
public class TocValidator {
private static final boolean DEBUG = false;
private HashMap<String, Object> processedTocs;
private TocFileParser parser;
public static class BrokenLink {
private String tocID;
private String href;
private BrokenLink(String tocID, String href) {
this.tocID = tocID;
this.href = href;
}
public String getTocID() {
return tocID; }
public String getHref() {
return href; }
}
public static abstract class Filter {
abstract public boolean isIncluded(String href);
}
public static class PassThroughFilter extends Filter {
public boolean isIncluded(String href) {
return true;
}
}
/**
* Checks the validity of all <code>href</code> attributes on <code>topic</code> elements in the toc and the
* <code>topic</code> attribute on the <code>toc</code> element if there is one. Also checks validity of any
* nested tocs.
* @param hrefs gives the list of paths to toc files to validate including the plug-in id
* (i.e. "/<plug-in id>/<path>/<file>")
* @return An ArrayList of BrokenLink objects in the toc. If no broken links are found, an empty ArrayList
* is returned.
* @throws IOException
* @throws SAXException
* @throws ParserConfigurationException
*/
public static ArrayList<BrokenLink> validate(String[] hrefs) throws IOException, SAXException, ParserConfigurationException{
return filteredValidate(hrefs, new PassThroughFilter());
}
public static ArrayList<BrokenLink> filteredValidate (String[] hrefs, Filter filter) throws IOException, SAXException, ParserConfigurationException{
TocValidator v = new TocValidator();
ArrayList<BrokenLink> result = new ArrayList<BrokenLink>();
for (int i = 0; i < hrefs.length; i++)
v.processToc(hrefs[i], null, result, filter);
return result;
}
private TocValidator() {
processedTocs = new HashMap<String, Object>();
parser = new TocFileParser();
}
/* Checks validity of all links in a given toc. If all links are valid, an empty ArrayList is returned.
* Otherwise an ArrayList of BrokenLink objects is returned.
*/
private void processToc(String href, String plugin, ArrayList<BrokenLink> result, Filter filter)
throws IOException, SAXException, ParserConfigurationException {
String path;
if (href.startsWith("/")) { //$NON-NLS-1$
href = href.substring(1);
int index = href.indexOf("/"); //$NON-NLS-1$
if (index == -1)
throw new IOException("Invalid parameters supplied to the validate method."); //$NON-NLS-1$
plugin = href.substring(0, index);
path = href.substring(index+1);
} else {
path = href;
}
if (plugin == null)
throw new IOException("Invalid parameters supplied to the validate method."); //$NON-NLS-1$
String key = "/" + plugin + "/" + path; //$NON-NLS-1$ //$NON-NLS-2$
if (processedTocs.get(key) != null) {
if (DEBUG)
System.out.println("Skipping toc because it has already been validated: " + key); //$NON-NLS-1$
return;
}
if (DEBUG)
System.out.println("Starting toc: " + key); //$NON-NLS-1$
processedTocs.put(key, new Object());
TocContribution contribution = parser.parse(new TocFile(plugin,path, true, "en", null, null)); //$NON-NLS-1$
process(contribution.getToc(), plugin, path, result, filter);
}
/* Checks validity of all links in the given IUAElement and recursively calls itself to check all children.
* If there are any links to other tocs, calls the processToc method to validate them. If any broken links
* are found, an appropriate BrokenLink object will be added to the result ArrayList.
*/
private void process(IUAElement element, String plugin, String path, ArrayList<BrokenLink> result, Filter filter) throws SAXException, ParserConfigurationException {
String href;
if (element instanceof ILink) {
href = ((ILink)element).getToc();
try {
processToc(href, plugin, result, filter);
} catch (IOException e) {
result.add(new BrokenLink("/" + plugin + "/" + path, href)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
else if (element instanceof IHelpResource) {
if (element instanceof IToc)
href = ((IToc)element).getTopic(null).getHref();
else
href = ((IHelpResource)element).getHref();
if (href != null && filter.isIncluded(href))
if (!checkLink(href, plugin)) {
result.add(new BrokenLink("/" + plugin + "/" + path, href)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
IUAElement [] children = element.getChildren();
for (int i = 0; i < children.length; i++)
process(children[i], plugin, path, result, filter);
}
/* Checks validity of a given link from a toc in a given plug-in.
* returns true if the link is valid.
*/
private boolean checkLink(String href, String plugin) {
if (href.startsWith("http")) { //$NON-NLS-1$
if (DEBUG)
System.out.println(" Skipping href: " + href); //$NON-NLS-1$
return true;
}
if (DEBUG)
System.out.print(" Checking href: " + href + "..."); //$NON-NLS-1$ //$NON-NLS-2$
boolean result = true;
InputStream i = null;
try {
HelpURLConnection c = new HelpURLConnection(createURL(href, plugin));
if ((i = c.getInputStream()) == null)
result = false;
} catch (Exception e) {
result = false;
}
if (i != null) {
try { i.close(); } catch(Exception e) { }
i = null;
}
if (DEBUG)
System.out.println(result?"pass":"fail"); //$NON-NLS-1$ //$NON-NLS-2$
return result;
}
// Builds a URL for a given plug-in/href to create a HelpURLConnection
private URL createURL(String href, String plugin) throws MalformedURLException {
StringBuffer url = new StringBuffer("file:/"); //$NON-NLS-1$
url.append(plugin);
url.append("/"); //$NON-NLS-1$
url.append(href);
return new URL(url.toString());
}
}
|
[
"187_6810_5877@sina.com"
] |
187_6810_5877@sina.com
|
f24f2c14e54b4ed11145c629146eb3a0d119ed66
|
50c1a79645701fd01bb4c29027ce5ec58c804f58
|
/src/main/java/com/rsg/labs/jhipster/web/rest/errors/CustomParameterizedException.java
|
11f869c44f3c871002be62f4b3ecc7d58f85c71d
|
[] |
no_license
|
BulkSecurityGeneratorProject/javaReactPres
|
df012ad7065f417b386b97c5d6af53763f734521
|
e0b7c3a507c27bce2842ac69ed8f1160373fcd84
|
refs/heads/master
| 2022-12-14T18:29:17.139307
| 2018-07-06T07:26:30
| 2018-07-06T07:26:30
| 296,551,766
| 0
| 0
| null | 2020-09-18T07:49:44
| 2020-09-18T07:49:43
| null |
UTF-8
|
Java
| false
| false
| 1,739
|
java
|
package com.rsg.labs.jhipster.web.rest.errors;
import org.zalando.problem.AbstractThrowableProblem;
import java.util.HashMap;
import java.util.Map;
import static org.zalando.problem.Status.BAD_REQUEST;
/**
* Custom, parameterized exception, which can be translated on the client side.
* For example:
*
* <pre>
* throw new CustomParameterizedException("myCustomError", "hello", "world");
* </pre>
*
* Can be translated with:
*
* <pre>
* "error.myCustomError" : "The server says {{param0}} to {{param1}}"
* </pre>
*/
public class CustomParameterizedException extends AbstractThrowableProblem {
private static final long serialVersionUID = 1L;
private static final String PARAM = "param";
public CustomParameterizedException(String message, String... params) {
this(message, toParamMap(params));
}
public CustomParameterizedException(String message, Map<String, Object> paramMap) {
super(ErrorConstants.PARAMETERIZED_TYPE, "Parameterized Exception", BAD_REQUEST, null, null, null, toProblemParameters(message, paramMap));
}
public static Map<String, Object> toParamMap(String... params) {
Map<String, Object> paramMap = new HashMap<>();
if (params != null && params.length > 0) {
for (int i = 0; i < params.length; i++) {
paramMap.put(PARAM + i, params[i]);
}
}
return paramMap;
}
public static Map<String, Object> toProblemParameters(String message, Map<String, Object> paramMap) {
Map<String, Object> parameters = new HashMap<>();
parameters.put("message", message);
parameters.put("params", paramMap);
return parameters;
}
}
|
[
"jhipster-bot@users.noreply.github.com"
] |
jhipster-bot@users.noreply.github.com
|
ff778a0dfa798cdc08ea02e256a5f837f12e833e
|
ebc27101c70c4ccd418df22d5d6b86987ae5ad42
|
/smartmining/src/main/java/com/seater/smartmining/controller/SessionController.java
|
2704b12555b8179eed913dbdba97df6fc14d324c
|
[] |
no_license
|
KanadeSong/webserver
|
f555210a443c8023bfca3fe7cb49f372a3779801
|
b464c21d5eb33108573a2319ffd982473a489752
|
refs/heads/master
| 2022-03-31T03:07:10.023485
| 2019-12-31T09:59:55
| 2019-12-31T09:59:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,156
|
java
|
package com.seater.smartmining.controller;
import com.seater.helpers.JsonHelper;
import com.seater.user.entity.SysUser;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import static com.seater.user.session.WebSecurityConfig.SESSION_KEY;
@RestController
@RequestMapping("/api/session")
public class SessionController {
@RequestMapping("/web")
public Object web(HttpServletRequest request)
{
try {
HttpSession session = request.getSession();
SysUser user = (SysUser) session.getAttribute(SESSION_KEY);
return JsonHelper.jsonStringToObject("{\"roleType\":\"Super\", \"type\":\"SysUser\", \"username\":\""
+ user.getAccount() + "\"}", Map.class);
}
catch (Exception e)
{
return null;
}
}
// @RequestMapping("/menus")
// public String menus()
// {
// return "";
// }
}
|
[
"545430154@qq.com"
] |
545430154@qq.com
|
88ce5153946b400205984cdbb643b756399b5566
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/34/34_380e2d1478f2de5c2615994cdd1f63c0795e10f8/DeathSystem/34_380e2d1478f2de5c2615994cdd1f63c0795e10f8_DeathSystem_t.java
|
35a6a91875d9ebc4c984f74d4cce1b6841dac384
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 4,681
|
java
|
package com.xkings.pokemontd.system.autonomous;
import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Mapper;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.math.Vector3;
import com.xkings.core.component.PositionComponent;
import com.xkings.pokemontd.App;
import com.xkings.pokemontd.Health;
import com.xkings.pokemontd.Player;
import com.xkings.pokemontd.Treasure;
import com.xkings.pokemontd.component.*;
import com.xkings.pokemontd.entity.MoneyInfo;
import com.xkings.pokemontd.entity.StaticObject;
import com.xkings.pokemontd.entity.creep.Creep;
import com.xkings.pokemontd.entity.creep.CreepAbilityType;
import com.xkings.pokemontd.entity.creep.CreepType;
import com.xkings.pokemontd.entity.datatypes.StaticObjectType;
import com.xkings.pokemontd.map.Path;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* Created by Tomas on 10/4/13.
*/
public class DeathSystem extends EntityProcessingSystem {
private final Player player;
@Mapper
ComponentMapper<PositionComponent> positionMapper;
@Mapper
ComponentMapper<HealthComponent> healthMapper;
@Mapper
ComponentMapper<TreasureComponent> treasureMapper;
@Mapper
ComponentMapper<CreepAbilityComponent> creepAbilityMapper;
@Mapper
ComponentMapper<PathComponent> pathMapper;
@Mapper
ComponentMapper<WaveComponent> waveMapper;
@Mapper
ComponentMapper<CreepTypeComponent> creepTypeMapper;
public DeathSystem(Player player) {
super(Aspect.getAspectForAll(HealthComponent.class, TreasureComponent.class, CreepAbilityComponent.class));
this.player = player;
}
@Override
protected void process(Entity e) {
Health health = healthMapper.get(e).getHealth();
if (!health.isAlive()) {
switch (creepAbilityMapper.get(e).getCreepAbilityType()) {
case RESURRECT:
resurrect(e, 4000);
break;
case SPAWN:
spawn(e, 8);
break;
default:
earn(e);
die(e);
}
}
}
private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor();
private void resurrect(final Entity e, int delayMs) {
final Vector3 position = positionMapper.get(e).getPoint();
final Path path = pathMapper.get(e).getPath();
final WaveComponent waveComponent = waveMapper.get(e);
final CreepType creepType = creepTypeMapper.get(e).getCreepType();
die(e);
final Entity grave = StaticObject.registerStaticObject(world, StaticObjectType.GRAVE, position.x, position.y);
Runnable task = new Runnable() {
public void run() {
die(grave);
Creep.registerCreep(world, path, waveComponent, creepType, CreepAbilityType.NORMAL,
creepType.getSpeed(), creepType.getSize(), position.x, position.y);
}
};
worker.schedule(task, delayMs, TimeUnit.MILLISECONDS);
}
private void spawn(Entity e, int creeps) {
final Vector3 position = positionMapper.get(e).getPoint();
final Path path = pathMapper.get(e).getPath();
final WaveComponent waveComponent = waveMapper.get(e);
final CreepType creepType = creepTypeMapper.get(e).getCreepType();
double circleSegment = Math.PI * 2 / creeps;
float radius = path.getWidth() / 2f * App.WORLD_SCALE;
for (int i = 0; i < creeps; i++) {
float x = position.x + (float) (Math.cos(circleSegment * i) * radius);
float y = position.y + (float) (Math.sin(circleSegment * i) * radius);
Creep.registerCreep(world, path, waveComponent, creepType, CreepAbilityType.NORMAL, creepType.getSpeed(),
creepType.getSize() / 4f, x, y);
}
die(e);
}
private void earn(Entity e) {
Vector3 position = positionMapper.get(e).getPoint();
Treasure treasure = treasureMapper.get(e).getTreasure();
MoneyInfo.registerMoneyInfo(world, treasure.getGold(), position.x, position.y);
treasure.transferTo(player.getTreasure());
}
private void die(Entity e) {
// FIXME tested so far on resurrect and does not work.
// waveMapper.get(e).removeCreep(e);
e.deleteFromWorld();
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
bb5b04b4307b1884beccf2cd15a0f920a65a0bc7
|
3df76d43273824ddeb625acb338ce543a22904f7
|
/ds4p-receiver/ds4p-admin-test-harness-p2/src/main/java/utsapi2_0/UtsMetathesaurusContent/GetAtomSubsetMembershipsResponse.java
|
b9f257fa3d0caba3c74ca9fbfd33f2fbb2886700
|
[] |
no_license
|
PilotDS4P/ds4p-pilot-receiver-public
|
c91ff3f41c9bf7cdf37d18a923b5479d9ce2163e
|
545c7dd006fd7a58daab8502e6ae85e4ec0e3804
|
refs/heads/master
| 2016-09-15T21:40:32.493523
| 2013-05-30T19:31:50
| 2013-05-30T19:31:50
| 10,087,112
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,181
|
java
|
/**
* This software is being provided per FARS 52.227-14 Rights in Data - General.
* Any redistribution or request for copyright requires written consent by the
* Department of Veterans Affairs.
*/
package UtsMetathesaurusContent;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for getAtomSubsetMembershipsResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="getAtomSubsetMembershipsResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://webservice.uts.umls.nlm.nih.gov/}atomSubsetMemberDTO" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getAtomSubsetMembershipsResponse", propOrder = {
"_return"
})
public class GetAtomSubsetMembershipsResponse {
@XmlElement(name = "return")
protected List<AtomSubsetMemberDTO> _return;
/**
* Gets the value of the return property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the return property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getReturn().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link AtomSubsetMemberDTO }
*
*
*/
public List<AtomSubsetMemberDTO> getReturn() {
if (_return == null) {
_return = new ArrayList<AtomSubsetMemberDTO>();
}
return this._return;
}
}
|
[
"duane.decouteau@gmail.com"
] |
duane.decouteau@gmail.com
|
6818b68dca390d8820edb681146192abea7351be
|
30f47590c4b70e90a2409c28759fd8bc06ef5b96
|
/test/src/test/java/org/zstack/test/tag/TestSystemTag2.java
|
4b2a0243e26ea1f2be9f21c139699a80e9e16ff2
|
[
"Apache-2.0"
] |
permissive
|
no2key/zstack
|
4739c627bd41c84f267a09c5dcea8fcf9c603184
|
eda9592b3ef26363612e8df2a2c96fa12c8ba7b2
|
refs/heads/master
| 2020-12-03T03:34:02.743550
| 2015-07-24T03:56:18
| 2015-07-24T03:56:18
| 39,621,131
| 1
| 0
| null | 2015-07-24T08:38:43
| 2015-07-24T08:38:42
| null |
UTF-8
|
Java
| false
| false
| 2,595
|
java
|
package org.zstack.test.tag;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.zstack.core.cloudbus.CloudBus;
import org.zstack.core.componentloader.ComponentLoader;
import org.zstack.core.db.DatabaseFacade;
import org.zstack.header.query.QueryOp;
import org.zstack.header.tag.*;
import org.zstack.header.zone.APIQueryZoneMsg;
import org.zstack.header.zone.APIQueryZoneReply;
import org.zstack.header.zone.ZoneInventory;
import org.zstack.header.zone.ZoneVO;
import org.zstack.tag.SystemTag;
import org.zstack.tag.TagSubQueryExtension;
import org.zstack.test.Api;
import org.zstack.test.ApiSenderException;
import org.zstack.test.DBUtil;
import org.zstack.test.deployer.Deployer;
import java.util.List;
/**
* test lifecycle listener
*/
public class TestSystemTag2 {
Deployer deployer;
Api api;
ComponentLoader loader;
CloudBus bus;
DatabaseFacade dbf;
boolean deleteCalled = false;
boolean createCalled = false;
@TagDefinition
public static class TestSystemTags {
public static SystemTag big = new SystemTag("big", ZoneVO.class);
}
@Before
public void setUp() throws Exception {
DBUtil.reDeployDB();
deployer = new Deployer("deployerXml/tag/TestUserTag.xml");
deployer.build();
api = deployer.getApi();
loader = deployer.getComponentLoader();
bus = loader.getComponent(CloudBus.class);
dbf = loader.getComponent(DatabaseFacade.class);
}
@Test
public void test() throws ApiSenderException {
TestSystemTags.big.installLifeCycleListener(new SystemTagLifeCycleListener() {
@Override
public void tagCreated(SystemTagInventory tag) {
if (tag.getTag().equals(TestSystemTags.big.getTagFormat())) {
createCalled = true;
}
}
@Override
public void tagDeleted(SystemTagInventory tag) {
if (tag.getTag().equals(TestSystemTags.big.getTagFormat())) {
deleteCalled = true;
}
}
});
ZoneInventory zone1 = deployer.zones.get("Zone1");
TagInventory inv = api.createSystemTag(zone1.getUuid(), "big", ZoneVO.class);
api.deleteTag(inv.getUuid());
SystemTagVO tvo = dbf.findByUuid(inv.getUuid(), SystemTagVO.class);
Assert.assertNull(tvo);
Assert.assertTrue(createCalled);
Assert.assertTrue(deleteCalled);
}
}
|
[
"xing5820@gmail.com"
] |
xing5820@gmail.com
|
0a2c415dd1de0eaf4a186bcd795d7946811c9437
|
41adbde51a4d994c1500688a78e500a6b2c59a0d
|
/src/molab/main/java/dao/UserDao.java
|
7f0ba5a48e18781f39a8dfa451533e1474f1fbfd
|
[] |
no_license
|
cocoy2006/ast_molab
|
8701f87d216e2b1eda72db3f8abe3d205a68e5bb
|
e2c173600990c84aa189288b873f395cb81747b7
|
refs/heads/master
| 2021-08-19T14:05:46.830873
| 2017-11-26T14:34:01
| 2017-11-26T14:34:01
| 112,073,485
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,653
|
java
|
package molab.main.java.dao;
import java.util.List;
import molab.main.java.entity.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Repository;
/**
* A data access object (DAO) providing persistence and search support for User
* entities. Transaction control of the save(), update() and delete() operations
* can directly support Spring container-managed transactions or they can be
* augmented to handle user-managed Spring transactions. Each of these methods
* provides additional information for how to configure it for the desired type
* of transaction control.
*
* @see molab.main.java.entity.User
* @author MyEclipse Persistence Tools
*/
@Repository
public class UserDao extends BaseDao<User> {
private static final Logger log = LoggerFactory.getLogger(UserDao.class);
public static final String USERNAME = "username";
public static final String NICKNAME = "nickname";
public static final String PASSWORD = "password";
public static final String EMAIL = "email";
public static final String PHONE = "phone";
public static final String LEFTTIME = "lefttime";
public static final String STATE = "state";
public static final String ROLE = "role";
public User findById(java.lang.Integer id) {
log.debug("getting User instance with id: " + id);
try {
User instance = (User) getHibernateTemplate().get(
"molab.main.java.entity.User", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List<User> findByExample(User instance) {
log.debug("finding User instance by example");
try {
List<User> results = (List<User>) getHibernateTemplate()
.findByExample(instance);
log.debug("find by example successful, result size: "
+ results.size());
return results;
} catch (RuntimeException re) {
log.error("find by example failed", re);
throw re;
}
}
public List findByProperty(String propertyName, Object value) {
log.debug("finding User instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from User as model where model."
+ propertyName + "= ?";
return getHibernateTemplate().find(queryString, value);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
public User findByUsername(Object username) {
List<User> users = findByProperty(USERNAME, username);
if(users != null && users.size() > 0) {
return users.get(0);
}
return null;
}
public List<User> findByNickname(Object nickname) {
return findByProperty(NICKNAME, nickname);
}
public List<User> findByPassword(Object password) {
return findByProperty(PASSWORD, password);
}
public List<User> findByEmail(Object email) {
return findByProperty(EMAIL, email);
}
public List<User> findByPhone(Object phone) {
return findByProperty(PHONE, phone);
}
public List<User> findByLefttime(Object lefttime) {
return findByProperty(LEFTTIME, lefttime);
}
public List<User> findByState(Object state) {
return findByProperty(STATE, state);
}
public List<User> findByRole(Object role) {
return findByProperty(ROLE, role);
}
public List<User> findAll() {
log.debug("finding all User instances");
try {
String queryString = "from User";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
public static UserDao getFromApplicationContext(ApplicationContext ctx) {
return (UserDao) ctx.getBean("UserDao");
}
}
|
[
"yekk@molab.com"
] |
yekk@molab.com
|
4aff6efc86113c0fef2358107815c5ce5c659c13
|
b2917c90089432697b0666cab176ac186293e13b
|
/common/src/main/java/io/github/flemmli97/runecraftory/common/advancements/SimpleTrigger.java
|
bc844e4a682932a971f1ad123336a75e20035dd6
|
[] |
no_license
|
Flemmli97/RuneCraftory
|
42fa7fe440bf20173dea7c35ad90cda99eac28ba
|
9712d5fbe7e4fea6406f215e8f0678d89de715f5
|
refs/heads/1.18
| 2023-09-01T08:00:57.410057
| 2023-08-31T22:52:10
| 2023-08-31T22:52:10
| 118,181,636
| 5
| 0
| null | 2023-01-30T20:26:08
| 2018-01-19T21:42:22
|
Java
|
UTF-8
|
Java
| false
| false
| 1,479
|
java
|
package io.github.flemmli97.runecraftory.common.advancements;
import com.google.gson.JsonObject;
import net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance;
import net.minecraft.advancements.critereon.DeserializationContext;
import net.minecraft.advancements.critereon.EntityPredicate;
import net.minecraft.advancements.critereon.SimpleCriterionTrigger;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
public class SimpleTrigger extends SimpleCriterionTrigger<SimpleTrigger.TriggerInstance> {
private final ResourceLocation id;
public SimpleTrigger(ResourceLocation id) {
this.id = id;
}
@Override
protected SimpleTrigger.TriggerInstance createInstance(JsonObject json, EntityPredicate.Composite player, DeserializationContext context) {
return new SimpleTrigger.TriggerInstance(this.id, player);
}
public void trigger(ServerPlayer player) {
this.trigger(player, inst -> true);
}
@Override
public ResourceLocation getId() {
return this.id;
}
public static class TriggerInstance extends AbstractCriterionTriggerInstance {
public TriggerInstance(ResourceLocation id, EntityPredicate.Composite composite) {
super(id, composite);
}
public static TriggerInstance of(SimpleTrigger trig) {
return new TriggerInstance(trig.getId(), EntityPredicate.Composite.ANY);
}
}
}
|
[
"Flemmli97@users.noreply.github.com"
] |
Flemmli97@users.noreply.github.com
|
ef3157de7bc4a5b478b915f4cdd8356c2c3ed2bc
|
07841705bb52cbe09f2f4736eb7fd3ab21dbbe03
|
/Others/Scope/Scope Part 2/ScopeCheck.java
|
edd782cf394ef3a044574cf2493dcbb7077e7c43
|
[] |
no_license
|
david2999999/Java-Master-Class
|
a861a772bd60654344e2acf6de461c0603e5b0ea
|
91bf32f0a02ee8971c972132b409f0900c7f1541
|
refs/heads/master
| 2021-07-16T03:32:09.526901
| 2018-12-09T13:14:26
| 2018-12-09T13:14:26
| 111,569,329
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,152
|
java
|
package com.timbuchalka;
/**
* Created by dev on 11/11/2015.
*/
public class ScopeCheck {
public int publicVar = 0;
private int varOne = 1;
public ScopeCheck() {
System.out.println("ScopeCheck created, publicVar = " + publicVar + ": varOne = " + varOne);
}
public int getVarOne() {
return varOne;
}
public void timesTwo() {
int varTwo = 2;
for (int i=0; i<10; i++) {
System.out.println(i + " times two is " + i * varTwo);
}
}
public void useInner() {
InnerClass innerClass = new InnerClass();
System.out.println("varThree from outer class: " + innerClass.varThree);
}
public class InnerClass {
private int varThree = 3;
public InnerClass() {
System.out.println("InnerClass created, varOne is " + varOne + " and varThree is " + varThree);
}
public void timesTwo() {
System.out.println("varOne is still available here " + varOne);
for (int i=0; i<10; i++) {
System.out.println(i + " times two is " + i * varThree);
}
}
}
}
|
[
"djiang86@binghamton.edu"
] |
djiang86@binghamton.edu
|
ec76bc57be0767780d36bc72d8a8f132d2fa0f67
|
c5765db45df294be9791e2fbcca65ffe2844bf22
|
/src/main/java/com/qd/common/utils/PropertiesLoader.java
|
e1c4e0c5ffd735835471c80995c6c89b72eb1a57
|
[
"Apache-2.0"
] |
permissive
|
guohaolei/harry
|
f7993f09a4c65982e69125769e46a85bc7473f45
|
54fca65e0c500d7705bcffcbb21f5830b9d23eda
|
refs/heads/master
| 2020-12-02T19:44:01.861952
| 2017-06-15T09:41:06
| 2017-06-15T09:41:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,548
|
java
|
/**
* Copyright (c) 2005-2011 springside.org.cn
*
* $Id: PropertiesLoader.java 1690 2012-02-22 13:42:00Z calvinxiu $
*/
package com.qd.common.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.Properties;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
/**
* Properties文件载入工具类. 可载入多个properties文件,
* 相同的属性在最后载入的文件中的值将会覆盖之前的值,但以System的Property优先.
*
* @author calvin
* @version 2013-05-15
*/
public class PropertiesLoader {
private static Logger logger = LoggerFactory
.getLogger(PropertiesLoader.class);
private static ResourceLoader resourceLoader = new DefaultResourceLoader();
private final Properties properties;
public PropertiesLoader(String... resourcesPaths) {
properties = loadProperties(resourcesPaths);
}
public Properties getProperties() {
return properties;
}
/**
* 取出Property,但以System的Property优先,取不到返回空字符串.
*/
private String getValue(String key) {
String systemProperty = System.getProperty(key);
if (systemProperty != null) {
return systemProperty;
}
if (properties.containsKey(key)) {
return properties.getProperty(key);
}
return "";
}
/**
* 取出String类型的Property,但以System的Property优先,如果都为Null则抛出异常.
*/
public String getProperty(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return value;
}
/**
* 取出String类型的Property,但以System的Property优先.如果都为Null则返回Default值.
*/
public String getProperty(String key, String defaultValue) {
String value = getValue(key);
return value != null ? value : defaultValue;
}
/**
* 取出Integer类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
*/
public Integer getInteger(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Integer.valueOf(value);
}
/**
* 取出Integer类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
*/
public Integer getInteger(String key, Integer defaultValue) {
String value = getValue(key);
return value != null ? Integer.valueOf(value) : defaultValue;
}
/**
* 取出Double类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
*/
public Double getDouble(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Double.valueOf(value);
}
/**
* 取出Double类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
*/
public Double getDouble(String key, Integer defaultValue) {
String value = getValue(key);
return value != null ? Double.valueOf(value) : defaultValue;
}
/**
* 取出Boolean类型的Property,但以System的Property优先.如果都为Null抛出异常,如果内容不是true/
* false则返回false.
*/
public Boolean getBoolean(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Boolean.valueOf(value);
}
/**
* 取出Boolean类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容不为true/
* false则返回false.
*/
public Boolean getBoolean(String key, boolean defaultValue) {
String value = getValue(key);
return value != null ? Boolean.valueOf(value) : defaultValue;
}
/**
* 载入多个文件, 文件路径使用Spring Resource格式.
*/
private Properties loadProperties(String... resourcesPaths) {
Properties props = new Properties();
for (String location : resourcesPaths) {
// logger.debug("Loading properties file from:" + location);
InputStream is = null;
try {
Resource resource = resourceLoader.getResource(location);
is = resource.getInputStream();
props.load(is);
} catch (IOException ex) {
logger.info("Could not load properties from path:" + location
+ ", " + ex.getMessage());
} finally {
IOUtils.closeQuietly(is);
}
}
return props;
}
}
|
[
"183865800@qq.com"
] |
183865800@qq.com
|
65226eb2be25ee3e7c7ed61b1795fd5f2c70dc62
|
893523f6c6d012351cae5ee1a5ed5045a5e78607
|
/guess-game-server/src/main/java/guess/util/load/CmsDataLoaderFactory.java
|
e2d9346ad369396afff470145eef1636dae4b18c
|
[] |
no_license
|
JugruGroup/guess-game
|
873d494fcba8b3a8c8794b498078bc4badd11c60
|
8e982353346f6acf3bdc4c524f72e5f4f508a495
|
refs/heads/master
| 2023-08-20T11:38:31.608974
| 2023-08-19T17:22:04
| 2023-08-19T17:22:04
| 213,897,239
| 10
| 3
| null | 2023-09-14T10:20:05
| 2019-10-09T11:14:04
|
Java
|
UTF-8
|
Java
| false
| false
| 937
|
java
|
package guess.util.load;
import guess.domain.source.load.CmsType;
import java.time.LocalDate;
/**
* Factory of CMS data loader.
*/
public class CmsDataLoaderFactory {
private static final LocalDate CONTENTFUL_AND_DATE = LocalDate.of(2022, 1, 1);
private CmsDataLoaderFactory() {
}
static CmsDataLoader createDataLoader(CmsType cmsType) {
if (CmsType.CONTENTFUL.equals(cmsType)) {
return new ContentfulDataLoader();
} else if (CmsType.JUGRUGROUP_CMS.equals(cmsType)) {
return new JrgCmsDataLoader();
} else {
throw new IllegalArgumentException(String.format("Unknown CMS type: %s", cmsType));
}
}
static CmsDataLoader createDataLoader(LocalDate startDate) {
if (startDate.isBefore(CONTENTFUL_AND_DATE)) {
return new ContentfulDataLoader();
} else {
return new JrgCmsDataLoader();
}
}
}
|
[
"dbelob@users.noreply.github.com"
] |
dbelob@users.noreply.github.com
|
429fda19d25d4ac21c84195398c0274015a36cd3
|
13e87bedfeecf62a2ee92f7dc81b010178910d47
|
/ProfessionalAndroid4ApplicationDevelopment/Code Snippets/Chapter 15/PA4AD_Ch15_Intent_Camera/src/com/paad/intentcamera/CameraActivity.java
|
3209f8eea5dadcbe22fd44d7da9256994f1c5f9c
|
[] |
no_license
|
longlinht/SourcesFromBook
|
fc44e4a2f67bb4df3a6866280c562a82ed83b6bd
|
6eea43041800e843a22d4bb0757222d8064b8716
|
refs/heads/master
| 2021-07-18T03:18:57.075712
| 2021-03-03T07:31:50
| 2021-03-03T07:31:50
| 61,864,811
| 3
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,576
|
java
|
package com.paad.intentcamera;
import java.io.File;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
public class CameraActivity extends Activity {
private static final int TAKE_PICTURE = 0;
private Uri outputFileUri;
private ImageView imageView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
imageView = (ImageView)findViewById(R.id.imageView1);
Button fullPhotoButton = (Button)findViewById(R.id.buttonFullPicture);
fullPhotoButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
/**
* Listing 15-23: Requesting a full-size picture using an Intent
*/
// Create an output file.
File file = new File(Environment.getExternalStorageDirectory(),
"test.jpg");
Uri outputFileUri = Uri.fromFile(file);
// Generate the Intent.
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
// Launch the camera app.
startActivityForResult(intent, TAKE_PICTURE);
}
});
Button photoButton = (Button)findViewById(R.id.buttonPicture);
photoButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
startActivityForResult(
new Intent(MediaStore.ACTION_IMAGE_CAPTURE), TAKE_PICTURE);
}
});
}
/**
* Listing 15-24: Receiving pictures from an Intent
*/
@Override
protected void onActivityResult(int requestCode,
int resultCode, Intent data) {
if (requestCode == TAKE_PICTURE) {
// Check if the result includes a thumbnail Bitmap
if (data != null) {
if (data.hasExtra("data")) {
Bitmap thumbnail = data.getParcelableExtra("data");
imageView.setImageBitmap(thumbnail);
}
} else {
// If there is no thumbnail image data, the image
// will have been stored in the target output URI.
// Resize the full image to fit in out image view.
int width = imageView.getWidth();
int height = imageView.getHeight();
BitmapFactory.Options factoryOptions = new
BitmapFactory.Options();
factoryOptions.inJustDecodeBounds = true;
BitmapFactory.decodeFile(outputFileUri.getPath(),
factoryOptions);
int imageWidth = factoryOptions.outWidth;
int imageHeight = factoryOptions.outHeight;
// Determine how much to scale down the image
int scaleFactor = Math.min(imageWidth/width,
imageHeight/height);
// Decode the image file into a Bitmap sized to fill the View
factoryOptions.inJustDecodeBounds = false;
factoryOptions.inSampleSize = scaleFactor;
factoryOptions.inPurgeable = true;
Bitmap bitmap =
BitmapFactory.decodeFile(outputFileUri.getPath(),
factoryOptions);
imageView.setImageBitmap(bitmap);
}
}
}
}
|
[
"longlinht@gmail.com"
] |
longlinht@gmail.com
|
ca696f9e375b3d9743179607483bca34e37a9ac5
|
64b47f83d313af33804b946d0613760b8ff23840
|
/tags/dev-3-7-4/weka/src/main/java/weka/gui/beans/ClassAssignerCustomizer.java
|
f5b26ce0862952d1e732416ce45e99ea7b29b4be
|
[] |
no_license
|
hackerastra/weka
|
afde1c7ab0fbf374e6d6ac6d07220bfaffb9488c
|
c8366c454e9718d0e1634ddf4a72319dac3ce559
|
refs/heads/master
| 2021-05-28T08:25:33.811203
| 2015-01-22T03:12:18
| 2015-01-22T03:12:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,987
|
java
|
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* ClassAssignerCustomizer.java
* Copyright (C) 2002 University of Waikato, Hamilton, New Zealand
*
*/
package weka.gui.beans;
import weka.core.Attribute;
import weka.core.Instances;
import weka.gui.PropertySheetPanel;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Customizer;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JPanel;
/**
* GUI customizer for the class assigner bean
*
* @author <a href="mailto:mhall@cs.waikato.ac.nz">Mark Hall</a>
* @version $Revision$
*/
public class ClassAssignerCustomizer
extends JPanel
implements BeanCustomizer, CustomizerClosingListener,
CustomizerCloseRequester, DataFormatListener {
/** for serialization */
private static final long serialVersionUID = 476539385765301907L;
private boolean m_displayColNames = false;
private ClassAssigner m_classAssigner;
private PropertyChangeSupport m_pcSupport =
new PropertyChangeSupport(this);
private PropertySheetPanel m_caEditor =
new PropertySheetPanel();
private JComboBox m_ClassCombo = new JComboBox();
private JPanel m_holderP = new JPanel();
private ModifyListener m_modifyListener;
private Window m_parent;
private String m_backup;
public ClassAssignerCustomizer() {
setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 5, 5));
setLayout(new BorderLayout());
add(new javax.swing.JLabel("ClassAssignerCustomizer"),
BorderLayout.NORTH);
m_holderP.setLayout(new BorderLayout());
m_holderP.setBorder(BorderFactory.createTitledBorder("Choose class attribute"));
m_holderP.add(m_ClassCombo, BorderLayout.CENTER);
m_ClassCombo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (m_classAssigner != null && m_displayColNames == true) {
m_classAssigner.setClassColumn(""+(m_ClassCombo.getSelectedIndex()));
}
}
});
add(m_caEditor, BorderLayout.CENTER);
addButtons();
}
private void addButtons() {
JButton okBut = new JButton("OK");
JButton cancelBut = new JButton("Cancel");
JPanel butHolder = new JPanel();
butHolder.setLayout(new GridLayout(1, 2));
butHolder.add(okBut); butHolder.add(cancelBut);
add(butHolder, BorderLayout.SOUTH);
okBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
m_modifyListener.setModifiedStatus(ClassAssignerCustomizer.this, true);
if (m_parent != null) {
m_parent.dispose();
}
}
});
cancelBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
customizerClosing();
if (m_parent != null) {
m_parent.dispose();
}
}
});
}
private void setUpStandardSelection() {
if (m_displayColNames == true) {
remove(m_holderP);
m_caEditor.setTarget(m_classAssigner);
add(m_caEditor, BorderLayout.CENTER);
m_displayColNames = false;
}
validate(); repaint();
}
private void setUpColumnSelection(Instances format) {
if (m_displayColNames == false) {
remove(m_caEditor);
}
int existingClassCol = format.classIndex();
if (existingClassCol < 0) {
existingClassCol = 0;
}
String [] attribNames = new String [format.numAttributes()+1];
attribNames[0] = "NO CLASS";
for (int i = 1; i < attribNames.length; i++) {
String type = "(" + Attribute.typeToStringShort(format.attribute(i-1)) + ") ";
attribNames[i] = type + format.attribute(i-1).name();
}
m_ClassCombo.setModel(new DefaultComboBoxModel(attribNames));
if (attribNames.length > 0) {
m_ClassCombo.setSelectedIndex(existingClassCol+1);
}
if (m_displayColNames == false) {
add(m_holderP, BorderLayout.CENTER);
m_displayColNames = true;
}
validate(); repaint();
}
/**
* Set the bean to be edited
*
* @param object an <code>Object</code> value
*/
public void setObject(Object object) {
if (m_classAssigner != (ClassAssigner)object) {
// remove ourselves as a listener from the old ClassAssigner (if necessary)
if (m_classAssigner != null) {
m_classAssigner.removeDataFormatListener(this);
}
m_classAssigner = (ClassAssigner)object;
// add ourselves as a data format listener
m_classAssigner.addDataFormatListener(this);
m_caEditor.setTarget(m_classAssigner);
if (m_classAssigner.getConnectedFormat() != null) {
setUpColumnSelection(m_classAssigner.getConnectedFormat());
}
m_backup = m_classAssigner.getClassColumn();
}
}
public void customizerClosing() {
// remove ourselves as a listener from the ClassAssigner (if necessary)
if (m_classAssigner != null) {
//System.out.println("Customizer deregistering with class assigner");
m_classAssigner.removeDataFormatListener(this);
}
if (m_backup != null) {
m_classAssigner.setClassColumn(m_backup);
}
}
public void newDataFormat(DataSetEvent dse) {
if (dse.getDataSet() != null) {
// System.err.println("Setting up column selection.........");
setUpColumnSelection(m_classAssigner.getConnectedFormat());
} else {
setUpStandardSelection();
}
}
/**
* Add a property change listener
*
* @param pcl a <code>PropertyChangeListener</code> value
*/
public void addPropertyChangeListener(PropertyChangeListener pcl) {
m_pcSupport.addPropertyChangeListener(pcl);
}
/**
* Remove a property change listener
*
* @param pcl a <code>PropertyChangeListener</code> value
*/
public void removePropertyChangeListener(PropertyChangeListener pcl) {
m_pcSupport.removePropertyChangeListener(pcl);
}
@Override
public void setModifiedListener(ModifyListener l) {
m_modifyListener = l;
}
@Override
public void setParentWindow(Window parent) {
m_parent = parent;
}
}
|
[
"mhall@e0a1b77d-ad91-4216-81b1-defd5f83fa92"
] |
mhall@e0a1b77d-ad91-4216-81b1-defd5f83fa92
|
a86ac209556bd850ef382f7acc0747d5c6db3052
|
99a8722d0d16e123b69e345df7aadad409649f6c
|
/jpa/deferred/src/main/java/example/repo/Customer1521Repository.java
|
e44d48e867574b97f87225bbaad498e13b98c8fc
|
[
"Apache-2.0"
] |
permissive
|
spring-projects/spring-data-examples
|
9c69a0e9f3e2e73c4533dbbab00deae77b2aacd7
|
c4d1ca270fcf32a93c2a5e9d7e91a5592b7720ff
|
refs/heads/main
| 2023-09-01T14:17:56.622729
| 2023-08-22T16:51:10
| 2023-08-24T19:48:04
| 16,381,571
| 5,331
| 3,985
|
Apache-2.0
| 2023-08-25T09:02:19
| 2014-01-30T15:42:43
|
Java
|
UTF-8
|
Java
| false
| false
| 284
|
java
|
package example.repo;
import example.model.Customer1521;
import java.util.List;
import org.springframework.data.repository.CrudRepository;
public interface Customer1521Repository extends CrudRepository<Customer1521, Long> {
List<Customer1521> findByLastName(String lastName);
}
|
[
"ogierke@pivotal.io"
] |
ogierke@pivotal.io
|
ecfb135ddf2281552c2ccc579d9c903815f60e54
|
cf4e63a3983b4e65b08368e678900b0a56a801a9
|
/bbb-screenshare/app/src/main/java/org/bigbluebutton/app/screenshare/red5/EventListenerImp.java
|
d42bdd32d897204c03e9e6fcabd0b57c88650a8f
|
[] |
no_license
|
Rickib93/bigbluebutton
|
bdfdd07a1b6b3cceaae41f273f37a9bec1d5fc38
|
4f4f2a71effc708aa9f8ce76adbfd71b9b0fc7b4
|
refs/heads/master
| 2021-01-18T02:56:10.585852
| 2016-08-15T20:25:05
| 2016-08-15T20:25:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,961
|
java
|
package org.bigbluebutton.app.screenshare.red5;
import java.util.HashMap;
import java.util.Map;
import org.bigbluebutton.app.screenshare.events.IEvent;
import org.bigbluebutton.app.screenshare.events.IEventListener;
import org.bigbluebutton.app.screenshare.events.ShareStartedEvent;
import org.bigbluebutton.app.screenshare.events.ShareStoppedEvent;
import org.bigbluebutton.app.screenshare.events.StreamStartedEvent;
import org.bigbluebutton.app.screenshare.events.StreamStoppedEvent;
import com.google.gson.Gson;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
public class EventListenerImp implements IEventListener {
private static Logger log = Red5LoggerFactory.getLogger(EventListenerImp.class, "screenshare");
private ConnectionInvokerService sender;
@Override
public void handleMessage(IEvent event) {
if (event instanceof ShareStartedEvent) {
sendShareStartedEvent((ShareStartedEvent) event);
} else if (event instanceof ShareStoppedEvent) {
sendShareStoppedEvent((ShareStoppedEvent) event);
} else if (event instanceof StreamStartedEvent) {
sendStreamStartedEvent((StreamStartedEvent) event);
} else if (event instanceof StreamStoppedEvent) {
sendStreamStoppedEvent((StreamStoppedEvent) event);
}
}
private void sendShareStartedEvent(ShareStartedEvent event) {
Map<String, Object> data = new HashMap<String, Object>();
data.put("meetingId", event.meetingId);
data.put("streamId", event.streamId);
Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson();
message.put("msg", gson.toJson(data));
BroadcastClientMessage msg = new BroadcastClientMessage(event.meetingId, "screenShareStartedMessage", message);
sender.sendMessage(msg);
Map<String, Object> logData = new HashMap<String, Object>();
logData.put("meetingId", event.meetingId);
logData.put("streamId", event.streamId);
gson = new Gson();
String logStr = gson.toJson(logData);
log.info("Screenshare started message: data={}", logStr);
}
private void sendShareStoppedEvent(ShareStoppedEvent event) {
Map<String, Object> data = new HashMap<String, Object>();
data.put("meetingId", event.meetingId);
data.put("streamId", event.streamId);
Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson();
message.put("msg", gson.toJson(data));
BroadcastClientMessage msg = new BroadcastClientMessage(event.meetingId, "screenShareStoppedMessage", message);
sender.sendMessage(msg);
Map<String, Object> logData = new HashMap<String, Object>();
logData.put("meetingId", event.meetingId);
logData.put("streamId", event.streamId);
gson = new Gson();
String logStr = gson.toJson(logData);
log.info("Screenshare stopped message: data={}", logStr);
}
private void sendStreamStartedEvent(StreamStartedEvent event) {
Map<String, Object> data = new HashMap<String, Object>();
data.put("meetingId", event.meetingId);
data.put("streamId", event.streamId);
data.put("width", event.width);
data.put("height", event.height);
data.put("url", event.url);
Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson();
message.put("msg", gson.toJson(data));
BroadcastClientMessage msg = new BroadcastClientMessage(event.meetingId, "screenStreamStartedMessage", message);
sender.sendMessage(msg);
Map<String, Object> logData = new HashMap<String, Object>();
logData.put("meetingId", event.meetingId);
logData.put("streamId", event.streamId);
logData.put("width", event.width);
logData.put("height", event.height);
logData.put("url", event.url);
gson = new Gson();
String logStr = gson.toJson(logData);
log.info("Screenshare stream started message: data={}", logStr);
}
private void sendStreamStoppedEvent(StreamStoppedEvent event) {
Map<String, Object> data = new HashMap<String, Object>();
data.put("meetingId", event.meetingId);
data.put("streamId", event.streamId);
Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson();
message.put("msg", gson.toJson(data));
BroadcastClientMessage msg = new BroadcastClientMessage(event.meetingId, "screenStreamStoppedMessage", message);
sender.sendMessage(msg);
Map<String, Object> logData = new HashMap<String, Object>();
logData.put("meetingId", event.meetingId);
logData.put("streamId", event.streamId);
gson = new Gson();
String logStr = gson.toJson(logData);
log.info("Screenshare stream stopped message: data={}", logStr);
}
public void setMessageSender(ConnectionInvokerService sender) {
this.sender = sender;
}
}
|
[
"ritzalam@gmail.com"
] |
ritzalam@gmail.com
|
10334fa69faccb2896f2654158344a43abb675e3
|
eb2c22492d4740a3eb455f2a898f6b3bc8235809
|
/jnnsBank/kyc-api/src/main/java/com/ideatech/ams/kyc/dto/CarrierOperatorDto.java
|
32ab259f8de8efc598d4602f809203c1b6e457d5
|
[] |
no_license
|
deepexpert-gaohz/sa-d
|
72a2d0cbfe95252d2a62f6247e7732c883049459
|
2d14275071b3d562447d24bd44d3a53f5a96fb71
|
refs/heads/master
| 2023-03-10T08:39:15.544657
| 2021-02-24T02:17:58
| 2021-02-24T02:17:58
| 341,395,351
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 479
|
java
|
package com.ideatech.ams.kyc.dto;
import com.ideatech.common.dto.BaseMaintainableDto;
import lombok.Data;
@Data
public class CarrierOperatorDto extends BaseMaintainableDto {
//姓名
private Long id;
//姓名
private String name;
//手机号
private String mobile;
//身份证号码
private String cardno;
//查询结果状态(success成功,fail失败)
private String status;
//查询失败原因
private String reason;
//查询结果
private String result;
}
|
[
"807661486@qq.com"
] |
807661486@qq.com
|
2c06c56126c7188c167b0b02d20702a1f5d89068
|
c37d2a36312534a55c319b19b61060649c7c862c
|
/app/src/main/java/com/spongycastle/jcajce/provider/asymmetric/util/DSABase.java
|
897bbbf4057fffdf99ef8d8edecf650973dc8412
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
trwinowiecki/AndroidTexting
|
f5626ad91a07ea7b3cd3ee75893abf8b1fe7154f
|
27e84a420b80054e676c390b898705856364b340
|
refs/heads/master
| 2020-12-30T23:10:17.542572
| 2017-02-01T01:46:13
| 2017-02-01T01:46:13
| 80,580,124
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,799
|
java
|
package com.spongycastle.jcajce.provider.asymmetric.util;
import java.math.BigInteger;
import java.security.SignatureException;
import java.security.SignatureSpi;
import java.security.spec.AlgorithmParameterSpec;
import com.spongycastle.asn1.pkcs.PKCSObjectIdentifiers;
import com.spongycastle.asn1.x509.X509ObjectIdentifiers;
import com.spongycastle.crypto.DSA;
import com.spongycastle.crypto.Digest;
public abstract class DSABase
extends SignatureSpi
implements PKCSObjectIdentifiers, X509ObjectIdentifiers
{
protected Digest digest;
protected DSA signer;
protected DSAEncoder encoder;
protected DSABase(
Digest digest,
DSA signer,
DSAEncoder encoder)
{
this.digest = digest;
this.signer = signer;
this.encoder = encoder;
}
protected void engineUpdate(
byte b)
throws SignatureException
{
digest.update(b);
}
protected void engineUpdate(
byte[] b,
int off,
int len)
throws SignatureException
{
digest.update(b, off, len);
}
protected byte[] engineSign()
throws SignatureException
{
byte[] hash = new byte[digest.getDigestSize()];
digest.doFinal(hash, 0);
try
{
BigInteger[] sig = signer.generateSignature(hash);
return encoder.encode(sig[0], sig[1]);
}
catch (Exception e)
{
throw new SignatureException(e.toString());
}
}
protected boolean engineVerify(
byte[] sigBytes)
throws SignatureException
{
byte[] hash = new byte[digest.getDigestSize()];
digest.doFinal(hash, 0);
BigInteger[] sig;
try
{
sig = encoder.decode(sigBytes);
}
catch (Exception e)
{
throw new SignatureException("error decoding signature bytes.");
}
return signer.verifySignature(hash, sig[0], sig[1]);
}
protected void engineSetParameter(
AlgorithmParameterSpec params)
{
throw new UnsupportedOperationException("engineSetParameter unsupported");
}
/**
* @deprecated replaced with <a href = "#engineSetParameter(java.security.spec.AlgorithmParameterSpec)">
*/
protected void engineSetParameter(
String param,
Object value)
{
throw new UnsupportedOperationException("engineSetParameter unsupported");
}
/**
* @deprecated
*/
protected Object engineGetParameter(
String param)
{
throw new UnsupportedOperationException("engineSetParameter unsupported");
}
}
|
[
"trw0511@gmail.com"
] |
trw0511@gmail.com
|
e7a0b1b9ef8d910ab972611b59f302dd3bab7332
|
254fdb8729b639fd0fb9896364d0e89186521b6a
|
/src/main/java/com/fishercoder/solutions/_740.java
|
01a859eebfc34ecacfdf34878187c2e50d77abf9
|
[
"Apache-2.0"
] |
permissive
|
jiangxf/java_interview
|
99e9601aefa058a2465946803ad348ffb91f804e
|
1a1794689d7a977464e7e47a994140de67cf56be
|
refs/heads/master
| 2020-04-08T14:54:06.386481
| 2018-12-04T06:03:31
| 2018-12-04T06:03:31
| 159,456,451
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,984
|
java
|
package com.fishercoder.solutions;
/**
* 740. Delete and Earn
* <p>
* Given an array nums of integers, you can perform operations on the array.
* In each operation, you pick any nums[i] and delete it to earn nums[i] points. After, you must delete every element equal to nums[i] - 1 or nums[i] + 1.
* You start with 0 points. Return the maximum number of points you can earn by applying such operations.
* <p>
* Example 1:
* Input: nums = [3, 4, 2]
* Output: 6
* Explanation:
* Delete 4 to earn 4 points, consequently 3 is also deleted.
* Then, delete 2 to earn 2 points. 6 total points are earned.
* <p>
* Example 2:
* Input: nums = [2, 2, 3, 3, 3, 4]
* Output: 9
* Explanation:
* Delete 3 to earn 3 points, deleting both 2's and the 4.
* Then, delete 3 again to earn 3 points, and 3 again to earn 3 points.
* 9 total points are earned.
* <p>
* Note:
* The length of nums is at most 20000.
* Each element nums[i] is an integer in the range [1, 10000].
*/
public class _740 {
public static class Solution1 {
/**
* Since the number is within range [1, 10000], we can build another array:
* each number in the array denotes the total sum of this number that appears in this array
* and
* use the numbers themselves in the indices of another array
* <p>
* credit: https://leetcode.com/problems/delete-and-earn/discuss/109895/JavaC++-Clean-Code-with-Explanation
*/
public int deleteAndEarn(int[] nums) {
int n = 10001;
int[] values = new int[n];
for (int num : nums) {
values[num] += num;
}
int take = 0;
int skip = 0;
for (int i = 0; i < n; i++) {
int takeI = skip + values[i];
int skipI = Math.max(skip, take);
take = takeI;
skip = skipI;
}
return Math.max(take, skip);
}
}
}
|
[
"jiangxiaofeng@simuyun.com"
] |
jiangxiaofeng@simuyun.com
|
cc4ddd3beb0f9f888dd29c1c33a2a7061b790753
|
9410ef0fbb317ace552b6f0a91e0b847a9a841da
|
/src/main/java/com/tencentcloudapi/ciam/v20210420/models/ListUserGroupsRequest.java
|
b62bb9da2fbc949230a397931b31c514be456fdd
|
[
"Apache-2.0"
] |
permissive
|
TencentCloud/tencentcloud-sdk-java-intl-en
|
274de822748bdb9b4077e3b796413834b05f1713
|
6ca868a8de6803a6c9f51af7293d5e6dad575db6
|
refs/heads/master
| 2023-09-04T05:18:35.048202
| 2023-09-01T04:04:14
| 2023-09-01T04:04:14
| 230,567,388
| 7
| 4
|
Apache-2.0
| 2022-05-25T06:54:45
| 2019-12-28T06:13:51
|
Java
|
UTF-8
|
Java
| false
| false
| 4,054
|
java
|
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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 com.tencentcloudapi.ciam.v20210420.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class ListUserGroupsRequest extends AbstractModel{
/**
* User directory ID
*/
@SerializedName("UserStoreId")
@Expose
private String UserStoreId;
/**
* Number of queried pages
*/
@SerializedName("Page")
@Expose
private Long Page;
/**
* Number of entries per page
*/
@SerializedName("Size")
@Expose
private Long Size;
/**
* Query conditions (user group ID or user group name)
*/
@SerializedName("Condition")
@Expose
private String Condition;
/**
* Get User directory ID
* @return UserStoreId User directory ID
*/
public String getUserStoreId() {
return this.UserStoreId;
}
/**
* Set User directory ID
* @param UserStoreId User directory ID
*/
public void setUserStoreId(String UserStoreId) {
this.UserStoreId = UserStoreId;
}
/**
* Get Number of queried pages
* @return Page Number of queried pages
*/
public Long getPage() {
return this.Page;
}
/**
* Set Number of queried pages
* @param Page Number of queried pages
*/
public void setPage(Long Page) {
this.Page = Page;
}
/**
* Get Number of entries per page
* @return Size Number of entries per page
*/
public Long getSize() {
return this.Size;
}
/**
* Set Number of entries per page
* @param Size Number of entries per page
*/
public void setSize(Long Size) {
this.Size = Size;
}
/**
* Get Query conditions (user group ID or user group name)
* @return Condition Query conditions (user group ID or user group name)
*/
public String getCondition() {
return this.Condition;
}
/**
* Set Query conditions (user group ID or user group name)
* @param Condition Query conditions (user group ID or user group name)
*/
public void setCondition(String Condition) {
this.Condition = Condition;
}
public ListUserGroupsRequest() {
}
/**
* NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
* and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
*/
public ListUserGroupsRequest(ListUserGroupsRequest source) {
if (source.UserStoreId != null) {
this.UserStoreId = new String(source.UserStoreId);
}
if (source.Page != null) {
this.Page = new Long(source.Page);
}
if (source.Size != null) {
this.Size = new Long(source.Size);
}
if (source.Condition != null) {
this.Condition = new String(source.Condition);
}
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "UserStoreId", this.UserStoreId);
this.setParamSimple(map, prefix + "Page", this.Page);
this.setParamSimple(map, prefix + "Size", this.Size);
this.setParamSimple(map, prefix + "Condition", this.Condition);
}
}
|
[
"tencentcloudapi@tencent.com"
] |
tencentcloudapi@tencent.com
|
16f33358b3d81f1ec1c727e4c07a1fe2d5907f65
|
4c2e8b9d64dce94ec74fa2a4951a926f42db7f7a
|
/src/by/it/_examples_/jd02_06/p03_abstract_factory/Start.java
|
3a2df362cab86f22e564c27a1e78e716722b02c0
|
[] |
no_license
|
NorthDragons/JD2021-02-24
|
7ffa5d4fc6d0984563a0af192fc34b921327c52a
|
14bc46e536a1352dca08585ed03309e1e11e52e5
|
refs/heads/master
| 2023-04-01T16:44:33.325159
| 2021-04-23T14:59:25
| 2021-04-23T14:59:25
| 344,739,064
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 674
|
java
|
package by.it._examples_.jd02_06.p03_abstract_factory;
import by.it._examples_.jd02_06.p03_abstract_factory.factory.impl.BelorussianFactory;
import by.it._examples_.jd02_06.p03_abstract_factory.factory.impl.USAFactory;
import by.it._examples_.jd02_06.p03_abstract_factory.factory.interfaces.TransportFactory;
public class Start {
public static void main(String[] args) {
boolean home = Math.random()>0.5;
TransportFactory factory;
if (home){
factory = new BelorussianFactory();
}else{
factory = new USAFactory();
}
factory.createAircraft().flight();
factory.createCar().drive();
}
}
|
[
"akhmelev@gmail.com"
] |
akhmelev@gmail.com
|
8b194064124211971ef8956664936934c69d00aa
|
a33aac97878b2cb15677be26e308cbc46e2862d2
|
/data/libgdx/HullDesc_getMVertices.java
|
a0c8f2c65b464ab8e4b00dc4d966c9710322cd12
|
[] |
no_license
|
GabeOchieng/ggnn.tensorflow
|
f5d7d0bca52258336fc12c9de6ae38223f28f786
|
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
|
refs/heads/master
| 2022-05-30T11:17:42.278048
| 2020-05-02T11:33:31
| 2020-05-02T11:33:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 166
|
java
|
public btVector3 getMVertices() {
long cPtr = LinearMathJNI.HullDesc_mVertices_get(swigCPtr, this);
return (cPtr == 0) ? null : new btVector3(cPtr, false);
}
|
[
"bdqnghi@gmail.com"
] |
bdqnghi@gmail.com
|
ea0a93e57841fbb02f3cacd7a4f82403d8b9fb34
|
6866965eee7057a7d98826fcf96e49c56461f111
|
/zjp2p-web-cxf/src/main/java/com/zjgt/msg/util/HttpRequest.java
|
4cc23cd7abd70d94ebe22e39b9e14d02cc8473c8
|
[] |
no_license
|
Permissions-System/zjparent
|
c4b8c39de36b07e6d7863827dde65a04fa563187
|
4bf961785eb06f8b52db5e16b6e37a8e269d264f
|
refs/heads/master
| 2020-03-15T04:30:34.791636
| 2018-05-03T08:52:48
| 2018-05-03T08:52:48
| 131,967,240
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,841
|
java
|
package com.zjgt.msg.util;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import java.util.Map;
public class HttpRequest {
/**
* 向指定URL发送GET方法的请求
*
* @param url
* 发送请求的URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return URL 所代表远程资源的响应结果
*/
public static String sendGet(String url, String param) {
String result = "";
BufferedReader in = null;
try {
String urlNameString = url + "?" + param;
URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接
URLConnection connection = realUrl.openConnection();
// 设置通用的请求属性
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 建立实际的连接 connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
// for (String key : map.keySet()) {
// System.out.println(key + "--->" + map.get(key));
// }
// 定义 BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送GET请求出现异常!" + e);
e.printStackTrace();
}
// 使用finally块来关闭输入流
finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return result;
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url
* 发送请求的 URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public static String sendPost(String url, String param) {
PrintWriter out = null;
BufferedReader in = null;
String result = "";
try {
URL realUrl = new URL(url);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new PrintWriter(conn.getOutputStream());
// 发送请求参数
out.print(param);
// flush输出流的缓冲
out.flush();
// 定义BufferedReader输入流来读取URL的响应
in = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送 POST 请求出现异常!"+e);
e.printStackTrace();
}
//使用finally块来关闭输出流、输入流
finally{
try{
if(out!=null){
out.close();
}
if(in!=null){
in.close();
}
}
catch(IOException ex){
ex.printStackTrace();
}
}
return result;
}
}
// public static void main(String[] args) {
// //发送 GET 请求
// String s=HttpRequest.sendGet("http://localhost:6144/Home/RequestString", "key=123&v=456");
// System.out.println(s);
//
// //发送 POST 请求
// String sr=HttpRequest.sendPost("http://localhost:6144/Home/RequestPostString", "key=123&v=456");
// System.out.println(sr);
// }
|
[
"kaiyun@zillionfortune.com"
] |
kaiyun@zillionfortune.com
|
c04cd89a1026a80dc72d29a16ae868c502cb8bec
|
fbf95d693ad5beddfb6ded0be170a9e810a10677
|
/finance/egov/egov-collection/src/main/java/org/egov/collection/integration/models/PaymentInfoChequeDD.java
|
fe7da6b14944c98cebefca4de6962fd878ef2a81
|
[
"GPL-1.0-or-later",
"GPL-3.0-or-later",
"LicenseRef-scancode-proprietary-license",
"GPL-3.0-only",
"MIT",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
egovernments/DIGIT-OSS
|
330cc364af1b9b66db8914104f64a0aba666426f
|
bf02a2c7eb783bf9fdf4b173faa37f402e05e96e
|
refs/heads/master
| 2023-08-15T21:26:39.992558
| 2023-08-08T10:14:31
| 2023-08-08T10:14:31
| 353,807,330
| 25
| 91
|
MIT
| 2023-09-10T13:23:31
| 2021-04-01T19:35:55
|
Java
|
UTF-8
|
Java
| false
| false
| 5,104
|
java
|
/*
* eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency,
* accountability and the service delivery of the government organizations.
*
* Copyright (C) 2017 eGovernments Foundation
*
* The updated version of eGov suite of products as by eGovernments Foundation
* is available at http://www.egovernments.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ or
* http://www.gnu.org/licenses/gpl.html .
*
* In addition to the terms of the GPL license to be adhered to in using this
* program, the following additional terms are to be complied with:
*
* 1) All versions of this program, verbatim or modified must carry this
* Legal Notice.
* Further, all user interfaces, including but not limited to citizen facing interfaces,
* Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any
* derived works should carry eGovernments Foundation logo on the top right corner.
*
* For the logo, please refer http://egovernments.org/html/logo/egov_logo.png.
* For any further queries on attribution, including queries on brand guidelines,
* please contact contact@egovernments.org
*
* 2) Any misrepresentation of the origin of the material is prohibited. It
* is required that all modified versions of this material be marked in
* reasonable ways as different from the original version.
*
* 3) This license does not grant any rights to any user of the program
* with regards to rights under trademark law for use of the trade names
* or trademarks of eGovernments Foundation.
*
* In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org.
*
*/
/**
*
*/
package org.egov.collection.integration.models;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author rishi
*/
public class PaymentInfoChequeDD implements PaymentInfo {
private Long bankId;
private String branchName;
private Date instrumentDate;
private String instrumentNumber;
private TYPE instrumentType;
private BigDecimal instrumentAmount;
/**
* Default constructor
*/
public PaymentInfoChequeDD() {
}
public PaymentInfoChequeDD(final Long bankId, final String branchName, final Date instrumentDate,
final String instrumentNumber, final TYPE instrumentType, final BigDecimal instrumentAmount) {
this.bankId = bankId;
this.branchName = branchName;
this.instrumentDate = instrumentDate;
this.instrumentNumber = instrumentNumber;
this.instrumentType = instrumentType;
this.instrumentAmount = instrumentAmount;
}
public Long getBankId() {
return bankId;
}
public String getBranchName() {
return branchName;
}
@Override
public BigDecimal getInstrumentAmount() {
return instrumentAmount;
}
public Date getInstrumentDate() {
return instrumentDate;
}
public String getInstrumentNumber() {
return instrumentNumber;
}
@Override
public TYPE getInstrumentType() {
return instrumentType;
}
/**
* @param bankId
* the bankId to set
*/
public void setBankId(final Long bankId) {
this.bankId = bankId;
}
/**
* @param branchName
* the branchName to set
*/
public void setBranchName(final String branchName) {
this.branchName = branchName;
}
/**
* @param instrumentDate
* the instrumentDate to set
*/
public void setInstrumentDate(final Date instrumentDate) {
this.instrumentDate = instrumentDate;
}
/**
* @param instrumentNumber
* the instrumentNumber to set
*/
public void setInstrumentNumber(final String instrumentNumber) {
this.instrumentNumber = instrumentNumber;
}
/**
* @param instrumentAmount
* the instrumentAmount to set
*/
@Override
public void setInstrumentAmount(final BigDecimal instrumentAmount) {
this.instrumentAmount = instrumentAmount;
}
/**
* @param instrumentType
* the instrumentType to set
*/
public void setInstrumentType(final TYPE instrumentType) {
this.instrumentType = instrumentType;
}
}
|
[
"venki@egovernments.org"
] |
venki@egovernments.org
|
dc6489eca0d701da1650955502fce48bac324f5d
|
50ca020d5dcc4c6ccb717374d4cc2d84b751dd1d
|
/Shubham/Struts And Hibernate/Day 7-8/a2/WelcomeProject/src/com/uks/shubham/struts/day2/a1/action/UserDataAction.java
|
22bfafadfb96fc0781a2e9dca9384b2ad2f051d1
|
[] |
no_license
|
VARADSP/NeedThisCode
|
16156b7c04040bf823bb8ba128abb326107071d5
|
19e2c8d1b2c4e91f3d5e0314e5be360ec247f8a8
|
refs/heads/master
| 2020-06-23T14:00:20.743123
| 2019-09-05T17:16:17
| 2019-09-05T17:16:17
| 198,641,644
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,215
|
java
|
package com.uks.shubham.struts.day2.a1.action;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import com.uks.shubham.struts.common.extra.DbLogic;
import com.uks.shubham.struts.day2.a1.bean.LoginBean;
import com.uks.shubham.struts.day2.a1.bean.UserDataBean;
import com.uks.shubham.struts.day2.a1.logic.UserLogic;
public class UserDataAction {
/**
* This class is use for user data action
*/
// Initializing the objects
DbLogic objDbLogic = new DbLogic();
Connection con = null;
UserDataBean objuser = new UserDataBean();
LoginBean objbean = new LoginBean();
UserLogic objLogic = new UserLogic();
public UserDataBean fetchUserData(String username) throws SQLException, IOException {
UserDataBean objBean;
// calling fetchUser method by passing usernmae as parameter
objBean = objLogic.fetchUser(username);
return objBean;
}
public List<UserDataBean> fetchAllUserData() throws SQLException {
try {
// Calling method that return the arraylist of objects
List<UserDataBean> list = objLogic.fetchAllUsers();
// returning list
return list;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
|
[
"parlikarvarad@gmail.com"
] |
parlikarvarad@gmail.com
|
a5dec4f8bdaf3837c11ba23e036dfcd263f195c4
|
25a91c33745c6b4476ea6cc67b8c12d1cf10c472
|
/TIJ4/src/za/co/coach/learning/tij/interfaces/Adventure.java
|
d5fcdb1eab7355beecc84174d6bfe866ed0b573b
|
[] |
no_license
|
kumbirai/Learning
|
f3148b90c8d532316397d87b3027d5efff801d5e
|
73573e416acf26c069a5f5240532e940b4a8fafa
|
refs/heads/master
| 2021-01-15T17:07:12.084262
| 2013-01-03T09:31:14
| 2013-01-03T09:31:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 897
|
java
|
package za.co.coach.learning.tij.interfaces;
//: za.co.coach.learning.tij.interfaces/Adventure.java
// Multiple za.co.coach.learning.tij.interfaces.
interface CanFight {
void fight();
}
interface CanSwim {
void swim();
}
interface CanFly {
void fly();
}
class ActionCharacter {
public void fight() {
}
}
class Hero extends ActionCharacter implements CanFight, CanSwim, CanFly {
public void swim() {
}
public void fly() {
}
}
public class Adventure {
public static void t(CanFight x) {
x.fight();
}
public static void u(CanSwim x) {
x.swim();
}
public static void v(CanFly x) {
x.fly();
}
public static void w(ActionCharacter x) {
x.fight();
}
public static void main(String[] args) {
Hero h = new Hero();
t(h); // Treat it as a CanFight
u(h); // Treat it as a CanSwim
v(h); // Treat it as a CanFly
w(h); // Treat it as an ActionCharacter
}
} ///:~
|
[
"kumbirai@gmail.com"
] |
kumbirai@gmail.com
|
ae7b2cefef792b3caaf146bbbf17c598d4e08550
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Lang/40/org/apache/commons/lang/text/StrBuilder_appendln_778.java
|
64237327c1f6899524730943325e0b4468a73fe9
|
[] |
no_license
|
hvdthong/NetML
|
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
|
9bb103da21327912e5a29cbf9be9ff4d058731a5
|
refs/heads/master
| 2021-06-30T15:03:52.618255
| 2020-10-07T01:58:48
| 2020-10-07T01:58:48
| 150,383,588
| 1
| 1
| null | 2018-09-26T07:08:45
| 2018-09-26T07:08:44
| null |
UTF-8
|
Java
| false
| false
| 4,134
|
java
|
org apach common lang text
build string constitu part provid flexibl power api
string buffer stringbuff
main differ string buffer stringbuff string builder stringbuild
subclass direct access charact arrai
addit method
append separ appendwithsepar add arrai valu separ
append pad appendpad add length pad charact
append fix length appendfixedlength add fix width field builder
char arrai tochararrai char getchar simpler wai rang charact arrai
delet delet string
replac search replac string
left string leftstr string rightstr mid string midstr substr except
builder string
size clear empti isempti collect style api method
view
token astoken intern buffer sourc str token strtoken
reader asread intern buffer sourc reader
writer aswrit writer write directli intern buffer
aim provid api mimic close string buffer stringbuff
addit method note edg case
invalid indic input alter individu method
biggest output text
'null' control properti link set null text setnulltext string
prior implement cloneabl implement
clone method onward longer
author stephen colebourn
author robert scholt
version
str builder strbuilder char sequenc charsequ append
append object line string builder
append call link append null appendnul
param obj object append
enabl chain
str builder strbuilder appendln object obj
append obj append line appendnewlin
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
01bc365b9eced306af67283d88dd2dcfe896bfae
|
81c4910a6784b3f0b512d972054d33cca75a7cd6
|
/src/main/java/com/guohuai/mmp/investor/baseaccount/refer/details/InvestoRefErDetailsClientController.java
|
f747fb15160e968e7d5b9675e8297bb788e27311
|
[] |
no_license
|
songpanyong/m-boot
|
0eeef760b87ede204b5d891fd7090315248a0fce
|
21717db7488daf6bd3f341b677e0424c9fe70b7a
|
refs/heads/master
| 2020-03-10T04:46:55.738802
| 2018-04-12T05:51:13
| 2018-04-12T05:51:13
| 129,201,268
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,872
|
java
|
package com.guohuai.mmp.investor.baseaccount.refer.details;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.guohuai.basic.component.ext.web.BaseController;
import com.guohuai.basic.component.ext.web.PageResp;
/**
* 我的推荐列表查询
*
* @author wanglei
*/
@RestController
@RequestMapping(value = "/mimosa/client/investor/baseaccount/referdetail", produces = "application/json")
public class InvestoRefErDetailsClientController extends BaseController {
@Autowired
InvestoRefErDetailsService investoRefErDetailsService;
@RequestMapping(value = "referlist", method = RequestMethod.POST)
@ResponseBody
public ResponseEntity<PageResp<InvestoRefErDetailsRep>> referlist(@RequestParam int page, @RequestParam int rows) {
final String uid = this.getLoginUser();
page = page < 1 ? 1 : page;
rows = rows < 1 ? 1 : rows;
Specification<InvestoRefErDetailsEntity> spec = new Specification<InvestoRefErDetailsEntity>() {
@Override
public Predicate toPredicate(Root<InvestoRefErDetailsEntity> root, CriteriaQuery<?> query,
CriteriaBuilder cb) {
return cb.and(cb
.equal(root.get("investorRefEree").get("investorBaseAccount").get("oid").as(String.class), uid)); // 投资者ID
}
};
Pageable pageable = new PageRequest(page - 1, rows, new Sort(new Order(Direction.DESC, "createTime")));
PageResp<InvestoRefErDetailsRep> pages = this.investoRefErDetailsService.referlist(spec,pageable);
return new ResponseEntity<PageResp<InvestoRefErDetailsRep>>(pages, HttpStatus.OK);
}
/**
* 推荐排名统计,前10名
* @return
*/
@RequestMapping(value = "recomtop10", method = RequestMethod.POST)
@ResponseBody
public ResponseEntity<PageResp<InvestoRefErDetailsRankRep>> recommendRankTOP10() {
PageResp<InvestoRefErDetailsRankRep> pages = this.investoRefErDetailsService.recommendRankTOP10();
return new ResponseEntity<PageResp<InvestoRefErDetailsRankRep>>(pages, HttpStatus.OK);
}
}
|
[
"songpanyong@163.com"
] |
songpanyong@163.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.