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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abe32ca502218cc3192e06a1a1f5b907a3f17d45
|
a22b1eec648f0f416abcfde7090ff38375afb9f0
|
/SimpleDB/src/main/java/simpledb/query/Expression.java
|
a634d22d123bfa1ec39f5198301c2581e8c555ac
|
[] |
no_license
|
Andres6936/SimpleDB
|
2843cd451c0fda1be8414d802b3273c1fe4531d8
|
1eb8c1620cfc6453db2107f9506f192c67fc48fd
|
refs/heads/master
| 2023-05-01T05:40:32.357144
| 2021-05-16T14:13:52
| 2021-05-16T14:13:52
| 367,878,598
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,870
|
java
|
package simpledb.query;
import simpledb.record.*;
/**
* The interface corresponding to SQL expressions.
*
* @author Edward Sciore
*/
public class Expression {
private Constant val = null;
private String fldname = null;
public Expression(Constant val) {
this.val = val;
}
public Expression(String fldname) {
this.fldname = fldname;
}
/**
* Evaluate the expression with respect to the
* current record of the specified scan.
*
* @param s the scan
* @return the value of the expression, as a Constant
*/
public Constant evaluate(Scan s) {
return (val != null) ? val : s.getVal(fldname);
}
/**
* Return true if the expression is a field reference.
*
* @return true if the expression denotes a field
*/
public boolean isFieldName() {
return fldname != null;
}
/**
* Return the constant corresponding to a constant expression,
* or null if the expression does not
* denote a constant.
*
* @return the expression as a constant
*/
public Constant asConstant() {
return val;
}
/**
* Return the field name corresponding to a constant expression,
* or null if the expression does not
* denote a field.
*
* @return the expression as a field name
*/
public String asFieldName() {
return fldname;
}
/**
* Determine if all of the fields mentioned in this expression
* are contained in the specified schema.
*
* @param sch the schema
* @return true if all fields in the expression are in the schema
*/
public boolean appliesTo(Schema sch) {
return (val != null) ? true : sch.hasField(fldname);
}
public String toString() {
return (val != null) ? val.toString() : fldname;
}
}
|
[
"andres6936@live.com"
] |
andres6936@live.com
|
7be882c39072bef41be57b95d57ebec08b86686e
|
a4b111fcca1be07af77a34f4f233c626036afc42
|
/bSSYNews/src/main/java/com/beisheng/synews/view/MyRecorder.java
|
4d97595259bd29648e162c2c8723174e0e3d3136
|
[] |
no_license
|
wodewzl/wzllibrary
|
340bf08a13f0dab26c0653948c53d032ee955b92
|
be7c4d81a5108dd9123e84eeeebecf30e2f8d607
|
refs/heads/master
| 2021-06-30T00:11:32.667131
| 2017-09-19T06:07:59
| 2017-09-19T06:07:59
| 104,013,642
| 6
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,854
|
java
|
package com.beisheng.synews.view;
import android.media.MediaRecorder;
import android.os.Environment;
import java.io.File;
import java.io.IOException;
public class MyRecorder {
private final MediaRecorder recorder= new MediaRecorder();
private final String path;
private static int SAMPLE_RATE_IN_HZ = 8000;
public MyRecorder(String path) {
this.path = sanitizePath(path);
}
private String sanitizePath(String path)
{
if (!path.startsWith("/"))
{
path = "/" + path;
}
if (!path.contains("."))
{
path += ".amr";
}
return Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/myvoice" + path;
}
/**开始录音*/
public void start(){
if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
return;
}
File directory = new File(path).getParentFile();
if(!directory.exists()&& !directory.mkdirs()){
return;
}
try {
//设置声音的来源
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
//设置声音的输出格式
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
//设置声音的编码格式
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
//设置音频采样率
recorder.setAudioSamplingRate(SAMPLE_RATE_IN_HZ);
//设置输出文件
recorder.setOutputFile(path);
//准备录音
recorder.prepare();
//开始录音
recorder.start();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
/**停止录音*/
public void stop(){
try{
//停止录音
recorder.stop();
//释放资源
recorder.release();
}catch(Exception e){
e.printStackTrace();
}
}
public double getAmplitude() {
if (recorder != null){
return (recorder.getMaxAmplitude());
}
else
return 0;
}
}
|
[
"273415345@qq.com"
] |
273415345@qq.com
|
8194b6a4551afbdf6db0d7fcaa3714910575acaa
|
57a8102994f76e55399fb27fa20de6011ec920d8
|
/src/main/java/org/folio/cataloging/bean/cataloguing/bibliographic/codelist/SoundCuttingType.java
|
180f758ab4d62acecdea77a751abd5f6cef03730
|
[
"Apache-2.0"
] |
permissive
|
carmentrazza/mod-cataloging
|
ab5c848264f09b7c9a3fd4d7102140d058977739
|
03467d2bf278d916d012db4fe7f4ff94ee5c7d60
|
refs/heads/master
| 2021-08-23T08:23:58.176080
| 2017-12-04T09:01:58
| 2017-12-04T09:01:58
| 113,018,484
| 0
| 0
| null | 2017-12-04T08:53:06
| 2017-12-04T08:53:05
| null |
UTF-8
|
Java
| false
| false
| 637
|
java
|
/*
* (c) LibriCore
*
* $Author: wimc $
* $Date: 2005/03/10 08:55:28 $
* $Locker: $
* $Name: $
* $Revision: 1.2 $
* $Source: /source/LibriSuite/src/librisuite/bean/cataloguing/bibliographic/codelist/SoundCuttingType.java,v $
* $State: Exp $
*/
package org.folio.cataloging.bean.cataloguing.bibliographic.codelist;
import org.folio.cataloging.dao.persistence.T_SND_DISC_CTG;
/**
* @author Wim Crols
* @version $Revision: 1.2 $, $Date: 2005/03/10 08:55:28 $
* @since 1.0
*/
public class SoundCuttingType extends CodeListBean {
public SoundCuttingType() {
super(T_SND_DISC_CTG.class);
}
}
|
[
"a.gazzarini@gmail.com"
] |
a.gazzarini@gmail.com
|
489cb9f625b74ebb3ddabc0996ce81aa127b4560
|
3ceab28bcfb9df4e0a4a1e7cf81ee719de5b551f
|
/commontemplate/src/main/java/org/commontemplate/util/log/Log4jLoggerProvider.java
|
9598b0e1b0f05ad335a667f338e37c8f5c884aa6
|
[
"Apache-2.0"
] |
permissive
|
draem0507/commontemplate
|
14f063025f35826b20bad51498cd175478edbb48
|
6c3b3c0c10a2aa50fbb237d2c7e6d9b02a09d9e9
|
refs/heads/master
| 2016-09-10T18:48:54.147050
| 2015-08-17T06:43:05
| 2015-08-17T06:43:05
| 40,870,240
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 819
|
java
|
package org.commontemplate.util.log;
import org.apache.log4j.LogManager;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.xml.DOMConfigurator;
public class Log4jLoggerProvider implements LoggerProvider {
public void setReloadableConfig(String config) {
if (config != null && config.length() > 0) {
if (config.endsWith(".xml"))
DOMConfigurator.configureAndWatch(config);
else
PropertyConfigurator.configureAndWatch(config);
}
}
public void setConfig(String config) {
if (config != null && config.length() > 0) {
if (config.endsWith(".xml"))
DOMConfigurator.configure(config);
else
PropertyConfigurator.configure(config);
}
}
public Logger getLogger(String key) {
return new Log4jLogger(LogManager.getLogger(key));
}
}
|
[
"liangfei0201@8dadb90d-c23f-0410-a79a-e763b8a9fd85"
] |
liangfei0201@8dadb90d-c23f-0410-a79a-e763b8a9fd85
|
023de1fd6055131011162d2b25e122f4d94023fa
|
4809012fefec5c13f487cf75af006c1f8275120e
|
/hibernate/src/main/java/app/validation/Employee.java
|
3c00d8b81ca0cf6fd7283f18f05ce439d7eefa53
|
[] |
no_license
|
maiorovi/PlayGround
|
7b09883401a74d6458cc96740a86db7293b393ee
|
5a8bf588bfa2cd6861366104d1ec4e62176759a7
|
refs/heads/master
| 2021-01-23T04:58:56.313891
| 2017-09-09T11:36:10
| 2017-09-09T11:36:10
| 86,262,432
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 236
|
java
|
package app.validation;
import javax.validation.constraints.NotNull;
public class Employee {
@NotNull
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
|
[
"maiorov.prog@gmail.com"
] |
maiorov.prog@gmail.com
|
4042e58a02ea54de3f38fd5830a0db95bc319ec3
|
7202391a3cf6f5be08509ca0b73291d4a540d967
|
/nuxeo-micro/src/test/java/org/nuxeo/micro/helidon/junit/Deploys.java
|
95ef50d37a9b5ad6c82e39f84eb8c26eda559687
|
[] |
no_license
|
bdelbosc/nuxeo-micro-stream-processor
|
3f1ab35774fa0b8ed96e52c4890e3af0890232f7
|
f639ea9279e5f9245c8c5d31cf72bd8885aa22e0
|
refs/heads/main
| 2023-06-10T18:23:49.307316
| 2019-09-14T12:11:55
| 2019-09-14T12:11:55
| 382,028,641
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 638
|
java
|
/*
* (C) Copyright 2019 Nuxeo (http://nuxeo.com/).
* This is unpublished proprietary source code of Nuxeo SA. All rights reserved.
* Notice of copyright on this source code does not indicate publication.
*
* Contributors:
* Nuxeo
*
*/
package org.nuxeo.micro.helidon.junit;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE, ElementType.METHOD })
public @interface Deploys {
Deploy[] value();
}
|
[
"bdelbosc@nuxeo.com"
] |
bdelbosc@nuxeo.com
|
c744b6cf6f5915d4d0c0f09f25f6d778bd644aa6
|
5cfaeebdc7c50ca23ee368fa372d48ed1452dfeb
|
/xd-rd-online/src/main/java/com/xiaodou/rdonline/service/tutormajor/TutorMajorService.java
|
fae1a9a9da5d860f244315087ea6225698a47b08
|
[] |
no_license
|
zdhuangelephant/xd_pro
|
c8c8ff6dfcfb55aead733884909527389e2c8283
|
5611b036968edfff0b0b4f04f0c36968333b2c3b
|
refs/heads/master
| 2022-12-23T16:57:28.306580
| 2019-12-05T06:05:43
| 2019-12-05T06:05:43
| 226,020,526
| 0
| 2
| null | 2022-12-16T02:23:20
| 2019-12-05T05:06:27
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 2,407
|
java
|
package com.xiaodou.rdonline.service.tutormajor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xiaodou.rdonline.domain.tutormajor.TutorMajorModel;
import com.xiaodou.rdonline.service.facade.IRdServiceFacade;
/**
* @author zdh:
* @date 2017年6月8日
*
*/
@Service("tutorMajorService")
public class TutorMajorService {
@Resource
IRdServiceFacade rdServiceFacade;
public List<TutorMajorModel> search(String authorName, Short type) {
return rdServiceFacade.search(authorName, type);
}
public TutorMajorModel getTutorMajorPaperById(Long id) {
TutorMajorModel tutor = rdServiceFacade.getTutorMajorPaperById(id);
return tutor;
}
public List<TutorMajorModel> findTutorMajorList(Short type, Integer pageNo, Integer pageSize) {
Map<String, Object> inputs = new HashMap<>();
inputs.put("type", type);
Map<String, Object> outputs = new HashMap<>();
outputs.put("id", "");
outputs.put("title", "");
outputs.put("type", "");
outputs.put("subtitle", "");
outputs.put("publishTime", "");
outputs.put("image", "");
outputs.put("author", "");
outputs.put("content", "");
outputs.put("thumbNums", "");
outputs.put("readQuantity", "");
outputs.put("majorCategoryId", "");
outputs.put("majorName", "");
outputs.put("contentImage", "");
return rdServiceFacade.listTutorMajor(inputs, outputs, pageNo, pageSize).getResult();
}
public List<TutorMajorModel> findPaperList(Integer pageNo, Integer pageSize) {
Map<String, Object> inputs = new HashMap<>();
inputs.put("type", 3);
Map<String, Object> outputs = new HashMap<>();
outputs.put("id", "");
outputs.put("title", "");
outputs.put("type", "");
outputs.put("publishTime", "");
outputs.put("author", "");
outputs.put("content", "");
outputs.put("thumbNums", "");
outputs.put("readQuantity", "");
outputs.put("contentImage", "");
return rdServiceFacade.listTutorMajor(inputs, outputs, pageNo, pageSize).getResult();
}
public Boolean updateThumbsReadQuality(TutorMajorModel tutorMajorModel) {
return rdServiceFacade.updateTutorMajor(tutorMajorModel);
}
public Boolean updateTutorMajorModel(TutorMajorModel tutorMajorModel) {
return rdServiceFacade.updateTutorMajor(tutorMajorModel);
}
}
|
[
"zedong.huang@bitmain.com"
] |
zedong.huang@bitmain.com
|
4173fb1fd7761d26316811864bcd0bdb529c72b4
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/api-vs-impl-small/domain/src/main/java/org/gradle/testdomain/performancenull_43/Productionnull_4267.java
|
f724a9eb234435a0f19f2c6d426b2d883aae5013
|
[] |
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
| 591
|
java
|
package org.gradle.testdomain.performancenull_43;
public class Productionnull_4267 {
private final String property;
public Productionnull_4267(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
9cda2de621c232d59fb91c9ce2ddd464ac973a53
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/11/11_714d408234fcb9d47efd6d4aa166b07107bbc720/XPathPrefixesEnum/11_714d408234fcb9d47efd6d4aa166b07107bbc720_XPathPrefixesEnum_t.java
|
32621aa142b8a33bbc736108e7a6726859b45cca
|
[] |
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
| 740
|
java
|
package com.operativus.senacrs.audit.properties.xpath;
public enum XPathPrefixesEnum implements XPathKeyPrefix {
DASHBOARD("xpath.dashboard", 0),
ABOUT("xpath.about", 0),
LOGIN("xpath.login", 0),
PORTAL("xpath.portal", 0),
CLASS("xpath.class", 0),
GRADES("xpath.grades", 0),
PLAN("xpath.plan", 0),
YEAR("param.xpath.portal.year.classes", 1),
;
private final String keyPrefix;
private final int paramAmount;
private XPathPrefixesEnum(final String keyPrefix, final int paramAmount) {
this.keyPrefix = keyPrefix;
this.paramAmount = paramAmount;
}
@Override
public String getKeyPrefix() {
return this.keyPrefix;
}
@Override
public int paramAmount() {
return paramAmount;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
57b8596aceb79be753916e61f9824055223ad951
|
e75be673baeeddee986ece49ef6e1c718a8e7a5d
|
/submissions/blizzard/Corpus/eclipse.jdt.ui/9990.java
|
7396c6d53d461b7b084104b2e5769f5d006a74a8
|
[
"MIT"
] |
permissive
|
zhendong2050/fse18
|
edbea132be9122b57e272a20c20fae2bb949e63e
|
f0f016140489961c9e3c2e837577f698c2d4cf44
|
refs/heads/master
| 2020-12-21T11:31:53.800358
| 2018-07-23T10:10:57
| 2018-07-23T10:10:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 207
|
java
|
package import_out;
import java.util.List;
public class TestUseInDeclClash {
List fList;
public void main() {
Provider p = null;
import_use.List list = null;
}
}
|
[
"tim.menzies@gmail.com"
] |
tim.menzies@gmail.com
|
ba7c98343c3c1001ab2137a9813555b7a234face
|
f07946e772638403c47cc3e865fd8a5e976c0ce6
|
/leetcode_java/src/661.image-smoother.java
|
34bc4d11f9a16013acd0d2039e27d135ea85582b
|
[] |
no_license
|
yuan-fei/Coding
|
2faf4f87c72694d56ac082778cfc81c6ff8ec793
|
2c64b53c5ec1926002d6e4236c4a41a676aa9472
|
refs/heads/master
| 2023-07-23T07:32:33.776398
| 2023-07-21T15:34:25
| 2023-07-21T15:34:25
| 113,255,839
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,856
|
java
|
/*
* @lc app=leetcode id=661 lang=java
*
* [661] Image Smoother
*
* https://leetcode.com/problems/image-smoother/description/
*
* algorithms
* Easy (52.07%)
* Likes: 282
* Dislikes: 1182
* Total Accepted: 52.2K
* Total Submissions: 100.3K
* Testcase Example: '[[1,1,1],[1,0,1],[1,1,1]]'
*
* Given a 2D integer matrix M representing the gray scale of an image, you
* need to design a smoother to make the gray scale of each cell becomes the
* average gray scale (rounding down) of all the 8 surrounding cells and
* itself. If a cell has less than 8 surrounding cells, then use as many as
* you can.
*
* Example 1:
*
* Input:
* [[1,1,1],
* [1,0,1],
* [1,1,1]]
* Output:
* [[0, 0, 0],
* [0, 0, 0],
* [0, 0, 0]]
* Explanation:
* For the point (0,0), (0,2), (2,0), (2,2): floor(3/4) = floor(0.75) = 0
* For the point (0,1), (1,0), (1,2), (2,1): floor(5/6) = floor(0.83333333) = 0
* For the point (1,1): floor(8/9) = floor(0.88888889) = 0
*
*
*
* Note:
*
* The value in the given matrix is in the range of [0, 255].
* The length and width of the given matrix are in the range of [1, 150].
*
*
*/
// @lc code=start
class Solution {
public int[][] imageSmoother(int[][] M) {
int n = M.length;
int m = M[0].length;
int[][] ret = new int[n][m];
int[][] dirs = {{0,1},{0,-1},{1,0},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
int sum = M[i][j];
int cnt = 1;
for(int[] dir: dirs){
int x = i + dir[0];
int y = j + dir[1];
if(x >= 0 && x < n && y >= 0 && y < m){
sum += M[x][y];
cnt++;
}
}
ret[i][j] = sum / cnt;
}
}
return ret;
}
}
// @lc code=end
|
[
"yuanfei_1984@hotmail.com"
] |
yuanfei_1984@hotmail.com
|
d2d56183b1ad04f260c1326eb1f08c8fd6dd7f60
|
2a822c9a02883eb9809a1928c7ebcbd124fa8889
|
/src/main/java/com/dyenigma/service/ISysRolePmsnService.java
|
8d52f7ce01aea2be600273edf30398f33adaf437
|
[] |
no_license
|
dingdongliang/transformer
|
8d1bd90af1f7e29eb96d0057b85f676d262b93ce
|
0e502dfad8980f94653f41cbbe3e63af6228d007
|
refs/heads/master
| 2021-01-01T20:08:52.537385
| 2018-01-23T06:33:06
| 2018-01-23T06:33:06
| 98,777,109
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 658
|
java
|
package com.dyenigma.service;
import com.dyenigma.entity.SysPermission;
import com.dyenigma.entity.SysRolePmsn;
import java.util.List;
/**
* Description:
* author dyenigma
* date 2017/07/21
*/
public interface ISysRolePmsnService extends IBaseService<SysRolePmsn> {
/**
* 好代码自己会说话
* param roleId
* return
*/
List<SysPermission> findAllByRoleId(String roleId);
/**
* 保存分配角色权限
* param roleId 角色id
* param checkedIds 菜单权限ID集合
* return
*/
boolean savePermission(String roleId, String checkedIds);
boolean setDefaultRole(String roleId);
}
|
[
"dyenigma@163.com"
] |
dyenigma@163.com
|
f9fb38845760ae46551100d445501c0045977a64
|
05b541541a7ee07d4673cb1c7a75ba069afe16d1
|
/src/main/java/info/vziks/homework10/Task101Command.java
|
499cc31ef4c8b48d0cdfbcee8f8661d6f168a713
|
[
"MIT"
] |
permissive
|
Vziks/javahomework
|
23e191008be0fe72927feeadcbc701ac9364f719
|
87d190716d37074a85f1aafa8e7ee008811ef8c4
|
refs/heads/master
| 2022-09-15T17:44:43.897389
| 2019-12-26T11:07:40
| 2019-12-26T11:07:40
| 174,201,116
| 1
| 0
|
MIT
| 2022-09-08T01:04:35
| 2019-03-06T18:45:25
|
Java
|
UTF-8
|
Java
| false
| false
| 2,219
|
java
|
package info.vziks.homework10;
import info.vziks.exceptions.TaskCommandException;
import info.vziks.homework10.list.DoublyLinkList;
import info.vziks.utils.Command;
import java.util.*;
public class Task101Command implements Command {
@Override
public void execute() throws TaskCommandException {
DoublyLinkList<String> stringDoublyLinkList = new DoublyLinkList<>();
stringDoublyLinkList.add("111");
stringDoublyLinkList.add("222");
stringDoublyLinkList.add("333");
stringDoublyLinkList.add("444");
stringDoublyLinkList.add("555");
System.out.println(stringDoublyLinkList);
stringDoublyLinkList.add(4, "666");
stringDoublyLinkList.add("777");
System.out.println(stringDoublyLinkList);
stringDoublyLinkList.remove("666");
System.out.println(stringDoublyLinkList);
System.out.println();
System.out.println("Iterator");
Iterator<String> stringIterator = stringDoublyLinkList.iterator();
while (stringIterator.hasNext()) {
System.out.println(stringIterator.next());
}
for (String item :
stringDoublyLinkList) {
System.out.println(item);
}
System.out.println();
DoublyLinkList<Integer> integerDoublyLinkList = new DoublyLinkList<>();
integerDoublyLinkList.add(111);
integerDoublyLinkList.add(222);
integerDoublyLinkList.add(333);
integerDoublyLinkList.add(444);
integerDoublyLinkList.add(555);
System.out.println(integerDoublyLinkList);
integerDoublyLinkList.add(4, 666);
integerDoublyLinkList.add(777);
System.out.println(integerDoublyLinkList);
integerDoublyLinkList.remove(666);
System.out.println(integerDoublyLinkList);
System.out.println();
System.out.println("Iterator");
for (Integer item :
integerDoublyLinkList) {
System.out.println(item);
}
Iterator<Integer> integerIterator = integerDoublyLinkList.iterator();
while (integerIterator.hasNext()) {
System.out.println(integerIterator.next());
}
}
}
|
[
"vziks@live.ru"
] |
vziks@live.ru
|
f688fb63b52e8137d542d541393968eab9cd7a60
|
369270a14e669687b5b506b35895ef385dad11ab
|
/java.xml.ws/com/sun/xml/internal/ws/db/glassfish/JAXBRIContextFactory.java
|
d1ed3227f57d71eebe56a60a56cd760769240530
|
[] |
no_license
|
zcc888/Java9Source
|
39254262bd6751203c2002d9fc020da533f78731
|
7776908d8053678b0b987101a50d68995c65b431
|
refs/heads/master
| 2021-09-10T05:49:56.469417
| 2018-03-20T06:26:03
| 2018-03-20T06:26:03
| 125,970,208
| 3
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,406
|
java
|
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.xml.internal.ws.db.glassfish;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.lang.reflect.Type;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import com.sun.xml.internal.bind.api.TypeReference;
import com.sun.xml.internal.bind.api.JAXBRIContext;
import com.sun.xml.internal.bind.api.CompositeStructure;
import com.sun.xml.internal.bind.v2.ContextFactory;
import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader;
import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
import com.sun.xml.internal.ws.developer.JAXBContextFactory;
import com.sun.xml.internal.ws.spi.db.BindingContext;
import com.sun.xml.internal.ws.spi.db.BindingContextFactory;
import com.sun.xml.internal.ws.spi.db.BindingInfo;
import com.sun.xml.internal.ws.spi.db.DatabindingException;
import com.sun.xml.internal.ws.spi.db.TypeInfo;
import com.sun.xml.internal.ws.spi.db.WrapperComposite;
import java.util.Arrays;
/**
* JAXBRIContextFactory
*
* @author shih-chang.chen@oracle.com
*/
public class JAXBRIContextFactory extends BindingContextFactory {
@Override
public BindingContext newContext(JAXBContext context) {
return new JAXBRIContextWrapper((JAXBRIContext) context, null);
}
@Override
public BindingContext newContext(BindingInfo bi) {
Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
for (int i = 0; i < classes.length; i++) {
if (WrapperComposite.class.equals(classes[i])) {
classes[i] = CompositeStructure.class;
}
}
Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
Map<Class, Class> subclassReplacements = bi.subclassReplacements();
String defaultNamespaceRemap = bi.getDefaultNamespace();
Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
try {
JAXBRIContext context = (jaxbContextFactory != null)
? jaxbContextFactory.createJAXBContext(
bi.getSEIModel(),
toList(classes),
toList(typeInfoMappings.values()))
: ContextFactory.createContext(
classes, typeInfoMappings.values(),
subclassReplacements, defaultNamespaceRemap,
(c14nSupport != null) ? c14nSupport : false,
ar, false, false, false);
return new JAXBRIContextWrapper(context, typeInfoMappings);
} catch (Exception e) {
throw new DatabindingException(e);
}
}
private <T> List<T> toList(T[] a) {
List<T> l = new ArrayList<T>();
l.addAll(Arrays.asList(a));
return l;
}
private <T> List<T> toList(Collection<T> col) {
if (col instanceof List) {
return (List<T>) col;
}
List<T> l = new ArrayList<T>();
l.addAll(col);
return l;
}
private Map<TypeInfo, TypeReference> typeInfoMappings(Collection<TypeInfo> typeInfos) {
Map<TypeInfo, TypeReference> map = new java.util.HashMap<TypeInfo, TypeReference>();
for (TypeInfo ti : typeInfos) {
Type type = WrapperComposite.class.equals(ti.type) ? CompositeStructure.class : ti.type;
TypeReference tr = new TypeReference(ti.tagName, type, ti.annotations);
map.put(ti, tr);
}
return map;
}
@Override
protected BindingContext getContext(Marshaller m) {
return newContext(((MarshallerImpl) m).getContext());
}
@Override
protected boolean isFor(String str) {
return (str.equals("glassfish.jaxb")
|| str.equals(this.getClass().getName())
|| str.equals("com.sun.xml.internal.bind.v2.runtime"));
}
}
|
[
"841617433@qq.com"
] |
841617433@qq.com
|
1d40dd2e84e0079615603a3e2696826ad6d40424
|
762724f613eb2b00f78a564d1024aced7744c578
|
/backEnd/src/main/java/fr/almavivahealth/service/mapper/PatientMapper.java
|
0f3da3f71e0066cbe2421ec9523bfe11981320d9
|
[] |
no_license
|
ChristopherLukombo/daily-follow-up
|
dbe6dea471ac248f4af5ef3c222db3e7c782c945
|
033aa7bf16759a483f904782bed9f2eaea4526a2
|
refs/heads/master
| 2023-01-11T16:33:20.908426
| 2020-07-12T21:00:56
| 2020-07-12T21:00:56
| 240,965,906
| 0
| 0
| null | 2023-01-07T16:11:52
| 2020-02-16T21:06:56
|
Java
|
UTF-8
|
Java
| false
| false
| 1,710
|
java
|
package fr.almavivahealth.service.mapper;
import org.mapstruct.DecoratedWith;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import fr.almavivahealth.domain.entity.Patient;
import fr.almavivahealth.service.dto.PatientDTO;
/**
* Mapper for the entity Patient and its DTO called PatientDTO.
*
* @author christopher
* @version 17
*/
@Mapper(componentModel = "spring", uses = OrderMapper.class, unmappedTargetPolicy = ReportingPolicy.IGNORE)
@DecoratedWith(PatientMapperDecorator.class)
public interface PatientMapper {
@Mapping(source = "id", target = "id")
@Mapping(source = "firstName", target = "firstName")
@Mapping(source = "lastName", target = "lastName")
@Mapping(source = "email", target = "email")
@Mapping(source = "situation", target = "situation")
@Mapping(source = "dateOfBirth", target = "dateOfBirth")
@Mapping(source = "address", target = "address")
@Mapping(source = "phoneNumber", target = "phoneNumber")
@Mapping(source = "mobilePhone", target = "mobilePhone")
@Mapping(source = "job", target = "job")
@Mapping(source = "bloodGroup", target = "bloodGroup")
@Mapping(source = "height", target = "height")
@Mapping(source = "weight", target = "weight")
@Mapping(source = "sex", target = "sex")
@Mapping(source = "state", target = "state")
@Mapping(source = "texture", target = "texture")
@Mapping(source = "comment", target = "comment")
@Mapping(source = "room.id", target = "roomId")
@Mapping(source = "orders", target = "orders")
PatientDTO patientToPatientDTO(Patient patient);
@InheritInverseConfiguration
Patient patientDTOToPatient(PatientDTO patientDTO);
}
|
[
"christopher.lukombo@outlook.fr"
] |
christopher.lukombo@outlook.fr
|
781185080d2f851a796d8d01b59894d8602cda91
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/21/21_4c77f95e547ab9685c6f1ae60640c6d7a6b22731/JerseyBroadcasterUtil/21_4c77f95e547ab9685c6f1ae60640c6d7a6b22731_JerseyBroadcasterUtil_s.java
|
e2780742e8e4a25f9945ccf4a80c3480c246548d
|
[] |
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,673
|
java
|
/*
* Copyright 2013 Jeanfrancois Arcand
*
* 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.atmosphere.jersey.util;
import com.sun.jersey.spi.container.ContainerResponse;
import org.atmosphere.cpr.ApplicationConfig;
import org.atmosphere.cpr.AtmosphereRequest;
import org.atmosphere.cpr.AtmosphereResource;
import org.atmosphere.cpr.AtmosphereResourceEvent;
import org.atmosphere.cpr.AtmosphereResourceEventImpl;
import org.atmosphere.cpr.AtmosphereResourceImpl;
import org.atmosphere.cpr.Broadcaster;
import org.atmosphere.cpr.DefaultBroadcaster;
import org.atmosphere.cpr.FrameworkConfig;
import org.atmosphere.jersey.AtmosphereFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
/**
* Simple util class shared among Jersey's Broadcaster.
*
* @author Jeanfrancois Arcand
*/
public final class JerseyBroadcasterUtil {
private static final Logger logger = LoggerFactory.getLogger(JerseyBroadcasterUtil.class);
public final static void broadcast(final AtmosphereResource r, final AtmosphereResourceEvent e, final Broadcaster broadcaster) {
AtmosphereRequest request = r.getRequest();
ContainerResponse cr = null;
// Make sure only one thread can play with the ContainerResponse. Threading issue can arise if there is a scheduler
// or if ContainerResponse is associated with more than Broadcaster.
cr = (ContainerResponse) request.getAttribute(FrameworkConfig.CONTAINER_RESPONSE);
if (cr == null || !r.isSuspended()) {
if (cr == null) {
logger.warn("Unexpected state. ContainerResponse has been resumed. Caching message {} for {}",
e.getMessage(), r.uuid());
} else {
logger.warn("The AtmosphereResource {} hasn't been suspended yet.",
r.uuid(), e);
}
if (DefaultBroadcaster.class.isAssignableFrom(broadcaster.getClass())) {
DefaultBroadcaster.class.cast(broadcaster).cacheLostMessage(r, true);
}
AtmosphereResourceImpl.class.cast(r)._destroy();
return;
}
synchronized (cr) {
try {
// This is required when you change the response's type
String m = null;
if (request.getAttribute(FrameworkConfig.EXPECTED_CONTENT_TYPE) != null) {
m = (String) request.getAttribute(FrameworkConfig.EXPECTED_CONTENT_TYPE);
}
if (m == null || m.equalsIgnoreCase("text/event-stream")) {
if (cr.getHttpHeaders().getFirst(HttpHeaders.CONTENT_TYPE) != null) {
m = cr.getHttpHeaders().getFirst(HttpHeaders.CONTENT_TYPE).toString();
}
if (m == null || m.equalsIgnoreCase("application/octet-stream")) {
m = r.getAtmosphereConfig().getInitParameter(ApplicationConfig.SSE_CONTENT_TYPE);
if (m == null) {
m = "text/plain";
}
}
}
if (e.getMessage() instanceof Response) {
cr.setResponse((Response) e.getMessage());
cr.getHttpHeaders().add(HttpHeaders.CONTENT_TYPE, m);
cr.write();
try {
cr.getOutputStream().flush();
} catch (IOException ex) {
logger.trace("", ex);
}
} else if (e.getMessage() instanceof List) {
for (Object msg : (List<Object>) e.getMessage()) {
cr.setResponse(Response.ok(msg).build());
cr.getHttpHeaders().add(HttpHeaders.CONTENT_TYPE, m);
cr.write();
}
// https://github.com/Atmosphere/atmosphere/issues/169
try {
cr.getOutputStream().flush();
} catch (IOException ex) {
logger.trace("", ex);
}
} else {
if (e.getMessage() == null) {
logger.warn("Broadcasted message is null");
return;
}
cr.setResponse(Response.ok(e.getMessage()).build());
cr.getHttpHeaders().add(HttpHeaders.CONTENT_TYPE, m);
cr.write();
try {
cr.getOutputStream().flush();
} catch (IOException ex) {
logger.trace("", ex);
}
}
} catch (Throwable t) {
boolean notifyAndCache = true;
logger.trace("Unexpected exception for AtmosphereResource {} and Broadcaster {}", r.uuid(), broadcaster.getID());
for (StackTraceElement element : t.getStackTrace()) {
if (element.getClassName().equals("java.io.BufferedWriter")
&& element.getMethodName().equals("flush")) {
logger.trace("Workaround issue https://github.com/Atmosphere/atmosphere/issues/710");
notifyAndCache = false;
}
}
if (DefaultBroadcaster.class.isAssignableFrom(broadcaster.getClass())) {
DefaultBroadcaster.class.cast(broadcaster).onException(t, r, notifyAndCache);
} else {
onException(t, r);
}
} finally {
if (cr != null) {
cr.setEntity(null);
}
Boolean resumeOnBroadcast = (Boolean) request.getAttribute(ApplicationConfig.RESUME_ON_BROADCAST);
if (resumeOnBroadcast != null && resumeOnBroadcast) {
String uuid = (String) request.getAttribute(AtmosphereFilter.RESUME_UUID);
if (uuid != null) {
if (request.getAttribute(AtmosphereFilter.RESUME_CANDIDATES) != null) {
((ConcurrentHashMap<String, AtmosphereResource>) request.getAttribute(AtmosphereFilter.RESUME_CANDIDATES)).remove(uuid);
}
}
r.getRequest().setAttribute(FrameworkConfig.CONTAINER_RESPONSE, null);
r.resume();
}
}
}
}
final static void onException(Throwable t, AtmosphereResource r) {
logger.trace("onException()", t);
r.notifyListeners(new AtmosphereResourceEventImpl((AtmosphereResourceImpl) r, true, false));
AtmosphereResourceImpl.class.cast(r)._destroy();
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
9d6326ee799150a06a12e6ff7ea7194f333cfbfc
|
bf3a2be2c285dc8083d3398f67eff55f59a590fb
|
/symja/src/main/java/org/hipparchus/ode/SecondaryODE.java
|
5da0b1a14dff0e3dc08005ee292f64554bbc3b20
|
[] |
no_license
|
tranleduy2000/symja_java7
|
9efaa4ab3e968de27bb0896ff64e6d71d6e315a1
|
cc257761258e443fe3613ce681be3946166584d6
|
refs/heads/master
| 2021-09-07T01:45:50.664082
| 2018-02-15T09:33:51
| 2018-02-15T09:33:51
| 105,413,861
| 2
| 1
| null | 2017-10-03T08:14:56
| 2017-10-01T02:17:38
|
Java
|
UTF-8
|
Java
| false
| false
| 3,510
|
java
|
/*
* Licensed to the Hipparchus project under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The Hipparchus project 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.hipparchus.ode;
import org.hipparchus.exception.MathIllegalArgumentException;
import org.hipparchus.exception.MathIllegalStateException;
/**
* This interface allows users to add secondary differential equations to a primary
* set of differential equations.
* <p>
* In some cases users may need to integrate some problem-specific equations along
* with a primary set of differential equations. One example is optimal control where
* adjoined parameters linked to the minimized hamiltonian must be integrated.
* </p>
* <p>
* This interface allows users to add such equations to a primary set of {@link
* OrdinaryDifferentialEquation first order differential equations}
* thanks to the {@link
* ExpandableODE#addSecondaryEquations(SecondaryODE)}
* method.
* </p>
*
* @see ExpandableODE
*/
public interface SecondaryODE {
/**
* Get the dimension of the secondary state parameters.
*
* @return dimension of the secondary state parameters
*/
int getDimension();
/**
* Initialize equations at the start of an ODE integration.
* <p>
* This method is called once at the start of the integration. It
* may be used by the equations to initialize some internal data
* if needed.
* </p>
* <p>
* The default implementation does nothing.
* </p>
*
* @param t0 value of the independent <I>time</I> variable at integration start
* @param primary0 array containing the value of the primary state vector at integration start
* @param secondary0 array containing the value of the secondary state vector at integration start
* @param finalTime target time for the integration
*/
default void init(double t0, double[] primary0, double[] secondary0, double finalTime) {
// nothing by default
}
/**
* Compute the derivatives related to the secondary state parameters.
*
* @param t current value of the independent <I>time</I> variable
* @param primary array containing the current value of the primary state vector
* @param primaryDot array containing the derivative of the primary state vector
* @param secondary array containing the current value of the secondary state vector
* @return derivative of the secondary state vector
* @throws MathIllegalStateException if the number of functions evaluations is exceeded
* @throws MathIllegalArgumentException if arrays dimensions do not match equations settings
*/
double[] computeDerivatives(double t, double[] primary, double[] primaryDot, double[] secondary)
throws MathIllegalArgumentException, MathIllegalStateException;
}
|
[
"tranleduy1233@gmail.com"
] |
tranleduy1233@gmail.com
|
ba0b689e9e48f9dce9b477d8eaff94471f8682ad
|
f35c201ca245fa6277a033c3d7b89e9a5f40945c
|
/ex0519/src/bbs/BBSDAO.java
|
4ed0956a50a0c5a698b826739d5f256073e3cc33
|
[] |
no_license
|
odasd/jsp
|
fe4f6c09bc1d7572d08235f560290b8386fb12e9
|
568bfae4786b8be278337e5cedf64b3b5a98e804
|
refs/heads/master
| 2022-11-15T16:03:59.500624
| 2020-07-10T07:14:50
| 2020-07-10T07:14:50
| 278,565,536
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 1,644
|
java
|
package bbs;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import book.Database;
public class BBSDAO {
//전제 데이터의 갯수
public int count(String key, String word) {
int count=0;
try {
String sql="select count(seqno) total from bbs where " + key + " like ? ";
//String sql="select count(*) total from goodsinfo where " + key + " like ? "; --같은거다
PreparedStatement ps=Database.CON.prepareStatement(sql);
ps.setString(1, "%" + word + "%");
ResultSet rs=ps.executeQuery();
if(rs.next()) { //데이터가 하나여서 if로 가져옴
count=rs.getInt("total");
}
} catch(Exception e) {
System.out.println("전체데이터의 갯수" + e.toString());
}
return count;
}
public ArrayList<BBSVO> list(String key, String word, int page) {
ArrayList<BBSVO> list=new ArrayList<BBSVO>();
try {
String sql="select * from bbs where " + key + " like ? order by seqno desc limit ?, 5";
PreparedStatement ps=Database.CON.prepareStatement(sql);
ps.setString(1, "%" + word + "%");
ps.setInt(2, ((page-1)*5));
ResultSet rs=ps.executeQuery();
while(rs.next()) {
BBSVO vo=new BBSVO();
vo.setSeqno(rs.getInt("seqno"));
vo.setTitle(rs.getString("title"));
vo.setContent(rs.getString("content"));
vo.setWriter(rs.getString("writer"));
vo.setWdate(rs.getString("wdate"));
list.add(vo);
}
} catch(Exception e) {
System.out.println("게시판 목록 : " + e.toString());
}
return list;
}
}
|
[
"odasd42@gmail.com"
] |
odasd42@gmail.com
|
94bc004d08c6051a592bb53324a201185ca12dbf
|
5e2f704e893a7546491c3eb97b8d07117380afad
|
/e3-portal-web/src/main/java/com/jisen/e3mall/portal/controller/IndexController.java
|
148dbd233ac477ebe4ea57cb93688c7db1231590
|
[] |
no_license
|
qq289736032/e3
|
786a1b8dd08e9fb9c3cd30fe5da916af6ac8478f
|
02805d3b9aa43d47eed58bae82e65350fa5cf177
|
refs/heads/master
| 2021-08-20T05:50:37.989239
| 2017-11-28T09:52:03
| 2017-11-28T09:52:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 925
|
java
|
package com.jisen.e3mall.portal.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.jisen.e3mall.content.service.ContentService;
import com.jisen.e3mall.pojo.TbContent;
/**
* 首页展示
* @author Administrator
*/
@Controller
public class IndexController {
@Autowired
private ContentService contentService;
@Value("${CONTENT_LUNBO_ID}")
private Long CONTENT_LUNBO_ID;
@RequestMapping("/index")
public String showIndex(Model model){
//查询内容列表
List<TbContent> ad1List = contentService.getContentListByCid(CONTENT_LUNBO_ID);
model.addAttribute("ad1List",ad1List);
return "index";
}
}
|
[
"289736032@qq.com"
] |
289736032@qq.com
|
e47819d0a9e89846f77547cad316f7146cdbbd88
|
7f1c1e9a27327e507a712025f35485fdaa62dad7
|
/IOCProj61-StrategyDP-BeanPostProcessor-POC/src/com/mac/beans/PetrolEngine.java
|
e7a5e770966926805787fa6c16a42cd67163fb91
|
[] |
no_license
|
asmitlade/Spring_Workspace_Final
|
c2e2b985bd69cd819503ff17708832c265503628
|
5a9c0fd088be9c23bc7d331feee77b8e3e9c87e0
|
refs/heads/master
| 2021-07-03T00:32:18.935380
| 2019-05-25T15:24:04
| 2019-05-25T15:24:04
| 183,057,081
| 0
| 0
| null | 2020-10-13T22:49:13
| 2019-04-23T16:43:33
|
Java
|
UTF-8
|
Java
| false
| false
| 347
|
java
|
package com.mac.beans;
public class PetrolEngine implements Engine {
public PetrolEngine() {
System.out.println("PetrolEngine : 0-param constructor");
}
@Override
public void start() {
System.out.println("PetrolEngine : start()");
}
@Override
public void stop() {
System.out.println("PetrolEngine : stop()");
}
}
|
[
"Mac@Mac-PC"
] |
Mac@Mac-PC
|
6dc6c312d7233e1ee7ce7383a1524ca4d42c59c0
|
35049c6fac2d0cbc3973a531d10eff9c54aa617c
|
/homeworks/hw2/src/main/java/task2/LocationCategoryPartitioner.java
|
0a54d58e5ed829a5d529411c3398b021ee11ef68
|
[
"MIT"
] |
permissive
|
fgulan/rovkp-fer
|
7a782206cbaa90355df150b90719ed8c4ff080ce
|
23132b39c74ec6d1aba38695b98cca53d8929291
|
refs/heads/master
| 2021-04-28T18:43:42.943069
| 2018-02-17T18:14:29
| 2018-02-17T18:14:29
| 121,879,105
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 945
|
java
|
package task2;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;
import util.DEBSRecordParser;
/**
* Created by filipgulan on 08/04/2017.
*/
public class LocationCategoryPartitioner extends Partitioner<IntWritable, Text> {
@Override
public int getPartition(IntWritable category, Text value , int i) {
DEBSRecordParser parser = new DEBSRecordParser();
String row = value.toString();
if (row.startsWith("medallion,")) return 0;
parser.parse(row);
Boolean isInCenter = parser.isInCenter();
switch (category.get()) {
case 1:
if (isInCenter) return 0;
else return 1;
case 2:
if (isInCenter) return 2;
else return 3;
default:
if (isInCenter) return 4;
else return 5;
}
}
}
|
[
"filip.gulan@infinum.hr"
] |
filip.gulan@infinum.hr
|
5780f64b8153f221517e52e4ec93660c021dc27a
|
30188024f1ba726ef1d3672628ecee34f3d55a98
|
/src/main/java/reusing/exercise/E20_OverrideAnnotation.java
|
bc246ad9ecaa4fc09e023cde666e6a12d8cbe530
|
[] |
no_license
|
javase/think-in-java
|
97052b787fc70d45732a3b7687bad01428b268a9
|
693fb0328982f1b961257c074b18c77690ba636b
|
refs/heads/master
| 2021-01-22T07:57:32.965499
| 2020-05-07T04:55:42
| 2020-05-07T04:55:42
| 92,586,027
| 0
| 0
| null | 2020-10-12T17:35:00
| 2017-05-27T08:55:34
|
Java
|
UTF-8
|
Java
| false
| false
| 925
|
java
|
package reusing.exercise;
/**
* Created by limenghua on 2017/10/27.
* @author limenghua
*/
import static net.mindview.util.Print.*;
class WithFinals {
// Identical to "private" alone:
private final void f() {
print("WithFinals.f()");
}
// Also automatically "final":
private void g() {
print("WithFinals.g()");
}
}
class OverridingPrivateE20 extends WithFinals {
//@Override
private final void f() {
print("OverridingPrivateE20.f()");
}
//@Override
private void g() {
print("OverridingPrivateE20.g()");
}
}
class OverridingPrivate2E20 extends OverridingPrivateE20 {
//@Override
public final void f() {
print("OverridingPrivate2E20.f()");
}
//@Override
public void g() {
print("OverridingPrivate2E20.g()");
}
}
public class E20_OverrideAnnotation {
public static void main(String[] args) {
OverridingPrivate2E20 op2 = new OverridingPrivate2E20();
op2.f();
op2.g();
}
} ///:~
|
[
"limenghua@wondersgroup.com"
] |
limenghua@wondersgroup.com
|
fe982e8a0aa474c70c5aad2ffebff515c9dd3dfc
|
13aad2320e7a9682c9a98f76d1a3524843398ee5
|
/gs-spring-boot-hutool/src/main/java/com/example/demo/strategy/duck/TestDuck.java
|
610792399bf574ba4d9ecc9e281c56410ea22125
|
[] |
no_license
|
tomlxq/best-practice
|
035bcc8a42006bc1f7678e8f09d17e0b90a7a942
|
26f716a86c7e46f08dbbb42a01ce6b355ec1024c
|
refs/heads/master
| 2023-07-03T19:23:40.477296
| 2023-06-28T22:25:06
| 2023-06-28T22:25:06
| 57,468,405
| 28
| 20
| null | 2022-12-16T07:58:36
| 2016-05-01T01:01:28
|
CSS
|
UTF-8
|
Java
| false
| false
| 429
|
java
|
package com.example.demo.strategy.duck;
/**
* 功能描述
*
* @author TomLuo
* @date 2019/10/11
*/
public class TestDuck {
public static void main(String[] args) {
Duck redHeadDuck=new RedHeadDuck();
Duck greenHeadDuck=new GreenHeadDuck();
redHeadDuck.display();
redHeadDuck.fly();
redHeadDuck.quack();
greenHeadDuck.fly();
greenHeadDuck.display();
}
}
|
[
"21429503@qq.com"
] |
21429503@qq.com
|
de61eda0203a9af0dc53e4c890a44158e91e4bcd
|
4d5683726e7d0095c3d884be22acbc8e840fd6a3
|
/org/omg/DynamicAny/DynArrayHelper.java
|
38c8b03580c981b9c17e4b243970321f1247a0a4
|
[] |
no_license
|
paopaosecret/jdk8src
|
f116f5a87446b6a0f97c09f0f76acea06b8c7f92
|
666738cd55039ab03e02821ecc3474761c8a10f2
|
refs/heads/master
| 2020-07-16T09:05:48.119626
| 2019-09-02T02:18:20
| 2019-09-02T02:18:20
| 205,760,466
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,850
|
java
|
package org.omg.DynamicAny;
/**
* org/omg/DynamicAny/DynArrayHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u172/10810/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl
* Wednesday, March 28, 2018 9:23:35 PM PDT
*/
/**
* DynArray objects support the manipulation of IDL arrays.
* Note that the dimension of the array is contained in the TypeCode which is accessible
* through the type attribute. It can also be obtained by calling the component_count operation.
*/
abstract public class DynArrayHelper
{
private static String _id = "IDL:omg.org/DynamicAny/DynArray:1.0";
public static void insert (org.omg.CORBA.Any a, org.omg.DynamicAny.DynArray 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.DynArray 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.CORBA.ORB.init ().create_interface_tc (org.omg.DynamicAny.DynArrayHelper.id (), "DynArray");
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static org.omg.DynamicAny.DynArray read (org.omg.CORBA.portable.InputStream istream)
{
throw new org.omg.CORBA.MARSHAL ();
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.DynamicAny.DynArray value)
{
throw new org.omg.CORBA.MARSHAL ();
}
public static org.omg.DynamicAny.DynArray narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof org.omg.DynamicAny.DynArray)
return (org.omg.DynamicAny.DynArray)obj;
else if (!obj._is_a (id ()))
throw new org.omg.CORBA.BAD_PARAM ();
else
{
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
org.omg.DynamicAny._DynArrayStub stub = new org.omg.DynamicAny._DynArrayStub ();
stub._set_delegate(delegate);
return stub;
}
}
public static org.omg.DynamicAny.DynArray unchecked_narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof org.omg.DynamicAny.DynArray)
return (org.omg.DynamicAny.DynArray)obj;
else
{
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
org.omg.DynamicAny._DynArrayStub stub = new org.omg.DynamicAny._DynArrayStub ();
stub._set_delegate(delegate);
return stub;
}
}
}
|
[
"zhaobing04@58ganji.com"
] |
zhaobing04@58ganji.com
|
0246ff16fc560febe6a51cc53aa2a1de554e016b
|
b63ce8148e95eb997f5f17dc6e221bbf610df63b
|
/CHNPlayer/app/src/main/java/com/chiang/chnplayer/MainActivity.java
|
08e4fc5845d607ff7461f0eaee1a1d779fdde947
|
[] |
no_license
|
ChiangC/AIDL
|
c5ee51e5de6db12f9f03b10ff6afcc9bd6ed5050
|
8449f9e0fbd901fb003e3cc60d909fb4a4309987
|
refs/heads/master
| 2020-03-30T20:05:46.439915
| 2018-10-04T13:11:57
| 2018-10-04T13:11:57
| 151,572,813
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 833
|
java
|
package com.chiang.chnplayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("native-lib");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Example of a call to a native method
TextView tv = (TextView) findViewById(R.id.sample_text);
tv.setText(stringFromJNI());
}
/**
* A native method that is implemented by the 'native-lib' native library,
* which is packaged with this application.
*/
public native String stringFromJNI();
}
|
[
"jiangchuna@126.com"
] |
jiangchuna@126.com
|
13fe99296bff9a4c1456c9f12a0fdf2ba4fb527c
|
0b9dd2ea9903d6dc4741b6999ac1a09ea1efe06c
|
/worldguard-v6/src/main/java/me/badbones69/crazyenvoy/multisupport/WorldGuard_v6.java
|
bdcf627ed73e1c016dcdbdb8b75f6886a9d04aea
|
[
"MIT"
] |
permissive
|
Liinx/Crazy-Envoy
|
209e6f3a13be0cbb761246e8de9891000460a1d1
|
8233a153a1a0306aefffa2ba76a4e1dd74dd021c
|
refs/heads/master
| 2022-11-24T22:36:59.503677
| 2020-08-02T11:30:14
| 2020-08-02T11:30:14
| 284,446,691
| 0
| 0
|
MIT
| 2020-08-02T11:18:51
| 2020-08-02T11:18:50
| null |
UTF-8
|
Java
| false
| false
| 696
|
java
|
package me.badbones69.crazyenvoy.multisupport;
import com.sk89q.worldguard.bukkit.WGBukkit;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import org.bukkit.Location;
public class WorldGuard_v6 implements WorldGuardVersion {
@Override
public boolean inRegion(String regionName, Location loc) {
ApplicableRegionSet set = WGBukkit.getPlugin().getRegionManager(loc.getWorld()).getApplicableRegions(loc);
for (ProtectedRegion region : set) {
if (regionName.equalsIgnoreCase(region.getId())) {
return true;
}
}
return false;
}
}
|
[
"joewojcik14@gmail.com"
] |
joewojcik14@gmail.com
|
58bc125db5db1a7656cf4a1ffd55aa69dbf2a80a
|
a034a7e08ec23b83f4572b81cb49a1196a189358
|
/impl/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/DigitalInterceptor.java
|
203efa59e2b58ef18bc0500559e0bf543a402a85
|
[] |
no_license
|
scottmarlow/cdi-tck
|
a8ec72eae1d656870cab94bf8f5c37401d3af953
|
7f7e86f71ed4e8875c8bf236bf45e46b031cb30b
|
refs/heads/master
| 2022-07-23T17:10:14.409176
| 2020-02-17T15:16:35
| 2020-02-17T16:03:02
| 243,301,425
| 0
| 0
| null | 2020-02-26T15:49:34
| 2020-02-26T15:49:33
| null |
UTF-8
|
Java
| false
| false
| 1,199
|
java
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
@Interceptor
@Digital
// non-serializable interceptor
public class DigitalInterceptor {
@AroundInvoke
public Object intercept(InvocationContext ctx) throws Exception {
return ctx.proceed();
}
}
|
[
"mkouba@redhat.com"
] |
mkouba@redhat.com
|
0710c39571bc4233f0f6fbcd9059e27f78dc296d
|
ee019cd9b9e9b524f734e790e9a1d65eb342fcbf
|
/KunAddressBook/src/web/servlet/FindUserServlet.java
|
b7c4a4249297ba19d29ee72d81a8d4377de53e3a
|
[] |
no_license
|
jacklizekun/Servlet_Projects
|
c5b9c0db69e6121ecad0b63f513b2ea81fdcfc46
|
7bfb8dc95e3a2f4d4cc4b308e0711635a5097214
|
refs/heads/master
| 2021-04-16T13:04:17.012274
| 2020-05-14T15:22:30
| 2020-05-14T15:22:30
| 249,351,518
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,204
|
java
|
package web.servlet;
import domain.User;
import service.UserService;
import service.impl.UserServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 查找用户WEB层
* @author 李泽坤
*
*/
@WebServlet("/findUserServlet")
public class FindUserServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//获取id
String id = request.getParameter("id");
//调用Service查询
UserService service = new UserServiceImpl();
User user = service.findUserById(id);
//将user存入request
request.setAttribute("user",user);
//转发到update.jsp
request.getRequestDispatcher("/update.jsp").forward(request,response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request, response);
}
}
|
[
"beike88888888@163.com"
] |
beike88888888@163.com
|
42e0fa19c34ec6df7a63e97edef014fac0ec1d64
|
a9d7c0acb024ab7bc935d382c2cea2b99492a014
|
/src/main/java/tutorial/form/MultiselectForm.java
|
27616a6d5cb3d1813ceea6b6dd8eb775efbd3998
|
[
"Apache-2.0"
] |
permissive
|
kawasima/sa-compojure
|
8428c0ab203505a00166ad409c2fbbb2089425c7
|
2bec330709fef4a50c837e17f6d7a7ca8ef3510d
|
refs/heads/master
| 2020-09-17T05:43:11.510317
| 2015-09-26T08:50:43
| 2015-09-26T08:50:43
| 20,471,691
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 602
|
java
|
package tutorial.form;
import java.io.Serializable;
import org.seasar.framework.container.annotation.tiger.Component;
import org.seasar.framework.container.annotation.tiger.InstanceType;
@Component(instance = InstanceType.SESSION)
public class MultiselectForm implements Serializable {
private static final long serialVersionUID = 1L;
public String[] select1;
public String[] select2;
public void initialize() {
select1 = new String[] { "2", "3" };
select2 = new String[0];
}
public void reset() {
select1 = new String[0];
}
public void reset2() {
select2 = new String[0];
}
}
|
[
"kawasima1016@gmail.com"
] |
kawasima1016@gmail.com
|
ce34cb2a5462639feb5677733c237b72daa19a4f
|
e96172bcad99d9fddaa00c25d00a319716c9ca3a
|
/plugin/src/test/resources/codeInsight/daemonCodeAnalyzer/quickFix/methodReturnBooleanFix/before2.java
|
9b6035fef695dd57a41386d6a0e13e9ccf533bb3
|
[
"Apache-2.0"
] |
permissive
|
consulo/consulo-java
|
8c1633d485833651e2a9ecda43e27c3cbfa70a8a
|
a96757bc015eff692571285c0a10a140c8c721f8
|
refs/heads/master
| 2023-09-03T12:33:23.746878
| 2023-08-29T07:26:25
| 2023-08-29T07:26:25
| 13,799,330
| 5
| 4
|
Apache-2.0
| 2023-01-03T08:32:23
| 2013-10-23T09:56:39
|
Java
|
UTF-8
|
Java
| false
| false
| 264
|
java
|
// "Make 'victim' return 'boolean'" "true"
class Test {
public void trigger() {
if (<caret>victim()) {
System.out.println("***");
}
}
public void victim() {
final int something = 1;
int another = 10;
}
}
|
[
"vistall.valeriy@gmail.com"
] |
vistall.valeriy@gmail.com
|
74127aa3b3ef45231bfeb0b782a00d592c662428
|
b6a866110187ec3a2a079656977658368d2db730
|
/src/main/java/com/edu/invest/security/DomainUserDetailsService.java
|
2a0881033c437d37713169fd81475042c77a92cd
|
[] |
no_license
|
aleks232/invest-application
|
f6daa95554d5eda15d1bc528584aaa75936fac61
|
3773e748badb4e3478077aff9b59258fab605d36
|
refs/heads/master
| 2022-11-25T02:54:53.095447
| 2020-04-11T11:07:28
| 2020-04-11T11:07:28
| 254,836,381
| 0
| 0
| null | 2020-07-20T06:28:11
| 2020-04-11T09:43:47
|
Java
|
UTF-8
|
Java
| false
| false
| 2,697
|
java
|
package com.edu.invest.security;
import com.edu.invest.domain.User;
import com.edu.invest.repository.UserRepository;
import java.util.*;
import java.util.stream.Collectors;
import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* Authenticate a user from the database.
*/
@Component("userDetailsService")
public class DomainUserDetailsService implements UserDetailsService {
private final Logger log = LoggerFactory.getLogger(DomainUserDetailsService.class);
private final UserRepository userRepository;
public DomainUserDetailsService(UserRepository userRepository) {
this.userRepository = userRepository;
}
@Override
@Transactional
public UserDetails loadUserByUsername(final String login) {
log.debug("Authenticating {}", login);
if (new EmailValidator().isValid(login, null)) {
return userRepository
.findOneWithAuthoritiesByEmailIgnoreCase(login)
.map(user -> createSpringSecurityUser(login, user))
.orElseThrow(() -> new UsernameNotFoundException("User with email " + login + " was not found in the database"));
}
String lowercaseLogin = login.toLowerCase(Locale.ENGLISH);
return userRepository
.findOneWithAuthoritiesByLogin(lowercaseLogin)
.map(user -> createSpringSecurityUser(lowercaseLogin, user))
.orElseThrow(() -> new UsernameNotFoundException("User " + lowercaseLogin + " was not found in the database"));
}
private org.springframework.security.core.userdetails.User createSpringSecurityUser(String lowercaseLogin, User user) {
if (!user.getActivated()) {
throw new UserNotActivatedException("User " + lowercaseLogin + " was not activated");
}
List<GrantedAuthority> grantedAuthorities = user
.getAuthorities()
.stream()
.map(authority -> new SimpleGrantedAuthority(authority.getName()))
.collect(Collectors.toList());
return new org.springframework.security.core.userdetails.User(user.getLogin(), user.getPassword(), grantedAuthorities);
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
f3ffa64feb06e395aa6c481545a831d350933489
|
809792ede00f148c9a07da194452c637e0eaa03d
|
/limelight_webapp/src/main/java/org/yeastrc/limelight/limelight_webapp/access_control/access_control_rest_controller/ValidateWebSessionAccess_ToWebservice_ForAccessLevelAnd_ProjectIdsIF.java
|
611348dc2c7533af57848c6cc273d9eb21c47828
|
[
"Apache-2.0"
] |
permissive
|
yeastrc/limelight-core
|
80eb23d62c3b967db42b12a3e90cd1b2878ea793
|
bc609c814f67393b787f31c4d813e8fec9ec1b96
|
refs/heads/master
| 2023-08-31T20:37:29.180350
| 2023-08-21T21:21:48
| 2023-08-21T21:21:48
| 159,243,534
| 5
| 3
|
Apache-2.0
| 2023-03-03T01:30:00
| 2018-11-26T22:52:14
|
TypeScript
|
UTF-8
|
Java
| false
| false
| 7,636
|
java
|
/*
* Original author: Daniel Jaschob <djaschob .at. uw.edu>
*
* Copyright 2018 University of Washington - Seattle, WA
*
* 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.yeastrc.limelight.limelight_webapp.access_control.access_control_rest_controller;
import java.sql.SQLException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.yeastrc.limelight.limelight_webapp.access_control.access_control_rest_controller.ValidateWebSessionAccess_ToWebservice_ForAccessLevelAnd_ProjectIds.CheckWhichAuthAccessLevel;
import org.yeastrc.limelight.limelight_webapp.access_control.access_control_rest_controller.ValidateWebSessionAccess_ToWebservice_ForAccessLevelAnd_ProjectIds.ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result;
/**
* @author danj
*
*/
public interface ValidateWebSessionAccess_ToWebservice_ForAccessLevelAnd_ProjectIdsIF {
/**
* Validate authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL_ADMIN
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateAdminAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Validate authAccessLevelIfNotLocked <= AuthAccessLevelConstants.ACCESS_LEVEL_ADMIN
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateAdminIfProjectNotLockedAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Validate authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL_CREATE_NEW_PROJECT_AKA_USER
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateCreateNewProjectAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Validate authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL_PROJECT_OWNER
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateProjectOwnerAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Validate authAccessLevelIfNotLocked <= AuthAccessLevelConstants.ACCESS_LEVEL_PROJECT_OWNER
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateProjectOwnerIfProjectNotLockedAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Validate authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL_ASSISTANT_PROJECT_OWNER_AKA_RESEARCHER
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateAssistantProjectOwnerAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Validate authAccessLevelIfNotLocked <= AuthAccessLevelConstants.ACCESS_LEVEL_ASSISTANT_PROJECT_OWNER_AKA_RESEARCHER
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateAssistantProjectOwnerIfProjectNotLockedAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Validate authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL_LOGGED_IN_USER_READ_ONLY
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateLoggedInUserReadOnlyAllowed( List<Integer> projectIds, HttpServletRequest httpServletRequest ) throws SQLException;
/**
* Validate authAccessLevelIfNotLocked <= AuthAccessLevelConstants.ACCESS_LEVEL_LOGGED_IN_USER_READ_ONLY
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateLoggedInUserReadOnlyIfProjectNotLockedAllowed( List<Integer> projectIds, HttpServletRequest httpServletRequest ) throws SQLException;
/**
* Validate authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL_SEARCH_DELETE
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateSearchDeleteAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Validate authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL_WRITE
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateWriteAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* NO access to user session with public access code for this project.
*
* Read only level that allows user session with user logged on with ACCESS_LEVEL_LOGGED_IN_USER_READ_ONLY.
*
* Validate authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL_LOGGED_IN_USER_READ_ONLY
*
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateUserReadAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* Read only level that allows user session with public access code for this project
* to access this data. User logged on with ACCESS_LEVEL_LOGGED_IN_USER_READ_ONLY
* also has access.
*
* @return true if authAccessLevel <= AuthAccessLevelConstants.ACCESS_LEVEL__PUBLIC_ACCESS_CODE_READ_ONLY__PUBLIC_PROJECT_READ_ONLY
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validatePublicAccessCodeReadAllowed(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* User session with public access code for this project.
*
* Validate authAccessLevel == AuthAccessLevelConstants.ACCESS_LEVEL__PUBLIC_ACCESS_CODE_READ_ONLY__PUBLIC_PROJECT_READ_ONLY
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validatePublicAccessCodeReadAccessLevel(
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
/**
* @param minimumAccessLevelRequired
* @param checkWhichAuthAccessLevel
* @param projectIds
* @param httpServletRequest
* @throws SQLException
*/
ValidateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectIds_Result validateWebSessionAccess_ToWebservice_ForAccessLevelAndProjectSearchIds(
int minimumAccessLevelRequired, CheckWhichAuthAccessLevel checkWhichAuthAccessLevel,
List<Integer> projectIds, HttpServletRequest httpServletRequest) throws SQLException;
}
|
[
"djaschob@uw.edu"
] |
djaschob@uw.edu
|
f32ef1b9ee5a46cd999f3e39dc87d688855d576a
|
d8c293555063481ee749e920618c163f1d8683e0
|
/src/main/java/com/prospero/kamertrade/ApplicationWebXml.java
|
cee4942ee0f9c68cd611e1233c73be6c953ee250
|
[] |
no_license
|
Dr7Dking/kamertrade
|
cf11b03e817af6911504f78abbdf4cf627f2220f
|
2234d2ac672171e523c6f198a036475edad4914c
|
refs/heads/master
| 2022-12-23T01:12:58.635716
| 2019-06-12T23:48:49
| 2019-06-12T23:48:49
| 191,659,457
| 0
| 0
| null | 2022-12-16T04:59:33
| 2019-06-12T23:48:37
|
Java
|
UTF-8
|
Java
| false
| false
| 848
|
java
|
package com.prospero.kamertrade;
import com.prospero.kamertrade.config.DefaultProfileUtil;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* This is a helper Java class that provides an alternative to creating a {@code web.xml}.
* This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc.
*/
public class ApplicationWebXml extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
/**
* set a default to use when no profile is configured.
*/
DefaultProfileUtil.addDefaultProfile(application.application());
return application.sources(KamertradeApp.class);
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
0aa0eec00671dda1070833a92fd4d267744764bd
|
cd544634f3003ba08c6e6f4ca88262d4cc0508f7
|
/pico/container/src/test/org/picocontainer/injectors/TypedFieldInjectionTestCase.java
|
68e2a4ba4a4fbd1b04ef6fc94f717d6c09196a78
|
[
"BSD-3-Clause"
] |
permissive
|
picocontainer/PicoContainer2
|
73fe132b5aedd672299670972f2a30dd8760b375
|
6ba3f410f80b7ad3463ae0084ab6dc349dcdc80d
|
refs/heads/master
| 2023-09-03T15:41:09.445373
| 2019-11-07T16:41:19
| 2019-11-07T16:41:19
| 34,866,283
| 18
| 16
| null | 2023-06-14T20:17:34
| 2015-04-30T17:02:20
|
Java
|
UTF-8
|
Java
| false
| false
| 2,760
|
java
|
/*****************************************************************************
* Copyright (C) PicoContainer Organization. All rights reserved. *
* ------------------------------------------------------------------------- *
* The software in this package is published under the terms of the BSD *
* style license a copy of which has been included with this distribution in *
* the LICENSE.txt file. *
* *
* Original code by *
*****************************************************************************/
package org.picocontainer.injectors;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.junit.Test;
import org.picocontainer.ComponentAdapter;
import org.picocontainer.Parameter;
import org.picocontainer.lifecycle.NullLifecycleStrategy;
import org.picocontainer.lifecycle.ReflectionLifecycleStrategy;
import org.picocontainer.monitors.ConsoleComponentMonitor;
public class TypedFieldInjectionTestCase {
private static final String FIELD_TYPES = Integer.class.getName() + " " + PogoStick.class.getName() + " " + Float.class.getName();
public static class Helicopter {
private PogoStick pogo;
}
public static class PogoStick {
}
@Test public void testFactoryMakesNamedInjector() {
TypedFieldInjection injectionFactory = new TypedFieldInjection();
ConsoleComponentMonitor cm = new ConsoleComponentMonitor();
Properties props = new Properties();
props.setProperty("injectionFieldTypes", FIELD_TYPES);
ComponentAdapter ca = injectionFactory.createComponentAdapter(cm, new NullLifecycleStrategy(),
props, Map.class, HashMap.class, Parameter.DEFAULT);
assertTrue(ca instanceof TypedFieldInjector);
TypedFieldInjector tfi = (TypedFieldInjector) ca;
assertEquals(3, tfi.getInjectionFieldTypes().size());
assertEquals(Integer.class.getName(), tfi.getInjectionFieldTypes().get(0));
assertEquals(PogoStick.class.getName(), tfi.getInjectionFieldTypes().get(1));
assertEquals(Float.class.getName(), tfi.getInjectionFieldTypes().get(2));
}
@Test public void testPropertiesAreRight() {
Properties props = TypedFieldInjection.injectionFieldTypes(FIELD_TYPES);
assertEquals("java.lang.Integer org.picocontainer.injectors.TypedFieldInjectionTestCase$PogoStick java.lang.Float", props.getProperty("injectionFieldTypes"));
assertEquals(1, props.size());
}
}
|
[
"paul@ac66bb80-72f5-0310-8d68-9f556cfffb23"
] |
paul@ac66bb80-72f5-0310-8d68-9f556cfffb23
|
3b3e0e48789e8399810bf79feae2a2a763e30a4a
|
701a16bf18a798e3b2770c30702f80b3abe34c7f
|
/23springboot-multi-datasource/src/main/java/com/sexyuncle/springboot/hikari/config/WebConfig.java
|
eeb625288ea55d8b064b05e9ef6a764f43f4176e
|
[] |
no_license
|
ricoyu/SpringBoot
|
8c24570614f48a328f651624a50279c7cea59d7f
|
43eda8504c7ca2608647ddf723d39cd13c0790c4
|
refs/heads/master
| 2022-12-01T22:01:13.686034
| 2019-12-20T14:06:30
| 2019-12-20T14:06:30
| 229,275,716
| 0
| 0
| null | 2022-11-16T12:27:43
| 2019-12-20T14:04:18
|
Java
|
UTF-8
|
Java
| false
| false
| 2,364
|
java
|
package com.sexyuncle.springboot.hikari.config;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.servlet.ServletRequestListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.loserico.commons.concurrent.ThreadLocalCleanupListener;
import com.loserico.web.advice.GlobalBindingAdivce;
import com.loserico.web.advice.RestExceptionAdvice;
import com.loserico.web.converter.GenericEnumConverter;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired
private ObjectMapper objectMapper;
/**
* 全局异常处理
*
* @return
*/
@Bean
public RestExceptionAdvice restExceptionAdvice() {
return new RestExceptionAdvice();
}
@Bean
public GlobalBindingAdivce globalBindingAdivce() {
return new GlobalBindingAdivce();
}
@Bean
public ServletListenerRegistrationBean<ServletRequestListener> listenerRegistrationBean() {
ServletListenerRegistrationBean<ServletRequestListener> bean = new ServletListenerRegistrationBean<>();
bean.setListener(new ThreadLocalCleanupListener());
return bean;
}
/**
* 支持Enum类型参数绑定,可以按名字,也可以按制定的属性
*/
@Override
public void addFormatters(FormatterRegistry registry) {
Set<String> properties = new HashSet<>();
properties.add("code");
properties.add("desc");
registry.addConverter(new GenericEnumConverter(properties));
WebMvcConfigurer.super.addFormatters(registry);
}
/**
* MVC层使用的ObjectMapper 需要像这样配置,
*/
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.add(new MappingJackson2HttpMessageConverter(objectMapper));
converters.add(new ByteArrayHttpMessageConverter());
}
}
|
[
"ricoyu520@gmail.com"
] |
ricoyu520@gmail.com
|
bdda5275e7d1a1b5506a9df88ec61f0b67b44b12
|
9007acd1ba3a71515fb2479b14b6e66c802e969f
|
/tracker/tags/REL-0.1.0/com.verticon.tracker/src/com/verticon/tracker/WeighIn.java
|
e565f69a79bf4b7b0fe223f706b758bc079fc102
|
[] |
no_license
|
jconlon/tracker
|
17d36709a52bf7ec5c758f30b66ea808fa9be790
|
937b3c30ac9937342ed27b984c2bd31f27bddb55
|
refs/heads/master
| 2020-03-08T05:31:34.895003
| 2018-04-03T19:20:38
| 2018-04-03T19:20:38
| 127,949,899
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,498
|
java
|
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package com.verticon.tracker;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Weigh In</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link com.verticon.tracker.WeighIn#getWeight <em>Weight</em>}</li>
* </ul>
* </p>
*
* @see com.verticon.tracker.TrackerPackage#getWeighIn()
* @model
* @generated
*/
public interface WeighIn extends Event {
/**
* @NOT
*/
public static final int EVENT_CODE = 102;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String copyright = "Copyright 2007 Verticon, Inc. All Rights Reserved.";
/**
* Returns the value of the '<em><b>Weight</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Weight</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Weight</em>' attribute.
* @see #setWeight(int)
* @see com.verticon.tracker.TrackerPackage#getWeighIn_Weight()
* @model required="true"
* @generated
*/
int getWeight();
/**
* Sets the value of the '{@link com.verticon.tracker.WeighIn#getWeight <em>Weight</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Weight</em>' attribute.
* @see #getWeight()
* @generated
*/
void setWeight(int value);
} // WeighIn
|
[
"jconlon@verticon.com"
] |
jconlon@verticon.com
|
b162212492d21bbd677797421cd91e0b46c68f68
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Lang/1/org/apache/commons/lang3/text/StrSubstitutor_replace_383.java
|
71b637999e071f1b8b33f8d5b8c2b0e298441e38
|
[] |
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
| 3,144
|
java
|
org apach common lang3 text
substitut variabl string valu
take piec text substitut variabl
definit variabl code variabl variablenam code
prefix suffix chang constructor set method
variabl valu typic resolv map resolv
system properti suppli custom variabl resolv
simplest replac java system properti
pre
str substitutor strsubstitutor replac system properti replacesystemproperti
run java version java version
pre
typic usag pattern instanc creat
initi map valu variabl
prefix suffix variabl
set perform code replac code
method call pass sourc text interpol return
text variabl refer valu resolv
demonstr
pre
map valu map valuesmap hash map hashmap
valu map valuesmap put quot anim quot quot quick brown fox quot
valu map valuesmap put quot target quot quot lazi dog quot
string templat string templatestr quot anim jump target quot
str substitutor strsubstitutor str substitutor strsubstitutor valu map valuesmap
string resolv string resolvedstr replac templat string templatestr
pre
yield
pre
quick brown fox jump lazi dog
pre
addit usag pattern conveni method
cover common case method
manual creat instanc multipl replac oper
perform creat reus instanc effici
variabl replac work recurs variabl
variabl variabl replac cyclic replac
detect except thrown
interpolation' result variabl prefix
sourc text
pre
variabl
pre
variable' refer text replac result
text assum code code variabl code code
pre
variabl
pre
achiev effect possibl set prefix
suffix variabl conflict result text
produc possibl escap charact
charact variabl refer refer
replac
pre
variabl
pre
complex scenario perform substitut
name variabl instanc
pre
jre java specif version
pre
code str substitutor strsubstitutor code support recurs substitut variabl
name enabl explicitli set
link set enabl substitut variabl setenablesubstitutioninvari enabl substitut variabl enablesubstitutioninvari
properti
version
str substitutor strsubstitutor
replac occurr variabl match valu
resolv sourc buffer templat
buffer alter method
param sourc buffer templat chang return
result replac oper
string replac string buffer stringbuff sourc
sourc
str builder strbuilder buf str builder strbuilder sourc length append sourc
substitut buf buf length
buf string tostr
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
9998e8b9a87a318c94ab283f6759cafe062fb78b
|
c66cf9f61b5fa6e01478639d647323868300ad10
|
/ups-service/src/main/java/com/taisf/services/ups/dto/ResourceRequest.java
|
ad53f37f00fc611ead4359d3dafc1e1276f5685d
|
[] |
no_license
|
dingfangwen/taisf
|
c4a427f3489d550013d72c1f22fc9ed1513122db
|
761ed130eedac07655804ca4b3ef7facc4476ca3
|
refs/heads/master
| 2023-01-05T00:18:32.604709
| 2020-11-09T10:13:38
| 2020-11-09T10:13:38
| 311,294,001
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 655
|
java
|
package com.taisf.services.ups.dto;
import com.jk.framework.base.page.PageRequest;
/**
* <p>
* 后台菜单查询参数
* </p>
*
* <PRE>
* <BR> 修改记录
* <BR>-----------------------------------------------
* <BR> 修改日期 修改人 修改内容
* </PRE>
*
* @author afi
* @since 1.0
* @version 1.0
*/
public class ResourceRequest extends PageRequest {
private static final long serialVersionUID = -3844034830675663909L;
/**
* 父类id查询
*/
private String parent_fid;
public String getParent_fid() {
return parent_fid;
}
public void setParent_fid(String parent_fid) {
this.parent_fid = parent_fid;
}
}
|
[
"dingwf2@ziroom.com"
] |
dingwf2@ziroom.com
|
a1b400d5c50ea1bdf2d766eb57262bcf0fdc3079
|
84125a032c2b2e150f62616c15f0089016aca05d
|
/src/comp/prep2019/less1000/Prob484.java
|
091c0154f2153cf307448d985f2b5093654e7edb
|
[] |
no_license
|
achowdhury80/leetcode
|
c577acc1bc8bce3da0c99e12d6d447c74fbed5c3
|
5ec97794cc5617cd7f35bafb058ada502ee7d802
|
refs/heads/master
| 2023-02-06T01:08:49.888440
| 2023-01-22T03:23:37
| 2023-01-22T03:23:37
| 115,574,715
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,405
|
java
|
package comp.prep2019.less1000;
public class Prob484 {
/**
* O(N) time
* D is responsible for its last number includng the number int it's position
* so if input string ends with D, we don't need special case
* if it ends with I, we have to take care of last number
* whenever D is encountered, try to find number of consecutive Ds.
*
* @param s
* @return
*/
public int[] findPermutation(String s) {
char[] arr = s.toCharArray();
int start = 1;
int[] result = new int[arr.length + 1];
int idx = 0;
for (int i = 0; i < arr.length; i++) {
if (arr[i] == 'D') {
int count = 0;
while(i < arr.length && arr[i] == 'D') {
count++;
i++;
}
start = start + count;
for (int j = 0; j <= count; j++) {
result[idx++] = start - j;
}
start++;
} else {
result[idx++] = start++;
}
}
if (arr[arr.length - 1] == 'I') result[idx] = start;
return result;
}
public static void main(String[] args) {
Prob484 prob = new Prob484();
int[] result = prob.findPermutation("DDIIDI");
//int[] result = prob.findPermutation("D");
for (int num : result) {
System.out.print(num + ", ");
}
}
}
|
[
"aychowdh@microsoft.com"
] |
aychowdh@microsoft.com
|
7c50282f662e846cbfeead71ec62f99cb946e3f9
|
f65df16ef266aa17e3fec6e6b172f7f32ec4ddc6
|
/1.JavaSyntax/src/com/javarush/task/task07/task0728/Solution.java
|
a708677599a905896f88e32ce29c0f7d57ce808f
|
[] |
no_license
|
Andrei-Rom/JavaRushTasks
|
56f5e4ad920f689667453ba9a0fb8f94a5c84bb7
|
e631d5dd824051809d3b142b2711a0651a2a837b
|
refs/heads/master
| 2020-06-11T11:18:31.500589
| 2019-08-10T19:38:33
| 2019-08-10T19:38:33
| 193,941,708
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,239
|
java
|
package com.javarush.task.task07.task0728;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
/*
В убывающем порядке
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[20];
for (int i = 0; i < 20; i++) {
array[i] = Integer.parseInt(reader.readLine());
}
sort(array);
for (int x : array) {
System.out.println(x);
}
}
public static void sort(int[] array) {
//напишите тут ваш код
for(int s=0;s<=array.length-1;s++){
for(int k=0;k<=array.length-2;k++){
if(array[k]<array[k+1]){ //comparing array values
int temp=0;
temp=array[k]; //storing value of array in temp variable
array[k]=array[k+1]; //swaping values
array[k+1]=temp; //now storing temp value in array
} //end if block
} // end inner loop
}
//end outer loop
}
}
|
[
"andrisrom@gmail.com"
] |
andrisrom@gmail.com
|
6f3d0da29d0d4fe04c0db7f0cbb5a9870744e411
|
0bf4bd936622652fe3b88c432f509fa3a9c5a08c
|
/rtp-message-model/src/main/java/iso/std/iso/_20022/tech/xsd/remt_001_001/ExchangeRateType1Code.java
|
e1b63cd3bb074428828df590ca36d180c0a0d844
|
[
"Apache-2.0"
] |
permissive
|
ecspangler/rtp-reference
|
d4c954d181a787025782d51705b3343777530636
|
541b255b41c9f3f18be2cdb407c62233bef29557
|
refs/heads/master
| 2022-11-29T23:28:42.994032
| 2020-01-24T19:37:02
| 2020-01-24T19:37:02
| 162,865,097
| 7
| 9
|
Apache-2.0
| 2022-11-24T08:45:16
| 2018-12-23T05:32:01
|
Java
|
UTF-8
|
Java
| false
| false
| 1,216
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.11.07 at 12:45:54 PM EST
//
package iso.std.iso._20022.tech.xsd.remt_001_001;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ExchangeRateType1Code.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="ExchangeRateType1Code">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="SPOT"/>
* <enumeration value="SALE"/>
* <enumeration value="AGRD"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "ExchangeRateType1Code")
@XmlEnum
public enum ExchangeRateType1Code {
SPOT,
SALE,
AGRD;
public String value() {
return name();
}
public static ExchangeRateType1Code fromValue(String v) {
return valueOf(v);
}
}
|
[
"lizspan@gmail.com"
] |
lizspan@gmail.com
|
9d80e845be78b62d32d62cfa5c5e325d0aa70449
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/training/org/apache/flink/runtime/checkpoint/CheckpointTypeTest.java
|
f32759d3feffe96a61c1ad0d98c550e9c4dbcc50
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 1,557
|
java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.runtime.checkpoint;
import CheckpointType.CHECKPOINT;
import CheckpointType.SAVEPOINT;
import org.junit.Assert;
import org.junit.Test;
public class CheckpointTypeTest {
/**
* This test validates that the order of enumeration constants is not changed, because the
* ordinal of that enum is used in serialization.
*
* <p>It is still possible to edit both the ordinal and this test, but the test adds
* a level of safety, and should make developers stumble over this when attempting
* to adjust the enumeration.
*/
@Test
public void testOrdinalsAreConstant() {
Assert.assertEquals(0, CHECKPOINT.ordinal());
Assert.assertEquals(1, SAVEPOINT.ordinal());
}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
ea0f89c35f06267cadf759f1df45767f913d7fcc
|
072216667ef59e11cf4994220ea1594538db10a0
|
/googleplay/com/google/android/gms/internal/uk.java
|
bfd3609b02ccad5990f557512a2c567720c7872c
|
[] |
no_license
|
jackTang11/REMIUI
|
896037b74e90f64e6f7d8ddfda6f3731a8db6a74
|
48d65600a1b04931a510e1f036e58356af1531c0
|
refs/heads/master
| 2021-01-18T05:43:37.754113
| 2015-07-03T04:01:06
| 2015-07-03T04:01:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,042
|
java
|
package com.google.android.gms.internal;
import com.google.android.gms.common.data.c;
public class uk extends c {
protected Double getAsDouble(String column) {
return bb(column) ? null : Double.valueOf(getDouble(column));
}
protected Integer getAsInteger(String column) {
return bb(column) ? null : Integer.valueOf(getInteger(column));
}
protected Long getAsLong(String column) {
return bb(column) ? null : Long.valueOf(getLong(column));
}
@Deprecated
protected boolean getBoolean(String column) {
return super.getBoolean(column);
}
@Deprecated
protected double getDouble(String column) {
return super.getDouble(column);
}
@Deprecated
protected float getFloat(String column) {
return super.getFloat(column);
}
@Deprecated
protected int getInteger(String column) {
return super.getInteger(column);
}
@Deprecated
protected long getLong(String column) {
return super.getLong(column);
}
}
|
[
"songjd@putao.com"
] |
songjd@putao.com
|
2aea4d04ad2cb88a5f8a455f027877e77f193506
|
4da2bb0c1fb189d8172e0210809063db5e59c079
|
/src/main/java/com/springmvc/entity/DoingSpreadUserReadRecord.java
|
f78fb9f6a7da04da4da0854eb1172968cf8c7160
|
[] |
no_license
|
liuwuxiang/property_app
|
59df70bcb2af4c8611e6c2a633836cbf52d9db58
|
08b35ff88511ba51aaf2638fa30c32cfb18fa421
|
refs/heads/master
| 2022-12-22T06:39:15.579385
| 2019-11-07T07:15:11
| 2019-11-07T07:15:11
| 220,174,067
| 0
| 0
| null | 2022-12-16T07:47:01
| 2019-11-07T07:12:08
|
Java
|
UTF-8
|
Java
| false
| false
| 708
|
java
|
package com.springmvc.entity;
/**
* @author: zhangfan
* @Date: 2018/11/7 00:54
* @Description:推广消息用户已读记录实体类
*/
public class DoingSpreadUserReadRecord {
private Integer id;
private Integer message_id;
private Integer user_id;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getMessage_id() {
return message_id;
}
public void setMessage_id(Integer message_id) {
this.message_id = message_id;
}
public Integer getUser_id() {
return user_id;
}
public void setUser_id(Integer user_id) {
this.user_id = user_id;
}
}
|
[
"494775947@qq.com"
] |
494775947@qq.com
|
a0b3f3ad9a8107ce2a7bb5d77b3eecdc64e3ad02
|
d03709d8f07ba1cc24ea29c632dd49363dea11b3
|
/3.JavaMultithreading/src/com/javarush/task/task21/task2105/Solution.java
|
21aadfc3cef5a16bc76f2afdd281bcd5f48368b0
|
[] |
no_license
|
isokolov/JavaRush
|
2fe44324c98b2b3810c6c2bd2646950356c184a9
|
29d752d045f8894c92a2476b0c4cbdcfefaeb7fb
|
refs/heads/master
| 2020-04-11T18:46:44.656505
| 2019-12-05T21:14:50
| 2019-12-05T21:14:50
| 162,009,457
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,740
|
java
|
package com.javarush.task.task21.task2105;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
/*
Исправить ошибку. Сравнение объектов
*/
public class Solution {
private final String first, last;
public Solution(String first, String last) {
this.first = first;
this.last = last;
}
/*public boolean equals(Object o) {
if (!(o instanceof Solution))
return false;
Solution n = (Solution) o;
return n.first.equals(first) && n.last.equals(last);
}*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Solution)) return false;
Solution solution = (Solution) o;
if (first != null ? !first.equals(solution.first) : solution.first != null) return false;
return last != null ? last.equals(solution.last) : solution.last == null;
}
@Override
public int hashCode() {
int result = first != null ? first.hashCode() : 0;
result = 31 * result + (last != null ? last.hashCode() : 0);
return result;
}
/*@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Solution)) return false;
Solution solution = (Solution) o;
return first.equals(solution.first) &&
last.equals(solution.last);
}
@Override
public int hashCode() {
return Objects.hash(first, last);
}*/
public static void main(String[] args) {
Set<Solution> s = new HashSet<>();
s.add(new Solution("Mickey", "Mouse"));
System.out.println(s.contains(new Solution("Mickey", "Mouse")));
}
}
|
[
"illya.sokolov82@gmail.com"
] |
illya.sokolov82@gmail.com
|
39a656833ed8af847397f2152bff01b314efbc82
|
08760e22a47445c0a3958837074ee68985746a9e
|
/app/src/main/java/br/senac/sp/l13/projetongithub/MainActivity.java
|
ba004e0dd4da27e6b1fcba24e19935a4619d8b51
|
[] |
no_license
|
lndsilva/ProjetoNGitHub
|
905adaa090e392601b75876278ace551e66f716c
|
6f3d12a0df536fa8eb35ba6e9f9008a6b78bcad7
|
refs/heads/master
| 2021-01-25T13:28:53.309863
| 2018-03-02T15:00:42
| 2018-03-02T15:00:42
| 123,577,170
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,043
|
java
|
package br.senac.sp.l13.projetongithub;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
BottomNavigationView bottomNavigationView =
(BottomNavigationView) findViewById(R.id.bottomNav);
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.action_recents:
Toast toast = Toast.makeText(MainActivity.this,
"Clique para recentes", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
break;
case R.id.action_favorite:
Toast toast1 = Toast.makeText(MainActivity.this, "Clique para favoritos", Toast.LENGTH_LONG);
toast1.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL, 0, 0);
toast1.show();
break;
case R.id.action_location:
Toast toast2 = Toast.makeText(MainActivity.this, "Clique para localizar", Toast.LENGTH_LONG);
toast2.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL, 0, 0);
toast2.show();
break;
}
return true;
}
});
}
}
|
[
"lndsilva@hotmail.com"
] |
lndsilva@hotmail.com
|
735747a9b896bf945b490ca062996f8bb5bb9b7e
|
b33e3ad7e9b73074cef6c5b0bed30c160266ea35
|
/문자열/src/문자열/n_17838.java
|
c55cdf0fcace6f92e2f3548f15e170e1339417fb
|
[] |
no_license
|
Jaejeong98/java
|
9bea9e8fa072abf5e36407c44c526876754ff572
|
8b8c31266031b59a0d60727b1c83576bb48827e8
|
refs/heads/master
| 2022-05-26T12:59:56.430185
| 2022-03-16T11:24:50
| 2022-03-16T11:24:50
| 176,660,171
| 1
| 0
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 680
|
java
|
package ¹®ÀÚ¿;
import java.io.*;
public class n_17838 {
public static void main(String[] args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));
int T=Integer.parseInt(br.readLine());
for(int i=0; i<T; i++){
String st=br.readLine();
if(st.length()!=7) bw.write(0+"\n");
else{
String str=st.replace(st.charAt(0),'1').replace(st.charAt(2),'2');
if(str.equals("1122122")) bw.write(1+"\n");
else bw.write(0+"\n");
}
}
bw.flush();bw.close();
}
}
|
[
"jaejeong98@naver.com"
] |
jaejeong98@naver.com
|
6f1307b6292374fe1e0a6a9b835d1f5a9322e845
|
0d20ede27eeec6bdb7c0d0a684b2ed7d68ebdb99
|
/Android/TeamPathy/app/src/main/java/com/ood/waterball/teampathy/Controllers/EntityControllers/MemberSystem/MemberController.java
|
87a496ae57d39042048e601fbbd2f41a7fd02633
|
[
"Apache-2.0"
] |
permissive
|
curry0423/BWS_IronMan_Practice_ChattingRoom
|
52ae1e7c4c9e8ea0d061b806606cc9dbe54d32b5
|
dd51538bfb74cc7f9413d4df4ba3e8fdbaed1d7d
|
refs/heads/master
| 2020-12-30T14:34:20.396646
| 2017-05-11T18:17:59
| 2017-05-11T18:18:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 886
|
java
|
package com.ood.waterball.teampathy.Controllers.EntityControllers.MemberSystem;
import com.ood.waterball.teampathy.Controllers.EntityControllers.MemberSystem.Exceptions.AccountDuplicatedException;
import com.ood.waterball.teampathy.Controllers.EntityControllers.MemberSystem.Exceptions.AccountNotFoundException;
import com.ood.waterball.teampathy.Controllers.EntityControllers.MemberSystem.Exceptions.PasswordNotConformException;
import com.ood.waterball.teampathy.DomainModels.Domains.Member;
public abstract class MemberController {
protected Member activeMember;
public Member getActiveMember(){
return activeMember;
}
public abstract void register(Member member ,String passwordConfirm) throws PasswordNotConformException, AccountDuplicatedException;
public abstract void logIn(String account,String password) throws AccountNotFoundException;
}
|
[
"johnny850807@gmail.com"
] |
johnny850807@gmail.com
|
a68d3387e973600a2310c7fee4ff1a0037db57a9
|
de0d18c1e0bfd47d44cbb3e3a66975e005953589
|
/Jsp/jQuery_Ajax/jsp_workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/04-xml/org/apache/jsp/ajax/comment/comment_005fdelete_jsp.java
|
7b1715ff2ce9c140d8618fb12336e25ab344c466
|
[] |
no_license
|
ohet9409/Git
|
a2ffd29ba1d9fa97f29471477f092e2579436425
|
b92dd387ba0d3c9d719ea501a1f32da942ae6f6c
|
refs/heads/master
| 2022-12-22T01:15:43.603058
| 2019-08-16T13:08:41
| 2019-08-16T13:08:41
| 202,706,298
| 0
| 0
| null | 2022-12-16T00:36:57
| 2019-08-16T10:13:14
|
Java
|
UTF-8
|
Java
| false
| false
| 5,282
|
java
|
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/8.5.40
* Generated at: 2019-08-12 03:49:09 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.ajax.comment;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class comment_005fdelete_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent,
org.apache.jasper.runtime.JspSourceImports {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private static final java.util.Set<java.lang.String> _jspx_imports_packages;
private static final java.util.Set<java.lang.String> _jspx_imports_classes;
static {
_jspx_imports_packages = new java.util.HashSet<>();
_jspx_imports_packages.add("javax.servlet");
_jspx_imports_packages.add("javax.servlet.http");
_jspx_imports_packages.add("javax.servlet.jsp");
_jspx_imports_classes = null;
}
private volatile javax.el.ExpressionFactory _el_expressionfactory;
private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public java.util.Set<java.lang.String> getPackageImports() {
return _jspx_imports_packages;
}
public java.util.Set<java.lang.String> getClassImports() {
return _jspx_imports_classes;
}
public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
if (_el_expressionfactory == null) {
synchronized (this) {
if (_el_expressionfactory == null) {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
}
}
}
return _el_expressionfactory;
}
public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
if (_jsp_instancemanager == null) {
synchronized (this) {
if (_jsp_instancemanager == null) {
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
}
}
return _jsp_instancemanager;
}
public void _jspInit() {
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final java.lang.String _jspx_method = request.getMethod();
if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
return;
}
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/xml; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
String param = request.getParameter("num");
int num = 0;
if (param != null) {
if (!param.equals("")) {
try {
num = Integer.parseInt(param);
} catch (Exception e) {}
}
}
// 데이터베이스 연동을 통한 삭제 결과를 얻어오는 과정에 대한 가정
boolean result = false;
String message = "덧글이 삭제에 실패했습니다.";
if (num == 4) {
result = true;
message = "덧글이 삭제되었습니다.";
}
out.write("<?xml version='1.0' encoding='UTF-8'?>\n");
out.write("<comment>\n");
out.write("\t<result>");
out.print(result);
out.write("</result>\n");
out.write("\t<message>");
out.print(message);
out.write("</message>\n");
out.write("</comment>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
|
[
"dhdmsxor1@naver.com"
] |
dhdmsxor1@naver.com
|
c2512d550a4c4a6ecf8e701aaa3555504644d8bf
|
5074b0ab213819756e5ff8d2d043d951b258ff8b
|
/Feipai/src/main/java/feipai/qiangdan/util/VolleyUtil.java
|
f8d1f87197968d88fd9a2232510429b3b2325acb
|
[] |
no_license
|
285336243/trunk
|
1ea5102cf5f12e8b34704028a6cafc0f4d1de891
|
96c5e68ccef71e6ed3ac9a161595936456cf2360
|
refs/heads/master
| 2021-01-13T00:37:16.942406
| 2016-03-27T09:31:17
| 2016-03-27T09:31:17
| 53,727,287
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,694
|
java
|
package feipai.qiangdan.util;
import android.content.Context;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
/**
* 封装的Volley
*/
public class VolleyUtil {
private Context context;
private RequestQueue mRequestQueue;
private StringRequest mStringRequest;
private VolleyUtil(Context context) {
this.context = context;
}
public static VolleyUtil getInstance(Context context) {
VolleyUtil vu = new VolleyUtil(context);
return vu;
}
/**
* 利用Volley实现Put请求
*
* @param url 地址
* @param hashMap 参数
* @param listener 监听
*/
public void volley_get(String url, final HashMap<String, String> hashMap, final OnCompleteListener listener) {
// ProgressDlgUtil.showProgressDlg(context, "请稍后...");
//加载提示框
// ProgressDlgUtil.showProgressDlg(activity, "正在加载");
Map<String, String> params = StringUtils.sorting(hashMap);
// StringBuilder是用来组拼请求地址和参数
final StringBuilder sb = new StringBuilder();
sb.append(url).append("?");
if (params != null && params.size() != 0) {
for (Map.Entry<String, String> entry : params.entrySet()) {
//如果请求参数中有中文,需要进行URLEncoder编码
try {
sb.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), "utf-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
sb.append("&");
}
sb.deleteCharAt(sb.length() - 1);
}
mRequestQueue = Volley.newRequestQueue(context);
mStringRequest = new StringRequest(IConstant.DOMAIN + sb.toString(),
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
// ProgressDlgUtil.stopProgressDlg();
listener.correct(response);
// Log.d("Response", response);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// ProgressDlgUtil.stopProgressDlg();
listener.error(error);
// Log.d("Error.Response", response);
}
}
) /*{
@Override
protected Map<String, String> getParams() {
*//* Map<String, String> params = new HashMap<String, String> ();
params.put("name", "Alif");
params.put("domain", "http://itsalif.info");
return params;*//*
HashMap<String, String> rehashMap = (HashMap<String, String>) StringUtils.sorting(hashMap);
return rehashMap;
}
}*/;
mRequestQueue.add(mStringRequest);
}
/**
* 利用Volley实现Put请求
*
* @param url 地址
* @param hashMap 参数
* @param listener 监听
*/
public void volley_put(String url, final HashMap<String, String> hashMap, final OnCompleteListener listener) {
ProgressDlgUtil.showProgressDlg(context, "请稍后...");
mRequestQueue = Volley.newRequestQueue(context);
mStringRequest = new StringRequest(Request.Method.PUT, IConstant.DOMAIN + url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
ProgressDlgUtil.stopProgressDlg();
listener.correct(response);
// Log.d("Response", response);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
ProgressDlgUtil.stopProgressDlg();
listener.error(error);
// Log.d("Error.Response", response);
}
}
) {
@Override
protected Map<String, String> getParams() {
/* Map<String, String> params = new HashMap<String, String> ();
params.put("name", "Alif");
params.put("domain", "http://itsalif.info");
return params;*/
HashMap<String, String> rehashMap = (HashMap<String, String>) StringUtils.sorting(hashMap);
return rehashMap;
}
};
mRequestQueue.add(mStringRequest);
}
/**
* 利用Volley实现Post请求
*
* @param url 地址
* @param hashMap 参数
*/
public void volley_post(String url, final HashMap<String, String> hashMap, final OnCompleteListener listener) {
ProgressDlgUtil.showProgressDlg(context, "请稍后...");
mRequestQueue = Volley.newRequestQueue(context);
mStringRequest = new StringRequest(Request.Method.POST, IConstant.DOMAIN + url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
ProgressDlgUtil.stopProgressDlg();
// System.out.println("请求结果:" + response);
listener.correct(response);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
ProgressDlgUtil.stopProgressDlg();
// System.out.println("请求错误:" + error.toString());
listener.error(error);
}
}) {
// 携带参数
@Override
protected HashMap<String, String> getParams()
throws AuthFailureError {
/* HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("un", "852041173");
hashMap.put("pw", "852041173abc");*/
HashMap<String, String> rehashMap = (HashMap<String, String>) StringUtils.sorting(hashMap);
return rehashMap;
}
// Volley请求类提供了一个 getHeaders()的方法,重载这个方法可以自定义HTTP 的头信息。(也可不实现)
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json; charset=UTF-8");
return headers;
}
};
mRequestQueue.add(mStringRequest);
}
public void cancelVolley(){
if (null != mRequestQueue) {
mRequestQueue.cancelAll(this);
}
}
public interface OnCompleteListener {
/**
* @param str 传入字符串
*/
public void correct(String str);
/**
* @param error 错误
*/
public void error(VolleyError error);
}
}
|
[
"285336243@qq.com"
] |
285336243@qq.com
|
9be28104545896d979afe20ee3a81e0ceadfb5e9
|
8b78c4fa5812c98a84db5b1acf364b6a723cbeb4
|
/src/main/java/refinedstorage/apiimpl/solderer/SoldererRegistry.java
|
b7518343aa79aee8bba5a1ca7f4e92db63290b97
|
[
"MIT"
] |
permissive
|
BobChao87/refinedstorage
|
690551e118598ed033f4a1500979acb0dae91b49
|
1739409a05bf9da214451c1720c195dab3d24404
|
refs/heads/mc1.10
| 2021-05-03T11:22:06.635441
| 2016-10-03T18:30:12
| 2016-10-03T18:30:12
| 68,980,995
| 0
| 0
| null | 2016-09-23T02:28:32
| 2016-09-23T02:28:31
| null |
UTF-8
|
Java
| false
| false
| 1,584
|
java
|
package refinedstorage.apiimpl.solderer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import refinedstorage.api.solderer.ISoldererRecipe;
import refinedstorage.api.solderer.ISoldererRegistry;
import refinedstorage.api.storage.CompareUtils;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class SoldererRegistry implements ISoldererRegistry {
private List<ISoldererRecipe> recipes = new ArrayList<>();
@Override
public void addRecipe(@Nonnull ISoldererRecipe recipe) {
recipes.add(recipe);
}
@Override
@Nullable
public ISoldererRecipe getRecipe(@Nonnull IItemHandler rows) {
for (ISoldererRecipe recipe : recipes) {
boolean found = true;
for (int i = 0; i < 3; ++i) {
if (!CompareUtils.compareStackNoQuantity(recipe.getRow(i), rows.getStackInSlot(i)) && !CompareUtils.compareStackOreDict(recipe.getRow(i), rows.getStackInSlot(i))) {
found = false;
}
ItemStack row = recipe.getRow(i);
if (rows.getStackInSlot(i) != null && row != null) {
if (rows.getStackInSlot(i).stackSize < row.stackSize) {
found = false;
}
}
}
if (found) {
return recipe;
}
}
return null;
}
@Override
public List<ISoldererRecipe> getRecipes() {
return recipes;
}
}
|
[
"raoulvdberge@gmail.com"
] |
raoulvdberge@gmail.com
|
586d7f65990c90445d63f24d7fb4a9864efed885
|
01426853dfa0316e22524e8880e51018a7a2bafa
|
/gen-web/trunk/org.imogene.web.template/src/main/java/org/imogene/web/client/ui/field/relation/multi/ImogMultiRelationBoxPopUpAsList.java
|
3f31a799dc0d607e76ce30be69cfe4bb1312ca27
|
[] |
no_license
|
breka/tutorial
|
4e612ee69254ab2ab7ab7fa89e92791aa798c124
|
20022171d716266df1b7f67b9b53293fc3a8b417
|
refs/heads/master
| 2021-01-10T20:07:31.311135
| 2013-10-22T15:22:02
| 2013-10-22T15:22:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,160
|
java
|
package org.imogene.web.client.ui.field.relation.multi;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.imogene.web.client.i18n.BaseNLS;
import org.imogene.web.client.ui.table.ImogBeanDataProvider;
import org.imogene.web.client.ui.table.pager.ImogSimplePager;
import org.imogene.web.client.util.ImogBeanRenderer;
import org.imogene.web.shared.proxy.ImogBeanProxy;
import com.google.gwt.cell.client.TextCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.Editor.Ignore;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.MouseWheelEvent;
import com.google.gwt.event.dom.client.MouseWheelHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.cellview.client.DataGrid;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.view.client.AsyncDataProvider;
import com.google.gwt.view.client.HasData;
import com.google.gwt.view.client.MultiSelectionModel;
import com.google.gwt.view.client.Range;
import com.google.web.bindery.requestfactory.shared.Receiver;
import com.google.web.bindery.requestfactory.shared.Request;
public class ImogMultiRelationBoxPopUpAsList<T extends ImogBeanProxy> {
@SuppressWarnings("rawtypes")
interface Binder extends UiBinder<PopupPanel, ImogMultiRelationBoxPopUpAsList> {
Binder BINDER = GWT.create(Binder.class);
}
interface ImogMultiSelectionBoxGridStyle extends DataGrid.Style {
String IMOG_CSS = "ImogMultiSelectionBoxGrid.css";
}
interface TableResources extends DataGrid.Resources {
@Override
@Source(value = { ImogMultiSelectionBoxGridStyle.IMOG_CSS })
ImogMultiSelectionBoxGridStyle dataGridStyle();
}
private List<HandlerRegistration> registrations = new ArrayList<HandlerRegistration>();
private static final int itemByPage=10;
private final MultiSelectionModel<T> selectionModel = new MultiSelectionModel<T>();
private ImogMultiRelationBox<T> parentBox;
private ImogBeanDataProvider<T> beanDataProvider;
private ImogBeanRenderer beanRenderer;
/* widgets */
@UiField(provided = true)
@Ignore
PopupPanel popup;
@UiField(provided = true)
@Ignore
Label title;
@UiField(provided = true)
@Ignore
DataGrid<T> table;
@UiField (provided = true)
@Ignore
ImogSimplePager pager;
@UiField
@Ignore
TextBox valueFilter;
@UiField
@Ignore
PushButton filterButton;
@UiField
@Ignore
PushButton okButton;
@UiField
@Ignore
PushButton cancelButton;
public ImogMultiRelationBoxPopUpAsList(ImogMultiRelationBox<T> parentBoxValue, ImogBeanDataProvider<T> provider, ImogBeanRenderer beanRenderer, String color) {
this.parentBox = parentBoxValue;
this.beanDataProvider = provider;
this.beanRenderer = beanRenderer;
if(beanDataProvider!=null && beanDataProvider.getSearchCriterions()!=null)
beanDataProvider.setSearchCriterions(null);
popup = new PopupPanel(true);
//popup.addStyleDependentName(color);
title = new Label();
title.addStyleDependentName(color);
table = new DataGrid<T>(itemByPage, GWT.<TableResources> create(TableResources.class)) {
@Override
protected void onUnload() {
for(HandlerRegistration r : registrations)
r.removeHandler();
registrations.clear();
super.onUnload();
}
};
pager = new ImogSimplePager();
Binder.BINDER.createAndBindUi(this);
Column<T, String> listColumn = new ListColumn();
table.addColumn(listColumn);
table.setSelectionModel(selectionModel);
// selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
// @Override
// public void onSelectionChange(SelectionChangeEvent event) {
// T value = selectionModel.getSelectedObject();
// if (value == null) {
// return;
// }
// parentBox.setValue(value);
// hide();
// selectionModel.setSelected(value, false);
// }
// });
//table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
//pager.setRangeLimited(false);
addMouseWheelHandler();
filterButton.setText(BaseNLS.constants().button_search());
okButton.setText(BaseNLS.constants().button_ok());
cancelButton.setText(BaseNLS.constants().button_cancel());
// fetchTotalRowCount();
// fetch(0);
ImogAsyncDataProvider dataProvider = new ImogAsyncDataProvider();
dataProvider.addDataDisplay(table);
}
@UiHandler("filterButton")
void onFilter(ClickEvent e) {
beanDataProvider.fullTextSearch(valueFilter.getText());
//pager.firstPage();
table.setVisibleRangeAndClearData(new Range(0,itemByPage), true);
}
@UiHandler("okButton")
void onOk(ClickEvent e) {
Set<T> values = selectionModel.getSelectedSet();
if (values != null) {
for(T value:values) {
if(!parentBox.isPresent(value))
parentBox.addValue(value);
}
}
hide();
}
@UiHandler("cancelButton")
void onCancel(ClickEvent e) {
hide();
}
public void show() {
popup.show();
}
public void hide() {
popup.hide();
}
public void setTitle(String text) {
title.setText(text);
}
private void addMouseWheelHandler() {
MouseWheelHandler mouseWheel = new MouseWheelHandler() {
@Override
public void onMouseWheel(MouseWheelEvent e) {
if(e.isNorth()) {
if(pager.hasPreviousPage())
pager.previousPage();
}
else {
if(pager.hasNextPage())
pager.nextPage();
}
}
};
registrations.add(table.addDomHandler(mouseWheel, MouseWheelEvent.getType()));
}
protected boolean isPresent(T toTest){
return parentBox.isPresent(toTest);
}
/**
*
* @author MEDES-IMPS
*
*/
private class ListColumn extends Column<T, String> {
public ListColumn() {
super(new TextCell());
}
@Override
public String getValue(T object) {
return beanRenderer.getDisplayValue(object);
}
}
/**
* @author MEDES-IMPS
*/
private class ImogAsyncDataProvider extends AsyncDataProvider<T> {
@Override
protected void onRangeChanged(final HasData<T> display) {
/** count total nb of rows and display the table **/
Request<Long> countRowsRequest = beanDataProvider.getTotalRowCount();
countRowsRequest.fire(new Receiver<Long>() {
@Override
public void onSuccess(Long count) {
if (count != null) {
updateRowCount(count.intValue(), true);
pager.setTotalNbOfRows(count.intValue());
updateTable(display);
}
}
});
}
/**
*
* @param display
*/
private void updateTable(final HasData<T> display) {
final Range range = display.getVisibleRange();
final int start = range.getStart();
Request<List<T>> request = beanDataProvider.getList(start, itemByPage);
request.fire(new Receiver<List<T>>() {
@Override
public void onSuccess(List<T> response) {
updateRowData(start, response);
}
});
}
}
}
|
[
"julien.dupouy.fr@gmail.com@ebdd1a65-156c-932d-9aad-d2100c70bdcf"
] |
julien.dupouy.fr@gmail.com@ebdd1a65-156c-932d-9aad-d2100c70bdcf
|
39aeb1d4c1d09db6e2b9535958d4e65b7376f449
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/orientechnologies--orientdb/7177f9ee131b9ba26b5a3b5a853ba2b0ee239010/after/OrientJdbcResultSetTest.java
|
ebd2810643f07ca4c3d0671180273bbf0f01a426
|
[] |
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,839
|
java
|
package com.orientechnologies.orient.jdbc;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.OCommandSQL;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
import org.junit.Test;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;
import static org.assertj.core.api.Assertions.*;
public class OrientJdbcResultSetTest extends OrientJdbcBaseTest {
@Test
public void shouldNavigateResultSet() throws Exception {
assertThat(conn.isClosed()).isFalse();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM Item");
assertThat(rs.getFetchSize()).isEqualTo(20);
assertThat(rs.isBeforeFirst()).isTrue();
assertThat(rs.next()).isTrue();
assertThat(rs.getRow()).isEqualTo(0);
rs.last();
assertThat(rs.getRow()).isEqualTo(19);
assertThat(rs.next()).isFalse();
rs.afterLast();
assertThat(rs.next()).isFalse();
rs.close();
assertThat(rs.isClosed()).isTrue();
stmt.close();
assertThat(stmt.isClosed()).isTrue();
}
@Test
public void shouldReturnEmptyResultSet() throws Exception {
ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM Author where false = true");
assertThat(rs.next()).isFalse();
}
@Test
public void shouldReturnResultSetAfterExecute() throws Exception {
assertThat(conn.isClosed()).isFalse();
Statement stmt = conn.createStatement();
assertThat(stmt.execute("SELECT stringKey, intKey, text, length, date FROM Item")).isTrue();
ResultSet rs = stmt.getResultSet();
assertThat(rs).isNotNull();
assertThat(rs.getFetchSize()).isEqualTo(20);
}
@Test
public void shouldReturnReultSetWithSparkStyle() throws Exception {
//set spark "profile"
conn.getInfo().setProperty("spark", "true");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select \"stringKey\",\"published\" from item");
assertThat(rs.next()).isTrue();
}
@Test
public void shouldReadRowWithNullValue() throws Exception {
db.activateOnCurrentThread();
db.command(new OCommandSQL("INSERT INTO Article(uuid, date, title, content) VALUES (123456, null, 'title', 'the content')"))
.execute();
List<ODocument> docs = db.query(new OSQLSynchQuery<>("SELECT uuid,date, title, content FROM Article WHERE uuid = 123456"));
// docs.stream().forEach(d -> System.out.println(d.toJSON()));
Statement stmt = conn.createStatement();
assertThat(stmt.execute("SELECT uuid,date, title, content FROM Article WHERE uuid = 123456")).isTrue();
ResultSet rs = stmt.getResultSet();
assertThat(rs).isNotNull();
assertThat(rs.getFetchSize()).isEqualTo(1);
rs.getLong("uuid");
rs.getDate(2);
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
fd2d12002b54eba3976f2bae1194a696c724ecb6
|
e1520517adcdd4ee45fb7b19e7002fdd5a46a02a
|
/polardbx-optimizer/src/main/java/com/alibaba/polardbx/optimizer/core/planner/rule/PushSemiJoinRule.java
|
d652d566dc44b1703e044548ef2a2432b09d8d2b
|
[
"Apache-2.0"
] |
permissive
|
huashen/galaxysql
|
7702969269d7f126d36f269e3331ed1c8da4dc20
|
b6c88d516367af105d85c6db60126431a7e4df4c
|
refs/heads/main
| 2023-09-04T11:40:36.590004
| 2021-10-25T15:43:14
| 2021-10-25T15:43:14
| 421,088,419
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,702
|
java
|
/*
* Copyright [2013-2021], Alibaba Group Holding Limited
*
* 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.polardbx.optimizer.core.planner.rule;
import com.alibaba.polardbx.common.properties.ConnectionParams;
import com.alibaba.polardbx.optimizer.utils.RelUtils;
import com.alibaba.polardbx.optimizer.PlannerContext;
import com.alibaba.polardbx.optimizer.core.rel.LogicalView;
import org.apache.calcite.plan.RelOptPredicateList;
import org.apache.calcite.plan.RelOptRuleCall;
import org.apache.calcite.plan.RelOptRuleOperand;
import org.apache.calcite.rel.logical.LogicalSemiJoin;
import org.apache.calcite.rex.RexNode;
import java.util.List;
/**
* @author lingce.ldm
*/
public class PushSemiJoinRule extends PushJoinRule {
public PushSemiJoinRule(RelOptRuleOperand operand, String description) {
super(operand, "PushSemiJoinRule:" + description);
}
public static final PushSemiJoinRule INSTANCE = new PushSemiJoinRule(
operand(LogicalSemiJoin.class, some(operand(LogicalView.class, none()), operand(LogicalView.class, none()))),
"INSTANCE");
@Override
public boolean matches(RelOptRuleCall call) {
return PlannerContext.getPlannerContext(call).getParamManager().getBoolean(ConnectionParams.ENABLE_PUSH_JOIN);
}
@Override
public void onMatch(RelOptRuleCall call) {
final LogicalSemiJoin join = (LogicalSemiJoin) call.rels[0];
final LogicalView leftView = (LogicalView) call.rels[1];
final LogicalView rightView = (LogicalView) call.rels[2];
RexNode joinCondition = join.getCondition();
if (join.getOperator() == null || joinCondition.isAlwaysTrue() || joinCondition.isAlwaysFalse()) {
return;
}
tryPushJoin(call, join, leftView, rightView, joinCondition);
}
@Override
protected void perform(RelOptRuleCall call, List<RexNode> leftFilters,
List<RexNode> rightFilters, RelOptPredicateList relOptPredicateList) {
final LogicalSemiJoin logicalSemiJoin = (LogicalSemiJoin) call.rels[0];
final LogicalView leftView = (LogicalView) call.rels[1];
final LogicalView rightView = (LogicalView) call.rels[2];
LogicalSemiJoin newLogicalSemiJoin = logicalSemiJoin.copy(
logicalSemiJoin.getTraitSet(),
logicalSemiJoin.getCondition(),
logicalSemiJoin.getLeft(),
logicalSemiJoin.getRight(),
logicalSemiJoin.getJoinType(),
logicalSemiJoin.isSemiJoinDone());
LogicalView newLeftView = leftView.copy(leftView.getTraitSet());
LogicalView newRightView = rightView.copy(rightView.getTraitSet());
newLeftView.pushSemiJoin(
newLogicalSemiJoin,
newRightView,
leftFilters,
rightFilters,
newLogicalSemiJoin.getPushDownRelNode(newRightView.getPushedRelNode(),
call.builder(),
call.builder().getRexBuilder(),
leftFilters,
rightFilters));
RelUtils.changeRowType(newLeftView, logicalSemiJoin.getRowType());
call.transformTo(newLeftView);
}
}
|
[
"chenmo.cm@alibaba-inc.com"
] |
chenmo.cm@alibaba-inc.com
|
93a547be1552aec84afe6e32553820274b517113
|
c3b7c7f5d92396462b24698c07e6b43f57f26f3a
|
/src/main/java/wiki/conoha/javahomework/classhomework/Person.java
|
cb99a6d8802b2595c537fb26bc80b87cca19fa24
|
[] |
no_license
|
usami-muzugi/javahomework
|
d0abca56bfd664c042c30b07dc8ba6bf4526b759
|
e0010bbfd0885d24db6ac87c671c7429be4b2a26
|
refs/heads/master
| 2021-09-17T14:07:45.305360
| 2018-07-02T14:28:36
| 2018-07-02T14:28:41
| 106,161,494
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 300
|
java
|
package wiki.conoha.javahomework.classhomework;
public abstract class Person {
private String name;
public Person(){
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public abstract void read();
}
|
[
"715759898@qq.com"
] |
715759898@qq.com
|
3b6e10680174edc393dbfaead4481eb9653bd56c
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/23/23_e62f31b70823bece4ed9b92993f09c1150b0e12e/TileEntityGrinder/23_e62f31b70823bece4ed9b92993f09c1150b0e12e_TileEntityGrinder_t.java
|
2443fa974142dddf2f5ee0e72d9b5b1928154244
|
[] |
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,755
|
java
|
package powercrystals.minefactoryreloaded.tile.machine;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandom;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidDictionary;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.liquids.LiquidTank;
import powercrystals.minefactoryreloaded.MFRRegistry;
import powercrystals.minefactoryreloaded.api.IFactoryGrindable2;
import powercrystals.minefactoryreloaded.api.MobDrop;
import powercrystals.minefactoryreloaded.core.GrindingDamage;
import powercrystals.minefactoryreloaded.core.HarvestAreaManager;
import powercrystals.minefactoryreloaded.core.ITankContainerBucketable;
import powercrystals.minefactoryreloaded.gui.client.GuiFactoryInventory;
import powercrystals.minefactoryreloaded.gui.client.GuiFactoryPowered;
import powercrystals.minefactoryreloaded.gui.container.ContainerFactoryPowered;
import powercrystals.minefactoryreloaded.setup.Machine;
import powercrystals.minefactoryreloaded.tile.base.TileEntityFactoryPowered;
import powercrystals.minefactoryreloaded.world.GrindingWorld;
import powercrystals.minefactoryreloaded.world.GrindingWorldServer;
import powercrystals.minefactoryreloaded.world.IGrindingWorld;
public class TileEntityGrinder extends TileEntityFactoryPowered implements ITankContainerBucketable
{
protected HarvestAreaManager _areaManager;
protected LiquidTank _tank;
protected Random _rand;
protected IGrindingWorld _grindingWorld;
protected GrindingDamage _damageSource;
private static Field recentlyHit;
static
{
ArrayList<String> q = new ArrayList<String>();
q.add("recentlyHit");
q.addAll(Arrays.asList(ObfuscationReflectionHelper.remapFieldNames("net.minecraft.entity.EntityLiving", new String[] { "field_70718_bc" })));
recentlyHit = ReflectionHelper.findField(EntityLiving.class, q.toArray(new String[q.size()]));
}
@Override
public String getGuiBackground()
{
return "grinder.png";
}
@Override
@SideOnly(Side.CLIENT)
public GuiFactoryInventory getGui(InventoryPlayer inventoryPlayer)
{
return new GuiFactoryPowered(getContainer(inventoryPlayer), this);
}
@Override
public ContainerFactoryPowered getContainer(InventoryPlayer inventoryPlayer)
{
return new ContainerFactoryPowered(this, inventoryPlayer);
}
protected TileEntityGrinder(Machine machine)
{
super(machine);
_areaManager = new HarvestAreaManager(this, 2, 2, 1);
_tank = new LiquidTank(4 * LiquidContainerRegistry.BUCKET_VOLUME);
_rand = new Random();
}
public TileEntityGrinder()
{
this(Machine.Grinder);
_damageSource = new GrindingDamage();
}
@Override
public void setWorldObj(World world)
{
super.setWorldObj(world);
if(_grindingWorld != null) _grindingWorld.clearReferences();
if(this.worldObj instanceof WorldServer)
_grindingWorld = new GrindingWorldServer((WorldServer)this.worldObj, this);
else
_grindingWorld = new GrindingWorld(this.worldObj, this);
}
public Random getRandom()
{
return _rand;
}
@Override
protected boolean shouldPumpLiquid()
{
return true;
}
@Override
public int getEnergyStoredMax()
{
return 32000;
}
@Override
public int getWorkMax()
{
return 1;
}
@Override
public int getIdleTicksMax()
{
return 200;
}
@Override
public ILiquidTank getTank()
{
return _tank;
}
@Override
public boolean activateMachine()
{
_grindingWorld.cleanReferences();
List<?> entities = worldObj.getEntitiesWithinAABB(EntityLiving.class, _areaManager.getHarvestArea().toAxisAlignedBB());
entityList: for(Object o : entities)
{
EntityLiving e = (EntityLiving)o;
if(e instanceof EntityAgeable && ((EntityAgeable)e).getGrowingAge() < 0 || e.isEntityInvulnerable() || e.getHealth() <= 0)
{
continue;
}
boolean processMob = false;
processEntity:
{
if(MFRRegistry.getGrindables27().containsKey(e.getClass()))
{
IFactoryGrindable2 r = MFRRegistry.getGrindables27().get(e.getClass());
List<MobDrop> drops = r.grind(e.worldObj, e, getRandom());
if(drops != null && drops.size() > 0 && WeightedRandom.getTotalWeight(drops) > 0)
{
ItemStack drop = ((MobDrop)WeightedRandom.getRandomItem(_rand, drops)).getStack();
doDrop(drop);
}
if(r instanceof IFactoryGrindable2)
{
if(((IFactoryGrindable2)r).processEntity(e))
{
processMob = true;
if(e.getHealth() <= 0)
{
continue entityList;
}
break processEntity;
}
}
else
{
processMob = true;
break processEntity;
}
}
for(Class<?> t : MFRRegistry.getGrinderBlacklist())
{
if(t.isInstance(e))
{
continue entityList;
}
}
if(!_grindingWorld.addEntityForGrinding(e))
{
continue entityList;
}
}
if(processMob && e.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot"))
{
try
{
e.worldObj.getGameRules().setOrCreateGameRule("doMobLoot", "false");
damageEntity(e);
if(e.getHealth() <= 0)
{
_tank.fill(LiquidDictionary.getLiquid("mobEssence", 100), true);
}
}
finally
{
e.worldObj.getGameRules().setOrCreateGameRule("doMobLoot", "true");
setIdleTicks(20);
}
return true;
}
damageEntity(e);
if(e.getHealth() <= 0)
{
_tank.fill(LiquidDictionary.getLiquid("mobEssence", 100), true);
setIdleTicks(20);
}
else
{
setIdleTicks(10);
}
return true;
}
setIdleTicks(getIdleTicksMax());
return false;
}
protected void setRecentlyHit(EntityLiving entity, int t)
{
try
{
recentlyHit.set(entity, t);
}
catch(Throwable e)
{
}
}
protected void damageEntity(EntityLiving entity)
{
setRecentlyHit(entity, 100);
entity.attackEntityFrom(_damageSource, 500000);
}
@Override
public String getInvName()
{
return "Mob Grinder";
}
@Override
public int getSizeInventory()
{
return 0;
}
@Override
public int fill(ForgeDirection from, LiquidStack resource, boolean doFill)
{
return 0;
}
@Override
public int fill(int tankIndex, LiquidStack resource, boolean doFill)
{
return 0;
}
@Override
public boolean allowBucketDrain()
{
return true;
}
@Override
public LiquidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
{
return null;
}
@Override
public LiquidStack drain(int tankIndex, int maxDrain, boolean doDrain)
{
return null;
}
@Override
public ILiquidTank[] getTanks(ForgeDirection direction)
{
return new ILiquidTank[] { _tank };
}
@Override
public ILiquidTank getTank(ForgeDirection direction, LiquidStack type)
{
return _tank;
}
@Override
public boolean manageSolids()
{
return true;
}
@Override
public boolean canRotate()
{
return true;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
1e7149a9c8cb1032bc894964d6367a16f5ee467d
|
82c73b14ca77a4e36976aab39d3a406faad399d1
|
/app/src/main/java/com/merrichat/net/activity/message/smallvideo/view/CameraView.java
|
d253c2eb153f4539dfe0d6391f7a647352bda1bc
|
[] |
no_license
|
AndroidDeveloperRaj/aaaaa
|
ab85835b3155ebe8701085560c550a676098736d
|
e6733ab804168065926f41b7e8723e0d92cd1682
|
refs/heads/master
| 2020-03-25T11:19:48.899989
| 2018-05-10T05:53:07
| 2018-05-10T05:53:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 614
|
java
|
package com.merrichat.net.activity.message.smallvideo.view;
import android.graphics.Bitmap;
/**
* =====================================
* 作 者: 陈嘉桐
* 版 本:1.1.4
* 创建日期:2017/9/8
* 描 述:
* =====================================
*/
public interface CameraView {
void resetState(int type);
void confirmState(int type);
void showPicture(Bitmap bitmap, boolean isVertical);
void playVideo(Bitmap firstFrame, String url);
void stopVideo();
void setTip(String tip);
void startPreviewCallback();
boolean handlerFoucs(float x, float y);
}
|
[
"309672235@qq.com"
] |
309672235@qq.com
|
7b99fc08513c2667989118516c888ae082e4d283
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/large-multiproject/project49/src/test/java/org/gradle/test/performance49_3/Test49_219.java
|
c6872e2cb349a1f3f80199182ede7157cacdea92
|
[] |
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
| 292
|
java
|
package org.gradle.test.performance49_3;
import static org.junit.Assert.*;
public class Test49_219 {
private final Production49_219 production = new Production49_219("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
021559b780daa5e0fc7f288b03703c08da4c719e
|
2e590ef886718e01d7ec58beff00a28d7aa9a366
|
/source-code/java/mc/test/gov/nasa/kepler/mc/fc/TestsRaDec2PixModel.java
|
633b6afe8e769c1f6727e7d388782f55ce3710b8
|
[
"LicenseRef-scancode-warranty-disclaimer"
] |
no_license
|
adam-sweet/kepler-pipeline
|
95a6cbc03dd39a8289b090fb85cdfc1eb5011fd9
|
f58b21df2c82969d8bd3e26a269bd7f5b9a770e1
|
refs/heads/master
| 2022-06-07T21:22:33.110291
| 2020-05-06T01:12:08
| 2020-05-06T01:12:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,455
|
java
|
/*
* Copyright 2017 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* This file is available under the terms of the NASA Open Source Agreement
* (NOSA). You should have received a copy of this agreement with the
* Kepler source code; see the file NASA-OPEN-SOURCE-AGREEMENT.doc.
*
* No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY
* WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY,
* INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE
* WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM
* INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR
* FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM
* TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER,
* CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT
* OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY
* OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE.
* FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES
* REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE,
* AND DISTRIBUTES IT "AS IS."
*
* Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS
* AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND
* SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE OF
* THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES,
* EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM
* PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE OF THE SUBJECT
* SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED
* STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY
* PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE
* REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL
* TERMINATION OF THIS AGREEMENT.
*/
package gov.nasa.kepler.mc.fc;
import static org.junit.Assert.assertTrue;
import gov.nasa.kepler.common.SocEnvVars;
import gov.nasa.kepler.fc.RaDec2PixModel;
import gov.nasa.kepler.fc.importer.ImporterGeometry;
import gov.nasa.kepler.fc.importer.ImporterPointing;
import gov.nasa.kepler.fc.importer.ImporterRollTime;
import gov.nasa.kepler.fs.api.FileStoreClient;
import gov.nasa.kepler.fs.api.FsId;
import gov.nasa.kepler.fs.client.FileStoreClientFactory;
import gov.nasa.kepler.hibernate.dbservice.DatabaseService;
import gov.nasa.kepler.hibernate.dbservice.DatabaseServiceFactory;
import gov.nasa.kepler.hibernate.dbservice.DdlInitializer;
import gov.nasa.kepler.hibernate.dr.DispatchLog;
import gov.nasa.kepler.hibernate.dr.DispatchLog.DispatcherType;
import gov.nasa.kepler.hibernate.dr.FileLog;
import gov.nasa.kepler.hibernate.dr.LogCrud;
import gov.nasa.kepler.hibernate.dr.ReceiveLog;
import gov.nasa.kepler.mc.fc.RaDec2PixOperations;
import gov.nasa.kepler.mc.fs.DrFsIdFactory;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class TestsRaDec2PixModel {
private static DdlInitializer ddlInitializer;
private static DatabaseService dbService;
private static FileStoreClient fsClient;
@Before
public void setUp() throws IOException {
dbService = DatabaseServiceFactory.getInstance();
fsClient = FileStoreClientFactory.getInstance();
ddlInitializer = dbService.getDdlInitializer();
ddlInitializer.initDB();
try {
dbService.beginTransaction();
fsClient.beginLocalFsTransaction();
new ImporterGeometry().rewriteHistory("TestsRaDec2PixModel geometry");
new ImporterRollTime().rewriteHistory("TestsRaDec2PixModel roll time");
new ImporterPointing().rewriteHistory("TestsRaDec2PixModel pointing");
DispatcherType[] dispatcherTypes = {
DispatcherType.LEAP_SECONDS,
DispatcherType.PLANETARY_EPHEMERIS,
DispatcherType.SPACECRAFT_EPHEMERIS };
String[] filenames = {
"naif0009.tls",
"de405.bsp",
"spk_2009065045522_2009008233141_kplr.bsp"};
String[] sourceDirectorys = {
SocEnvVars.getLocalDataDir() + "/moc/leap-seconds/latest/",
SocEnvVars.getLocalDataDir() + "/moc/planetary-ephemeris/latest/",
SocEnvVars.getLocalDataDir() + "/moc/spacecraft-ephemeris/latest/" };
FsId[] fsIds = new FsId[3];
ReceiveLog recieveLog = new ReceiveLog(new Date(), "test1", "test2");
DispatchLog[] dispatchLogs = new DispatchLog[3];
FileLog[] fileLogs = new FileLog[3];
LogCrud logCrud = new LogCrud();
logCrud.createReceiveLog(recieveLog);
for (int ii = 0; ii < 3; ++ii) {
fsIds[ii] = DrFsIdFactory.getFile(dispatcherTypes[ii], filenames[ii]);
fsClient.writeBlob(fsIds[ii], 0, new File(sourceDirectorys[ii] + File.separator + filenames[ii]));
dispatchLogs[ii] = new DispatchLog(recieveLog, dispatcherTypes[ii]);
fileLogs[ii] = new FileLog(dispatchLogs[ii], filenames[ii]);
logCrud.createDispatchLog(dispatchLogs[ii]);
logCrud.createFileLog(fileLogs[ii]);
}
fsClient.commitLocalFsTransaction();
dbService.commitTransaction();
} finally {
fsClient.rollbackLocalFsTransactionIfActive();
dbService.rollbackTransactionIfActive();
}
}
@After
public void destroyDatabase() {
dbService.closeCurrentSession();
ddlInitializer.cleanDB();
}
// @Test
// public void testOperationsWrapper() {
// double mjdStart = 55000.0;
// double mjdEnd = 56000.0;
//
// RaDec2PixOperations ops = new RaDec2PixOperations();
// RaDec2PixModel model = ops.retrieveRaDec2PixModel(mjdStart, mjdEnd);
//
// boolean isGeometryContained =
// (model.getGeometryModel().getMjds())[0] <= mjdStart &&
// (model.getGeometryModel().getMjds())[model.getGeometryModel().size()-1] <= mjdEnd;
// assertTrue(isGeometryContained);
//
// boolean isPointingBracketed =
// (model.getPointingModel().getMjds())[0] <= mjdStart &&
// (model.getPointingModel().getMjds())[model.getPointingModel().size()-1] >= mjdEnd;
// assertTrue(isPointingBracketed);
// }
@Test
public void testCall() {
RaDec2PixOperations raDec2PixOperations = new RaDec2PixOperations();
@SuppressWarnings("unused")
RaDec2PixModel raDec2PixModel = raDec2PixOperations.retrieveRaDec2PixModel(55100, 55200);
assertTrue(true);
}
@Test
public void testDefaultConstructor() {
@SuppressWarnings("unused")
RaDec2PixModel model = (new RaDec2PixOperations()).retrieveRaDec2PixModel();
assertTrue(true);
}
@Test
public void testDefaultConstructor2() {
RaDec2PixOperations ops = new RaDec2PixOperations();
RaDec2PixModel model = ops.retrieveRaDec2PixModel();
assertTrue(model.getMjdEnd() >= model.getMjdStart());
}
}
|
[
"Bill.Wohler@nasa.gov"
] |
Bill.Wohler@nasa.gov
|
12eb11b53a51eb5652a39a8811ab7f3b02cc0adc
|
eebf69b36a6e00934df5426f6256c3d1f995179f
|
/services/hrdb/src/com/auto_ptcwjnbmpw/hrdb/service/HrdbQueryExecutorService.java
|
4de47b7d6ebbc4590e8cd42b4610202ea0edd676
|
[] |
no_license
|
wavemakerapps/Auto_PtcWjnbMPW
|
4f228aeb4375a0d60cee76f5bd7564b06e03b682
|
5c2a918bcab7699c9497437b90682a4ed1d15ea8
|
refs/heads/master
| 2021-04-15T11:48:26.682128
| 2018-03-22T23:41:22
| 2018-03-22T23:41:22
| 126,407,275
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 515
|
java
|
/*Copyright (c) 2015-2016 wavemaker.com All Rights Reserved.
This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance
with the terms of the source code license agreement you entered into with wavemaker.com*/
package com.auto_ptcwjnbmpw.hrdb.service;
/*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/
public interface HrdbQueryExecutorService {
}
|
[
"automate1@wavemaker.com"
] |
automate1@wavemaker.com
|
957483bfd2382658bb909d1dcb5207971cce78d3
|
489cdd80ed8dc667ddc9c979b142b0c05235c2a2
|
/yaoming-mall-common/src/main/java/com/club/web/store/domain/RechargeNoteDo.java
|
154cd005d81dc74983d6746a3f5fbcfcb75247d2
|
[] |
no_license
|
569934390/darenbao
|
4103cd748498ec6f5f2bb9069c97fa29c48535b2
|
a4d1bee852d1e1f3768d3f4d264a9dff2b4cfc61
|
refs/heads/master
| 2020-04-17T07:29:22.914538
| 2016-09-13T07:32:56
| 2016-09-13T07:32:56
| 67,473,893
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,250
|
java
|
package com.club.web.store.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import com.club.web.store.domain.repository.RechargeNoteRepository;
@Configurable
public class RechargeNoteDo {
@Autowired
RechargeNoteRepository rechargeNoteRepository;
private Long indentId;
private BigDecimal paymentAmount;
private Integer payType;
private Integer itemCode;
private String buyerClient;
private String buyerAccount;
private Date createDate;
private String state;
public Long getIndentId() {
return indentId;
}
public void setIndentId(Long indentId) {
this.indentId = indentId;
}
public BigDecimal getPaymentAmount() {
return paymentAmount;
}
public void setPaymentAmount(BigDecimal paymentAmount) {
this.paymentAmount = paymentAmount;
}
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public Integer getItemCode() {
return itemCode;
}
public void setItemCode(Integer itemCode) {
this.itemCode = itemCode;
}
public String getBuyerClient() {
return buyerClient;
}
public void setBuyerClient(String buyerClient) {
this.buyerClient = buyerClient == null ? null : buyerClient.trim();
}
public String getBuyerAccount() {
return buyerAccount;
}
public void setBuyerAccount(String buyerAccount) {
this.buyerAccount = buyerAccount == null ? null : buyerAccount.trim();
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state == null ? null : state.trim();
}
public int insert(){
return rechargeNoteRepository.addRechargeNote(this);
}
public int update(){
return rechargeNoteRepository.updateRechargeNote(this);
}
}
|
[
"569934930@163.com"
] |
569934930@163.com
|
fac380ba3bf0713be2b770208c75b0b567627c6d
|
3c7502cc9da3b1827b0a7529985a4e62fa1ade61
|
/freeipa-api/src/main/java/com/sequenceiq/freeipa/api/v1/freeipa/dns/AddDnsZoneForSubnetsResponse.java
|
916f2f68a8dc5ada9d6c2ac108333d6ac39cd47e
|
[
"LicenseRef-scancode-warranty-disclaimer",
"ANTLR-PD",
"CDDL-1.0",
"bzip2-1.0.6",
"Zlib",
"BSD-3-Clause",
"MIT",
"EPL-1.0",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-jdbm-1.00",
"Apache-2.0"
] |
permissive
|
jdesjean/cloudbreak
|
d77d630dab058df4aaa6cf609cb97f542c4cdf8c
|
d533f24162c043bd5345d07adef0e4074e938027
|
refs/heads/master
| 2020-07-06T05:06:10.822481
| 2019-08-13T19:55:33
| 2019-08-16T19:58:23
| 202,900,069
| 0
| 0
|
Apache-2.0
| 2019-08-17T15:42:47
| 2019-08-17T15:42:46
| null |
UTF-8
|
Java
| false
| false
| 919
|
java
|
package com.sequenceiq.freeipa.api.v1.freeipa.dns;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
@ApiModel("AddDnsZoneForSubnetsV1Request")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AddDnsZoneForSubnetsResponse {
private Set<String> success = new HashSet<>();
private Map<String, String> failed = new HashMap<>();
public Set<String> getSuccess() {
return success;
}
public void setSuccess(Set<String> success) {
this.success = success;
}
public Map<String, String> getFailed() {
return failed;
}
public void setFailed(Map<String, String> failed) {
this.failed = failed;
}
}
|
[
"keyki.kk@gmail.com"
] |
keyki.kk@gmail.com
|
de7ac6664d8aab8e52a84ccd2bd307952b533880
|
59f9102cbcb7a0ca6ffd6840e717e8648ab2f12a
|
/jdk6/org/omg/PortableServer/ServantRetentionPolicyOperations.java
|
f22cdf8058a6911b990c72ec0d93c42940a93326
|
[] |
no_license
|
yuanhua1/ruling_java
|
77a52b2f9401c5392bf1409fc341ab794c555ee5
|
7f4b47c9f013c5997f138ddc6e4f916cc7763476
|
refs/heads/master
| 2020-08-22T22:50:35.762836
| 2019-06-24T15:39:54
| 2019-06-24T15:39:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 655
|
java
|
package org.omg.PortableServer;
/**
* org/omg/PortableServer/ServantRetentionPolicyOperations.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/org/omg/PortableServer/poa.idl
* Friday, January 20, 2012 10:38:36 AM GMT-08:00
*/
/**
* This policy specifies whether the created POA retains
* active servants in an Active Object Map.
*/
public interface ServantRetentionPolicyOperations extends org.omg.CORBA.PolicyOperations
{
/**
* specifies the policy value
*/
org.omg.PortableServer.ServantRetentionPolicyValue value ();
} // interface ServantRetentionPolicyOperations
|
[
"massimo.paladin@gmail.com"
] |
massimo.paladin@gmail.com
|
20feb3011ca75fdb60fa5326f0bd27c853c4a9b4
|
d954670a214dc84a912d7a5942bc45164260cf49
|
/src/main/java/org/apache/fop/area/inline/UnresolvedPageNumber.java
|
a5bb1f0f636949bcea003ac3945bbf25cb0d678e
|
[
"Apache-2.0"
] |
permissive
|
nghinv/Apache-Fop
|
d1e6663ca2f9b76d3b3055cc0f2ac88907373c09
|
9d65e2a01cd344ccdc44b5ac176b07657a1bd8cd
|
refs/heads/master
| 2020-06-28T03:06:01.795472
| 2014-04-21T19:23:34
| 2014-04-21T19:23:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,399
|
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id: UnresolvedPageNumber.java 679326 2008-07-24 09:35:34Z vhennebert $ */
package org.apache.fop.area.inline;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.Resolvable;
import org.apache.fop.fonts.Font;
/**
* Unresolvable page number area. This is a word area that resolves itself to a
* page number from an id reference.
*/
@Slf4j
public class UnresolvedPageNumber extends TextArea implements Resolvable {
/**
*
*/
private static final long serialVersionUID = 4779140599215451931L;
private boolean resolved = false;
private final String pageIDRef;
private String text;
private final boolean pageType;
/**
* Indicates that the reference refers to the first area generated by a
* formatting object.
*/
public static final boolean FIRST = true;
/**
* Indicates that the reference refers to the last area generated by a
* formatting object.
*/
public static final boolean LAST = false;
// Transient fields
private transient Font font;
/**
* Create a new unresolved page number.
*
* @param id
* the id reference for resolving this
* @param f
* the font for formatting the page number
*/
public UnresolvedPageNumber(final String id, final Font f) {
this(id, f, FIRST);
}
/**
* Create a new unresolved page number.
*
* @param id
* the id reference for resolving this
* @param f
* the font for formatting the page number
* @param type
* indicates whether the reference refers to the first or last
* area generated by a formatting object
*/
public UnresolvedPageNumber(final String id, final Font f,
final boolean type) {
this.pageIDRef = id;
this.font = f;
this.text = "?";
this.pageType = type;
}
/**
* Get the id references for this area.
*
* @return the id reference for this unresolved page number
*/
@Override
public String[] getIDRefs() {
return new String[] { this.pageIDRef };
}
/**
* Resolve the page number idref This resolves the idref for this object by
* getting the page number string from the first page in the list of pages
* that apply for this ID. The page number text is then set to the String
* value of the page number.
*
* @param id
* an id whose PageViewports have been determined
* @param pages
* the list of PageViewports associated with this ID
*/
@Override
public void resolveIDRef(final String id, final List pages) {
if (!this.resolved && this.pageIDRef.equals(id) && pages != null) {
if (log.isDebugEnabled()) {
log.debug("Resolving pageNumber: " + id);
}
this.resolved = true;
PageViewport page;
if (this.pageType == FIRST) {
page = (PageViewport) pages.get(0);
} else {
page = (PageViewport) pages.get(pages.size() - 1);
}
// replace the text
removeText();
this.text = page.getPageNumberString();
addWord(this.text, 0);
// update ipd
if (this.font != null) {
handleIPDVariation(this.font.getWordWidth(this.text) - getIPD());
// set the Font object to null, as we don't need it any more
this.font = null;
} else {
log.warn("Cannot update the IPD of an unresolved page number."
+ " No font information available.");
}
}
}
/**
* Check if this is resolved.
*
* @return true when this has been resolved
*/
@Override
public boolean isResolved() {
return this.resolved;
}
/**
* recursively apply the variation factor to all descendant areas
*
* @param variationFactor
* the variation factor that must be applied to adjustment ratios
* @param lineStretch
* the total stretch of the line
* @param lineShrink
* the total shrink of the line
* @return true if there is an UnresolvedArea descendant
*/
@Override
public boolean applyVariationFactor(final double variationFactor,
final int lineStretch, final int lineShrink) {
return true;
}
}
|
[
"guillaume.rodrigues@gmail.com"
] |
guillaume.rodrigues@gmail.com
|
05b657cbfd252da2a496eea0045a6808131d50d3
|
d49dcc3df76120003776e1ec944a8fd1fb99795d
|
/PullRecycler/app/src/main/java/com/bumptech/glide/load/engine/DataCacheGenerator.java
|
5aea80f2ccae9b0458eb15a0ca1864923ddcbc97
|
[
"MIT"
] |
permissive
|
chefish/RecycleView
|
5f719f4e3f110e7508c6d58e094fa25c0ca6bb58
|
289f43f13b361bcbe22c8b579dcc7c19119adfd5
|
refs/heads/master
| 2020-04-29T17:00:28.140578
| 2019-03-18T12:42:34
| 2019-03-18T12:42:34
| 176,282,915
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,138
|
java
|
package com.bumptech.glide.load.engine;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.Key;
import com.bumptech.glide.load.data.DataFetcher;
import com.bumptech.glide.load.model.ModelLoader;
import com.bumptech.glide.load.model.ModelLoader.LoadData;
import java.io.File;
import java.util.List;
/**
* Generates {@link DataFetcher DataFetchers} from cache files
* containing original unmodified source data.
*/
class DataCacheGenerator implements DataFetcherGenerator,
DataFetcher.DataCallback<Object> {
private List<Key> cacheKeys;
private final DecodeHelper<?> helper;
private final FetcherReadyCallback cb;
private int sourceIdIndex = -1;
private Key sourceKey;
private List<ModelLoader<File, ?>> modelLoaders;
private int modelLoaderIndex;
private volatile LoadData<?> loadData;
// PMD is wrong here, this File must be an instance variable because it may be used across
// multiple calls to startNext.
@SuppressWarnings("PMD.SingularField")
private File cacheFile;
DataCacheGenerator(DecodeHelper<?> helper, FetcherReadyCallback cb) {
this(helper.getCacheKeys(), helper, cb);
}
// In some cases we may want to load a specific cache key (when loading from source written to
// cache), so we accept a list of keys rather than just obtain the list from the helper.
DataCacheGenerator(List<Key> cacheKeys, DecodeHelper<?> helper, FetcherReadyCallback cb) {
this.cacheKeys = cacheKeys;
this.helper = helper;
this.cb = cb;
}
@Override
public boolean startNext() {
while (modelLoaders == null || !hasNextModelLoader()) {
sourceIdIndex++;
if (sourceIdIndex >= cacheKeys.size()) {
return false;
}
Key sourceId = cacheKeys.get(sourceIdIndex);
Key originalKey = new DataCacheKey(sourceId, helper.getSignature());
cacheFile = helper.getDiskCache().get(originalKey);
if (cacheFile != null) {
this.sourceKey = sourceId;
modelLoaders = helper.getModelLoaders(cacheFile);
modelLoaderIndex = 0;
}
}
loadData = null;
boolean started = false;
while (!started && hasNextModelLoader()) {
ModelLoader<File, ?> modelLoader = modelLoaders.get(modelLoaderIndex++);
loadData =
modelLoader.buildLoadData(cacheFile, helper.getWidth(), helper.getHeight(),
helper.getOptions());
if (loadData != null && helper.hasLoadPath(loadData.fetcher.getDataClass())) {
started = true;
loadData.fetcher.loadData(helper.getPriority(), this);
}
}
return started;
}
private boolean hasNextModelLoader() {
return modelLoaderIndex < modelLoaders.size();
}
@Override
public void cancel() {
LoadData<?> local = loadData;
if (local != null) {
local.fetcher.cancel();
}
}
@Override
public void onDataReady(Object data) {
cb.onDataFetcherReady(sourceKey, data, loadData.fetcher, DataSource.DATA_DISK_CACHE, sourceKey);
}
@Override
public void onLoadFailed(Exception e) {
cb.onDataFetcherFailed(sourceKey, e, loadData.fetcher, DataSource.DATA_DISK_CACHE);
}
}
|
[
"xiaomin.yxm@alibaba-inc.com"
] |
xiaomin.yxm@alibaba-inc.com
|
4cdda558b222a65f6e57fadb1c4eedb6476910fd
|
472c4ef66cc94b53622432f89c914e9301dbe58b
|
/new-alg/src/main/java/std/algs/Merge.java
|
e5c79a87b88f0711110546276e969b3f9efdfaee
|
[
"Apache-2.0"
] |
permissive
|
jt120/algorithm
|
1001a78e2ad56bf55dc447f9e4b673612761de40
|
b64b350e392fec219fb07e22bac2b63687b5e6bf
|
refs/heads/master
| 2021-01-21T23:28:54.149253
| 2017-03-15T08:51:11
| 2017-03-15T08:51:11
| 31,927,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,030
|
java
|
package std.algs;
import std.libs.*;
/*************************************************************************
* Compilation: javac Merge.java Execution: java Merge < input.txt Dependencies: StdOut.java StdIn.java Data files:
* http://algs4.cs.princeton.edu/22mergesort/tiny.txt http://algs4.cs.princeton.edu/22mergesort/words3.txt
*
* Sorts a sequence of strings from standard input using mergesort.
*
* % more tiny.txt S O R T E X A M P L E
*
* % java Merge < tiny.txt A E E L M O P R S T X [ one string per line ]
*
* % more words3.txt bed bug dad yes zoo ... all bad yet
*
* % java Merge < words3.txt all bad bed bug dad ... yes yet zoo [ one string per line ]
*
*************************************************************************/
/**
* The <tt>Merge</tt> class provides static methods for sorting an array using mergesort.
* <p>
* For additional documentation, see <a href="http://algs4.cs.princeton.edu/22mergesort">Section 2.2</a> of
* <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne. For an optimized version, see {@link MergeX}.
*
* @author Robert Sedgewick
* @author Kevin Wayne
*/
public class Merge {
// This class should not be instantiated.
private Merge() {
}
// stably merge a[lo .. mid] with a[mid+1 ..hi] using aux[lo .. hi]
private static void merge(Comparable[] a, Comparable[] aux, int lo, int mid, int hi) {
// precondition: a[lo .. mid] and a[mid+1 .. hi] are sorted subarrays
assert isSorted(a, lo, mid);
assert isSorted(a, mid + 1, hi);
// copy to aux[]
for (int k = lo; k <= hi; k++) {
aux[k] = a[k];
}
// merge back to a[]
int i = lo, j = mid + 1;
for (int k = lo; k <= hi; k++) {
if (i > mid)
a[k] = aux[j++]; // this copying is unnecessary
else if (j > hi)
a[k] = aux[i++];
else if (less(aux[j], aux[i]))
a[k] = aux[j++];
else
a[k] = aux[i++];
}
// postcondition: a[lo .. hi] is sorted
assert isSorted(a, lo, hi);
}
// mergesort a[lo..hi] using auxiliary array aux[lo..hi]
private static void sort(Comparable[] a, Comparable[] aux, int lo, int hi) {
if (hi <= lo)
return;
int mid = lo + (hi - lo) / 2;
sort(a, aux, lo, mid);
sort(a, aux, mid + 1, hi);
merge(a, aux, lo, mid, hi);
}
/**
* Rearranges the array in ascending order, using the natural order.
*
* @param a the array to be sorted
*/
public static void sort(Comparable[] a) {
Comparable[] aux = new Comparable[a.length];
sort(a, aux, 0, a.length - 1);
assert isSorted(a);
}
/***********************************************************************
* Helper sorting functions
***********************************************************************/
// is v < w ?
private static boolean less(Comparable v, Comparable w) {
return (v.compareTo(w) < 0);
}
// exchange a[i] and a[j]
private static void exch(Object[] a, int i, int j) {
Object swap = a[i];
a[i] = a[j];
a[j] = swap;
}
/***********************************************************************
* Check if array is sorted - useful for debugging
***********************************************************************/
private static boolean isSorted(Comparable[] a) {
return isSorted(a, 0, a.length - 1);
}
private static boolean isSorted(Comparable[] a, int lo, int hi) {
for (int i = lo + 1; i <= hi; i++)
if (less(a[i], a[i - 1]))
return false;
return true;
}
/***********************************************************************
* Index mergesort
***********************************************************************/
// stably merge a[lo .. mid] with a[mid+1 .. hi] using aux[lo .. hi]
private static void merge(Comparable[] a, int[] index, int[] aux, int lo, int mid, int hi) {
// copy to aux[]
for (int k = lo; k <= hi; k++) {
aux[k] = index[k];
}
// merge back to a[]
int i = lo, j = mid + 1;
for (int k = lo; k <= hi; k++) {
if (i > mid)
index[k] = aux[j++];
else if (j > hi)
index[k] = aux[i++];
else if (less(a[aux[j]], a[aux[i]]))
index[k] = aux[j++];
else
index[k] = aux[i++];
}
}
/**
* Returns a permutation that gives the elements in the array in ascending order.
*
* @param a the array
* @return a permutation <tt>p[]</tt> such that <tt>a[p[0]]</tt>, <tt>a[p[1]]</tt>, ..., <tt>a[p[N-1]]</tt> are in
* ascending order
*/
public static int[] indexSort(Comparable[] a) {
int N = a.length;
int[] index = new int[N];
for (int i = 0; i < N; i++)
index[i] = i;
int[] aux = new int[N];
sort(a, index, aux, 0, N - 1);
return index;
}
// mergesort a[lo..hi] using auxiliary array aux[lo..hi]
private static void sort(Comparable[] a, int[] index, int[] aux, int lo, int hi) {
if (hi <= lo)
return;
int mid = lo + (hi - lo) / 2;
sort(a, index, aux, lo, mid);
sort(a, index, aux, mid + 1, hi);
merge(a, index, aux, lo, mid, hi);
}
// print array to standard output
private static void show(Comparable[] a) {
for (int i = 0; i < a.length; i++) {
StdOut.println(a[i]);
}
}
/**
* Reads in a sequence of strings from standard input; mergesorts them; and prints them to standard output in
* ascending order.
*/
public static void main(String[] args) {
String[] a = StdIn.readAllStrings();
Merge.sort(a);
show(a);
}
}
|
[
"jt120lz@gmail.com"
] |
jt120lz@gmail.com
|
e23c6d16216ef8b8b8f222ebbf172d0e755d8c90
|
c2d8181a8e634979da48dc934b773788f09ffafb
|
/storyteller/output/musicmug/DeleteCardForAdminAction.java
|
5a33cc59038534212b2065f6f093bb42a87258bb
|
[] |
no_license
|
toukubo/storyteller
|
ccb8281cdc17b87758e2607252d2d3c877ffe40c
|
6128b8d275efbf18fd26d617c8503a6e922c602d
|
refs/heads/master
| 2021-05-03T16:30:14.533638
| 2016-04-20T12:52:46
| 2016-04-20T12:52:46
| 9,352,300
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,596
|
java
|
package net.musicmug.web.app;
import net.musicmug.model.*;
import net.musicmug.model.crud.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.enclosing.util.HTTPGetRedirection;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.web.context.support.WebApplicationContextUtils;
import net.enclosing.util.HibernateSession;
public class DeleteCardForAdminAction extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res) throws Exception{
Session session = new HibernateSession().currentSession(this
.getServlet().getServletContext());
Transaction transaction = session.beginTransaction();
Criteria criteria = session.createCriteria(Card.class);
criteria.add(Restrictions.idEq(Integer.valueOf(req.getParameter("id"))));
Card card = (Card) criteria.uniqueResult();
session.delete(card);
transaction.commit();
session.flush();
new HTTPGetRedirection(req, res, "Cards.do", card.getId().toString());
return null;
}
}
|
[
"toukubo@gmail.com"
] |
toukubo@gmail.com
|
f6e0ab04f32cc3d98579353a19db5ceb8ff38119
|
e6ce4ed86a5a9bec1b074245afc29ab002b06298
|
/src/qz2019/alibaba/Main2.java
|
4854f597e290078f72444eba817531617e3070bf
|
[] |
no_license
|
hyfangcong/data-struct
|
6c16f2909c8949142cb28ab6d02bacb71debdef2
|
dfd609daf7ab3c2afa289e6903aa2d7642b0398e
|
refs/heads/master
| 2020-05-18T23:02:57.700011
| 2019-11-22T01:47:31
| 2019-11-22T01:47:31
| 184,702,462
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,799
|
java
|
package qz2019.alibaba;
import java.util.Scanner;
/**
* @author: fangcong
* @date: 2019/8/30
*/
public class Main2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String s = scanner.next();
int k = scanner.nextInt();
int index = getLuckBoy(s);
int max = getLong(s,k, index);
System.out.println(index +" "+ max);
}
private static int getLong(String s, int k, int first) {
int n = s.length();
int ans = 0;
int j = 0;
int tmp = 0;
for(int i = first; j < n; i++, j++){
if(s.charAt((i % n)) == 'g'){
tmp++;
if(tmp > k){
ans = j - k;
break;
}
}
}
if(j == n){
ans = n - tmp;
}
tmp = 0;
j = 0;
int ans2 = 0;
for(int i = first; j < n; i--,j++){
if(s.charAt((i + n) % n) == 'g'){
tmp++;
if(tmp > k){
ans2 = j - k;
break;
}
}
}
if(j == n){
ans2 = n - tmp;
}
return ans > ans2 ? ans : ans2;
}
private static int getLuckBoy(String s) {
int n = s.length();
int max = 0, first = -1;
for(int i = 0; i < n; i ++){
if(s.charAt(i) == 'b'){
int tmp = 0;
if(i!=0 && s.charAt((i-1+n) % n) == 'g')
tmp++;
if(s.charAt((i+1) % n) == 'g')
tmp++;
if(tmp > max){
max = tmp;
first = i;
}
}
}
return first;
}
}
|
[
"1186977171@qq.com"
] |
1186977171@qq.com
|
81aafc2b697e60038e26516f2df3383372bbc231
|
b530af769bb496cdbadb4d1c14b81d6c53e2e36f
|
/factory/src/test/java/io/github/factoryfx/factory/attribute/time/InstantAttributeTest.java
|
0b8d20e169dae7e63d5dc6a2a1864a8e6d2ad64c
|
[
"Apache-2.0"
] |
permissive
|
factoryfx/factoryfx
|
ab366d3144a27fd07bbf4098b9dc82e3bab1181f
|
08bab85ecd5ab30b26fa57d852c7fac3fb5ce312
|
refs/heads/master
| 2023-07-09T05:20:02.320970
| 2023-07-04T15:11:52
| 2023-07-04T15:11:52
| 59,744,695
| 12
| 3
|
Apache-2.0
| 2023-03-02T15:11:26
| 2016-05-26T11:22:59
|
Java
|
UTF-8
|
Java
| false
| false
| 884
|
java
|
package io.github.factoryfx.factory.attribute.time;
import io.github.factoryfx.factory.jackson.ObjectMapperBuilder;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.time.Instant;
import java.time.temporal.ChronoField;
public class InstantAttributeTest {
@Test
public void test_json(){
InstantAttribute attribute = new InstantAttribute();
Instant value = Instant.now();
attribute.set(value);
InstantAttribute copy = ObjectMapperBuilder.build().copy(attribute);
System.out.println(ObjectMapperBuilder.build().writeValueAsString(attribute));
Assertions.assertEquals(value,copy.get());
}
@Test
public void parse_from_ts(){
Instant parse = Instant.parse("2018-12-12T10:24:55.262Z");
Assertions.assertEquals(262,parse.get(ChronoField.MILLI_OF_SECOND));
}
}
|
[
"henning.brackmann@scoop-software.de"
] |
henning.brackmann@scoop-software.de
|
430edab312311728e91723936fba24c656c2034d
|
f84bf3d19f1d7ba87b278b8ef1413daae6530958
|
/src/main/java/com/qinyuan15/crawler/dao/IndexLogo.java
|
a544e92b1f365a68e3f8a7a81291fcc51856c0f9
|
[] |
no_license
|
sumit784/crawler-3
|
3f3bd681be4c5d2659cf4c48a77246bd5d6c87c8
|
a1b38f16e635ee8e0d565824f6e3cdc9a5ad5ae0
|
refs/heads/master
| 2021-01-21T17:29:33.479262
| 2015-04-16T04:25:45
| 2015-04-16T04:25:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 870
|
java
|
package com.qinyuan15.crawler.dao;
/**
* Persist Object of IndexLogo
* Created by qinyuan on 15-2-18.
*/
public class IndexLogo extends PersistObject implements Ranking {
private String path;
private String link;
private Integer ranking;
private String description;
public String getPath() {
return path;
}
public String getLink() {
return link;
}
public Integer getRanking() {
return ranking;
}
public void setPath(String path) {
this.path = path;
}
public void setLink(String link) {
this.link = link;
}
public void setRanking(Integer ranking) {
this.ranking = ranking;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
|
[
"qinyuan15@sina.com"
] |
qinyuan15@sina.com
|
f24f173dce200bec64a1eb93b583e3bee11ecc25
|
c8c438817c924e0acaaaacfbdaaa7db90288f313
|
/EscolaHeranca1/src/escolaheranca1/Tecnico.java
|
7f31e4a10ca6bfcdd17697c30ccd5940291f97b4
|
[] |
no_license
|
regisPatrick/ProjetosJava
|
56b3c3b4945f3b8678636c6e73edeb93d21462b8
|
fa9f372b0f170acf7fb7ac798cdd91ea35015c91
|
refs/heads/master
| 2021-03-05T08:59:14.756464
| 2020-06-17T06:02:33
| 2020-06-17T06:02:33
| 246,109,018
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 642
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package escolaheranca1;
/**
*
* @author user
*/
public final class Tecnico extends Aluno{
private int registro_profissional = 3333;
public int getRegistro_profissional() {
return registro_profissional;
}
public void setRegistro_profissional(int registro_profissional) {
this.registro_profissional = registro_profissional;
}
public void praticar(){
System.out.println("Praticando...");
}
}
|
[
"regis86@hotmail.com"
] |
regis86@hotmail.com
|
495ae9863ed9bdd678807f9b05f67ebbe8945fbc
|
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
|
/java/neo4j/2017/4/TestCustomCacheableAuthenticationPlugin.java
|
c6c6a449abd738b9e8864301c8609638c934caff
|
[] |
no_license
|
rosoareslv/SED99
|
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
|
a062c118f12b93172e31e8ca115ce3f871b64461
|
refs/heads/main
| 2023-02-22T21:59:02.703005
| 2021-01-28T19:40:51
| 2021-01-28T19:40:51
| 306,497,459
| 1
| 1
| null | 2020-11-24T20:56:18
| 2020-10-23T01:18:07
| null |
UTF-8
|
Java
| false
| false
| 2,302
|
java
|
/*
* Copyright (c) 2002-2017 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.server.security.enterprise.auth.plugin;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;
import org.neo4j.server.security.enterprise.auth.plugin.api.AuthToken;
import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthenticationInfo;
import org.neo4j.server.security.enterprise.auth.plugin.spi.AuthenticationPlugin;
import org.neo4j.server.security.enterprise.auth.plugin.spi.CustomCacheableAuthenticationInfo;
public class TestCustomCacheableAuthenticationPlugin extends AuthenticationPlugin.CachingEnabledAdapter
{
@Override
public String name()
{
return getClass().getSimpleName();
}
@Override
public AuthenticationInfo authenticate( AuthToken authToken )
{
getAuthenticationInfoCallCount.incrementAndGet();
String principal = authToken.principal();
char[] credentials = authToken.credentials();
if ( principal.equals( "neo4j" ) && Arrays.equals( credentials, "neo4j".toCharArray() ) )
{
return CustomCacheableAuthenticationInfo.of( "neo4j",
( token ) ->
{
char[] tokenCredentials = token.credentials();
return Arrays.equals( tokenCredentials, "neo4j".toCharArray() );
} );
}
return null;
}
// For testing purposes
public static AtomicInteger getAuthenticationInfoCallCount = new AtomicInteger( 0 );
}
|
[
"rodrigosoaresilva@gmail.com"
] |
rodrigosoaresilva@gmail.com
|
7587ed70009aad8c06fc22c61a5393d2c493a734
|
fb9506d58c1dc3410a60308066cecc28fdcd360e
|
/OntologyUpdate/src/com/hp/hpl/jena/sparql/engine/optimizer/ExplainFormatter.java
|
bf838c69cdeaa76dea4359b0a98f9abd4a6a695f
|
[
"Apache-2.0",
"BSD-3-Clause"
] |
permissive
|
utalo/ontologyUpdate
|
37cab2bf8c89f5d2c29d1036169363a9c901969e
|
96b8bcd880930a9d19363d2a80eac65496663b1b
|
refs/heads/master
| 2020-06-14T04:03:28.902754
| 2019-07-02T16:45:53
| 2019-07-02T16:45:53
| 194,888,725
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,273
|
java
|
/*
* (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
* [See end of file]
*/
package com.hp.hpl.jena.sparql.engine.optimizer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.shared.PrefixMapping;
/**
* The class takes care of pretty formatting of the Optimizer explain method
*
* @author Markus Stocker
*/
public class ExplainFormatter
{
/**
* Print out a table including frame lines, header and rows
*
* @param out
* @param header
* @param rows
* @param left
* @param sep
*/
public static void printTable(StringBuffer out, String[] header, List rows, String left, String sep)
{
int[] colWidths = colWidths(header, rows) ;
printLine(out, colWidths, left, sep) ;
printHeader(out, header, colWidths, left, sep) ;
printLine(out, colWidths, left, sep) ;
for (Iterator iter = rows.iterator(); iter.hasNext(); )
{
List row = (List)iter.next() ;
StringBuffer bf = new StringBuffer(120) ;
bf.append(left) ;
for (int i = 0; i < row.size(); i++)
{
String s = (String)row.get(i) ;
bf.append(s) ;
for (int j = 0; j < colWidths[i] - s.length(); j++)
bf.append(' ') ;
bf.append(sep) ;
}
out.append(bf + "\n") ;
}
printLine(out, colWidths, left, sep) ;
}
/**
* Return a list with the formatted columns for a single row with joined triple patterns.
* The method takes care of formatting rows for the table which displays the estimated
* cost of joined triple patterns.
*
* @param prefix
* @param triple1
* @param triple2
* @param cost
* @return List
*/
public static List formatCols(PrefixMapping prefix, Triple triple1, Triple triple2, double cost)
{
List cols = new ArrayList() ;
String subject1 = formatNode(prefix, triple1.getSubject()) ;
String predicate1 = formatNode(prefix, triple1.getPredicate()) ;
String object1 = formatNode(prefix, triple1.getObject()) ;
String subject2 = formatNode(prefix, triple2.getSubject()) ;
String predicate2 = formatNode(prefix, triple2.getPredicate()) ;
String object2 = formatNode(prefix, triple2.getObject()) ;
cols.add(subject1 + " " + predicate1 + " " + object1) ;
cols.add(subject2 + " " + predicate2 + " " + object2) ;
cols.add(formatCost(cost)) ;
return cols ;
}
/**
* Return a list with the formatted columns for a single row with one triple pattern.
* The method takes care of formatting rows for the table which displays the estimated
* cost of single triple patterns.
*
* @param prefix
* @param triple
* @param cost
* @return List
*/
public static List formatCols(PrefixMapping prefix, Triple triple, double cost)
{
List cols = new ArrayList() ;
cols.add(formatNode(prefix, triple.getSubject())) ;
cols.add(formatNode(prefix, triple.getPredicate())) ;
cols.add(formatNode(prefix, triple.getObject())) ;
cols.add(formatCost(cost)) ;
return cols ;
}
/*
* Print the table header columns
*
* @param out
* @param header
* @param colWidths
* @param left
* @param sep
*/
private static void printHeader(StringBuffer out, String[] header, int[] colWidths, String left, String sep)
{
StringBuffer bf = new StringBuffer(120) ;
// Left mark
bf.append(left) ;
for (int i = 0; i < header.length; i++ )
{
String s = header[i] ;
bf.append(s) ;
for (int j = 0; j < colWidths[i] - s.length(); j++)
bf.append(' ') ;
bf.append(sep) ;
}
out.append(bf + "\n") ;
}
/*
* Print a horizontal frame line for the table
*
* @param out
* @param colWidths
* @param left
* @param sep
*/
private static void printLine(StringBuffer out, int[] colWidths, String left, String sep)
{
StringBuffer bf = new StringBuffer(120) ;
int tableLength = left.length() ;
for (int i = 0; i < colWidths.length; i++ )
tableLength += colWidths[i] + sep.length() ;
// -1 correction for the last sep of length 3, ' | '
for (int i = 0; i < tableLength - 1; i++)
bf.append('-') ;
out.append(bf + "\n") ;
}
/*
* Return an array which contains the width for each table column
*
* @param header
* @param rows
* @return int[]
*/
private static int[] colWidths(String[] header, List rows)
{
int[] colWidths = new int[header.length] ;
for (Iterator iter = rows.iterator(); iter.hasNext(); )
{
List row = (ArrayList)iter.next() ;
for (int i = 0; i < row.size(); i++ )
{
String s = (String)row.get(i) ;
if (s.length() > colWidths[i])
colWidths[i] = s.length() ;
}
}
return colWidths ;
}
/*
* Pretty print a node (with prefix mapping, ? and <URI>
*
* @param header
* @param rows
* @return int[]
*/
private static String formatNode(PrefixMapping prefixMapping, Node node)
{
if (node.isVariable())
return "?" + node.getName() ;
else if (node.isBlank())
return node.getBlankNodeLabel() ;
else if (node.isURI())
{
// If the node is a URI without a PREFIX (e.g. ?s rdf:type <http://myOntologyClass>) return the <URI>
String prefix = prefixMapping.getNsURIPrefix(node.getNameSpace()) ;
if (prefix == null)
return "<" + node.getURI() + ">" ;
return prefix + ":" + node.getLocalName() ;
}
else if (node.isLiteral())
return '"' + node.getLiteralLexicalForm() + '"';
return null ;
}
/*
* Format a double cost value as a string (returns NaN if the cost is > 1d)
*/
private static String formatCost(double cost)
{
if (cost <= 1d)
return new Double(cost).toString() ;
return "NaN" ;
}
}
/*
* (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
|
[
"uta.loesch@gmx.de"
] |
uta.loesch@gmx.de
|
cd20ff2033a9c6dfb60cfd8ab995b157eff4eb4b
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Lang/24/org/apache/commons/lang3/ClassUtils_toCanonicalName_887.java
|
b7e1a4499722525ee9bfea4c194fbc532502d9e2
|
[] |
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
| 1,986
|
java
|
org apach common lang3
oper class reflect
handl invalid code code input
method document behaviour detail
notion code canon code includ human
readabl type code code
canon method variant work jvm name
code code
author apach softwar foundat
author gari gregori
author norm dean
author alban peignier
author tomasz blachowicz
version
class util classutil
convert jl style
param classnam
convert
string canon tocanonicalnam string classnam
classnam string util stringutil delet whitespac deletewhitespac classnam
classnam
null pointer except nullpointerexcept classnam
classnam end endswith
string builder stringbuild buffer classnamebuff string builder stringbuild
classnam end endswith
classnam classnam substr classnam length
buffer classnamebuff append
string abbrevi abbrevi map abbreviationmap classnam
abbrevi
buffer classnamebuff append abbrevi
buffer classnamebuff append append classnam append
classnam buffer classnamebuff string tostr
classnam
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
f616f17f88fd767ea619193e5c52d5d6de116d5b
|
920b8d88fe46763b208ceac71ede8782cf962d8f
|
/common/src/main/java/org/gatein/common/net/media/TypeDef.java
|
3f63b00326bf1e042023ef24e37dc20ac704723e
|
[] |
no_license
|
licshire/gatein-common
|
50e7ee2d143e598069a1bbd686a2b91f6533e912
|
240055cc424542d1af925a059f9df6045263ecbc
|
refs/heads/master
| 2021-01-18T00:41:05.578219
| 2014-03-17T19:42:28
| 2014-03-17T19:42:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,723
|
java
|
/******************************************************************************
* JBoss, a division of Red Hat *
* Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
* *
* This is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation; either version 2.1 of *
* the License, or (at your option) any later version. *
* *
* This software is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this software; if not, write to the Free *
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
******************************************************************************/
package org.gatein.common.net.media;
/**
* A top level media type definition defined by <a href="http://tools.ietf.org/html/rfc2046#section-2">RFC2046 section 2</a>).
*
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
public final class TypeDef
{
// The five discrete top-level media types
/** . */
public static final TypeDef TEXT = new TypeDef("text", "", false);
/** . */
public static final TypeDef IMAGE = new TypeDef("image", "", false);
/** . */
public static final TypeDef AUDIO = new TypeDef("audio", "", false);
/** . */
public static final TypeDef VIDEO = new TypeDef("video", "", false);
/** . */
public static final TypeDef APPLICATION = new TypeDef("application", "", false);
// The two composite top-level media types
/** . */
public static final TypeDef MULTIPART = new TypeDef("multipart", "", true);
/** . */
public static final TypeDef MESSAGE = new TypeDef("message", "", true);
/**
* Returns the corresponding type definition for the given top level type name.
* If the type name does not correspond to a top level name, then null is returned.
*
* @param typeName the name of the type def
* @return the corresponding type def
* @throws IllegalArgumentException if the type name is null
*/
public static TypeDef create(String typeName) throws IllegalArgumentException
{
if (typeName == null)
{
throw new IllegalArgumentException("no null type name accepted");
}
if (TEXT.name.equalsIgnoreCase(typeName))
{
return TEXT;
}
if (APPLICATION.name.equalsIgnoreCase(typeName))
{
return APPLICATION;
}
if (MULTIPART.name.equalsIgnoreCase(typeName))
{
return MULTIPART;
}
if (IMAGE.name.equalsIgnoreCase(typeName))
{
return IMAGE;
}
if (AUDIO.name.equalsIgnoreCase(typeName))
{
return AUDIO;
}
if (VIDEO.name.equalsIgnoreCase(typeName))
{
return VIDEO;
}
if (MESSAGE.name.equalsIgnoreCase(typeName))
{
return MESSAGE;
}
return null;
}
/** . */
private final String name;
/** . */
private final String description;
/** . */
private final boolean composite;
/** . */
private final String toString;
private TypeDef(String name, String description, boolean composite)
{
this.name = name;
this.description = description;
this.composite = composite;
this.toString = "TypeDef[" + name + "]";
}
public String getName()
{
return name;
}
public String getDescription()
{
return description;
}
public boolean isComposite()
{
return composite;
}
public boolean isDiscrete()
{
return !composite;
}
public String toString()
{
return toString;
}
}
|
[
"metacosm@gmail.com"
] |
metacosm@gmail.com
|
3df5f724c5c46040b7d53ff256ecb760df15ca5b
|
b7777fea226fa48f30a89429d7d5c1057b0bd306
|
/src/main/java/uk/co/datadisk/demo/services/mapservices/ProductServiceImpl.java
|
a18d2ed3e2b80fa9aa1bca03204c2efdd637d312
|
[] |
no_license
|
datadiskpfv/spring-boot-remove
|
ce73fdf825d516da0c46630c06b79f2a795fcbc7
|
4dc75d07d35afa99d37e3a2b8e4901b72d5be577
|
refs/heads/master
| 2021-04-15T09:05:31.308163
| 2018-03-23T08:54:06
| 2018-03-23T08:54:06
| 126,346,268
| 4
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 860
|
java
|
package uk.co.datadisk.demo.services.mapservices;
import uk.co.datadisk.demo.domain.DomainObject;
import uk.co.datadisk.demo.domain.Product;
import uk.co.datadisk.demo.services.ProductService;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Profile("map")
public class ProductServiceImpl extends AbstractMapService implements ProductService {
@Override
public List<DomainObject> listAll() {
return super.listAll();
}
@Override
public Product getById(Integer id) {
return (Product) super.getById(id);
}
@Override
public Product saveOrUpdate(Product domainObject) {
return (Product) super.saveOrUpdate(domainObject);
}
@Override
public void delete(Integer id) {
super.delete(id);
}
}
|
[
"paul.valle@datadisk.co.uk"
] |
paul.valle@datadisk.co.uk
|
308f61e8a4890afe54d5e9b95b2ffef19210b1e2
|
de897e577c2bd95abbf98b143a2ec3d8cc5b9f80
|
/app/src/main/java/com/lwc/shanxiu/module/order/ui/IOrderListFragmentView.java
|
fe68bdb3a524e12c5f869abeb4521748bb9b88ab
|
[] |
no_license
|
popularcloud/SHANXIU06042120
|
6b4e02c1e4c1df2cf5ac9145992125f0cf930d80
|
60cb0a4512f36fb2933009f97b6ab332d7b370bb
|
refs/heads/master
| 2021-06-29T01:30:10.062909
| 2021-01-04T01:51:36
| 2021-01-04T01:51:36
| 199,803,391
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 434
|
java
|
package com.lwc.shanxiu.module.order.ui;
import com.lwc.shanxiu.module.bean.Order;
import java.util.List;
import cn.bingoogolapple.refreshlayout.BGARefreshLayout;
/**
* Created by 何栋 on 2017/3/9.
*/
public interface IOrderListFragmentView {
void notifyData(List<Order> myOrders);
void addData(List<Order> myOrders);
/**
* 获取刷新控件实例
*/
BGARefreshLayout getBGARefreshLayout();
}
|
[
"liushuzhiyt@163.com"
] |
liushuzhiyt@163.com
|
805775dc22dca638c6923c2ca939a9f88045fe4a
|
f9620c2b3df9a4293e7b32e1b974897f5bf68537
|
/tools/proguard5.3.2/src/proguard/classfile/visitor/MemberDescriptorReferencedClassVisitor.java
|
e505971bfc64a630d784f9614910aae185566b0a
|
[
"MIT",
"GPL-2.0-or-later",
"GPL-1.0-or-later"
] |
permissive
|
BrainiacRawkib/TheFatRat
|
cd3956b0809ee02b67acbd297d048e63bf4663e9
|
79b5da2fd1a1b4cda7dbad020c477e09f487ccb2
|
refs/heads/master
| 2023-03-16T14:59:50.870047
| 2017-03-22T07:06:16
| 2017-03-22T07:06:16
| 586,202,158
| 1
| 0
|
MIT
| 2023-01-07T09:56:12
| 2023-01-07T09:56:11
| null |
UTF-8
|
Java
| false
| false
| 2,302
|
java
|
/*
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
* Copyright (c) 2002-2016 Eric Lafortune @ GuardSquare
*
* 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.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package proguard.classfile.visitor;
import proguard.classfile.*;
import proguard.classfile.attribute.*;
import proguard.classfile.attribute.annotation.*;
import proguard.classfile.attribute.annotation.visitor.*;
import proguard.classfile.attribute.visitor.*;
import proguard.classfile.constant.*;
import proguard.classfile.constant.visitor.ConstantVisitor;
import proguard.classfile.util.SimplifiedVisitor;
/**
* This MemberVisitor lets a given ClassVisitor visit all the classes
* referenced by the descriptors of the class members that it visits.
*
* @author Eric Lafortune
*/
public class MemberDescriptorReferencedClassVisitor
extends SimplifiedVisitor
implements MemberVisitor
{
private final ClassVisitor classVisitor;
public MemberDescriptorReferencedClassVisitor(ClassVisitor classVisitor)
{
this.classVisitor = classVisitor;
}
// Implementations for MemberVisitor.
public void visitProgramMember(ProgramClass programClass, ProgramMember programMember)
{
// Let the visitor visit the classes referenced in the descriptor string.
programMember.referencedClassesAccept(classVisitor);
}
public void visitLibraryMember(LibraryClass programClass, LibraryMember libraryMember)
{
// Let the visitor visit the classes referenced in the descriptor string.
libraryMember.referencedClassesAccept(classVisitor);
}
}
|
[
"root@localhost.localdomain"
] |
root@localhost.localdomain
|
c977101da13b18e4c8e18b9221dd9a7c9ad7c6cd
|
39b7e86a2b5a61a1f7befb47653f63f72e9e4092
|
/src/main/java/com/alipay/api/response/AlipayCommerceCityfacilitatorVoucherBatchqueryResponse.java
|
cf2396c20ad07c1988b20e951c171f90091b0eab
|
[
"Apache-2.0"
] |
permissive
|
slin1972/alipay-sdk-java-all
|
dbec0604c2d0b76d8a1ebf3fd8b64d4dd5d21708
|
63095792e900bbcc0e974fc242d69231ec73689a
|
refs/heads/master
| 2020-08-12T14:18:07.203276
| 2019-10-13T09:00:11
| 2019-10-13T09:00:11
| 214,782,009
| 0
| 0
|
Apache-2.0
| 2019-10-13T07:56:34
| 2019-10-13T07:56:34
| null |
UTF-8
|
Java
| false
| false
| 899
|
java
|
package com.alipay.api.response;
import java.util.List;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
import com.alipay.api.domain.TicketDetailInfo;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.commerce.cityfacilitator.voucher.batchquery response.
*
* @author auto create
* @since 1.0, 2019-01-07 20:51:15
*/
public class AlipayCommerceCityfacilitatorVoucherBatchqueryResponse extends AlipayResponse {
private static final long serialVersionUID = 7736233323323272323L;
/**
* 查询到的订单信息列表
*/
@ApiListField("tickets")
@ApiField("ticket_detail_info")
private List<TicketDetailInfo> tickets;
public void setTickets(List<TicketDetailInfo> tickets) {
this.tickets = tickets;
}
public List<TicketDetailInfo> getTickets( ) {
return this.tickets;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
1fd7d4efb6335c19ae45e0714d42716db941be13
|
c7f5d40b36f4cee821e70460690d10b8d181b094
|
/src/main/java/org/openapitools/client/StringUtil.java
|
c5cc2488671544423b83522fadb606d2e25a5b33
|
[] |
no_license
|
wing328/test-java-okhttp
|
b98732eef7bc095a1326a57038fb567e28a6d95d
|
c40e6b074748a23c0cb7cafb9f98e42fcaf78184
|
refs/heads/master
| 2022-11-08T03:23:13.554456
| 2022-10-22T05:12:35
| 2022-10-22T05:12:35
| 61,017,396
| 0
| 0
| null | 2022-05-20T20:44:53
| 2016-06-13T07:47:28
|
Java
|
UTF-8
|
Java
| false
| false
| 2,228
|
java
|
/*
* Twitter API v2
* Twitter API v2 available endpoints
*
* The version of the OpenAPI document: 2.54
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client;
import java.util.Collection;
import java.util.Iterator;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) {
return true;
}
if (value != null && value.equalsIgnoreCase(str)) {
return true;
}
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) {
return "";
}
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
/**
* Join a list of strings with the given separator.
*
* @param list The list of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(Collection<String> list, String separator) {
Iterator<String> iterator = list.iterator();
StringBuilder out = new StringBuilder();
if (iterator.hasNext()) {
out.append(iterator.next());
}
while (iterator.hasNext()) {
out.append(separator).append(iterator.next());
}
return out.toString();
}
}
|
[
"wing328hk@gmail.com"
] |
wing328hk@gmail.com
|
3d6f71027dbc1a3f4f1d714193ff40b27c72691c
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/12/12_f848507989f26daa51dc7591320778c4c82530e2/WildcardArgument/12_f848507989f26daa51dc7591320778c4c82530e2_WildcardArgument_s.java
|
ec3452a92d5aaf9937e4cade567f49f5b4bbb732
|
[] |
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
| 1,629
|
java
|
package se.ranzdo.bukkit.methodcommand;
import java.lang.reflect.Array;
import org.bukkit.command.CommandSender;
public class WildcardArgument extends CommandArgument {
private boolean join;
public WildcardArgument(Arg commandArgAnnotation, Class<?> argumentClass, ArgumentHandler<?> argumentHandler, boolean join) {
super(commandArgAnnotation, argumentClass, argumentHandler);
this.join = join;
}
public WildcardArgument(String name, String description, String def, String verifiers, Class<?> argumentClass, ArgumentHandler<?> handler, boolean join) {
super(name, description, def, verifiers, argumentClass, handler);
this.join = join;
}
@Override
public Object execute(CommandSender sender, Arguments args) throws CommandError {
if(!args.hasNext()) {
Object o = getHandler().handle(sender, this, getDefault().equals(" ") ? "" : getDefault());
if(join)
return o;
else {
Object array = Array.newInstance(getArgumentClass(), 1);
Array.set(array, 0, o);
return array;
}
}
if(join) {
StringBuilder sb = new StringBuilder();
while(args.hasNext())
sb.append(" "+args.nextArgument());
return getHandler().handle(sender, this, CommandUtil.escapeArgumentVariable(sb.toString()));
}
else {
Object array = Array.newInstance(getArgumentClass(), args.over());
for(int i = 0; i < args.over();i++)
Array.set(array, i, getHandler().handle(sender, this, CommandUtil.escapeArgumentVariable(args.nextArgument())));
return array;
}
}
public boolean willJoin() {
return join;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
f3b71f5014438567e93af5f971f2f33ebf14107c
|
a95287baa7d02d12553ad03c3c789091df2a7156
|
/src/main/java/fr/sully/boot/config/LoggingConfiguration.java
|
e255ddb450435a78238aa148988bae851c3a67aa
|
[] |
no_license
|
gaelgubian/ContratsProjets
|
f882baf2391b62dea9e51778367ae56cf211f83d
|
658186a4c9711dc0281a61da7a3ca40e01a1b21e
|
refs/heads/master
| 2020-03-13T15:44:56.622227
| 2018-05-14T16:39:38
| 2018-05-14T16:39:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,573
|
java
|
package fr.sully.boot.config;
import java.net.InetSocketAddress;
import java.util.Iterator;
import io.github.jhipster.config.JHipsterProperties;
import ch.qos.logback.classic.AsyncAppender;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.boolex.OnMarkerEvaluator;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.LoggerContextListener;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.filter.EvaluatorFilter;
import ch.qos.logback.core.spi.ContextAwareBase;
import ch.qos.logback.core.spi.FilterReply;
import net.logstash.logback.appender.LogstashTcpSocketAppender;
import net.logstash.logback.encoder.LogstashEncoder;
import net.logstash.logback.stacktrace.ShortenedThrowableConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
public class LoggingConfiguration {
private static final String LOGSTASH_APPENDER_NAME = "LOGSTASH";
private static final String ASYNC_LOGSTASH_APPENDER_NAME = "ASYNC_LOGSTASH";
private final Logger log = LoggerFactory.getLogger(LoggingConfiguration.class);
private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
private final String appName;
private final String serverPort;
private final JHipsterProperties jHipsterProperties;
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort,
JHipsterProperties jHipsterProperties) {
this.appName = appName;
this.serverPort = serverPort;
this.jHipsterProperties = jHipsterProperties;
if (jHipsterProperties.getLogging().getLogstash().isEnabled()) {
addLogstashAppender(context);
addContextListener(context);
}
if (jHipsterProperties.getMetrics().getLogs().isEnabled()) {
setMetricsMarkerLogbackFilter(context);
}
}
private void addContextListener(LoggerContext context) {
LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener();
loggerContextListener.setContext(context);
context.addListener(loggerContextListener);
}
private void addLogstashAppender(LoggerContext context) {
log.info("Initializing Logstash logging");
LogstashTcpSocketAppender logstashAppender = new LogstashTcpSocketAppender();
logstashAppender.setName(LOGSTASH_APPENDER_NAME);
logstashAppender.setContext(context);
String customFields = "{\"app_name\":\"" + appName + "\",\"app_port\":\"" + serverPort + "\"}";
// More documentation is available at: https://github.com/logstash/logstash-logback-encoder
LogstashEncoder logstashEncoder=new LogstashEncoder();
// Set the Logstash appender config from JHipster properties
logstashEncoder.setCustomFields(customFields);
// Set the Logstash appender config from JHipster properties
logstashAppender.addDestinations(new InetSocketAddress(jHipsterProperties.getLogging().getLogstash().getHost(),jHipsterProperties.getLogging().getLogstash().getPort()));
ShortenedThrowableConverter throwableConverter = new ShortenedThrowableConverter();
throwableConverter.setRootCauseFirst(true);
logstashEncoder.setThrowableConverter(throwableConverter);
logstashEncoder.setCustomFields(customFields);
logstashAppender.setEncoder(logstashEncoder);
logstashAppender.start();
// Wrap the appender in an Async appender for performance
AsyncAppender asyncLogstashAppender = new AsyncAppender();
asyncLogstashAppender.setContext(context);
asyncLogstashAppender.setName(ASYNC_LOGSTASH_APPENDER_NAME);
asyncLogstashAppender.setQueueSize(jHipsterProperties.getLogging().getLogstash().getQueueSize());
asyncLogstashAppender.addAppender(logstashAppender);
asyncLogstashAppender.start();
context.getLogger("ROOT").addAppender(asyncLogstashAppender);
}
// Configure a log filter to remove "metrics" logs from all appenders except the "LOGSTASH" appender
private void setMetricsMarkerLogbackFilter(LoggerContext context) {
log.info("Filtering metrics logs from all appenders except the {} appender", LOGSTASH_APPENDER_NAME);
OnMarkerEvaluator onMarkerMetricsEvaluator = new OnMarkerEvaluator();
onMarkerMetricsEvaluator.setContext(context);
onMarkerMetricsEvaluator.addMarker("metrics");
onMarkerMetricsEvaluator.start();
EvaluatorFilter<ILoggingEvent> metricsFilter = new EvaluatorFilter<>();
metricsFilter.setContext(context);
metricsFilter.setEvaluator(onMarkerMetricsEvaluator);
metricsFilter.setOnMatch(FilterReply.DENY);
metricsFilter.start();
for (ch.qos.logback.classic.Logger logger : context.getLoggerList()) {
for (Iterator<Appender<ILoggingEvent>> it = logger.iteratorForAppenders(); it.hasNext();) {
Appender<ILoggingEvent> appender = it.next();
if (!appender.getName().equals(ASYNC_LOGSTASH_APPENDER_NAME)) {
log.debug("Filter metrics logs from the {} appender", appender.getName());
appender.setContext(context);
appender.addFilter(metricsFilter);
appender.start();
}
}
}
}
/**
* Logback configuration is achieved by configuration file and API.
* When configuration file change is detected, the configuration is reset.
* This listener ensures that the programmatic configuration is also re-applied after reset.
*/
class LogbackLoggerContextListener extends ContextAwareBase implements LoggerContextListener {
@Override
public boolean isResetResistant() {
return true;
}
@Override
public void onStart(LoggerContext context) {
addLogstashAppender(context);
}
@Override
public void onReset(LoggerContext context) {
addLogstashAppender(context);
}
@Override
public void onStop(LoggerContext context) {
// Nothing to do.
}
@Override
public void onLevelChange(ch.qos.logback.classic.Logger logger, Level level) {
// Nothing to do.
}
}
}
|
[
"jhipster-bot@users.noreply.github.com"
] |
jhipster-bot@users.noreply.github.com
|
1d833975898b4ae0e4d4a747cb650321cdff85d5
|
41ee91745dcc8b718d6aae5ea36b4984ddb51291
|
/backend/src/main/java/com/pierredev/catalog/resource/UserResource.java
|
66b4f8c381b553395afe0d072d8f037ffc6546fe
|
[] |
no_license
|
pierreEnoc/dscatalog-with-test
|
25c49795a185500753886bc7028b7927e8e29453
|
64b8751655dbd8fdffec2d9759e8032f669518b5
|
refs/heads/main
| 2023-04-23T00:03:39.312024
| 2021-05-13T15:27:07
| 2021-05-13T15:27:07
| 367,084,162
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,788
|
java
|
package com.pierredev.catalog.resource;
import java.net.URI;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import com.pierredev.catalog.dto.UserDTO;
import com.pierredev.catalog.dto.UserInsertDTO;
import com.pierredev.catalog.dto.UserUpdateDTO;
import com.pierredev.catalog.services.UserService;
@RestController
@RequestMapping(value="/users")
public class UserResource {
@Autowired
private UserService userServise;
@GetMapping
public ResponseEntity<Page<UserDTO>> findAll(
@RequestParam(value = "page", defaultValue = "0") Integer page,
@RequestParam(value = "linesPerPage", defaultValue = "12") Integer linesPerPage,
@RequestParam(value = "orderBy", defaultValue = "firstName") String orderBy,
@RequestParam(value = "direction", defaultValue = "ASC") String direction
){
PageRequest pageRequest = PageRequest.of(page, linesPerPage, Direction.valueOf(direction),orderBy);
Page<UserDTO> list = userServise.findAllPaged(pageRequest);
return ResponseEntity.ok().body(list);
}
@GetMapping(value = "/{id}")
public ResponseEntity<UserDTO> findById(@PathVariable Long id) {
UserDTO dto = userServise.findById(id);
return ResponseEntity.ok().body(dto);
}
@PostMapping
public ResponseEntity<UserDTO> insert(@Valid @RequestBody UserInsertDTO dto) {
UserDTO newDto = userServise.insert(dto);
URI uri = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}")
.buildAndExpand(newDto.getId()).toUri();
return ResponseEntity.created(uri).body(newDto);
}
@PutMapping(value = "/{id}")
public ResponseEntity<UserDTO>update( @PathVariable Long id, @Valid @RequestBody UserUpdateDTO dto){
UserDTO newdto = userServise.update(id, dto);
return ResponseEntity.ok().body(newdto);
}
@DeleteMapping(value = "/{id}")
public ResponseEntity<UserDTO>delete(@PathVariable Long id) {
userServise.delete(id);
return ResponseEntity.noContent().build();
}
}
|
[
"pierre.enoc@gympass.com"
] |
pierre.enoc@gympass.com
|
3bf805fee8b820d709c7835c96ed3549ad042918
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XWIKI-13544-75-29-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/container/servlet/filters/internal/SetHTTPHeaderFilter_ESTest_scaffolding.java
|
51c5dd9ea52674e3bea12e7ee7aa17b263429c9b
|
[] |
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
| 468
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sun Jan 19 09:33:07 UTC 2020
*/
package org.xwiki.container.servlet.filters.internal;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class SetHTTPHeaderFilter_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
0fab705062026cf3a3d8357ef3d33568e5ab5d91
|
4feea080239894c29ed2b7b03c8a7a60a6533ed2
|
/app/src/main/java/com/transitclone/BaseActivity.java
|
a910db3ec8fb6691d3a8937d2387d2f71ee983ed
|
[] |
no_license
|
Dharamveer-Rajput/TransitClone
|
47661d62b5a814ba16a1cac196e2c94420348803
|
6883edf1ff37db8ad7bdec4def18c34b06082eb0
|
refs/heads/master
| 2020-03-08T02:41:30.090314
| 2018-04-03T07:21:38
| 2018-04-03T07:21:38
| 127,867,711
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,640
|
java
|
package com.transitclone;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import com.transitclone.di.modules.SharedPrefsHelper;
import com.transitclone.manager.ApiService;
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
/**
* Created by rajsm on 01/04/2018.
*/
public class BaseActivity extends AppCompatActivity {
@Nullable
@BindView(R.id.toolbar)
Toolbar toolbar;
@Inject
ApiService apiService;
@Inject
SharedPrefsHelper sharedPrefsHelper;
protected Unbinder unbinder;
protected ProgressDialog pDialog;
protected AlertDialog alertDialog;
public void showProgressDialog(String messageToShow) {
pDialog = new ProgressDialog(this);
pDialog.setMessage(messageToShow + "...");
pDialog.setCancelable(false);
pDialog.setCanceledOnTouchOutside(true);
}
@Override
public void setContentView(int layoutRedID) {
super.setContentView(layoutRedID);
((AppController) getApplication()).getComponent().inject(this);
unbinder = ButterKnife.bind(this);
}
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return super.onSupportNavigateUp();
}
protected void showAlertDialog() {
AlertDialog.Builder alertDialogBuilder;
alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setCancelable(true);
alertDialogBuilder.setPositiveButton(
"Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
alertDialog = alertDialogBuilder.create();
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
((AppController) getApplication()).getComponent().inject(this);
super.onCreate(savedInstanceState);
}
@Override
protected void onDestroy() {
super.onDestroy();
if (unbinder != null) {
unbinder.unbind();
}
}
}
|
[
"dharamveer.smartitventures@gmail.com"
] |
dharamveer.smartitventures@gmail.com
|
0b9afa004e15215478c29fe8177b5bcd8904d29f
|
57ec97caae6a381196ded23caa48bf3197eee0dd
|
/happylifeplat-transaction-common/src/main/java/com/happylifeplat/transaction/common/holder/LogUtil.java
|
1d980f6c583ed8f17dabbe92062d1e7882e46e46
|
[
"Apache-2.0"
] |
permissive
|
JackCaptain1015/HappyLifePlafTransactionStudy
|
7c1edad272402ce430f8d96d3a56b38b97b59bff
|
d0efb0037566e60d685ff524a7b62c9768418faf
|
refs/heads/master
| 2021-05-05T21:23:23.638814
| 2017-12-28T02:14:29
| 2017-12-28T02:14:29
| 115,574,925
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,708
|
java
|
/*
*
* Copyright 2017-2018 549477611@qq.com(xiaoyu)
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* 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 Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, see <http://www.gnu.org/licenses/>.
*
*/
package com.happylifeplat.transaction.common.holder;
import org.slf4j.Logger;
import java.util.Objects;
import java.util.function.Supplier;
/**
* @author xiaoyu
*/
public class LogUtil {
public static final LogUtil LOG_UTIL = new LogUtil();
private LogUtil(){
}
public static LogUtil getInstance() {
return LOG_UTIL;
}
/**
* debug 打印日志
* @param logger 日志
* @param format 日志信息
* @param supplier supplier接口
*/
public static void debug(Logger logger ,String format,Supplier<Object> supplier){
if(logger.isDebugEnabled()){
logger.debug(format,supplier.get());
}
}
public static void debug(Logger logger ,Supplier<Object> supplier){
if(logger.isDebugEnabled()){
logger.debug(Objects.toString(supplier.get()));
}
}
public static void info(Logger logger,String format,Supplier<Object> supplier){
if(logger.isInfoEnabled()){
logger.info(format,supplier.get());
}
}
public static void info(Logger logger,Supplier<Object> supplier){
if(logger.isInfoEnabled()){
logger.info(Objects.toString(supplier.get()));
}
}
public static void error(Logger logger,String format,Supplier<Object> supplier){
if(logger.isErrorEnabled()){
logger.error(format,supplier.get());
}
}
public static void error(Logger logger,Supplier<Object> supplier){
if(logger.isErrorEnabled()){
logger.error(Objects.toString(supplier.get()));
}
}
public static void warn(Logger logger,String format,Supplier<Object> supplier){
if(logger.isWarnEnabled()){
logger.warn(format,supplier.get());
}
}
public static void warn(Logger logger,Supplier<Object> supplier){
if(logger.isWarnEnabled()){
logger.warn(Objects.toString(supplier.get()));
}
}
}
|
[
"yu.xiao@happylifeplat.com"
] |
yu.xiao@happylifeplat.com
|
a8585f5d18f5b871c9428e1a8c673cde574395c2
|
69ee0508bf15821ea7ad5139977a237d29774101
|
/cmis-core/src/main/java/vmware/vim25/ArrayOfVmPortGroupProfile.java
|
e49943e815e660225b10bc42876da18469407d92
|
[] |
no_license
|
bhoflack/cmis
|
b15bac01a30ee1d807397c9b781129786eba4ffa
|
09e852120743d3d021ec728fac28510841d5e248
|
refs/heads/master
| 2021-01-01T05:32:17.872620
| 2014-11-17T15:00:47
| 2014-11-17T15:00:47
| 8,852,575
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,032
|
java
|
package vmware.vim25;
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 ArrayOfVmPortGroupProfile complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ArrayOfVmPortGroupProfile">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="VmPortGroupProfile" type="{urn:vim25}VmPortGroupProfile" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfVmPortGroupProfile", propOrder = {
"vmPortGroupProfile"
})
public class ArrayOfVmPortGroupProfile {
@XmlElement(name = "VmPortGroupProfile")
protected List<VmPortGroupProfile> vmPortGroupProfile;
/**
* Gets the value of the vmPortGroupProfile 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 vmPortGroupProfile property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getVmPortGroupProfile().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link VmPortGroupProfile }
*
*
*/
public List<VmPortGroupProfile> getVmPortGroupProfile() {
if (vmPortGroupProfile == null) {
vmPortGroupProfile = new ArrayList<VmPortGroupProfile>();
}
return this.vmPortGroupProfile;
}
}
|
[
"brh@melexis.com"
] |
brh@melexis.com
|
54b865e2cbf240150fb9db45a077e3b5d2094fe7
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/24/24_7cf63a0ce18b958933167030c7c52fdcdf2840ce/Unit/24_7cf63a0ce18b958933167030c7c52fdcdf2840ce_Unit_t.java
|
a0c863ef6ead12605f1f66e0eeb8a47a8d123888
|
[] |
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
| 600
|
java
|
package com.cdm.view.elements;
import com.cdm.view.IRenderer;
import com.cdm.view.Position;
public abstract class Unit implements Element {
public enum UnitType {
CANNON, ROCKET_THROWER, STUNNER, PHAZER, ROCKET
};
Position pos;
float size;
public Unit(Position p) {
pos = p;
size = 1.0f;
}
public abstract void move(float time);
public abstract void draw(IRenderer renderer);
@Override
public void setPosition(Position p) {
pos = p;
}
public Position getPosition() {
return pos;
}
public void setSize(float f) {
size = f;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
ed4d2e82c60d4374ad55c0ed2520db97484de515
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/31/31_8a91e87cbeb1c15869cc479ddc9a0961f707dffa/PersonSpouseRelationshipsRSDefinition/31_8a91e87cbeb1c15869cc479ddc9a0961f707dffa_PersonSpouseRelationshipsRSDefinition_s.java
|
ddac89787f4c8c684a91f6bcf37497ef115da596
|
[] |
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
| 2,219
|
java
|
/**
* Copyright Intellectual Reserve, 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 org.gedcomx.rs;
import org.gedcomx.Gedcomx;
import org.gedcomx.rt.rs.ResourceDefinition;
import org.gedcomx.rt.rs.ResponseCode;
import org.gedcomx.rt.rs.StateTransition;
import org.gedcomx.rt.rs.StatusCodes;
import javax.ws.rs.GET;
import javax.ws.rs.core.Response;
/**
* <p>The person spouse relationships resource defines a list of relationships to spouses of a person. The person spouse relationships
* resource is to be considered an embedded resource, any links to this resource are to be treated as embedded links. This means
* that some implementations MAY choose to bind this interface to the containing person.</p>
*/
@ResourceDefinition (
name = "Person Spouse Relationships",
id = PersonSpouseRelationshipsRSDefinition.REL,
description = "A set of relationships to spouses of a person.",
resourceElement = Gedcomx.class,
transitions = {
@StateTransition( rel = PersonRSDefinition.REL, description = "The person.", targetResource = PersonRSDefinition.class )
}
)
public interface PersonSpouseRelationshipsRSDefinition {
public static final String REL = Rel.SPOUSE_RELATIONSHIPS;
/**
* Read the set of spouse relationships for a specific person.
*
* @return The set of spouse relationships.
*/
@GET
@StatusCodes({
@ResponseCode ( code = 200, condition = "Upon a successful read."),
@ResponseCode ( code = 204, condition = "Upon a successful read and no relationships exist."),
@ResponseCode ( code = 404, condition = "If the requested resource is not found.")
})
Response get();
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
73dabe26821e5fdb0cc7d4cb68ee0bee91330bb8
|
e49bffe6fb1b90ae06cfd4b4395bfef6ae97ef93
|
/springboots/08-mssc-state-machine/src/main/java/com/elearning/msscstatemachine/actions/AuthApproveAction.java
|
f35f03872cb8ed9f63deb19224775df0636555cf
|
[] |
no_license
|
mkejeiri/Toolbox
|
ca86901149179eb54d2a66df18c36dfb737bc018
|
a64fcf71243fedf8ad73521a827f114d912b3040
|
refs/heads/master
| 2023-04-09T22:41:25.131280
| 2021-04-06T12:49:01
| 2021-04-06T12:49:01
| 297,075,481
| 0
| 1
| null | 2021-01-01T18:18:35
| 2020-09-20T12:51:41
|
Java
|
UTF-8
|
Java
| false
| false
| 757
|
java
|
package com.elearning.msscstatemachine.actions;
import com.elearning.msscstatemachine.domain.PaymentEvent;
import com.elearning.msscstatemachine.domain.PaymentState;
import lombok.extern.slf4j.Slf4j;
import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.action.Action;
import org.springframework.stereotype.Component;
@Component
@Slf4j
//Action run after a message is received by a state machine
//In general it could call a more complex business logic, database, or a web server
public class AuthApproveAction implements Action<PaymentState, PaymentEvent> {
@Override
public void execute(StateContext<PaymentState, PaymentEvent> context) {
log.debug("AuthApproveAction has been called!");
}
}
|
[
"kejeiri@gmail.com"
] |
kejeiri@gmail.com
|
0317d6495fb40bbee2809caae567aa6ab90fb773
|
2150eb71a131f9dc0b55fc8cc7f05819ca61bc2a
|
/src/main/java/com/manhui/gsl/jbqgsl/service/web/activity/IActivityInfoService.java
|
6e1255b424ed22d61ec367a8473aba48ed7d446b
|
[] |
no_license
|
juexingzero/qgsl1
|
20c73d85a50d906d8260b9144cb26c0205e3fe0f
|
a01313f0babb3102afa5d47e415587f9c03fc874
|
refs/heads/master
| 2020-04-08T21:32:54.027201
| 2018-11-30T01:16:42
| 2018-11-30T01:20:55
| 159,748,468
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,172
|
java
|
package com.manhui.gsl.jbqgsl.service.web.activity;
import java.util.List;
import java.util.Map;
import com.manhui.gsl.jbqgsl.model.TopicEvaluate;
import com.manhui.gsl.jbqgsl.model.activitymanager.ActivityInfo;
/**
* @类名称 IActivityInfoService.java
* @类描述 活动管理
* @作者 kevin kwmo1005@163.com
* @创建时间 2018年10月17日 下午17:33:15
* @版本 1.00
*
* @修改记录
*
* <pre>
* 版本 修改人 修改日期 修改内容描述
* ----------------------------------------------
* 1.00 kevin 2018年10月17日 创建
* ----------------------------------------------
* </pre>
*/
public interface IActivityInfoService {
List<ActivityInfo> getActivityInfoList(String activity_theme,List<String> activity_stateList,Integer pageIndex, Integer pageSize);
Integer queryActivityInfoTotal(String activity_theme,List<String> activity_stateList,Integer pageIndex, Integer pageSize);
Integer updateActivityInfo(ActivityInfo ai);
Integer addActivityInfo(ActivityInfo ai);
ActivityInfo queryActivityInfo(ActivityInfo ai);
Integer queryActivityInfoNum(ActivityInfo ai);
}
|
[
"610761341@qq.com"
] |
610761341@qq.com
|
faf7c6a2cbf67d2e736a665594112e73f3d8d3d8
|
e44759c6e645b4d024e652ab050e7ed7df74eba3
|
/src/org/ace/insurance/system/common/religion/persistence/ReligionDAO.java
|
a442f312cf9705b1de8ffdede56c349d73095f33
|
[] |
no_license
|
LifeTeam-TAT/MI-Core
|
5f779870b1328c23b192668308ee25c532ab6280
|
8c5c4466da13c7a8bc61df12a804f840417e2513
|
refs/heads/master
| 2023-04-04T13:36:11.616392
| 2021-04-02T14:43:34
| 2021-04-02T14:43:34
| 354,033,545
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,092
|
java
|
/***************************************************************************************
* @author <<Your Name>>
* @Date 2013-02-11
* @Version 1.0
* @Purpose <<You have to write the comment the main purpose of this class>>
*
*
***************************************************************************************/
package org.ace.insurance.system.common.religion.persistence;
import java.util.List;
import javax.persistence.PersistenceException;
import javax.persistence.Query;
import org.ace.insurance.system.common.religion.Religion;
import org.ace.insurance.system.common.religion.persistence.interfaces.IReligionDAO;
import org.ace.java.component.persistence.BasicDAO;
import org.ace.java.component.persistence.exception.DAOException;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Repository("ReligionDAO")
public class ReligionDAO extends BasicDAO implements IReligionDAO {
@Transactional(propagation = Propagation.REQUIRED)
public void insert(Religion religion) throws DAOException {
try {
em.persist(religion);
em.flush();
} catch (PersistenceException pe) {
throw translate("Failed to insert Religion", pe);
}
}
@Transactional(propagation = Propagation.REQUIRED)
public void update(Religion religion) throws DAOException {
try {
em.merge(religion);
em.flush();
} catch (PersistenceException pe) {
throw translate("Failed to update Religion", pe);
}
}
@Transactional(propagation = Propagation.REQUIRED)
public void delete(Religion religion) throws DAOException {
try {
religion = em.merge(religion);
em.remove(religion);
em.flush();
} catch (PersistenceException pe) {
throw translate("Failed to update Religion", pe);
}
}
@Transactional(propagation = Propagation.REQUIRED)
public Religion findById(String id) throws DAOException {
Religion result = null;
try {
result = em.find(Religion.class, id);
em.flush();
} catch (PersistenceException pe) {
throw translate("Failed to find Religion", pe);
}
return result;
}
@Transactional(propagation = Propagation.REQUIRED)
public List<Religion> findAll() throws DAOException {
List<Religion> result = null;
try {
Query q = em.createNamedQuery("Religion.findAll");
result = q.getResultList();
em.flush();
} catch (PersistenceException pe) {
throw translate("Failed to find all of Religion", pe);
}
return result;
}
@Transactional(propagation = Propagation.REQUIRED)
public List<Religion> findByCriteria(String criteria) throws DAOException {
List<Religion> result = null;
try {
// Query q = em.createNamedQuery("Religion.findByCriteria");
Query q = em.createQuery("Select t from Religion t where t.name Like '" + criteria + "%'");
// q.setParameter("criteriaValue", "%" + criteria + "%");
result = q.getResultList();
em.flush();
} catch (PersistenceException pe) {
throw translate("Failed to find by criteria of Religion.", pe);
}
return result;
}
}
|
[
"lifeteam.tat@gmail.com"
] |
lifeteam.tat@gmail.com
|
a7c4ba243d68f357072f2e722adef9a34a344b77
|
19ba8f487f1bc8965b6155469acae4d5059c77c5
|
/src/mx/tiendas3b/tdexpress/entities/ServicioRegistro.java
|
a88c2595534ff57e38d022d2353445eccb85442d
|
[] |
no_license
|
opelayoa/tdexpress
|
a7c8460159786b3a7ee2f40912788fd62c17cb07
|
d917858db7dcbce94d42c7e2d940af80c72ea11f
|
refs/heads/master
| 2020-04-26T14:31:52.936070
| 2019-06-10T02:11:55
| 2019-06-10T02:11:55
| 173,617,629
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,242
|
java
|
package mx.tiendas3b.tdexpress.entities;
// Generated 6/03/2019 08:16:53 AM by Hibernate Tools 4.3.5.Final
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* ServicioRegistro generated by hbm2java
*/
@Entity
@Table(name = "servicio_registro", catalog = "itaid")
public class ServicioRegistro implements java.io.Serializable {
private Integer id;
private Integer ticketId;
private String nombre;
private int region;
private String puesto;
private String area;
private String tipoServicio;
private int usuarioup;
private Date fechaup;
private int usuariocharge;
private Date fechacharge;
private int usuariovobo;
private Date fechavobo;
private String observaciones;
private byte status;
public ServicioRegistro() {
}
public ServicioRegistro(String nombre, int region, String puesto, String area, String tipoServicio, int usuarioup,
Date fechaup, int usuariocharge, Date fechacharge, int usuariovobo, Date fechavobo, String observaciones,
byte status) {
this.nombre = nombre;
this.region = region;
this.puesto = puesto;
this.area = area;
this.tipoServicio = tipoServicio;
this.usuarioup = usuarioup;
this.fechaup = fechaup;
this.usuariocharge = usuariocharge;
this.fechacharge = fechacharge;
this.usuariovobo = usuariovobo;
this.fechavobo = fechavobo;
this.observaciones = observaciones;
this.status = status;
}
public ServicioRegistro(Integer ticketId, String nombre, int region, String puesto, String area,
String tipoServicio, int usuarioup, Date fechaup, int usuariocharge, Date fechacharge, int usuariovobo,
Date fechavobo, String observaciones, byte status) {
this.ticketId = ticketId;
this.nombre = nombre;
this.region = region;
this.puesto = puesto;
this.area = area;
this.tipoServicio = tipoServicio;
this.usuarioup = usuarioup;
this.fechaup = fechaup;
this.usuariocharge = usuariocharge;
this.fechacharge = fechacharge;
this.usuariovobo = usuariovobo;
this.fechavobo = fechavobo;
this.observaciones = observaciones;
this.status = status;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name = "ticket_id")
public Integer getTicketId() {
return this.ticketId;
}
public void setTicketId(Integer ticketId) {
this.ticketId = ticketId;
}
@Column(name = "nombre", nullable = false, length = 65535)
public String getNombre() {
return this.nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
@Column(name = "region", nullable = false)
public int getRegion() {
return this.region;
}
public void setRegion(int region) {
this.region = region;
}
@Column(name = "puesto", nullable = false)
public String getPuesto() {
return this.puesto;
}
public void setPuesto(String puesto) {
this.puesto = puesto;
}
@Column(name = "area", nullable = false)
public String getArea() {
return this.area;
}
public void setArea(String area) {
this.area = area;
}
@Column(name = "tipo_servicio", nullable = false)
public String getTipoServicio() {
return this.tipoServicio;
}
public void setTipoServicio(String tipoServicio) {
this.tipoServicio = tipoServicio;
}
@Column(name = "usuarioup", nullable = false)
public int getUsuarioup() {
return this.usuarioup;
}
public void setUsuarioup(int usuarioup) {
this.usuarioup = usuarioup;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "fechaup", nullable = false, length = 19)
public Date getFechaup() {
return this.fechaup;
}
public void setFechaup(Date fechaup) {
this.fechaup = fechaup;
}
@Column(name = "usuariocharge", nullable = false)
public int getUsuariocharge() {
return this.usuariocharge;
}
public void setUsuariocharge(int usuariocharge) {
this.usuariocharge = usuariocharge;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "fechacharge", nullable = false, length = 19)
public Date getFechacharge() {
return this.fechacharge;
}
public void setFechacharge(Date fechacharge) {
this.fechacharge = fechacharge;
}
@Column(name = "usuariovobo", nullable = false)
public int getUsuariovobo() {
return this.usuariovobo;
}
public void setUsuariovobo(int usuariovobo) {
this.usuariovobo = usuariovobo;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "fechavobo", nullable = false, length = 19)
public Date getFechavobo() {
return this.fechavobo;
}
public void setFechavobo(Date fechavobo) {
this.fechavobo = fechavobo;
}
@Column(name = "observaciones", nullable = false, length = 65535)
public String getObservaciones() {
return this.observaciones;
}
public void setObservaciones(String observaciones) {
this.observaciones = observaciones;
}
@Column(name = "status", nullable = false)
public byte getStatus() {
return this.status;
}
public void setStatus(byte status) {
this.status = status;
}
}
|
[
"od.pelayo@gmail.com"
] |
od.pelayo@gmail.com
|
049b72332d8cbc2054ee02fb9719b748628ebf53
|
aeada48fb548995312d2117f2a97b05242348abf
|
/bundles/com.zeligsoft.domain.omg.dds.api/api-gen/com/zeligsoft/domain/omg/dds/api/DCPS/impl/DomainZImpl.java
|
1d702045670cb45bba1071bf1e034fa48efdf464
|
[
"Apache-2.0"
] |
permissive
|
elder4p/CX4CBDDS
|
8f103d5375595f583ceb30b343ae4c7cc240f18b
|
11296d3076c6d667ad86bc83fa47f708e8b5bf01
|
refs/heads/master
| 2023-03-16T01:51:59.122707
| 2022-08-04T22:13:10
| 2022-08-04T22:13:10
| 198,875,329
| 0
| 0
|
Apache-2.0
| 2019-08-22T17:33:21
| 2019-07-25T17:33:51
|
Java
|
UTF-8
|
Java
| false
| false
| 7,085
|
java
|
package com.zeligsoft.domain.omg.dds.api.DCPS.impl;
import com.zeligsoft.base.zdl.staticapi.util.ZDLFactoryRegistry;
import com.zeligsoft.domain.omg.dds.api.DCPS.Domain;
import com.zeligsoft.domain.omg.dds.api.Core.impl.NamedEntityZImpl;
import com.zeligsoft.domain.omg.dds.api.DCPS.DomainTopic;
import com.zeligsoft.domain.omg.dds.api.DCPS.TopicConnector;
import com.zeligsoft.domain.omg.dds.api.DCPS.DomainParticipant;
import com.zeligsoft.base.zdl.util.ZDLUtil;
public class DomainZImpl extends NamedEntityZImpl implements Domain {
protected java.util.List<TopicConnector> _connector;
protected java.util.List<DomainTopic> _domainTopic;
protected java.util.List<DomainParticipant> _participant;
public DomainZImpl(org.eclipse.emf.ecore.EObject element) {
super(element);
}
@Override
public java.util.List<TopicConnector> getConnector() {
if (_connector == null) {
final Object rawValue = com.zeligsoft.base.zdl.util.ZDLUtil
.getValue(eObject(), "DDS::DCPS::Domain", "connector");
_connector = new java.util.ArrayList<TopicConnector>();
@SuppressWarnings("unchecked")
final java.util.List<Object> rawList = (java.util.List<Object>) rawValue;
for (Object next : rawList) {
if (next instanceof org.eclipse.emf.ecore.EObject) {
TopicConnector nextWrapper = ZDLFactoryRegistry.INSTANCE
.create((org.eclipse.emf.ecore.EObject) next,
TopicConnector.class);
_connector.add(nextWrapper);
}
}
}
return _connector;
}
@Override
public void addConnector(TopicConnector val) {
// make sure the connector list is created
getConnector();
final Object rawValue = ZDLUtil.getValue(element, "DDS::DCPS::Domain",
"connector");
@SuppressWarnings("unchecked")
final java.util.List<Object> rawList = (java.util.List<Object>) rawValue;
rawList.add(val.eObject());
if (_connector != null) {
_connector.add(val);
}
}
@Override
public <T extends TopicConnector> T addConnector(Class<T> typeToCreate,
String concept) {
// make sure the connector list is created
getConnector();
org.eclipse.emf.ecore.EObject newConcept = ZDLUtil.createZDLConcept(
element, "DDS::DCPS::Domain", "connector", concept);
T element = ZDLFactoryRegistry.INSTANCE.create(
newConcept, typeToCreate);
if (_connector != null) {
_connector.add(element);
}
return element;
}
@Override
public TopicConnector addConnector() {
// make sure the connector list is created
getConnector();
org.eclipse.emf.ecore.EObject newConcept = ZDLUtil.createZDLConcept(
element, "DDS::DCPS::Domain", "connector",
"DDS::DCPS::TopicConnector");
TopicConnector element = ZDLFactoryRegistry.INSTANCE.create(
newConcept,
TopicConnector.class);
if (_connector != null) {
_connector.add(element);
}
return element;
}
@Override
public java.util.List<DomainTopic> getDomainTopic() {
if (_domainTopic == null) {
final Object rawValue = com.zeligsoft.base.zdl.util.ZDLUtil
.getValue(eObject(), "DDS::DCPS::Domain", "domainTopic");
_domainTopic = new java.util.ArrayList<DomainTopic>();
@SuppressWarnings("unchecked")
final java.util.List<Object> rawList = (java.util.List<Object>) rawValue;
for (Object next : rawList) {
if (next instanceof org.eclipse.emf.ecore.EObject) {
DomainTopic nextWrapper = ZDLFactoryRegistry.INSTANCE
.create((org.eclipse.emf.ecore.EObject) next,
DomainTopic.class);
_domainTopic.add(nextWrapper);
}
}
}
return _domainTopic;
}
@Override
public void addDomainTopic(DomainTopic val) {
// make sure the domainTopic list is created
getDomainTopic();
final Object rawValue = ZDLUtil.getValue(element, "DDS::DCPS::Domain",
"domainTopic");
@SuppressWarnings("unchecked")
final java.util.List<Object> rawList = (java.util.List<Object>) rawValue;
rawList.add(val.eObject());
if (_domainTopic != null) {
_domainTopic.add(val);
}
}
@Override
public <T extends DomainTopic> T addDomainTopic(Class<T> typeToCreate,
String concept) {
// make sure the domainTopic list is created
getDomainTopic();
org.eclipse.emf.ecore.EObject newConcept = ZDLUtil.createZDLConcept(
element, "DDS::DCPS::Domain", "domainTopic", concept);
T element = ZDLFactoryRegistry.INSTANCE.create(
newConcept, typeToCreate);
if (_domainTopic != null) {
_domainTopic.add(element);
}
return element;
}
@Override
public DomainTopic addDomainTopic() {
// make sure the domainTopic list is created
getDomainTopic();
org.eclipse.emf.ecore.EObject newConcept = ZDLUtil.createZDLConcept(
element, "DDS::DCPS::Domain", "domainTopic",
"DDS::DCPS::DomainTopic");
DomainTopic element = ZDLFactoryRegistry.INSTANCE.create(
newConcept, DomainTopic.class);
if (_domainTopic != null) {
_domainTopic.add(element);
}
return element;
}
@Override
public java.util.List<DomainParticipant> getParticipant() {
if (_participant == null) {
final Object rawValue = com.zeligsoft.base.zdl.util.ZDLUtil
.getValue(eObject(), "DDS::DCPS::Domain", "participant");
_participant = new java.util.ArrayList<DomainParticipant>();
@SuppressWarnings("unchecked")
final java.util.List<Object> rawList = (java.util.List<Object>) rawValue;
for (Object next : rawList) {
if (next instanceof org.eclipse.emf.ecore.EObject) {
DomainParticipant nextWrapper = ZDLFactoryRegistry.INSTANCE
.create((org.eclipse.emf.ecore.EObject) next,
DomainParticipant.class);
_participant.add(nextWrapper);
}
}
}
return _participant;
}
@Override
public void addParticipant(DomainParticipant val) {
// make sure the participant list is created
getParticipant();
final Object rawValue = ZDLUtil.getValue(element, "DDS::DCPS::Domain",
"participant");
@SuppressWarnings("unchecked")
final java.util.List<Object> rawList = (java.util.List<Object>) rawValue;
rawList.add(val.eObject());
if (_participant != null) {
_participant.add(val);
}
}
@Override
public <T extends DomainParticipant> T addParticipant(
Class<T> typeToCreate, String concept) {
// make sure the participant list is created
getParticipant();
org.eclipse.emf.ecore.EObject newConcept = ZDLUtil.createZDLConcept(
element, "DDS::DCPS::Domain", "participant", concept);
T element = ZDLFactoryRegistry.INSTANCE.create(
newConcept, typeToCreate);
if (_participant != null) {
_participant.add(element);
}
return element;
}
@Override
public DomainParticipant addParticipant() {
// make sure the participant list is created
getParticipant();
org.eclipse.emf.ecore.EObject newConcept = ZDLUtil.createZDLConcept(
element, "DDS::DCPS::Domain", "participant",
"DDS::DCPS::DomainParticipant");
DomainParticipant element = ZDLFactoryRegistry.INSTANCE.create(
newConcept,
DomainParticipant.class);
if (_participant != null) {
_participant.add(element);
}
return element;
}
@Override
public org.eclipse.uml2.uml.Component asComponent() {
return (org.eclipse.uml2.uml.Component) eObject();
}
}
|
[
"tuhin@zeligsoft.com"
] |
tuhin@zeligsoft.com
|
503d96af8862e16cbca1432a3477737b1abe3842
|
b494660c34135527b4443b9d79819fd75db5079b
|
/VIPShopper/src/com/shopper/app/entities/SearchArticleAdapter.java
|
83907df7f75927a28d4b5a7ca0b576eb5eb9fb22
|
[] |
no_license
|
palash051/R-D
|
3ed47f9ac41685165a4730bda950e247492febdf
|
2bc1126409e6012be927557b20824d860ac624c9
|
refs/heads/master
| 2021-01-16T21:04:00.291049
| 2016-08-04T05:40:22
| 2016-08-04T05:40:22
| 64,904,130
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,969
|
java
|
package com.shopper.app.entities;
import java.util.ArrayList;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.shopper.app.R;
/**
* @author Tanvir Ahmed Chowdhury use for loading search article information in
* search screen Asynchronously
*
*/
public class SearchArticleAdapter extends ArrayAdapter<ArticleForSearch> {
ArticleForSearch articleEntity;
ArrayList<ArticleForSearch> articleInquieryList;
Context context;
int _position = -1;
View oldView = null;
public SearchArticleAdapter(Context context, int resource,
ArrayList<ArticleForSearch> _articleInquieryList) {
super(context, resource, _articleInquieryList);
this.context = context;
articleInquieryList = _articleInquieryList;
}
static class ViewHolder {
public TextView text;
public TextView text2;
public int pos;
}
@Override
// prepare the search view
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.search_article, parent,
false);
// convertView.setPadding(7, 5, 7, 5);
viewHolder = new ViewHolder();
viewHolder.text = (TextView) convertView
.findViewById(R.id.tvarticleItemText);
viewHolder.text2 = (TextView) convertView
.findViewById(R.id.tvsubarticleItemText);
convertView.setTag(viewHolder);
}
articleEntity = (ArticleForSearch) articleInquieryList.get(position);
convertView.setBackgroundColor(Color.TRANSPARENT);
viewHolder = (ViewHolder) convertView.getTag();
viewHolder.text.setText(String.valueOf(articleEntity.text));
viewHolder.pos = position;
if (articleEntity.text2 != "") {
viewHolder.text2.setVisibility(View.VISIBLE);
viewHolder.text2.setText(String.valueOf(articleEntity.text2));
} else {
viewHolder.text2.setVisibility(View.GONE);
viewHolder.text2.setText(String.valueOf(""));
}
// if (_position == position) {
// convertView.setBackgroundResource(R.drawable.selectedrow);
// }
convertView.setOnTouchListener(touchListener);
return convertView;
}
public void setSelection(int pos) {
_position = pos;
}
private RelativeLayout.OnTouchListener touchListener = new RelativeLayout.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
try {
if (oldView != null) {
oldView.setBackgroundResource(R.color.transparent);
}
setSelection(((ViewHolder)v.getTag()).pos);
v.setBackgroundResource(R.drawable.list_pressed);
// v.setPadding(7, 5, 7, 5);
oldView = v;
} catch (Exception e) {
}
return false;
}
};
}
|
[
"md.jahirul.islam.bhuiyan.2014@gmail.com"
] |
md.jahirul.islam.bhuiyan.2014@gmail.com
|
e37b30c1286d2a166d80d3d61e2335b129ab80e4
|
ed166738e5dec46078b90f7cca13a3c19a1fd04b
|
/minor/guice-OOM-error-reproduction/src/main/java/gen/V_Gen91.java
|
42583529b4855b0e67dbaba0b2a7b3e894d7d418
|
[] |
no_license
|
michalradziwon/script
|
39efc1db45237b95288fe580357e81d6f9f84107
|
1fd5f191621d9da3daccb147d247d1323fb92429
|
refs/heads/master
| 2021-01-21T21:47:16.432732
| 2016-03-23T02:41:50
| 2016-03-23T02:41:50
| 22,663,317
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 326
|
java
|
package gen;
public class V_Gen91 {
@com.google.inject.Inject
public V_Gen91(V_Gen92 v_gen92){
System.out.println(this.getClass().getCanonicalName() + " created. " + v_gen92 );
}
@com.google.inject.Inject public void injectInterfaceWithoutImpl(gen.InterfaceWithoutImpl i){} // should expolode :)
}
|
[
"michal.radzi.won@gmail.com"
] |
michal.radzi.won@gmail.com
|
bb50e45c117d354168af0aca3917b2fb7058862f
|
cf2be80cf86ba39b894091a8d8b1c29d9ea36d48
|
/rocketmq-study/src/main/java/com/fly/rocketmq/client/filter/FilterMessageConsumer.java
|
46505947f4db0580acb642fd6d16c6ddb5a04da7
|
[] |
no_license
|
BobShare/fly-springboot
|
d1b8d56b6db3f0e44fe6c7726ac42a6fdc45ddb5
|
90cb7610da616f5af61bf0474ad588eb91ed78d3
|
refs/heads/master
| 2023-03-29T06:20:30.258454
| 2020-08-11T09:35:24
| 2020-08-11T09:35:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,780
|
java
|
package com.fly.rocketmq.client.filter;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.MessageSelector;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.message.MessageExt;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author 张攀钦
* @date 2020-02-09-04:59
* @description
*/
public class FilterMessageConsumer {
public static void main(String[] args) throws MQClientException {
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("group45");
consumer.setNamesrvAddr("localhost:9876");
consumer.subscribe("TopicTest", MessageSelector.bySql("a >= 5"));
consumer.registerMessageListener(new MessageListenerConcurrently() {
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) {
List<String> collect = msgs.stream().map(item -> {
try {
return new String(item.getBody(), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}).collect(Collectors.toList());
System.out.println(collect);
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
});
consumer.start();
}
}
|
[
"zhangpanqin@outlook.com"
] |
zhangpanqin@outlook.com
|
f60adf50bc970e0fb317cb6eff26ed38d1755d86
|
0b4844d550c8e77cd93940e4a1d8b06d0fbeabf7
|
/JavaSource/dream/work/rpt/mabmeqlist/form/MaBmEqListForm.java
|
8a71790ae31ceb9e19065ea9fbf741bf8f56411e
|
[] |
no_license
|
eMainTec-DREAM/DREAM
|
bbf928b5c50dd416e1d45db3722f6c9e35d8973c
|
05e3ea85f9adb6ad6cbe02f4af44d941400a1620
|
refs/heads/master
| 2020-12-22T20:44:44.387788
| 2020-01-29T06:47:47
| 2020-01-29T06:47:47
| 236,912,749
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 736
|
java
|
package dream.work.rpt.mabmeqlist.form;
import common.struts.BaseForm;
import dream.work.rpt.mabmeqlist.dto.MaBmEqListDTO;
/**
* 설비별고장분석
* @author kim21017
* @version $Id: MaBmEqListForm.java,v 1.0 2015/12/01 09:13:09 kim21017 Exp $
* @since 1.0
*
* @struts.form name="maBmEqListForm"
*/
public class MaBmEqListForm extends BaseForm
{
//===============================================================
/** 설비별고장분석 */
private MaBmEqListDTO maBmEqListDTO = new MaBmEqListDTO();
public MaBmEqListDTO getMaBmEqListDTO() {
return maBmEqListDTO;
}
public void setMaBmEqListDTO(MaBmEqListDTO maBmEqListDTO) {
this.maBmEqListDTO = maBmEqListDTO;
}
}
|
[
"HN4741@10.31.0.185"
] |
HN4741@10.31.0.185
|
342a63a23d00096a6f95de4b73627908ebb67dbc
|
98ccbb4f41669dbdfcae08c3709a404131f54f05
|
/2021/src/M0320/라인5.java
|
4e47d20a1a126716b02de93d115275a6f5222852
|
[
"MIT"
] |
permissive
|
KimJaeHyun94/CodingTest
|
fee6f14b3320c85670bdab7e9dbe97f429a31d9c
|
f153879ac0ac1cf45de487afd9a4a94c9ffbe10d
|
refs/heads/main
| 2023-04-22T15:27:46.325475
| 2021-05-16T15:02:27
| 2021-05-16T15:02:27
| 330,885,734
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,263
|
java
|
package M0320;
import java.util.Arrays;
import java.util.HashMap;
public class 라인5 {
static HashMap<String, String> map;
public static void main(String[] args) {
String program = "line";
String[] flag_rules = { "-s STRING", "-n NUMBER", "-e NULL" };
String[] commands = { "line -n 100 -s hi -e", "lien -s Bye" };
String[] commands2 = { "line -s 123 -n HI", "line fun" };
System.out.println(Arrays.toString(solution(program, flag_rules, commands)));
System.out.println(Arrays.toString(solution(program, flag_rules, commands2)));
}
public static boolean[] solution(String program, String[] flag_rules, String[] commands) {
boolean[] answer = {};
answer = new boolean[commands.length];
map = new HashMap<>();
for (int i = 0; i < flag_rules.length; i++) {
String str[] = flag_rules[i].split(" ");
map.put(str[0], str[1]);
}
int idx = -1;
for (String str : commands) {
idx++;
String line[] = str.split(" ");
String name = line[0];
if (!name.equals(program)) {
answer[idx] = false;
continue;
}
boolean flag = true;
for (int i = 1; i < line.length; i += 2) {
if (map.containsKey(line[i])) {
if (map.get(line[i]).equals("NULL")) {
if (i == line.length - 1) {
break;
} else if (map.containsKey(line[i + 1])) {
i -= 1;
continue;
}
} else if (!commanding(line[i], line[i + 1])) {
flag = false;
break;
} else {
continue;
}
} else {
flag = false;
break;
}
}
if (flag)
answer[idx] = true;
else
answer[idx] = false;
}
return answer;
}
private static boolean commanding(String key, String sol) {
String command = map.get(key);
switch (command) {
case "STRING":
for (int i = 0; i < sol.length(); i++) {
char ch = sol.charAt(i);
if ('A' <= ch && ch <= 'Z' || 'a' <= ch && ch <= 'z')
continue;
else
return false;
}
return true;
case "NUMBER":
for (int i = 0; i < sol.length(); i++) {
char ch = sol.charAt(i);
if ('0' <= ch && ch <= '9')
continue;
else
return false;
}
return true;
}
return false;
}
}
|
[
"ru6300@naver.com"
] |
ru6300@naver.com
|
7e20e55ae6b85c742053bf6bc9e9f7485cc83996
|
f39e023550f92c1622d07fd4824c6a744a547bdc
|
/src/main/java/com/cnuip/pmes2/controller/api/MetaController.java
|
ca729362da028a8941ed7a5c8cab006fdbc0ff46
|
[] |
no_license
|
yuervsxiami/pmes
|
9a71d5a224df772740cca5ecb840070e5f7e395c
|
d2c0a5257d9ba383653f145aea6282c3620348c8
|
refs/heads/master
| 2022-10-08T03:09:12.195457
| 2019-05-29T06:59:21
| 2019-05-29T06:59:31
| 189,168,009
| 1
| 1
| null | 2022-10-05T19:27:04
| 2019-05-29T06:55:49
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 6,604
|
java
|
package com.cnuip.pmes2.controller.api;
import com.cnuip.pmes2.controller.api.request.MetaSearchCondition;
import com.cnuip.pmes2.controller.api.response.ApiResponse;
import com.cnuip.pmes2.domain.core.Meta;
import com.cnuip.pmes2.domain.core.MetaValue;
import com.cnuip.pmes2.exception.MetaException;
import com.cnuip.pmes2.service.MetaService;
import com.cnuip.pmes2.util.UserUtil;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* Create By Crixalis:
* 2018年1月4日 下午4:27:02
*/
@RestController
@RequestMapping("/api/meta")
public class MetaController extends BussinessLogicExceptionHandler {
@Autowired
private MetaService metaService;
/**
* 根据key获得元数据
*
* @param key
* @return
*/
@RequestMapping(value = "/get/{key}", method = RequestMethod.GET)
public ApiResponse<Meta> get(@PathVariable String key) {
ApiResponse<Meta> resp = new ApiResponse<>();
resp.setResult(metaService.selectByKey(key));
return resp;
}
/**
* 根据id获得元数据
*
* @param id
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public ApiResponse<Meta> getByPrimaryKey(@PathVariable Long id) {
ApiResponse<Meta> resp = new ApiResponse<>();
resp.setResult(metaService.selectByPrimaryKey(id));
return resp;
}
/**
* 则获取全部元数据
*
* @param pageSize
* @param pageNum
* @return
*/
@RequestMapping(value = "/all/", method = RequestMethod.GET)
public ApiResponse<List<Meta>> getAll() {
ApiResponse<List<Meta>> resp = new ApiResponse<>();
resp.setResult(metaService.selectAll());
return resp;
}
/**
* 根据type获得元数据,如果type为0,则获取全部
*
* @param type
* @param pageSize
* @param pageNum
* @return
*/
@RequestMapping(value = "/findByType/{type}", method = RequestMethod.GET)
public ApiResponse<PageInfo<Meta>> getByType(@PathVariable Integer type,
@RequestParam(required = false, defaultValue = "10") int pageSize,
@RequestParam(required = false, defaultValue = "1") int pageNum) {
ApiResponse<PageInfo<Meta>> resp = new ApiResponse<>();
resp.setResult(metaService.selectByType(type, pageNum, pageSize));
return resp;
}
/**
* 根据搜索条件搜索列表
*
* @return
*/
@RequestMapping(value = "/search/", method = RequestMethod.GET)
public ApiResponse<PageInfo<Meta>> search(
@RequestParam(required = false) Integer type,
@RequestParam(required = false) String name,
@RequestParam(required = false) Integer state,
@RequestParam(required = false) String username,
@RequestParam(required = false) Date fromTime,
@RequestParam(required = false) Date toTime,
@RequestParam(required = false, defaultValue = "10") int pageSize,
@RequestParam(required = false, defaultValue = "1") int pageNum) {
ApiResponse<PageInfo<Meta>> resp = new ApiResponse<>();
MetaSearchCondition condition = new MetaSearchCondition(type, name, state, username, fromTime, toTime);
resp.setResult(metaService.search(condition, pageNum, pageSize));
return resp;
}
/**
* 根据元数据key获取key下的所有元数据值
*
* @param key
* @return
*/
@RequestMapping(value = "/values/{key}", method = RequestMethod.GET)
public ApiResponse<List<MetaValue>> getMetaValues(@PathVariable String key) {
ApiResponse<List<MetaValue>> resp = new ApiResponse<>();
resp.setResult(metaService.selectMetaValues(key));
return resp;
}
/**
* 根据id获取元数据值
*
* @param id
* @return
*/
@RequestMapping(value = "/value/{id}", method = RequestMethod.GET)
public ApiResponse<MetaValue> getMetaValue(@PathVariable Long id) {
ApiResponse<MetaValue> resp = new ApiResponse<>();
resp.setResult(metaService.selectMetaValue(id));
return resp;
}
/**
* 添加元数据,如果元数据下有值会把元数据值一起添加
*
* @param id
* @return
* @throws MetaException
*/
@RequestMapping(value = "/add/", method = RequestMethod.POST)
public ApiResponse<Meta> add(Authentication authentication, @RequestBody Meta meta) throws MetaException {
ApiResponse<Meta> resp = new ApiResponse<>();
Long userId = UserUtil.getUser(authentication).getId();
resp.setResult(metaService.addMeta(meta, userId));
return resp;
}
/**
* 修改元数据,把新增后的元数据值添加,修改的元数据值对应修改
*
* @param id
* @return
* @throws MetaException
*/
@RequestMapping(value = "/update/", method = RequestMethod.POST)
public ApiResponse<Meta> update(Authentication authentication, @RequestBody Meta meta) throws MetaException {
ApiResponse<Meta> resp = new ApiResponse<>();
Long userId = UserUtil.getUser(authentication).getId();
resp.setResult(metaService.updateMeta(meta, userId));
return resp;
}
/**
* 删除元数据值
*
* @param id
* @return
* @throws MetaException
*/
@RequestMapping(value = "/value/delete/{id}", method = RequestMethod.DELETE)
public ApiResponse<String> deleteMetaValue(@PathVariable Long id) throws MetaException {
ApiResponse<String> resp = new ApiResponse<>();
metaService.deleteMetaValue(id);
resp.setResult("删除成功");
return resp;
}
/**
* 改变元数据状态0为禁用,1为启用
*/
@RequestMapping(value = "/changeState/", method = RequestMethod.POST)
public ApiResponse<String> changState(@RequestBody Meta meta) {
ApiResponse<String> resp = new ApiResponse<>();
metaService.changeMetaState(meta.getKey(), meta.getState());
resp.setResult("修改成功");
return resp;
}
}
|
[
"15951766580@139.com"
] |
15951766580@139.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.