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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7ac058e8857a70e4d6781b1dbdee80aa8b413a09 | f4dfe52bd506f1508637f23f1d9822c659891c12 | /LowLatencyQueues/src/main/java/org/mk/training/queues/BackOffStrategy.java | c3a0bc033ccbf9bfac8b480f6c04001f78f6e786 | [] | no_license | siddhantaws/LowLatency | 5b27b99b8fbe3a98029ca42f636b49d870a0b3bb | f245916fed8bfe5a038dc21098d813bf5accdb1e | refs/heads/master | 2021-06-25T19:55:07.994337 | 2019-09-19T15:39:15 | 2019-09-19T15:39:15 | 152,133,438 | 0 | 0 | null | 2020-10-13T16:09:28 | 2018-10-08T19:17:54 | Java | UTF-8 | Java | false | false | 755 | java | package org.mk.training.queues;
import java.util.concurrent.locks.LockSupport;
public enum BackOffStrategy {
SPIN {
public int backoff(int called) {
return called++;
}
},
YIELD{
public int backoff(int called) {
Thread.yield();
return called++;
}
},
PARK{
public int backoff(int called) {
LockSupport.parkNanos(1);
return called++;
}
},
SPIN_YIELD {
public int backoff(int called) {
if(called>1000)
Thread.yield();
return called++;
}
};
public abstract int backoff(int called);
public static BackOffStrategy getStrategy(String propertyName, BackOffStrategy defaultS){
try{
return BackOffStrategy.valueOf(System.getProperty(propertyName));
}
catch(Exception e){
return defaultS;
}
}
}
| [
"siddhantaws@gmail.com"
] | siddhantaws@gmail.com |
43ff95c645035c33e1bc06cc76ac14074d0992fb | 79cabd2726dc47e0ec4195970ff101e2716d42e4 | /gremlin-test/src/main/java/com/tinkerpop/gremlin/process/graph/step/branch/LocalTest.java | 8189354f99f430d97a6e911c7d2740a79e84959e | [
"Apache-2.0"
] | permissive | greedy/tinkerpop3-before-apache | 114a0cfc362c13f173ec7d45e9b7d08c47737568 | 45cfc356b06b17370b3978c80659dfe5a76f3d4d | refs/heads/master | 2021-01-15T08:31:19.296719 | 2015-01-24T01:09:31 | 2015-01-24T01:09:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,733 | java | package com.tinkerpop.gremlin.process.graph.step.branch;
import com.tinkerpop.gremlin.LoadGraphWith;
import com.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import com.tinkerpop.gremlin.process.T;
import com.tinkerpop.gremlin.process.Traversal;
import com.tinkerpop.gremlin.structure.Order;
import com.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
import java.util.Arrays;
import java.util.Map;
import static com.tinkerpop.gremlin.LoadGraphWith.GraphData.CREW;
import static com.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
import static com.tinkerpop.gremlin.process.graph.AnonymousGraphTraversal.Tokens.__;
import static org.junit.Assert.*;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public abstract class LocalTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, String> get_g_V_localXpropertiesXlocationX_order_byXvalueX_limitX2XX_value();
public abstract Traversal<Vertex, Map<String, Object>> get_g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_byXidX();
public abstract Traversal<Vertex, Long> get_g_V_localXoutE_countX();
@Test
@LoadGraphWith(CREW)
public void g_V_localXpropertiesXlocationX_orderByXvalueX_limitX2XX_value() {
final Traversal<Vertex, String> traversal = get_g_V_localXpropertiesXlocationX_order_byXvalueX_limitX2XX_value();
printTraversalForm(traversal);
checkResults(Arrays.asList("brussels", "san diego", "centreville", "dulles", "baltimore", "bremen", "aachen", "kaiserslautern"), traversal);
}
@Test
@LoadGraphWith(MODERN)
public void g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_by() {
final Traversal<Vertex, Map<String, Object>> traversal = get_g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_byXidX();
printTraversalForm(traversal);
int counter = 0;
while (traversal.hasNext()) {
final Map<String, Object> map = traversal.next();
counter++;
assertEquals(2, map.size());
if (map.get("a").equals("marko")) {
assertEquals(convertToVertexId("lop"), map.get("b"));
} else if (map.get("a").equals("josh")) {
assertTrue(convertToVertexId("lop").equals(map.get("b")) || convertToVertexId("ripple").equals(map.get("b")));
} else if (map.get("a").equals("peter")) {
assertEquals(convertToVertexId("lop"), map.get("b"));
} else {
fail("The following map should not have been returned: " + map);
}
}
assertEquals(4, counter);
}
@Test
@LoadGraphWith(MODERN)
public void g_V_localXoutE_countX() {
final Traversal<Vertex, Long> traversal = get_g_V_localXoutE_countX();
printTraversalForm(traversal);
checkResults(Arrays.asList(3l, 0l, 0l, 0l, 1l, 2l), traversal);
}
/*@Test
@LoadGraphWith(MODERN)
public void g_V_localXoutE_weight_groupCountX() {
final Traversal<Vertex, Map<Double, Long>> traversal = get_g_V_localXoutE_weight_groupCountX();
int counter = 0;
int zeroCounter = 0;
while (traversal.hasNext()) {
counter++;
final Map<Double, Long> map = traversal.next();
if(0 == map.size()) zeroCounter++;
System.out.println(map);
}
assertEquals(6, counter);
assertEquals(3, zeroCounter);
}*/
public static class StandardTest extends LocalTest {
public StandardTest() {
requiresGraphComputer = false;
}
@Override
public Traversal<Vertex, String> get_g_V_localXpropertiesXlocationX_order_byXvalueX_limitX2XX_value() {
return g.V().local(__.properties("location").order().by(T.value, Order.incr).range(0, 2)).value();
}
@Override
public Traversal<Vertex, Map<String, Object>> get_g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_byXidX() {
return g.V().has(T.label, "person").as("a").local(__.out("created").as("b")).select("a", "b").by("name").by(T.id);
}
@Override
public Traversal<Vertex, Long> get_g_V_localXoutE_countX() {
return g.V().local(__.outE().count());
}
/*@Override
public Traversal<Vertex, Map<Double, Long>> get_g_V_localXoutE_weight_groupCountX() {
return g.V().local((Traversal) __.outE().values("weight").groupCount());
}*/
}
public static class ComputerTest extends LocalTest {
public ComputerTest() {
requiresGraphComputer = true;
}
@Override
public Traversal<Vertex, String> get_g_V_localXpropertiesXlocationX_order_byXvalueX_limitX2XX_value() {
return g.V().local(__.properties("location").order().by(T.value, Order.incr).range(0, 2)).<String>value().submit(g.compute());
}
@Override
public Traversal<Vertex, Map<String, Object>> get_g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_byXidX() {
return g.V().has(T.label, "person").as("a").local(__.out("created").as("b")).select("a", "b").by("name").by(T.id).submit(g.compute());
}
@Override
public Traversal<Vertex, Long> get_g_V_localXoutE_countX() {
return g.V().local(__.outE().count()).submit(g.compute());
}
/*@Override
public Traversal<Vertex, Map<Double, Long>> get_g_V_localXoutE_weight_groupCountX() {
return g.V().local((Traversal) __.outE().values("weight").groupCount()).submit(g.compute());
}*/
}
}
| [
"okrammarko@gmail.com"
] | okrammarko@gmail.com |
4baed7e2810dda4fd44bc19b74c8dab1706bb239 | 6361a44297dcacfbb5b09924537f033f8ca861cc | /codefirst/codefirst3/src/main/java/entities/universitySystemDb/Person.java | 494b0b19ff6f60d8f53f881dce620fa7d7512a58 | [] | no_license | allsi89/db_Hibernate_Spring | 071a9ecb0a3151a83b63ce4ed93954afea9992cc | 25761e8b1f8085e40680ec92881707781dc8f514 | refs/heads/master | 2020-04-04T08:51:31.117586 | 2018-12-08T13:38:25 | 2018-12-08T13:38:25 | 155,797,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,074 | java | package entities.universitySystemDb;
import javax.persistence.*;
@MappedSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class Person {
private int id;
private String firstName;
private String lastName;
private String phoneNumber;
public Person() {
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "first_name")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@Column(name = "last_name")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
@Column(name = "phone_number")
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
}
| [
"37107768+allsi89@users.noreply.github.com"
] | 37107768+allsi89@users.noreply.github.com |
558f23c33780da0ae7ada1d525e28344ec7f9891 | 6b3040734f41809e284655a7dd8746f95050df40 | /src/main/java/redo/p0400_0499/P434.java | 4b921f2a97096f2638e30eb25faee3a251db244a | [] | no_license | yu132/leetcode-solution | a451e30f6e34eab93de39f7bb6d1fd135ffd154d | 6a659a4d773f58c2efd585a0b7140ace5f5ea10a | refs/heads/master | 2023-01-28T08:14:03.817652 | 2023-01-14T16:26:59 | 2023-01-14T16:26:59 | 185,592,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,233 | java | package redo.p0400_0499;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.Test;
/**
* @ClassName: P434
*
* @Description: TODO(这里用一句话描述这个类的作用)
*
* @author 余定邦
*
* @date 2020年12月19日
*
*/
public class P434 {
class Solution {
public int countSegments(String s) {
boolean isBlank = true;
int wordNum = 0;
for (char ch : s.toCharArray()) {
if (ch == ' ') {
if (!isBlank) {
isBlank = true;
}
} else {
if (isBlank) {
++wordNum;
isBlank = false;
}
}
}
return wordNum;
}
}
@Test
public void test() {
Solution s = new Solution();
assertEquals(5, s.countSegments("Hello, my name is John"));
assertEquals(5, s.countSegments(" Hello, my name is John "));
assertEquals(5, s.countSegments("Hello, my name is John "));
assertEquals(0, s.countSegments(" "));
assertEquals(0, s.countSegments(""));
}
}
| [
"876633022@qq.com"
] | 876633022@qq.com |
cfcf44d04614ed70a37389a32bd2996edf713227 | d8a5ccc7a66e7d326b95f549ed790a974947e2a6 | /mbaas-server/src/main/java/com/angkorteam/mbaas/server/page/role/RoleCreatePage.java | 56f8b351368a6aad47d5d2ac177d57432d9d8d22 | [
"Apache-2.0"
] | permissive | sophea/MBaaS | feb02932f35ba623556a1711ac03705f64cdd145 | b0f551dd8278a6540d17fbf55bd6d93388f1cdf7 | refs/heads/master | 2021-01-15T13:29:56.556655 | 2016-04-06T23:59:41 | 2016-04-06T23:59:41 | 55,662,818 | 0 | 1 | null | 2016-04-07T04:08:46 | 2016-04-07T04:08:46 | null | UTF-8 | Java | false | false | 3,149 | java | package com.angkorteam.mbaas.server.page.role;
import com.angkorteam.framework.extension.wicket.feedback.TextFeedbackPanel;
import com.angkorteam.framework.extension.wicket.markup.html.form.Button;
import com.angkorteam.mbaas.model.entity.Tables;
import com.angkorteam.mbaas.model.entity.tables.RoleTable;
import com.angkorteam.mbaas.model.entity.tables.records.RoleRecord;
import com.angkorteam.mbaas.server.validator.RoleNameValidator;
import com.angkorteam.mbaas.server.wicket.JooqUtils;
import com.angkorteam.mbaas.server.wicket.MasterPage;
import com.angkorteam.mbaas.server.wicket.Mount;
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.PropertyModel;
import org.jooq.DSLContext;
import java.util.UUID;
/**
* Created by socheat on 3/1/16.
*/
@AuthorizeInstantiation("administrator")
@Mount("/role/create")
public class RoleCreatePage extends MasterPage {
private String name;
private TextField<String> nameField;
private TextFeedbackPanel nameFeedback;
private String description;
private TextField<String> descriptionField;
private TextFeedbackPanel descriptionFeedback;
private Button saveButton;
private Form<Void> form;
@Override
public String getPageHeader() {
return "Create New Role";
}
@Override
protected void onInitialize() {
super.onInitialize();
this.nameField = new TextField<>("nameField", new PropertyModel<>(this, "name"));
this.nameField.setRequired(true);
this.nameField.add(new RoleNameValidator());
this.nameField.setLabel(JooqUtils.lookup("name", this));
this.nameFeedback = new TextFeedbackPanel("nameFeedback", this.nameField);
this.descriptionField = new TextField<>("descriptionField", new PropertyModel<>(this, "description"));
this.descriptionField.setRequired(true);
this.descriptionField.setLabel(JooqUtils.lookup("description", this));
this.descriptionFeedback = new TextFeedbackPanel("descriptionFeedback", this.descriptionField);
this.saveButton = new Button("saveButton");
this.saveButton.setOnSubmit(this::saveButtonOnSubmit);
this.form = new Form<>("form");
add(this.form);
this.form.add(this.nameField);
this.form.add(this.nameFeedback);
this.form.add(this.descriptionField);
this.form.add(this.descriptionFeedback);
this.form.add(this.saveButton);
}
private void saveButtonOnSubmit(Button button) {
DSLContext context = getDSLContext();
RoleTable roleTable = Tables.ROLE.as("roleTable");
RoleRecord roleRecord = context.newRecord(roleTable);
roleRecord.setRoleId(UUID.randomUUID().toString());
roleRecord.setSystem(false);
roleRecord.setDeleted(false);
roleRecord.setName(this.name);
roleRecord.setDescription(this.description);
roleRecord.store();
setResponsePage(RoleManagementPage.class);
}
}
| [
"pkayjava@gmail.com"
] | pkayjava@gmail.com |
4cd11e274f3ff31b55125054260020798018011d | 6b3a781d420c88a3a5129638073be7d71d100106 | /AppDisProxyServer/src/main/java/com/ocean/service/BaitongDownloaderAppSupplier.java | 3bb91a9de6169967683b7fb6b6e887eaf15932af | [] | no_license | Arthas-sketch/FrexMonitor | 02302e8f7be1a68895b9179fb3b30537a6d663bd | 125f61fcc92f20ce948057a9345432a85fe2b15b | refs/heads/master | 2021-10-26T15:05:59.996640 | 2019-04-13T07:52:57 | 2019-04-13T07:52:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,819 | java | package com.ocean.service;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.stereotype.Component;
import com.inveno.util.CollectionUtils;
import com.ocean.app.dis.proxy.thrift.entity.AppDisContent;
import com.ocean.app.dis.proxy.thrift.entity.AppDisRecomReply;
import com.ocean.app.dis.proxy.thrift.entity.AppDisRecomReq;
import com.ocean.app.dis.proxy.thrift.entity.AppInfo;
import com.ocean.app.dis.proxy.thrift.entity.AppType;
import com.ocean.app.dis.proxy.thrift.entity.ReportType;
import com.ocean.core.common.http.Bean2Utils;
import com.ocean.core.common.system.ErrorCode;
import com.ocean.core.common.system.SystemContext;
import com.ocean.handler.base.AbstractAppDisSupplier;
import com.ocean.persist.app.dis.AppDisException;
import com.ocean.persist.app.dis.AppDisResponse;
import com.ocean.persist.app.dis.baidubt.pkgsearch.BaitongApp;
import com.ocean.persist.app.dis.baidubt.pkgsearch.BaitongPkgSearchReq;
import com.ocean.persist.app.dis.baidubt.pkgsearch.BaitongPkgSearchResp;
import com.ocean.persist.app.dis.baidubt.pkgsearch.BaitongPkgSearchSecParams;
import com.ocean.persist.common.AppDisConstants;
import com.ocean.service.baitongInvokerHandler.BaitongPkgSearchHandler;
import com.ocean.service.baitongInvokerHandler.base.BaitongInvokeHandlerFactory;
import com.ocean.service.baitongInvokerHandler.base.BaitongMethodType;
/** * @author Alex & E-mail:569246607@qq.com
@date 2017年5月12日
@version 1.0
*/
@Component(value="BaitongDownloaderAppSupplier")
public class BaitongDownloaderAppSupplier extends AbstractAppDisSupplier{
private static final int REPORT_TYPE_CLICK=0;
private static final int REPORT_TYPE_DOWNLOAD=1;
private static final int REPORT_TYPE_INSTALL=2;
private static Map<String,AppType> appTypeMap=new HashMap<String,AppType>();
{
appTypeMap.put("soft", AppType.TYPE_APP);
appTypeMap.put("game", AppType.TYPE_GAME);
}
public AppDisRecomReply invoke(AppDisRecomReq req)
throws AppDisException {
// TODO Auto-generated method stub
switch(req.getInterType()){
case PKG_SEARCH:
return pkgSearch(req);
default:
throw new AppDisException(ErrorCode.PARAM_ERROR,"can not find the mapping interface:"+req.getInterType().name());
}
}
private AppDisRecomReply pkgSearch(AppDisRecomReq req) throws AppDisException{
BaitongPkgSearchHandler pkgSearchHandler=(BaitongPkgSearchHandler)BaitongInvokeHandlerFactory.getHandler(BaitongMethodType.PKG_SEARCH);
BaitongPkgSearchResp resp=(BaitongPkgSearchResp)pkgSearchHandler.invok(req);
return parseResp(req,resp,pkgSearchHandler);
}
private AppDisRecomReply parseResp (AppDisRecomReq req,BaitongPkgSearchResp resp,BaitongPkgSearchHandler pkgSearchHandler) throws AppDisException{
if(resp==null||CollectionUtils.isEmpty(resp.getList())){
throw new AppDisException(ErrorCode.INTER_ERROR,"DATA_EMPTY return error code:"+resp.getFlag());
}
if(resp.getFlag()!=1){
throw new AppDisException(ErrorCode.INTER_ERROR,"DATA_ERROR return error code:"+resp.getFlag());
}
AppDisRecomReply reply=new AppDisRecomReply();
reply.setErrorCode(com.ocean.app.dis.proxy.thrift.entity.ErrorCode.RC_SUCCESS);
List<AppDisContent> appL=new ArrayList<AppDisContent>();
String reportUrl=SystemContext.getDynamicPropertyHandler().get(AppDisConstants.BAITOGN_PKG_REPORT_URL);
for(BaitongApp item:resp.getList()){
AppDisContent appDisContent=new AppDisContent();
appDisContent.setApkUrl(formatUrl(REPORT_TYPE_CLICK,item.getApp_name(),item.getDownload_url(),item.getApp_key(),resp.getLog_id(), req,pkgSearchHandler));
appDisContent.setCategoryId(item.getCategory());
//appDisContent.setContent(item.getShortDesc());
//默认设置为是广告
appDisContent.setIsAd(1);
appDisContent.setInstalledCount(item.getDownnum());
AppInfo app=new AppInfo();
app.setAppName(item.getApp_name());
app.setIconUrl(item.getApp_icon());
app.setPkgName(item.getApp_package());
app.setType(AppType.TYPE_APP);
app.setVersionCode(String.valueOf(item.getVersion_code()));
app.setFileSize(item.getApp_file_size());
app.setVersionName(item.getVersion_name());
appDisContent.setAppInfo(app);
//设置上报用字段
Map<String,List<String>> report=new HashMap<String,List<String>>();
//report.put(CLICK, Collections.singletonList(formatUrl(REPORT_TYPE_CLICK,reportUrl,item.getApp_key(),resp.getLog_id(),req,pkgSearchHandler)));
report.put(DOWNLOAD_END, Collections.singletonList(formatUrl(REPORT_TYPE_DOWNLOAD,item.getApp_name(),item.getDownload_url(),item.getApp_key(),resp.getLog_id(),req,pkgSearchHandler)));
report.put(INSTALL,Collections.singletonList(formatUrl(REPORT_TYPE_INSTALL,item.getApp_name(),item.getDownload_url(),item.getApp_key(),resp.getLog_id(),req,pkgSearchHandler)));
appDisContent.setThirdReportLinks(report);
appDisContent.setReportType(ReportType.REPORT_GET);
appL.add(appDisContent);
}
reply.setAppDisContent(appL);
return reply;
}
private String formatUrl(int reportType,String appName,String url,String appKey,String logId,AppDisRecomReq req,BaitongPkgSearchHandler pkgSearchHandler) throws AppDisException{
StringBuilder sb=new StringBuilder(url);
BaitongPkgSearchReq baitReq=pkgSearchHandler.parsePkgParam(req);
BaitongPkgSearchSecParams sec=pkgSearchHandler.getSecParams(req.getAppInfo(),req.getUserInfo(), req.getDevice());
sec.setAction_type(2);
sec.setAction("download_list");
sec.setDownload_app_name(appName);
String secParamStr=Bean2Utils.toHttpParams(sec);
try {
String secStr = URLEncoder.encode(Base64.encodeBase64String(secParamStr.getBytes(CHARSET_CODER)) ,CHARSET_CODER);
baitReq.setParams(secStr);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//去掉不用的
baitReq.setAd_type(null);
baitReq.setPlatform(null);
baitReq.setClienttype(null);
baitReq.setSub_channel(null);
baitReq.setPackage_name(null);
baitReq.setPage(null);
baitReq.setPage_size(null);
baitReq.setApp_key(appKey);
baitReq.setSecret(DigestUtils.md5Hex(req.getJoinParam().get(1).getValue()+appKey));
if(REPORT_TYPE_CLICK==reportType){
baitReq.setFrom("lc");
}
baitReq.setDown_complete(reportType);
baitReq.setLog_id(logId);
String sufix=url.indexOf("?")<0?"?":"&";
sb.append(sufix).append(Bean2Utils.toHttpParams(baitReq));
return sb.toString();
}
public List<String> pvReport(String interTye,AppDisRecomReq req,AppDisResponse resp) throws AppDisException {
// TODO Auto-generated method stub
return null;
}
public List<String> clickReport(String interTye,AppDisRecomReq req,AppDisResponse resp) throws AppDisException {
// TODO Auto-generated method stub
return null;
}
public List<String> beginDownloadReport(String interTye,AppDisRecomReq req,AppDisResponse resp)
throws AppDisException {
// TODO Auto-generated method stub
return null;
}
public List<String> endDownloadReport(String interTye,AppDisRecomReq req,AppDisResponse resp) throws AppDisException {
// TODO Auto-generated method stub
return null;
}
public List<String> installReport(String interTye,AppDisRecomReq req,AppDisResponse resp) throws AppDisException {
// TODO Auto-generated method stub
return null;
}
public List<String> activeReport(String interTye,AppDisRecomReq req,AppDisResponse resp) throws AppDisException {
// TODO Auto-generated method stub
return null;
}
}
| [
"569246607@qq.com"
] | 569246607@qq.com |
d4d40e21475a206de60af0d95293b5c370bbb0ef | b81d1df0562de9d4ff5c30bec90647402972f478 | /src/test/java/pl/pancordev/leak/three/six/DummyControllerTest9.java | 85a34c2a6b1149828be7f779f32814fed7ed8054 | [] | no_license | Pancor/leak | eea9fe401a7c9b543bf95a929f0bbf7ee6113dc9 | f060ff6a1a8c829b287cffb35b9d63040ca3c7ec | refs/heads/master | 2023-01-30T17:14:38.463089 | 2020-12-14T12:01:00 | 2020-12-14T12:01:00 | 321,322,490 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,968 | java | package pl.pancordev.leak.three.six;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import pl.pancordev.leak.services.Service9;
import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest
@WebAppConfiguration
@RunWith(SpringRunner.class)
public class DummyControllerTest9 {
@Autowired
private WebApplicationContext webApplicationContext;
@MockBean
private Service9 service9;
private MockMvc mvc;
@Before
public void setUp() {
mvc = MockMvcBuilders.webAppContextSetup(webApplicationContext)
.defaultRequest(delete("/").contentType(MediaType.APPLICATION_JSON))
.alwaysDo(print())
.apply(springSecurity())
.build();
}
@Test
public void shouldReturnProperResponseFromIndexPage() throws Exception {
mvc.perform(delete("/"))
.andExpect(status().isOk())
.andExpect(content().string("It's dummy response from server"));
}
}
| [
"pancordev@gmail.com"
] | pancordev@gmail.com |
a72055c7d82393b65122b061a0efd0e597a86778 | 4ddaca5dae1ac44ecbb8030734b4cb77cd16becd | /Leetcode/Solution_382_RandomNodeLinkedList.java | 46d38f599fd961e3054c5e9bc688b4f4a3d45f68 | [
"Apache-2.0"
] | permissive | dgr8akki/DS-Algo-Made-Easy-With-Aakash | 55aad8cb22226322773871df4be2b53d12ec366a | ccb6f6323af47858a6647b72fbde79fe81538eb9 | refs/heads/develop | 2021-06-28T06:09:06.239674 | 2020-10-27T14:26:08 | 2020-10-27T14:26:08 | 144,481,699 | 9 | 0 | Apache-2.0 | 2020-10-05T09:13:49 | 2018-08-12T16:14:25 | Java | UTF-8 | Java | false | false | 524 | java | package Leetcode;
import java.util.Random;
public class Solution_382_RandomNodeLinkedList {
private ListNode head;
private Random random;
public Solution_382_RandomNodeLinkedList(ListNode h) {
head = h;
random = new Random();
}
public int getRandom() {
ListNode current = head;
int result = current.val;
for (int i = 1; current.next != null; i++) {
current = current.next;
if (random.nextInt(i + 1) == i) {
result = current.val;
}
}
return result;
}
}
| [
"pahujaaakash5@gmail.com"
] | pahujaaakash5@gmail.com |
7d13a119e45e7a4d6508b70e539b7d6daf7c22a0 | c3bafabd9ad1b1b66f07d5c5c3aa81cd6508ae6b | /FlickrGallery/app/src/main/java/kailianc/andrew/cmu/edu/flickrgallery/model/SuggestionProvider.java | 571902f717f6adeac2fa97a8527d17b2002b6af8 | [] | no_license | bbfeechen/FlickrGallery | 06db701279549b96edb6f7dea84254635f80136d | c5fd05e866db2edec85417355f9c2527741e0ca9 | refs/heads/master | 2021-01-10T13:22:45.863284 | 2018-02-04T10:09:42 | 2018-02-04T10:09:42 | 47,945,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 734 | java | package kailianc.andrew.cmu.edu.flickrgallery.model;
import android.content.SearchRecentSuggestionsProvider;
/**
* Author : KAILIANG CHEN<br>
* Version : 1.0<br>
* Date : 12/13/15<p>
*
* Customized Content Provider class for search suggestion function.
*
*/
public class SuggestionProvider extends SearchRecentSuggestionsProvider {
// part of content uri which is defined in AndroidManifest.xml
public static final String AUTHORITY = "kailianc.andrew.cmu.edu.flickrgallery.model" +
".SuggestionProvider";
// suggestion mode which gives recent queries
public static final int MODE = DATABASE_MODE_QUERIES;
public SuggestionProvider() {
setupSuggestions(AUTHORITY, MODE);
}
}
| [
"bbfeechen@gmail.com"
] | bbfeechen@gmail.com |
440e6c6ab667edfd5e874bbbbeaa0163f46d93b8 | acbd679269175cdbd9b00eae69662d4d2b609677 | /src/test/java/com/xxx/rte/web/rest/TestUtil.java | a5b35a38c8fcaa6b328970f3c5891a44f76064a9 | [] | no_license | terracina-r/xxx | fb40b1541a324c75a62ece7aaf51c376a3258992 | e8cae7ec2b824b32052477952a26a4a6d7f39578 | refs/heads/master | 2020-09-04T11:11:20.348478 | 2019-11-05T10:24:52 | 2019-11-05T10:24:52 | 219,717,410 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,128 | java | package com.xxx.rte.web.rest;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
import org.springframework.format.support.DefaultFormattingConversionService;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.http.MediaType;
import java.io.IOException;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Utility class for testing REST controllers.
*/
public final class TestUtil {
private static final ObjectMapper mapper = createObjectMapper();
/** MediaType for JSON UTF8 */
public static final MediaType APPLICATION_JSON_UTF8 = MediaType.APPLICATION_JSON_UTF8;
private static ObjectMapper createObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
mapper.registerModule(new JavaTimeModule());
return mapper;
}
/**
* Convert an object to JSON byte array.
*
* @param object the object to convert.
* @return the JSON byte array.
* @throws IOException
*/
public static byte[] convertObjectToJsonBytes(Object object) throws IOException {
return mapper.writeValueAsBytes(object);
}
/**
* Create a byte array with a specific size filled with specified data.
*
* @param size the size of the byte array.
* @param data the data to put in the byte array.
* @return the JSON byte array.
*/
public static byte[] createByteArray(int size, String data) {
byte[] byteArray = new byte[size];
for (int i = 0; i < size; i++) {
byteArray[i] = Byte.parseByte(data, 2);
}
return byteArray;
}
/**
* A matcher that tests that the examined string represents the same instant as the reference datetime.
*/
public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher<String> {
private final ZonedDateTime date;
public ZonedDateTimeMatcher(ZonedDateTime date) {
this.date = date;
}
@Override
protected boolean matchesSafely(String item, Description mismatchDescription) {
try {
if (!date.isEqual(ZonedDateTime.parse(item))) {
mismatchDescription.appendText("was ").appendValue(item);
return false;
}
return true;
} catch (DateTimeParseException e) {
mismatchDescription.appendText("was ").appendValue(item)
.appendText(", which could not be parsed as a ZonedDateTime");
return false;
}
}
@Override
public void describeTo(Description description) {
description.appendText("a String representing the same Instant as ").appendValue(date);
}
}
/**
* Creates a matcher that matches when the examined string represents the same instant as the reference datetime.
* @param date the reference datetime against which the examined string is checked.
*/
public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) {
return new ZonedDateTimeMatcher(date);
}
/**
* Verifies the equals/hashcode contract on the domain object.
*/
public static <T> void equalsVerifier(Class<T> clazz) throws Exception {
T domainObject1 = clazz.getConstructor().newInstance();
assertThat(domainObject1.toString()).isNotNull();
assertThat(domainObject1).isEqualTo(domainObject1);
assertThat(domainObject1.hashCode()).isEqualTo(domainObject1.hashCode());
// Test with an instance of another class
Object testOtherObject = new Object();
assertThat(domainObject1).isNotEqualTo(testOtherObject);
assertThat(domainObject1).isNotEqualTo(null);
// Test with an instance of the same class
T domainObject2 = clazz.getConstructor().newInstance();
assertThat(domainObject1).isNotEqualTo(domainObject2);
// HashCodes are equals because the objects are not persisted yet
assertThat(domainObject1.hashCode()).isEqualTo(domainObject2.hashCode());
}
/**
* Create a {@link FormattingConversionService} which use ISO date format, instead of the localized one.
* @return the {@link FormattingConversionService}.
*/
public static FormattingConversionService createFormattingConversionService() {
DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService ();
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(dfcs);
return dfcs;
}
private TestUtil() {}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
a2b5d401dc91ac72c05f844a7df57822ffc7d352 | b5a4790330d45512e481060d0e930223defbbb35 | /src/main/java/com/igomall/controller/admin/PointController.java | c4a86951cad74258c20e5e2dec6027d858e36159 | [] | no_license | heyewei/cms_shop | 451081a46b03e85938d8dd256a9b97662241ac63 | 29047908c40202ddaa3487369a4429ab15634b9d | refs/heads/master | 2023-02-13T15:43:17.118001 | 2020-12-29T09:58:52 | 2020-12-29T09:58:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,920 | java | /*
* Copyright 2008-2018 shopxx.net. All rights reserved.
* Support: localhost
* License: localhost/license
* FileId: KCodXagnBcJs4ImshCa49UnNrj833dNP
*/
package com.igomall.controller.admin;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import org.apache.commons.lang.StringUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.igomall.Pageable;
import com.igomall.Results;
import com.igomall.entity.Admin;
import com.igomall.entity.Member;
import com.igomall.entity.PointLog;
import com.igomall.security.CurrentUser;
import com.igomall.service.MemberService;
import com.igomall.service.PointLogService;
/**
* Controller - 积分
*
* @author 爱购 Team
* @version 6.1
*/
@Controller("adminPointController")
@RequestMapping("/admin/point")
public class PointController extends BaseController {
@Inject
private PointLogService pointLogService;
@Inject
private MemberService memberService;
/**
* 会员选择
*/
@GetMapping("/member_select")
public ResponseEntity<?> memberSelect(String keyword) {
List<Map<String, Object>> data = new ArrayList<>();
if (StringUtils.isEmpty(keyword)) {
return ResponseEntity.ok(data);
}
List<Member> members = memberService.search(keyword, null, null);
for (Member member : members) {
Map<String, Object> item = new HashMap<>();
item.put("id", member.getId());
item.put("name", member.getUsername());
item.put("point", member.getPoint());
data.add(item);
}
return ResponseEntity.ok(data);
}
/**
* 调整
*/
@GetMapping("/adjust")
public String adjust() {
return "admin/point/adjust";
}
/**
* 调整
*/
@PostMapping("/adjust")
public ResponseEntity<?> adjust(Long memberId, long amount, String memo, @CurrentUser Admin currentUser) {
Member member = memberService.find(memberId);
if (member == null) {
return Results.UNPROCESSABLE_ENTITY;
}
if (amount == 0) {
return Results.UNPROCESSABLE_ENTITY;
}
if (member.getPoint() == null || member.getPoint() + amount < 0) {
return Results.UNPROCESSABLE_ENTITY;
}
memberService.addPoint(member, amount, PointLog.Type.ADJUSTMENT, memo);
return Results.OK;
}
/**
* 记录
*/
@GetMapping("/log")
public String log(Long memberId, Pageable pageable, ModelMap model) {
Member member = memberService.find(memberId);
if (member != null) {
model.addAttribute("member", member);
model.addAttribute("page", pointLogService.findPage(member, pageable));
} else {
model.addAttribute("page", pointLogService.findPage(pageable));
}
return "admin/point/log";
}
} | [
"1169794338@qq.com"
] | 1169794338@qq.com |
7e89d61060874e12b7e63bd05d38059ff02408f9 | 53ebcb2718b5f425bf665f6933f9889145244162 | /src/main/java/com/nttdata/sf/partner/UnexpectedErrorFault_Exception.java | 99527dd6a99e102bb9cfdc3e1a55333268c782fd | [] | no_license | okoeth/apex-analyser | 3125464fec1a9c21028b13aac1c71dab7da00f1e | f0ecb42c5f5dce69aed1f42eabb2873f2932cfed | refs/heads/master | 2016-09-08T00:42:24.047163 | 2015-08-01T17:33:01 | 2015-08-01T17:33:01 | 29,812,122 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,174 | java |
package com.nttdata.sf.partner;
import javax.xml.ws.WebFault;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.4-b01
* Generated source version: 2.2
*
*/
@WebFault(name = "UnexpectedErrorFault", targetNamespace = "urn:fault.partner.soap.sforce.com")
public class UnexpectedErrorFault_Exception
extends Exception
{
/**
* Java type that goes as soapenv:Fault detail element.
*
*/
private UnexpectedErrorFault faultInfo;
/**
*
* @param message
* @param faultInfo
*/
public UnexpectedErrorFault_Exception(String message, UnexpectedErrorFault faultInfo) {
super(message);
this.faultInfo = faultInfo;
}
/**
*
* @param message
* @param faultInfo
* @param cause
*/
public UnexpectedErrorFault_Exception(String message, UnexpectedErrorFault faultInfo, Throwable cause) {
super(message, cause);
this.faultInfo = faultInfo;
}
/**
*
* @return
* returns fault bean: com.nttdata.sf.partner.UnexpectedErrorFault
*/
public UnexpectedErrorFault getFaultInfo() {
return faultInfo;
}
}
| [
"koeth@acm.org"
] | koeth@acm.org |
c1fbe7ee5bc7629c3a3281d6601ea7c60fd47e4b | 40835a17cf815a1cf4755669a98ff8e35bee2e5d | /src/main/java/com/jokkoapps/jokkoapps/security/JwtAuthenticationFilter.java | f42ccfb17bc70a4f96f25765051e6fa6eaf6b78c | [] | no_license | gbabspro/backlab | db6c4589f7c368f70c3461909a788d20895edd34 | 92b1783777e3bf62360dbc8e62c8b33159ebc796 | refs/heads/master | 2021-06-23T12:25:19.978290 | 2020-04-22T22:36:21 | 2020-04-22T22:36:21 | 208,473,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,448 | java | package com.jokkoapps.jokkoapps.security;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.util.StringUtils;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class JwtAuthenticationFilter extends OncePerRequestFilter {
@Autowired
private JwtTokenProvider tokenProvider;
@Autowired
private CustomUserDetailsService customUserDetailsService;
private static final Logger logger = LoggerFactory.getLogger(JwtAuthenticationFilter.class);
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
try {
String jwt = getJwtFromRequest(request);
if (StringUtils.hasText(jwt) && tokenProvider.validateToken(jwt)) {
Long userId = tokenProvider.getUserIdFromJWT(jwt);
UserDetails userDetails = customUserDetailsService.loadUserById(userId);
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authentication);
}
} catch (Exception ex) {
logger.error("Could not set user authentication in security context", ex);
}
filterChain.doFilter(request, response);
}
private String getJwtFromRequest(HttpServletRequest request) {
String bearerToken = request.getHeader("Authorization");
if (StringUtils.hasText(bearerToken) && bearerToken.startsWith("Bearer ")) {
return bearerToken.substring(7, bearerToken.length());
}
return null;
}
} | [
"you@example.com"
] | you@example.com |
2427a575e52a5fc35a02187f7c0236aff29c7f11 | 61b6a819a5a4afa7382d18d51737782e3a438006 | /PCODE/java/leetcodes/src/main/java/com/hit/math/linked_list/_160.java | 6c9c487eb9911c5c27c90675beeb09cca4953f40 | [
"MIT"
] | permissive | Artcontainer/myleetcode | 0502a11ab8a129a79645ddd2ee93a9668f9a8f6e | 5ed37789b65d5f7afd5738eaf60158c1b66c512e | refs/heads/master | 2020-06-12T01:01:54.890193 | 2019-06-25T06:18:36 | 2019-06-25T06:18:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,575 | java | package com.hit.math.linked_list;
import com.hit.utils.ListNode;
/**
* 160. Intersection of Two Linked Lists
* <p>
* Write a program to find the node at which the intersection of two singly linked lists begins.
* <p>
* <p>
* For example, the following two linked lists:
* <p>
* A: a1 → a2
* ↘
* c1 → c2 → c3
* ↗
* B: b1 → b2 → b3
* <p>
* begin to intersect at node c1.
* <p>
* <p>
* Notes:
* <p>
* If the two linked lists have no intersection at all, return null.
* The linked lists must retain their original structure after the function returns.
* You may assume there are no cycles anywhere in the entire linked structure.
* Your code should preferably run in O(n) time and use only O(1) memory.
*/
public class _160 {
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
/**
* Boundary check
*/
if (headA == null || headB == null) {
return null;
}
ListNode nodeA = headA;
ListNode nodeB = headB;
/**
* If a & b have different len,
* then we will stop the loop after second iteration
*/
while (nodeA != nodeB) {
/**
* For the end of first iteration,
* we just reset the pointer to the head of another linkedlist
*/
nodeA = (nodeA == null ? headB : nodeA.next);
nodeB = (nodeB == null ? headA : nodeB.next);
}
return nodeA;
}
}
| [
"guobinhit@gmail.com"
] | guobinhit@gmail.com |
998c255e631d854e42d8dcbadc55daa1c7400538 | e96172bcad99d9fddaa00c25d00a319716c9ca3a | /plugin/src/test/resources/codeInsight/daemonCodeAnalyzer/quickFix/accessStaticViaInstance/after3.java | 2653d2b2014f0ac3b3fd79164166699e800c6dd4 | [
"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 | 249 | java | // "Access static 'AClass.getA()' via class 'AClass' reference" "true"
class AClass
{
static AClass getA() {
return null;
}
static int fff;
}
class acc {
int f() {
AClass a = null;
<caret>AClass.getA();
return 0;
}
} | [
"vistall.valeriy@gmail.com"
] | vistall.valeriy@gmail.com |
18e878e245abb703b2cfdf293c5d4f6a8ed8fb94 | e561e962ecbdcdb8c849354b876665f959b70e5c | /app/src/main/java/com/video/liveshow/fragment/HomeHotFragment.java | f90e1f714a66b0d638f8c68b9fe8946f228fa0c8 | [] | no_license | xiongkai888/video_live | c59872ba98cdb0866af3d3df374901ff14f81157 | 9e24d87fb4fa8a6225766fec5aeb2b60ebca6aa4 | refs/heads/master | 2021-04-23T14:51:54.113601 | 2020-03-25T11:04:47 | 2020-03-25T11:04:47 | 249,933,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,664 | java | package com.video.liveshow.fragment;
import android.support.v7.widget.GridLayoutManager;
import com.alibaba.fastjson.JSON;
import com.video.liveshow.Constants;
import com.video.liveshow.R;
import com.video.liveshow.activity.VideoPlayActivity;
import com.video.liveshow.adapter.FollowVideoAdapter;
import com.video.liveshow.bean.VideoBean;
import com.video.liveshow.custom.ItemDecoration;
import com.video.liveshow.custom.RefreshAdapter;
import com.video.liveshow.custom.RefreshView;
import com.video.liveshow.http.HttpCallback;
import com.video.liveshow.http.HttpUtil;
import com.video.liveshow.interfaces.OnItemClickListener;
import com.video.liveshow.utils.VideoStorge;
import java.util.Arrays;
import java.util.List;
/**
* Created by cxf on 2018/6/9.
*/
public class HomeHotFragment extends AbsFragment implements OnItemClickListener<VideoBean> {
private RefreshView mRefreshView;
private FollowVideoAdapter mFollowAdapter;
private boolean mFirst = true;
@Override
protected int getLayoutId() {
return R.layout.fragment_home_hot;
}
@Override
protected void main() {
mRefreshView = (RefreshView) mRootView.findViewById(R.id.refreshView);
mRefreshView.setNoDataLayoutId(R.layout.view_no_data_default);
mRefreshView.setDataHelper(new RefreshView.DataHelper<VideoBean>() {
@Override
public RefreshAdapter<VideoBean> getAdapter() {
if (mFollowAdapter == null) {
mFollowAdapter = new FollowVideoAdapter(mContext);
mFollowAdapter.setOnItemClickListener(HomeHotFragment.this);
}
return mFollowAdapter;
}
@Override
public void loadData(int p, HttpCallback callback) {
HttpUtil.getVideoList(p, callback);
}
@Override
public List<VideoBean> processData(String[] info) {
return JSON.parseArray(Arrays.toString(info), VideoBean.class);
}
@Override
public void onRefresh(List<VideoBean> list) {
VideoStorge.getInstance().put(Constants.VIDEO_HOT, list);
}
@Override
public void onNoData(boolean noData) {
}
@Override
public void onLoadDataCompleted(int dataCount) {
}
});
mRefreshView.setLayoutManager(new GridLayoutManager(mContext, 2, GridLayoutManager.VERTICAL, false));
ItemDecoration decoration = new ItemDecoration(mContext, 0x00000000, 2, 2);
decoration.setOnlySetItemOffsetsButNoDraw(true);
mRefreshView.setItemDecoration(decoration);
}
public void init(){
mRefreshView.initData(true);
}
@Override
public void onItemClick(VideoBean bean, int position) {
if (mRefreshView != null && bean != null && bean.getUserinfo() != null) {
VideoPlayActivity.forwardVideoPlay(mContext, Constants.VIDEO_HOT, position, mRefreshView.getPage(), bean.getUserinfo(),bean.getIsattent());
}
}
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (!hidden) {
if (mFirst) {
mFirst = false;
mRefreshView.initData();
}
}
}
@Override
public void onDestroyView() {
HttpUtil.cancel(HttpUtil.GET_VIDEO_LIST);
super.onDestroyView();
}
@Override
public void onDestroy() {
if(mRefreshView!=null){
mRefreshView.setDataHelper(null);
}
super.onDestroy();
}
}
| [
"173422042@qq.com"
] | 173422042@qq.com |
85aa9efbd3d01b91e1d671f0bb15e91317ed7e25 | 53d6a07c1a7f7ce6f58135fefcbd0e0740b059a6 | /workspace/SeektingLibiary-master/src/com/seekting/activity/MainActivity.java | b937eb379357ad9fadbc0a55616e75f2f6474cf4 | [] | no_license | jx-admin/Code2 | 33dfa8d7a1acfa143d07309b6cf33a9ad7efef7f | c0ced8c812c0d44d82ebd50943af8b3381544ec7 | refs/heads/master | 2021-01-15T15:36:33.439310 | 2017-05-17T03:22:30 | 2017-05-17T03:22:30 | 43,429,217 | 8 | 4 | null | null | null | null | UTF-8 | Java | false | false | 331 | java |
package com.seekting.activity;
import android.app.Activity;
import android.os.Bundle;
import com.seekting.R;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"jx.wang@holaverse.com"
] | jx.wang@holaverse.com |
0b0be6446666b6b229272b7fb1e09659df552f86 | e33249f4c2923a13bf9ec30c50223a7b4776045d | /src/main/java/org/tugraz/sysds/lops/Transform.java | 2b750cc7a263598f2044c69b8b065108c1c490a8 | [
"Apache-2.0"
] | permissive | johannaSommer/systemds | deca77e228f21a9577a6ea95349459f2c794d501 | 1af9ff3efe8ec8239ddf049cf0af95573efe0670 | refs/heads/master | 2020-08-30T10:46:40.845672 | 2019-10-25T21:11:23 | 2019-10-25T21:11:50 | 218,355,784 | 1 | 0 | Apache-2.0 | 2019-10-29T18:28:00 | 2019-10-29T18:28:00 | null | UTF-8 | Java | false | false | 5,381 | java | /*
* Modifications Copyright 2019 Graz University of Technology
*
* 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.tugraz.sysds.lops;
import org.tugraz.sysds.lops.LopProperties.ExecType;
import org.tugraz.sysds.common.Types.DataType;
import org.tugraz.sysds.common.Types.ValueType;
/*
* Lop to perform transpose/vector to diag operations
* This lop can change the keys and hence break alignment.
*/
public class Transform extends Lop
{
public enum OperationTypes {
Transpose,
Diag,
Reshape,
Sort,
Rev
}
private OperationTypes operation = null;
private boolean _bSortIndInMem = false;
private boolean _outputEmptyBlock = true;
private int _numThreads = 1;
public Transform(Lop input, Transform.OperationTypes op, DataType dt, ValueType vt, ExecType et) {
this(input, op, dt, vt, et, 1);
}
public Transform(Lop[] inputs, Transform.OperationTypes op, DataType dt, ValueType vt, boolean outputEmptyBlock, ExecType et) {
this(inputs, op, dt, vt, et, 1);
_outputEmptyBlock = outputEmptyBlock;
}
public Transform(Lop input, Transform.OperationTypes op, DataType dt, ValueType vt, ExecType et, int k) {
super(Lop.Type.Transform, dt, vt);
init(new Lop[]{input}, op, dt, vt, et);
_numThreads = k;
}
public Transform(Lop[] inputs, Transform.OperationTypes op, DataType dt, ValueType vt, ExecType et, int k) {
super(Lop.Type.Transform, dt, vt);
init(inputs, op, dt, vt, et);
_numThreads = k;
}
public Transform(Lop input, Transform.OperationTypes op, DataType dt, ValueType vt, ExecType et, boolean bSortIndInMem) {
super(Lop.Type.Transform, dt, vt);
_bSortIndInMem = bSortIndInMem;
init(new Lop[]{input}, op, dt, vt, et);
}
public Transform(Lop[] inputs, Transform.OperationTypes op, DataType dt, ValueType vt, ExecType et, boolean bSortIndInMem) {
super(Lop.Type.Transform, dt, vt);
_bSortIndInMem = bSortIndInMem;
init(inputs, op, dt, vt, et);
}
private void init (Lop[] input, Transform.OperationTypes op, DataType dt, ValueType vt, ExecType et)
{
operation = op;
for(Lop in : input) {
this.addInput(in);
in.addOutput(this);
}
lps.setProperties( inputs, et);
}
@Override
public String toString() {
return " Operation: " + operation;
}
/**
* method to get operation type
* @return operaton type
*/
public OperationTypes getOperationType()
{
return operation;
}
private String getOpcode() {
switch(operation) {
case Transpose:
// Transpose a matrix
return "r'";
case Rev:
// Transpose a matrix
return "rev";
case Diag:
// Transform a vector into a diagonal matrix
return "rdiag";
case Reshape:
// Transform a vector into a diagonal matrix
return "rshape";
case Sort:
// Transform a matrix into a sorted matrix
return "rsort";
default:
throw new UnsupportedOperationException(this.printErrorLocation() + "Instruction is not defined for Transform operation " + operation);
}
}
//CP instructions
@Override
public String getInstructions(String input1, String output) {
//opcodes: r', rev, rdiag
return getInstructions(input1, 1, output);
}
@Override
public String getInstructions(String input1, String input2, String input3, String input4, String output) {
//opcodes: rsort
return getInstructions(input1, 4, output);
}
@Override
public String getInstructions(String input1, String input2, String input3, String input4, String input5, String output) {
//opcodes: rshape
return getInstructions(input1, 5, output);
}
private String getInstructions(String input1, int numInputs, String output) {
StringBuilder sb = new StringBuilder();
sb.append( getExecType() );
sb.append( OPERAND_DELIMITOR );
sb.append( getOpcode() );
sb.append( OPERAND_DELIMITOR );
sb.append( getInputs().get(0).prepInputOperand(input1));
//rows, cols, byrow
for( int i = 1; i < numInputs; i++ ) {
Lop ltmp = getInputs().get(i);
sb.append( OPERAND_DELIMITOR );
sb.append( ltmp.prepScalarInputOperand(getExecType()));
}
//output
sb.append( OPERAND_DELIMITOR );
sb.append( this.prepOutputOperand(output));
if( getExecType()==ExecType.CP && operation == OperationTypes.Transpose ) {
sb.append( OPERAND_DELIMITOR );
sb.append( _numThreads );
}
if( getExecType()==ExecType.SPARK && operation == OperationTypes.Reshape ) {
sb.append( OPERAND_DELIMITOR );
sb.append( _outputEmptyBlock );
}
if( getExecType()==ExecType.SPARK && operation == OperationTypes.Sort ){
sb.append( OPERAND_DELIMITOR );
sb.append( _bSortIndInMem );
}
return sb.toString();
}
}
| [
"mboehm7@gmail.com"
] | mboehm7@gmail.com |
05ac86c011e5bbdc1ed8d67d0e342b25c026da9c | b8fbc8c768253f03d0f25897a4a58382f78c8fd8 | /Flynas/src/test/java/flynas/web/production/routes/TC73_roundTripDomesticFlex_JED_DMM.java | ac165abc6373423246b8fa3e3710e579135b88e6 | [] | no_license | CignitiFlynas/Android | 23006014955f6679236bf4b96d76bad7f53a6474 | 81725bb0c473d52bd30a87f8c6b78c919574cd5b | refs/heads/master | 2020-03-23T12:33:08.740591 | 2018-07-19T09:51:42 | 2018-07-19T09:51:42 | 141,565,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,468 | java | package flynas.web.production.routes;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import com.ctaf.accelerators.TestEngine;
import com.ctaf.support.ExcelReader;
import com.ctaf.support.HtmlReportSupport;
import com.ctaf.utilities.Reporter;
import flynas.web.testObjects.BookingPageLocators;
import flynas.web.workflows.BookingPageFlow;
public class TC73_roundTripDomesticFlex_JED_DMM extends BookingPageFlow{
ExcelReader xls = new ExcelReader(configProps.getProperty("TestDataProdRoutes"),"Chrome_TestData");
@Test(dataProvider = "testData",groups={"Flex"})
public void TC_73_roundTripDomesticFlex_JED_DMM( String bookingClass,
String mobilenum,
String paymentType,
String newDate,
String Departuredate,String rtnDate,
String origin,
String dest,String triptype,String adult,String child,String infant,String seatSelect,
String Description) throws Throwable {
try {
TestEngine.testDescription.put(HtmlReportSupport.tc_name, Description);
String deptDate = pickDate(Departuredate);
String retrnDate = pickDate(rtnDate);
String[] Credentials = pickCredentials("UserCredentials");
String username =Credentials[0];
String password =Credentials[1];
click(BookingPageLocators.login_lnk, "Login");
login(username,password);
inputBookingDetails(triptype,origin, dest, deptDate , "", "", retrnDate,adult, child, infant,"","","");
selectClass(bookingClass, triptype);
waitforElement(BookingPageLocators.passengerDetailsTittle);
waitUtilElementhasAttribute(BookingPageLocators.body);
clickContinueBtn();
waitforElement(BookingPageLocators.baggagetittle);
waitUtilElementhasAttribute(BookingPageLocators.body);
if(isElementDisplayedTemp(BookingPageLocators.baggagetittle)==true){
clickContinueBtn();
}else{
System.out.println("No Baggae Page Available");
}
waitforElement(BookingPageLocators.selectseattittle);
waitUtilElementhasAttribute(BookingPageLocators.body);
if(isElementDisplayedTemp(BookingPageLocators.selectseattittle)){
clickContinueBtn();
if(isElementDisplayedTemp(BookingPageLocators.ok))
click(BookingPageLocators.ok, "OK");
}
payment(paymentType, "");
String strpnr = getReferenceNumber();
String strPNR = strpnr.trim();
System.out.println(strPNR);
verifyPNRforSadad();
Reporter.SuccessReport("TC73_roundTripDomesticFlex_JED_DMM", "Pass");
}
catch (Exception e) {
e.printStackTrace();
Reporter.failureReport("TC73_roundTripDomesticFlex_JED_DMM", "Failed");
}
}
@DataProvider(name="testData")
public Object[][] createdata1() {
return (Object[][]) new Object[][] {
{
xls.getCellValue("Booking Class", "Value2"),
xls.getCellValue("Mobile", "Value"),
xls.getCellValue("Payment Type", "Value"),
xls.getCellValue("NewDate", "Value"),
xls.getCellValue("Departure Date", "Value"),
xls.getCellValue("Return Date", "Value"),
xls.getCellValue("Origin", "Value11"),
xls.getCellValue("Destination", "Value11"),
xls.getCellValue("Trip Type", "Value2"),
xls.getCellValue("Adults Count", "Value"),
xls.getCellValue("Child Count", "Value"),
xls.getCellValue("Infant Count", "Value"),
"Extra Leg Room",
"Validate RoundTrip Domestic Flex_JED_DMM"}};
}
}
| [
"Indrajeet.kumar@cigniti.com"
] | Indrajeet.kumar@cigniti.com |
72e44d8b8be9f74afc434eacf5fe886efc539f05 | 9e4601501c71f6690e0f7bd99f157d7076a481b3 | /vendor/fop/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java | 0d6a1b1dc45f2361c9ba00d457e8d694f6725bb4 | [
"Apache-2.0"
] | permissive | Fallmist42/hq | 5d74ae98d766b16dd047bde7a3433fa22a3643f0 | b67e302b8660318d84583c9138b9b59f56a05787 | refs/heads/master | 2020-12-11T08:06:22.887854 | 2015-10-02T14:22:17 | 2015-10-02T14:22:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,165 | 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: PreviewDialogAboutBox.java 1296526 2012-03-03 00:18:45Z gadams $ */
package org.apache.fop.render.awt.viewer;
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import org.apache.fop.Version;
/**
* AWT Viewer's "About" dialog.
* Originally contributed by:
* Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com,
* Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com,
* Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com
*/
public class PreviewDialogAboutBox extends Dialog implements ActionListener {
private JButton okButton;
/**
* Creates modal "About" dialog, attached to a given parent frame.
* @param parent parent frame
* @param translator Translator for localization
*/
public PreviewDialogAboutBox(Frame parent, Translator translator) {
super(parent, true);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
setTitle(translator.getString("About.Title"));
setResizable(false);
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
JPanel insetsPanel1 = new JPanel();
JPanel insetsPanel2 = new JPanel();
JPanel insetsPanel3 = new JPanel();
okButton = new JButton();
JLabel imageControl1 = new JLabel();
imageControl1.setIcon(new ImageIcon(getClass().getResource("images/fop.gif")));
JLabel label1 = new JLabel(translator.getString("About.Product"));
JLabel label2 = new JLabel(translator.getString("About.Version")
+ " " + Version.getVersion());
JLabel label3 = new JLabel(translator.getString("About.Copyright"));
panel1.setLayout(new BorderLayout());
panel2.setLayout(new BorderLayout());
insetsPanel1.setLayout(new FlowLayout());
insetsPanel2.setLayout(new FlowLayout());
insetsPanel2.setBorder(new EmptyBorder(10, 10, 10, 10));
insetsPanel3.setLayout(new GridLayout(3, 1));
insetsPanel3.setBorder(new EmptyBorder(10, 10, 10, 10));
okButton.setText(translator.getString("Button.Ok"));
okButton.addActionListener(this);
insetsPanel2.add(imageControl1, null);
panel2.add(insetsPanel2, BorderLayout.WEST);
insetsPanel3.add(label1);
insetsPanel3.add(label2);
insetsPanel3.add(label3);
panel2.add(insetsPanel3, BorderLayout.CENTER);
insetsPanel1.add(okButton);
panel1.add(insetsPanel1, BorderLayout.SOUTH);
panel1.add(panel2, BorderLayout.NORTH);
add(panel1);
pack();
}
/**
* {@inheritDoc}
*/
protected void processWindowEvent(WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
cancel();
}
super.processWindowEvent(e);
}
private void cancel() {
dispose();
}
/**
* {@inheritDoc}
*/
public void actionPerformed(ActionEvent e) {
if (e.getSource() == okButton) {
cancel();
}
}
}
| [
"vau2007@rambler.ru"
] | vau2007@rambler.ru |
25bfabcd74cab7af747560597c632a1d8227d580 | 6f439a8d39b3f058a16d2309923935535b4a9d3a | /kie-wb-common-services/kie-wb-common-services-backend/src/test/java/org/kie/workbench/common/services/backend/project/ProjectServiceImplNewProjectTest.java | 5bcd13901ef732ac4f7d108c771a403fde602c7e | [
"Apache-2.0"
] | permissive | swayampb/kie-wb-common | 25cf29e31305041f9b11919abc7a331d0a7f85e6 | 0e8671e3872e75ac98980e12899472f305727a36 | refs/heads/master | 2020-12-26T01:12:18.052359 | 2015-10-02T09:44:39 | 2015-10-12T09:58:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,432 | java | /*
* Copyright 2013 JBoss 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.kie.workbench.common.services.backend.project;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import javax.enterprise.event.Event;
import org.guvnor.common.services.project.backend.server.ProjectConfigurationContentHandler;
import org.guvnor.common.services.project.builder.events.InvalidateDMOProjectCacheEvent;
import org.guvnor.common.services.project.events.DeleteProjectEvent;
import org.guvnor.common.services.project.events.NewPackageEvent;
import org.guvnor.common.services.project.events.NewProjectEvent;
import org.guvnor.common.services.project.events.RenameProjectEvent;
import org.guvnor.common.services.project.model.POM;
import org.guvnor.common.services.project.model.Package;
import org.guvnor.common.services.project.model.Project;
import org.guvnor.common.services.project.service.POMService;
import org.guvnor.common.services.project.service.ProjectService;
import org.guvnor.structure.repositories.Repository;
import org.guvnor.structure.server.config.ConfigurationFactory;
import org.guvnor.structure.server.config.ConfigurationService;
import org.jboss.errai.security.shared.api.identity.User;
import org.junit.Before;
import org.junit.Test;
import org.kie.workbench.common.services.shared.kmodule.KModuleService;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.uberfire.backend.vfs.Path;
import org.uberfire.io.IOService;
import org.uberfire.java.nio.file.FileSystemNotFoundException;
import org.uberfire.java.nio.file.FileSystems;
import org.uberfire.rpc.SessionInfo;
import static junit.framework.Assert.*;
import static org.mockito.Mockito.*;
public class ProjectServiceImplNewProjectTest {
private IOService ioService;
private ProjectService projectService;
@Before
public void setup() {
ioService = mock( IOService.class );
final POMService pomService = mock( POMService.class );
final KModuleService kModuleService = mock( KModuleService.class );
final ProjectConfigurationContentHandler projectConfigurationContentHandler = new ProjectConfigurationContentHandler();
final ConfigurationService configurationService = mock( ConfigurationService.class );
final ConfigurationFactory configurationFactory = mock( ConfigurationFactory.class );
final Event<NewProjectEvent> newProjectEvent = mock( Event.class );
final Event<NewPackageEvent> newPackageEvent = mock( Event.class );
final Event<RenameProjectEvent> renameProjectEvent = mock( Event.class );
final Event<DeleteProjectEvent> deleteProjectEvent = mock( Event.class );
final Event<InvalidateDMOProjectCacheEvent> invalidateDMOCache = mock( Event.class );
final User identity = mock( User.class );
final SessionInfo sessionInfo = mock( SessionInfo.class );
final Project project = mock( Project.class );
final Path projectRootPath = mock( Path.class );
when( project.getRootPath() ).thenReturn( projectRootPath );
when( projectRootPath.toURI() ).thenReturn( "git://test/p0" );
when( ioService.createDirectory( any( org.uberfire.java.nio.file.Path.class ) ) ).thenAnswer( new Answer<Object>() {
@Override
public Object answer( final InvocationOnMock invocation ) throws Throwable {
return invocation.getArguments()[ 0 ];
}
} );
projectService = new ProjectServiceImpl( ioService,
pomService,
kModuleService,
projectConfigurationContentHandler,
configurationService,
configurationFactory,
newProjectEvent,
newPackageEvent,
renameProjectEvent,
deleteProjectEvent,
invalidateDMOCache,
identity,
sessionInfo ) {
@Override
//Override Package resolution as we don't have the Project Structure set-up in this test
public Package resolvePackage( final Path resource ) {
return makePackage( project,
resource );
}
};
assertNotNull( projectService );
}
@Test
public void testPackageNameWhiteList() throws URISyntaxException {
final URI fs = new URI( "git://test" );
try {
FileSystems.getFileSystem( fs );
} catch ( FileSystemNotFoundException e ) {
FileSystems.newFileSystem( fs,
new HashMap<String, Object>() );
}
final Map<String, String> writes = new HashMap<String, String>();
final Repository repository = mock( Repository.class );
final String name = "p0";
final POM pom = new POM();
final String baseURL = "/";
final Path repositoryRootPath = mock( Path.class );
when( repository.getRoot() ).thenReturn( repositoryRootPath );
when( repositoryRootPath.toURI() ).thenReturn( "git://test" );
when( ioService.write( any( org.uberfire.java.nio.file.Path.class ),
anyString() ) ).thenAnswer( new Answer<Object>() {
@Override
public Object answer( final InvocationOnMock invocation ) throws Throwable {
if ( invocation.getArguments().length == 2 ) {
final String path = ( (org.uberfire.java.nio.file.Path) invocation.getArguments()[ 0 ] ).toUri().getPath();
final String content = ( (String) invocation.getArguments()[ 1 ] );
writes.put( path,
content );
}
return invocation.getArguments()[ 0 ];
}
} );
pom.getGav().setGroupId( "org.kie.workbench.services" );
pom.getGav().setArtifactId( "kie-wb-common-services-test" );
pom.getGav().setVersion( "1.0.0-SNAPSHOT" );
projectService.newProject( repository,
name,
pom,
baseURL );
assertTrue( writes.containsKey( "/p0/package-names-white-list" ) );
assertEquals( "org.kie.workbench.services.kie_wb_common_services_test.**",
writes.get( "/p0/package-names-white-list" ) );
}
}
| [
"michael.anstis@gmail.com"
] | michael.anstis@gmail.com |
0a6301200384b0638fc91f7f5e21c98ac48164f6 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/15/15_c20d4adbe79fa1aaee6616a2ba0c66535eace29c/PermissionsPopupPresenterWidget/15_c20d4adbe79fa1aaee6616a2ba0c66535eace29c_PermissionsPopupPresenterWidget_s.java | 4c3f91fc7c19598a759eb90d71b00a4b8e5f097b | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,290 | java | package org.ovirt.engine.ui.webadmin.section.main.presenter.popup;
import org.ovirt.engine.core.compat.Event;
import org.ovirt.engine.core.compat.EventArgs;
import org.ovirt.engine.core.compat.IEventListener;
import org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel;
import org.ovirt.engine.ui.webadmin.widget.HasUiCommandClickHandlers;
import org.ovirt.engine.ui.webadmin.widget.dialog.PopupNativeKeyPressHandler;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.HasBlurHandlers;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.dom.client.HasFocusHandlers;
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HasHandlers;
import com.google.gwt.user.client.ui.HasValue;
import com.google.inject.Inject;
public class PermissionsPopupPresenterWidget extends AbstractModelBoundPopupPresenterWidget<AdElementListModel, PermissionsPopupPresenterWidget.ViewDef> {
public interface ViewDef extends AbstractModelBoundPopupPresenterWidget.ViewDef<AdElementListModel> {
HasUiCommandClickHandlers getSearchButton();
HasKeyPressHandlers getKeyPressSearchInputBox();
HasValue<String> getSearchString();
HasClickHandlers getEveryoneRadio();
HasClickHandlers getSpecificUserOrGroupRadio();
HasHandlers getSearchStringEditor();
PopupNativeKeyPressHandler getNativeKeyPressHandler();
void changeStateOfElementsWhenAccessIsForEveryone(boolean isEveryone);
void hideRoleSelection(Boolean indic);
void hideEveryoneSelection(Boolean indic);
}
@Inject
public PermissionsPopupPresenterWidget(EventBus eventBus, ViewDef view) {
super(eventBus, view);
}
@Override
public void init(final AdElementListModel model) {
// Let the parent do its work:
super.init(model);
getView().getSearchButton().setCommand(model.getSearchCommand());
registerHandler(getView().getSearchButton().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
getView().getSearchButton().getCommand().Execute();
}
}));
registerHandler(getView().getKeyPressSearchInputBox().addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (KeyCodes.KEY_ENTER == event.getNativeEvent().getKeyCode()) {
model.setSearchString(getView().getSearchString().getValue());
getView().getSearchButton().getCommand().Execute();
}
}
}));
registerHandler(getView().getEveryoneRadio().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
model.setIsEveryoneSelected(true);
getView().changeStateOfElementsWhenAccessIsForEveryone(true);
// Disable relevant elements
}
}));
registerHandler(getView().getSpecificUserOrGroupRadio().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
model.setIsEveryoneSelected(false);
getView().changeStateOfElementsWhenAccessIsForEveryone(false);
}
}));
model.getIsRoleListHiddenModel().getPropertyChangedEvent().addListener(new IEventListener() {
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
getView().hideRoleSelection(Boolean.parseBoolean(model.getIsRoleListHiddenModel()
.getEntity()
.toString()));
}
});
getView().hideEveryoneSelection((Boolean) model.getIsEveryoneSelectionHidden().getEntity());
model.getIsEveryoneSelectionHidden().getPropertyChangedEvent().addListener(new IEventListener() {
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
getView().hideEveryoneSelection(Boolean.parseBoolean(model.getIsRoleListHiddenModel()
.getEntity()
.toString()));
}
});
getView().setPopupKeyPressHandler(new PermissionPopupNativeKeyPressHandler(getView().getNativeKeyPressHandler()));
}
class PermissionPopupNativeKeyPressHandler implements PopupNativeKeyPressHandler {
private PopupNativeKeyPressHandler decorated;
private boolean hasFocus = false;
public PermissionPopupNativeKeyPressHandler(PopupNativeKeyPressHandler decorated) {
this.decorated = decorated;
((HasFocusHandlers) getView().getSearchStringEditor()).addFocusHandler(new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
hasFocus = true;
}
});
((HasBlurHandlers) getView().getSearchStringEditor()).addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent event) {
hasFocus = false;
}
});
}
@Override
public void onKeyPress(NativeEvent event) {
if (hasFocus && KeyCodes.KEY_ENTER == event.getKeyCode()) {
getView().getSearchButton().getCommand().Execute();
} else {
decorated.onKeyPress(event);
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
10bb2e909c82eda0f634e8cb576b2f930db04ca8 | 947fc9eef832e937f09f04f1abd82819cd4f97d3 | /src/apk/io/intercom/com/bumptech/glide/load/c/a/y.java | 62da3f7e3c0bcb5307de94013b578fc98a068d21 | [] | no_license | thistehneisen/cifra | 04f4ac1b230289f8262a0b9cf7448a1172d8f979 | d46c6f4764c9d4f64e45c56fa42fddee9b44ff5a | refs/heads/master | 2020-09-22T09:35:57.739040 | 2019-12-01T19:39:59 | 2019-12-01T19:39:59 | 225,136,583 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 721 | java | package io.intercom.com.bumptech.glide.load.c.a;
import io.intercom.com.bumptech.glide.load.i.a;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
/* compiled from: VideoBitmapDecoder */
class y implements a<Integer> {
/* renamed from: a reason: collision with root package name */
private final ByteBuffer f9644a = ByteBuffer.allocate(4);
y() {
}
public void a(byte[] bArr, Integer num, MessageDigest messageDigest) {
if (num != null) {
messageDigest.update(bArr);
synchronized (this.f9644a) {
this.f9644a.position(0);
messageDigest.update(this.f9644a.putInt(num.intValue()).array());
}
}
}
}
| [
"putnins@nils.digital"
] | putnins@nils.digital |
4bba12027c632137782ba68809ca137d41f98287 | 4fe4c3c91dfb92a9cda622b756266b08eaebb5ff | /app/src/main/java/com/hongbao/api/model/dto/IndexRollInfo.java | 97d195661917c911a50870263ada339d6455c1a5 | [] | no_license | learningtcc/red-envelope-daemon-root | 45cefbed3c6be6fe071c07b90e355bce18dea3c7 | 376103831f754275262db3d7cbf519d3167d405d | refs/heads/master | 2021-05-06T22:31:56.153764 | 2017-11-16T02:00:01 | 2017-11-16T02:00:01 | 112,915,518 | 1 | 1 | null | 2017-12-03T09:29:38 | 2017-12-03T09:29:37 | null | UTF-8 | Java | false | false | 1,253 | java | package com.hongbao.api.model.dto;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* Created by Summer on 2016/10/8.
*/
public class IndexRollInfo implements Serializable {
// 昵称
private String nickname;
// 类型;0:支出,1:收入
private int detailType;
// 任务分类
private int missionType;
// 任务子分类
private int missionSubtype;
// 金额
private BigDecimal money;
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public int getDetailType() {
return detailType;
}
public void setDetailType(int detailType) {
this.detailType = detailType;
}
public int getMissionType() {
return missionType;
}
public void setMissionType(int missionType) {
this.missionType = missionType;
}
public int getMissionSubtype() {
return missionSubtype;
}
public void setMissionSubtype(int missionSubtype) {
this.missionSubtype = missionSubtype;
}
public BigDecimal getMoney() {
return money;
}
public void setMoney(BigDecimal money) {
this.money = money;
}
}
| [
"janforp@163.com"
] | janforp@163.com |
baa515cf0b0e5ae69b0c80f2d2fa92536fb20416 | f87904b0d14bc865b174c21b9c6e8406ccccf6d1 | /wrapper-classes/app1/src/com/lara/M19.java | ca43ed715bb10bf53898ad60fb2f5e53109ee191 | [] | no_license | nextuser88/lara_java_code | f7c90e662b4d25cfb9a572f68a8ab86773febb92 | f53349afa87aa5a8fa475b29ccf0c5ea903dcc74 | refs/heads/master | 2021-05-15T20:19:00.931695 | 2017-10-22T06:28:48 | 2017-10-22T06:28:48 | 107,842,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 174 | java | package com.lara;
public class M19
{
public static void main(String[] args)
{
String s1 = "p";
//char c1 = Character.parseChar(s1);
System.out.println("done");
}
}
| [
"abhishekmishra034@gmail.com"
] | abhishekmishra034@gmail.com |
5d6f3552ef7554ef77e9a3bf1de1eff48fc14206 | 286cd3bec921be71be72022040b07985c703d9ef | /JavaSE/General/src/main/java/lambda/Entity.java | 96ebece48730bf93e91e5d3acf542ce8cb198a5d | [] | no_license | SkyFervor/Study | 13198979b297846d99db8c7063be5e1b5ee9c22e | a6645cee0b19602ba290f93e1daa009ec01d76b4 | refs/heads/next | 2022-12-22T09:43:02.259109 | 2020-05-19T07:00:08 | 2020-05-19T07:00:08 | 109,661,669 | 2 | 0 | null | 2022-12-16T15:30:37 | 2017-11-06T07:28:19 | Java | UTF-8 | Java | false | false | 374 | java | package lambda;
import lombok.*;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
public class Entity {
private int key;
private Integer value;
private int name;
private List<ChildEntity> childEntities;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
class ChildEntity {
private int key;
private int name;
} | [
"skyfervor@gmail.com"
] | skyfervor@gmail.com |
b3054e2a67c1c73e5a08752d3535c9532e3bfc35 | f94510f053eeb8dd18ea5bfde07f4bf6425401c2 | /common/src/main/java/com/zhiyicx/common/utils/recycleviewdecoration/ShareDecoration.java | e10dff13596ca4c5efc2bed4482b51bbcf24cce2 | [] | no_license | firwind/3fou_com_android | e13609873ae030f151c62dfaf836a858872fa44c | 717767cdf96fc2f89238c20536fa4b581a22d9aa | refs/heads/master | 2020-03-28T09:02:56.431407 | 2018-09-07T02:14:54 | 2018-09-07T02:14:54 | 148,009,743 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package com.zhiyicx.common.utils.recycleviewdecoration;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
* @Describe
* @Author zl
* @Date 2017/3/31
* @Contact master.jungle68@gmail.com
*/
public class ShareDecoration extends RecyclerView.ItemDecoration {
private int space;
public ShareDecoration(int space) {
this.space = space;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
//不是第一个的格子都设一个左边和底部的间距
outRect.left = space;
outRect.right =space;
outRect.top = 0;
outRect.bottom = 0;
}
} | [
"1428907383@qq.com"
] | 1428907383@qq.com |
258f593c5024ac62d6265b30d826164c97b21c84 | 2bc2eadc9b0f70d6d1286ef474902466988a880f | /tags/mule-1.3-rc1/providers/space/src/main/java/org/mule/providers/space/SpaceMessageAdapter.java | 5b3f0e585f1481fe7e7fddcb43cad28e8ac68d31 | [
"LicenseRef-scancode-symphonysoft",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | OrgSmells/codehaus-mule-git | 085434a4b7781a5def2b9b4e37396081eaeba394 | f8584627c7acb13efdf3276396015439ea6a0721 | refs/heads/master | 2022-12-24T07:33:30.190368 | 2020-02-27T19:10:29 | 2020-02-27T19:10:29 | 243,593,543 | 0 | 0 | null | 2022-12-15T23:30:00 | 2020-02-27T18:56:48 | null | UTF-8 | Java | false | false | 2,455 | java | /*
* $Header$
* $Revision$
* $Date$
* ------------------------------------------------------------------------------------------------------
*
* Copyright (c) SymphonySoft Limited. All rights reserved.
* http://www.symphonysoft.com
*
* 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.
*/
package org.mule.providers.space;
import org.mule.providers.AbstractMessageAdapter;
import org.mule.umo.provider.MessageTypeNotSupportedException;
import org.mule.util.UUID;
import org.mule.util.Utility;
/**
* Wraps a JavaSpaces Entry object
*
* @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
* @version $Revision$
*/
public class SpaceMessageAdapter extends AbstractMessageAdapter {
private String id;
private Object message;
/**
* Creates a default message adapter with properties and attachments
*
* @param message the message to wrap. If this is null and NullPayload object will be used
* @see org.mule.providers.NullPayload
*/
public SpaceMessageAdapter(Object message) throws MessageTypeNotSupportedException {
id = new UUID().getUUID();
if (message == null) {
throw new MessageTypeNotSupportedException(null, getClass());
} else {
this.message = message;
}
}
/**
* Converts the message implementation into a String representation
*
* @param encoding The encoding to use when transforming the message (if necessary). The parameter is
* used when converting from a byte array
* @return String representation of the message payload
* @throws Exception Implementation may throw an endpoint specific exception
*/
public String getPayloadAsString(String encoding) throws Exception {
return message.toString();
}
/**
* Converts the message implementation into a String representation
*
* @return String representation of the message
* @throws Exception Implemetation may throw an endpoint specific exception
*/
public byte[] getPayloadAsBytes() throws Exception {
return Utility.objectToByteArray(message);
}
/**
* @return the current message
*/
public Object getPayload() {
return message;
}
public String getUniqueId() {
return id;
}
}
| [
"(no author)@bf997673-6b11-0410-b953-e057580c5b09"
] | (no author)@bf997673-6b11-0410-b953-e057580c5b09 |
5d2e8b9775dd10991d0a656cd48d9b35ff5f2020 | 173a7e3c1d4b34193aaee905beceee6e34450e35 | /kmzyc-cms/kmzyc-cms-web/src/main/java/com/pltfm/cms/action/BaseAction.java | 5808b8b4f54784b62f8bff6354cb38619d931dae | [] | no_license | jjmnbv/km_dev | d4fc9ee59476248941a2bc99a42d57fe13ca1614 | f05f4a61326957decc2fc0b8e06e7b106efc96d4 | refs/heads/master | 2020-03-31T20:03:47.655507 | 2017-05-26T10:01:56 | 2017-05-26T10:01:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,970 | java | package com.pltfm.cms.action;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.CookiesAware;
import org.apache.struts2.interceptor.ParameterAware;
import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;
import com.alibaba.fastjson.JSON;
import com.opensymphony.xwork2.ActionSupport;
import com.pltfm.cms.vobject.KeyWords;
public class BaseAction extends ActionSupport implements ServletRequestAware,
ServletResponseAware, RequestAware, CookiesAware, ParameterAware,
SessionAware, ApplicationAware {
/**
*
*/
private static final long serialVersionUID = -3436974352110732022L;
protected HttpServletRequest httpServletRequest;
protected HttpServletResponse httpServletResponse;
protected Map request;
protected Map application;
protected Map parameters;
protected Map cookiesMap;
protected int pageSize = 10;
protected Map sysUserMap;//用户集合
protected KeyWords keyWords;
public String formatDouble(double s) {
DecimalFormat fmt = new DecimalFormat("##0.00");
return fmt.format(s);
}
/**
* 将对象转换成JSON字符串,并响应回前台
*/
public void writeJson(Object object) {
String json = JSON.toJSONString(object);
try {
ServletActionContext.getResponse().setContentType(
"text/html;charset=utf-8");
ServletActionContext.getResponse().getWriter().write(json);
ServletActionContext.getResponse().getWriter().flush();
} catch (IOException e) {
}
}
/**
* 取得response
*/
protected HttpServletResponse getResponse() {
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
return response;
}
protected final Log log = LogFactory.getLog(getClass());
@Override
public void setApplication(Map arg0) {
// TODO Auto-generated method stub
this.application = arg0;
}
@Override
public void setSession(Map arg0) {
// TODO Auto-generated method stub
// this.session = arg0;
}
@Override
public void setParameters(Map arg0) {
// TODO Auto-generated method stub
this.parameters = arg0;
}
@Override
public void setCookiesMap(Map arg0) {
// TODO Auto-generated method stub
this.cookiesMap = arg0;
}
@Override
public void setRequest(Map arg0) {
// TODO Auto-generated method stub
this.request = arg0;
}
@Override
public void setServletResponse(HttpServletResponse arg0) {
// TODO Auto-generated method stub
this.httpServletResponse = arg0;
}
@Override
public void setServletRequest(HttpServletRequest arg0) {
// TODO Auto-generated method stub
this.httpServletRequest = arg0;
}
public Map getSysUserMap() {
return sysUserMap;
}
public void setSysUserMap(Map sysUserMap) {
this.sysUserMap = sysUserMap;
}
public KeyWords getKeyWords() {
return keyWords;
}
public void setKeyWords(KeyWords keyWords) {
this.keyWords = keyWords;
}
}
| [
"luoxinyu@km.com"
] | luoxinyu@km.com |
7793d6484300679cbe650432386c8a49e4f0a079 | a2f07a3cbf878da5535ab5cb93d9306ad42ad607 | /service/settlement-service/src/main/java/com/meiduimall/service/settlement/common/SettlementUtil.java | 34d2246bec0e74ad4872cbc9a7a061d5c743321a | [] | no_license | neaos/mall | 60af0022101b158049cddaf8ea00c66aa7288abc | 07982826af767ef6fbfebc13d67dfba4dfc5ccc7 | refs/heads/master | 2021-07-02T10:33:46.117180 | 2017-09-21T14:31:26 | 2017-09-21T14:31:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,836 | java | package com.meiduimall.service.settlement.common;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.beanutils.PropertyUtils;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.github.pagehelper.StringUtil;
import com.meiduimall.core.ResBodyData;
/**
* Copyright (C), 2002-2017, 美兑壹购
* FileName: SettlementUtil.java
* Author: 许彦雄
* Date: 2017年3月15日 下午6:15:47
* Description: 结算工具类
*/
public class SettlementUtil {
private static final Log log = LogFactory.getLog(SettlementUtil.class);
private SettlementUtil(){}
public static <K,V> Map<K,V> convert2Map(List<V> list,String propName){
Map<K,V> map=new HashMap<>();
if(Strings.isNullOrEmpty(propName)){
return map;
}
if(list!=null && !list.isEmpty()){
for(V v:list){
try{
K k=(K) PropertyUtils.getProperty(v, propName);
map.put(k, v);
}catch(Exception e){
log.error(e.getMessage(),e);
}
}
}
return map;
}
public static <K,V> List<K> convert2ListByProperty(List<V> list,String propName){
List<K> retList=new ArrayList<>();
if(Strings.isNullOrEmpty(propName)){
return retList;
}
if(list!=null && !list.isEmpty()){
for(V v:list){
try{
K k=(K) PropertyUtils.getProperty(v, propName);
retList.add(k);
}catch(Exception e){
log.error(e.getMessage(),e);
}
}
}
return retList;
}
public static boolean isZero(double number){
boolean flag = false;
BigDecimal num = BigDecimal.valueOf(number);
if (num.compareTo(BigDecimal.ZERO) == 0) {
flag = true;
}
return flag;
}
public static ResBodyData success(Object data) {
return buildReponseData(data, ShareProfitConstants.RESPONSE_STATUS_CODE_SUCCESS, ShareProfitConstants.RESPONSE_SUCCESS);
}
public static ResBodyData failure(Object data, String resultMsg) {
return buildReponseData(data, ShareProfitConstants.RESPONSE_STATUS_CODE_FAILURE, resultMsg);
}
public static ResBodyData buildReponseData(Object data,Integer statusCode,String resultMsg){
return new ResBodyData(statusCode,resultMsg,data);
}
public static boolean contains(String[] src,String ele){
boolean result=false;
if(src!=null && src.length>0 && !Strings.isNullOrEmpty(ele)){
result=Arrays.asList(src).contains(ele);
}
return result;
}
public static String getValues(String[] src,String separator){
String result="";
String newSeparator=StringUtil.isEmpty(separator)?",":separator;
if(src!=null && src.length>0){
result=Joiner.on(newSeparator).skipNulls().join(src);
}
return result;
}
}
| [
"326800567@qq.com"
] | 326800567@qq.com |
ec049d0c34770d0cab20ccf5c4d3259d4ed38a85 | 0b499e2213d25d598b8efaca1d9a9857610d605e | /src/test/java/BBCodeStripTest.java | 94b0e66ce87ce22c027395f2292d3f02e2d53bda | [
"Apache-2.0"
] | permissive | Manebot/ts3 | ec8d54cda454440d1179f02bcbcf97990be1f0cb | c3c9d5303680d658d01b763131b1fe264c1e373c | refs/heads/master | 2023-02-21T15:06:45.768759 | 2023-02-17T23:04:16 | 2023-02-17T23:04:16 | 175,074,054 | 6 | 1 | Apache-2.0 | 2020-10-13T13:28:06 | 2019-03-11T19:54:22 | Java | UTF-8 | Java | false | false | 533 | java | import io.manebot.database.search.Search;
import io.manebot.plugin.ts3.platform.chat.TeamspeakChatMessage;
import junit.framework.TestCase;
public class BBCodeStripTest extends TestCase {
public static void main(String[] args) throws Exception {
new BBCodeStripTest().testParser();
}
public void testParser() throws Exception {
assertEquals(
TeamspeakChatMessage.stripBBCode("[URL]https://youtu.be/bEfpZYYX9p8[/URL]"),
"https://youtu.be/bEfpZYYX9p8"
);
}
}
| [
"teamlixo@gmail.com"
] | teamlixo@gmail.com |
371bfe20c8f45e7478706c25dde7e9c3a476a8ad | e05194ef3957c3f0107376f4538d95474d4cf2de | /requery/src/main/java/io/requery/EntityCache.java | b174a7cf5c0bf723192b8b4c148c67770c38162d | [
"Apache-2.0"
] | permissive | jbenezech/requery | f6c68ab53cd3a9d1dc3b776ccc431b3361475a17 | c6c3881cda38269d1d5028e32b311851e8705da4 | refs/heads/master | 2022-09-21T22:17:08.127119 | 2020-06-04T09:10:33 | 2020-06-04T09:10:33 | 269,224,315 | 0 | 0 | Apache-2.0 | 2020-06-04T00:34:30 | 2020-06-04T00:34:30 | null | UTF-8 | Java | false | false | 1,893 | java | /*
* Copyright 2016 requery.io
*
* 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 io.requery;
/**
* Cache of entity objects.
*
* @author Nikhil Purushe
*/
public interface EntityCache {
/**
* Retrieve an existing entity if it exists in the cache.
*
* @param type entity class
* @param key entity key
* @param <T> entity type
* @return the cached entity or null.
*/
<T> T get(Class<T> type, Object key);
/**
* Put a reference to an entity.
*
* @param type entity class
* @param key entity key
* @param value entity reference
* @param <T> entity type
*/
<T> void put(Class<T> type, Object key, T value);
/**
* Check if a reference to an entity exists.
*
* @param type entity class
* @param key entity key
* @return true if a reference exists false otherwise.
*/
boolean contains(Class<?> type, Object key);
/**
* Removes all references for the given type from the cache.
*
* @param type entity class
*/
void invalidate(Class<?> type);
/**
* Remove a reference to an entity from the cache.
*
* @param type entity class
* @param key entity key
*/
void invalidate(Class<?> type, Object key);
/**
* Evict all references from the cache.
*/
void clear();
}
| [
"npurushe@gmail.com"
] | npurushe@gmail.com |
8a180fa78dafdc4d94273724a8d6d5c611d4eee3 | e5fcecd08dc30e947cf11d1440136994226187c6 | /SpagoBILdapSecurityProvider/src/main/java/it/eng/spagobi/security/init/LdapSecurityProviderInit.java | 0e552edbe7dc9f5803ef40205488465bfcc681aa | [] | no_license | skoppe/SpagoBI | 16851fa5a6949b5829702eaea2724cee0629560b | 7a295c096e3cca9fb53e5c125b9566983472b259 | refs/heads/master | 2021-05-05T10:18:35.120113 | 2017-11-27T10:26:44 | 2017-11-27T10:26:44 | 104,053,911 | 0 | 0 | null | 2017-09-19T09:19:44 | 2017-09-19T09:19:43 | null | UTF-8 | Java | false | false | 883 | java | /* SpagoBI, the Open Source Business Intelligence suite
* Copyright (C) 2012 Engineering Ingegneria Informatica S.p.A. - SpagoBI Competency Center
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0, without the "Incompatible With Secondary Licenses" notice.
* If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package it.eng.spagobi.security.init;
import it.eng.spago.base.SourceBean;
import it.eng.spago.init.InitializerIFace;
public class LdapSecurityProviderInit implements InitializerIFace {
/* (non-Javadoc)
* @see it.eng.spago.init.InitializerIFace#init(it.eng.spago.base.SourceBean)
*/
public void init(SourceBean config) {
}
/* (non-Javadoc)
* @see it.eng.spago.init.InitializerIFace#getConfig()
*/
public SourceBean getConfig() {
return null;
}
}
| [
"mail@skoppe.eu"
] | mail@skoppe.eu |
16c9b365196863f9680cce14a2b97e087e90d44f | 6b2e1f5fdd3668b32c471ff872f03f043b18d5f7 | /mutants/dataset/lcs_length/9820/LCS_LENGTH.java | 79aee760ff7777f20e94250ea2e78b08f1122453 | [] | no_license | mou23/Impact-of-Similarity-on-Repairing-Small-Programs | 87e58676348f1b55666171128ecced3571979d44 | 6704d78b2bc9c103d97bcf55ecd5c12810ba2851 | refs/heads/master | 2023-03-25T10:42:17.464870 | 2021-03-20T04:55:17 | 2021-03-20T04:55:17 | 233,513,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,965 | java | package buggy_java_programs;
import java.util.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author derricklin
*/
public class LCS_LENGTH {
public static Integer lcs_length(String s, String t) {
// make a Counter
// pair? no! just hashtable to a hashtable.. woo.. currying
Map<Integer, Map<Integer,Integer>> dp = new HashMap<Integer,Map<Integer,Integer>>();
// just set all the internal maps to 0
for (int i=0; i < s.length(); i++) {
Map<Integer,Integer> initialize = new HashMap<Integer,Integer>();
dp.put(i, initialize);
for (int j=0; j < t.length(); j++) {
Map<Integer,Integer> internal_map = dp.get(i);
internal_map.put(j,0);
dp.put(i, internal_map);
}
}
// now the actual code
for (int i=0; i < s.length(); i++) {
for (int j=0; j < t.length(); j++) {
if (s.charAt(i) == t.charAt(j)) {
if (dp.containsKey(i-1)) {
Map<Integer, Integer> internal_map = dp.get(i);
int insert_value = dp.get(i-1).get(j) + 1;
internal_map.put(j, insert_value);
dp.put(i,internal_map);
} else {
Map<Integer, Integer> internal_map = dp.get(i);
internal_map.put(j,1);
dp.put(i,internal_map);
}
}
}
}
if (!ret_list.isEmpty()) {
List<Integer> ret_list = new ArrayList<Integer>();
for (int i=0; i<s.length(); i++) {
ret_list.add(!dp.get(i).isEmpty() ? Collections.max(dp.get(i).values()) : 0);
}
return Collections.max(ret_list);
} else {
return 0;
}
}
}
| [
"bsse0731@iit.du.ac.bd"
] | bsse0731@iit.du.ac.bd |
dfa74cbebc4cba954b2648fd23e70d7f85ff256f | 5b037008827a899f8990bcfdfc6bcdabaa382014 | /src/Arrayproblems/SubArraySum.java | 7e823df6663fc587e5077c2ec63d8b047f415c37 | [] | no_license | svkdey/geeksDSA | 4d5792d8b60a09b412778f2e87e090a174eef2d8 | f0356824db671f84fcbcbf224cae40be73557147 | refs/heads/master | 2021-06-13T23:23:58.146018 | 2021-02-07T08:15:15 | 2021-02-07T08:15:15 | 254,462,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,989 | java | package Arrayproblems;
/*
* Subarray with given sum
Given an unsorted array A of size N of non-negative integers, find a continuous sub-array which adds to a given number S.
Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. The first line of each test case is N and S, where N is the size of array and S is the sum. The second line of each test case contains N space separated integers denoting the array elements.
Output:
For each testcase, in a new line, print the starting and ending positions(1 indexing) of first such occuring subarray from the left if sum equals to subarray, else print -1.
User Task:
The task is to complete the function subarraySum() which finds starting and ending positions(1 indexing) of first such occuring subarray from the left if sum equals to subarray, else -1 is printed. The driver code automatically appends a new line.
Constraints:
1 <= T <= 100
1 <= N <= 105
1 <= Ai <= 1010
Example:
Input:
3
5 12
1 2 3 7 5
10 15
1 2 3 4 5 6 7 8 9 10
4 15
5 7 1 2
Output:
2 4
1 5
1 4
Explanation :
Testcase1: sum of elements from 2nd position to 4th position is 12.
Testcase2: sum of elements from 1st position to 5th position is 15.
Testcase 3: Sum of elements from 1st to 4th position is 15.
** For More Input/Output Examples Use 'Expected Output' option ***/
class SubArraySum {
// Function to find sub array with given sum
static void subarraySum(int n, int s, int[] arr) {
// Your code here
//taking arr of O as sum and 0 as starting point
int sum = arr[0];
int start = 0;
int j=1;
for (j = 1; j <=n; j++) {
//clean the prev window
while (sum > s && start < j) {
sum -= arr[start];
start++;
}
if (sum == s) {
System.out.println("sum is btwn " + start + " and " + (j - 1));
// return 1;
}
;
if (j < n) {
sum += arr[j];
}
}
// return 0;
}
public static void main(String[] args) {
}
} | [
"svkdey9@gmail.com"
] | svkdey9@gmail.com |
b07485da3e377f30a82d047a996e7e239c9ad22c | 6ed803fcb0276d0294232bf2fb8fcad4edaee5b4 | /cuba/src/test/java/com/haulmont/cuba/core/model/common/ClientType.java | fa65e6478bc7e2b75d14f87d6ddcd9a98ff95e55 | [
"Apache-2.0"
] | permissive | stvliu/jmix-cuba | 7f7fd7604814bc68df3c6e9094ddaf4de823bf42 | 1205bacd98d8351a0543ac5da6f936e6b37f5279 | refs/heads/master | 2023-03-27T02:52:20.134744 | 2021-03-26T11:48:08 | 2021-03-26T11:48:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,499 | java | /*
* Copyright (c) 2008-2016 Haulmont.
*
* 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.haulmont.cuba.core.model.common;
import io.jmix.core.metamodel.datatype.impl.EnumClass;
import javax.annotation.Nullable;
public enum ClientType implements EnumClass<String> {
WEB("W", "web"),
PORTAL("P", "portal"),
DESKTOP("D", "desktop"),
REST_API("R", "rest");
private String id;
private String configPath;
ClientType(String id, String configPath) {
this.id = id;
this.configPath = configPath;
}
public String getId() {
return id;
}
public String getConfigPath() {
return configPath;
}
@Nullable
public static ClientType fromId(String id) {
if ("W".equals(id)) {
return WEB;
} else if ("D".equals(id)) {
return DESKTOP;
} else if ("P".equals(id)) {
return PORTAL;
} else {
return null;
}
}
} | [
"krivopustov@haulmont.com"
] | krivopustov@haulmont.com |
d3540148506e43dc6cd4ceb366cf0e79027fc282 | 0429ec7192a11756b3f6b74cb49dc1ba7c548f60 | /src/main/java/com/linkage/module/gwms/cao/gw/MwbandCAO.java | b8fb5ec4d5b7c8bf1366d626113df53b53df7298 | [] | no_license | lichao20000/WEB | 5c7730779280822619782825aae58506e8ba5237 | 5d2964387d66b9a00a54b90c09332e2792af6dae | refs/heads/master | 2023-06-26T16:43:02.294375 | 2021-07-29T08:04:46 | 2021-07-29T08:04:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,955 | java | /**
* LINKAGE TECHNOLOGY (NANJING) CO.,LTD.<BR>
* Copyright 2007-2010. All right reserved.
*/
package com.linkage.module.gwms.cao.gw;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.linkage.litms.LipossGlobals;
import com.linkage.module.gwms.cao.gw.interf.I_CAO;
import com.linkage.module.gwms.util.PreProcessInterface;
import com.linkage.module.gwms.util.corba.SuperGatherCorba;
/**
* CAO:Mwband
* @author Alex.Yan (yanhj@lianchuang.com)
* @version 2.0, Jun 25, 2009
* @see
* @since 1.0
*/
public class MwbandCAO implements I_CAO {
/** log */
private static Logger logger = LoggerFactory
.getLogger(MwbandCAO.class);
/** PreProcess CORBA */
private PreProcessInterface ppCorba;
/** SuperGather CORBA */
private SuperGatherCorba sgCorba;
/*
* (non-Javadoc)
*
* @see com.linkage.module.gwms.diagnostics.cao.interf.I_AdvanceSearchCAO#addStrategyToPP(java.lang.String)
*/
@Override
public boolean addStrategyToPP(String id) {
logger.debug("addStrategyToPP({})", id);
return ppCorba.processOOBatch(id);
}
/*
* (non-Javadoc)
*
* @see com.linkage.module.gwms.diagnostics.cao.interf.I_AdvanceSearchCAO#getDataFromSG(java.lang.String,
* int)
*/
@Override
public int getDataFromSG(String deviceId, int type) {
logger.debug("getDataFromSG({},{})", deviceId, type);
String gw_type = LipossGlobals.getGw_Type(deviceId);
sgCorba = new SuperGatherCorba(String.valueOf(gw_type));
return sgCorba.getCpeParams(deviceId, type, 1);
}
/**
* set:ppCorba
*
* @param ppCorba
* the ppCorba to set
*/
public void setPpCorba(PreProcessInterface ppCorba) {
logger.debug("setPpCorba({})", ppCorba);
this.ppCorba = ppCorba;
}
/**
* set:sgCorba
*
* @param sgCorba
* the sgCorba to set
*/
public void setSgCorba(SuperGatherCorba sgCorba) {
logger.debug("setSgCorba({})", sgCorba);
this.sgCorba = sgCorba;
}
}
| [
"di4zhibiao.126.com"
] | di4zhibiao.126.com |
6eebc3d2abbe4db0713c438a00f0c71de376470f | da22e34de630d479d7e611339f8a64e9df913e7a | /src/main/java/ic2/api/crops/ExampleCropCard.java | bcc687aee04011cca88777509464081e6c3b45dc | [] | no_license | Choonster-Minecraft-Mods/turbodiesel4598-NuclearCraft | 2bc9b579f1bea376a27e3e55018836f3a0cd2ab7 | dcb807e6cfaa472a153cac27143752e76bb38aa0 | refs/heads/master | 2021-01-20T02:12:30.860577 | 2017-04-25T17:42:52 | 2017-04-25T17:42:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,029 | java | package ic2.api.crops;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
/**
* CropCard example
* @author estebes
*/
public class ExampleCropCard extends CropCard {
@Override
public String getId() {
return "example";
}
@Override
public String getOwner() {
return "myaddon";
}
/**
* See {@link CropProperties} for more info.
*/
@Override
public CropProperties getProperties() {
return new CropProperties(1, 0, 4, 0, 0, 2);
}
@Override
public int getMaxSize() {
return 5;
}
@Override
public ItemStack getGain(ICropTile crop) {
return new ItemStack(Items.DIAMOND, 1);
}
@Override
public List<ResourceLocation> getTexturesLocation() {
List<ResourceLocation> ret = new ArrayList<ResourceLocation>(getMaxSize());
for (int size = 1; size <= getMaxSize(); size++) {
ret.add(new ResourceLocation("myaddon", "blocks/crop/" + getId() + "_" + size));
}
return ret;
}
}
| [
"joedodd35@gmail.com"
] | joedodd35@gmail.com |
75eb50d00f815960ecf91c39074204303f5b1a46 | 3342a8518c2b290c423ff67ed78d154926135e9c | /blog-mover-core/src/main/java/com/redv/blogmover/impl/AttachmentImpl.java | be540223795411d6cfc16906b85704baeb6fe6d6 | [] | no_license | sutra/blog-mover | 126333d14aa1c423f25e6ccadfccdd9753730b22 | 800b92235574b69e1a3561f1958b8939789fc26d | refs/heads/master | 2021-01-17T14:07:27.919143 | 2019-07-05T12:41:01 | 2019-07-05T12:41:01 | 27,595,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,735 | java | /**
* Created on 2006-7-9 16:35:07
*/
package com.redv.blogmover.impl;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.redv.blogmover.Attachment;
/**
* @author Joe
* @version 1.0
*
*/
public class AttachmentImpl implements Attachment {
/**
*
*/
private static final long serialVersionUID = -4339768603586607598L;
@SuppressWarnings("unused")
private static final Log log = LogFactory.getLog(AttachmentImpl.class);
private static final String PREFIX = "blogremoverattachment";
private static final String SUFFIX = ".tmp";
private String contentType;
private String url;
private File file;
private ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
/**
* @throws IOException
*
*/
public AttachmentImpl() throws IOException {
super();
file = File.createTempFile(PREFIX, SUFFIX);
}
/*
* (non-Javadoc)
*
* @see com.redv.blogremover.Attachment#getContentType()
*/
public String getContentType() {
return contentType;
}
/*
* (non-Javadoc)
*
* @see com.redv.blogremover.Attachment#setContentType(java.lang.String)
*/
public void setContentType(String contentType) {
this.contentType = contentType;
}
/*
* (non-Javadoc)
*
* @see com.redv.blogremover.Attachment#getUrl()
*/
public String getUrl() {
return url;
}
/*
* (non-Javadoc)
*
* @see com.redv.blogremover.Attachment#setUrl(java.lang.String)
*/
public void setUrl(String url) {
this.url = url;
}
/*
* (non-Javadoc)
*
* @see com.redv.blogremover.Attachment#getStream()
*/
public InputStream getStream() throws FileNotFoundException {
this.readWriteLock.readLock().lock();
try {
FileInputStream stream = new FileInputStream(file);
return stream;
} finally {
this.readWriteLock.readLock().unlock();
}
}
/*
* (non-Javadoc)
*
* @see com.redv.blogremover.Attachment#setStream(java.io.InputStream)
*/
public void setStream(InputStream stream) throws IOException {
byte[] buffer = new byte[1024];
int len;
this.readWriteLock.writeLock().lock();
try {
FileOutputStream fos = new FileOutputStream(file);
try {
while ((len = stream.read(buffer)) != -1) {
fos.write(buffer, 0, len);
}
} finally {
fos.close();
}
} finally {
this.readWriteLock.writeLock().unlock();
}
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof AttachmentImpl == false) {
return false;
}
if (this == obj) {
return true;
}
AttachmentImpl a = (AttachmentImpl) obj;
return new EqualsBuilder().appendSuper(super.equals(obj)).append(
this.url, a.url).isEquals();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#finalize()
*/
@Override
protected void finalize() throws Throwable {
if (!this.file.delete()) {
this.file.deleteOnExit();
}
super.finalize();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
if (this.url == null) {
return 0;
} else {
return this.url.hashCode();
}
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return new ToStringBuilder(this).append("url", this.url).toString();
}
}
| [
"zhoushuqun@gmail.com"
] | zhoushuqun@gmail.com |
7ae3bd2589a12ee6ec9fcbcd296424faa8fe2414 | 470618f1f962153fe892bd771bc5aa5bbb7e143b | /mogu_admin/src/main/java/com/moxi/mogublog/admin/restapi/VisitorRestApi.java | d6cbc7ec3c035c8d2ad692447e6491d0752e7e90 | [
"Apache-2.0"
] | permissive | qq570231345/mogu_blog_v2 | 4104082522a797ba5ac3e91b2bbbd17d7f14b66a | 1ebd539c9d6f5c93dc66886e1da813982b8de37f | refs/heads/master | 2022-11-07T08:24:09.924745 | 2020-06-12T00:55:14 | 2020-06-12T00:56:51 | 271,795,938 | 1 | 0 | Apache-2.0 | 2020-06-12T12:43:18 | 2020-06-12T12:43:17 | null | UTF-8 | Java | false | false | 487 | java | package com.moxi.mogublog.admin.restapi;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 游客表 RestApi
* </p>
*
* @author xzx19950624@qq.com
* @since 2018-09-08
*/
@RestController
@RequestMapping("/visitor")
@Api(value = "游客相关接口", tags = {"游客相关接口"})
@Slf4j
public class VisitorRestApi {
}
| [
"xzx19950624@qq.com"
] | xzx19950624@qq.com |
8c454642fefeeff0d7d51be40e89df6ac41442d0 | 7e34493f5335ed3fe64cea407245b6c76805d6e5 | /lkjh14/src/main/java/com/fastcode/lkjh14/addons/docmgmt/application/file/dto/UpdateFileInput.java | 037aeb035faf252b1dba61640e70a9456119ed47 | [] | no_license | fastcoderepos/lkjh14 | 3ae3f5bc85ba3b7bc0e4e555e1696d61de8a4799 | e331a3cebc2203a1f25f0942a916973f48ba6868 | refs/heads/master | 2023-02-18T01:37:16.142545 | 2021-01-21T15:16:09 | 2021-01-21T15:16:09 | 331,666,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 387 | java | package com.fastcode.lkjh14.addons.docmgmt.application.file.dto;
import javax.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class UpdateFileInput {
@NotNull(message = "id Should not be null")
private Long id;
private String label;
private String name;
private String summary;
private String versiono;
}
| [
"info@nfinityllc.com"
] | info@nfinityllc.com |
5d8eb760246126b229d3b6fb5793ea92fda62bea | e08314b8c22df72cf3aa9e089624fc511ff0d808 | /src/selfdefine/com/ces/component/tcssczzqyxx/action/TcssczzqyxxController.java | 881efee407d5d32252871afc817b45fb8c70d40b | [] | no_license | quxiongwei/qhzyc | 46acd4f6ba41ab3b39968071aa114b24212cd375 | 4b44839639c033ea77685b98e65813bfb269b89d | refs/heads/master | 2020-12-02T06:38:21.581621 | 2017-07-12T02:06:10 | 2017-07-12T02:06:10 | 96,864,946 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 870 | java | package com.ces.component.tcssczzqyxx.action;
import com.ces.component.trace.dao.TraceShowModuleDao;
import com.ces.component.tcssczzqyxx.service.TcssczzqyxxService;
import com.ces.component.trace.action.base.TraceShowModuleDefineServiceDaoController;
import com.ces.xarch.core.entity.StringIDEntity;
public class TcssczzqyxxController extends TraceShowModuleDefineServiceDaoController<StringIDEntity, TcssczzqyxxService, TraceShowModuleDao> {
private static final long serialVersionUID = 1L;
/*
* (非 Javadoc)
* <p>标题: initModel</p>
* <p>描述: </p>
* @see com.ces.xarch.core.web.struts2.BaseController#initModel()
*/
@Override
protected void initModel() {
setModel(new StringIDEntity());
}
public void getQyxxGridData(){
setReturnData(getService().getQyxxGridData());
}
} | [
"qu.xiongwei@cesgroup.com.cn"
] | qu.xiongwei@cesgroup.com.cn |
d2e2e7fd0cad57d56c86bb916275c2204dee9dd9 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/hudson/model/ApiSecurity1129Test.java | 34cda8a0c611111b4298e307ddb218f62bb4a63a | [] | 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,695 | java | package hudson.model;
import HttpServletResponse.SC_BAD_REQUEST;
import HttpServletResponse.SC_OK;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
// TODO after the security fix, it could be merged inside ApiTest
public class ApiSecurity1129Test {
@Rule
public JenkinsRule j = new JenkinsRule();
/**
* Test the wrapper parameter for the api/xml urls to avoid XSS.
*
* @throws Exception
* See {@link #checkWrapperParam(String, Integer, String)}
*/
@Issue("SECURITY-1129")
@Test
public void wrapperXss() throws Exception {
String wrapper = "html%20xmlns=\"http://www.w3.org/1999/xhtml\"><script>alert(%27XSS%20Detected%27)</script></html><!--";
checkWrapperParam(wrapper, SC_BAD_REQUEST, Messages.Api_WrapperParamInvalid());
}
/**
* Test the wrapper parameter for the api/xml urls with a bad name.
*
* @throws Exception
* See {@link #checkWrapperParam(String, Integer, String)}
*/
@Issue("SECURITY-1129")
@Test
public void wrapperBadName() throws Exception {
String wrapper = "-badname";
checkWrapperParam(wrapper, SC_BAD_REQUEST, Messages.Api_WrapperParamInvalid());
}
/**
* Test thw erapper parameter with a good name, to ensure the security fix doesn't break anything.
*
* @throws Exception
* See {@link #checkWrapperParam(String, Integer, String)}
*/
@Issue("SECURITY-1129")
@Test
public void wrapperGoodName() throws Exception {
String wrapper = "__GoodName-..-OK";
checkWrapperParam(wrapper, SC_OK, null);
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
30814c0b5b33e4d213771b97674d133473cff0a0 | a4a51084cfb715c7076c810520542af38a854868 | /src/main/java/com/google/android/gms/internal/firebase_remote_config/zzax.java | 9df5b915621bdefb2ddad883614d82b16a42d867 | [] | no_license | BharathPalanivelu/repotest | ddaf56a94eb52867408e0e769f35bef2d815da72 | f78ae38738d2ba6c9b9b4049f3092188fabb5b59 | refs/heads/master | 2020-09-30T18:55:04.802341 | 2019-12-02T10:52:08 | 2019-12-02T10:52:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,016 | java | package com.google.android.gms.internal.firebase_remote_config;
import java.io.IOException;
public class zzax extends zzby implements Cloneable {
private zzaw zzda;
public final void zza(zzaw zzaw) {
this.zzda = zzaw;
}
public String toString() {
zzaw zzaw = this.zzda;
if (zzaw == null) {
return super.toString();
}
try {
return zzaw.toString(this);
} catch (IOException e2) {
throw zzeb.zzb(e2);
}
}
public final String zzaq() throws IOException {
zzaw zzaw = this.zzda;
if (zzaw != null) {
return zzaw.zzc(this);
}
return super.toString();
}
/* renamed from: zza */
public zzax clone() {
return (zzax) super.clone();
}
/* renamed from: zza */
public zzax zzb(String str, Object obj) {
return (zzax) super.zzb(str, obj);
}
public /* synthetic */ zzby zzb() {
return (zzax) clone();
}
}
| [
"noiz354@gmail.com"
] | noiz354@gmail.com |
60290e519d3d2955045339376f92fedc44a4a8f7 | 0f782acc35a009fa7298a65a2785b6ffccaa901e | /src/javaCore/lambda_method_references/MethodRefObject.java | 9d75183e2344523dead933cd18537ee34ea4d440 | [] | no_license | RossHS/MyWorkbook | 071bd0eb81108ab615badbf4916b8b77cba908b1 | 65e2cd70058da4648d94858d3f0311a3dff00805 | refs/heads/master | 2022-11-23T20:45:07.900110 | 2020-07-23T10:42:20 | 2020-07-23T10:42:20 | 281,899,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 868 | java | package javaCore.lambda_method_references;
/**
* Пример ссылки на метод экземпляра класса
*
* @author Ross Khapilov
* @version 1.0 created on 09.01.2018
*/
public class MethodRefObject {
String strReverse(String str) {
String result = "";
for (int i = str.length() - 1; i >= 0; i--) {
result += str.charAt(i);
}
return result;
}
}
class ObjDemo {
static String strinOp(StringFunc sf, String s) {
return sf.func(s);
}
public static void main(String[] args) {
String inStr = "Java";
MethodRefObject str = new MethodRefObject();
String outStr = strinOp(str::strReverse, inStr);
System.out.println(inStr);
System.out.println(outStr);
}
}
@FunctionalInterface
interface StringFunc {
String func(String n);
}
| [
"rossxpanteley@gmail.com"
] | rossxpanteley@gmail.com |
a3cad0b4a5bebbfd4fc1810c4418e115d88bdcfe | 9cdf4a803b5851915b53edaeead2546f788bddc6 | /machinelearning/5.0.x/drools-core/src/test/java/org/drools/base/extractors/IntClassFieldExtractorTest.java | 8e70ec95d02bb746a324a9cd58357e0a24d69b9f | [
"Apache-2.0"
] | permissive | kiegroup/droolsjbpm-contributed-experiments | 8051a70cfa39f18bc3baa12ca819a44cc7146700 | 6f032d28323beedae711a91f70960bf06ee351e5 | refs/heads/master | 2023-06-01T06:11:42.641550 | 2020-07-15T15:09:02 | 2020-07-15T15:09:02 | 1,184,582 | 1 | 13 | null | 2021-06-24T08:45:52 | 2010-12-20T15:42:26 | Java | UTF-8 | Java | false | false | 3,417 | java | package org.drools.base.extractors;
import junit.framework.Assert;
import org.drools.base.ClassFieldAccessorCache;
import org.drools.base.ClassFieldAccessorStore;
import org.drools.base.TestBean;
import org.drools.spi.InternalReadAccessor;
public class IntClassFieldExtractorTest extends BaseClassFieldExtractorsTest {
private static final int VALUE = 4;
InternalReadAccessor reader;
TestBean bean = new TestBean();
protected void setUp() throws Exception {
ClassFieldAccessorStore store = new ClassFieldAccessorStore();
store.setClassFieldAccessorCache( new ClassFieldAccessorCache( Thread.currentThread().getContextClassLoader() ) );
store.setEagerWire( true );
this.reader = store.getReader( TestBean.class,
"intAttr",
getClass().getClassLoader() );
}
public void testGetBooleanValue() {
try {
this.reader.getBooleanValue( null,
this.bean );
fail( "Should have throw an exception" );
} catch ( final Exception e ) {
// success
}
}
public void testGetByteValue() {
Assert.assertEquals( IntClassFieldExtractorTest.VALUE,
this.reader.getByteValue( null,
this.bean ) );
}
public void testGetCharValue() {
try {
this.reader.getCharValue( null,
this.bean );
fail( "Should have throw an exception" );
} catch ( final Exception e ) {
// success
}
}
public void testGetDoubleValue() {
Assert.assertEquals( IntClassFieldExtractorTest.VALUE,
this.reader.getDoubleValue( null,
this.bean ),
0.01 );
}
public void testGetFloatValue() {
Assert.assertEquals( IntClassFieldExtractorTest.VALUE,
this.reader.getFloatValue( null,
this.bean ),
0.01 );
}
public void testGetIntValue() {
Assert.assertEquals( IntClassFieldExtractorTest.VALUE,
this.reader.getIntValue( null,
this.bean ) );
}
public void testGetLongValue() {
Assert.assertEquals( IntClassFieldExtractorTest.VALUE,
this.reader.getLongValue( null,
this.bean ) );
}
public void testGetShortValue() {
Assert.assertEquals( IntClassFieldExtractorTest.VALUE,
this.reader.getShortValue( null,
this.bean ) );
}
public void testGetValue() {
Assert.assertEquals( IntClassFieldExtractorTest.VALUE,
((Number) this.reader.getValue( null,
this.bean )).intValue() );
}
public void testIsNullValue() {
Assert.assertFalse( this.reader.isNullValue( null,
this.bean ) );
}
}
| [
"gizil.oguz@gmail.com"
] | gizil.oguz@gmail.com |
60cee4f523747bea5290f4b1e657772074947f12 | 82d82aa06fef6785356b55c40e87610ad6b0a59f | /provider/src/main/java/com/daqsoft/provider/view/convenientbanner/helper/CBLoopScaleHelper.java | 962895d35e7920ddf82f41d3c3ce8c7693ce506b | [] | no_license | loading103/wly_master | e6f8cf69f55177a1bdc397c6d21a4b84390cf5e3 | 71b8f4f885b531219020a0801665b81239ac8da4 | refs/heads/main | 2023-07-16T22:54:30.847693 | 2021-09-03T09:30:48 | 2021-09-03T09:30:48 | 402,705,010 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,695 | java | package com.daqsoft.provider.view.convenientbanner.helper;
import android.view.View;
import android.view.ViewTreeObserver;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.PagerSnapHelper;
import androidx.recyclerview.widget.RecyclerView;
import com.daqsoft.provider.view.convenientbanner.adapter.CBPageAdapter;
import com.daqsoft.provider.view.convenientbanner.listener.OnPageChangeListener;
import com.daqsoft.provider.view.convenientbanner.view.CBLoopViewPager;
/**
* Created by jameson on 8/30/16.
* changed by 二精-霁雪清虹 on 2017/11/19
* changed by Sai on 2018/04/25
*/
public class CBLoopScaleHelper {
private CBLoopViewPager mRecyclerView;
private int mPagePadding = 0; // 卡片的padding, 卡片间的距离等于2倍的mPagePadding
private int mShowLeftCardWidth = 0; // 左边卡片显示大小
private int mFirstItemPos;
private PagerSnapHelper mPagerSnapHelper = new PagerSnapHelper();
private OnPageChangeListener onPageChangeListener;
public void attachToRecyclerView(final CBLoopViewPager mRecyclerView) {
if (mRecyclerView == null) {
return;
}
this.mRecyclerView = mRecyclerView;
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
int position = getCurrentItem();
//这里变换位置实现循环
CBPageAdapter adapter = (CBPageAdapter) mRecyclerView.getAdapter();
int count = adapter.getRealItemCount();
if(adapter.isCanLoop()) {
if (position < count) {
position = count + position;
setCurrentItem(position);
} else if (position >= 2 * count) {
position = position - count;
setCurrentItem(position);
}
}
if(onPageChangeListener != null) {
onPageChangeListener.onScrollStateChanged(recyclerView, newState);
if(count != 0)
onPageChangeListener.onPageSelected(position % count);
}
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
//Log.e("TAG", String.format("onScrolled dx=%s, dy=%s", dx, dy));
super.onScrolled(recyclerView, dx, dy);
if(onPageChangeListener != null)
onPageChangeListener.onScrolled(recyclerView, dx, dy);
onScrolledChangedCallback();
}
});
initWidth();
mPagerSnapHelper.attachToRecyclerView(mRecyclerView);
}
/**
* 初始化卡片宽度
*/
private void initWidth() {
mRecyclerView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
mRecyclerView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
scrollToPosition(mFirstItemPos);
}
});
}
public void setCurrentItem(int item) {
setCurrentItem(item,false);
}
public void setCurrentItem(int item, boolean smoothScroll) {
if (mRecyclerView == null) {
return;
}
if (smoothScroll) {
mRecyclerView.smoothScrollToPosition(item);
}else {
scrollToPosition(item);
}
}
public void scrollToPosition(int pos) {
if (mRecyclerView == null) {
return;
}
((LinearLayoutManager) mRecyclerView.getLayoutManager()).
scrollToPositionWithOffset(pos,
(mPagePadding + mShowLeftCardWidth));
mRecyclerView.post(new Runnable() {
@Override
public void run() {
onScrolledChangedCallback();
}
});
}
public void setFirstItemPos(int firstItemPos) {
this.mFirstItemPos = firstItemPos;
}
/**
* RecyclerView位移事件监听, view大小随位移事件变化
*/
private void onScrolledChangedCallback() {
}
public int getCurrentItem() {
try {
if(mRecyclerView==null){
return 0;
}
RecyclerView.LayoutManager layoutManager = mRecyclerView.getLayoutManager();
View view = mPagerSnapHelper.findSnapView(layoutManager);
if (view != null)
return layoutManager.getPosition(view);
}catch (NullPointerException e){}
return 0;
}
public int getRealCurrentItem() {
CBPageAdapter adapter = (CBPageAdapter) mRecyclerView.getAdapter();
int count = adapter.getRealItemCount();
return getCurrentItem()%count;
}
public void setPagePadding(int pagePadding) {
mPagePadding = pagePadding;
}
public void setShowLeftCardWidth(int showLeftCardWidth) {
mShowLeftCardWidth = showLeftCardWidth;
}
public int getFirstItemPos() {
return mFirstItemPos;
}
public int getRealItemCount(){
CBPageAdapter adapter = (CBPageAdapter) mRecyclerView.getAdapter();
int count = adapter.getRealItemCount();
return count;
}
public void setOnPageChangeListener(OnPageChangeListener onPageChangeListener) {
this.onPageChangeListener = onPageChangeListener;
}
}
| [
"qiuql@daqsoft.com"
] | qiuql@daqsoft.com |
908a361c033a1e9a788968cbb5f8a5362054e166 | 84e41905d2bf955eaae2a82d80eb8f77a59c5f63 | /thinkwin-yunmeeting-service-pay-parent/thinkwin-yunmeeting-service-pay/src/main/java/com/thinkwin/pay/service/PaymentRepo.java | 701cf2d728a215a6ee8c7bb9752423b78d5de795 | [] | no_license | moyu3390/wang | ac91803f34e04e55dd5f7d883f779ba736e96aa1 | 207c75752590bf6b3d7d58aedd9e6b3ccc9424d4 | refs/heads/master | 2022-01-14T22:36:19.096206 | 2018-08-10T09:50:07 | 2018-08-10T09:50:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 445 | java | package com.thinkwin.pay.service;
import com.thinkwin.pay.model.Payment;
import com.thinkwin.pay.model.PaymentLog;
import com.thinkwin.pay.dto.PaymentVo;
public interface PaymentRepo {
Payment getPaymentByOrderId(String orderId);
Payment getPaymentByIdLocked(String orderId);
Payment newPayment(PaymentVo paymentVo);
PaymentLog getPaymentLogById(String tradeNo);
boolean updatePaymentStatus(Payment payment, PaymentLog paymentLog);
}
| [
"173030685@qq.com"
] | 173030685@qq.com |
36030f979045097449e451ba90f1fc0a536a6f14 | 47074239415381aefe6286ab11049bd27b5de2eb | /3. Automatically Generated Test Data/PMD.Strategy/Strategy_JavaParserTokenManager_CharStream_5.java | c1543295e37cf4dd46d05130920e7c3ac30c6033 | [
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Megre/Dataset4SparT-ETA | c9c3611b143a0d1b1d5180603c5684313686921a | 6165ed6ffb63c9c74522ca77e5d4edde7369376c | refs/heads/master | 2021-06-25T22:37:13.843086 | 2021-04-03T16:37:36 | 2021-04-03T16:37:36 | 225,321,687 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 471 | java | package test.auto;
public class Strategy_JavaParserTokenManager_CharStream_5
{
public static void main(String[] args) throws java.lang.Exception {
net.sourceforge.pmd.ast.CharStream strategy = new net.sourceforge.pmd.ast.JavaCharStream(new java.io.FileReader(new java.io.File("D:/test_input_file.txt")), 1, 1, 1);
net.sourceforge.pmd.ast.JavaParserTokenManager context = new net.sourceforge.pmd.ast.JavaParserTokenManager(strategy);
context.jjFillToken();
}
}
| [
"renhao.x@seu.edu.cn"
] | renhao.x@seu.edu.cn |
432650ab53407ae2f5d9678578c70ef7d0ae320c | 95c49f466673952b465e19a5ee3ae6eff76bee00 | /src/main/java/com/cmic/sso/sdk/p430e/SignUtil.java | d7ad21c7f65474d4d4df48b027a45238c701be7c | [] | no_license | Phantoms007/zhihuAPK | 58889c399ae56b16a9160a5f48b807e02c87797e | dcdbd103436a187f9c8b4be8f71bdf7813b6d201 | refs/heads/main | 2023-01-24T01:34:18.716323 | 2020-11-25T17:14:55 | 2020-11-25T17:14:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | package com.cmic.sso.sdk.p430e;
import android.content.Context;
import android.content.p022pm.PackageManager;
import android.content.pm.PackageInfo;
/* renamed from: com.cmic.sso.sdk.e.l */
/* compiled from: SignUtil */
public class SignUtil {
/* renamed from: a */
public static byte[] m19898a(Context context, String str) {
PackageManager packageManager = context.getPackageManager();
if (context.getPackageName().equalsIgnoreCase(str)) {
try {
PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 64);
if (packageInfo.packageName.equals(str)) {
return packageInfo.signatures[0].toByteArray();
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return null;
}
}
return null;
}
}
| [
"seasonpplp@qq.com"
] | seasonpplp@qq.com |
b95bec70cc328597e42b25bc519f6fd5302cd381 | 8ed92f2dd6d2cb7ca69ec869c9944b83e724e673 | /argouml-app/src/org/argouml/ui/explorer/TypeThenNameOrder.java | ed260d2c6208fef387d7aea9ef3ff21cb83a5c2a | [
"LicenseRef-scancode-other-permissive",
"BSD-3-Clause"
] | permissive | danilofes/argouml-refactorings | e74c68c3a556fad9915f7a7e51cf7bd98634b02b | 893bcb1c3e8dcb60ca97ad3ee2adf48103307ce4 | refs/heads/master | 2021-01-10T12:44:46.359352 | 2015-11-03T15:59:42 | 2015-11-03T15:59:42 | 45,476,515 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,768 | java | /* $Id: TypeThenNameOrder.java 19614 2011-07-20 12:10:13Z linus $
*****************************************************************************
* Copyright (c) 2009 Contributors - see below
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* tfmorris
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
*/
// Copyright (c) 1996-2006 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
// and this paragraph appear in all copies. This software program and
// documentation are copyrighted by The Regents of the University of
// California. The software program and documentation are supplied "AS
// IS", without any accompanying services from The Regents. The Regents
// does not warrant that the operation of the program will be
// uninterrupted or error-free. The end-user understands that the program
// was developed for research purposes and is advised not to rely
// exclusively on the program for any reason. IN NO EVENT SHALL THE
// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
package org.argouml.ui.explorer;
import javax.swing.tree.DefaultMutableTreeNode;
import org.argouml.i18n.Translator;
/**
* Sorts by user object type,
* diagrams first,
* then packages,
* then other types.
*
* sorts by name within type groups.
*
* @since 0.15.2, Created on 28 September 2003, 10:02
*
* @author alexb
*/
public class TypeThenNameOrder extends NameOrder {
/** Creates a new instance of TypeThenNameOrder */
public TypeThenNameOrder() {
}
/*
* Compares obj1 and obj2 sorting by user object type, then name. Diagrams
* are sorted first, then packages, then other types. sorts by name within
* type groups. Nulls are sorted first for names.
*
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
@Override
public int compare(Object obj1, Object obj2) {
if (obj1 instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) obj1;
obj1 = node.getUserObject();
}
if (obj2 instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) obj2;
obj2 = node.getUserObject();
}
if (obj1 == null) {
if (obj2 == null) {
return 0;
}
return -1;
} else if (obj2 == null) {
return 1;
}
String typeName = obj1.getClass().getName();
String typeName1 = obj2.getClass().getName();
// all diagram types treated equally, see issue 2260
// if (typeName.indexOf("Diagram") != -1
// && typeName1.indexOf("Diagram") != -1)
// return compareUserObjects(obj1, obj2);
int typeNameOrder = typeName.compareTo(typeName1);
if (typeNameOrder == 0) {
return compareUserObjects(obj1, obj2);
}
if (typeName.indexOf("Diagram") == -1
&& typeName1.indexOf("Diagram") != -1) {
return 1;
}
if (typeName.indexOf("Diagram") != -1
&& typeName1.indexOf("Diagram") == -1) {
return -1;
}
if (typeName.indexOf("Package") == -1
&& typeName1.indexOf("Package") != -1) {
return 1;
}
if (typeName.indexOf("Package") != -1
&& typeName1.indexOf("Package") == -1) {
return -1;
}
return typeNameOrder;
}
/*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return Translator.localize("combobox.order-by-type-name");
}
}
| [
"danilofes@gmail.com"
] | danilofes@gmail.com |
7f45b0f521c2d6da85969f59d919e2513669d01d | 216b3edfbc1522231633793d4375e02a4f6a8416 | /livepoll-codec/src/main/java/org/revo/streamer/livepoll/codec/commons/rtp/d/MediaType.java | 2a02f69982da47188665be340620211fff9c1202 | [] | no_license | ashraf-revo/streamer | d6b2b1e7ee0e23595fe95a14c8aceaea8bea7540 | d18af7f2cf38ca547707d05220e7beab2267e48f | refs/heads/master | 2023-05-13T21:49:33.036829 | 2023-05-03T06:57:03 | 2023-05-03T06:57:03 | 253,750,818 | 8 | 1 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package org.revo.streamer.livepoll.codec.commons.rtp.d;
public enum MediaType {
VIDEO,
AUDIO,
UNKOWN;
public boolean isAudio() {
return this == AUDIO;
}
public boolean isVideo() {
return this == VIDEO;
}
public static MediaType typeOf(String type) {
if("video".equalsIgnoreCase(type)) {
return VIDEO;
} else if ("audio".equalsIgnoreCase(type)) {
return AUDIO;
} else {
return UNKOWN;
}
}
}
| [
"ashraf1abdelrasool@gmail.com"
] | ashraf1abdelrasool@gmail.com |
c18c1aeb276d72884a3c66dbaccced65df869dfe | 0175a417f4b12b80cc79edbcd5b7a83621ee97e5 | /flexodesktop/externalmodels/flexojavacvs/src/main/java/org/netbeans/lib/cvsclient/connection/ConnectionFactory.java | fbd3ef53cbafc419caa9cdc522b26490cbfef07f | [] | no_license | agilebirds/openflexo | c1ea42996887a4a171e81ddbd55c7c1e857cbad0 | 0250fc1061e7ae86c9d51a6f385878df915db20b | refs/heads/master | 2022-08-06T05:42:04.617144 | 2013-05-24T13:15:58 | 2013-05-24T13:15:58 | 2,372,131 | 11 | 6 | null | 2022-07-06T19:59:55 | 2011-09-12T15:44:45 | Java | UTF-8 | Java | false | false | 3,005 | java | /*
* (c) Copyright 2010-2011 AgileBirds
*
* This file is part of OpenFlexo.
*
* OpenFlexo is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenFlexo 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 OpenFlexo. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.netbeans.lib.cvsclient.connection;
import org.netbeans.lib.cvsclient.CVSRoot;
/**
* Simple class for managing the mapping from CVSROOT specifications to Connection classes.
*
* @author <a href="mailto:gerrit.riessen@wiwi.hu-berlin.de">Gerrit Riessen</a>, OAR Development AG
* @author <a href="mailto:rami.ojares@elisa.fi">Rami Ojares</a>, Elisa Internet Oy
*/
public class ConnectionFactory {
/**
* <b>Protected Constructor</b>
*/
protected ConnectionFactory() {
}
/**
* Returns a Connection object to handle the specific CVSRoot specification. This returns null if not suitable connection was found.
*
* If the return value is an instance of the PServerConnection class, then the encoded password needs to be set if not defined in the
* CVSRoot. This is left up to the client to set.
*/
public static Connection getConnection(String cvsRoot) throws IllegalArgumentException {
CVSRoot root = CVSRoot.parse(cvsRoot);
return getConnection(root);
}
/**
* Returns a Connection object to handle the specific CVSRoot specification. This returns null if not suitable connection was found.
*
* If the return value is an instance of the PServerConnection class, then the encoded password needs to be set if not defined in the
* CVSRoot. This is left up to the client to set.
*/
public static Connection getConnection(CVSRoot root) throws IllegalArgumentException {
// LOCAL CONNECTIONS (no-method, local & fork)
if (root.isLocal()) {
LocalConnection con = new LocalConnection();
con.setRepository(root.getRepository());
return con;
}
String method = root.getMethod();
// SSH2Connection (server, ext)
/* SSH2Connection is TBD
if (
method == null || CVSRoot.METHOD_SERVER == method || CVSRoot.METHOD_EXT == method
) {
// NOTE: If you want to implement your own authenticator you have to construct SSH2Connection yourself
SSH2Connection con = new SSH2Connection(
root,
new ConsoleAuthenticator()
);
return con;
}
*/
// PServerConnection (pserver)
if (CVSRoot.METHOD_PSERVER == method) {
PServerConnection con = new PServerConnection(root);
return con;
}
throw new IllegalArgumentException("Unrecognized CVS Root: " + root);
}
}
| [
"guillaume.polet@gmail.com"
] | guillaume.polet@gmail.com |
f355324feee643a74c5ea02c0c791e8ecbcd099f | 9e8187c35ef08c67186679f6d472603a8f7b2d6d | /lab4/mujavaHome/result/BackPack/traditional_mutants/int_BackPack_Solution(int,int,int,int)/AOIS_66/BackPack.java | cdacf2a4b4ed1387ec5ecb8c47cfc12541c0c744 | [] | no_license | cxdzb/software-testing-technology | 8b79f99ec859a896042cdf5bccdadfd11f65b64c | 5fb1305dd2dd028c035667c71e0abf57a489360b | refs/heads/master | 2021-01-09T15:24:42.561680 | 2020-04-16T06:18:58 | 2020-04-16T06:18:58 | 242,354,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 853 | java | // This is a mutant program.
// Author : ysma
public class BackPack
{
public int[][] BackPack_Solution( int m, int n, int[] w, int[] p )
{
int[][] c = new int[n + 1][m + 1];
for (int i = 0; i < n + 1; i++) {
c[i][0] = 0;
}
for (int j = 0; j < m + 1; j++) {
c[0][j] = 0;
}
for (int i = 1; i < n + 1; i++) {
for (int j = 1; j < m + 1; j++) {
if (w[i - 1] <= j) {
if (c[i - 1][j] < c[i - 1][j - w[i - 1]] + p[--i - 1]) {
c[i][j] = c[i - 1][j - w[i - 1]] + p[i - 1];
} else {
c[i][j] = c[i - 1][j];
}
} else {
c[i][j] = c[i - 1][j];
}
}
}
return c;
}
}
| [
"1005968086@qq.com"
] | 1005968086@qq.com |
1e624a8f753a6f0e511b3deec08b620bfcf9f5e2 | 0ed0793dfbe80580b733925d1197726052dad16b | /src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeIterator.java | 9f8c5f9b51632c3ddbb87cdc0a941f23d622cf67 | [] | no_license | td1617/jdk1.8-source-analysis | 73b653f014f90eee1a6c6f8dd9b132b2333666f9 | e260d95608527ca360892bdd21c9b75ea072fbaa | refs/heads/master | 2023-03-12T03:22:09.529624 | 2021-02-25T01:00:11 | 2021-02-25T01:01:44 | 341,839,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,310 | java | /*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DTMNodeIterator.java,v 1.2.4.1 2005/09/15 08:15:03 suresh_emailid Exp $
*/
package com.sun.org.apache.xml.internal.dtm.ref;
import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMDOMException;
import com.sun.org.apache.xml.internal.dtm.DTMIterator;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.traversal.NodeFilter;
/**
* <code>DTMNodeIterator</code> gives us an implementation of the
* DTMNodeIterator which returns DOM nodes.
* <p>
* Please note that this is not necessarily equivlaent to a DOM
* NodeIterator operating over the same document. In particular:
* <ul>
*
* <li>If there are several Text nodes in logical succession (ie,
* across CDATASection and EntityReference boundaries), we will return
* only the first; the caller is responsible for stepping through
* them.
* (%REVIEW% Provide a convenience routine here to assist, pending
* proposed DOM Level 3 getAdjacentText() operation?) </li>
*
* <li>Since the whole XPath/XSLT architecture assumes that the source
* document is not altered while we're working with it, we do not
* promise to implement the DOM NodeIterator's "maintain current
* position" response to document mutation. </li>
*
* <li>Since our design for XPath NodeIterators builds a stateful
* filter directly into the traversal object, getNodeFilter() is not
* supported.</li>
*
* </ul>
*
* <p>State: In progress!!</p>
*/
public class DTMNodeIterator implements org.w3c.dom.traversal.NodeIterator {
private DTMIterator dtm_iter;
private boolean valid = true;
//================================================================
// Methods unique to this class
/**
* Public constructor: Wrap a DTMNodeIterator around an existing
* and preconfigured DTMIterator
*/
public DTMNodeIterator(DTMIterator dtmIterator) {
try {
dtm_iter = (DTMIterator) dtmIterator.clone();
} catch (CloneNotSupportedException cnse) {
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(cnse);
}
}
/**
* Access the wrapped DTMIterator. I'm not sure whether anyone will
* need this or not, but let's write it and think about it.
*/
public DTMIterator getDTMIterator() {
return dtm_iter;
}
//================================================================
// org.w3c.dom.traversal.NodeFilter API follows
/**
* Detaches the NodeIterator from the set which it iterated over,
* releasing any computational resources and placing the iterator in
* the INVALID state.
*/
public void detach() {
// Theoretically, we could release dtm_iter at this point. But
// some of the operations may still want to consult it even though
// navigation is now invalid.
valid = false;
}
/**
* The value of this flag determines whether the children
* of entity reference nodes are visible to the iterator.
*
* @return false, always (the DTM model flattens entity references)
*/
public boolean getExpandEntityReferences() {
return false;
}
/**
* Return a handle to the filter used to screen nodes.
* <p>
* This is ill-defined in Xalan's usage of Nodeiterator, where we have
* built stateful XPath-based filtering directly into the traversal
* object. We could return something which supports the NodeFilter interface
* and allows querying whether a given node would be permitted if it appeared
* as our next node, but in the current implementation that would be very
* complex -- and just isn't all that useful.
*
* @throws DOMException -- NOT_SUPPORTED_ERROR because I can't think
* of anything more useful to do in this case
*/
public NodeFilter getFilter() {
throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
* @return The root node of the NodeIterator, as specified
* when it was created.
*/
public Node getRoot() {
int handle = dtm_iter.getRoot();
return dtm_iter.getDTM(handle).getNode(handle);
}
/**
* Return a mask describing which node types are presented via the
* iterator.
**/
public int getWhatToShow() {
return dtm_iter.getWhatToShow();
}
/**
* @return the next node in the set and advance the position of the
* iterator in the set.
* @throws DOMException - INVALID_STATE_ERR Raised if this method is
* called after the detach method was invoked.
*/
public Node nextNode() throws DOMException {
if (!valid)
throw new DTMDOMException(DOMException.INVALID_STATE_ERR);
int handle = dtm_iter.nextNode();
if (handle == DTM.NULL)
return null;
return dtm_iter.getDTM(handle).getNode(handle);
}
/**
* @return the next previous in the set and advance the position of the
* iterator in the set.
* @throws DOMException - INVALID_STATE_ERR Raised if this method is
* called after the detach method was invoked.
*/
public Node previousNode() {
if (!valid)
throw new DTMDOMException(DOMException.INVALID_STATE_ERR);
int handle = dtm_iter.previousNode();
if (handle == DTM.NULL)
return null;
return dtm_iter.getDTM(handle).getNode(handle);
}
}
| [
"2714956759@qq.com"
] | 2714956759@qq.com |
2cadd8ce2875852e888fcdd6d882bebf6b99bdb2 | c4b94158b0ac8f1c4f3d535b6cdee5d1639743ce | /Java/505__The_Maze_II.java | 17884a548ad5b279787d9f7a332fdfbcb410463f | [] | no_license | FIRESTROM/Leetcode | fc61ae5f11f9cb7a118ae7eac292e8b3e5d10e41 | 801beb43235872b2419a92b11c4eb05f7ea2adab | refs/heads/master | 2020-04-04T17:40:59.782318 | 2019-08-26T18:58:21 | 2019-08-26T18:58:21 | 156,130,665 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | class Solution {
int[][] dirs = {{0,1}, {0,-1}, {-1,0}, {1,0}};
public int shortestDistance(int[][] maze, int[] start, int[] dest) {
int[][] distance = new int[maze.length][maze[0].length];
for (int[] row: distance) Arrays.fill(row, Integer.MAX_VALUE);
distance[start[0]][start[1]] = 0;
dfs(maze, start, distance);
return distance[dest[0]][dest[1]] == Integer.MAX_VALUE ? -1 : distance[dest[0]][dest[1]];
}
public void dfs(int[][] maze, int[] start, int[][] distance) {
for (int[] dir: dirs) {
int x = start[0] + dir[0];
int y = start[1] + dir[1];
int count = 0;
while (x >= 0 && y >= 0 && x < maze.length && y < maze[0].length && maze[x][y] == 0) {
x += dir[0];
y += dir[1];
count++;
}
if (distance[start[0]][start[1]] + count < distance[x - dir[0]][y - dir[1]]) {
distance[x - dir[0]][y - dir[1]] = distance[start[0]][start[1]] + count;
dfs(maze, new int[]{x - dir[0],y - dir[1]}, distance);
}
}
}
}
| [
"junou_cui@berkeley.edu"
] | junou_cui@berkeley.edu |
9dbec5336033e788461576edf21e5f1eb43ff4fa | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/25/25_ecd1c1b8e86e9ba96c743c7bec8b82c66e2af7cd/PrefsActivity/25_ecd1c1b8e86e9ba96c743c7bec8b82c66e2af7cd_PrefsActivity_t.java | 87bfd37c3cc928daa57a4a963f17e06f07c7cfba | [] | 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,403 | java | /*
* This file is part of OppiaMobile - http://oppia-mobile.org/
*
* OppiaMobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OppiaMobile 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 OppiaMobile. If not, see <http://www.gnu.org/licenses/>.
*/
package org.digitalcampus.mobile.learning.activity;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.digitalcampus.mobile.learning.R;
import org.digitalcampus.mobile.learning.model.Lang;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.PreferenceActivity;
public class PrefsActivity extends PreferenceActivity {
public static final String TAG = PrefsActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.prefs);
ListPreference langsList = (ListPreference) findPreference(getString(R.string.prefs_language));
List<String> entries = new ArrayList<String>();
List<String> entryValues = new ArrayList<String>();
Bundle bundle = this.getIntent().getExtras();
if(bundle != null) {
@SuppressWarnings("unchecked")
ArrayList<Lang> langs = (ArrayList<Lang>) bundle.getSerializable("langs");
for(Lang l: langs){
if(!entryValues.contains(l.getLang())){
entryValues.add(l.getLang());
Locale loc = new Locale(l.getLang());
entries.add(loc.getDisplayLanguage(loc));
}
}
}
final CharSequence[] entryCharSeq = entries.toArray(new CharSequence[entries.size()]);
final CharSequence[] entryValsChar = entryValues.toArray(new CharSequence[entryValues.size()]);
langsList.setEntries(entryCharSeq);
langsList.setEntryValues(entryValsChar);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
264c8cad50612c039caa97cace55b329afae8b8e | 39bef83f3a903f49344b907870feb10a3302e6e4 | /Android Studio Projects/bf.io.openshop/src/mbanje/kurt/fabbutton/FabUtil$6.java | 79ee6b34cd8a9684d536f1d7565eadf0566e2594 | [] | no_license | Killaker/Android | 456acf38bc79030aff7610f5b7f5c1334a49f334 | 52a1a709a80778ec11b42dfe9dc1a4e755593812 | refs/heads/master | 2021-08-19T06:20:26.551947 | 2017-11-24T22:27:19 | 2017-11-24T22:27:19 | 111,960,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | package mbanje.kurt.fabbutton;
import android.animation.*;
static final class FabUtil$6 implements ValueAnimator$AnimatorUpdateListener {
final /* synthetic */ OnFabValueCallback val$callback;
public void onAnimationUpdate(final ValueAnimator valueAnimator) {
this.val$callback.onIndeterminateValuesChanged(-1.0f, (float)valueAnimator.getAnimatedValue(), -1.0f, -1.0f);
}
} | [
"ema1986ct@gmail.com"
] | ema1986ct@gmail.com |
ec2aac32e3c7709d3e824dce513f4991de900448 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_1ac4dcd3de14b089227ee02fa4c0b96d25eeb15d/DefaultTypeMapperContext/2_1ac4dcd3de14b089227ee02fa4c0b96d25eeb15d_DefaultTypeMapperContext_t.java | 46102f37b35212536bebf88ad7988e3e2861c8ea | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,990 | java | package org.analogweb.core;
import java.lang.reflect.Array;
import java.util.Collection;
import org.analogweb.ContainerAdaptor;
import org.analogweb.TypeMapper;
import org.analogweb.TypeMapperContext;
import org.analogweb.util.ArrayUtils;
import org.analogweb.util.Assertion;
import org.analogweb.util.logging.Log;
import org.analogweb.util.logging.Logs;
import org.analogweb.util.logging.Markers;
/**
* @author snowgoose
*/
public class DefaultTypeMapperContext implements TypeMapperContext {
private static final Log log = Logs.getLog(DefaultTypeMapperContext.class);
private TypeMapper defaultTypeMapper = new AutoTypeMapper();
private ContainerAdaptor containerAdapter;
public DefaultTypeMapperContext(ContainerAdaptor containerAdapter) {
this.containerAdapter = containerAdapter;
}
@Override
@SuppressWarnings("unchecked")
public <T> T mapToType(Class<? extends TypeMapper> typeMapperClass, Object from,
Class<T> requiredType, String[] formats) {
Assertion.notNull(requiredType, "RequiredType");
log.log(Markers.VARIABLE_ACCESS, "DC000001", from, requiredType, formats);
if (requiredType.isAssignableFrom((from.getClass()))) {
return (T) from;
}
T result = handleCollection(requiredType, from);
if (result != null) {
return result;
}
result = handleArray(requiredType, from);
if (result != null) {
return result;
}
TypeMapper typeMapper = findTypeMapper(typeMapperClass);
if (typeMapper != null) {
return (T) typeMapper.mapToType(from, requiredType, formats);
} else {
return (T) getDefaultTypeMapper().mapToType(from, requiredType, formats);
}
}
@SuppressWarnings("unchecked")
protected <T> T handleArray(Class<T> requiredType, Object from) {
if (from == null) {
return null;
}
Object result = null;
if (from.getClass().isArray() && ArrayUtils.isNotEmpty((Object[]) from)
&& (result = Array.get(from, 0)) != null) {
if (requiredType.isAssignableFrom(result.getClass())) {
return (T) result;
} else if (requiredType.isArray()
&& requiredType.getComponentType().isAssignableFrom(result.getClass())) {
return (T) from;
}
}
return null;
}
@SuppressWarnings("unchecked")
protected <T> T handleCollection(Class<T> requiredType, Object from) {
if (from == null) {
return null;
}
if (from instanceof Collection) {
Collection<?> fromCollection = (Collection<?>) from;
if (Collection.class.isAssignableFrom(requiredType)) {
return (T) fromCollection;
}
Object result = null;
if (fromCollection.isEmpty() == false
&& requiredType.isAssignableFrom((result = fromCollection.iterator().next())
.getClass())) {
return (T) result;
}
}
return null;
}
protected TypeMapper findTypeMapper(Class<? extends TypeMapper> clazz) {
if (clazz == null || isDefaultTypeMapper(clazz)) {
return null;
}
return getContainerAdaptor().getInstanceOfType(clazz);
}
protected ContainerAdaptor getContainerAdaptor() {
return this.containerAdapter;
}
protected boolean isDefaultTypeMapper(Class<? extends TypeMapper> clazz) {
return clazz.equals(TypeMapper.class);
}
protected TypeMapper getDefaultTypeMapper() {
return this.defaultTypeMapper;
}
public void setDefaultTypeMapper(TypeMapper defaultTypeMapper) {
this.defaultTypeMapper = defaultTypeMapper;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
05d25db44ff559f4b76fadec6da71fa12ed1661b | 6bb4a0663e864f7e58d22c2f5ad4b92b390933b2 | /saibz5base/src/main/java/net/ibizsys/psrt/srv/common/dao/PVPartDAOBase.java | 6ef8e99055904d6008a130e0aed49afc78f06749 | [
"Apache-2.0"
] | permissive | bluebird88/iBizSysRuntime | 8a7de1a4e8acecac7f2056fd505aac5a3e4cdc38 | de18dbf57d6f55d64c225a182a34b7dd47c65b50 | refs/heads/master | 2022-03-03T00:31:11.050508 | 2017-07-20T07:34:59 | 2017-07-20T07:34:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,935 | java | /**
* iBizSys 5.0 机器人生产代码(不要直接修改当前代码)
* http://www.ibizsys.net
*/
package net.ibizsys.psrt.srv.common.dao;
import net.ibizsys.paas.db.IDBDialect;
import net.ibizsys.paas.core.IDataEntity;
import net.ibizsys.paas.util.StringHelper;
import net.ibizsys.paas.core.IDEDBCallContext;
import net.ibizsys.paas.db.DBCallResult;
import net.ibizsys.paas.demodel.IDataEntityModel;
import net.ibizsys.paas.demodel.DEModelGlobal;
import net.ibizsys.paas.dao.DAOGlobal;
import net.ibizsys.paas.dao.IDAO;
import net.ibizsys.paas.entity.IEntity;
import javax.annotation.PostConstruct;
import net.ibizsys.psrt.srv.common.demodel.PVPartDEModel;
import net.ibizsys.psrt.srv.common.entity.PVPart;
/**
* 实体[PVPart] DAO对象基类
*/
public abstract class PVPartDAOBase extends net.ibizsys.psrt.srv.PSRuntimeSysDAOBase<PVPart> {
private static final long serialVersionUID = -1L;
public PVPartDAOBase() {
super();
}
@PostConstruct
public void postConstruct() throws Exception {
DAOGlobal.registerDAO(getDAOId(), this);
}
/* (non-Javadoc)
* @see net.ibizsys.paas.dao.DAOBase#getDAOId()
*/
@Override
protected String getDAOId() {
return "net.ibizsys.psrt.srv.common.dao.PVPartDAO";
}
private PVPartDEModel pVPartDEModel;
/**
* 获取实体[PVPart]模型对象
* @return
*/
public PVPartDEModel getPVPartDEModel() {
if(this.pVPartDEModel==null) {
try {
this.pVPartDEModel = (PVPartDEModel)DEModelGlobal.getDEModel("net.ibizsys.psrt.srv.common.demodel.PVPartDEModel");
} catch(Exception ex) {
}
}
return this.pVPartDEModel;
}
/*
* (non-Javadoc)
* @see net.ibizsys.paas.dao.DAOBase#getDEModel()
*/
@Override
public IDataEntityModel getDEModel() {
return this.getPVPartDEModel();
}
} | [
"dev@ibizsys.net"
] | dev@ibizsys.net |
58fa7156cdb653d171058479d0f3e2085d955317 | d82abe22de29543a68e0c2641c021d3cdd49fc30 | /src/main/java/mods/hinasch/unsaga/villager/UnsagaVillagerProfession.java | 130292c4587e9a1ea09e01b6f91b05947017bce0 | [] | no_license | damofujiki/UnsagaMod-for-1.12 | 80f7b782649e66894e0ea90d41ed3d7567ca512e | bbd64f025b81e83e4f8c15fd833afc02e103803a | refs/heads/master | 2020-03-15T03:01:30.694580 | 2018-05-03T02:43:22 | 2018-05-03T02:43:22 | 131,932,242 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,626 | java | package mods.hinasch.unsaga.villager;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Lists;
import mods.hinasch.unsaga.UnsagaMod;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer;
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession;
public class UnsagaVillagerProfession {
public static final VillagerProfession MERCHANT = new VillagerProfession(UnsagaMod.MODID+":merchant"
,UnsagaMod.MODID+":textures/entity/villager/merchant.png"
,"minecraft:textures/entity/zombie_villager/zombie_butcher.png");
public static final VillagerProfession MAGIC_MERCHANT = new VillagerProfession(UnsagaMod.MODID+":magicMerchant"
,UnsagaMod.MODID+":textures/entity/villager/magic_merchant.png"
,"minecraft:textures/entity/zombie_villager/zombie_butcher.png");
public static final VillagerProfession BLACKSMITH = new VillagerProfession(UnsagaMod.MODID+":blackSmith"
,UnsagaMod.MODID+":textures/entity/villager/unsaga_smith.png"
,"minecraft:textures/entity/zombie_villager/zombie_smith.png");
public List<VillagerProfession> professions = Lists.newArrayList();
protected static UnsagaVillagerProfession INSTANCE;
public static UnsagaVillagerProfession instance(){
if(INSTANCE == null){
INSTANCE = new UnsagaVillagerProfession();
}
return INSTANCE;
}
public static boolean isUnsagaVillager(EntityVillager villager){
UnsagaVillagerProfession professions = UnsagaVillagerProfession.instance();
if(villager.getProfessionForge()==MERCHANT){
return true;
}
if(villager.getProfessionForge()==MAGIC_MERCHANT){
return true;
}
if(villager.getProfessionForge()==BLACKSMITH){
return true;
}
return false;
}
public VillagerProfession getRandomProfession(Random rand){
return professions.get(rand.nextInt(professions.size()));
}
protected UnsagaVillagerProfession(){
// VillagerRegistry.instance().register(merchant);
ForgeRegistries.VILLAGER_PROFESSIONS.register(MERCHANT);
new VillagerCareer(MERCHANT,"merchant");
this.professions.add(MERCHANT);
// VillagerRegistry.instance().register(magicMerchant);
ForgeRegistries.VILLAGER_PROFESSIONS.register(MAGIC_MERCHANT);
new VillagerCareer(MAGIC_MERCHANT,"magicMerchant");
this.professions.add(MAGIC_MERCHANT);
// VillagerRegistry.instance().register(unsagaSmith);
ForgeRegistries.VILLAGER_PROFESSIONS.register(BLACKSMITH);
new VillagerCareer(BLACKSMITH,"blackSmith");
this.professions.add(BLACKSMITH);
}
}
| [
"ahoahomen@gmail.com"
] | ahoahomen@gmail.com |
00f41e61eb6e7edb0c02814725b7b838c1cf5c42 | 760f173d4e4c97822149537285aa4bbb5ce13b3e | /src/main/java/pe/joedayz/api/json/JsonEnumSerializer.java | 08efd9e76b52b17e18923e8f762b16abae8384e7 | [] | no_license | JANCARLO123/campusbackend | a80fdd53052ecef12c33f7453d76ec12c785367c | d59606becebbfcd4c65271620ac1f5346a04d0d4 | refs/heads/master | 2021-01-09T23:36:15.563278 | 2016-11-05T15:16:34 | 2016-11-05T15:16:34 | 73,211,306 | 1 | 0 | null | 2016-11-08T17:40:55 | 2016-11-08T17:40:55 | null | UTF-8 | Java | false | false | 646 | java | package pe.joedayz.api.json;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import pe.joedayz.api.util.EnumBase;
@SuppressWarnings("rawtypes")
public class JsonEnumSerializer extends JsonSerializer<EnumBase> {
@Override
public void serialize (EnumBase value, JsonGenerator gen, SerializerProvider arg2)
throws IOException, JsonProcessingException {
gen.writeString((value.getCode()));
}
}
| [
"jose.diaz@joedayz.pe"
] | jose.diaz@joedayz.pe |
aa0f9575d58a07a152418f1b06c13fae8175f600 | cda3816a44e212b52fdf1b9578e66a4543445cbb | /trunk/Src/l2next/gameserver/network/serverpackets/ExShowSeedMapInfo.java | aa38431663257f27c3cb99a9cd2c164182f6d186 | [] | no_license | gryphonjp/L2J | 556d8b1f24971782f98e1f65a2e1c2665a853cdb | 003ec0ed837ec19ae7f7cf0e8377e262bf2d6fe4 | refs/heads/master | 2020-05-18T09:51:07.102390 | 2014-09-16T14:25:06 | 2014-09-16T14:25:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,465 | java | package l2next.gameserver.network.serverpackets;
import l2next.gameserver.instancemanager.SoDManager;
import l2next.gameserver.instancemanager.SoIManager;
import l2next.gameserver.utils.Location;
/**
* Probably the destination coordinates where you should fly your clan's airship.<BR>
* Exactly at the specified coordinates an airship controller is spawned.<BR>
* Sent while being in Gracia, when world map is opened, in response to RequestSeedPhase.<BR>
* FE A1 00 - opcodes<BR>
* 02 00 00 00 - list size<BR>
* <BR>
* B7 3B FC FF - x<BR>
* 38 D8 03 00 - y<BR>
* EB 10 00 00 - z<BR>
* D3 0A 00 00 - sysmsg id<BR>
* <BR>
* F6 BC FC FF - x<BR>
* 48 37 03 00 - y<BR>
* 30 11 00 00 - z<BR>
* CE 0A 00 00 - sysmsg id
*
* @done by n0nam3
*/
public class ExShowSeedMapInfo extends L2GameServerPacket
{
private static final Location[] ENTRANCES = {
new Location(-246857, 251960, 4331, 1),
new Location(-213770, 210760, 4400, 2),
};
@Override
protected void writeImpl()
{
writeD(ENTRANCES.length);
for(Location loc : ENTRANCES)
{
writeD(loc.x);
writeD(loc.y);
writeD(loc.z);
switch(loc.h)
{
case 1: // Seed of Destruction
if(SoDManager.isAttackStage())
{
writeD(2771);
}
else
{
writeD(2772);
}
break;
case 2: // Seed of Immortality
writeD(SoIManager.getCurrentStage() + 2765);
break;
}
}
}
}
| [
"tuningxtreme@108c6750-40d5-47c8-815d-bc471747907c"
] | tuningxtreme@108c6750-40d5-47c8-815d-bc471747907c |
1bea74c9c0109e480f25adeb2fa4b9b63d0e07ef | ca1beeaba34710f4f41d5048bf58a89c1b9d8d29 | /chatak-library/src/main/java/com/chatak/pg/enums/EntryModeEnum.java | ae58c6e52b84c7f149ff0feedc725b4b86464c6d | [] | no_license | itsbalamurali/test_build | f63796b78a050cc03e34527f56dd840e546b0102 | 11c491b17c5a2643e1400a23882ba82d6f3d8033 | refs/heads/master | 2020-04-02T21:16:11.430445 | 2018-06-19T04:14:38 | 2018-06-19T04:14:38 | 154,793,051 | 0 | 2 | null | 2018-10-26T07:15:38 | 2018-10-26T07:15:38 | null | UTF-8 | Java | false | false | 1,368 | java | package com.chatak.pg.enums;
/**
* << Add Comments Here >>
*
* @author Girmiti Software
* @date 01-Apr-2015 3:42:44 PM
* @version 1.0
*/
public enum EntryModeEnum {
UNSPECIFIED("00"),
MANUAL("01"),
MAGNETIC_STRIP("02"),
BARCODE("03"),
OCR("04"), //Optical card reader
ICC("05"),
MANUAL_KEY_ENTRY("06"),
PAN_AUTO_ENTRY_CONTACTLESS_M_CHIP("07"),
PAN_AUTO_ENTRY_ECOMMERCE("09"),
PAN_MANUAL_ENTRY_CHIP("79"),
PAN_SWIPE_CHIP("80"),
PAN_MANUAL_ENTRY_ECOMMERCE("81"),
PAN_SWIPE_CONTACTLESS("91"),
PAN_MANUAL_ENTRY_CONTACTLESS("92"),
CARD_TOKEN("19"),
PAN_TAP_NFC("61"),
PAN_SCAN_BAR("62"),
PAN_SCAN_QR("63"),
PAN_SCAN_BLE("64"),
CASH("99"),
QR_SALE("33"),
CARD_TAP("34");
private final String value;
EntryModeEnum(String v) {
value = v;
}
public String value() {
return value;
}
public static EntryModeEnum fromValue(String v) {
for (EntryModeEnum c : EntryModeEnum.values()) {
if (c.value.equals(v)) {
return c;
}
}
return UNSPECIFIED;
}
public static String getValue(String v) {
if(null != v && v.length() > Integer.parseInt("2")) {
v = v.substring(0, Integer.parseInt("2"));
}
for (EntryModeEnum c : EntryModeEnum.values()) {
if (c.value.equals(v)) {
return c.name();
}
}
return CASH.name();
}
}
| [
"rajesh.bs@girmiti.com"
] | rajesh.bs@girmiti.com |
92dd7e586a66a80ea925eca90cc2b716ecba1711 | c885ef92397be9d54b87741f01557f61d3f794f3 | /tests-without-trycatch/Chart-8/org.jfree.data.time.Week/BBC-F0-opt-40/12/org/jfree/data/time/Week_ESTest_scaffolding.java | 51e30ff1feafc833d603468d04953db04266a006 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 4,003 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Oct 20 17:03:22 GMT 2021
*/
package org.jfree.data.time;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class Week_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.jfree.data.time.Week";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(Week_ESTest_scaffolding.class.getClassLoader() ,
"org.jfree.data.time.MonthConstants",
"org.jfree.data.time.FixedMillisecond",
"org.jfree.data.time.Year",
"org.jfree.data.time.SpreadsheetDate",
"org.jfree.data.time.SerialDate",
"org.jfree.data.time.Week",
"org.jfree.data.time.RegularTimePeriod",
"org.jfree.data.time.TimePeriodFormatException",
"org.jfree.data.time.TimePeriod"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(Week_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.jfree.data.time.RegularTimePeriod",
"org.jfree.data.time.Week",
"org.jfree.data.time.Year",
"org.jfree.data.time.Quarter",
"org.jfree.data.time.Month",
"org.jfree.data.time.Day",
"org.jfree.data.time.Hour",
"org.jfree.data.time.Minute",
"org.jfree.data.time.TimePeriodFormatException",
"org.jfree.data.time.SerialDate",
"org.jfree.data.time.SpreadsheetDate",
"org.jfree.data.time.Second",
"org.jfree.data.time.Millisecond",
"org.jfree.data.time.FixedMillisecond"
);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
7c6dcd20d5bc845b2152d25a7b776cbe41afd77c | 06aa8e90fd57ad9700901058d3fe627bc42f9464 | /app/src/main/java/com/tianjian/teachingclient/basic/bean/SIMCardInfo.java | a3f331237752534861c7fb08c3bc362f6957b71b | [] | no_license | tequiero777/TeachingClient | 161994b3617b1be3e1b15e5b4e6cbd0e1bdba9c6 | 2ab8beca53b9538f26879c85e4fec3c6aa61394c | refs/heads/master | 2021-01-13T14:50:49.811629 | 2016-12-20T01:16:14 | 2016-12-20T01:16:14 | 76,318,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,934 | java | /**
* Copyright (c) 2013 Tianjian, Inc. All rights reserved.
* This software is the confidential and proprietary information of
* Tianjian, Inc. You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with Tianjian.
*/
package com.tianjian.teachingclient.basic.bean;
import com.tianjian.teachingclient.util.StringUtil;
import android.content.Context;
import android.telephony.TelephonyManager;
/**
* 手机SIM卡信息
* <p>
* Title: S.java
* </p>
* <p>
* Copyright: Copyright (c) 2013
* </p>
* <p>
* Company: Tianjian
* </p>
* <p>
* team: TianjianTeam
* </p>
* <p>
*
* @author: cheng
* </p>
* @date 2014年11月7日上午10:03:39
* @version 1.0
*
*/
public class SIMCardInfo{
/**
* TelephonyManager提供设备上获取通讯服务信息的入口。 应用程序可以使用这个类方法确定的电信服务商和国家 以及某些类型的用户访问信息。
* 应用程序也可以注册一个监听器到电话收状态的变化。不需要直接实例化这个类
* 使用Context.getSystemService(Context.TELEPHONY_SERVICE)来获取这个类的实例。
*/
private TelephonyManager telephonyManager;
/**
* 国际移动用户识别码
*/
private String IMSI;
public SIMCardInfo(Context context) {
telephonyManager = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
}
/**
* Role:获取当前设置的电话号码
* <BR>Date:2012-3-12
* <BR>@author cheng
*/
public String getNativePhoneNumber() {
String NativePhoneNumber=null;
NativePhoneNumber=telephonyManager.getLine1Number();
if(!StringUtil.isEmpty(NativePhoneNumber)){
//NativePhoneNumber = "+8618623613316"
NativePhoneNumber = NativePhoneNumber.substring(3);
}
return NativePhoneNumber;
}
/**
* Role:Telecom service providers获取手机服务商信息 <BR>
* 需要加入权限<uses-permission
* android:name="android.permission.READ_PHONE_STATE"/> <BR>
* Date:2012-3-12 <BR>
*
* @author cheng
*/
public String getProvidersName() {
String ProvidersName = null;
// 返回唯一的用户ID;就是这张卡的编号神马的
IMSI = telephonyManager.getSubscriberId();
// IMSI号前面3位460是国家,紧接着后面2位00 02是中国移动,01是中国联通,03是中国电信。
System.out.println(IMSI);
if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) {
ProvidersName = "中国移动";
} else if (IMSI.startsWith("46001")) {
ProvidersName = "中国联通";
} else if (IMSI.startsWith("46003")) {
ProvidersName = "中国电信";
}
return ProvidersName;
}
}
| [
"yhmsn2008@hotmail.com"
] | yhmsn2008@hotmail.com |
8f510c9dc7707204f80a237e6b629a6f9d19b7da | e89d45f9e6831afc054468cc7a6ec675867cd3d7 | /src/main/java/com/microsoft/graph/requests/extensions/IPrivateLinkResourcePolicyRequest.java | 38f9d5892b78d530bc8c1b549d8c88015e94d40b | [
"MIT"
] | permissive | isabella232/msgraph-beta-sdk-java | 67d3b9251317f04a465042d273fe533ef1ace13e | 7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8 | refs/heads/dev | 2023-03-12T05:44:24.349020 | 2020-11-19T15:51:17 | 2020-11-19T15:51:17 | 318,158,544 | 0 | 0 | MIT | 2021-02-23T20:48:09 | 2020-12-03T10:37:46 | null | UTF-8 | Java | false | false | 4,604 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.extensions;
import com.microsoft.graph.models.extensions.PrivateLinkResourcePolicy;
import com.microsoft.graph.concurrency.ICallback;
import com.microsoft.graph.core.ClientException;
import com.microsoft.graph.http.IHttpRequest;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The interface for the Private Link Resource Policy Request.
*/
public interface IPrivateLinkResourcePolicyRequest extends IHttpRequest {
/**
* Gets the PrivateLinkResourcePolicy from the service
*
* @param callback the callback to be called after success or failure
*/
void get(final ICallback<? super PrivateLinkResourcePolicy> callback);
/**
* Gets the PrivateLinkResourcePolicy from the service
*
* @return the PrivateLinkResourcePolicy from the request
* @throws ClientException this exception occurs if the request was unable to complete for any reason
*/
PrivateLinkResourcePolicy get() throws ClientException;
/**
* Delete this item from the service
*
* @param callback the callback when the deletion action has completed
*/
void delete(final ICallback<? super PrivateLinkResourcePolicy> callback);
/**
* Delete this item from the service
*
* @throws ClientException if there was an exception during the delete operation
*/
void delete() throws ClientException;
/**
* Patches this PrivateLinkResourcePolicy with a source
*
* @param sourcePrivateLinkResourcePolicy the source object with updates
* @param callback the callback to be called after success or failure
*/
void patch(final PrivateLinkResourcePolicy sourcePrivateLinkResourcePolicy, final ICallback<? super PrivateLinkResourcePolicy> callback);
/**
* Patches this PrivateLinkResourcePolicy with a source
*
* @param sourcePrivateLinkResourcePolicy the source object with updates
* @return the updated PrivateLinkResourcePolicy
* @throws ClientException this exception occurs if the request was unable to complete for any reason
*/
PrivateLinkResourcePolicy patch(final PrivateLinkResourcePolicy sourcePrivateLinkResourcePolicy) throws ClientException;
/**
* Posts a PrivateLinkResourcePolicy with a new object
*
* @param newPrivateLinkResourcePolicy the new object to create
* @param callback the callback to be called after success or failure
*/
void post(final PrivateLinkResourcePolicy newPrivateLinkResourcePolicy, final ICallback<? super PrivateLinkResourcePolicy> callback);
/**
* Posts a PrivateLinkResourcePolicy with a new object
*
* @param newPrivateLinkResourcePolicy the new object to create
* @return the created PrivateLinkResourcePolicy
* @throws ClientException this exception occurs if the request was unable to complete for any reason
*/
PrivateLinkResourcePolicy post(final PrivateLinkResourcePolicy newPrivateLinkResourcePolicy) throws ClientException;
/**
* Posts a PrivateLinkResourcePolicy with a new object
*
* @param newPrivateLinkResourcePolicy the object to create/update
* @param callback the callback to be called after success or failure
*/
void put(final PrivateLinkResourcePolicy newPrivateLinkResourcePolicy, final ICallback<? super PrivateLinkResourcePolicy> callback);
/**
* Posts a PrivateLinkResourcePolicy with a new object
*
* @param newPrivateLinkResourcePolicy the object to create/update
* @return the created PrivateLinkResourcePolicy
* @throws ClientException this exception occurs if the request was unable to complete for any reason
*/
PrivateLinkResourcePolicy put(final PrivateLinkResourcePolicy newPrivateLinkResourcePolicy) throws ClientException;
/**
* Sets the select clause for the request
*
* @param value the select clause
* @return the updated request
*/
IPrivateLinkResourcePolicyRequest select(final String value);
/**
* Sets the expand clause for the request
*
* @param value the expand clause
* @return the updated request
*/
IPrivateLinkResourcePolicyRequest expand(final String value);
}
| [
"GraphTooling@service.microsoft.com"
] | GraphTooling@service.microsoft.com |
81c96f0150798f93bef0367af3cd0b1bb42614ca | d0f5e1f47d0c99142b5b1932acb230a6d6db768b | /src/main/java/org/codenarc/idea/inspections/braces/IfStatementBracesInspectionTool.java | 5d20d44381c600c82d90b4c7f07843cfac2e4345 | [] | no_license | melix/codenarc-idea | f1e3c11c444eb05a23ce29a407e1b84ba12d20f7 | 567cb81cae1495a3d008fc4e4ab543c22ce6b204 | refs/heads/master | 2023-08-03T11:10:33.385264 | 2023-07-31T07:30:32 | 2023-07-31T07:30:32 | 1,278,732 | 10 | 11 | null | 2023-07-31T07:30:33 | 2011-01-21T15:03:47 | Java | UTF-8 | Java | false | false | 1,710 | java | package org.codenarc.idea.inspections.braces;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.psi.PsiElement;
import java.util.Collection;
import java.util.Collections;
import javax.annotation.Generated;
import org.codenarc.idea.CodeNarcInspectionTool;
import org.codenarc.rule.Violation;
import org.codenarc.rule.braces.IfStatementBracesRule;
import org.jetbrains.annotations.NotNull;
@Generated("You can customize this class at the end of the file or remove this annotation to skip regeneration completely")
public class IfStatementBracesInspectionTool extends CodeNarcInspectionTool<IfStatementBracesRule> {
// this code has been generated from org.codenarc.rule.braces.IfStatementBracesRule
public static final String GROUP = "Braces";
public IfStatementBracesInspectionTool() {
super(new IfStatementBracesRule());
applyDefaultConfiguration(getRule());
}
@Override
public String getRuleset() {
return GROUP;
}
public void setApplyToClassNames(String value) {
getRule().setApplyToClassNames(value);
}
public String getApplyToClassNames() {
return getRule().getApplyToClassNames();
}
public void setDoNotApplyToClassNames(String value) {
getRule().setDoNotApplyToClassNames(value);
}
public String getDoNotApplyToClassNames() {
return getRule().getDoNotApplyToClassNames();
}
// custom code can be written after this line and it will be preserved during the regeneration
@Override
protected @NotNull Collection<LocalQuickFix> getQuickFixesFor(Violation violation, PsiElement violatingElement) {
return Collections.emptyList();
}
}
| [
"vladimir@orany.cz"
] | vladimir@orany.cz |
51e8529362b59c2984e903080987bc3871f2f445 | cecc82d48ae4ab2b88fcb50aae8b1598636ea7a8 | /XiaYiYeCamera/src/main/java/com/hichip/thecamhi/main/HiActivity.java | 571080e960cc78c24e7372f54de2252ed6b65b27 | [] | no_license | ivanocj/APICloudModuleSDK_XiaYiYeCamera | 33f94df37f2d00ebffab0ca4941db3fd32b9b567 | 188e62bcdd1f994e24fdf4a494f30b075ff22837 | refs/heads/master | 2022-11-30T14:46:13.925215 | 2020-08-12T03:32:21 | 2020-08-12T03:32:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,754 | java | package com.hichip.thecamhi.main;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.app.Service;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.KeyEvent;
import com.hichip.R;
import com.hichip.hichip.progressload.DialogUtils;
public class HiActivity extends FragmentActivity {
protected ProgressDialog progressDialog;
public Builder mDlgBuilder;
public Dialog mJhLoading;
private AudioManager audioManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
audioManager = (AudioManager) getSystemService(Service.AUDIO_SERVICE);
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.out_to_right, R.anim.in_from_left);
}
@Override
public void startActivityForResult(Intent intent, int requestCode) {
super.startActivityForResult(intent, requestCode);
overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);
break;
case KeyEvent.KEYCODE_VOLUME_UP:
audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE,
AudioManager.FX_FOCUS_NAVIGATION_UP);
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER,
AudioManager.FX_FOCUS_NAVIGATION_UP);
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public void startActivity(Intent intent) {
super.startActivity(intent);
overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);
}
public void showYesNoDialog(int msg, DialogInterface.OnClickListener listener) {
Builder builder = new Builder(HiActivity.this);
builder.setMessage(getResources().getString(msg)).setTitle(R.string.tips_warning)
.setPositiveButton(getResources().getString(R.string.btn_yes), listener)
.setNegativeButton(getResources().getString(R.string.btn_no), listener).show();
}
public void showAlert(CharSequence message) {
Builder dlgBuilder = new Builder(this);
dlgBuilder.setIcon(android.R.drawable.ic_dialog_alert);
dlgBuilder.setTitle(R.string.tips_warning);
dlgBuilder.setMessage(message);
dlgBuilder.setPositiveButton(getText(R.string.btn_ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).show();
}
public void showAlert(CharSequence message, DialogInterface.OnClickListener listener, boolean cancelable) {
if (mDlgBuilder == null) {
mDlgBuilder = new Builder(this);
mDlgBuilder.setIcon(android.R.drawable.ic_dialog_alert);
mDlgBuilder.setTitle(R.string.tips_warning);
mDlgBuilder.setMessage(message);
mDlgBuilder.setCancelable(cancelable);
mDlgBuilder.setPositiveButton(getText(R.string.btn_ok), listener).show();
}
}
public interface MyDismiss {
public void OnDismiss();
}
MyDismiss myDismiss;
public void setOnLoadingProgressDismissListener(MyDismiss dismiss) {
this.myDismiss = dismiss;
}
public void showLoadingProgress() {
if (progressDialog == null) {
progressDialog = new ProgressDialog(HiActivity.this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setIcon(R.drawable.ic_launcher);
progressDialog.setMessage(getText(R.string.tips_loading));
progressDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
if (myDismiss != null) {
myDismiss.OnDismiss();
progressDialog = null;
}
}
});
progressDialog.show();
}
}
/**
* @param theme
* @param isOutSideOnTouch
*/
public void showLoadingProgress(int theme, boolean isOutSideOnTouch) {
if (progressDialog == null) {
progressDialog = new ProgressDialog(HiActivity.this, theme);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(isOutSideOnTouch);
progressDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
if (myDismiss != null) {
myDismiss.OnDismiss();
progressDialog = null;
}
}
});
progressDialog.show();
}
}
/**
* @param isOutSideOnTouch
* @param title Progressdialog ��Content Message
*/
public void showLoadingProgress(boolean isOutSideOnTouch, CharSequence title) {
if (progressDialog == null) {
progressDialog = new ProgressDialog(HiActivity.this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(isOutSideOnTouch);
progressDialog.setMessage(title);
progressDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
if (myDismiss != null) {
myDismiss.OnDismiss();
progressDialog = null;
}
}
});
progressDialog.show();
}
}
public void showAlertnew(Drawable iconId, CharSequence title, CharSequence message, CharSequence cancel,
CharSequence okch, DialogInterface.OnClickListener listener) {
if (mDlgBuilder == null) {
mDlgBuilder = new Builder(this);
mDlgBuilder.setIcon(iconId);
mDlgBuilder.setTitle(title);
mDlgBuilder.setMessage(message);
mDlgBuilder.setPositiveButton(okch, listener).setNegativeButton(cancel, listener).show();
}
}
public void dismissLoadingProgress() {
if (progressDialog != null && !isFinishing()) {//#181521
progressDialog.cancel();
progressDialog = null;
}
}
/**
* 隐藏dialog
*/
public void dismissjuHuaDialog() {
if (mJhLoading != null && !isFinishing()) {
mJhLoading.dismiss();
}
}
/**
* 显示dialog
*/
public void showjuHuaDialog() {
if (mJhLoading == null) {
mJhLoading = DialogUtils.createLoadingDialog(this, true);
}
mJhLoading.show();
}
}
| [
"13343401268@qq.com"
] | 13343401268@qq.com |
a4e313f3762f43627cec049d0236cedbb01942fb | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/third-party/other/external-module-1066/src/java/external_module_1066/a/IFoo0.java | 38557beaa3c14067faf0cca7b4258f895ec21ca1 | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 874 | java | package external_module_1066.a;
import javax.net.ssl.*;
import javax.rmi.ssl.*;
import java.awt.datatransfer.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see javax.management.Attribute
* @see javax.naming.directory.DirContext
* @see javax.net.ssl.ExtendedSSLSession
*/
@SuppressWarnings("all")
public interface IFoo0<W> extends java.util.concurrent.Callable<W> {
javax.rmi.ssl.SslRMIClientSocketFactory f0 = null;
java.awt.datatransfer.DataFlavor f1 = null;
java.beans.beancontext.BeanContext f2 = null;
String getName();
void setName(String s);
W get();
void set(W e);
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
6e17245e5468e49a995a75f3ff6286a0fb0949ee | 8fa563f642cd754d16bfc717abd681fd15906b1c | /src/main/java/com/be4tech/becare3/web/rest/vm/ManagedUserVM.java | 3ba638dee91935162acb25441e12a9c6440d17de | [] | no_license | eter98/Becare3 | 17b35bf343f460d6a0c4bd0960d9046bcf9af52f | 16cf139b6178c9763a46b768967474fbae376a9e | refs/heads/main | 2023-04-21T02:15:18.143783 | 2021-05-05T14:54:44 | 2021-05-05T14:54:44 | 364,612,669 | 0 | 0 | null | 2021-05-05T14:56:08 | 2021-05-05T14:54:26 | Java | UTF-8 | Java | false | false | 470 | java | package com.be4tech.becare3.web.rest.vm;
import com.be4tech.becare3.service.dto.AdminUserDTO;
/**
* View Model extending the AdminUserDTO, which is meant to be used in the user management UI.
*/
public class ManagedUserVM extends AdminUserDTO {
public ManagedUserVM() {
// Empty constructor needed for Jackson.
}
// prettier-ignore
@Override
public String toString() {
return "ManagedUserVM{" + super.toString() + "} ";
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
c9202487db0366db4a426c7113a6d2c6e40cfe48 | 32b72e1dc8b6ee1be2e80bb70a03a021c83db550 | /ast_results/codinguser_gnucash-android/app/src/main/java/org/gnucash/android/ui/settings/TransactionsPreferenceFragment.java | 6f6b410f8f26de305e24db3b2fdbcb83dcc032da | [] | no_license | cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning | d90c41a17e88fcd99d543124eeb6e93f9133cb4a | 0564143d92f8024ff5fa6b659c2baebf827582b1 | refs/heads/master | 2020-07-13T13:53:40.297493 | 2019-01-11T11:51:18 | 2019-01-11T11:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,682 | java | // isComment
package org.gnucash.android.ui.settings;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.support.v7.preference.SwitchPreferenceCompat;
import org.gnucash.android.R;
import org.gnucash.android.db.DatabaseSchema;
import org.gnucash.android.db.adapter.AccountsDbAdapter;
import org.gnucash.android.db.adapter.BooksDbAdapter;
import org.gnucash.android.db.adapter.CommoditiesDbAdapter;
import org.gnucash.android.model.Commodity;
import org.gnucash.android.ui.settings.dialog.DeleteAllTransactionsConfirmationDialog;
import java.util.Currency;
import java.util.List;
/**
* isComment
*/
public class isClassOrIsInterface extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
@Override
public void isMethod(Bundle isParameter) {
super.isMethod(isNameExpr);
isMethod().isMethod(isNameExpr.isMethod().isMethod());
ActionBar isVariable = ((AppCompatActivity) isMethod()).isMethod();
isNameExpr.isMethod(true);
isNameExpr.isMethod(true);
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
}
@Override
public void isMethod(Bundle isParameter, String isParameter) {
isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
}
@Override
public void isMethod() {
super.isMethod();
SharedPreferences isVariable = isMethod().isMethod();
String isVariable = isNameExpr.isMethod(isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
Preference isVariable = isMethod(isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
isMethod(isNameExpr, isNameExpr);
isNameExpr.isMethod(this);
isNameExpr = isMethod(isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
isNameExpr.isMethod(this);
String isVariable = isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
SwitchPreferenceCompat isVariable = (SwitchPreferenceCompat) isMethod(isNameExpr);
isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr, true));
String isVariable = isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr = (SwitchPreferenceCompat) isMethod(isNameExpr);
isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr, true));
String isVariable = isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr = (SwitchPreferenceCompat) isMethod(isNameExpr);
isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr, true));
Preference isVariable = isMethod(isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
isNameExpr.isMethod(new Preference.OnPreferenceClickListener() {
@Override
public boolean isMethod(Preference isParameter) {
isMethod();
return true;
}
});
}
@Override
public boolean isMethod(Preference isParameter, Object isParameter) {
if (isNameExpr.isMethod().isMethod(isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr))) {
boolean isVariable = (Boolean) isNameExpr;
isMethod(isNameExpr);
} else {
isMethod(isNameExpr, isNameExpr.isMethod());
}
return true;
}
/**
* isComment
*/
public void isMethod() {
DeleteAllTransactionsConfirmationDialog isVariable = isNameExpr.isMethod();
isNameExpr.isMethod(isMethod().isMethod(), "isStringConstant");
}
/**
* isComment
*/
private void isMethod(boolean isParameter) {
String isVariable = isNameExpr ? "isStringConstant" : "isStringConstant";
AccountsDbAdapter isVariable = isNameExpr.isMethod();
List<Commodity> isVariable = isNameExpr.isMethod();
for (Commodity isVariable : isNameExpr) {
String isVariable = isNameExpr.isMethod(isNameExpr);
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr, isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);
}
}
}
/**
* isComment
*/
private void isMethod(Preference isParameter, String isParameter) {
String isVariable = isNameExpr.isMethod("isStringConstant") ? isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr) : isMethod().isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr.isMethod(isNameExpr);
}
}
| [
"matheus@melsolucoes.net"
] | matheus@melsolucoes.net |
34ebc9e9916a23e37a4f0447cd22fdef5e6472ed | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Jetty/Jetty5949.java | 886e05a27b184396362c3c2e860ed20ee35f1675 | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 376 | java | public static WebAppContext getCurrentWebAppContext()
{
ContextHandler.Context context=ContextHandler.getCurrentContext();
if (context!=null)
{
ContextHandler handler = context.getContextHandler();
if (handler instanceof WebAppContext)
return (WebAppContext)handler;
}
return null;
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
22b9bbdf9f96c3f2c792e108bbb729d4a8da084a | 90f17cd659cc96c8fff1d5cfd893cbbe18b1240f | /src/main/java/com/google/android/gms/internal/measurement/zzgt.java | 91b983116803628c048667a4ba69982422c7868b | [] | no_license | redpicasso/fluffy-octo-robot | c9b98d2e8745805edc8ddb92e8afc1788ceadd08 | b2b62d7344da65af7e35068f40d6aae0cd0835a6 | refs/heads/master | 2022-11-15T14:43:37.515136 | 2020-07-01T22:19:16 | 2020-07-01T22:19:16 | 276,492,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,012 | java | package com.google.android.gms.internal.measurement;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
final class zzgt {
private static final zzgt zzalc = new zzgt();
private final zzha zzald = new zzfv();
private final ConcurrentMap<Class<?>, zzgx<?>> zzale = new ConcurrentHashMap();
public static zzgt zzvy() {
return zzalc;
}
public final <T> zzgx<T> zzf(Class<T> cls) {
String str = "messageType";
zzez.zza((Object) cls, str);
zzgx<T> zzgx = (zzgx) this.zzale.get(cls);
if (zzgx != null) {
return zzgx;
}
Object zze = this.zzald.zze(cls);
zzez.zza((Object) cls, str);
zzez.zza(zze, "schema");
zzgx<T> zzgx2 = (zzgx) this.zzale.putIfAbsent(cls, zze);
return zzgx2 != null ? zzgx2 : zze;
}
public final <T> zzgx<T> zzw(T t) {
return zzf(t.getClass());
}
private zzgt() {
}
}
| [
"aaron@goodreturn.org"
] | aaron@goodreturn.org |
1115d143a947e1ba16ca214d01e47b5a7284b781 | 28814debdd13ea4f4dba2bb7d98b9280e2bb2820 | /b2c-mongodb/src/main/java/org/javamaster/b2c/mongodb/repository/CustomizingMallWashOrderRepository.java | c86fda55034a98ad978632abd1039b09eadc95a5 | [
"Unlicense"
] | permissive | autumnFly/b2c | c0ddabcfbd82b488c0d428eebb448e0025cb4dea | 68524604d39de2bc1bb4823de6a41878bdb238f1 | refs/heads/master | 2022-12-28T06:58:07.208736 | 2020-09-20T17:35:29 | 2020-09-20T17:35:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package org.javamaster.b2c.mongodb.repository;
import org.javamaster.b2c.mongodb.model.AggregateValue;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author yudong
* @date 2020/7/3
*/
public interface CustomizingMallWashOrderRepository {
List<AggregateValue> findServiceTypePercentByTemplate(LocalDateTime startDate, LocalDateTime endDate);
}
| [
"liangyudong@bluemoon.com.cn"
] | liangyudong@bluemoon.com.cn |
e3a76cf32b23ba3a240300df9612fb4c84c353e0 | f280628caaf863de03550ed9c2191fec4393edf7 | /src/test/java/io/orax/invest/config/timezone/HibernateTimeZoneIT.java | 7326c39b38dcdce8f5669ed6dac87af8843a2ca1 | [] | no_license | pashamad/orax-invest-app | 117f71fd9c4613c83e087ed29c922b9e42b3caf1 | e469dd26cb8bd43fee7b53e65f3ae5d3f191937d | refs/heads/main | 2023-05-03T12:25:14.904463 | 2021-05-23T22:15:06 | 2021-05-23T22:15:06 | 370,167,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,696 | java | package io.orax.invest.config.timezone;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
import io.orax.invest.IntegrationTest;
import io.orax.invest.repository.timezone.DateTimeWrapper;
import io.orax.invest.repository.timezone.DateTimeWrapperRepository;
import java.time.*;
import java.time.format.DateTimeFormatter;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.transaction.annotation.Transactional;
/**
* Integration tests for the ZoneId Hibernate configuration.
*/
@IntegrationTest
class HibernateTimeZoneIT {
@Autowired
private DateTimeWrapperRepository dateTimeWrapperRepository;
@Autowired
private JdbcTemplate jdbcTemplate;
@Value("${spring.jpa.properties.hibernate.jdbc.time_zone:UTC}")
private String zoneId;
private DateTimeWrapper dateTimeWrapper;
private DateTimeFormatter dateTimeFormatter;
private DateTimeFormatter timeFormatter;
private DateTimeFormatter dateFormatter;
@BeforeEach
public void setup() {
dateTimeWrapper = new DateTimeWrapper();
dateTimeWrapper.setInstant(Instant.parse("2014-11-12T05:50:00.0Z"));
dateTimeWrapper.setLocalDateTime(LocalDateTime.parse("2014-11-12T07:50:00.0"));
dateTimeWrapper.setOffsetDateTime(OffsetDateTime.parse("2011-12-14T08:30:00.0Z"));
dateTimeWrapper.setZonedDateTime(ZonedDateTime.parse("2011-12-14T08:30:00.0Z"));
dateTimeWrapper.setLocalTime(LocalTime.parse("14:30:00"));
dateTimeWrapper.setOffsetTime(OffsetTime.parse("14:30:00+02:00"));
dateTimeWrapper.setLocalDate(LocalDate.parse("2016-09-10"));
dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S").withZone(ZoneId.of(zoneId));
timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss").withZone(ZoneId.of(zoneId));
dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
}
@Test
@Transactional
void storeInstantWithZoneIdConfigShouldBeStoredOnGMTTimeZone() {
dateTimeWrapperRepository.saveAndFlush(dateTimeWrapper);
String request = generateSqlRequest("instant", dateTimeWrapper.getId());
SqlRowSet resultSet = jdbcTemplate.queryForRowSet(request);
String expectedValue = dateTimeFormatter.format(dateTimeWrapper.getInstant());
assertThatDateStoredValueIsEqualToInsertDateValueOnGMTTimeZone(resultSet, expectedValue);
}
@Test
@Transactional
void storeLocalDateTimeWithZoneIdConfigShouldBeStoredOnGMTTimeZone() {
dateTimeWrapperRepository.saveAndFlush(dateTimeWrapper);
String request = generateSqlRequest("local_date_time", dateTimeWrapper.getId());
SqlRowSet resultSet = jdbcTemplate.queryForRowSet(request);
String expectedValue = dateTimeWrapper.getLocalDateTime().atZone(ZoneId.systemDefault()).format(dateTimeFormatter);
assertThatDateStoredValueIsEqualToInsertDateValueOnGMTTimeZone(resultSet, expectedValue);
}
@Test
@Transactional
void storeOffsetDateTimeWithZoneIdConfigShouldBeStoredOnGMTTimeZone() {
dateTimeWrapperRepository.saveAndFlush(dateTimeWrapper);
String request = generateSqlRequest("offset_date_time", dateTimeWrapper.getId());
SqlRowSet resultSet = jdbcTemplate.queryForRowSet(request);
String expectedValue = dateTimeWrapper.getOffsetDateTime().format(dateTimeFormatter);
assertThatDateStoredValueIsEqualToInsertDateValueOnGMTTimeZone(resultSet, expectedValue);
}
@Test
@Transactional
void storeZoneDateTimeWithZoneIdConfigShouldBeStoredOnGMTTimeZone() {
dateTimeWrapperRepository.saveAndFlush(dateTimeWrapper);
String request = generateSqlRequest("zoned_date_time", dateTimeWrapper.getId());
SqlRowSet resultSet = jdbcTemplate.queryForRowSet(request);
String expectedValue = dateTimeWrapper.getZonedDateTime().format(dateTimeFormatter);
assertThatDateStoredValueIsEqualToInsertDateValueOnGMTTimeZone(resultSet, expectedValue);
}
@Test
@Transactional
void storeLocalTimeWithZoneIdConfigShouldBeStoredOnGMTTimeZoneAccordingToHis1stJan1970Value() {
dateTimeWrapperRepository.saveAndFlush(dateTimeWrapper);
String request = generateSqlRequest("local_time", dateTimeWrapper.getId());
SqlRowSet resultSet = jdbcTemplate.queryForRowSet(request);
String expectedValue = dateTimeWrapper
.getLocalTime()
.atDate(LocalDate.of(1970, Month.JANUARY, 1))
.atZone(ZoneId.systemDefault())
.format(timeFormatter);
assertThatDateStoredValueIsEqualToInsertDateValueOnGMTTimeZone(resultSet, expectedValue);
}
@Test
@Transactional
void storeOffsetTimeWithZoneIdConfigShouldBeStoredOnGMTTimeZoneAccordingToHis1stJan1970Value() {
dateTimeWrapperRepository.saveAndFlush(dateTimeWrapper);
String request = generateSqlRequest("offset_time", dateTimeWrapper.getId());
SqlRowSet resultSet = jdbcTemplate.queryForRowSet(request);
String expectedValue = dateTimeWrapper
.getOffsetTime()
.toLocalTime()
.atDate(LocalDate.of(1970, Month.JANUARY, 1))
.atZone(ZoneId.systemDefault())
.format(timeFormatter);
assertThatDateStoredValueIsEqualToInsertDateValueOnGMTTimeZone(resultSet, expectedValue);
}
@Test
@Transactional
void storeLocalDateWithZoneIdConfigShouldBeStoredWithoutTransformation() {
dateTimeWrapperRepository.saveAndFlush(dateTimeWrapper);
String request = generateSqlRequest("local_date", dateTimeWrapper.getId());
SqlRowSet resultSet = jdbcTemplate.queryForRowSet(request);
String expectedValue = dateTimeWrapper.getLocalDate().format(dateFormatter);
assertThatDateStoredValueIsEqualToInsertDateValueOnGMTTimeZone(resultSet, expectedValue);
}
private String generateSqlRequest(String fieldName, long id) {
return format("SELECT %s FROM jhi_date_time_wrapper where id=%d", fieldName, id);
}
private void assertThatDateStoredValueIsEqualToInsertDateValueOnGMTTimeZone(SqlRowSet sqlRowSet, String expectedValue) {
while (sqlRowSet.next()) {
String dbValue = sqlRowSet.getString(1);
assertThat(dbValue).isNotNull();
assertThat(dbValue).isEqualTo(expectedValue);
}
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
bb1e1875e2b9023479a54888199c48bbdbb66151 | 3d970fb4346b489197fc50004e0d418b162c46fb | /app/src/main/java/com/delaroystudios/scanner/networking/api/Service.java | a914c1495575ba2755ed5ba8c6da21b836937075 | [] | no_license | delaroy/ScannerApp | c175ffd9048f42ea488d794abe83a00a42434c31 | 7ca5e459abb1823f1b88c33cefe2e84cdb2c23c5 | refs/heads/master | 2023-04-08T16:34:59.989864 | 2021-04-08T17:16:35 | 2021-04-08T17:16:35 | 343,382,054 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,131 | java | package com.delaroystudios.scanner.networking.api;
import com.delaroystudios.scanner.model.LoginModel;
import com.delaroystudios.scanner.model.LoginResponse;
import com.delaroystudios.scanner.model.PaidModel;
import com.delaroystudios.scanner.model.Product;
import com.delaroystudios.scanner.model.ProductFound;
import com.delaroystudios.scanner.model.RegisterModel;
import com.delaroystudios.scanner.model.RegisterResponse;
import com.delaroystudios.scanner.networking.Routes;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
public interface Service {
@POST(Routes.PRODUCT + "{sku}")
Call<ProductFound> create(@Path("sku") String sku);
@POST(Routes.REGISTER)
Call<RegisterResponse> createRegister(@Body RegisterModel registerModel);
@POST(Routes.LOGIN)
Call<LoginResponse> createLogin(@Body LoginModel loginModel);
@POST(Routes.CONTROLLERLOGIN)
Call<LoginResponse> loginController(@Body LoginModel loginModel);
@POST(Routes.PAID)
Call<RegisterResponse> insertPayment(@Body PaidModel paidModel);
}
| [
"bamoyk@yahoo.com"
] | bamoyk@yahoo.com |
8d407b7814cc337227fb04c97cb0f0872967ad40 | f749485e290ebb26ff81113c472f071966547282 | /kafka-demo/src/main/java/com/wyx/kafkademo/producer/MyPartitioner.java | e1892a38f221df927b49948f6dc7b3d9360b38d4 | [] | no_license | justwyx/wyx-kafka-demo | 5f9c3121e85012370afbcdeadc52d4f1c1fa5340 | 559175ef96943536650c0225c0e818899c9a62a2 | refs/heads/master | 2023-01-07T05:58:29.504765 | 2020-10-28T08:32:32 | 2020-10-28T08:32:32 | 307,569,057 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 943 | java | package com.wyx.kafkademo.producer;
import org.apache.kafka.clients.producer.Partitioner;
import org.apache.kafka.common.Cluster;
import java.util.Map;
//todo:需求:自定义kafka的分区函数
public class MyPartitioner implements Partitioner{
/**
* 通过这个方法来实现消息要去哪一个分区中
* @param topic
* @param key
* @param bytes
* @param value
* @param bytes1
* @param cluster
* @return
*/
public int partition(String topic, Object key, byte[] bytes, Object value, byte[] bytes1, Cluster cluster) {
//获取topic分区数
int partitions = cluster.partitionsForTopic(topic).size();
//key.hashCode()可能会出现负数 -1 -2 0 1 2
//Math.abs 取绝对值
return Math.abs(key.hashCode()% partitions);
}
public void close() {
}
public void configure(Map<String, ?> map) {
}
}
| [
"wenyvxiang@iiasaas.com"
] | wenyvxiang@iiasaas.com |
43fedab8fa2db0f5d4b6231774f5349bfde96263 | 87e952be6d566be831ac65bed06e409de67775c8 | /ex-99-final/services/generator-api/src/main/java/org/bookstore/generator/rest/NumberGeneratorResource.java | 55d299dd9c3661d3bb97e6b98e4116a341a4d6b4 | [] | no_license | agoncal/agoncal-training-microservices | f0506b4b5bf1b3722bc93e2377b2221ae0556c78 | bc8d15d4809199afc06ef2d6f11f840444c731d4 | refs/heads/master | 2020-03-26T03:45:19.419623 | 2018-09-21T05:21:56 | 2018-09-21T05:21:56 | 144,469,618 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,476 | java | package org.bookstore.generator.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* REST controller for Generating Numbers.
*/
@RestController
@RequestMapping("/api")
@Api(description = "Generating all sorts of book numbers.")
public class NumberGeneratorResource {
private final Logger log = LoggerFactory.getLogger(NumberGeneratorResource.class);
/**
* GET /numbers : generates a number.
*
* @return the ResponseEntity with status 200 (OK) and the generated number
*/
@GetMapping(path = "/numbers", produces = MediaType.TEXT_PLAIN_VALUE)
@ApiOperation(value = "Generates a book number.")
public ResponseEntity<String> generateNumber() {
log.debug("REST request to generate a number");
String result = "BK-" + Math.random();
return ResponseEntity.ok()
.body(result);
}
@GetMapping("/numbers/health")
@ApiOperation(value = "Checks the health of this REST endpoint")
public ResponseEntity<Void> health() {
log.info("Alive and Kicking !!!");
return ResponseEntity.ok().build();
}
}
| [
"antonio.goncalves@gmail.com"
] | antonio.goncalves@gmail.com |
fb8578d8ccfc82a261a8f1a1414723f52eb6af45 | 64fb4188da2c00a4c1e48d0777b5396a22a9eb2e | /src/main/java/com/pbc/job/SyncProcessThread.java | c9730d06ae0a4432b39aeccf837e5f357d258d57 | [] | no_license | EmbeddedDownloads/BitVaultPBCMediaVault | 8f2404dedfda0dc76f733475198de2bdb6a233d3 | 944af94898cb3db293160d85a2d590a4c7bef3ad | refs/heads/master | 2020-04-02T04:45:44.301076 | 2018-10-21T17:22:38 | 2018-10-21T17:22:38 | 154,033,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,705 | java | package com.pbc.job;
import static com.pbc.utility.ConfigConstants.MIN_NODE_VALIDITY;
import java.io.PrintWriter;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.pbc.blockchain.BlockContent;
import com.pbc.models.GetStatusRequest;
import com.pbc.utility.ConfigConstants;
import com.pbc.utility.GetSystemIp;
import com.pbc.utility.StringConstants;
@Component
public class SyncProcessThread extends Thread {
private static Logger logger = Logger.getLogger(SyncProcessThread.class);
@Autowired
private BlockSynchronizationReceiver synchronizationReceiver;
// Wait to 1 minute so that sync data received properly before start sync
// process.
private final Long waitForInterval = 1000 * 60 * 1L;
private Map<String, PbcSyncModel> receivedSyncModelMap = null;
private final Set<BlockContent> commonBlockSet = new TreeSet<>();
private static List<String> listOfHosts = new CopyOnWriteArrayList<>();
final Map<String, List<GetStatusRequest>> mapWithStatus = new HashMap<>();
static {
listOfHosts = ConfigConstants.NODES;
listOfHosts = listOfHosts.stream().filter(t -> !t.isEmpty()).collect(Collectors.toList());
}
/**
* Map of tag + transactionId and list of host which contains this key. Map
* Maintained for the blocks which need to get from other nodes.
*/
private final Map<GetStatusRequest, List<String>> receiveBlockForTxnIds = new HashMap<>();
/**
* List of tag + transaction id which is to be deleted from this node.
*/
private final List<GetStatusRequest> deleteBlockForTxnIds = new ArrayList<>();
private final List<String> localHashList = new ArrayList<>();
@Override
public void run() {
try {
// Start operation after given time minute
Thread.sleep(waitForInterval);
// Setting SynchronizationReceiver to not accept any incoming data
// which sync is in process.
synchronizationReceiver.doAccept(false);
receivedSyncModelMap = synchronizationReceiver.getReceivedSyncModelMap();
if (null == receivedSyncModelMap || receivedSyncModelMap.isEmpty()) {
logger.info("Received Data from other nodes was null or empty");
return;
}
if (null != receivedSyncModelMap.get(GetSystemIp.getSystemLocalIp())) {
localHashList.addAll(receivedSyncModelMap.get(GetSystemIp.getSystemLocalIp()).getHashList());
}
// Build common set.
buildCommonBlockSet();
if (receivedSyncModelMap.size() >= MIN_NODE_VALIDITY) {
// Start block synchronization mechanism.
doSync();
// Send TxnId with Status to other nodes.
sendTxnListToOtherNode();
} else {
logger.info(
"Preventing block syncing because no. of communicated host is " + receivedSyncModelMap.size());
}
// Clear the collections for fresh data
cleanSynchronizationBuffers();
// Clear common set for new incoming data.
synchronizationReceiver.clearReceivedSyncModelMap();
// Setting SynchronizationReceiver to accept incoming data now.
synchronizationReceiver.doAccept(true);
// Terminating this thread.
interrupt();
} catch (final InterruptedException e) {
// Empty catch.
logger.warn("Thread was interrupted " + e.getMessage());
} catch (final Exception e) {
logger.error("Problem while starting Sync Process Thread ", e);
}
}
private void cleanSynchronizationBuffers() {
logger.info("Cleaning synchronization buffers...");
commonBlockSet.clear();
receiveBlockForTxnIds.clear();
deleteBlockForTxnIds.clear();
localHashList.clear();
if (null != receivedSyncModelMap) {
receivedSyncModelMap.clear();
}
logger.info("Cleaning done.");
}
/**
* Build a common set from the sets of all nodes.
*/
private void buildCommonBlockSet() {
commonBlockSet.addAll(receivedSyncModelMap.values().stream().map(set -> set.getOrderedBlockSet())
.flatMap(Set::stream).collect(Collectors.toSet()));
}
/**
* Implemented all the cases which is responsible for block chain
* synchronization.
*/
private void doSync() {
final StringBuilder combineKey = new StringBuilder();
final List<GetStatusRequest> listOfTxn = new ArrayList<>();
commonBlockSet.forEach(blockContent -> {
try {
combineKey.append(blockContent.getTag()).append(blockContent.getHashTxnId());
final GetStatusRequest tagTxn = new GetStatusRequest();
tagTxn.setTag(blockContent.getTag());
tagTxn.setTransactionId(blockContent.getHashTxnId());
listOfTxn.add(tagTxn);
} catch (final Exception e) {
logger.error("Error while validating block to sync for transaction id " + blockContent.getHashTxnId(),
e);
}
});
mapWithStatus.put(StringConstants.TXT_STATUS, listOfTxn);
}
private void sendTxnListToOtherNode() {
final ObjectMapper mapper = new ObjectMapper();
listOfHosts.forEach((host) -> {
try (final Socket socket = new Socket();) {
logger.info("Sending MapOfTagTxnId: " + mapWithStatus + " To host: " + host);
socket.setTcpNoDelay(true);
socket.connect(new InetSocketAddress(host, ConfigConstants.PORT_NO_TAGTXD_SEND), 1000 * 10);
final String valueAsString = mapper.writeValueAsString(mapWithStatus);
final PrintWriter printWriter = new PrintWriter(socket.getOutputStream());
printWriter.write(valueAsString);
printWriter.flush();
printWriter.close();
} catch (final Exception e) {
logger.error("Problem while Sending listOftagTaxnId: " + mapWithStatus + " to host: " + host);
}
});
}
public void sendTxnListToOtherNode(final Map<String, List<GetStatusRequest>> mapToSend, final String clientip) {
final ObjectMapper mapper = new ObjectMapper();
try (final Socket socket = new Socket();) {
logger.info("Sending MapToSend: " + mapToSend + " To host: " + clientip);
socket.setTcpNoDelay(true);
socket.connect(new InetSocketAddress(clientip, ConfigConstants.PORT_NO_TAGTXD_SEND), 1000 * 10);
final String valueAsString = mapper.writeValueAsString(mapToSend);
logger.info("Sending value: " + valueAsString + " to Host: " + clientip);
final PrintWriter printWriter = new PrintWriter(socket.getOutputStream());
printWriter.write(valueAsString);
printWriter.flush();
printWriter.close();
} catch (final Exception e) {
logger.error("Problem while Sending listOftagTaxnId: " + mapWithStatus + " to host: " + clientip);
}
}
} | [
"hein@Heins-iMac.local"
] | hein@Heins-iMac.local |
5d55157a9bd87cc3800cc1da77a0f8ced9b594eb | 8b78c4fa5812c98a84db5b1acf364b6a723cbeb4 | /src/main/java/refinedstorage/api/storage/item/IGroupedItemStorage.java | 6e6bd8bc591830542ea230ebfb0e525374c866dd | [
"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 | 2,609 | java | package refinedstorage.api.storage.item;
import net.minecraft.item.ItemStack;
import refinedstorage.api.network.INetworkMaster;
import refinedstorage.api.storage.CompareUtils;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
/**
* This holds all items from all the connected storages from a {@link INetworkMaster}.
* <p>
* Refined Storage uses this class mainly for use in Grids and Detectors to avoid querying
* individual {@link IItemStorage} constantly (performance impact) and to send and detect storage changes
* more efficiently.
*/
public interface IGroupedItemStorage {
/**
* Rebuilds the global item list.
* Typically called when a {@link IItemStorageProvider} is added or removed from the network.
*/
void rebuild();
/**
* Adds an item to the global item list.
* <p>
* Note that this doesn't modify any of the connected storages, but just modifies the global item list.
* Use {@link INetworkMaster#insertItem(ItemStack, int, boolean)} to add an item to an actual storage.
* <p>
* Will merge it with another item if it already exists.
*
* @param stack the stack to add, do NOT modify
* @param rebuilding whether this method is called while the storage is rebuilding
*/
void add(@Nonnull ItemStack stack, boolean rebuilding);
/**
* Removes a item from global item list.
* <p>
* Note that this doesn't modify any of the connected storages, but just modifies the global item list.
* Use {@link INetworkMaster#extractItem(ItemStack, int, int)} to remove an item from an actual storage.
*
* @param stack the item to remove, do NOT modify
*/
void remove(@Nonnull ItemStack stack);
/**
* Gets an item from the network.
*
* @param stack the stack to find
* @param flags the flags to compare on, see {@link CompareUtils}
* @return null if no item is found, or the stack, do NOT modify
*/
@Nullable
ItemStack get(@Nonnull ItemStack stack, int flags);
/**
* Gets an item from the network by hash, see {@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)}.
*
* @return null if no item is found matching the hash, or the stack, do NOT modify
*/
@Nullable
ItemStack get(int hash);
/**
* @return all items in this storage network
*/
Collection<ItemStack> getStacks();
/**
* @return the item storages connected to this network
*/
List<IItemStorage> getStorages();
}
| [
"raoulvdberge@gmail.com"
] | raoulvdberge@gmail.com |
203b15d969682e83b1ddc7697de0d26e5f27b77c | fe5e00e551a642f961944685c89e30a81292e748 | /src/main/java/org/datanucleus/metadata/JdbcType.java | 0295ca913185631e16e2240373089eb668ab9302 | [
"Apache-2.0"
] | permissive | sangkyunyoon/datanucleus-core | 6805660edaaf52c60a8b4d158dd31411a5c03125 | fd927f7be286df7f765c0d37aaf1766ba806d7e2 | refs/heads/master | 2021-05-29T20:38:17.996473 | 2015-11-23T16:28:17 | 2015-11-23T16:28:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,359 | java | /**********************************************************************
Copyright (c) 2014 Andy Jefferson and others. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributors:
...
**********************************************************************/
package org.datanucleus.metadata;
import java.sql.Types;
/**
* Representation of the jdbc-type of a column.
* Note that something similar to this is now present in JDK 1.8 so we could remove this in the future when that is the minimum JDK supported.
*/
public enum JdbcType
{
BIGINT(Types.BIGINT),
BINARY(Types.BINARY),
BIT(Types.BIT),
BLOB(Types.BLOB),
BOOLEAN(Types.BOOLEAN),
CHAR(Types.CHAR),
CLOB(Types.CLOB),
DATALINK(Types.DATALINK),
DATE(Types.DATE),
DECIMAL(Types.DECIMAL),
DOUBLE(Types.DOUBLE),
FLOAT(Types.FLOAT),
INTEGER(Types.INTEGER),
LONGNVARCHAR(Types.LONGNVARCHAR),
LONGVARBINARY(Types.LONGVARBINARY),
LONGVARCHAR(Types.LONGVARCHAR),
NCHAR(Types.NCHAR),
NCLOB(Types.NCLOB),
NUMERIC(Types.NUMERIC),
NVARCHAR(Types.NVARCHAR),
OTHER(Types.OTHER),
REAL(Types.REAL),
SMALLINT(Types.SMALLINT),
SQLXML(Types.SQLXML),
TIME(Types.TIME),
TIME_WITH_TIMEZONE(2013), // JDK 1.8+
TIMESTAMP(Types.TIMESTAMP),
TIMESTAMP_WITH_TIMEZONE(2014), // JDK 1.8+
TINYINT(Types.TINYINT),
VARBINARY(Types.VARBINARY),
VARCHAR(Types.VARCHAR),
XMLTYPE(2007); // TODO This is not strictly speaking a JDBC type (actually an SQL type for Oracle)
private int value;
private JdbcType(int value)
{
this.value = value;
}
public int getValue()
{
return value;
}
public static JdbcType getEnumByValue(int value)
{
switch (value)
{
case Types.BIGINT:
return BIGINT;
case Types.BINARY:
return BINARY;
case Types.BIT:
return BIT;
case Types.BLOB:
return BLOB;
case Types.BOOLEAN:
return BOOLEAN;
case Types.CHAR:
return CHAR;
case Types.CLOB:
return CLOB;
case Types.DATALINK:
return DATALINK;
case Types.DATE:
return DATE;
case Types.DECIMAL:
return DECIMAL;
case Types.DOUBLE:
return DOUBLE;
case Types.FLOAT:
return FLOAT;
case Types.INTEGER:
return INTEGER;
case Types.LONGNVARCHAR:
return LONGNVARCHAR;
case Types.LONGVARBINARY:
return LONGVARBINARY;
case Types.LONGVARCHAR:
return LONGVARCHAR;
case Types.NCHAR:
return NCHAR;
case Types.NCLOB:
return NCLOB;
case Types.NUMERIC:
return NUMERIC;
case Types.NVARCHAR:
return NVARCHAR;
case Types.OTHER:
return OTHER;
case Types.REAL:
return REAL;
case Types.SMALLINT:
return SMALLINT;
case Types.SQLXML:
return SQLXML;
case Types.TIME:
return TIME;
case 2013:
return TIME_WITH_TIMEZONE;
case Types.TIMESTAMP:
return TIMESTAMP;
case 2014:
return TIMESTAMP_WITH_TIMEZONE;
case Types.TINYINT:
return TINYINT;
case Types.VARBINARY:
return VARBINARY;
case Types.VARCHAR:
return VARCHAR;
case 2007:
return XMLTYPE;
default:
return null;
}
}
} | [
"andy@datanucleus.org"
] | andy@datanucleus.org |
8e4f138da98f08afa974efee86e7053d06cec1ed | e1450a329c75a55cf6ccd0ce2d2f3517b3ee51c5 | /src/main/java/home/javarush/javaSyntax/task15/task1513/Solution.java | b9f5e06ab35e5ae511667ed04293538f9e873ef2 | [] | no_license | nikolaydmukha/netology-java-base-java-core | afcf0dd190f4c912c5feb2ca8897bc17c09a9ec1 | eea55c27bbbab3b317c3ca5b0719b78db7d27375 | refs/heads/master | 2023-03-18T13:33:24.659489 | 2021-03-25T17:31:52 | 2021-03-25T17:31:52 | 326,259,412 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | package home.javarush.javaSyntax.task15.task1513;
import java.nio.file.Path;
import java.util.Scanner;
/*
Зри в корень
*/
public class Solution {
public static void main(String[] args) {
//напишите тут ваш код
try(Scanner scanner = new Scanner(System.in);){
String fileName = scanner.nextLine();
Path path = Path.of(fileName).getRoot();
System.out.println(path);
}
}
}
| [
"dmukha@mail.ru"
] | dmukha@mail.ru |
12fb34cfe83c3ce2d9823971c3a1ea0d0414199a | 92c1674aacda6c550402a52a96281ff17cfe5cff | /module22/module05/module8/module2/src/main/java/com/android/example/module22_module05_module8_module2/ClassAAJ.java | a886557c6d163a160c25d204fc2295eabecf25b9 | [] | no_license | bingranl/android-benchmark-project | 2815c926df6a377895bd02ad894455c8b8c6d4d5 | 28738e2a94406bd212c5f74a79179424dd72722a | refs/heads/main | 2023-03-18T20:29:59.335650 | 2021-03-12T11:47:03 | 2021-03-12T11:47:03 | 336,009,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | package com.android.example.module22_module05_module8_module2;
public class ClassAAJ {
private com.android.example.module22_module05_module8_module1.ClassAAH instance_var_1_0 = new com.android.example.module22_module05_module8_module1.ClassAAH();
private com.android.example.module22_module05_module8_module3.ClassAAC instance_var_1_1 = new com.android.example.module22_module05_module8_module3.ClassAAC();
private com.android.example.module22_module05_module8_module3.ClassAAH instance_var_1_2 = new com.android.example.module22_module05_module8_module3.ClassAAH();
public void method0(
com.android.example.module22_module05_module8_module3.ClassAAA param0,
com.android.example.module22_module05_module8_module1.ClassAAG param1) throws Throwable {
}
public void method1(
com.android.example.module22_module05_module8_module3.ClassAAD param0) throws Throwable {
param0.method0(new com.android.example.module22_module04_module11.ClassAAD(), new com.android.example.module22_module04_module11.ClassAAG(), new com.android.example.module22_module04_module11.ClassAAC());
}
}
| [
"bingran@google.com"
] | bingran@google.com |
646973288e3c179d128c5723d04d9912cdc9a05f | 08e5b14cca74e954ad08f4dfe66f40a19a583632 | /src/com/bridgelab/programming/datastructure/palindrome_checker/PalindromeCheaker.java | 84fbb3645b653a2bed10c2cfe6c1508954b0394b | [] | no_license | Shriniwaspathak/shriniwas | 0658a36481e49fb673c1cda520d77d12de5e0053 | 584968ac7793149c9af8cc28d4a74035f0aa6fd0 | refs/heads/master | 2020-06-28T23:14:06.679742 | 2019-08-17T13:40:07 | 2019-08-17T13:40:07 | 200,366,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package com.bridgelab.programming.datastructure.palindrome_checker;
public class PalindromeCheaker {
public static void main(String args[]) {
Deque dq = new Deque();
boolean result = dq.result();
if (result == true)
System.out.print("string is palindrome:");
else
System.out.print("string is not palindrome:");
}
}
| [
"you@example.com"
] | you@example.com |
4fd9d2bb6c5e87074c3821b227517eb693e1f416 | b2de611098f691cd7aa3ca9af453e5190e3df931 | /src/core/net/Session.java | 3c4405c31df6bb2bff8fd38cab6db894a6b170a5 | [] | no_license | rojr/Project-Aeolus | d70abe05a9f508aa61e43ec6d6572b7a3d17e327 | 6bde71f2dcacb157d16f4a9150a4b5509cccb88f | refs/heads/master | 2021-01-17T23:26:21.778032 | 2015-09-16T22:37:37 | 2015-09-16T22:37:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 455 | java | package core.net;
import org.jboss.netty.channel.Channel;
import core.game.model.entity.player.Player;
public class Session {
private final Channel channel;
private Player player;
public Session(Channel channel) {
this.channel = channel;
}
public Channel getChannel() {
return channel;
}
public Player getPlayer() {
return player;
}
public void setPlayer(Player player) {
this.player = player;
}
}
| [
"nshusa99@gmail.com"
] | nshusa99@gmail.com |
dda8d4c450366475a6294c3a7c1aa4f256e5e8ac | fc2ab5ae263917dee7d6905103fdd2ee541be3c1 | /core/src/macbury/neutrino/core/map/Hex.java | c4ea5c8656fca37990932d516d3d3cd330bf499d | [] | no_license | macbury/Hex-engine | b26dfdc771e0c7c901e8a17206d8cc936511cfa0 | 51a6e70ea52d779fe68791f86f49184d0e210be2 | refs/heads/master | 2021-01-10T07:44:49.231071 | 2016-01-26T08:20:17 | 2016-01-26T08:20:17 | 50,414,311 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,181 | java | package macbury.neutrino.core.map;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
/**
* This class defines each hexagonal tile on the map using cube cordinate system
*/
public class Hex {
public final static int SIZE = 1;
public final static float WIDTH = SIZE * 2;
public final static float HEIGHT = MathUtils.floorPositive((float)(Math.sqrt(3.0)/2.0) * WIDTH);
private final static Hex tempHex = new Hex();
public final static Hex DIRECTIONS[] = new Hex[] {
new Hex(1, 0, -1), new Hex(1, -1, 0), new Hex(0, -1, 1),
new Hex(-1, 0, 1), new Hex(-1, 1, 0), new Hex(0, 1, -1)
};
public int q;
public int r;
public int s;
/**
* Creates new hex
* @param q column index
* @param r row index
* @param s
*/
public Hex(int q, int r, int s) {
this.q = q;
this.r = r;
this.s = s;
}
/**
* Creates copy of passed hex tile
* @param hexToCopy
*/
public Hex(Hex hexToCopy) {
this.set(hexToCopy);
}
public Hex() {
}
/**
* Copy values from passed tile
* @param hexToCopy
* @return current hex tile
*/
public Hex set(Hex hexToCopy) {
this.q = hexToCopy.q;
this.r = hexToCopy.r;
this.s = hexToCopy.s;
return this;
}
/**
* Adds other hex tile coordinates to this tile coordinate
* @param otherHex
* @return current hex tile
*/
public Hex add(Hex otherHex) {
this.q += otherHex.q;
this.r += otherHex.r;
this.s += otherHex.s;
return this;
}
/**
* Subs other hex tile coordinates to this tile coordinate
* @param otherHex
* @return current hex tile
*/
public Hex sub(Hex otherHex) {
this.q -= otherHex.q;
this.r -= otherHex.r;
this.s -= otherHex.s;
return this;
}
/**
* Multiply other hex tile coordinates to this tile coordinate
* @param otherHex
* @return current hex tile
*/
public Hex mul(Hex otherHex) {
this.q *= otherHex.q;
this.r *= otherHex.r;
this.s *= otherHex.s;
return this;
}
/**
* Returns length of this hex tile
* @return
*/
public int len() {
return (Math.abs(q) + Math.abs(r) + Math.abs(s))/2;
}
/**
* Returns distance to passed hex from current hex
* @return
*/
public int dst(Hex toHex) {
return tempHex.set(this).sub(toHex).len();
}
/**
* Transform {@link Hex} into {@link Vector2} position
* @param layout
* @param out
* @return
*/
public Vector2 toVector2(Layout layout, Vector2 out) {
return Hex.hexToVector2(layout, this, out);
}
/**
* Transform {@link Hex} into {@link Vector2} position
* @param layout
* @param in
* @param out
* @return
*/
public static Vector2 hexToVector2(Layout layout, Hex in, Vector2 out) {
Orientation M = layout.orientation;
float x = (M.f0 * in.q + M.f1 * in.r) * layout.size.x;
float y = (M.f2 * in.q + M.f3 * in.r) * layout.size.y;
return out.set(x + layout.origin.x, y + layout.origin.y);
}
/**
* Transform {@link Vector2} into {@link Hex} position
* @param layout
* @param in
* @param out
* @return
*/
/*public static Hex vector2ToHex(Layout layout, Vector2 in, Hex out) {
Orientation M = layout.orientation;
float x = (M.f0 * in.q + M.f1 * in.r) * layout.size.x;
float y = (M.f2 * in.q + M.f3 * in.r) * layout.size.y;
return out.set(x + layout.origin.x, y + layout.origin.y);
}*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Hex)) return false;
Hex hex = (Hex) o;
if (q != hex.q) return false;
if (r != hex.r) return false;
return s == hex.s;
}
@Override
public int hashCode() {
int result = q;
result = 31 * result + r;
result = 31 * result + s;
return result;
}
@Override
public String toString() {
return "Hex{" +
"q=" + q +
", r=" + r +
", s=" + s +
'}';
}
public Hex set(int q, int r, int s) {
this.q = q;
this.r = r;
this.s = s;
return this;
}
public Hex set(int q, int r) {
this.q = q;
this.r = r;
this.s = -q-r;
return this;
}
}
| [
"macbury@gmail.com"
] | macbury@gmail.com |
4e7d08fc78733f19d4f8aac2d72940544070d931 | da9db3922e9f716ced7e0082096b1cc32dd86f5d | /src/main/java/pl/java/scalatech/config/mongo/MongoSettings.java | e7caa9fa3ac327e40378ea525de1d6576e5d6634 | [] | no_license | przodownikR1/Cep | 8e084753b5008ae7e15512adc805b30638583d4d | e6b46df31983e2111c9b1ca2f5bcd7b8fc8c687a | refs/heads/master | 2021-01-19T02:40:39.552114 | 2016-11-28T10:33:45 | 2016-11-28T10:33:45 | 23,699,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package pl.java.scalatech.config.mongo;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import lombok.Data;
@ConfigurationProperties(prefix="mongo")
@Data
@Component
public class MongoSettings {
private String database;
private String host;
}
| [
"przodownik@tlen.pl"
] | przodownik@tlen.pl |
69099393daa724228d62591dea0a795c16cfd5ae | 657924c0e0c46110c3da43c8730194f397c3ac4c | /src/main/java/methods/NumberOfArgumentsInAMethod2.java | 76680998368c2360f5dbbac57ceb3c4a28f660bc | [] | no_license | lenshuygh/Java_ReadableAndReusableCode | 98a990e9d0319063d060d88b5ba98b85dc4d2e2a | bd6295c0c6a00cc7d38bf1114b9ba24122c4611d | refs/heads/master | 2020-08-03T10:40:16.414183 | 2019-10-06T15:59:04 | 2019-10-06T15:59:04 | 211,722,233 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java | package methods;
public class NumberOfArgumentsInAMethod2 {
public static void main(String[] args) {
new NumberOfArgumentsInAMethod2();
}
NumberOfArgumentsInAMethod2(){
//bad
String greeting = new EmailSender().constructTemplateEmail("Mr.","John","Smith");
//good
Person john = new Person("Mr.","John","Smith");
String greeting2 = new EmailSender().constructTemplateEmail(john);
}
private class EmailSender {
public String constructTemplateEmail(String title, String name, String surname) {
return String.format("Hello, %s %s %s",title,name,surname);
}
public String constructTemplateEmail(Person person) {
return String.format("Hello, %s %s %s",person.getTitle(),person.getName(),person.getSurName());
}
}
static class Person{
private String title;
private String name;
private String surName;
public Person(String title, String name, String surName) {
this.title = title;
this.name = name;
this.surName = surName;
}
public String getTitle() {
return title;
}
public String getName() {
return name;
}
public String getSurName() {
return surName;
}
}
}
| [
"lens.huygh@gmail.com"
] | lens.huygh@gmail.com |
ff44fba96979c99fff2126c094470eb6b2aca7ed | 04a12720462c0cfce091e25b8cdaedb13f921b61 | /javaweb/day25-cookie&session&jsp/04_代码/day25_cookieAndSession/src/com/itheima/demo4_Cookie的有效时长/ServletDemo4.java | 94046d42f88c36ea359c5fbfece1386c460bda23 | [] | no_license | haoxiangjiao/Java20210921 | 31662732e44b248208b21f6f1aaf18e6335b398c | 6edcbd081d33bace427fdc6041e9eeaac89def8a | refs/heads/main | 2023-07-19T03:42:17.498075 | 2021-09-25T15:06:11 | 2021-09-25T15:06:11 | 409,024,583 | 0 | 0 | null | 2021-09-22T01:19:43 | 2021-09-22T01:19:43 | null | UTF-8 | Java | false | false | 1,547 | java | package com.itheima.demo4_Cookie的有效时长;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @Author:pengzhilin
* @Date: 2021/5/6 10:27
*/
@WebServlet("/ServletDemo4")
public class ServletDemo4 extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 获取所有的cookie对象,打印数据
Cookie[] cookies = request.getCookies();
if (cookies != null){
for (Cookie cookie : cookies) {
System.out.println(cookie.getName()+"="+cookie.getValue());
}
}
// 创建Cookie对象
Cookie aCookie = new Cookie("akey", "aaa");
Cookie bCookie = new Cookie("bkey", "bbb");
// 设置aCookie的有效时长,bCookie的有效时长为默认
aCookie.setMaxAge(60*60*24*7);
// 响应Cookie对象
response.addCookie(aCookie);
response.addCookie(bCookie);
// 响应数据到页面,证明当前Servlet执行了
response.getWriter().print("ServletDemo4....");
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}
| [
"70306977+liufanpy@users.noreply.github.com"
] | 70306977+liufanpy@users.noreply.github.com |
155b66456be40a1c649a50a9be57c0c9aaacad4f | a2df6764e9f4350e0d9184efadb6c92c40d40212 | /aliyun-java-sdk-sofa/src/main/java/com/aliyuncs/sofa/model/v20190815/QueryLinkefabricFabricNewappinfoRequest.java | b45bcf3f0bd3d940e9ac68e0e428b74863f7419d | [
"Apache-2.0"
] | permissive | warriorsZXX/aliyun-openapi-java-sdk | 567840c4bdd438d43be6bd21edde86585cd6274a | f8fd2b81a5f2cd46b1e31974ff6a7afed111a245 | refs/heads/master | 2022-12-06T15:45:20.418475 | 2020-08-20T08:37:31 | 2020-08-26T06:17:49 | 290,450,773 | 1 | 0 | NOASSERTION | 2020-08-26T09:15:48 | 2020-08-26T09:15:47 | null | UTF-8 | Java | false | false | 2,219 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.sofa.model.v20190815;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.sofa.Endpoint;
/**
* @author auto create
* @version
*/
public class QueryLinkefabricFabricNewappinfoRequest extends RpcAcsRequest<QueryLinkefabricFabricNewappinfoResponse> {
private Long tenantId;
private String configType;
private String releaseId;
public QueryLinkefabricFabricNewappinfoRequest() {
super("SOFA", "2019-08-15", "QueryLinkefabricFabricNewappinfo", "sofa");
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}
public Long getTenantId() {
return this.tenantId;
}
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
if(tenantId != null){
putBodyParameter("TenantId", tenantId.toString());
}
}
public String getConfigType() {
return this.configType;
}
public void setConfigType(String configType) {
this.configType = configType;
if(configType != null){
putBodyParameter("ConfigType", configType);
}
}
public String getReleaseId() {
return this.releaseId;
}
public void setReleaseId(String releaseId) {
this.releaseId = releaseId;
if(releaseId != null){
putBodyParameter("ReleaseId", releaseId);
}
}
@Override
public Class<QueryLinkefabricFabricNewappinfoResponse> getResponseClass() {
return QueryLinkefabricFabricNewappinfoResponse.class;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
22b79ff2bc7ed45692edb6da4abdd75d8e7d5278 | ea4b2e14a0d00d8dd03dd5a69ff56da1e693dcd4 | /Java-DesignPatterns-WORKSPACE/HeadFirstDesignPatterns/src/examples_1_strategy_set_behavior_dynamically/RubberDuck.java | 0b4c8dbaba3ee4656d778baa13d85b3b7afbce45 | [] | no_license | umeshkilkile/java | c69aa244a3f62988cee94337b1b47581a35d1764 | 0879eecf56faae8842bcde7aebccb42b52c6d189 | refs/heads/master | 2020-04-09T22:36:28.326660 | 2019-01-04T11:02:49 | 2019-01-04T11:02:49 | 160,633,177 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package examples_1_strategy_set_behavior_dynamically;
public class RubberDuck extends Duck {
public RubberDuck() {
quackBehavior = new MuteQuack();
flyBehavior = new FlyNoWay();
}
@Override
public void display() {
System.out.println("I'm a real Rubber Duck");
}
}
| [
"umeshsubhash.kilkile@lowes.com"
] | umeshsubhash.kilkile@lowes.com |
fda0094ab7b703ce8fd222296d528a497a6683db | 8563fe82723ead28031115a9bf7c541deebeda39 | /wildfly/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/ServerAuditLogger.java | b8f271d8e2cc56328210d88d6ca6b973f9ee7658 | [
"LicenseRef-scancode-dco-1.1",
"Apache-2.0"
] | permissive | benjifin/infinispan | 05e2ea59a286bc4db27bd57a79521edc42d7ef4f | 4ea78a75d2bb2cc690dd1e3b5ae786d10c36cdd1 | refs/heads/master | 2023-07-24T11:33:22.894967 | 2019-11-22T11:04:51 | 2019-11-25T13:13:23 | 223,975,130 | 0 | 1 | Apache-2.0 | 2023-09-01T18:36:17 | 2019-11-25T15:01:43 | null | UTF-8 | Java | false | false | 2,281 | java | /*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file 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.jboss.as.clustering.infinispan.subsystem;
import javax.security.auth.Subject;
import org.infinispan.security.AuditContext;
import org.infinispan.security.AuditLogger;
import org.infinispan.security.AuditResponse;
import org.infinispan.security.AuthorizationPermission;
import org.jboss.security.audit.AuditEvent;
import org.jboss.security.audit.AuditLevel;
import org.jboss.security.audit.AuditManager;
/**
* ServerAuditLogger.
*
* @author Tristan Tarrant
* @since 7.0
*/
public class ServerAuditLogger implements AuditLogger {
private final AuditManager auditManager;
ServerAuditLogger(AuditManager auditManager) {
this.auditManager = auditManager;
}
@Override
public void audit(Subject subject, AuditContext context, String contextName, AuthorizationPermission permission, AuditResponse response) {
String level;
switch (response) {
case ALLOW:
level = AuditLevel.SUCCESS;
break;
case DENY:
level = AuditLevel.FAILURE;
break;
case ERROR:
level = AuditLevel.ERROR;
break;
default:
level = AuditLevel.INFO;
break;
}
AuditEvent ae = new AuditEvent(level);
auditManager.audit(ae);
}
}
| [
"galder@zamarreno.com"
] | galder@zamarreno.com |
56fb57cea9cadcce5502bd65e8fc9df4b0e4eb7f | 791242405b3a1e16dc20abde538b7f8e7e7c5ac9 | /h2o-core/src/main/java/water/DTask.java | ed4cdc7232b3eaad26048fd2ca7bbc79d6c4fc2e | [
"Apache-2.0"
] | permissive | Esmaeili/h2o-dev | d8101593c136e892a3004d948abe55da1116aede | 3e446de2f5f0807ebfc61af7c9962c178ee99160 | refs/heads/master | 2021-01-17T21:55:24.769495 | 2014-08-08T19:02:48 | 2014-08-08T19:02:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,677 | java | package water;
import water.DException.DistributedException;
import water.H2O.H2OCountedCompleter;
/** Objects which are passed and remotely executed.<p>
* <p>
* Efficient serialization methods for subclasses will be automatically
* generated, but explicit ones can be provided. Transient fields will
* <em>not</em> be mirrored between the VMs.
* <ol>
* <li>On the local vm, this task will be serialized and sent to a remote.</li>
* <li>On the remote, the task will be deserialized.</li>
* <li>On the remote, the {@link #dinvoke(H2ONode)} method will be executed.</li>
* <li>On the remote, the task will be serialized and sent to the local vm</li>
* <li>On the local vm, the task will be deserialized
* <em>into the original instance</em></li>
* <li>On the local vm, the {@link #onAck()} method will be executed.</li>
* <li>On the remote, the {@link #onAckAck()} method will be executed.</li>
* </ol>
*
*/
public abstract class DTask<T extends DTask> extends H2OCountedCompleter implements Freezable {
protected DTask(){}
public DTask(H2OCountedCompleter completer){super(completer);}
// Return a distributed-exception
protected DException _ex;
public final boolean hasException() { return _ex != null; }
public synchronized void setException(Throwable ex) { if( _ex==null ) _ex = new DException(ex); }
public DistributedException getDException() { return _ex==null ? null : _ex.toEx(); }
// Track if the reply came via TCP - which means a timeout on ACKing the TCP
// result does NOT need to get the entire result again, just that the client
// needs more time to process the TCP result.
transient boolean _repliedTcp; // Any return/reply/result was sent via TCP
/** Top-level remote execution hook. Called on the <em>remote</em>. */
public void dinvoke( H2ONode sender ) { compute2(); }
/** 2nd top-level execution hook. After the primary task has received a
* result (ACK) and before we have sent an ACKACK, this method is executed on
* the <em>local vm</em>. Transients from the local vm are available here. */
public void onAck() {}
/** 3rd top-level execution hook. After the original vm sent an ACKACK, this
* method is executed on the <em>remote</em>. Transients from the remote vm
* are available here. */
public void onAckAck() {}
/** Override to remove 2 lines of logging per RPC. 0.5M RPC's will lead to
* 1M lines of logging at about 50 bytes/line produces 50M of log file,
* which will swamp all other logging output. */
public boolean logVerbose() { return true; }
// For MRTasks, we need to copyOver
protected void copyOver( T src ) { icer().copyOver(this,src); }
}
| [
"cliffc@acm.org"
] | cliffc@acm.org |
1e9f7de80b7f67c790ce0369a1b04c868d5299e9 | 83436380fe01acf30dd154294b3da930e58c5ceb | /BelejanorProject/src/com/belejanor/switcher/bimo/pacs/pacs_002_022/GenericOrganisationIdentification1.java | 72445e91116b2a6303f900a57f22e3b266adecf1 | [] | no_license | jmptrader/BelejanorSwitch | 83e847ee3dc6a555a40e6347f40af4e106c9054f | ce11d46b5ed52b89d22b5890f1e4fad29730125a | refs/heads/master | 2023-02-07T07:22:42.266465 | 2020-12-27T05:07:15 | 2020-12-27T05:07:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,448 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520
// 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.02.15 at 01:12:40 PM COT
//
package com.belejanor.switcher.bimo.pacs.pacs_002_022;
import java.io.Serializable;
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 GenericOrganisationIdentification1 complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="GenericOrganisationIdentification1">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Id" type="{urn:iso:std:iso:20022:tech:xsd:pacs.002.001.08.022}Max35Text"/>
* <element name="SchmeNm" type="{urn:iso:std:iso:20022:tech:xsd:pacs.002.001.08.022}OrganisationIdentificationSchemeName1Choice" minOccurs="0"/>
* <element name="Issr" type="{urn:iso:std:iso:20022:tech:xsd:pacs.002.001.08.022}Max35Text" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@SuppressWarnings("serial")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GenericOrganisationIdentification1", propOrder = {
"id",
"schmeNm",
"issr"
})
public class GenericOrganisationIdentification1 implements Serializable{
@XmlElement(name = "Id", required = true)
protected String id;
@XmlElement(name = "SchmeNm")
protected OrganisationIdentificationSchemeName1Choice schmeNm;
@XmlElement(name = "Issr")
protected String issr;
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* Gets the value of the schmeNm property.
*
* @return
* possible object is
* {@link OrganisationIdentificationSchemeName1Choice }
*
*/
public OrganisationIdentificationSchemeName1Choice getSchmeNm() {
return schmeNm;
}
/**
* Sets the value of the schmeNm property.
*
* @param value
* allowed object is
* {@link OrganisationIdentificationSchemeName1Choice }
*
*/
public void setSchmeNm(OrganisationIdentificationSchemeName1Choice value) {
this.schmeNm = value;
}
/**
* Gets the value of the issr property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getIssr() {
return issr;
}
/**
* Sets the value of the issr property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setIssr(String value) {
this.issr = value;
}
}
| [
"jorellana29@gmail.com"
] | jorellana29@gmail.com |
492491e631427a6809d124ff1ed4717d10ad22dc | 6ce88a15d15fc2d0404243ca8415c84c8a868905 | /bitcamp-web01/src/main/java/step08/ex03/Exam01.java | e46ecd72449875bad5d25a9f71755416ce9a1722 | [] | no_license | SangKyeongLee/bitcamp | 9f6992ce2f3e4425f19b0af19ce434c4864e610b | a26991752920f280f6404565db2b13a0c34ca3d9 | refs/heads/master | 2021-01-24T10:28:54.595759 | 2018-08-10T07:25:57 | 2018-08-10T07:25:57 | 123,054,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,825 | java | // 다른 서블릿의 작업을 포함하기 - include
package step08.ex03;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@SuppressWarnings("serial")
@WebServlet("/step08/ex03/exam01")
public class Exam01 extends HttpServlet {
@Override
protected void doGet(
HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
String name = request.getParameter("name");
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println(" <meta charset='UTF-8'>");
out.println(" <title>include</title>");
out.println("<style>");
RequestDispatcher 요청배달자 = request.getRequestDispatcher("/step08/ex03/common");
요청배달자.include(request, response);
out.println("</style>");
out.println("</head>");
out.println("<body>");
요청배달자 = request.getRequestDispatcher("/step08/ex03/header");
요청배달자.include(request, response);
out.printf("<h1>%s 님 반갑습니다.</h1>\n", name);
요청배달자 = request.getRequestDispatcher("/step08/ex03/footer");
요청배달자.include(request, response);
out.println("</body>");
out.println("</html>");
}
}
| [
"sangkyeong.lee93@gmail.com"
] | sangkyeong.lee93@gmail.com |
5ed5e557826b5865ba4bc81ccb0e2e0c4cdd96dc | d3ca9b7e806eb18de461ab2824c10ada9798385e | /app/src/main/java/id/co/myproject/nicepos_admin/model/Pesan.java | 32473629435db291a104fb1cd5f9dfa21dd05059 | [] | no_license | raihanArman/Nice-POS-Admin | e2454498c6fb14ea869231da9d0e49375d36585e | 69bc51ceac8ff6531c579b4a6a9b94e0ca8ddfef | refs/heads/master | 2022-11-25T10:16:16.506080 | 2020-07-28T10:53:45 | 2020-07-28T10:53:45 | 283,184,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,442 | java | package id.co.myproject.nicepos_admin.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
public class Pesan {
@SerializedName("id_pesan")
@Expose
private String idPesan;
@SerializedName("id_user")
@Expose
private String idUser;
@SerializedName("nama_user")
@Expose
private String namaUser;
@SerializedName("email")
@Expose
private String email;
@SerializedName("level")
@Expose
private String level;
@SerializedName("isi")
@Expose
private String isi;
@SerializedName("tanggal")
@Expose
private Date tanggal;
public Pesan(String idPesan, String idUser, String namaUser, String email, String level, String isi, Date tanggal) {
this.idPesan = idPesan;
this.idUser = idUser;
this.namaUser = namaUser;
this.email = email;
this.level = level;
this.isi = isi;
this.tanggal = tanggal;
}
public String getIdPesan() {
return idPesan;
}
public String getIdUser() {
return idUser;
}
public String getNamaUser() {
return namaUser;
}
public String getEmail() {
return email;
}
public String getLevel() {
return level;
}
public String getIsi() {
return isi;
}
public Date getTanggal() {
return tanggal;
}
}
| [
"raihanarman8@gmail.com"
] | raihanarman8@gmail.com |
73aeb1b2fea7d56e4d8a167cf96ad480008688a1 | 74c4239fd6855e2a197add8ca002fb23003da34f | /分布式事务解决方案案列/boot-seata/account-server/src/main/java/com/github/server/AccountService.java | 6ff168e2947c005521ef858575bb59233e0b34fc | [] | no_license | changsongyang/boot-cloud | 1df15b4fbb27c8964c95d6a5e760899774a4bd56 | eaf737abe6d1d2c91f7f9f1a85b041c7c4bc081c | refs/heads/master | 2022-11-02T08:29:07.307679 | 2020-06-18T10:40:06 | 2020-06-18T10:40:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 244 | java | package com.github.server;
import java.math.BigDecimal;
public interface AccountService {
/**
* 扣减账户余额
* @param userId 用户id
* @param money 金额
*/
void decrease(Long userId, BigDecimal money);
}
| [
"870439570@qq.com"
] | 870439570@qq.com |
5165460191c620e269acf00b8b78f108406897ce | 0d36e8d7aa9727b910cb2ed6ff96eecb4444b782 | /backends/pelioncloud_devicemanagement/src/main/java/com/arm/mbed/cloud/sdk/lowlevel/pelionclouddevicemanagement/model/RegisterWebsocketChannel.java | 50a5930ccc44b07c82bf064f80529c67212a90b7 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | PelionIoT/mbed-cloud-sdk-java | b6d93f7e22c5afa30a51329b60e0f33c042ef00e | cc99c51db43cc9ae36601f20f20b7d8cd7515432 | refs/heads/master | 2023-08-19T01:25:29.548242 | 2020-07-01T16:48:16 | 2020-07-01T16:48:16 | 95,459,293 | 0 | 1 | Apache-2.0 | 2021-01-15T08:44:08 | 2017-06-26T15:06:56 | Java | UTF-8 | Java | false | false | 2,399 | java | /*
* Pelion Device Management API
* Pelion Device Management API build from the publicly defined API definitions.
*
* OpenAPI spec version: 3
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.arm.mbed.cloud.sdk.lowlevel.pelionclouddevicemanagement.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* RegisterWebsocketChannel
*/
public class RegisterWebsocketChannel implements Serializable {
private static final long serialVersionUID = 1L;
@SerializedName("serialization")
private Object serialization = null;
public RegisterWebsocketChannel serialization(Object serialization) {
this.serialization = serialization;
return this;
}
/**
* Serialization configuration for a channel
*
* @return serialization
**/
@ApiModelProperty(value = "Serialization configuration for a channel")
public Object getSerialization() {
return serialization;
}
public void setSerialization(Object serialization) {
this.serialization = serialization;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
RegisterWebsocketChannel registerWebsocketChannel = (RegisterWebsocketChannel) o;
return Objects.equals(this.serialization, registerWebsocketChannel.serialization);
}
@Override
public int hashCode() {
return Objects.hash(serialization);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RegisterWebsocketChannel {\n");
sb.append(" serialization: ").append(toIndentedString(serialization)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"adrien.cabarbaye@arm.com"
] | adrien.cabarbaye@arm.com |
504f58541472e95f9da5013d44f60064a9e8a7e8 | 8a22690873a0a449a855d25f1c6c0fc70a5e4bb2 | /app/src/main/java/com/xiandao/android/view/common/LocalFile.java | 9b408c8b2e69ba491b45034e0392c7724aecf607 | [] | no_license | cfsc-android/CFL-Old | a595b6efeaf61e9f413cfd99985eb3a63427f4dc | bf24fbc996089d38cb6c09d584aa5d0fd9bd83a5 | refs/heads/master | 2022-04-15T23:56:54.473896 | 2020-03-31T04:40:44 | 2020-03-31T04:40:44 | 245,079,056 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package com.xiandao.android.view.common;
/**
* @author TanYong
* create at 2017/4/21 14:20
*/
public class LocalFile {
private String originalUri;//原图URI
private String thumbnailUri;//缩略图URI
private int orientation;//图片旋转角度
public String getThumbnailUri() {
return thumbnailUri;
}
public void setThumbnailUri(String thumbnailUri) {
this.thumbnailUri = thumbnailUri;
}
public String getOriginalUri() {
return originalUri;
}
public void setOriginalUri(String originalUri) {
this.originalUri = originalUri;
}
public int getOrientation() {
return orientation;
}
public void setOrientation(int exifOrientation) {
orientation = exifOrientation;
}
}
| [
"zengxiaolong@chanfine.com"
] | zengxiaolong@chanfine.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.