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
c13de2abcd7daaec570604a0d5068b82616db89e
750d06d12ce6e408301fdf9bdbb08ddef0b6f1f1
/Databases_Advanced/Spring-data-auto-mapping-objects-exercises/src/main/java/com/softuni/springautomappingdemo/services/GameService.java
34b19fac8f5acc406bebf246b51e3fedd8673d29
[]
no_license
Deianov/Java-DB
e16245af70527a33efa9789d03276b449bbee70c
e7023500f76e84f220f621a598e460177ce327d3
refs/heads/master
2022-07-31T02:31:18.508054
2022-06-23T11:06:28
2022-06-23T11:06:28
239,293,956
1
3
null
2022-06-23T11:06:29
2020-02-09T11:35:24
Java
UTF-8
Java
false
false
798
java
package com.softuni.springautomappingdemo.services; import com.softuni.springautomappingdemo.domain.dtos.GameBaseViewDto; import com.softuni.springautomappingdemo.domain.dtos.GameDetailViewDto; import com.softuni.springautomappingdemo.domain.dtos.GameDto; import com.softuni.springautomappingdemo.domain.entities.Game; import java.util.Set; public interface GameService { boolean existsGameByTitleLike(String title); boolean existsGameById(Long id); String deleteGameById(long id); String validate(GameDto gameDto); String addGame(GameDto gameDto); String EditGame(long id, GameDto gameDto); GameDto findGameById(long id); Game findGameByTitle(String title); Set<GameBaseViewDto> getAllGames(); GameDetailViewDto getDetailGameByTitle(String title); }
[ "44973718+Deianov@users.noreply.github.com" ]
44973718+Deianov@users.noreply.github.com
30462fda4920ea3f089ffe87d97b09b45593b7e5
f0d301dfdf9c71e67e2d2d20e002e644aaa6971a
/BaekJoon_Online_Judge/BaekJoon_Online_Judge-master/BackJoon_10171.java
1b3d5c3d882e9a27ab428497e3ac9fb87e92f3c3
[]
no_license
MinjiJo/BaekJoon_Online_Judge
c581ee388110d06be646a4ec60f664dba0328a6f
144b96e1c965fb87ef0f6e2e0619ac147d05a50b
refs/heads/master
2020-07-12T23:28:27.336793
2020-07-03T00:49:01
2020-07-03T00:49:01
204,933,410
0
0
null
null
null
null
UTF-8
Java
false
false
569
java
/* 怨좎뼇�씠 臾몄젣 �븘�옒 �삁�젣�� 媛숈씠 怨좎뼇�씠瑜� 異쒕젰�븯�떆�삤. �엯�젰 �뾾�쓬. 異쒕젰 怨좎뼇�씠瑜� 異쒕젰�븳�떎. �삁�젣 �엯�젰 1 �삁�젣 異쒕젰 1 \ /\ ) ( ') ( / ) \(__)| */ public class BackJoon_10171 { public static void main(String[] args){ System.out.println("\\ /\\"); System.out.println(" ) ( ')"); System.out.println("( / )"); System.out.println(" \\(__)|"); } }
[ "MinjiJo@users.noreply.github.com" ]
MinjiJo@users.noreply.github.com
92d34fe1994ee1035c1b33755db5ddd2f1ba5ece
c62b2129ff957419f81e4bd189a497c9ec636b29
/app/src/main/java/com/RSPL/MEDIA/BootReciever.java
c2b26cb18dc13080393fa33b9e86abbb8e072b3f
[]
no_license
rcb4u/PROD99RetailMediaApp
dcbb677aa2a097e0b3212113740960d974745425
5f93c669974e5984d4641eb1d4883f59c39303dd
refs/heads/master
2020-03-26T08:23:30.873545
2018-09-06T06:53:33
2018-09-06T06:53:33
144,699,468
0
0
null
null
null
null
UTF-8
Java
false
false
625
java
package com.RSPL.MEDIA; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class BootReciever extends BroadcastReceiver { public BootReciever() { } @Override public void onReceive(Context context, Intent intent) { // TODO: This method is called when the BroadcastReceiver is receiving // an Intent broadcast. // TODO Auto-generated method stub Intent myIntent = new Intent(context, MediaMainScreen.class); myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(myIntent); } }
[ "chaudharirahul518@gmail.com" ]
chaudharirahul518@gmail.com
6d06f8c4097f813826ef07abd3c812a9a04eba06
9cdf4a803b5851915b53edaeead2546f788bddc6
/machinelearning/5.0/drools-verifier/src/main/java/org/drools/verifier/components/PatternPossibility.java
0285ddeaaa24a726d9fa48c2d39fe0f65bc587fb
[ "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
1,586
java
package org.drools.verifier.components; import java.util.HashSet; import java.util.Set; import org.drools.verifier.report.components.Cause; import org.drools.verifier.report.components.CauseType; /** * Instance of this class represents a possible combination of Constraints under * one Pattern. Each possibility returns true if all the Constraints in the * combination are true. * * @author Toni Rikkola */ public class PatternPossibility extends VerifierComponent implements Possibility { private static final long serialVersionUID = 8871361928380977116L; private static int index = 0; private int patternId; private int ruleId; private Set<Cause> items = new HashSet<Cause>(); public PatternPossibility() { super(index++); } @Override public VerifierComponentType getComponentType() { return VerifierComponentType.PATTERN_POSSIBILITY; } public CauseType getCauseType() { return CauseType.PATTERN_POSSIBILITY; } public Set<Cause> getItems() { return items; } public int getAmountOfItems() { return items.size(); } public int getPatternId() { return patternId; } public int getRuleId() { return ruleId; } public void setRuleId(int ruleId) { this.ruleId = ruleId; } public void setPatternId(int patternId) { this.patternId = patternId; } public void add(Restriction restriction) { items.add(restriction); } @Override public String toString() { return "PatternPossibility from rule: " + ruleName + ", amount of items:" + items.size(); } }
[ "gizil.oguz@gmail.com" ]
gizil.oguz@gmail.com
99f53bb97e04df53c307dc912037268af1509ea1
44abee7981ec47704f59d0cb9345efc4b909ad4f
/src/chap06/textbook/s061302/package1/A.java
444c2108d322e0c163d4fba1b75a16c4930e9e35
[]
no_license
hyojjjin/java20200929
ad24e96c2c3837f695951be783c59418559eceee
8a2d7b34bc814465c83ae0efa0bd59f29205c738
refs/heads/master
2023-03-11T22:56:51.890496
2021-03-02T01:08:15
2021-03-02T01:08:15
299,485,576
0
0
null
null
null
null
UTF-8
Java
false
false
304
java
package chap06.textbook.s061302.package1; public class A { //필드 A a1 = new A(true); //ㅇ A a2 = new A(1); //ㅇ A a3 = new A("문자열"); //생성자 public A(boolean b) {} //public 접근 제한 A(int b){} //default 접근 제한 private A(String s) {} //private 접근 제한 }
[ "hjjin2_@naver.com" ]
hjjin2_@naver.com
7ffcf97ca72c773d2f171f6f19cc28b321b29f7a
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_378/Testnull_37726.java
12a2c4b825c4c829583bb7567bedc48b7e5d890d
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_378; import static org.junit.Assert.*; public class Testnull_37726 { private final Productionnull_37726 production = new Productionnull_37726("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
db4967bef85a243053bb97e35f50d283bd6a87d2
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-sofa/src/main/java/com/aliyuncs/sofa/model/v20190815/QueryMSDdcsPushHistoryRequest.java
28854419153458740ee45ba2fb8196918c33c727
[ "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,826
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 QueryMSDdcsPushHistoryRequest extends RpcAcsRequest<QueryMSDdcsPushHistoryResponse> { private Long endTime; private Long startTime; private String instanceId; private String dataId; private Long size; private Long startId; public QueryMSDdcsPushHistoryRequest() { super("SOFA", "2019-08-15", "QueryMSDdcsPushHistory", "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 getEndTime() { return this.endTime; } public void setEndTime(Long endTime) { this.endTime = endTime; if(endTime != null){ putBodyParameter("EndTime", endTime.toString()); } } public Long getStartTime() { return this.startTime; } public void setStartTime(Long startTime) { this.startTime = startTime; if(startTime != null){ putBodyParameter("StartTime", startTime.toString()); } } public String getInstanceId() { return this.instanceId; } public void setInstanceId(String instanceId) { this.instanceId = instanceId; if(instanceId != null){ putBodyParameter("InstanceId", instanceId); } } public String getDataId() { return this.dataId; } public void setDataId(String dataId) { this.dataId = dataId; if(dataId != null){ putBodyParameter("DataId", dataId); } } public Long getSize() { return this.size; } public void setSize(Long size) { this.size = size; if(size != null){ putBodyParameter("Size", size.toString()); } } public Long getStartId() { return this.startId; } public void setStartId(Long startId) { this.startId = startId; if(startId != null){ putBodyParameter("StartId", startId.toString()); } } @Override public Class<QueryMSDdcsPushHistoryResponse> getResponseClass() { return QueryMSDdcsPushHistoryResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
074e5b338836609da32dbe7d39805605c218ccd5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_1fa8d3bce5fcf2bb4a8870481085e20b690b2f62/EnsembleViewer/9_1fa8d3bce5fcf2bb4a8870481085e20b690b2f62_EnsembleViewer_t.java
c2d67da801d8ee52e55e268035a734f4516334a9
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,400
java
/* The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is "EnsembleViewer.java". Description: "Viewer for peeking into an Ensemble @author Shu" The Initial Developer of the Original Code is Bryan Tripp & Centre for Theoretical Neuroscience, University of Waterloo. Copyright (C) 2006-2008. All Rights Reserved. Alternatively, the contents of this file may be used under the terms of the GNU Public License license (the GPL License), in which case the provisions of GPL License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the GPL License. */ package ca.nengo.ui.models.viewers; import ca.nengo.model.Ensemble; import ca.nengo.model.Node; import ca.nengo.model.Network; import ca.nengo.model.Probeable; import ca.nengo.model.neuron.Neuron; import ca.nengo.ui.lib.util.UserMessages; import ca.nengo.ui.lib.util.Util; import ca.nengo.ui.models.UINeoNode; import ca.nengo.ui.models.nodes.UIEnsemble; import ca.nengo.ui.models.nodes.UINeuron; import ca.nengo.ui.models.nodes.UINetwork; import ca.nengo.util.Probe; /** * Viewer for peeking into an Ensemble * * @author Shu */ public class EnsembleViewer extends NodeViewer { private static final long serialVersionUID = 1L; /** * @param ensembleUI * Parent Ensemble UI Wrapper */ public EnsembleViewer(UIEnsemble ensembleUI) { super(ensembleUI); } @Override public void applyDefaultLayout() { if (getUINodes().size() == 0) return; applySortLayout(SortMode.BY_NAME); } @Override public Ensemble getModel() { return (Ensemble) super.getModel(); } @Override public UIEnsemble getViewerParent() { return (UIEnsemble) super.getViewerParent(); } @Override public void updateViewFromModel(boolean isFirstUpdate) { getGround().clearLayer(); Node[] nodes = getModel().getNodes(); /* * Construct Neurons */ for (Node node : nodes) { if (node instanceof Neuron) { Neuron neuron = (Neuron) node; UINeuron neuronUI = new UINeuron(neuron); addUINode(neuronUI, false, false); } else if (node instanceof Ensemble) { Ensemble ensemble = (Ensemble)node; UIEnsemble ensembleUI = new UIEnsemble(ensemble); addUINode(ensembleUI,false,false); } else if (node instanceof Network) { Network network = (Network)node; UINetwork networkUI = new UINetwork(network); addUINode(networkUI, false, false); } else { UserMessages.showError("Unsupported node type " + node.getClass().getSimpleName() + " in EnsembleViewer"); } } if (getViewerParent().getNetworkParent() != null) { /* * Construct probes */ Probe[] probes = getViewerParent().getNetworkParent().getSimulator().getProbes(); for (Probe probe : probes) { Probeable target = probe.getTarget(); if (!(target instanceof Node)) { UserMessages.showError("Unsupported target type for probe"); } else { if (probe.isInEnsemble() && probe.getEnsembleName() == getModel().getName()) { Node node = (Node) target; UINeoNode nodeUI = getUINode(node); nodeUI.showProbe(probe); } } } } } @Override protected void removeChildModel(Node node) { Util.Assert(false, "Cannot remove model"); } @Override protected boolean canRemoveChildModel(Node node) { return false; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ea7084824d0438b0c60cdf9a05e17b69ae564f38
ae35e8f3d2b928605457c0d69077f9913bcd0500
/src/programmersguide/asposecells/workingwithdata/addonfeatures/namedranges/copynamedranges/java/CopyNamedRanges.java
29ded76029ad65a5f02291efc5a6f6359db9514e
[ "MIT" ]
permissive
asposemarketplace/Aspose-Cells-Java
782bb48c226a2822a1c9b2c2fac201dbe4104774
287c566d3f5c07c50f0434f774fe41bea7e0dd1e
refs/heads/master
2021-01-19T09:46:05.267016
2015-11-26T16:01:08
2015-11-26T16:01:08
46,932,416
2
0
null
null
null
null
UTF-8
Java
false
false
1,630
java
/* * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved. * * This file is part of Aspose.Cells. The source code in this file * is only intended as a supplement to the documentation, and is provided * "as is", without warranty of any kind, either expressed or implied. */ package programmersguide.asposecells.workingwithdata.addonfeatures.namedranges.copynamedranges.java; import com.aspose.cells.*; public class CopyNamedRanges { public static void main(String[] args) throws Exception { // The path to the documents directory. String dataDir = "src/programmersguide/asposecells/workingwithdata/addonfeatures/namedranges/copynamedranges/data/"; //Instantiating a Workbook object Workbook workbook = new Workbook(); WorksheetCollection worksheets = workbook.getWorksheets(); //Accessing the first worksheet in the Excel file Worksheet sheet = worksheets.get(0); Cells cells = sheet.getCells(); //Creating a named range Range namedRange = cells.createRange("B4", "G14"); namedRange.setName("TestRange"); //Input some data with some formattings into //a few cells in the range. namedRange.get(0, 0).setValue("Test"); namedRange.get(0, 4).setValue("123"); //Creating a named range Range namedRange2 = cells.createRange("H4", "M14"); namedRange2.setName("TestRange2"); namedRange2.copy(namedRange); workbook.save(dataDir + "copyranges.xls"); // Print message System.out.println("Process completed successfully"); } }
[ "shoaib.khan@aspose.com" ]
shoaib.khan@aspose.com
77adf665e79157dd470273370a659ab1edbd55b5
5479e441b1430b5301298119b3ad637b5e9a9a9a
/openapi-sdk-message/src/main/java/com/yiji/openapi/message/common/installment/InstallmentModifyScheduleResponse.java
3f410322a58f9b2063a6071fd52f9316346c7e42
[]
no_license
weichk/yiji-sdk
4e3c0252a10eec91c6f14220994e9be903b68317
7715e3feabb3aef32ea8ee0103cafa774204d928
refs/heads/master
2022-12-22T12:47:16.898108
2019-06-20T07:56:23
2019-06-20T07:56:23
192,875,193
0
0
null
2022-12-15T23:31:31
2019-06-20T07:53:07
Java
UTF-8
Java
false
false
566
java
/* * www.yiji.com Inc. * Copyright (c) 2014 All Rights Reserved */ /* * 修订记录: * hgeshu@yiji.com 2015-05-19 10:53 创建 * */ package com.yiji.openapi.message.common.installment; import com.yiji.openapi.sdk.common.annotation.OpenApiMessage; import com.yiji.openapi.sdk.common.enums.ApiMessageType; import com.yiji.openapi.sdk.common.message.ApiResponse; /** * @author hgeshu@yiji.com */ @OpenApiMessage(service = "installmentModifySchedule", type = ApiMessageType.Response) public class InstallmentModifyScheduleResponse extends ApiResponse { }
[ "539603511@qq.com" ]
539603511@qq.com
51fa47a62cfc1b5db331d19d50872120234b1da3
cac52d34455a08b3fb882d0a58e0b3b72206e935
/common/protocols/android-java/src/main/java/ru/trendtech/common/mobileexchange/model/web/ArticleAdjustmentsRequest.java
b5d4b75b1d9be9dd4ac47d6e2e8b238cfb307b67
[]
no_license
MrFractal/taxisto
75f72238ab4ce3c14f6e559098653ae53756fbaa
195863dc17f5c6147c578b5695c1bc34ef9702a5
refs/heads/master
2021-01-10T16:25:28.332080
2016-02-17T12:10:01
2016-02-17T12:10:01
51,916,660
0
0
null
null
null
null
UTF-8
Java
false
false
626
java
package ru.trendtech.common.mobileexchange.model.web; /** * Created by petr on 12.02.2015. */ public class ArticleAdjustmentsRequest { private String security_token; private long articleAdjustmentsId; public String getSecurity_token() { return security_token; } public void setSecurity_token(String security_token) { this.security_token = security_token; } public long getArticleAdjustmentsId() { return articleAdjustmentsId; } public void setArticleAdjustmentsId(long articleAdjustmentsId) { this.articleAdjustmentsId = articleAdjustmentsId; } }
[ "fr@bekker.com.ua" ]
fr@bekker.com.ua
068e410d918edde328563eb3b52e2fc14396df9e
ed166738e5dec46078b90f7cca13a3c19a1fd04b
/minor/guice-OOM-error-reproduction/src/main/java/gen/H_Gen170.java
fd11b5a13b37e49562222ed202be92aeab715d80
[]
no_license
michalradziwon/script
39efc1db45237b95288fe580357e81d6f9f84107
1fd5f191621d9da3daccb147d247d1323fb92429
refs/heads/master
2021-01-21T21:47:16.432732
2016-03-23T02:41:50
2016-03-23T02:41:50
22,663,317
2
0
null
null
null
null
UTF-8
Java
false
false
331
java
package gen; public class H_Gen170 { @com.google.inject.Inject public H_Gen170(H_Gen171 h_gen171){ System.out.println(this.getClass().getCanonicalName() + " created. " + h_gen171 ); } @com.google.inject.Inject public void injectInterfaceWithoutImpl(gen.InterfaceWithoutImpl i){} // should expolode :) }
[ "michal.radzi.won@gmail.com" ]
michal.radzi.won@gmail.com
d1c8c328cc916ed834af074e3d62c2c1c46aed34
138c5dd54e57f498380c4c59e3ddabf939f1964a
/lcloud-library/lcloud-purchase-service/src/main/java/com/szcti/lcloud/purchase/service/impl/FileUploadUtil.java
c7d09bd5163b4d373719fd0a07de73a2529b192e
[]
no_license
JIANLAM/zt-project
4d249f4b504789395a335df21fcf1cf009e07d78
50318c9296485d3a97050e307b3a8ab3e12510e7
refs/heads/master
2020-03-31T12:40:36.269261
2018-10-09T09:42:36
2018-10-09T09:42:36
152,225,516
1
0
null
null
null
null
UTF-8
Java
false
false
4,048
java
package com.szcti.lcloud.purchase.service.impl; import com.szcti.lcloud.common.utils.IdGen; import org.jboss.resteasy.plugins.providers.multipart.InputPart; import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.net.URLDecoder; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; /** * @Author liujunliang * @Description * @Date 2018/7/12 **/ public class FileUploadUtil { //获取项目所在的路径 String filePath = System.getProperty("user.dir") + "/tmp/import/"; //String exportPath=System.getProperty("user.dir") + "\\export\\"; //String filePath="c:\\temp\\";//临时存放目录 public String uploadStoreFile(MultipartFormDataInput multipartFormDataInput,String fileName) throws Exception { //获取表单中的数据map Map<String, List<InputPart>> dataMaps = multipartFormDataInput.getFormDataMap(); //根据表单元素名称获取表单元素(需要同前端沟通好表单元素的name) List<InputPart> fileParts = dataMaps.get(fileName);//表单元素-文件 //解析获取表单文件的输入流 InputStream inputStream; String rename; try { if (fileParts == null || fileParts.isEmpty()) throw new Exception("请求参数为空!"); InputPart filePart = fileParts.get(0); String preindex=getFileNameByFileInputPart(filePart); //preindex=preindex.split(".")[1]; rename=IdGen.getDateUUId()+preindex; inputStream = filePart.getBody(InputStream.class, null); } catch (Exception e) { throw new Exception(e.getMessage()); } //保存文件至本地 String filePathName =filePath+rename; System.out.println("upload:"+filePathName); //String filePathName = "C:\\temp\\newFile.xls"; File target = new File(filePathName); FileOutputStream fos = null; try { if (!target.getParentFile().exists()) target.getParentFile().mkdirs(); fos = new FileOutputStream(target); byte[] b = new byte[1024]; int readLength; while ((readLength = inputStream.read(b)) != -1) { fos.write(b, 0, readLength); } } catch (Exception e) { //throw new AssistanceException(e.getMessage()); } finally { if (inputStream != null) inputStream.close(); if (fos != null) fos.close(); } return filePathName; } /** * 从表单文件元素中提取文件名 * * @param filePart * @return * @throws Exception */ public String getFileNameByFileInputPart(InputPart filePart) throws Exception { String[] contentDispositionHeader = filePart.getHeaders().getFirst("Content-Disposition").split(";"); for (String fileName : contentDispositionHeader) { if ((fileName.trim().startsWith("filename"))) { String[] tmp = fileName.split("="); String fileNameStr = tmp[1].trim().replaceAll("\"", ""); return fileNameStr; } } return null; } /** * 从表单元素中获取字串文本并以UTF-8编码 * * @param inputPart * @return * @throws Exception */ public static String getInputPartAsString(InputPart inputPart) throws Exception { if (inputPart == null) return null; String nameString = inputPart.getBodyAsString(); if (nameString == null || nameString.isEmpty()) return null; return URLDecoder.decode(nameString, StandardCharsets.UTF_8.name()); } public String getFilePath() { return filePath; } public void setFilePath(String filePath) { this.filePath = filePath; } }
[ "mrkinlam@163.com" ]
mrkinlam@163.com
40919416c0727ce5891a885083c7d18f0262f326
01c2aa059ad6bb0e85a6e669723446084bf5b1c5
/Botcoin-javafx/src/com/fxexperience/javafx/animation/FadeOutDownBigTransition.java
d7f32cb27b3abc7602f5c221d52ce1610d171dcc
[ "MIT" ]
permissive
adv0r/botcoin
7baf02f59701ebe113b992680f360b74f5923116
bab2914de3b87fb5563a8fdb9de2a47e0671a23a
refs/heads/master
2020-03-30T05:49:53.696120
2014-04-29T07:45:58
2014-04-29T07:45:58
19,103,523
1
1
null
null
null
null
UTF-8
Java
false
false
1,785
java
package com.fxexperience.javafx.animation; import javafx.animation.KeyFrame; import javafx.animation.KeyValue; import javafx.animation.TimelineBuilder; import javafx.scene.Node; import javafx.util.Duration; /** * Animate a fade out up big effect on a node * * Port of FadeOutDownBig from Animate.css http://daneden.me/animate by Dan Eden * * {@literal @}keyframes fadeOutDownBig { * 0% { * opacity: 1; * transform: translateY(0); * } * 100% { * opacity: 0; * transform: translateY(2000px); * } * } * * @author Jasper Potts */ public class FadeOutDownBigTransition extends CachedTimelineTransition { /** * Create new FadeOutDownBigTransition * * @param node The node to affect */ public FadeOutDownBigTransition(final Node node) { super(node, null); setCycleDuration(Duration.seconds(1)); setDelay(Duration.seconds(0.2)); } @Override protected void starting() { double endY = node.getScene().getHeight() - node.localToScene(0, 0).getY(); timeline = TimelineBuilder.create() .keyFrames( new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateYProperty(), 0, WEB_EASE) ), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateYProperty(), endY, WEB_EASE) ) ) .build(); super.starting(); } @Override protected void stopping() { super.stopping(); node.setTranslateY(0); // restore default } }
[ "paternoster.nicolo@gmail.com" ]
paternoster.nicolo@gmail.com
5583381c72a7c266636393f2fda050247b1b2a8a
af606a04ed291e8c9b1e500739106a926e205ee2
/aliyun-java-sdk-waf-openapi/src/main/java/com/aliyuncs/waf_openapi/transform/v20180117/CreateCertAndKeyResponseUnmarshaller.java
44c19c68129ccba0343aa5906d1460a490f58d16
[ "Apache-2.0" ]
permissive
xtlGitHub/aliyun-openapi-java-sdk
a733f0a16c8cc493cc28062751290f563ab73ace
f60c71de2c9277932b6549c79631b0f03b11cc36
refs/heads/master
2023-09-03T13:56:50.071024
2021-11-10T11:53:25
2021-11-10T11:53:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,402
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.waf_openapi.transform.v20180117; import com.aliyuncs.waf_openapi.model.v20180117.CreateCertAndKeyResponse; import com.aliyuncs.waf_openapi.model.v20180117.CreateCertAndKeyResponse.Result; import com.aliyuncs.transform.UnmarshallerContext; public class CreateCertAndKeyResponseUnmarshaller { public static CreateCertAndKeyResponse unmarshall(CreateCertAndKeyResponse createCertAndKeyResponse, UnmarshallerContext _ctx) { createCertAndKeyResponse.setRequestId(_ctx.stringValue("CreateCertAndKeyResponse.RequestId")); Result result = new Result(); result.setWafTaskId(_ctx.stringValue("CreateCertAndKeyResponse.Result.WafTaskId")); result.setStatus(_ctx.integerValue("CreateCertAndKeyResponse.Result.Status")); createCertAndKeyResponse.setResult(result); return createCertAndKeyResponse; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
ef9275a6c9f79e9106dfb1f8bdb5164a0e678ce5
f009dc33f9624aac592cb66c71a461270f932ffa
/src/main/java/com/alipay/api/domain/PosDeviceInfoVO.java
e1c3d65e39cd52069cc5fd65420a86a7c3876c56
[ "Apache-2.0" ]
permissive
1093445609/alipay-sdk-java-all
d685f635af9ac587bb8288def54d94e399412542
6bb77665389ba27f47d71cb7fa747109fe713f04
refs/heads/master
2021-04-02T16:49:18.593902
2020-03-06T03:04:53
2020-03-06T03:04:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,796
java
package com.alipay.api.domain; import java.util.Date; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 设备商回流pos基础设备信息 * * @author auto create * @since 1.0, 2018-03-08 10:35:41 */ public class PosDeviceInfoVO extends AlipayObject { private static final long serialVersionUID = 4754144462785883866L; /** * 设备对应的软件方公司名称,比如:美味不用等;银盒子;二维火;云纵;雅座;辰森; */ @ApiField("decive_software_name") private String deciveSoftwareName; /** * 设备安装的应用数 */ @ApiField("device_app_cnt") private String deviceAppCnt; /** * 设备安装的应用列表对应的流量,单位KB */ @ApiField("device_app_flow") private String deviceAppFlow; /** * 设备安装的应用列表 */ @ApiField("device_app_list") private String deviceAppList; /** * 设备出厂公司;比如:商米;新大陆;荣焱; */ @ApiField("device_company_name") private String deviceCompanyName; /** * 设备总使用流量,单位KB */ @ApiField("device_flow") private String deviceFlow; /** * pos机设备ip值 */ @ApiField("device_ip") private String deviceIp; /** * pos机设备MAC地址 */ @ApiField("device_mac") private String deviceMac; /** * 设备运行的操作系统版本 */ @ApiField("device_os_version") private String deviceOsVersion; /** * pos机设备状态值,枚举值为:已出厂(1),已入仓(2),已出售(3),已报单(4),已发货(5),已收货(6),已激活(7)、已绑定(8)、运行中(9)、设备失联(10)、已解绑(11) */ @ApiField("device_status") private String deviceStatus; /** * pos机设备类型,枚举值为: 旗舰(FLAG_SHIP),高端(HIGH_END),标准(STANDARD),手持(IN_HAND) */ @ApiField("device_type") private String deviceType; /** * 设备型号,如荣焱P10CC、商米D1、荣焱P10S、商米P1、荣焱HD01、商米V1、商米M1、荣焱P8K、商米T1、商米T2lite、荣焱P8G、商米T1、商米T2Lite等 */ @ApiField("device_version") private String deviceVersion; /** * 设备激活时间 */ @ApiField("gmt_activate") private Date gmtActivate; /** * 最后登录时间:设备处于登陆状态的最后时间 */ @ApiField("gmt_login") private Date gmtLogin; /** * 设备解绑时间 */ @ApiField("gmt_production") private Date gmtProduction; /** * 最后发送信息时间:设备最后发送信息的时间,发给服务端的最后时间 */ @ApiField("gmt_send") private Date gmtSend; /** * 设备出厂时间 */ @ApiField("gmt_unbundling") private Date gmtUnbundling; /** * 最后更新时间:设备上软件的最后更新时间 */ @ApiField("gmt_update") private Date gmtUpdate; /** * 数据回流设备对应的ISV名称 */ @ApiField("isv_name") private String isvName; /** * 数据回流设备对应的ISV_PID */ @ApiField("isv_pid") private String isvPid; /** * 口碑门店id,激活设备才有口碑门店id */ @ApiField("shop_id") private String shopId; /** * 设备id,唯一标识设备的ID,SN号 */ @ApiField("sn_no") private String snNo; public String getDeciveSoftwareName() { return this.deciveSoftwareName; } public void setDeciveSoftwareName(String deciveSoftwareName) { this.deciveSoftwareName = deciveSoftwareName; } public String getDeviceAppCnt() { return this.deviceAppCnt; } public void setDeviceAppCnt(String deviceAppCnt) { this.deviceAppCnt = deviceAppCnt; } public String getDeviceAppFlow() { return this.deviceAppFlow; } public void setDeviceAppFlow(String deviceAppFlow) { this.deviceAppFlow = deviceAppFlow; } public String getDeviceAppList() { return this.deviceAppList; } public void setDeviceAppList(String deviceAppList) { this.deviceAppList = deviceAppList; } public String getDeviceCompanyName() { return this.deviceCompanyName; } public void setDeviceCompanyName(String deviceCompanyName) { this.deviceCompanyName = deviceCompanyName; } public String getDeviceFlow() { return this.deviceFlow; } public void setDeviceFlow(String deviceFlow) { this.deviceFlow = deviceFlow; } public String getDeviceIp() { return this.deviceIp; } public void setDeviceIp(String deviceIp) { this.deviceIp = deviceIp; } public String getDeviceMac() { return this.deviceMac; } public void setDeviceMac(String deviceMac) { this.deviceMac = deviceMac; } public String getDeviceOsVersion() { return this.deviceOsVersion; } public void setDeviceOsVersion(String deviceOsVersion) { this.deviceOsVersion = deviceOsVersion; } public String getDeviceStatus() { return this.deviceStatus; } public void setDeviceStatus(String deviceStatus) { this.deviceStatus = deviceStatus; } public String getDeviceType() { return this.deviceType; } public void setDeviceType(String deviceType) { this.deviceType = deviceType; } public String getDeviceVersion() { return this.deviceVersion; } public void setDeviceVersion(String deviceVersion) { this.deviceVersion = deviceVersion; } public Date getGmtActivate() { return this.gmtActivate; } public void setGmtActivate(Date gmtActivate) { this.gmtActivate = gmtActivate; } public Date getGmtLogin() { return this.gmtLogin; } public void setGmtLogin(Date gmtLogin) { this.gmtLogin = gmtLogin; } public Date getGmtProduction() { return this.gmtProduction; } public void setGmtProduction(Date gmtProduction) { this.gmtProduction = gmtProduction; } public Date getGmtSend() { return this.gmtSend; } public void setGmtSend(Date gmtSend) { this.gmtSend = gmtSend; } public Date getGmtUnbundling() { return this.gmtUnbundling; } public void setGmtUnbundling(Date gmtUnbundling) { this.gmtUnbundling = gmtUnbundling; } public Date getGmtUpdate() { return this.gmtUpdate; } public void setGmtUpdate(Date gmtUpdate) { this.gmtUpdate = gmtUpdate; } public String getIsvName() { return this.isvName; } public void setIsvName(String isvName) { this.isvName = isvName; } public String getIsvPid() { return this.isvPid; } public void setIsvPid(String isvPid) { this.isvPid = isvPid; } public String getShopId() { return this.shopId; } public void setShopId(String shopId) { this.shopId = shopId; } public String getSnNo() { return this.snNo; } public void setSnNo(String snNo) { this.snNo = snNo; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
a4fb77c91067acb72f7d9f1f89bafa0ccf84eb7b
606cd7931bc5288ffe91cf58f45d3e4f64a9b3df
/pk/src/java/com/pelindo/ebtos/bean/security/LoginController.java
4409cc5583f1c43057f5062dc23c9c656c0d622e
[]
no_license
surachman/iconos-tarakan
5655284ac69059935922d92ee856b6926b656d1d
d7fa1c120d22d391983dab95c5654cb63b27e1f7
refs/heads/master
2021-01-20T20:21:40.937285
2016-06-27T14:51:22
2016-06-27T14:51:22
61,995,382
0
0
null
null
null
null
UTF-8
Java
false
false
6,751
java
package com.pelindo.ebtos.bean.security; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ import com.qtasnim.jsf.FacesHelper; import com.pelindo.ebtos.bean.application.Navigation; import com.pelindo.ebtos.ejb.facade.remote.ActiveDirectoryFacadeRemote; import com.pelindo.ebtos.ejb.facade.remote.MasterSettingAppFacadeRemote; import com.pelindo.ebtos.model.ChangePassword; import com.pelindo.ebtos.model.NamedObject; import java.io.IOException; import java.io.Serializable; import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.servlet.ServletException; import javax.servlet.http.HttpSession; import org.primefaces.context.RequestContext; /** * * @author senoanggoro */ @ManagedBean(name="loginController") @ViewScoped public class LoginController implements Serializable{ private static final String AGENT_GROUP_NAME_PARAM = "ebtos.group.agent"; private MasterSettingAppFacadeRemote masterSettingAppFacade = lookupMasterSettingAppFacadeRemote(); private ActiveDirectoryFacadeRemote activeDirectoryFacade = lookupActiveDirectoryFacadeRemote(); private String username; private String password; private String module; private ChangePassword changePassword; public LoginController() { module = FacesHelper.translateElExpression("#{module}", FacesContext.getCurrentInstance(), String.class); changePassword = new ChangePassword(); } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public ChangePassword getChangePassword() { return changePassword; } public void setChangePassword(ChangePassword changePassword) { this.changePassword = changePassword; } public void invalidate(){ ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext(); HttpSession session = (HttpSession) ec.getSession(false); session.invalidate(); } public void doLogout(ActionEvent event) throws IOException { FacesContext context = FacesContext.getCurrentInstance(); invalidate(); context.getExternalContext().redirect(Navigation.resolveHomeUrl(context)); } public void changePassword(ActionEvent event){ FacesContext facesContext = FacesContext.getCurrentInstance(); RequestContext requestContext = RequestContext.getCurrentInstance(); if (getChangePassword() != null && getChangePassword().isValid()) { if (getChangePassword().isNewPasswordValid()) { LoginSessionBean sessionBean = LoginSessionBean.getCurrentInstance(); NamedObject user = activeDirectoryFacade.findUserByUid(sessionBean.getUsername()); if (user != null && activeDirectoryFacade.authenticate(user, changePassword.getCurrentPassword())) { activeDirectoryFacade.changePassword(user, getChangePassword().getNewPassword()); requestContext.addCallbackParam("isPasswordChanged", true); FacesHelper.addFacesMessage(facesContext, FacesMessage.SEVERITY_INFO, "Info", "application.validation.password_changed"); return; } requestContext.addCallbackParam("isPasswordChanged", false); FacesHelper.addFacesMessage(facesContext, FacesMessage.SEVERITY_ERROR, "Error", "application.validation.password_wrong"); return; } requestContext.addCallbackParam("isPasswordChanged", false); FacesHelper.addFacesMessage(facesContext, FacesMessage.SEVERITY_ERROR, "Error", "application.validation.new_password_not_match"); return; } requestContext.addCallbackParam("isPasswordChanged", false); } public void doLogin(ActionEvent event) throws IOException, ServletException { FacesContext context = FacesContext.getCurrentInstance(); NamedObject user = activeDirectoryFacade.findUserByUid(username); if (activeDirectoryFacade.authenticate(user, password)){ //check credential if (!user.getGroups().contains(masterSettingAppFacade.find(AGENT_GROUP_NAME_PARAM).getValueString())){ HttpSession session = (HttpSession) context.getExternalContext().getSession(true); LoginSessionBean bean = LoginSessionBean.getCurrentInstance(); session.setAttribute("username", getUsername()); //untuk trigger bean.setUsername(getUsername()); bean.setName(user.getCn()); bean.setGroups(user.getGroups()); context.getExternalContext().redirect(Navigation.resolveUrl(context, (module == null || module.equals("")) ? Navigation.DEFAULT_HOME_URL : module)); return; } FacesHelper.addErrorFacesMessage(context, "message.access.login_error_credential"); invalidate(); return; } if (activeDirectoryFacade.getMessage() != null) FacesHelper.addErrorFacesMessage(context, activeDirectoryFacade.getMessage()); invalidate(); } private ActiveDirectoryFacadeRemote lookupActiveDirectoryFacadeRemote() { try { Context c = new InitialContext(); return (ActiveDirectoryFacadeRemote) c.lookup("java:global/pkproject/pk-ejb/ActiveDirectoryFacade!com.pelindo.ebtos.ejb.facade.remote.ActiveDirectoryFacadeRemote"); } catch (NamingException ne) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne); throw new RuntimeException(ne); } } private MasterSettingAppFacadeRemote lookupMasterSettingAppFacadeRemote() { try { Context c = new InitialContext(); return (MasterSettingAppFacadeRemote) c.lookup("java:global/pkproject/pk-ejb/MasterSettingAppFacade!com.pelindo.ebtos.ejb.facade.remote.MasterSettingAppFacadeRemote"); } catch (NamingException ne) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne); throw new RuntimeException(ne); } } }
[ "surachman026@gmail.com" ]
surachman026@gmail.com
ca48582b50a5cd948aed006e103777fed30e491a
09d0ddd512472a10bab82c912b66cbb13113fcbf
/TestApplications/privacy-friendly-netmonitor-2.0/DecompiledCode/Fernflower/src/main/java/android/support/v4/content/ContextCompat.java
596b430b33908640fc8be2f155c5b0dad82539bf
[]
no_license
sgros/activity_flow_plugin
bde2de3745d95e8097c053795c9e990c829a88f4
9e59f8b3adacf078946990db9c58f4965a5ccb48
refs/heads/master
2020-06-19T02:39:13.865609
2019-07-08T20:17:28
2019-07-08T20:17:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,882
java
package android.support.v4.content; import android.content.Context; import android.content.Intent; import android.content.res.ColorStateList; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Process; import android.os.Build.VERSION; import android.support.annotation.ColorInt; import android.support.annotation.ColorRes; import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.Log; import android.util.TypedValue; import java.io.File; public class ContextCompat { private static final String TAG = "ContextCompat"; private static final Object sLock = new Object(); private static TypedValue sTempValue; protected ContextCompat() { } private static File buildPath(File var0, String... var1) { int var2 = 0; int var3 = var1.length; File var4; for(var4 = var0; var2 < var3; var4 = var0) { String var5 = var1[var2]; if (var4 == null) { var0 = new File(var5); } else { var0 = var4; if (var5 != null) { var0 = new File(var4, var5); } } ++var2; } return var4; } public static int checkSelfPermission(@NonNull Context var0, @NonNull String var1) { if (var1 == null) { throw new IllegalArgumentException("permission is null"); } else { return var0.checkPermission(var1, Process.myPid(), Process.myUid()); } } public static Context createDeviceProtectedStorageContext(Context var0) { return VERSION.SDK_INT >= 24 ? var0.createDeviceProtectedStorageContext() : null; } private static File createFilesDir(File var0) { synchronized(ContextCompat.class){} label103: { Throwable var10000; label107: { boolean var1; boolean var10001; try { if (var0.exists() || var0.mkdirs()) { break label103; } var1 = var0.exists(); } catch (Throwable var8) { var10000 = var8; var10001 = false; break label107; } if (var1) { return var0; } try { StringBuilder var2 = new StringBuilder(); var2.append("Unable to create files subdir "); var2.append(var0.getPath()); Log.w("ContextCompat", var2.toString()); } catch (Throwable var7) { var10000 = var7; var10001 = false; break label107; } return null; } Throwable var9 = var10000; throw var9; } return var0; } public static File getCodeCacheDir(Context var0) { return VERSION.SDK_INT >= 21 ? var0.getCodeCacheDir() : createFilesDir(new File(var0.getApplicationInfo().dataDir, "code_cache")); } @ColorInt public static final int getColor(Context var0, @ColorRes int var1) { return VERSION.SDK_INT >= 23 ? var0.getColor(var1) : var0.getResources().getColor(var1); } public static final ColorStateList getColorStateList(Context var0, @ColorRes int var1) { return VERSION.SDK_INT >= 23 ? var0.getColorStateList(var1) : var0.getResources().getColorStateList(var1); } public static File getDataDir(Context var0) { if (VERSION.SDK_INT >= 24) { return var0.getDataDir(); } else { String var1 = var0.getApplicationInfo().dataDir; File var2; if (var1 != null) { var2 = new File(var1); } else { var2 = null; } return var2; } } public static final Drawable getDrawable(Context var0, @DrawableRes int var1) { if (VERSION.SDK_INT >= 21) { return var0.getDrawable(var1); } else if (VERSION.SDK_INT >= 16) { return var0.getResources().getDrawable(var1); } else { Object var2 = sLock; synchronized(var2){} Throwable var10000; boolean var10001; label160: { try { if (sTempValue == null) { TypedValue var3 = new TypedValue(); sTempValue = var3; } } catch (Throwable var15) { var10000 = var15; var10001 = false; break label160; } label157: try { var0.getResources().getValue(var1, sTempValue, true); var1 = sTempValue.resourceId; return var0.getResources().getDrawable(var1); } catch (Throwable var14) { var10000 = var14; var10001 = false; break label157; } } while(true) { Throwable var16 = var10000; try { throw var16; } catch (Throwable var13) { var10000 = var13; var10001 = false; continue; } } } } public static File[] getExternalCacheDirs(Context var0) { return VERSION.SDK_INT >= 19 ? var0.getExternalCacheDirs() : new File[]{var0.getExternalCacheDir()}; } public static File[] getExternalFilesDirs(Context var0, String var1) { return VERSION.SDK_INT >= 19 ? var0.getExternalFilesDirs(var1) : new File[]{var0.getExternalFilesDir(var1)}; } public static final File getNoBackupFilesDir(Context var0) { return VERSION.SDK_INT >= 21 ? var0.getNoBackupFilesDir() : createFilesDir(new File(var0.getApplicationInfo().dataDir, "no_backup")); } public static File[] getObbDirs(Context var0) { return VERSION.SDK_INT >= 19 ? var0.getObbDirs() : new File[]{var0.getObbDir()}; } public static boolean isDeviceProtectedStorage(Context var0) { return VERSION.SDK_INT >= 24 ? var0.isDeviceProtectedStorage() : false; } public static boolean startActivities(Context var0, Intent[] var1) { return startActivities(var0, var1, (Bundle)null); } public static boolean startActivities(Context var0, Intent[] var1, Bundle var2) { if (VERSION.SDK_INT >= 16) { var0.startActivities(var1, var2); } else { var0.startActivities(var1); } return true; } public static void startActivity(Context var0, Intent var1, @Nullable Bundle var2) { if (VERSION.SDK_INT >= 16) { var0.startActivity(var1, var2); } else { var0.startActivity(var1); } } public static void startForegroundService(Context var0, Intent var1) { if (VERSION.SDK_INT >= 26) { var0.startForegroundService(var1); } else { var0.startService(var1); } } }
[ "crash@home.home.hr" ]
crash@home.home.hr
e57773b807191aff28dbee253d74f5f755e04444
28935683223311c6345a7c7a0ed2e5f19cfa94d8
/app/src/main/java/com/google/android/apps/exposurenotification/nearby/PackageConfigurationHelper.java
76f41b8988e17cc214361bb3c5a454de948ee276
[ "Apache-2.0" ]
permissive
isabella232/exposure-notifications-android
64ba16ea78d56d508874c5eaf2d7611b962cf48f
0220325466214966368b1f1e5cc0eb8a6a380df7
refs/heads/master
2023-06-05T08:16:17.444741
2021-06-21T17:25:39
2021-06-21T17:28:13
380,784,965
0
0
Apache-2.0
2021-06-27T16:15:55
2021-06-27T16:14:38
null
UTF-8
Java
false
false
4,367
java
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.google.android.apps.exposurenotification.nearby; import android.os.Bundle; import androidx.annotation.Nullable; import com.google.android.apps.exposurenotification.storage.ExposureNotificationSharedPreferences; import com.google.android.gms.nearby.exposurenotification.PackageConfiguration; import com.google.common.base.Optional; import javax.inject.Inject; /** * Helper methods for {@link PackageConfiguration}. */ public class PackageConfigurationHelper { public static final String APP_ANALYTICS_OPT_IN = "METRICS_OPT_IN"; public static final String PRIVATE_ANALYTICS_OPT_IN = "APPA_OPT_IN"; public static final String CHECK_BOX_API_KEY = "check_box_api"; private final ExposureNotificationSharedPreferences exposureNotificationSharedPreferences; @Inject public PackageConfigurationHelper( ExposureNotificationSharedPreferences exposureNotificationSharedPreferences) { this.exposureNotificationSharedPreferences = exposureNotificationSharedPreferences; } /** * Updates the various analytics states with a given {@link PackageConfiguration} * * <p>If app analytics is not set and app analytics state from {@link PackageConfiguration} is * true, * update the app analytics state in {@link ExposureNotificationSharedPreferences}. * * <p>If private analytics is not set, and private analytics state exists in the {@link * PackageConfiguration}, set the private analytics state in {@link * ExposureNotificationSharedPreferences}. */ public void maybeUpdateAnalyticsState(@Nullable PackageConfiguration packageConfiguration) { if (packageConfiguration == null) { return; } if (getAppAnalyticsFromPackageConfiguration(packageConfiguration)) { if (!exposureNotificationSharedPreferences.isAppAnalyticsSet()) { exposureNotificationSharedPreferences.setAppAnalyticsState(true); } } Optional<Boolean> privateAnalyticsFromConfiguration = maybeGetPrivateAnalyticsFromPackageConfiguration(packageConfiguration); if (privateAnalyticsFromConfiguration.isPresent()) { if (!exposureNotificationSharedPreferences.isPrivateAnalyticsStateSet()) { exposureNotificationSharedPreferences .setPrivateAnalyticsState(privateAnalyticsFromConfiguration.get()); } } } /** * Fetches the app analytics state from a {@link PackageConfiguration} if it exists. Otherwise * false. */ private static boolean getAppAnalyticsFromPackageConfiguration( PackageConfiguration packageConfiguration) { Bundle values = packageConfiguration.getValues(); if (values != null) { return values.getBoolean(APP_ANALYTICS_OPT_IN, false); } return false; } /** * Fetches the private analytics state from a {@link PackageConfiguration} if it exists. Otherwise * absent. */ private static Optional<Boolean> maybeGetPrivateAnalyticsFromPackageConfiguration( PackageConfiguration packageConfiguration) { Bundle values = packageConfiguration.getValues(); if (values == null) { return Optional.absent(); } if (!values.containsKey(PRIVATE_ANALYTICS_OPT_IN)) { return Optional.absent(); } return Optional.of(values.getBoolean(PRIVATE_ANALYTICS_OPT_IN)); } /** * Fetches the checkbox consent from a {@link PackageConfiguration} if it exists. Otherwise * returns false. */ public static boolean getCheckboxConsentFromPackageConfiguration( @Nullable PackageConfiguration packageConfiguration) { if (packageConfiguration == null) { return false; } Bundle values = packageConfiguration.getValues(); if (values != null) { return values.getBoolean(CHECK_BOX_API_KEY, false); } return false; } }
[ "noreply@google.com" ]
noreply@google.com
6d19c36d1728403a1c7424b0853a7e4c99ef9529
2fac25248a4dd0184b335b8a4cf52decf06f6262
/src/main/java/methodchain/Robot.java
ecda7716fa16ac2e136c9cdeb62781e229dfaaec
[]
no_license
Rolderek/training-solutions
a1314a5c147b04531ed5d7909bb33fa85dd2605a
f87b5269e8499f54deb89bcebd4f3b5a765f67e3
refs/heads/master
2023-04-14T08:21:59.930872
2021-04-28T08:44:49
2021-04-28T08:44:49
308,072,642
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
package methodchain; public class Robot { private int distance; private int azimut; public Robot(int distance, int azimut) { this.distance = distance; this.azimut = azimut; } public Robot go(int meter) { this.distance = distance; return this; } public Robot rotate(int angle) { this.azimut = azimut; return this; } public int getDistance() { return distance; } public int getAzimut() { return azimut; } }
[ "restaslaci@gmail.com" ]
restaslaci@gmail.com
6a7d739a1c75c1614a16f901cbec5c9d26b717f6
4d6f449339b36b8d4c25d8772212bf6cd339f087
/netreflected/src/Framework/Microsoft.Build.Framework,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a/microsoft/build/framework/INodeLogger.java
24461c183743a316d0fa959c56617bff303f530b
[ "MIT" ]
permissive
lvyitian/JCOReflector
299a64550394db3e663567efc6e1996754f6946e
7e420dca504090b817c2fe208e4649804df1c3e1
refs/heads/master
2022-12-07T21:13:06.208025
2020-08-28T09:49:29
2020-08-28T09:49:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,931
java
/* * MIT License * * Copyright (c) 2020 MASES s.r.l. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /************************************************************************************** * <auto-generated> * This code was generated from a template using JCOReflector * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. * </auto-generated> *************************************************************************************/ package microsoft.build.framework; import org.mases.jcobridge.*; import org.mases.jcobridge.netreflection.*; // Import section import microsoft.build.framework.ILogger; import microsoft.build.framework.ILoggerImplementation; import microsoft.build.framework.IEventSource; import microsoft.build.framework.IEventSourceImplementation; import microsoft.build.framework.LoggerVerbosity; /** * The base .NET class managing Microsoft.Build.Framework.INodeLogger, Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Implements {@link IJCOBridgeReflected}. * <p> * * See: <a href="https://docs.microsoft.com/en-us/dotnet/api/Microsoft.Build.Framework.INodeLogger" target="_top">https://docs.microsoft.com/en-us/dotnet/api/Microsoft.Build.Framework.INodeLogger</a> */ public interface INodeLogger extends IJCOBridgeReflected, ILogger { /** * Fully assembly qualified name: Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a */ public static final String assemblyFullName = "Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; /** * Assembly name: Microsoft.Build.Framework */ public static final String assemblyShortName = "Microsoft.Build.Framework"; /** * Qualified class name: Microsoft.Build.Framework.INodeLogger */ public static final String className = "Microsoft.Build.Framework.INodeLogger"; /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link INodeLogger}, a cast assert is made to check if types are compatible. */ public static INodeLogger ToINodeLogger(IJCOBridgeReflected from) throws Throwable { JCOBridge bridge = JCOBridgeInstance.getInstance("Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); JCType classType = bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName)); NetType.AssertCast(classType, from); return new INodeLoggerImplementation(from.getJCOInstance()); } /** * Returns the reflected Assembly name * * @return A {@link String} representing the Fullname of reflected Assembly */ public String getJCOAssemblyName(); /** * Returns the reflected Class name * * @return A {@link String} representing the Fullname of reflected Class */ public String getJCOClassName(); /** * Returns the reflected Class name used to build the object * * @return A {@link String} representing the name used to allocated the object * in CLR context */ public String getJCOObjectName(); /** * Returns the instantiated class * * @return An {@link Object} representing the instance of the instantiated Class */ public Object getJCOInstance(); /** * Returns the instantiated class Type * * @return A {@link JCType} representing the Type of the instantiated Class */ public JCType getJCOType(); // Methods section public void Initialize(IEventSource eventSource, int nodeCount) throws Throwable; // Properties section // Instance Events section }
[ "mario.mastrodicasa@masesgroup.com" ]
mario.mastrodicasa@masesgroup.com
d456e1375c52f7c7e5def8b54723faf5d1432714
e73bd7bbae7ea4c75681f1fb03ca3e1851811cf2
/entando-components-enterprise/plugins/entando-plugin-jppentaho/src/test/java/com/agiletec/plugins/jppentaho/apsadmin/JpPentahoApsAdminBaseTestCase.java
1e7d39b9f203aa841d1e31601cd9ec8bb59fd62c
[]
no_license
pietrangelo/entando-base-image-4.3.2
b4f3ee6bb98e5b3b651fdddf0803b88c5132af55
d8014859a2c0e8808efb34867e87d3c34764fe2c
refs/heads/master
2021-07-21T12:02:21.780905
2017-11-02T11:13:40
2017-11-02T11:13:40
109,249,644
0
0
null
null
null
null
UTF-8
Java
false
false
810
java
/* * * Copyright 2013 Entando S.r.l. (http://www.entando.com) All rights reserved. * * This file is part of Entando Enterprise Edition software. * You can redistribute it and/or modify it * under the terms of the Entando's EULA * * See the file License for the specific language governing permissions * and limitations under the License * * * * Copyright 2013 Entando S.r.l. (http://www.entando.com) All rights reserved. * */ package com.agiletec.plugins.jppentaho.apsadmin; import com.agiletec.ConfigTestUtils; import com.agiletec.apsadmin.ApsAdminBaseTestCase; import com.agiletec.plugins.jppentaho.PluginConfigTestUtils; public class JpPentahoApsAdminBaseTestCase extends ApsAdminBaseTestCase { @Override protected ConfigTestUtils getConfigUtils() { return new PluginConfigTestUtils(); } }
[ "p.masala@entando.com" ]
p.masala@entando.com
8a1ec0d0a60b48eeb7b749ffb043b040c5126984
85fdcf0631ca2cc72ce6385c2bc2ac3c1aea4771
/temp/src/minecraft/net/minecraft/src/BlockDeadBush.java
e77245dbfb65c62e227600a52af8617e116f126f
[]
no_license
lcycat/Cpsc410-Code-Trip
c3be6d8d0d12fd7c32af45b7e3b8cd169e0e28d4
cb7f76d0f98409af23b602d32c05229f5939dcfb
refs/heads/master
2020-12-24T14:45:41.058181
2014-11-21T06:54:49
2014-11-21T06:54:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,760
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) braces deadcode fieldsfirst package net.minecraft.src; import java.util.Random; // Referenced classes of package net.minecraft.src: // BlockFlower, Material, Block, World, // EntityPlayer, ItemStack, Item, ItemShears, // StatList public class BlockDeadBush extends BlockFlower { protected BlockDeadBush(int p_i3932_1_, int p_i3932_2_) { super(p_i3932_1_, p_i3932_2_, Material.field_76255_k); float f = 0.4F; func_71905_a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); } protected boolean func_72263_d_(int p_72263_1_) { return p_72263_1_ == Block.field_71939_E.field_71990_ca; } public int func_71858_a(int p_71858_1_, int p_71858_2_) { return field_72059_bZ; } public int func_71885_a(int p_71885_1_, Random p_71885_2_, int p_71885_3_) { return -1; } public void func_71893_a(World p_71893_1_, EntityPlayer p_71893_2_, int p_71893_3_, int p_71893_4_, int p_71893_5_, int p_71893_6_) { if(!p_71893_1_.field_72995_K && p_71893_2_.func_71045_bC() != null && p_71893_2_.func_71045_bC().field_77993_c == Item.field_77745_be.field_77779_bT) { p_71893_2_.func_71064_a(StatList.field_75934_C[field_71990_ca], 1); func_71929_a(p_71893_1_, p_71893_3_, p_71893_4_, p_71893_5_, new ItemStack(Block.field_71961_Y, 1, p_71893_6_)); } else { super.func_71893_a(p_71893_1_, p_71893_2_, p_71893_3_, p_71893_4_, p_71893_5_, p_71893_6_); } } }
[ "kye.13@hotmail.com" ]
kye.13@hotmail.com
8ee488cea029aa1f423121103007efe01c3fe7cb
89e9f27fdbc28b80e5d89d7b9ee0fdd588ac2bfb
/src/com/facebook/buck/d/DBinaryDescription.java
844652c6a49de6b75baea9bc8ce3e9e5c022311d
[ "Apache-2.0" ]
permissive
longseespace/buck
a108bc826a513eb7ec58e17407f90d64c7639cc1
c1962f963e72f920ea53a99e66165ae7e7c1c4aa
refs/heads/master
2020-12-13T21:52:43.176739
2015-05-13T08:05:57
2015-05-13T08:05:57
35,529,932
0
0
null
2015-05-13T05:26:53
2015-05-13T05:26:53
null
UTF-8
Java
false
false
2,126
java
/* * Copyright 2015-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.d; import com.facebook.buck.model.BuildTarget; import com.facebook.buck.rules.BuildRule; import com.facebook.buck.rules.BuildRuleParams; import com.facebook.buck.rules.BuildRuleResolver; import com.facebook.buck.rules.BuildRuleType; import com.facebook.buck.rules.Description; import com.facebook.buck.rules.SourcePath; import com.facebook.buck.rules.SourcePathResolver; import com.facebook.infer.annotation.SuppressFieldNotInitialized; import com.google.common.base.Optional; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSortedSet; public class DBinaryDescription implements Description<DBinaryDescription.Arg> { private static final BuildRuleType TYPE = BuildRuleType.of("d_binary"); private final DBuckConfig dBuckConfig; public DBinaryDescription(DBuckConfig dBuckConfig) { this.dBuckConfig = dBuckConfig; } @Override public BuildRuleType getBuildRuleType() { return TYPE; } @Override public Arg createUnpopulatedConstructorArg() { return new Arg(); } @Override public <A extends Arg> BuildRule createBuildRule( BuildRuleParams params, BuildRuleResolver resolver, A args) { return new DBinary( params, new SourcePathResolver(resolver), args.srcs, dBuckConfig.getDCompiler()); } @SuppressFieldNotInitialized public static class Arg { public ImmutableSet<SourcePath> srcs; public Optional<ImmutableSortedSet<BuildTarget>> deps; } }
[ "sdwilsh@fb.com" ]
sdwilsh@fb.com
97cffccf2e38367c3ced2a3c629cbbe3fa7a402a
224316208b7a6ddd49c3d1b7a5ecfd5ca985775c
/activemq-things/src/test/java/posta/MyProcessor.java
687a2bf162396a59e3cea9ae623a44eee09b1569
[]
no_license
b2kalyan/camel-sandbox
dbb256c49f552397452eabf34eb34c28b0d66d2e
69df21605d7582e673eb3f926d27241a8d91ab80
refs/heads/master
2020-03-06T22:55:18.475804
2014-07-29T21:46:24
2014-07-29T21:46:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,150
java
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package posta; import org.apache.camel.Exchange; import org.apache.camel.Processor; /** * @author <a href="http://www.christianposta.com/blog">Christian Posta</a> */ public class MyProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { exchange.getIn().setBody(new TheBean()); } }
[ "christian.posta@gmail.com" ]
christian.posta@gmail.com
8cda158986b1a40620b6536f7fb1cc97554fe90b
f5b407377a491a7cd475414c7faeed18468ac5b0
/feilong-core/src/test/java/com/feilong/core/bean/propertyutiltest/CopyPropertiesTest.java
4f22d92db00a8d0ef08ded4ff59efb34f90ae7ab
[ "Apache-2.0" ]
permissive
luchao0111/feilong
100a7b7784fc6fbfb8252bd468c52899dc4b5169
4024b8abb5b19f1378295fa8d1bd8ee3b86cfdad
refs/heads/master
2022-05-29T02:09:55.324155
2020-05-06T14:50:17
2020-05-06T14:50:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,922
java
/* * Copyright (C) 2008 feilong * * 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.feilong.core.bean.propertyutiltest; import static com.feilong.core.bean.ConvertUtil.toArray; import static com.feilong.core.date.DateUtil.now; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasProperty; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; import java.math.BigDecimal; import java.util.Date; import org.junit.Test; import com.feilong.core.bean.BeanOperationException; import com.feilong.core.bean.PropertyUtil; import com.feilong.store.member.Person; import com.feilong.store.member.User; /** * The Class PropertyUtilTest. * * @author <a href="http://feitianbenyue.iteye.com/">feilong</a> * @since 1.2.2 */ public class CopyPropertiesTest{ /** * Test copy properties. */ @Test public void testCopyProperties(){ Date now = now(); String[] array = toArray("feilong", "飞天奔月", "venusdrogon"); User oldUser = new User(); oldUser.setId(5L); oldUser.setMoney(new BigDecimal(500000)); oldUser.setDate(now); oldUser.setNickNames(array); User newUser = new User(); PropertyUtil.copyProperties(newUser, oldUser, "date", "money", "nickNames"); assertThat( newUser, allOf(// hasProperty("money", equalTo(new BigDecimal(500000))), hasProperty("date", is(now)), hasProperty("nickNames", equalTo(array)) // )); } //--------------------------------------------------------------- @Test public void testCopyPropertiesNullValue(){ User oldUser = new User(); oldUser.setId(null); User newUser = new User(); PropertyUtil.copyProperties(newUser, oldUser); assertEquals(null, newUser.getId()); } //--------------------------------------------------------------- /** * Test copy properties null to obj. */ @Test(expected = NullPointerException.class) public void testCopyPropertiesNullToObj(){ PropertyUtil.copyProperties(null, new Person()); } /** * Test copy properties null from obj. */ @Test(expected = NullPointerException.class) public void testCopyPropertiesNullFromObj(){ PropertyUtil.copyProperties(new Person(), null); } /** * Test copy properties from obj no exist property name. */ @Test(expected = BeanOperationException.class) public void testCopyPropertiesFromObjNoExistPropertyName(){ User oldUser = new User(); oldUser.setId(5L); User newUser = new User(); PropertyUtil.copyProperties(newUser, oldUser, "date1"); } /** * Test copy properties to obj no exist property name. */ @Test(expected = BeanOperationException.class) public void testCopyPropertiesToObjNoExistPropertyName(){ User oldUser = new User(); oldUser.setId(5L); oldUser.setMoney(new BigDecimal(500000)); PropertyUtil.copyProperties(new Person(), oldUser, "date"); } }
[ "venusdrogon@163.com" ]
venusdrogon@163.com
7a44850b8969822f256c1d705cdd99e22ccf3c6e
c34c16c923802c7bd63ba7666da7406ea179c8db
/server/mianshi-service/src/main/java/cn/xyz/mianshi/utils/SMSVerificationUtils.java
a4188893a4422d5ae59968754337028083fb1b01
[]
no_license
xeon-ye/bailian
36f322b40a4bc3a9f4cc6ad76e95efe3216258ed
ec84ac59617015a5b7529845f551d4fa136eef4e
refs/heads/main
2023-06-29T06:12:53.074219
2021-08-07T11:56:38
2021-08-07T11:56:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,152
java
package cn.xyz.mianshi.utils; import java.io.UnsupportedEncodingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.alibaba.fastjson.JSONObject; import com.aliyuncs.DefaultAcsClient; import com.aliyuncs.IAcsClient; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.IClientProfile; import cn.xyz.commons.autoconfigure.KApplicationProperties.SmsConfig; import cn.xyz.commons.utils.DateUtil; import cn.xyz.commons.utils.HttpClientUtil; import cn.xyz.commons.utils.WebNetEncode; import cn.xyz.mianshi.vo.SmsRecord; /** @version:(1.0) * @ClassName SMSPushUtils * @Description: (短信验证服务) * @date:2018年9月8日下午12:20:30 */ @Component public class SMSVerificationUtils { protected static Logger smsLogger=LoggerFactory.getLogger("SMSVerificationUtils"); public static SmsConfig getSmsConfig() { return SKBeanUtils.getSmsConfig(); } public static final String SMSFORMAT = "00"; public static SendSmsResponse sendSms(String telephone, String code, String areaCode) throws ClientException { // 可自助调整超时时间 System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); System.setProperty("sun.net.client.defaultReadTimeout", "10000"); // 初始化acsClient,暂不支持region化 IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", getSmsConfig().getAccesskeyid(), getSmsConfig().getAccesskeysecret()); DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", getSmsConfig().getProduct(), getSmsConfig().getDomain()); IAcsClient acsClient = new DefaultAcsClient(profile); // 组装请求对象-具体描述见控制台-文档部分内容 SendSmsRequest request = new SendSmsRequest(); // 必填:待发送手机号 smsLogger.info("格式化手机号 : 00 + 国际区号 + 号码 ==========>"+" SMSFORMAT :"+ SMSFORMAT +" areaCode: " + areaCode); request.setPhoneNumbers(SMSFORMAT + telephone);// 接收号码格式为00+国际区号+号码 // 必填:短信签名-可在短信控制台中找到 request.setSignName(getSmsConfig().getSignname()); // 必填:短信模板-可在短信控制台中找到 request.setTemplateCode(getSmsConfig().getEnglish_templetecode()); if ("86".equals(areaCode) || "886".equals(areaCode) || "852".equals(areaCode)) request.setTemplateCode(getSmsConfig().getChinase_templetecode()); // 可选:模板中的变量替换JSON串,如模板内容为"亲爱的用户,您的验证码为${code}"时,此处的值为 request.setTemplateParam("{\"code\":\"" + code + "\"}"); // 选填-上行短信扩展码(无特殊需求用户请忽略此字段) // request.setSmsUpExtendCode("90997"); // 可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者 // request.setOutId("yourOutId"); // hint 此处可能会抛出异常,注意catch SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); smsLogger.info("阿里云短信服务回执详情:"+JSONObject.toJSONString(sendSmsResponse)); if (sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) { smsLogger.info("短信发送成功!"); saveSMSToDB(request.getPhoneNumbers(), areaCode, code, request.getSignName()+request.getTemplateCode(), sendSmsResponse.getRequestId()); } else { smsLogger.info("短信发送失败!"); } return sendSmsResponse; } // 使用天天国际短信平台发送国际短信 public static String sendSmsToMs360(String telephone, String areaCode, String code) { String msgId = null; try { String ip = getSmsConfig().getHost(); int port = getSmsConfig().getPort(); // HTTP 请求工具 HttpClientUtil util = new HttpClientUtil(ip, port, getSmsConfig().getApi()); String user = getSmsConfig().getUsername();// 你的用户名 String pwd = getSmsConfig().getPassword();// 你的密码: String ServiceID = "SEND"; // 固定,不需要改变 String dest = telephone; // 你的目的号码【收短信的电话号码】 String sender = "";// 你的原号码,可空【大部分国家原号码带不过去,只有少数国家支持透传,所有一般为空】 String templateEnglishSMS = new String(getSmsConfig().getTemplateEnglishSMS().getBytes("ISO-8859-1"),"utf-8"); String msg = templateEnglishSMS + code;// 你的短信内容 if ("86".equals(areaCode) || "886".equals(areaCode) || "852".equals(areaCode)) { String templateChineseSMS = new String(getSmsConfig().getTemplateChineseSMS().getBytes("ISO-8859-1"),"utf-8"); msg = templateChineseSMS + code; } // codec=8 Unicode 编码, 3 ISO-8859-1, 0 ASCII // 短信内容 HEX 编码,8 为 UTF-16BE HEX 编码, dataCoding = 8 ,支持所有国家的语言,建议直接使用 // 8 String hex = WebNetEncode.encodeHexStr(8, msg); hex = hex.trim() + "&codec=8"; // HTTP 封包请求, util.sendPostMessage 返回结果, // 如果是以 “-” 开头的为发送失败,请查看错误代码,否则为MSGID msgId = util.sendGetMessage(user, pwd, ServiceID, dest, sender, hex); smsLogger.info("msgid = " + msgId + " msg = " + msg); // 发送短信记录保存到数据库 saveSMSToDB(telephone, areaCode, code, msg, msgId); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return msgId; } /** * @Description:(短信详情存库) * @param telephone * @param areaCode * @param code * @param content * @param msgId **/ public static void saveSMSToDB(String telephone, String areaCode, String code, String content, String msgId) { SmsRecord sms = ConstantUtil.getSmsPrice(areaCode); if (null == sms) sms = new SmsRecord(); sms.setAreaCode(areaCode); sms.setTelephone(telephone); sms.setCode(code); sms.setContent(content); sms.setMsgId(msgId); sms.setTime(DateUtil.currentTimeSeconds()); ConstantUtil.dsForRW.save(sms); } }
[ "xiexun6943@gmail.com" ]
xiexun6943@gmail.com
467cbde7a1dfa077137e1cc6a65f6736de07eab7
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_34092.java
e20c555141f87f5934377e417f54742d278aea82
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
258
java
/** * A custom enhancer for the authorization request * @param authorizationRequestEnhancer */ public void setAuthorizationRequestEnhancer(RequestEnhancer authorizationRequestEnhancer){ this.authorizationRequestEnhancer=authorizationRequestEnhancer; }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
1e062bbc688c0b8fb421c553db79b69cc16e9eab
de897e577c2bd95abbf98b143a2ec3d8cc5b9f80
/app/src/main/java/com/lwc/shanxiu/widget/CustomerDateView/CustomYearView.java
6113e92d4351a30ba813fce37efa94c3bd56212d
[]
no_license
popularcloud/SHANXIU06042120
6b4e02c1e4c1df2cf5ac9145992125f0cf930d80
60cb0a4512f36fb2933009f97b6ab332d7b370bb
refs/heads/master
2021-06-29T01:30:10.062909
2021-01-04T01:51:36
2021-01-04T01:51:36
199,803,391
0
0
null
null
null
null
UTF-8
Java
false
false
4,640
java
/* * Copyright (C) 2016 huanghaibin_dev <huanghaibin_dev@163.com> * WebSite https://github.com/MiracleTimes-Dev * 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.lwc.shanxiu.widget.CustomerDateView; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import com.haibin.calendarview.Calendar; import com.haibin.calendarview.YearView; /** * 自定义年视图 * Created by huanghaibin on 2018/10/9. */ @SuppressWarnings("unused") public class CustomYearView extends YearView { private int mTextPadding; /** * 闰年字体 */ private Paint mLeapYearTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG); public CustomYearView(Context context) { super(context); mTextPadding = dipToPx(context, 3); mLeapYearTextPaint.setTextSize(dipToPx(context, 12)); mLeapYearTextPaint.setColor(0xffd1d1d1); mLeapYearTextPaint.setAntiAlias(true); mLeapYearTextPaint.setFakeBoldText(true); } @Override protected void onDrawMonth(Canvas canvas, int year, int month, int x, int y, int width, int height) { String text = getContext() .getResources() .getStringArray(com.haibin.calendarview.R.array.month_string_array)[month - 1]; canvas.drawText(text, x + mItemWidth / 2 - mTextPadding, y + mMonthTextBaseLine, mMonthTextPaint); if (month == 2 && isLeapYear(year)) { float w = getTextWidth(mMonthTextPaint, text); canvas.drawText("闰年", x + mItemWidth / 2 - mTextPadding + w + dipToPx(getContext(), 6), y + mMonthTextBaseLine, mLeapYearTextPaint); } } private float getTextWidth(Paint paint, String text) { return paint.measureText(text); } /** * 是否是闰年 * * @param year year * @return 是否是闰年 */ private static boolean isLeapYear(int year) { return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); } @Override protected void onDrawWeek(Canvas canvas, int week, int x, int y, int width, int height) { String text = getContext().getResources().getStringArray(com.haibin.calendarview.R.array.year_view_week_string_array)[week]; canvas.drawText(text, x + width / 2, y + mWeekTextBaseLine, mWeekTextPaint); } @Override protected boolean onDrawSelected(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme) { int cx = x + mItemWidth / 2; int cy = y + mItemHeight / 2; int radius = Math.min(mItemWidth, mItemHeight) / 8 * 5; canvas.drawCircle(cx, cy, radius, mSelectedPaint); return true; } @Override protected void onDrawScheme(Canvas canvas, Calendar calendar, int x, int y) { } @Override protected void onDrawText(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme, boolean isSelected) { float baselineY = mTextBaseLine + y; int cx = x + mItemWidth / 2; if (isSelected) { canvas.drawText(String.valueOf(calendar.getDay()), cx, baselineY, hasScheme ? mSchemeTextPaint : mSelectTextPaint); } else if (hasScheme) { canvas.drawText(String.valueOf(calendar.getDay()), cx, baselineY, calendar.isCurrentDay() ? mCurDayTextPaint : mSchemeTextPaint); } else { canvas.drawText(String.valueOf(calendar.getDay()), cx, baselineY, calendar.isCurrentDay() ? mCurDayTextPaint : mCurMonthTextPaint); } } /** * dp转px * * @param context context * @param dpValue dp * @return px */ private static int dipToPx(Context context, float dpValue) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dpValue * scale + 0.5f); } }
[ "liushuzhiyt@163.com" ]
liushuzhiyt@163.com
770744ee53184c407d775e7867c9b5703a69933a
c1116c7ff8314ec43b16d455ee1aea7d8d289943
/enderio-machines/src/main/java/crazypants/enderio/machines/config/config/SoulBinderConfig.java
180b62af789f8ea59de8f8a2faca125454cd7c56
[ "Unlicense", "CC-BY-NC-3.0", "CC0-1.0", "CC-BY-3.0", "LicenseRef-scancode-public-domain" ]
permissive
FinalCraftMC/EnderIO
71054da73fe329d5d49c9a2c239b4545a8b7ed7b
a173868d1659d511154d9b195cd0d4759164029b
refs/heads/master
2023-04-23T19:20:36.682724
2021-05-10T18:42:24
2021-05-10T18:42:24
298,419,938
0
0
Unlicense
2020-09-26T23:02:13
2020-09-24T23:40:35
null
UTF-8
Java
false
false
708
java
package crazypants.enderio.machines.config.config; import info.loenwind.autoconfig.factory.IValue; import info.loenwind.autoconfig.factory.IValueFactory; import crazypants.enderio.machines.config.Config; public final class SoulBinderConfig { public static final IValueFactory F = Config.F.section("soulbinder"); public static final IValue<Integer> soulFluidInputRate = F.make("soulFluidInputRate", 50, // "Amount of XP fluid in mB the Soul Binder can accept per tick.").setMin(1).sync(); public static final IValue<Integer> soulFluidOutputRate = F.make("soulFluidOutputRate", 50, // "Amount of XP fluid in mB that can be extracted from the Soul Binder per tick.").setMin(1).sync(); }
[ "henry@loenwind.info" ]
henry@loenwind.info
855937a9cea6107b1fc7eeca286a75f7ed33a3cb
a37e75c5138eec880850caaa0d1fa548f08d4e31
/org.kevoree.extra.freePastry/src/main/java/rice/pastry/NodeIdFactory.java
e10d55348b24372ccb58509c6ab31d5df373192f
[]
no_license
dukeboard/kevoree-extra
c88806d50d23d2dcdd0d5d64d75b5e6358cdabcf
f8308f812d54d7a8ba4ae8fd2972d6fed3bc3503
refs/heads/master
2022-12-22T17:09:51.828299
2014-05-27T14:43:16
2014-05-27T14:43:16
2,067,252
4
7
null
2022-12-13T19:14:06
2011-07-18T16:15:37
Java
UTF-8
Java
false
false
2,239
java
/******************************************************************************* "FreePastry" Peer-to-Peer Application Development Substrate Copyright 2002-2007, Rice University. Copyright 2006-2007, Max Planck Institute for Software Systems. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Rice University (RICE), Max Planck Institute for Software Systems (MPI-SWS) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. This software is provided by RICE, MPI-SWS and the contributors on an "as is" basis, without any representations or warranties of any kind, express or implied including, but not limited to, representations or warranties of non-infringement, merchantability or fitness for a particular purpose. In no event shall RICE, MPI-SWS or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. *******************************************************************************/ package rice.pastry; /** * An interface to any object capable of generating nodeIds. * * @version $Id: NodeIdFactory.java 3613 2007-02-15 14:45:14Z jstewart $ * * @author Andrew Ladd */ public interface NodeIdFactory { /** * Generates a nodeId. * * @return a new node id. */ public Id generateNodeId(); }
[ "jedartois@gmail.com" ]
jedartois@gmail.com
cccf0eb5a1d1804d841c253a237649b3c492215d
eb64e635bb49eb264867b6c3815de21bd7fee32e
/src/main/java/org/wildfly/security/auth/provider/RealmIdentity.java
fe8a18005f77557dd9bf857d9c8856f6d55cebb0
[ "Apache-2.0" ]
permissive
jpkrohling/wildfly-elytron
20580bc1f76fcebb4a55dd687dc2fccb110e25fb
1b4471f30a511c272b15491247653e1d5f055587
refs/heads/master
2021-01-20T22:35:06.806003
2014-08-27T15:36:49
2014-08-27T15:42:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,468
java
/* * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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.wildfly.security.auth.provider; import java.security.Principal; import org.wildfly.security.auth.IdentityContext; import org.wildfly.security.auth.SecurityIdentity; import org.wildfly.security.auth.login.AuthenticationException; import org.wildfly.security.auth.verifier.Verifier; /** * A representation of a pre-authentication identity. * * The life of a {@code RealmIdentity} is short and is for a specific authentication attempt. A {@link SecurityRealm} creating a * {@code RealmIdentity} does not confirm the existance of the identity. * * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a> */ public interface RealmIdentity { /** * Get the {@link Principal} for this identity. * * Note: {@link #createSecurityIdentity()} may be sufficient to make this redundant, just retaining as we currently support * early {@link Principal} access. * * @return The {@link Principal} for this identity. */ Principal getPrincipal(); /** * Obtain the name of the realm this identity is associated with, * * @return The realm name. */ String getRealmName(); /** * Determine whether a given credential is definitely supported, possibly supported, or definitely not supported for this * identity. * * @param credentialType the credential type * @return the level of support for this credential type */ CredentialSupport getCredentialSupport(Class<?> credentialType); /** * Use a verifier to acquire proof of authentication. * * @param verifier the verifier containing evidence of authenticity * @param <P> the type of proof returned by the verifier, or {@link Void} if the verifier cannot return proof * @return the proof, or {@code null} if the verifier cannot return proof * @throws AuthenticationException if the authentication of the principal cannot be verified based on the evidence */ <P> P proveAuthentic(Verifier<P> verifier) throws AuthenticationException; /** * Acquire a credential of the given type. * * @param credentialType the credential type class * @param <C> the credential type * @return the credential, or {@code null} if the principal has no credential of that type */ <C> C getCredential(Class<C> credentialType); /** * Create the {@link SecurityIdentity} that will be associated with the {@link IdentityContext} * * Note: The caller is responsible for ensuring the identity is actually authenticated. * * TODO: Verify where authorization ID is fitting. * * @return The {@link SecurityIdentity} for this identity. */ SecurityIdentity createSecurityIdentity(); }
[ "darran.lofthouse@jboss.com" ]
darran.lofthouse@jboss.com
44b72945e99b6f06d5ce6bf8a0111662f3876945
a911f926261b82ec8a2ade2d0af1a973280ceab6
/qipai_game/src/main/java/com/anbang/qipai/game/plan/bean/historicalresult/majiang/TaizhouMajiangPanPlayerResult.java
fb4500f51734b505ac2167ded87c3cc2a151bac6
[]
no_license
791837060/qipai_huainanmajiang
31325550c9db1fcb139c6f5a89d84f7deac0e3a2
b4f17b26484bbe2840a0852156117faee9996bbb
refs/heads/master
2023-06-26T22:31:40.822705
2021-07-30T07:20:49
2021-07-30T07:20:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,135
java
package com.anbang.qipai.game.plan.bean.historicalresult.majiang; import com.anbang.qipai.game.plan.bean.historicalresult.GamePanPlayerResult; import java.util.Map; public class TaizhouMajiangPanPlayerResult implements GamePanPlayerResult { private String playerId;// 玩家id private String nickname;// 玩家昵称 private int score;// 一盘总分 public TaizhouMajiangPanPlayerResult() { } public TaizhouMajiangPanPlayerResult(Map panPlayerResult) { this.playerId = (String) panPlayerResult.get("playerId"); this.nickname = (String) panPlayerResult.get("nickname"); this.score = ((Double) panPlayerResult.get("score")).intValue(); } public String getPlayerId() { return playerId; } public void setPlayerId(String playerId) { this.playerId = playerId; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public int getScore() { return score; } public void setScore(int score) { this.score = score; } }
[ "shony01@163.com" ]
shony01@163.com
376bd9a74015528da9a3fc7433c84aa7b62d3d89
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/MOCKITO-16b-3-23-Single_Objective_GGA-WeightedSum-BasicBlockCoverage/org/mockito/internal/MockitoCore_ESTest.java
0bd11fa661418456dda4735819110a6866e7a916
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
/* * This file was automatically generated by EvoSuite * Mon May 18 03:14:56 UTC 2020 */ package org.mockito.internal; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; import org.mockito.internal.MockitoCore; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class MockitoCore_ESTest extends MockitoCore_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { MockitoCore mockitoCore0 = new MockitoCore(); String string0 = "+nhNB"; // Undeclared exception! mockitoCore0.when("+nhNB"); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
a097d4819da831bdec550711d7a143a6e015fc2d
175cd60676635a80a6fcbfa0ec506cc9dbcfb5da
/app/src/main/java/com/safety/android/safety/PhotoGallery/PhotoGalleryFragment.java
ff5b9c2108a518c622df5ccfc6fe976fe22ac27a
[]
no_license
wangruiwangrui/Safety
f69a77389a8cf75c1f86b3d87ce8fb81b66a3199
cc8ec75a7d1faff6b3ad5e7a34cb94bc03f094dd
refs/heads/master
2020-05-02T17:49:03.767405
2019-03-27T14:20:41
2019-03-27T14:20:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,631
java
package com.safety.android.safety.PhotoGallery; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.widget.ImageView; import com.safety.android.safety.R; import com.squareup.picasso.Picasso; import java.util.ArrayList; import java.util.List; public class PhotoGalleryFragment extends Fragment { private static final String TAG = "PhotoGalleryFragment"; private RecyclerView mPhotoRecyclerView; private List<GalleryItem> mItems = new ArrayList<>(); public static PhotoGalleryFragment newInstance() { return new PhotoGalleryFragment(); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); new FetchItemsTask().execute(); Log.i(TAG,"Background thread started"); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_photo_gallery, container, false); mPhotoRecyclerView = (RecyclerView) v .findViewById(R.id.fragment_photo_gallery_recycler_view); updatePhotoView(); return v; } @Override public void onDestroyView(){ super.onDestroyView(); } @Override public void onDestroy(){ super.onDestroy(); } private void setupAdapter() { if (isAdded()) { mPhotoRecyclerView.setAdapter(new PhotoAdapter(mItems)); } } private class PhotoHolder extends RecyclerView.ViewHolder { private ImageView mItemImageView; public PhotoHolder(View itemView) { super(itemView); mItemImageView = (ImageView) itemView.findViewById(R.id.fragment_photo_gallery_image_view); } public void bindDrawable(Drawable drawable){ mItemImageView.setImageDrawable(drawable); } } private class PhotoAdapter extends RecyclerView.Adapter<PhotoHolder> { private List<GalleryItem> mGalleryItems; public PhotoAdapter(List<GalleryItem> galleryItems) { mGalleryItems = galleryItems; } @Override public PhotoHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { LayoutInflater inflater= LayoutInflater.from(getActivity()); View view=inflater.inflate(R.layout.gallery_item,viewGroup,false); return new PhotoHolder(view); } @Override public void onBindViewHolder(PhotoHolder photoHolder, int position) { GalleryItem galleryItem = mGalleryItems.get(position); Drawable placeholder=getResources().getDrawable(R.drawable.ic_menu_gallery); photoHolder.bindDrawable(placeholder); Picasso.with(getActivity()).load(galleryItem.getUrl()).placeholder(placeholder).error(R.mipmap.ic_launcher).into(photoHolder.mItemImageView); } @Override public int getItemCount() { return mGalleryItems.size(); } } private void updatePhotoView(){ ViewTreeObserver observer=mPhotoRecyclerView.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { int w,h; @Override public void onGlobalLayout() { mPhotoRecyclerView.getViewTreeObserver().removeOnGlobalLayoutListener(this); w=mPhotoRecyclerView.getMeasuredWidth(); h=mPhotoRecyclerView.getMeasuredHeight(); if(w/h>=2){ mPhotoRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(),5)); }else { mPhotoRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 3)); } } }); } private class FetchItemsTask extends AsyncTask<Void,Void,List<GalleryItem>> { @Override protected List<GalleryItem> doInBackground(Void... params) { return new FlickrFetchr().fetchItems(); } @Override protected void onPostExecute(List<GalleryItem> items) { mItems = items; setupAdapter(); } } }
[ "2768911783@qq.com" ]
2768911783@qq.com
d616382f703d30a12dbd0a79a36b4b4d1000fb7e
1ec73a5c02e356b83a7b867580a02b0803316f0a
/java/bj/DesignPattern/JavaAndPattern/LISKOV/VERSION4/ImmutableSquare.java
6cb4d5b05eb8c18b213cdaf510413bfef07d0b0d
[]
no_license
jxsd0084/JavaTrick
f2ee8ae77638b5b7654c3fcf9bceea0db4626a90
0bb835fdac3c2f6d1a29d1e6e479b553099ece35
refs/heads/master
2021-01-20T18:54:37.322832
2016-06-09T03:22:51
2016-06-09T03:22:51
60,308,161
0
1
null
null
null
null
UTF-8
Java
false
false
483
java
package bj.DesignPattern.JavaAndPattern.LISKOV.VERSION4; public class ImmutableSquare extends Rectangle { private long side; public void setWidth( long width ) { // setSide(width); } public long getWidth() { return getSide(); } public void setHeight( long height ) { // setSide(height); } public long getHeight() { return getSide(); } public long getSide() { return side; } public void setSide( long side ) { // this.side = side; } }
[ "chenlong88882001@163.com" ]
chenlong88882001@163.com
0852d3402b506aa1bdc4d9be474e2deda7d0878d
5a10a1d4954da61a00fcba22eba97089db23e352
/shop/com/enation/javashop/widget/member/MemberMessageWidget.java
e65f2a802d8a9595223ddcf9118010d0f10cadce
[]
no_license
jianganglu/NC
f994dbbb196665167c03c30f5e7973449bc8ab7a
7267ddf78d7c78efa936da3ea0125d1bb0377526
refs/heads/master
2021-01-18T00:30:21.719668
2015-07-12T12:53:54
2015-07-12T12:53:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,801
java
package com.enation.javashop.widget.member; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import com.enation.app.base.core.model.Member; import com.enation.app.base.core.model.Message; import com.enation.eop.sdk.user.IUserService; import com.enation.eop.sdk.user.UserServiceFactory; import com.enation.eop.sdk.widget.AbstractWidget; import com.enation.framework.context.webcontext.ThreadContextHolder; import com.enation.framework.database.Page; import com.enation.framework.util.StringUtil; import com.enation.javashop.core.service.IMemberManager; import com.enation.javashop.core.service.IMessageManager; /** * 短信息挂件 * * @author kingapex * */ public class MemberMessageWidget extends AbstractMemberWidget { private IMessageManager messageManager; private IMemberManager memberManager; protected void config(Map<String, String> params) { } protected void display(Map<String, String> params) { HttpServletRequest request = ThreadContextHolder.getHttpRequest(); action = action == null ? "" : action; if (action.equals("inbox")) { this.setPageName("message_inbox"); String page = request.getParameter("page"); page = (page == null || page.equals("")) ? "1" : page; int pageSize = 10; Page inboxPage = this.messageManager.pageMessage( Integer.valueOf(page), pageSize, "inbox"); Long totalCount = inboxPage.getTotalCount(); Long pageCount = inboxPage.getTotalPageCount(); List inboxList = (List) inboxPage.getResult(); inboxList = inboxList == null ? new ArrayList() : inboxList; this.putData("totalCount", totalCount); this.putData("pageSize", pageSize); this.putData("page", page); this.putData("inboxList", inboxList); this.putData("pageCount", pageCount); } else if (action.equals("outbox")) { this.setPageName("message_outbox"); String page = request.getParameter("page"); page = (page == null || page.equals("")) ? "1" : page; int pageSize = 10; Page outboxPage = this.messageManager.pageMessage( Integer.valueOf(page), pageSize, "outbox"); Long totalCount = outboxPage.getTotalCount(); Long pageCount = outboxPage.getTotalPageCount(); List outboxList = (List) outboxPage.getResult(); outboxList = outboxList == null ? new ArrayList() : outboxList; this.putData("totalCount", totalCount); this.putData("pageSize", pageSize); this.putData("page", page); this.putData("outboxList", outboxList); this.putData("pageCount", pageCount); } else if (action.equals("send")) { this.setPageName("message_send"); } else if (action.equals("sendSave")) { IUserService userService = UserServiceFactory.getUserService(); Member member = userService.getCurrentMember(); Message message = new Message(); message.setFrom_id(member.getMember_id()); message.setMsg_from(member.getUname()); String subject = request.getParameter("subject"); message.setSubject(subject); String msg = request.getParameter("message"); message.setMessage(msg); message.setDate_line((new Date()).getTime()); String msg_to = request.getParameter("msg_to"); msg_to = msg_to.replace(" ", ","); String[] msg_to_array = msg_to.split(","); String returnmessage = ""; try { for (String uname : msg_to_array) { Member m = memberManager.getMemberByUname(uname); if (m != null) { message.setTo_id(m.getMember_id()); message.setMsg_to(m.getUname()); messageManager.addMessage(message); returnmessage += "[" + uname + "] "; } } this.showSuccess("消息已发送给" + returnmessage, "发送消息", "member_message.html?action=send"); } catch (Exception e) { if (this.logger.isDebugEnabled()) { logger.error(e.getStackTrace()); } this.showError("发送失败", "发送消息", "member_message.html?action=send"); } } else if (action.equals("indel")) { String[] ids = request.getParameterValues("delete"); try { messageManager.delinbox(StringUtil.arrayToString(ids, ",")); this.showSuccess("删除成功", "收件箱", "member_message.html?action=inbox"); } catch (Exception e) { if (this.logger.isDebugEnabled()) { logger.error(e.getStackTrace()); } this.showError("删除失败", "收件箱", "member_message.html?action=inbox"); } } else if (action.equals("outdel")) { String[] ids = request.getParameterValues("delete"); try { messageManager.deloutbox(StringUtil.arrayToString(ids, ",")); this.showSuccess("删除成功", "发件箱", "member_message.html?action=outbox"); } catch (Exception e) { if (this.logger.isDebugEnabled()) { logger.error(e.getStackTrace()); } this.showError("删除失败", "发件箱", "member_message.html?action=outbox"); } } else if (action.equals("reply")) { this.setPageName("message_reply"); String msg_to = request.getParameter("msg_to"); String subject = request.getParameter("subject"); this.putData("msg_to", StringUtil.to(msg_to, "utf-8")); this.putData("subject", StringUtil.to(subject, "utf-8")); } else if (action.equals("read")) { this.putData("json", "{message:'ok'}"); this.setPageName("json"); Message m = new Message(); String msg_id = request.getParameter("msg_id"); messageManager.setMessage_read(Integer.valueOf(msg_id)); } } public IMessageManager getMessageManager() { return messageManager; } public void setMessageManager(IMessageManager messageManager) { this.messageManager = messageManager; } public IMemberManager getMemberManager() { return memberManager; } public void setMemberManager(IMemberManager memberManager) { this.memberManager = memberManager; } }
[ "378476772@qq.com" ]
378476772@qq.com
22e3ec478f455c53e868c6dea508182c3dcbcad9
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/appbrand/jsapi/j/g.java
f48e252ad57cca1b15c11fd61a1b9d77f406f9b8
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
245
java
package com.tencent.mm.plugin.appbrand.jsapi.j; import com.tencent.mm.plugin.appbrand.jsapi.p; public final class g extends p { public static final int CTRL_INDEX = 519; public static final String NAME = "onVoIPChatSpeakersChanged"; }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
462144ab983af76d2798ac06a5cc1fe4b4669ea4
729971681f9bf97729988e7fe57d3e041cdad598
/Advanced/src/main/java/hibernate/collection/map/MapTest.java
f7263e072cf5828de28b4a16b1853ef48d79e1fa
[]
no_license
liuchenwei2000/Hibernate
e6b90a10634e9a83f7c3d166429b5e94885d1ef3
aa18556d56affcc68beea2628f07087b4783484b
refs/heads/master
2021-01-10T08:12:04.378524
2017-04-27T07:57:38
2017-04-27T07:57:38
48,789,500
0
0
null
null
null
null
UTF-8
Java
false
false
1,234
java
/** * */ package hibernate.collection.map; import org.hibernate.Session; import hibernate.util.AbstractHibernateTestCase; /** * Map示例 * <p> * Map是一个无序集合类型,提供了键值对应关系。 * * @author 刘晨伟 * * 创建日期:2014年8月18日 */ public class MapTest extends AbstractHibernateTestCase { @Override protected void doTest() throws Exception { session.beginTransaction(); Product product = new Product("car"); product.getParts().put("左前轮", new Part("tire1")); product.getParts().put("右前轮", new Part("tire2")); product.getParts().put("左后轮", new Part("tire3")); product.getParts().put("右后轮", new Part("tire4")); session.save(product); // 注意这里的Map实例已经被Hibernate替换为其自身实现,而不再是HashMap System.out.println("【Map class is】" + product.getParts().getClass()); session.getTransaction().commit(); Session newSession = sessionFactory.openSession(); Product p = (Product) newSession.load(Product.class, 1L); // 这里可以直接根据key值获取对应的对象 System.out.println(p.getParts().get("左前轮")); newSession.close(); } @Override protected void prepareData() { } }
[ "liuchenwei2000@163.com" ]
liuchenwei2000@163.com
71447b0490754320fc9270cd292e1d1d66599289
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_9541fb23272f8f92634325967c48cebebaf63b18/CapabilitiesMetaData/2_9541fb23272f8f92634325967c48cebebaf63b18_CapabilitiesMetaData_s.java
b37171840bea6a3ac355a36c872095cbdf7e1cab
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,022
java
/* * JBoss, Home of Professional Open Source * Copyright 2008, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.classloading.spi.metadata; import java.io.Serializable; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.classloading.plugins.metadata.ModuleCapability; import org.jboss.classloading.plugins.metadata.PackageCapability; /** * CapabilitiesMetaData. * * @author <a href="adrian@jboss.com">Adrian Brock</a> * @version $Revision: 1.1 $ */ @XmlType(name="capabilties", propOrder= {"capabilities"}) @XmlRootElement(name="capabilities", namespace="urn:jboss:classloading:1.0") public class CapabilitiesMetaData implements Serializable, Cloneable { /** The serialVersionUID */ private static final long serialVersionUID = -7910704924025591308L; /** The capabilities */ private List<Capability> capabilities; /** * Get the capabilities. * * @return the capabilities. */ public List<Capability> getCapabilities() { return capabilities; } /** * Set the capabilities. * * @param capabilities the capabilities. */ @XmlElements ({ @XmlElement(name="module", type=ModuleCapability.class), @XmlElement(name="package", type=PackageCapability.class) }) @XmlAnyElement public void setCapabilities(List<Capability> capabilities) { this.capabilities = capabilities; } /** * Add a capability * * @param capability the capability * @throws IllegalArgumentException for a null capability */ public void addCapability(Capability capability) { if (capability == null) throw new IllegalArgumentException("Null capability"); if (capabilities == null) capabilities = new CopyOnWriteArrayList<Capability>(); capabilities.add(capability); } /** * Remove a capability * * @param capability the capability * @throws IllegalArgumentException for a null capability */ public void removeCapability(Capability capability) { if (capability == null) throw new IllegalArgumentException("Null capability"); if (capabilities == null) return; capabilities.remove(capability); } @Override public CapabilitiesMetaData clone() { try { CapabilitiesMetaData clone = (CapabilitiesMetaData) super.clone(); if (capabilities != null) { List<Capability> clonedCapabilities = new CopyOnWriteArrayList<Capability>(capabilities); clone.setCapabilities(clonedCapabilities); } return clone; } catch (CloneNotSupportedException e) { throw new RuntimeException("Unexpected", e); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
e53583c267920caca95167c40aff460de87dd1be
b19b3a02b548220023d7266bc6a85a25518f3319
/back/leetcode/page2/PascalsTriangle2.java
9ad8dca5809e56d1ee651474af96382fc0a8127c
[]
no_license
yangseungin/algo
40ab28734cf23515bf34fcc1da8f9ba169f54f8f
03c96b21a79425988dc76e842f940e9e642ac1d5
refs/heads/master
2022-05-08T07:54:26.087728
2022-04-01T15:03:45
2022-04-01T15:03:45
177,534,719
1
1
null
2019-04-07T10:50:53
2019-03-25T07:20:12
Java
UTF-8
Java
false
false
661
java
package page2; import java.util.ArrayList; import java.util.List; public class PascalsTriangle2 { public static void main(String[] args) { System.out.println(getRow(0)); } public static List<Integer> getRow(int rowIndex) { List<List<Integer>> cal = new ArrayList<>(); List<Integer> first = new ArrayList<>(); first.add(1); if(rowIndex<=0){ return first; } cal.add(first); for(int i=2;i<=rowIndex+1;i++){ List<Integer> tmp = new ArrayList<>(); tmp.add(1); for(int j=0;j<first.size()-1;j++){ tmp.add(first.get(j)+first.get(j+1)); } tmp.add(1); cal.add(tmp); first=tmp; } return first; } }
[ "rhfpdk92@naver.com" ]
rhfpdk92@naver.com
789913000bb6c613b010f8103d509f36d4a30ec9
f2e744082c66f270d606bfc19d25ecb2510e337c
/sources/androidx/core/app/ActivityCompat.java
44fc1c7e227d915020da58bac76c88beef9e3e5e
[]
no_license
AshutoshSundresh/OnePlusSettings-Java
365c49e178612048451d78ec11474065d44280fa
8015f4badc24494c3931ea99fb834bc2b264919f
refs/heads/master
2023-01-22T12:57:16.272894
2020-11-21T16:30:18
2020-11-21T16:30:18
314,854,903
4
2
null
null
null
null
UTF-8
Java
false
false
3,896
java
package androidx.core.app; import android.app.Activity; import android.content.Intent; import android.content.IntentSender; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; import androidx.core.content.ContextCompat; import java.util.Arrays; public class ActivityCompat extends ContextCompat { private static PermissionCompatDelegate sDelegate; public interface OnRequestPermissionsResultCallback { void onRequestPermissionsResult(int i, String[] strArr, int[] iArr); } public interface PermissionCompatDelegate { boolean requestPermissions(Activity activity, String[] strArr, int i); } public interface RequestPermissionsRequestCodeValidator { void validateRequestPermissionsRequestCode(int i); } public static void startActivityForResult(Activity activity, Intent intent, int i, Bundle bundle) { if (Build.VERSION.SDK_INT >= 16) { activity.startActivityForResult(intent, i, bundle); } else { activity.startActivityForResult(intent, i); } } public static void startIntentSenderForResult(Activity activity, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException { if (Build.VERSION.SDK_INT >= 16) { activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle); } else { activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4); } } public static void finishAffinity(Activity activity) { if (Build.VERSION.SDK_INT >= 16) { activity.finishAffinity(); } else { activity.finish(); } } public static void requestPermissions(final Activity activity, final String[] strArr, final int i) { PermissionCompatDelegate permissionCompatDelegate = sDelegate; if (permissionCompatDelegate == null || !permissionCompatDelegate.requestPermissions(activity, strArr, i)) { for (String str : strArr) { if (TextUtils.isEmpty(str)) { throw new IllegalArgumentException("Permission request for permissions " + Arrays.toString(strArr) + " must not contain null or empty values"); } } if (Build.VERSION.SDK_INT >= 23) { if (activity instanceof RequestPermissionsRequestCodeValidator) { ((RequestPermissionsRequestCodeValidator) activity).validateRequestPermissionsRequestCode(i); } activity.requestPermissions(strArr, i); } else if (activity instanceof OnRequestPermissionsResultCallback) { new Handler(Looper.getMainLooper()).post(new Runnable() { /* class androidx.core.app.ActivityCompat.AnonymousClass1 */ public void run() { int[] iArr = new int[strArr.length]; PackageManager packageManager = activity.getPackageManager(); String packageName = activity.getPackageName(); int length = strArr.length; for (int i = 0; i < length; i++) { iArr[i] = packageManager.checkPermission(strArr[i], packageName); } ((OnRequestPermissionsResultCallback) activity).onRequestPermissionsResult(i, strArr, iArr); } }); } } } public static void recreate(Activity activity) { if (Build.VERSION.SDK_INT >= 28) { activity.recreate(); } else if (!ActivityRecreator.recreate(activity)) { activity.recreate(); } } }
[ "ashutoshsundresh@gmail.com" ]
ashutoshsundresh@gmail.com
d8c41eeca3193fb69321aa65c879590cc9335c64
88c841a7e3433b0afbefa4d95f8d06f38484fbbf
/lecshop_base_modules/lecshop_system/src/main/java/com/lecshop/storemenu/service/StoreMenuService.java
c3347b1148d775cd1b4efb74b5e8c23f15e74f39
[]
no_license
chocoai/Shop_V2
751ebe841b979260d5f2a4718d06be86f04543bd
c2d8b2fb17727539e4bcaf5d1dfce15716197ba5
refs/heads/master
2020-04-14T19:29:51.673436
2017-11-01T04:25:10
2017-11-01T04:38:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
858
java
package com.lecshop.storemenu.service; import com.lecshop.storemenu.bean.StoreMenu; import java.util.List; /** * @author sunluyang on 2017/6/7. */ public interface StoreMenuService { /** * 根据管理员id查询菜单 * * @param customerId 会员id * @return 管理员菜单实体类 */ List<StoreMenu> queryStoreMenu(Long customerId); /** * 根据管理员id所有菜单 * * @param customerId 会员id * @return 管理员菜单实体类 */ List<StoreMenu> queryAllStoreMenu(Long customerId); /** * 根据管理员id查询菜单-公共方法 * * @param customerId 会员id * @param isMenu 是否是用于后台菜单 * @return 管理员菜单实体类 递归返回一级 */ List<StoreMenu> storeMenuCommon(Long customerId, boolean isMenu); }
[ "Sun_Masily@163.com" ]
Sun_Masily@163.com
d8363611864c6b96587a024d1e30d8ba10f1b5bd
86b55c5bfd3cbce99db30907ecc63c0038b0f1e2
/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogHelper.java
c03e85b59c59bf2683eccba67bc83225cb6e14c8
[ "BSD-3-Clause" ]
permissive
Claw-Lang/chromium
3ed8160ea3f2b5d51fdc2a7d764aadd5b443eb3f
651cebac57fcd0ce2c7c974494602cc098fe7348
refs/heads/master
2022-11-19T07:46:03.573023
2020-07-28T06:45:27
2020-07-28T06:45:27
283,134,740
1
0
BSD-3-Clause
2020-07-28T07:26:49
2020-07-28T07:26:48
null
UTF-8
Java
false
false
6,318
java
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.download.dialogs; import android.content.Context; import androidx.annotation.IntDef; import androidx.annotation.Nullable; import org.chromium.base.Callback; import org.chromium.chrome.browser.download.DownloadLaterMetrics; import org.chromium.chrome.browser.download.DownloadLaterMetrics.DownloadLaterUiEvent; import org.chromium.components.offline_items_collection.OfflineItemSchedule; import org.chromium.components.prefs.PrefService; import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.ui.modelutil.PropertyModel; /** * A wrapper of {@link DownloadLaterDialogCoordinator}, always use the same Android {@link Context} * and relevant dependencies, and supports to show dialog based on a {@link * org.chromium.components.offline_items_collection.OfflineItem}. */ public class DownloadLaterDialogHelper implements DownloadLaterDialogController { /** * Defines the caller of {@link DownloadLaterDialogHelper}. Used in metrics recording. */ @IntDef({Source.DOWNLOAD_HOME, Source.DOWNLOAD_INFOBAR}) public @interface Source { int DOWNLOAD_HOME = 0; int DOWNLOAD_INFOBAR = 1; } private final Context mContext; private final ModalDialogManager mModalDialogManager; private final PrefService mPrefService; private final DownloadLaterDialogCoordinator mDownloadLaterDialog; private Callback<OfflineItemSchedule> mCallback; private @Source int mSource; /** * Creates the download later dialog helper. * @param context The {@link Context} associated with the dialog. * @param manager The {@link ModalDialogManager} to show the modal dialog. * @param prefService Used to update user preferences. * @return The download later dialog helper. */ public static DownloadLaterDialogHelper create( Context context, ModalDialogManager manager, PrefService prefService) { DownloadDateTimePickerDialog dateTimePicker = new DownloadDateTimePickerDialogImpl(); DownloadLaterDialogCoordinator dialog = new DownloadLaterDialogCoordinator(dateTimePicker); dateTimePicker.initialize(dialog); return new DownloadLaterDialogHelper(context, manager, prefService, dialog); } DownloadLaterDialogHelper(Context context, ModalDialogManager manager, PrefService prefService, DownloadLaterDialogCoordinator downloadLaterDialog) { mContext = context; mModalDialogManager = manager; mPrefService = prefService; mDownloadLaterDialog = downloadLaterDialog; mDownloadLaterDialog.initialize(this); } /** * Shows a download later dialog when the user wants to change the {@link OfflineItemSchedule}. * @param currentSchedule The current {@link OfflineItemSchedule}. * @param source The caller of this function, used to collect metrics. * @param callback The callback to reply the new schedule selected by the user. May reply null * if the user cancels the dialog. */ public void showChangeScheduleDialog(@Nullable final OfflineItemSchedule currentSchedule, @Source int source, Callback<OfflineItemSchedule> callback) { @DownloadLaterDialogChoice int initialChoice = DownloadLaterDialogChoice.DOWNLOAD_NOW; if (currentSchedule != null) { initialChoice = currentSchedule.onlyOnWifi ? DownloadLaterDialogChoice.ON_WIFI : DownloadLaterDialogChoice.DOWNLOAD_LATER; } mCallback = callback; mSource = source; PropertyModel model = new PropertyModel.Builder(DownloadLaterDialogProperties.ALL_KEYS) .with(DownloadLaterDialogProperties.CONTROLLER, mDownloadLaterDialog) .with(DownloadLaterDialogProperties.DOWNLOAD_TIME_INITIAL_SELECTION, initialChoice) .build(); mDownloadLaterDialog.showDialog(mContext, mModalDialogManager, mPrefService, model); } /** * Destroys the download later dialog. */ public void destroy() { mDownloadLaterDialog.destroy(); } // DownloadLaterDialogController implementation. @Override public void onDownloadLaterDialogComplete(int choice, long startTime) { if (mCallback == null) return; recordDialogMetrics(true /*complete*/, choice); OfflineItemSchedule schedule = new OfflineItemSchedule(choice == DownloadLaterDialogChoice.ON_WIFI, startTime); mCallback.onResult(schedule); mCallback = null; } @Override public void onDownloadLaterDialogCanceled() { if (mCallback == null) return; recordDialogMetrics(false /*complete*/, -1); mCallback.onResult(null); mCallback = null; } @Override public void onEditLocationClicked() { // Do nothing, no edit location text for the change schedule dialog. } // Collect complete or cancel metrics based on the source of the dialog. private void recordDialogMetrics(boolean complete, @DownloadLaterDialogChoice int choice) { switch (mSource) { case Source.DOWNLOAD_HOME: if (complete) { DownloadLaterMetrics.recordDownloadHomeChangeScheduleChoice(choice); } else { DownloadLaterMetrics.recordDownloadLaterUiEvent( DownloadLaterUiEvent.DOWNLOAD_HOME_CHANGE_SCHEDULE_CANCEL); } break; case Source.DOWNLOAD_INFOBAR: if (complete) { DownloadLaterMetrics.recordInfobarChangeScheduleChoice(choice); } else { DownloadLaterMetrics.recordDownloadLaterUiEvent( DownloadLaterUiEvent.DOWNLOAD_INFOBAR_CHANGE_SCHEDULE_CANCEL); } break; default: assert false : "Unknown source, can't collect metrics."; return; } } }
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
332239a419c0954b40ac8a900b394805446547f5
36838dfcd53c4d2c73b9a6b0b7a8a28e4a331517
/cn/com/smartdevices/bracelet/weight/family/UserInfoActivity.java
a2bcd3f4291eebda1552c640271ba9b376f57390
[]
no_license
ShahmanTeh/MiFit-Java
fbb2fd578727131b9ac7150b86c4045791368fe8
93bdf88d39423893b294dec2f5bf54708617b5d0
refs/heads/master
2021-01-20T13:05:10.408158
2016-02-03T21:02:55
2016-02-03T21:02:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,480
java
package cn.com.smartdevices.bracelet.weight.family; import android.app.FragmentTransaction; import android.content.Intent; import android.os.Bundle; import cn.com.smartdevices.bracelet.C0596r; import cn.com.smartdevices.bracelet.ui.SystemBarTintActivity; import cn.com.smartdevices.bracelet.weight.J; public class UserInfoActivity extends SystemBarTintActivity { private static final String a = UserInfoActivity.class.getSimpleName(); private int b = -1; private h c; protected void onActivityResult(int i, int i2, Intent intent) { super.onActivityResult(i, i2, intent); h hVar = (h) getFragmentManager().findFragmentByTag(h.class.getName()); if (hVar != null) { hVar.onActivityResult(i, i2, intent); } } protected void onCreate(Bundle bundle) { super.onCreate(bundle); if (getIntent() != null) { this.b = getIntent().getIntExtra(MemberInfoBaseActivity.b, -1); C0596r.e(a, "UserInfoActivity receive the infomation uid " + this.b); C0596r.e(a, "userinfo " + J.a().a(this.b).toString()); } this.c = (h) h.a(this.b); FragmentTransaction beginTransaction = getFragmentManager().beginTransaction(); beginTransaction.add(16908290, this.c, h.class.getName()); beginTransaction.commit(); } protected void onPause() { super.onPause(); } protected void onResume() { super.onResume(); } }
[ "kasha_malaga@hotmail.com" ]
kasha_malaga@hotmail.com
07100b241dd0112099cd15a1899dcb94cd1b98e8
534409d21c3bb5e80983b4836fb8e2fcf931bd26
/app/src/main/java/com/nilhcem/droidconit/ui/schedule/pager/SchedulePagerPresenter.java
7c275a522c17925d6b513be7debf1e99e9c6c5d4
[ "Apache-2.0" ]
permissive
Nilhcem/droidconit-2016
76701403d56849069003f9e5af53050f82a39ba6
b5feb0807f500cccf1168e50d5aa01af17496995
refs/heads/master
2016-08-12T15:59:11.490731
2016-04-07T19:34:25
2016-04-07T19:34:25
53,884,862
0
1
null
null
null
null
UTF-8
Java
false
false
1,924
java
package com.nilhcem.droidconit.ui.schedule.pager; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import com.nilhcem.droidconit.data.app.DataProvider; import com.nilhcem.droidconit.data.app.model.Schedule; import com.nilhcem.droidconit.ui.BaseFragmentPresenter; import icepick.State; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; import timber.log.Timber; public class SchedulePagerPresenter extends BaseFragmentPresenter<SchedulePagerView> { @State Schedule schedule; private final DataProvider dataProvider; private Subscription scheduleSubscription; public SchedulePagerPresenter(SchedulePagerView view, DataProvider dataProvider) { super(view); this.dataProvider = dataProvider; } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (schedule == null) { loadData(); } else { this.view.displaySchedule(schedule); } } public void reloadData() { loadData(); } @Override public void onStop() { if (scheduleSubscription != null) { scheduleSubscription.unsubscribe(); } super.onStop(); } private void loadData() { scheduleSubscription = dataProvider.getSchedule() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(scheduleDays -> { schedule = scheduleDays; view.displaySchedule(schedule); }, throwable -> Timber.e(throwable, "Error getting schedule"), () -> { if (schedule == null) { view.displayLoadingError(); } }); } }
[ "nilhcem@gmail.com" ]
nilhcem@gmail.com
96c4ff748e043bf9b09ac60214c9ed9ef8a63d62
3fc7c3d4a697c418bad541b2ca0559b9fec03db7
/TestResult/javasource/uk/co/senab/photoview/scrollerproxy/PreGingerScroller.java
014325405a31164799ce4ce3315358e69ad182e1
[]
no_license
songxingzai/APKAnalyserModules
59a6014350341c186b7788366de076b14b8f5a7d
47cf6538bc563e311de3acd3ea0deed8cdede87b
refs/heads/master
2021-12-15T02:43:05.265839
2017-07-19T14:44:59
2017-07-19T14:44:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,011
java
package uk.co.senab.photoview.scrollerproxy; import android.content.Context; import android.widget.Scroller; public class PreGingerScroller extends ScrollerProxy { private final Scroller mScroller; public PreGingerScroller(Context paramContext) { mScroller = new Scroller(paramContext); } public boolean computeScrollOffset() { return mScroller.computeScrollOffset(); } public void fling(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10) { mScroller.fling(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, paramInt8); } public void forceFinished(boolean paramBoolean) { mScroller.forceFinished(paramBoolean); } public int getCurrX() { return mScroller.getCurrX(); } public int getCurrY() { return mScroller.getCurrY(); } public boolean isFinished() { return mScroller.isFinished(); } }
[ "leehdsniper@gmail.com" ]
leehdsniper@gmail.com
be705998cc47a194bd3627bc629d3b6c98e6dc02
ddf24b280c71259c5500d66b156f73812e1e7d6f
/app/src/main/java/home/smart/fly/animations/activity/WXGalleryActivity.java
22ddb3a13363cdb0c833504eb367e9db2d98a506
[ "Apache-2.0" ]
permissive
MnyZhao/AndroidAnimationExercise
70b424e11c1f35ab693f6551ff43c54b15bb73b5
c8d1434eb1777515a27d8d7e6610fce7f51e1625
refs/heads/master
2021-01-01T04:42:22.683876
2017-07-14T00:42:50
2017-07-14T00:42:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package home.smart.fly.animations.activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import home.smart.fly.animations.R; public class WXGalleryActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_wxgallery); } }
[ "foreverlove.zyl@163.com" ]
foreverlove.zyl@163.com
7899cd6a0b3bfa4afa602401b9876b81f65d5b08
e3e348f7732cf0a45b73628a51c54d7777690d0a
/src/main/java/shift/sextiarysector/item/ItemMineboat.java
5f159b5b7d4431506f53fe39a63a0f0418888c54
[]
no_license
shift02/SextiarySector2
cf89a03527cebd8a605c787e6d547f4ede5a8bde
79a78d3008f573a52de87bcf9f828c121b8038ce
refs/heads/master
2021-12-12T21:18:21.553111
2017-09-05T14:47:11
2017-09-05T14:47:11
25,522,254
10
16
null
2016-06-04T00:56:52
2014-10-21T12:56:47
Java
UTF-8
Java
false
false
4,414
java
package shift.sextiarysector.item; import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; import shift.sextiarysector.api.SextiarySectorAPI; import shift.sextiarysector.entity.EntityMineboat; import shift.sextiarysector.entity.EntityMineboatChest; public class ItemMineboat extends Item { public ItemMineboat() { super(); this.maxStackSize = 1; this.setCreativeTab(SextiarySectorAPI.TabSSTransport); } @Override public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { float f = 1.0F; float f1 = p_77659_3_.prevRotationPitch + (p_77659_3_.rotationPitch - p_77659_3_.prevRotationPitch) * f; float f2 = p_77659_3_.prevRotationYaw + (p_77659_3_.rotationYaw - p_77659_3_.prevRotationYaw) * f; double d0 = p_77659_3_.prevPosX + (p_77659_3_.posX - p_77659_3_.prevPosX) * f; double d1 = p_77659_3_.prevPosY + (p_77659_3_.posY - p_77659_3_.prevPosY) * f + 1.62D - p_77659_3_.yOffset; double d2 = p_77659_3_.prevPosZ + (p_77659_3_.posZ - p_77659_3_.prevPosZ) * f; Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); float f5 = -MathHelper.cos(-f1 * 0.017453292F); float f6 = MathHelper.sin(-f1 * 0.017453292F); float f7 = f4 * f5; float f8 = f3 * f5; double d3 = 5.0D; Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); MovingObjectPosition movingobjectposition = p_77659_2_.rayTraceBlocks(vec3, vec31, true); if (movingobjectposition == null) { return p_77659_1_; } else { Vec3 vec32 = p_77659_3_.getLook(f); boolean flag = false; float f9 = 1.0F; List list = p_77659_2_.getEntitiesWithinAABBExcludingEntity(p_77659_3_, p_77659_3_.boundingBox.addCoord(vec32.xCoord * d3, vec32.yCoord * d3, vec32.zCoord * d3).expand(f9, f9, f9)); int i; for (i = 0; i < list.size(); ++i) { Entity entity = (Entity) list.get(i); if (entity.canBeCollidedWith()) { float f10 = entity.getCollisionBorderSize(); AxisAlignedBB axisalignedbb = entity.boundingBox.expand(f10, f10, f10); if (axisalignedbb.isVecInside(vec3)) { flag = true; } } } if (flag) { return p_77659_1_; } else { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; if (p_77659_2_.getBlock(i, j, k) == Blocks.snow_layer) { --j; } EntityMineboat entityboat = this.createMineboat(p_77659_2_, i, j, k);//new EntityMineboatChest(p_77659_2_, i + 0.5F, j + 1.0F, k + 0.5F); entityboat.rotationYaw = ((MathHelper.floor_double(p_77659_3_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) - 1) * 90; if (!p_77659_2_.getCollidingBoundingBoxes(entityboat, entityboat.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) { return p_77659_1_; } if (!p_77659_2_.isRemote) { p_77659_2_.spawnEntityInWorld(entityboat); } if (!p_77659_3_.capabilities.isCreativeMode) { --p_77659_1_.stackSize; } } return p_77659_1_; } } } public EntityMineboat createMineboat(World par1World, double par2, double par4, double par6) { return new EntityMineboatChest(par1World, par2 + 0.5F, par4 + 1.0F, par6 + 0.5F); } }
[ "shift02ss@gmail.com" ]
shift02ss@gmail.com
ba2957d6358667618423399552fa44279e4141d3
ba005c6729aed08554c70f284599360a5b3f1174
/lib/selenium-server-standalone-3.4.0/org/apache/xerces/xs/XSFacet.java
a484ae95c15583e081e99272f7615264227f1160
[]
no_license
Viral-patel703/Testyourbond-aut0
f6727a6da3b1fbf69cc57aeb89e15635f09e249a
784ab7a3df33d0efbd41f3adadeda22844965a56
refs/heads/master
2020-08-09T00:27:26.261661
2017-11-07T10:12:05
2017-11-07T10:12:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package org.apache.xerces.xs; public abstract interface XSFacet extends XSObject { public abstract short getFacetKind(); public abstract String getLexicalFacetValue(); public abstract int getIntFacetValue(); public abstract Object getActualFacetValue(); public abstract boolean getFixed(); public abstract XSAnnotation getAnnotation(); public abstract XSObjectList getAnnotations(); }
[ "VIRUS-inside@users.noreply.github.com" ]
VIRUS-inside@users.noreply.github.com
a7c79dd239cbf6e47457fefbb89f3769c80069f0
c474b03758be154e43758220e47b3403eb7fc1fc
/apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/google/android/gms/internal/afr.java
b0b95025d349c7e908fdd664734aebbe954c9010
[]
no_license
EstebanDalelR/tinderAnalysis
f80fe1f43b3b9dba283b5db1781189a0dd592c24
941e2c634c40e5dbf5585c6876ef33f2a578b65c
refs/heads/master
2020-04-04T09:03:32.659099
2018-11-23T20:41:28
2018-11-23T20:41:28
155,805,042
0
0
null
2018-11-18T16:02:45
2018-11-02T02:44:34
null
UTF-8
Java
false
false
2,536
java
package com.google.android.gms.internal; import android.content.Context; import com.google.android.gms.ads.internal.ar; import com.google.android.gms.ads.internal.gmsg.ab; import com.google.android.gms.ads.internal.gmsg.zzt; import com.google.android.gms.ads.internal.js.C2388t; import com.google.android.gms.ads.internal.js.C4272a; import com.google.android.gms.ads.internal.js.zzaj; import org.json.JSONObject; @zzzv public final class afr implements zzgo { /* renamed from: a */ private final afe f22918a; /* renamed from: b */ private final Context f22919b; /* renamed from: c */ private final ab f22920c; /* renamed from: d */ private C4272a f22921d; /* renamed from: e */ private boolean f22922e; /* renamed from: f */ private final zzt<zzaj> f22923f = new afw(this); /* renamed from: g */ private final zzt<zzaj> f22924g = new afx(this); /* renamed from: h */ private final zzt<zzaj> f22925h = new afy(this); /* renamed from: i */ private final zzt<zzaj> f22926i = new afz(this); public afr(afe afe, C2388t c2388t, Context context) { this.f22918a = afe; this.f22919b = context; this.f22920c = new ab(this.f22919b); this.f22921d = c2388t.b(null); this.f22921d.zza(new afs(this), new aft(this)); String str = "Core JS tracking ad unit: "; String valueOf = String.valueOf(this.f22918a.f15127a.m19074d()); hx.m19911b(valueOf.length() != 0 ? str.concat(valueOf) : new String(str)); } /* renamed from: a */ final void m27082a(zzaj zzaj) { zzaj.zza("/updateActiveView", this.f22923f); zzaj.zza("/untrackActiveViewUnit", this.f22924g); zzaj.zza("/visibilityChanged", this.f22925h); if (ar.z().m19598a(this.f22919b)) { zzaj.zza("/logScionEvent", this.f22926i); } } /* renamed from: b */ final void m27083b(zzaj zzaj) { zzaj.zzb("/visibilityChanged", this.f22925h); zzaj.zzb("/untrackActiveViewUnit", this.f22924g); zzaj.zzb("/updateActiveView", this.f22923f); if (ar.z().m19598a(this.f22919b)) { zzaj.zzb("/logScionEvent", this.f22926i); } } public final void zzb(JSONObject jSONObject, boolean z) { this.f22921d.zza(new afu(this, jSONObject), new iy()); } public final boolean zzgg() { return this.f22922e; } public final void zzgh() { this.f22921d.zza(new afv(this), new iy()); this.f22921d.a(); } }
[ "jdguzmans@hotmail.com" ]
jdguzmans@hotmail.com
7bf6a10e9c858c9cc106a0267bee8bb3a8ac0307
3d0b168c5333cde4b1609b6cdf2870a459a71b68
/src/test/java/com/cybertek/utilities/FailPassContains.java
563424fd87cd865f08f31bb5bb709060f8a8a028
[]
no_license
YusufKucukvatan/SeleniumBasics
1383f1dc0e0a7c6eb4cf0741834b833cdbe45ad1
6a2de7f956d496090243a1ceda2e8cc4c74097b8
refs/heads/master
2023-05-10T04:26:29.024814
2020-02-22T18:37:55
2020-02-22T18:37:55
217,621,163
0
0
null
2023-05-09T18:37:37
2019-10-25T22:05:37
Java
UTF-8
Java
false
false
427
java
package com.cybertek.utilities; public class FailPassContains { public static void failPass(String actual, String expected) { if (actual.toLowerCase().contains(expected.toLowerCase())) { System.out.println("PASS"); } else { System.out.println("FAIL"); System.out.println("actual = " + actual); System.out.println("expected = " + expected); } } }
[ "yusuf@kucukvatan.com" ]
yusuf@kucukvatan.com
29eb311960452818108f86e79c8827a8d007275f
85ce3a70a4bcfb824833053a2d5ab78e5870dc4d
/IdeaProjects/wms/src/main/java/cn/wolfcode/wms/service/ISupplierService.java
b6069ccb0f98b1f62e27c6075226a4ad6f6f7e74
[]
no_license
qyl1006/Hello_World
87e4aef81874cef1ddd5cd0d7278ac56c8f8bb19
be81d9e957d4e81e3d2097ac7ab9ae7ba1a620af
refs/heads/master
2020-03-08T03:14:44.053205
2018-05-18T02:31:16
2018-05-18T02:31:16
127,881,971
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package cn.wolfcode.wms.service; import cn.wolfcode.wms.domain.Supplier; import cn.wolfcode.wms.query.PageResult; import cn.wolfcode.wms.query.QueryObject; import java.util.List; public interface ISupplierService { void insertOrUpdate(Supplier entity); void deleteById(Long id); Supplier getById(Long id); List<Supplier> listAll(); //分页 PageResult queryAll(QueryObject qo); }
[ "yuelinshi@qq.com" ]
yuelinshi@qq.com
aa6606f582b061f091dd1c6d4eb96b2b36d7d165
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/game/luggage/b/p.java
d6c0613676f56b297ccd5ae75f4e4116faf0bc33
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
4,803
java
package com.tencent.mm.plugin.game.luggage.b; import android.content.Context; import com.tencent.luggage.d.b; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.plugin.game.luggage.page.GameWebPage; import com.tencent.mm.plugin.webview.luggage.jsapi.bv.a; import com.tencent.mm.plugin.webview.luggage.jsapi.bw; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.WeChatEnvironment; import org.json.JSONException; import org.json.JSONObject; public class p extends bw<GameWebPage> { public final void a(Context paramContext, String paramString, bv.a parama) { AppMethodBeat.i(277145); paramContext = new JSONObject(); try { paramString = com.tencent.mm.plugin.webview.luggage.c.c.ZL(paramString); if ((paramString == null) || (!paramString.has("appId"))) { Log.w("MicroMsg.JsApiGetLiteAppSwitch", "invalid appId"); paramContext.put("switch", false); parama.j(null, paramContext); AppMethodBeat.o(277145); return; } localObject = paramString.getString("appId"); bool3 = ((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).aJT((String)localObject); if (WeChatEnvironment.isCoolassistEnv()) { break label453; } if (!bool3) { break label404; } } catch (JSONException paramString) { for (;;) { Object localObject; boolean bool3; StringBuilder localStringBuilder; int i; label285: label307: Log.printErrStackTrace("MicroMsg.JsApiGetLiteAppSwitch", paramString, "", new Object[0]); label404: label416: label422: continue; continue; boolean bool2 = true; continue; boolean bool1 = true; } } Log.i("MicroMsg.JsApiGetLiteAppSwitch", "isLiteAppCanOpen value: %s", new Object[] { Boolean.valueOf(bool3) }); if ((paramString != null) && (paramString.has("needPkg"))) { bool2 = paramString.getBoolean("needPkg"); paramString = ((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).et((String)localObject); com.tencent.mm.plugin.report.service.h.OAn.p(1293L, 80L, 1L); if (bool1) { com.tencent.mm.plugin.report.service.h.OAn.p(1293L, 81L, 1L); if (paramString == null) { if (((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).fTU() == null) { ((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).fTS(); } ((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).a((String)localObject, null); if (bool2) { com.tencent.mm.plugin.report.service.h.OAn.p(1293L, 82L, 1L); bool1 = false; localStringBuilder = new StringBuilder(); localObject = localStringBuilder.append((String)localObject).append(","); if (bool2) { i = 1; localObject = ((StringBuilder)localObject).append(i).append(","); if (!bool1) { break label416; } i = 1; ((StringBuilder)localObject).append(i); com.tencent.mm.plugin.report.service.h.OAn.kvStat(20982, localStringBuilder.toString()); localStringBuilder = new StringBuilder("debug:false, coolassist:").append(WeChatEnvironment.isCoolassistEnv()).append(", enable:").append(bool3).append(",info:"); if (paramString != null) { break label422; } } for (bool2 = true;; bool2 = false) { Log.i("MicroMsg.JsApiGetLiteAppSwitch", bool2); paramContext.put("switch", bool1); parama.j(null, paramContext); AppMethodBeat.o(277145); return; bool1 = false; break; i = 0; break label285; i = 0; break label307; } } } } } } public final void b(b<GameWebPage>.a paramb) {} public final int dgI() { return 1; } public final String name() { return "getLiteAppSwitch"; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.plugin.game.luggage.b.p * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
68487babdf6b9dca4968321fe3faa5c91dd4c729
82eba08b9a7ee1bd1a5f83c3176bf3c0826a3a32
/ZmailSoap/src/java/org/zmail/soap/sync/type/DeviceId.java
99f6466468c76a3881df9c7a1b961c384e083ed8
[ "MIT" ]
permissive
keramist/zmailserver
d01187fb6086bf3784fe180bea2e1c0854c83f3f
762642b77c8f559a57e93c9f89b1473d6858c159
refs/heads/master
2021-01-21T05:56:25.642425
2013-10-21T11:27:05
2013-10-22T12:48:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,571
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2011, 2012 VMware, Inc. * * The contents of this file are subject to the Zimbra Public License * Version 1.3 ("License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.zimbra.com/license. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * ***** END LICENSE BLOCK ***** */ package org.zmail.soap.sync.type; import com.google.common.base.Objects; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import org.zmail.common.soap.SyncConstants; @XmlAccessorType(XmlAccessType.NONE) public class DeviceId { /** * @zm-api-field-tag device-id * @zm-api-field-description device ID */ @XmlAttribute(name=SyncConstants.A_ID /* id */, required=true) private final String id; /** * no-argument constructor wanted by JAXB */ @SuppressWarnings("unused") private DeviceId() { this((String) null); } public DeviceId(String id) { this.id = id; } public String getId() { return id; } public Objects.ToStringHelper addToStringInfo(Objects.ToStringHelper helper) { return helper.add("id", id); } @Override public String toString() { return addToStringInfo(Objects.toStringHelper(this)).toString(); } }
[ "bourgerie.quentin@gmail.com" ]
bourgerie.quentin@gmail.com
78d5c2313ddeb5e5116973371b62a657405e1daa
1ca86d5d065372093c5f2eae3b1a146dc0ba4725
/spring-exceptions/src/test/java/com/surya/ex/nosuchbeandefinitionexception/Cause3NoSuchBeanDefinitionExceptionManualTest.java
b0267ff085a524b5244c18b2448b90c0dfa2902d
[]
no_license
Suryakanta97/DemoExample
1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e
5c6b831948e612bdc2d9d578a581df964ef89bfb
refs/heads/main
2023-08-10T17:30:32.397265
2021-09-22T16:18:42
2021-09-22T16:18:42
391,087,435
0
1
null
null
null
null
UTF-8
Java
false
false
726
java
package com.surya.ex.nosuchbeandefinitionexception; import com.surya.ex.nosuchbeandefinitionexception.spring.Cause3ContextWithJavaConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { Cause3ContextWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class) public class Cause3NoSuchBeanDefinitionExceptionManualTest { @Test public final void givenContextIsInitialized_thenNoException() { // } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
8458acc8ade54ec4d1a9f629d6baaa91e4dd4e9e
d937646fcd3ba303cab55d729cf7f2a8d8a93c83
/app/src/main/java/zhuyekeji/zhengzhou/jxlifecircle/widget/MyAppTitle.java
fa812c5e6aafa2376578fff6fbf09ce13bacadd6
[]
no_license
jingzhixb/jxlifecircle
7e2e61ba3c0207ba547ff2bb228589a402df8121
5247754504d92383fb93f5bda60e03766d84ecce
refs/heads/master
2020-03-19T20:34:15.281494
2018-07-23T12:03:54
2018-07-23T12:03:54
136,907,546
0
0
null
null
null
null
UTF-8
Java
false
false
5,536
java
package zhuyekeji.zhengzhou.jxlifecircle.widget; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import zhuyekeji.zhengzhou.jxlifecircle.R; /** * App通用titleBar **/ public class MyAppTitle extends LinearLayout { private OnLeftButtonClickListener mLeftButtonClickListener; private OnRightButtonClickListener mRightButtonClickListener; private MyViewHolder mViewHolder; private View viewAppTitle; public MyAppTitle(Context context) { super(context); init(); } public MyAppTitle(Context context, AttributeSet attrs) { super(context, attrs); init(); } @TargetApi(Build.VERSION_CODES.HONEYCOMB) public MyAppTitle(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init() { LayoutInflater inflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); viewAppTitle = inflater.inflate(R.layout.common_title_bar, null); this.addView(viewAppTitle, layoutParams); mViewHolder = new MyViewHolder(this); mViewHolder.llLeftGoBack.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (isFastDoubleClick()) { return; } if (mLeftButtonClickListener != null) { mLeftButtonClickListener.onLeftButtonClick(v); } } }); mViewHolder.llRight.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (isFastDoubleClick()) { return; } if (mRightButtonClickListener != null) { mRightButtonClickListener.OnRightButtonClick(v); } } }); } public void initViewsVisible(boolean isLeftButtonVisile, boolean isCenterTitleVisile, boolean isRightIconVisile, boolean isRightTitleVisile) { // 左侧返回 mViewHolder.llLeftGoBack.setVisibility(isLeftButtonVisile ? View.VISIBLE : View.INVISIBLE); // 中间标题 mViewHolder.tvCenterTitle.setVisibility(isCenterTitleVisile ? View.VISIBLE : View.INVISIBLE); // 右侧返回图标,文字 if (!isRightIconVisile && !isRightTitleVisile) { mViewHolder.llRight.setVisibility(View.INVISIBLE); } else { mViewHolder.llRight.setVisibility(View.VISIBLE); } mViewHolder.ivRightComplete.setVisibility(isRightIconVisile ? View.VISIBLE : View.GONE); mViewHolder.tvRightComplete.setVisibility(isRightTitleVisile ? View.VISIBLE : View.INVISIBLE); } /** * 设置标题 * * @param title */ public void setAppTitle(String title) { mViewHolder.tvCenterTitle.setText(title); } public void setLeftIcon(int sourceId) { mViewHolder.llLeftGoBack.setImageResource(sourceId); } public void setTitleSize(float size) { mViewHolder.tvCenterTitle.setTextSize(size); } public void setRightTitle(String text) { if (!TextUtils.isEmpty(text)) { mViewHolder.tvRightComplete.setText(text); } } public void setRightIcon(int sourceID) { mViewHolder.ivRightComplete.setImageResource(sourceID); } public void setLeftOnclick(OnLeftButtonClickListener mOnLeftButtonClickListener) { if (mOnLeftButtonClickListener != null) { } } public void setAppBackground(int color) { viewAppTitle.setBackgroundColor(color); } public void setOnLeftButtonClickListener(OnLeftButtonClickListener listen) { mLeftButtonClickListener = listen; } public void setOnRightButtonClickListener(OnRightButtonClickListener listen) { mRightButtonClickListener = listen; } public interface OnLeftButtonClickListener { void onLeftButtonClick(View v); } public interface OnRightButtonClickListener { void OnRightButtonClick(View v); } static class MyViewHolder { ImageView llLeftGoBack; TextView tvCenterTitle; RelativeLayout llRight; ImageView ivRightComplete; TextView tvRightComplete; public MyViewHolder(View v) { llLeftGoBack = v.findViewById(R.id.llLeftGoBack); tvCenterTitle = v.findViewById(R.id.tvCenterTitle); llRight = v.findViewById(R.id.llRight); ivRightComplete = v.findViewById(R.id.ivRightComplete); tvRightComplete = v.findViewById(R.id.tvRightComplete); } } // 防止快速点击默认等待时长为900ms private long DELAY_TIME = 900; private static long lastClickTime; private boolean isFastDoubleClick() { long time = System.currentTimeMillis(); long timeD = time - lastClickTime; if (0 < timeD && timeD < DELAY_TIME) { return true; } lastClickTime = time; return false; } }
[ "1390056147qq.com" ]
1390056147qq.com
a56373133fb94091e81bb7be4a67b1b1e6266333
8b6283648c7e81e5313f7ef776457b642202d207
/liveproject_spring_security_project2_milestone2/src/main/java/com/laurentiuspilca/liveproject/exceptions/HealthProfileAlreadyExistsException.java
0f21802518528a149cbed17cca8c29879faf8373
[]
no_license
lspil/liveproject_refactored
d60d8bd8232b436769708400a2b061a4087f512a
486cd62ea1cfe708c96fba4d4ae08b53f783f0c2
refs/heads/master
2023-04-04T15:15:13.223109
2021-04-11T09:14:00
2021-04-11T09:14:00
352,297,018
6
3
null
null
null
null
UTF-8
Java
false
false
219
java
package com.laurentiuspilca.liveproject.exceptions; public class HealthProfileAlreadyExistsException extends RuntimeException { public HealthProfileAlreadyExistsException(String message) { super(message); } }
[ "Laurentiu.Spilca@endava.com" ]
Laurentiu.Spilca@endava.com
2401208f736d6c1cba1a85df14a8470b602bf1a2
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Math-8/org.apache.commons.math3.distribution.DiscreteDistribution/default/22/org/apache/commons/math3/distribution/DiscreteDistribution_ESTest_scaffolding.java
90eb721846464eeef42fded0514ddead8c244b42
[ "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
7,059
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Jul 30 13:49:03 GMT 2021 */ package org.apache.commons.math3.distribution; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class DiscreteDistribution_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 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.apache.commons.math3.distribution.DiscreteDistribution"; 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(); } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); 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() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("user.dir", "/experiment"); java.lang.System.setProperty("java.io.tmpdir", "/tmp"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DiscreteDistribution_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math3.exception.util.ExceptionContextProvider", "org.apache.commons.math3.random.Well44497a", "org.apache.commons.math3.util.MathArrays", "org.apache.commons.math3.random.AbstractWell", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.exception.NotPositiveException", "org.apache.commons.math3.exception.MathInternalError", "org.apache.commons.math3.exception.MathIllegalStateException", "org.apache.commons.math3.random.BitsStreamGenerator", "org.apache.commons.math3.exception.NonMonotonicSequenceException", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.util.Pair", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.distribution.DiscreteDistribution", "org.apache.commons.math3.exception.DimensionMismatchException", "org.apache.commons.math3.exception.util.Localizable", "org.apache.commons.math3.random.Well19937c", "org.apache.commons.math3.exception.NotStrictlyPositiveException", "org.apache.commons.math3.random.RandomGenerator", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.random.Well512a", "org.apache.commons.math3.random.Well19937a" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(DiscreteDistribution_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.math3.distribution.DiscreteDistribution", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.util.Pair", "org.apache.commons.math3.random.BitsStreamGenerator", "org.apache.commons.math3.random.AbstractWell", "org.apache.commons.math3.random.Well19937c", "org.apache.commons.math3.util.MathArrays", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.random.MersenneTwister", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.random.Well19937a", "org.apache.commons.math3.random.Well512a", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.exception.NotPositiveException", "org.apache.commons.math3.random.SynchronizedRandomGenerator", "org.apache.commons.math3.random.Well1024a", "org.apache.commons.math3.random.Well44497a", "org.apache.commons.math3.random.ISAACRandom", "org.apache.commons.math3.random.Well44497b", "org.apache.commons.math3.random.RandomAdaptor", "org.apache.commons.math3.util.FastMathLiteralArrays", "org.apache.commons.math3.util.FastMath$lnMant", "org.apache.commons.math3.util.FastMath$CodyWaite", "org.apache.commons.math3.exception.NotStrictlyPositiveException", "org.apache.commons.math3.random.JDKRandomGenerator" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
13070b34221cd7edbce9d40cac404259cb778b01
4abd603f82fdfa5f5503c212605f35979b77c406
/html/Programs/hw4-diff/b03611033-191-0/Diff.java
af8d6b5bb52b1ec7bf47324da517ece6121fe7f5
[]
no_license
dn070017/1042-PDSA
b23070f51946c8ac708d3ab9f447ab8185bd2a34
5e7d7b1b2c9d751a93de9725316aa3b8f59652e6
refs/heads/master
2020-03-20T12:13:43.229042
2018-06-15T01:00:48
2018-06-15T01:00:48
137,424,305
0
0
null
null
null
null
UTF-8
Java
false
false
3,539
java
import java.util.Iterator; import java.util.NoSuchElementException; public class Deque<Item> implements Iterable<Item> { private int N; private Node first, last; private Node oldlast, oldfirst; private class Node { Item item; Node next; } public Deque() { // construct an empty deque first = null; last = null; N = 0; } public boolean isEmpty() { // is the deque empty? return first == null; } public int size() { // return the number of items on the deque return N; } public void addLast(Item item) { // add the item to the end if (item == null) { throw new NullPointerException(); } else { oldlast = last; last = new Node(); last.item = item; last.next = null; if (isEmpty()) { first = last; } else { oldlast.next = last; } N++; } } public void addFirst(Item item) { // add the item to the front if (item == null) { throw new NullPointerException(); } else { oldfirst = first; if (isEmpty()) { first = new Node(); first.item = item; last = first; } else { first = new Node(); first.item = item; first.next = oldfirst; } N++; } } public Item removeFirst() { // remove and return the item from the front if (isEmpty()) { throw new NoSuchElementException(); } else { Item item; item = first.item; first = first.next; N--; return item; } } public Item removeLast() { // remove and return the item from the end if (isEmpty()) { throw new NoSuchElementException(); } else { Item item; item = last.item; last = oldlast; N--; return item; } } public Iterator<Item> iterator() { // return an iterator over items in order from front to end return (Iterator<Item>) new ListIterator(); } private class ListIterator implements Iterable<Item> { private Node current = first; public boolean hasNext() { return current != null; } public void remove() { throw new UnsupportedOperationException(); } public Item Next() { Item item = current.item; if (hasNext()) { current = current.next; return item; } else { throw new NoSuchElementException(); } } @Override public Iterator<Item> iterator() { . } } public static void main(String[] args) throws Exception { // unit testing Deque deque=new Deque(); deque.addFirst(""yyy""); deque.addLast(""fff""); deque.addLast(""sss""); String f =null; //deque.addFirst(f); StdOut.println(deque.size()); StdOut.println(deque.removeFirst()); } }
[ "dn070017@gmail.com" ]
dn070017@gmail.com
d0d0f40471cf4d65a869e7aee179620529d7636f
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/main/java/org/gradle/test/performancenull_280/Productionnull_27939.java
6a34a170a5f9eccef39acbf22e4722740207ed7d
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
588
java
package org.gradle.test.performancenull_280; public class Productionnull_27939 { private final String property; public Productionnull_27939(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
a06a441ca8b8d96f75cd7fabb35f2a0a0027659e
cfec1fd7f6d6ceebd37260f340f9c1facbeeb16f
/src/uk/co/senab/photoview/ImageDetailFragment.java
2f5a3e6808a7ed875bb7103d889acda5e8aeb426
[]
no_license
caocf/Tjxl
adc21e67c86c438d592af26a9e30d22c2e565485
371b51d7ffe3909d003353139863bbc4ff771803
refs/heads/master
2021-01-18T12:21:29.000804
2015-07-28T07:26:16
2015-07-28T07:26:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,147
java
package uk.co.senab.photoview; import uk.co.senab.photoview.PhotoViewAttacher; import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; import android.graphics.Bitmap; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.Toast; import com.eims.tjxl_andorid.R; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.assist.FailReason; import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; /** * 单张图片显示Fragment */ public class ImageDetailFragment extends Fragment { private String mImageUrl; private ImageView mImageView; private ProgressBar progressBar; private PhotoViewAttacher mAttacher; public static ImageDetailFragment newInstance(String imageUrl) { final ImageDetailFragment f = new ImageDetailFragment(); final Bundle args = new Bundle(); args.putString("url", imageUrl); f.setArguments(args); return f; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mImageUrl = getArguments() != null ? getArguments().getString("url") : null; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View v = inflater.inflate(R.layout.image_detail_fragment, container, false); mImageView = (ImageView) v.findViewById(R.id.image); mAttacher = new PhotoViewAttacher(mImageView); mAttacher.setOnPhotoTapListener(new OnPhotoTapListener() { @Override public void onPhotoTap(View arg0, float arg1, float arg2) { getActivity().finish(); } }); progressBar = (ProgressBar) v.findViewById(R.id.loading); return v; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); ImageLoader.getInstance().displayImage(mImageUrl, mImageView, new SimpleImageLoadingListener() { @Override public void onLoadingStarted(String imageUri, View view) { progressBar.setVisibility(View.VISIBLE); } @Override public void onLoadingFailed(String imageUri, View view, FailReason failReason) { String message = null; switch (failReason.getType()) { case IO_ERROR: message = "下载错误"; break; case DECODING_ERROR: message = "图片无法显示"; break; case NETWORK_DENIED: message = "网络有问题,无法下载"; break; case OUT_OF_MEMORY: message = "图片太大无法显示"; break; case UNKNOWN: message = "未知的错误"; break; } Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show(); progressBar.setVisibility(View.GONE); } @Override public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) { progressBar.setVisibility(View.GONE); mAttacher.update(); } }); } }
[ "293575570@qq.com" ]
293575570@qq.com
0e610df6b6877435c219027e341c3e48c567a565
696ce7d6d916dd36912d5660e4921af7d793d80c
/Succorfish/CombatDiver/app/src/main/java/com/succorfish/combatdiver/helper/Constant.java
8401e2100b7d07e67c7dcbb616f2c79d9f5791cc
[]
no_license
VinayTShetty/GeoFence_Project_End
c669ff89cc355e1772353317c8d6e7bac9ac3361
7e178f207c9183bcd42ec24e339bf414a6df9e71
refs/heads/main
2023-06-04T13:54:32.836943
2021-06-26T02:27:59
2021-06-26T02:27:59
380,394,802
0
0
null
null
null
null
UTF-8
Java
false
false
245
java
package com.succorfish.combatdiver.helper; /** * Created by Jaydeep on 19-01-2018. */ public class Constant { public static String DIRECTORY_FOLDER_NAME = "/CombatDiver"; public static String DIRECTORY_APP_DOCUMENT = "/Document"; }
[ "vinay@succorfish.com" ]
vinay@succorfish.com
aaf6260d66288f19f00cfd8583cbe9ca0954cc3b
2d8daca2f394423e00b772fe3563d5d47b365826
/learn-modules/learn-tmc/learn-sync/learn-sync-service/src/main/java/me/own/learn/sync/bo/RequestBo.java
211c48b8987fe54f89ce55b6dce7067e1f9da7de
[]
no_license
xudongye/learn
07601d1f57cf52ff63a70d83f30670e38fc9cb77
dd88d68cf45014f68210c24982b994d21dd850cc
refs/heads/master
2022-07-12T23:47:06.073893
2020-04-17T09:23:38
2020-04-17T09:23:45
181,639,796
0
0
null
2022-06-25T07:28:37
2019-04-16T07:41:27
Java
UTF-8
Java
false
false
1,784
java
package me.own.learn.sync.bo; /** * @author yexudong * @date 2019/4/17 16:03 */ public class RequestBo { private Object businessRequest; private String partnerCode; private String version; private String requestType; private String signature; private Long timestamp; public Object getBusinessRequest() { return businessRequest; } public void setBusinessRequest(Object businessRequest) { this.businessRequest = businessRequest; } public String getPartnerCode() { return partnerCode; } public void setPartnerCode(String partnerCode) { this.partnerCode = partnerCode; } public String getRequestType() { return requestType; } public void setRequestType(String requestType) { this.requestType = requestType; } public String getSignature() { return signature; } public void setSignature(String signature) { this.signature = signature; } public Long getTimestamp() { return timestamp; } public void setTimestamp(Long timestamp) { this.timestamp = timestamp; } public String getVersion() { return version; } public void setVersion(String version) { this.version = version; } @Override public String toString() { return '{' + "\"businessRequest\":{" + businessRequest + '}' + "\"header\":{" + "\"partnerCode\":\"" + partnerCode + "\"" + ",\"version\":\"" + version + "\"" + ",\"requestType\":\"" + requestType + "\"" + ",\"signature\":\"" + signature + "\"" + ",\"timestamp\":" + timestamp + '}' + '}'; } }
[ "simonye@aliyun.com" ]
simonye@aliyun.com
34e4e042c91ece286fb1089c4aebd09096bf1222
18e6da955719cff29d33ac4c0c5587d8f7b1188e
/apg-core/src/main/java/it/giunti/apg/shared/model/LogDeletion.java
1e2de13d8f2cebd826372111c54ab8a196555a99
[]
no_license
pynolo/backup-apg-project
5dde8def09a330298e981a0146b3f7e00295801f
36c427a6ea2242db433129dd1a17a4e7ed09438b
refs/heads/master
2023-01-23T19:56:18.519181
2020-12-02T11:05:17
2020-12-02T11:05:17
317,835,636
0
0
null
null
null
null
UTF-8
Java
false
false
2,882
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package it.giunti.apg.shared.model; import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * * @author paolo */ @Entity @Table(name = "log_deletion") public class LogDeletion extends BaseEntity { private static final long serialVersionUID = 5781543734777809510L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id", nullable = false) private Integer id; @Basic(optional = false) @Column(name = "entity_name", nullable = false, length = 64) private String entityName; @Basic(optional = false) @Column(name="entity_id", nullable = false) private Integer entityId; @Basic(optional = false) @Column(name="entity_uid", nullable = false, length = 16) private String entityUid; @Basic(optional = false) @Column(name = "log_datetime", nullable = false) @Temporal(TemporalType.TIMESTAMP) private Date logDatetime; @Column(name = "id_utente", length = 32, nullable = false) private String idUtente; public LogDeletion() { } public LogDeletion(Integer id) { this.id = id; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getEntityName() { return entityName; } public void setEntityName(String entityName) { this.entityName = entityName; } public Integer getEntityId() { return entityId; } public void setEntityId(Integer entityId) { this.entityId = entityId; } public String getEntityUid() { return entityUid; } public void setEntityUid(String entityUid) { this.entityUid = entityUid; } public String getIdUtente() { return idUtente; } public void setIdUtente(String idUtente) { this.idUtente = idUtente; } public Date getLogDatetime() { return logDatetime; } public void setLogDatetime(Date logDatetime) { this.logDatetime = logDatetime; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { if (!(object instanceof LogDeletion)) { return false; } LogDeletion other = (LogDeletion) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } @Override public String toString() { return "LogWs[id=" + id + "]"; } }
[ "p.tacconi@giunti.it" ]
p.tacconi@giunti.it
f99891f0d61ac2b67baa7ea85e9d53bf64e3c891
02e4f82f23954cac1b152065dfa91f4e689f3e4b
/core/src/main/java/io/onedev/server/rest/github/RepositoryResource.java
73976df0fa5861b91b3d0894501e9073aa5af7ae
[ "MIT" ]
permissive
desktoptips/onedev
f51e3cfd8eca0c5ccbeb865f40d21d7a6c49dfb6
8dff13e1f20756f7d1a283923a38057490bd7ff0
refs/heads/master
2020-04-16T01:37:48.106728
2019-01-10T08:45:10
2019-01-10T08:45:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,910
java
package io.onedev.server.rest.github; import java.util.HashMap; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.shiro.authz.UnauthorizedException; import io.onedev.server.manager.ProjectManager; import io.onedev.server.model.Project; import io.onedev.server.rest.RestConstants; import io.onedev.server.security.SecurityUtils; @Path("/repos/projects") @Consumes(MediaType.WILDCARD) @Produces(MediaType.WILDCARD) @Singleton public class RepositoryResource { private final ProjectManager projectManager; @Inject public RepositoryResource(ProjectManager projectManager) { this.projectManager = projectManager; } @Path("/{name}") @GET public Response get(@PathParam("name") String name) { Project project = projectManager.find(name); if (!SecurityUtils.canReadCode(project.getFacade())) { throw new UnauthorizedException("Unauthorized access to project " + project.getName()); } else { Map<String, Object> entity = new HashMap<>(); Map<String, String> permissionsMap = new HashMap<>(); entity.put("name", project.getName()); permissionsMap.put("admin", String.valueOf(SecurityUtils.canAdministrate(project.getFacade()))); permissionsMap.put("push", String.valueOf(SecurityUtils.canWriteCode(project.getFacade()))); permissionsMap.put("pull", "true"); entity.put("permissions", permissionsMap); Map<String, String> ownerMap = new HashMap<>(); ownerMap.put("login", "projects"); ownerMap.put("id", "1000000"); entity.put("owner", ownerMap); return Response.ok(entity, RestConstants.JSON_UTF8).build(); } } }
[ "robin@pmease.com" ]
robin@pmease.com
1184a8e523c1b0f6bd77ece3377e1336beb2de40
44bc6514eb20e966bcd8d8177e6981d2dc645d71
/itrip-biz/src/main/java/cn/itrip/service/itripHotelOrder/ItripHotelOrderServiceImpl.java
ca3a8499298029dbd92c72dadea53f562f89eb08
[]
no_license
j338group/itrip-project
3b70c1a99f6b5b0a7db388dd1aa7f723a74ad439
7c7b66f9a23d7d16f54d9bc490953743f664194a
refs/heads/master
2021-06-22T11:15:54.469248
2019-11-15T08:32:27
2019-11-15T08:32:27
214,998,252
1
0
null
2021-06-04T02:18:08
2019-10-14T09:10:54
Java
UTF-8
Java
false
false
6,293
java
package cn.itrip.service.itripHotelOrder; import cn.itrip.beans.pojo.*; import cn.itrip.common.BigDecimalUtil; import cn.itrip.mapper.itripHotelOrder.ItripHotelOrderMapper; import cn.itrip.common.EmptyUtils; import cn.itrip.common.Page; import cn.itrip.mapper.itripHotelRoom.ItripHotelRoomMapper; import cn.itrip.mapper.itripHotelTempStore.ItripHotelTempStoreMapper; import cn.itrip.mapper.itripOrderLinkUser.ItripOrderLinkUserMapper; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import cn.itrip.common.Constants; @Service public class ItripHotelOrderServiceImpl implements ItripHotelOrderService { @Resource private ItripHotelOrderMapper itripHotelOrderMapper; @Resource private ItripOrderLinkUserMapper itripOrderLinkUserMapper; @Resource private ItripHotelRoomMapper itripHotelRoomMapper; @Resource private ItripHotelTempStoreMapper itripHotelTempStoreMapper; public ItripHotelOrder getItripHotelOrderById(Long id)throws Exception{ return itripHotelOrderMapper.getItripHotelOrderById(id); } public List<ItripHotelOrder> getItripHotelOrderListByMap(Map<String,Object> param)throws Exception{ return itripHotelOrderMapper.getItripHotelOrderListByMap(param); } public Integer getItripHotelOrderCountByMap(Map<String,Object> param)throws Exception{ return itripHotelOrderMapper.getItripHotelOrderCountByMap(param); } public Integer itriptxAddItripHotelOrder(ItripHotelOrder itripHotelOrder)throws Exception{ itripHotelOrder.setCreationDate(new Date()); return itripHotelOrderMapper.insertItripHotelOrder(itripHotelOrder); } public Integer itriptxModifyItripHotelOrder(ItripHotelOrder itripHotelOrder)throws Exception{ itripHotelOrder.setModifyDate(new Date()); return itripHotelOrderMapper.updateItripHotelOrder(itripHotelOrder); } public Integer itriptxDeleteItripHotelOrderById(Long id)throws Exception{ return itripHotelOrderMapper.deleteItripHotelOrderById(id); } public Page<ItripHotelOrder> queryItripHotelOrderPageByMap(Map<String,Object> param,Integer pageNo,Integer pageSize)throws Exception{ Integer total = itripHotelOrderMapper.getItripHotelOrderCountByMap(param); pageNo = EmptyUtils.isEmpty(pageNo) ? Constants.DEFAULT_PAGE_NO : pageNo; pageSize = EmptyUtils.isEmpty(pageSize) ? Constants.DEFAULT_PAGE_SIZE : pageSize; Page page = new Page(pageNo, pageSize, total); param.put("beginPos", page.getBeginPos()); param.put("pageSize", page.getPageSize()); List<ItripHotelOrder> itripHotelOrderList = itripHotelOrderMapper.getItripHotelOrderListByMap(param); page.setRows(itripHotelOrderList); return page; } @Override public BigDecimal getPayAmount(Integer count, int bookingDays, Double roomPrice) throws Exception { return BigDecimalUtil.OperationASMD(count * bookingDays, roomPrice, BigDecimalUtil.BigDecimalOprations.multiply, 2, BigDecimal.ROUND_DOWN); } @Override public Long itriptxAddItripHotelOrder(ItripHotelOrder order, List<ItripUserLinkUser> linkUser) throws Exception { Long orderId = order.getId(); if (orderId == null) { //插入订单记录 order.setCreationDate(new Date()); itripHotelOrderMapper.insertItripHotelOrder(order); orderId=order.getId(); }else{ //删除联系人 itripOrderLinkUserMapper.deleteItripOrderLinkUserByOrderId(orderId); //修改订单 itripHotelOrderMapper.updateItripHotelOrder(order); } //插入订单联系人 for (ItripUserLinkUser user : linkUser) { ItripOrderLinkUser orderUser = new ItripOrderLinkUser(); orderUser.setOrderId(orderId); orderUser.setLinkUserId(user.getId()); orderUser.setLinkUserName(user.getLinkUserName()); orderUser.setCreationDate(new Date()); orderUser.setCreatedBy(order.getUserId()); itripOrderLinkUserMapper.insertItripOrderLinkUser(orderUser); } return orderId; } /** * 验证支付类型是否支持(线上、线下) * @param hotelOrder * @param payType * @return * @throws Exception */ @Override public Boolean getSupportPayType(ItripHotelOrder hotelOrder, Integer payType) throws Exception { ItripHotelRoom hotelRoom = itripHotelRoomMapper.getItripHotelRoomById(hotelOrder.getRoomId()); Integer oldPayType = hotelRoom.getPayType(); // 11 01 10 // 01,10 01 10 return (oldPayType&payType)!=0; } /** * 修改订单状态并刷新库存 * @param hotelOrder * @param payType * @throws Exception */ @Override public void itriptxModifyItripHotelOrderAndTempRoomStore(ItripHotelOrder hotelOrder, Integer payType) throws Exception { //减库存 Map<String, Object> param = new HashMap<>(); param.put("count", hotelOrder.getCount()); param.put("roomId", hotelOrder.getRoomId()); param.put("checkInDate", hotelOrder.getCheckInDate()); param.put("checkOutDate", hotelOrder.getCheckOutDate()); itripHotelTempStoreMapper.updateTempStore(param); //修改订单状态 hotelOrder.setPayType(payType); hotelOrder.setOrderStatus(2); itripHotelOrderMapper.updateItripHotelOrder(hotelOrder); } @Scheduled(cron = "0 0/10 * * * ?") public void updateOrderStatusTimeOutPay(){ //扫描订单表,(未支付的)查看订单生成时间跟当前时间的差,是否大于2小时 //如果大于2小时,修改订单状态 //1分钟 效率低 //2小时 12:00 2:00 误差大 System.out.println("定时修改超时未支付的订单。。。"); try { itripHotelOrderMapper.updateOrderStatus(); } catch (Exception e) { e.printStackTrace(); } } }
[ "test@test.com" ]
test@test.com
08ed701b517abbb2f3cb8f14c9d666f10256b07c
310059f7a578936a2c1428cb744697422fbd3207
/cache2k-core/src/test/java/org/cache2k/test/core/CacheNameTest.java
5e53304ec9cc77d9df2f747537aa5958f54d28f3
[ "Apache-2.0" ]
permissive
alfonsomunozpomer/cache2k
74cf34012f6afdacdeeed550b190bc8aba2d9ad3
b54a9d2df7d4b072663fe4dc561355c8a4f7f326
refs/heads/master
2022-11-26T20:13:16.915023
2020-08-08T22:36:31
2020-08-08T22:36:31
286,234,358
1
0
Apache-2.0
2020-08-09T12:38:28
2020-08-09T12:38:27
null
UTF-8
Java
false
false
2,036
java
package org.cache2k.test.core; /* * #%L * cache2k implementation * %% * Copyright (C) 2000 - 2020 headissue GmbH, Munich * %% * 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. * #L% */ import org.cache2k.Cache; import org.cache2k.Cache2kBuilder; import org.cache2k.CacheManager; import org.cache2k.testing.category.FastTests; import static org.junit.Assert.*; import static org.hamcrest.Matchers.*; import org.junit.Test; import org.junit.experimental.categories.Category; /** * @author Jens Wilke */ @Category(FastTests.class) public class CacheNameTest { /** * Needed by JSR107 TCK tests, e.g.: org.jsr107.tck.CacheManagerTest@6fc6f14e */ @Test public void atCharacter() { Cache2kBuilder.forUnknownTypes().name("CacheNameTest@").build().close(); } /** * Needed by JSR107 annotations that create a cache name with * {@code org.example.KeyClass,org.example.ValueClass} */ @Test public void commaCharacter() { Cache2kBuilder.forUnknownTypes().name("CacheNameTest,").build().close(); } /** * Needed by JSR107 TCK */ @Test public void spaceCharacter() { Cache2kBuilder.forUnknownTypes().name("CacheNameTest space").build().close(); } @Test public void managerNameInToString() { final String _MANAGER_NAME = "managerNameInToString123"; CacheManager cm = CacheManager.getInstance(_MANAGER_NAME); Cache c = Cache2kBuilder.forUnknownTypes().manager(cm).build(); assertThat(c.toString(), containsString(_MANAGER_NAME)); cm.close(); } }
[ "jw_github@headissue.com" ]
jw_github@headissue.com
80818c196843e54662161c1a7f4713ba669836b9
43ab26a1d1c3b34b1e35a5d6ab348ad7c1f49af7
/src/main/java/org/smart4j/framework/ConfigConstant.java
0156b631996281295484feb7618bd8ca97dc55d0
[]
no_license
liukunlong1093/template_web
ba95db359d3fab115ff3031f293bfe97af22abc8
a2be29075825120d34268137242d076662133443
refs/heads/master
2021-09-11T15:30:53.344103
2018-04-09T09:27:56
2018-04-09T09:27:56
119,965,288
0
0
null
null
null
null
UTF-8
Java
false
false
832
java
package org.smart4j.framework; /** * 提供相关配置项常量 * * @author liukl * @date 2018/2/1 */ public interface ConfigConstant { /** MySQL驱动*/ String CONFIG_FILE="smart.properties"; /** MySQL驱动*/ String JDBC_DRIVER="smart.framework.jdbc.driver"; /** MySQL连接地址*/ String JDBC_URL="smart.framework.jdbc.url"; /** MySQL用户名*/ String JDBC_USERNAME="smart.framework.jdbc.username"; /** MySQL密码*/ String JDBC_PASSWORD="smart.framework.jdbc.password"; /** 项目的基础包名*/ String APP_BASE_PACKAGE="smart.framework.app.base_package"; /** JSP的基础路径*/ String APP_JSP_PATH="smart.framework.jsp_ptah"; /** 静态资源文件的基础路径,比如JS,CSS,图片等*/ String APP_ASSET_PATH="smart.framework.asset_path"; }
[ "liukunlong1093@163.com" ]
liukunlong1093@163.com
1e78b36708f0dbd7c1528563ef37726ba2fdaa02
4fab44e9f3205863c0c4e888c9de1801919dc605
/AL-Game/src/com/aionemu/gameserver/model/templates/housing/HousePart.java
c080019fcc7e4eb56ad53ea594cfe277cd895309
[]
no_license
YggDrazil/AionLight9
fce24670dcc222adb888f4a5d2177f8f069fd37a
81f470775c8a0581034ed8c10d5462f85bef289a
refs/heads/master
2021-01-11T00:33:15.835333
2016-07-29T19:20:11
2016-07-29T19:20:11
70,515,345
2
0
null
null
null
null
UTF-8
Java
false
false
2,265
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning 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. * * Aion-Lightning 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 Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package com.aionemu.gameserver.model.templates.housing; import com.aionemu.gameserver.model.templates.item.ItemQuality; import javax.xml.bind.Unmarshaller; import javax.xml.bind.annotation.*; import java.util.HashSet; import java.util.List; import java.util.Set; /** * @author Rolandas */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "house_part") public class HousePart { @XmlAttribute(name = "building_tags", required = true) private List<String> buildingTags; @XmlAttribute(required = true) protected PartType type; @XmlAttribute(required = true) protected ItemQuality quality; @XmlAttribute protected String name; @XmlAttribute(required = true) protected int id; @XmlTransient protected Set<String> tagsSet = new HashSet<String>(1); void afterUnmarshal(Unmarshaller u, Object parent) { if (buildingTags == null) { return; } for (String tag : buildingTags) { tagsSet.add(tag); } buildingTags.clear(); buildingTags = null; } public PartType getType() { return type; } public ItemQuality getQuality() { return quality; } public String getName() { return name; } public int getId() { return id; } public Set<String> getTags() { return tagsSet; } public boolean isForBuilding(Building building) { return tagsSet.contains(building.getPartsMatchTag()); } }
[ "michelgorter@outlook.com" ]
michelgorter@outlook.com
d61582e8bb4ecc6cf10ae55c35d7f95a02f4146b
81190399ea2048a65d17a9ed08ac3dc945b98580
/src/main/java/com/jkinfo/taotao/service/impl/TestServiceImpl.java
35d317c04fb1ac6a2696312bccb24a32ebc550b5
[]
no_license
leochn/jkinfo-taotao
bb945bad31c81786a8a86ce1028ca07f0b6cfebb
0c7bda35bd225113fc495ed1c2d02dc6d595492f
refs/heads/master
2021-01-22T08:28:59.714969
2017-02-15T08:40:39
2017-02-15T08:40:39
81,904,824
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com.jkinfo.taotao.service.impl; import org.springframework.stereotype.Service; import com.jkinfo.taotao.pojo.Test; import com.jkinfo.taotao.service.TestService; @Service public class TestServiceImpl extends BaseServiceImpl<Test> implements TestService { public Integer saveTest(Test item) { item.setId(null);// 强制设置id为null,从数据库中自增长 return super.save(item); } }
[ "appchn@163.com" ]
appchn@163.com
c3dfa562dd4c8180375f967dec8b78d84e7bd44e
ca9371238f2f8fbec5f277b86c28472f0238b2fe
/src/mx/com/kubo/rest/model/LoginMembership.java
ce9fbeb18ac4bbbf1e803d554e6cc31380e27984
[]
no_license
ocg1/kubo.portal
64cb245c8736a1f8ec4010613e14a458a0d94881
ab022457d55a72df73455124d65b625b002c8ac2
refs/heads/master
2021-05-15T17:23:48.952576
2017-05-08T17:18:09
2017-05-08T17:18:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
package mx.com.kubo.rest.model; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class LoginMembership { private String area; private String prospectus_id; private String full_name; private String last_login_attempt; private String password_ENABLED; public LoginMembership(){} public String getProspectus_id() { return prospectus_id; } public void setProspectus_id(String prospectus_id) { this.prospectus_id = prospectus_id; } public String getFull_name() { return full_name; } public void setFull_name(String full_name) { this.full_name = full_name; } public String getLast_login_attempt() { return last_login_attempt; } public void setLast_login_attempt(String last_login_attempt) { this.last_login_attempt = last_login_attempt; } public String getArea() { return area; } public void setArea(String area) { this.area = area; } public String getPassword_ENABLED() { return password_ENABLED; } public void setPassword_ENABLED(String password_ENABLED) { this.password_ENABLED = password_ENABLED; } }
[ "damian.tapia.nava@gmail.com" ]
damian.tapia.nava@gmail.com
d580a77e73b7532688c7ae31fb25f0f966decca4
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MATH-51b-6-19-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/apache/commons/math/analysis/solvers/BaseSecantSolver_ESTest.java
3b9fe7ab56b46df8a4ffd546fc585bfe143e74b2
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
1,055
java
/* * This file was automatically generated by EvoSuite * Tue Jan 21 22:02:47 UTC 2020 */ package org.apache.commons.math.analysis.solvers; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.apache.commons.math.analysis.SinFunction; import org.apache.commons.math.analysis.UnivariateRealFunction; import org.apache.commons.math.analysis.solvers.PegasusSolver; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class BaseSecantSolver_ESTest extends BaseSecantSolver_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { PegasusSolver pegasusSolver0 = new PegasusSolver(0.0, 0.0, 0.0); SinFunction sinFunction0 = new SinFunction(); // Undeclared exception! pegasusSolver0.solve(4, (UnivariateRealFunction) sinFunction0, (-1245.11383374), 540.459599, 1996.4512); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
3934cdd6f957de09f4ecaac951400655cc4212d9
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
/WidgetWarren/src/com/puttysoftware/widgetwarren/objects/FadingWall.java
5a04484975789b811869298bb987a0424f8e6c27
[ "Unlicense" ]
permissive
retropipes/older-java-games
777574e222f30a1dffe7936ed08c8bfeb23a21ba
786b0c165d800c49ab9977a34ec17286797c4589
refs/heads/master
2023-04-12T14:28:25.525259
2021-05-15T13:03:54
2021-05-15T13:03:54
235,693,016
0
0
null
null
null
null
UTF-8
Java
false
false
1,740
java
/* WidgetWarren: A Maze-Solving Game Copyright (C) 2008-2014 Eric Ahnell Any questions should be directed to the author via email at: products@puttysoftware.com */ package com.puttysoftware.widgetwarren.objects; import com.puttysoftware.widgetwarren.Application; import com.puttysoftware.widgetwarren.WidgetWarren; import com.puttysoftware.widgetwarren.generic.GenericWall; import com.puttysoftware.widgetwarren.maze.MazeConstants; public class FadingWall extends GenericWall { // Fields private static final int SCAN_LIMIT = 3; // Constructors public FadingWall() { super(); this.activateTimer(1); } @Override public void timerExpiredAction(final int dirX, final int dirY) { // Disappear if the player is close to us boolean scanResult = false; final Application app = WidgetWarren.getApplication(); final int pz = app.getGameManager().getPlayerManager() .getPlayerLocationZ(); final int pl = MazeConstants.LAYER_OBJECT; final String targetName = new Player().getName(); scanResult = app.getMazeManager().getMaze().radialScan(dirX, dirY, pz, pl, FadingWall.SCAN_LIMIT, targetName); if (scanResult) { app.getGameManager().morph(new Empty(), dirX, dirY, pz); } this.activateTimer(1); } @Override public String getName() { return "Fading Wall"; } @Override public String getGameName() { return "Wall"; } @Override public String getPluralName() { return "Fading Walls"; } @Override public String getDescription() { return "Fading Walls disappear when you get close to them."; } }
[ "eric.ahnell@puttysoftware.com" ]
eric.ahnell@puttysoftware.com
d1d804094c734e6c5ae4751762f2dd57f60344d8
447520f40e82a060368a0802a391697bc00be96f
/apks/playstore_apps/com_advantage_RaiffeisenBank/source/org/apache/commons/codec/StringDecoder.java
12dc62da98c0fa87a22eae75b470d80a518b8a52
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
178
java
package org.apache.commons.codec; public abstract interface StringDecoder extends Decoder { public abstract String decode(String paramString) throws DecoderException; }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
b8b1d0ec529e908b2c4f92d08cdfd99a4ffd8393
d84fb60595312136aeb1069baad585da325c218d
/HuaShanApp/app/src/main/java/com/karazam/huashanapp/my/security/checkpaymentpassword/retrofit/CheckPaymentpsDataSource.java
6ddfb8475e571d4419ca4ce09018d7d63103709d
[]
no_license
awplying12/huashanApp
d6a72b248c94a65e882385edf92231552214340c
86bd908ec2f82fc030a9d83238144a943461c842
refs/heads/master
2021-01-11T00:21:10.870110
2017-02-10T11:27:06
2017-02-10T11:27:06
70,544,770
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package com.karazam.huashanapp.my.security.checkpaymentpassword.retrofit; import com.karazam.huashanapp.HuaShanApplication; import com.karazam.huashanapp.main.retorfitMain.BaseDataSource; import com.karazam.huashanapp.main.retorfitMain.BaseReturn; import rx.Observable; /** * Created by Administrator on 2017/2/10. */ public class CheckPaymentpsDataSource extends BaseDataSource { CheckPaymentpsApi service = retrofit1.create(CheckPaymentpsApi.class); public Observable<BaseReturn> checkPaymentps(){ CheckPaymentpsPost post = new CheckPaymentpsPost(); post.setUserId(HuaShanApplication.uuid); return service.checkPaymentps(post,HuaShanApplication.token,"XMLHttpRequest"); } }
[ "awplying14@163.com" ]
awplying14@163.com
ed3119328432cfdfecf7db6749d61e6fb998e5b1
d2d2b04534a32e79161b35e664f018e7d43a2f1b
/src/pl/grzegorz2047/survivalgames/commands/EditModeArg.java
3ff048681bb9158cb8547bbe348c3ba9779d677d
[ "Apache-2.0" ]
permissive
grzegorz2047/SurvivalGames-Bukkit
92422a404b62a6127b68c2edac077025059578ef
47d2aaf7e266f2267358739b90988690676e0261
refs/heads/master
2021-01-11T05:20:40.050520
2016-10-25T10:41:32
2016-10-25T10:41:32
71,886,803
1
0
null
null
null
null
UTF-8
Java
false
false
1,564
java
package pl.grzegorz2047.survivalgames.commands; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import pl.grzegorz2047.survivalgames.MsgManager; import pl.grzegorz2047.survivalgames.SurvivalGames; /** * Created by Grzegorz2047. 01.09.2015. */ public class EditModeArg extends Arg { private SurvivalGames sg; public EditModeArg(SurvivalGames sg) { this.sg = sg; } @Override protected void execute(CommandSender sender, String args[]) { if(!(sender instanceof Player)){ return; } Player p = (Player) sender; if(args.length >= 2){ boolean editMode = Boolean.parseBoolean(args[1]); sg.getGameManager().getChestManager().setEditMode(editMode); if(editMode){ p.sendMessage(MsgManager.msg(ChatColor.GREEN + "Wlaczono tryb edycji skrzynek!")); p.sendMessage(MsgManager.msg("Aby zapisac wspolrzedne skrzynki kliknij na nia lewym klawiszem!")); p.sendMessage(MsgManager.msg("Kiedy skonczysz wylacz tryb edycji i zapisz wspolrzedne skrzynek poprzez /sg editmode false")); }else{ sg.getGameManager().getChestManager().saveChestsLocToFile(); sg.getGameManager().getChestManager().saveDoubleChestsLocToFile(); p.sendMessage(MsgManager.msg("zapisano skrzynki!")); } }else{ p.sendMessage(MsgManager.msg("Poprawne uzycie: /sg editmode true/false")); } } }
[ "grzegorz2047@gmail.com" ]
grzegorz2047@gmail.com
7383412853324ee525a6496f06f12a0a58a2f5fa
0167f77a8364fe86aed16510c97ffc348c0d9132
/src/com/jetcms/common/office/PdfToSwfConverter.java
c12c5d06eb11a0dbcabfe062c3f57c9f7e87bfd0
[]
no_license
barrycom/kgmx
1bc379b7472ec11f8d807fbdf38644b59449410f
f2ad7902d06d36fdb908c6c098f36c978907b05f
refs/heads/master
2021-07-13T14:06:20.966837
2017-09-26T03:14:54
2017-09-26T03:16:42
104,827,608
2
0
null
null
null
null
UTF-8
Java
false
false
1,969
java
package com.jetcms.common.office; /** * @author Tom */ import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /* * PDF转SWF工具 * @author tom * */ public class PdfToSwfConverter { public static int convertPDF2SWF(String swftoolsHome,String sourcePath, String destPath, String fileName) throws IOException { File dest = new File(destPath); if (!dest.exists()) dest.mkdirs(); //调用pdf2swf命令进行转换 没有中文文件不需要参数-s languagedir String command= swftoolsHome+" "+sourcePath+" -o "+destPath+fileName+" -f -z -s flashversion=9 "; command=command.replace("\\", "/"); Process process =Runtime.getRuntime().exec(command); // 调用外部程序 final InputStream pInputStream = process.getInputStream(); new Thread(new Runnable() { public void run() { BufferedReader br = new BufferedReader(new InputStreamReader(pInputStream)); try { while(br.readLine()!= null) ; } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }).start(); // 启动单独的线程来清空process.getInputStream()的缓冲区 InputStream inputstream = process.getErrorStream(); BufferedReader bufferReader = new BufferedReader(new InputStreamReader(inputstream)); StringBuilder buf = new StringBuilder(); // 保存输出结果流 String line = null; while((line = bufferReader.readLine()) != null) buf.append(line); try { process.waitFor(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return process.exitValue(); } }
[ "whlitiger_yp@163.com" ]
whlitiger_yp@163.com
cc319b8219e6a2628270e7f8e773244fcd1d11d0
c578aec5d7bc6ada60e2d1be0654d011a850c32c
/library/common/src/main/java/com/jaydenxiao/common/base/BaseFragment.java
8a09b2a7b0df5fc0187d8a7920f1e4f66de6e55a
[]
no_license
1097919195/AndroidFire-master
e497a5917d22bdd3301fa9fb9354838226ac1837
696db1dc4b2879f74332d33af79d17f528770ff8
refs/heads/master
2020-03-18T06:14:36.588960
2019-01-12T08:37:41
2019-01-12T08:37:41
134,383,736
2
0
null
null
null
null
UTF-8
Java
false
false
5,209
java
package com.jaydenxiao.common.base; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.jaydenxiao.common.R; import com.jaydenxiao.common.baserx.RxManager; import com.jaydenxiao.common.commonutils.TUtil; import com.jaydenxiao.common.commonutils.ToastUtil; import com.jaydenxiao.common.commonwidget.LoadingDialog; import butterknife.ButterKnife; /** * des:基类fragment * Created by xsf * on 2016.07.12:38 */ /***************使用例子*********************/ //1.mvp模式 //public class SampleFragment extends BaseFragment<NewsChanelPresenter, NewsChannelModel>implements NewsChannelContract.View { // @Override // public int getLayoutId() { // return R.layout.activity_news_channel; // } // // @Override // public void initPresenter() { // mPresenter.setVM(this, mModel); // } // // @Override // public void initView() { // } //} //2.普通模式 //public class SampleFragment extends BaseFragment { // @Override // public int getLayoutResource() { // return R.layout.activity_news_channel; // } // // @Override // public void initPresenter() { // } // // @Override // public void initView() { // } //} public abstract class BaseFragment<T extends BasePresenter, E extends BaseModel> extends Fragment { protected View rootView; public T mPresenter; public E mModel; public RxManager mRxManager; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (rootView == null) rootView = inflater.inflate(getLayoutResource(), container, false); mRxManager=new RxManager(); ButterKnife.bind(this, rootView);//绑定fragment mPresenter = TUtil.getT(this, 0); mModel= TUtil.getT(this,1); if(mPresenter!=null){ mPresenter.mContext=this.getActivity(); } initPresenter(); initView(); return rootView; } //获取布局文件 protected abstract int getLayoutResource(); //简单页面无需mvp就不用管此方法即可,完美兼容各种实际场景的变通 public abstract void initPresenter(); //初始化view protected abstract void initView(); /** * 通过Class跳转界面 **/ public void startActivity(Class<?> cls) { startActivity(cls, null); } /** * 通过Class跳转界面 **/ public void startActivityForResult(Class<?> cls, int requestCode) { startActivityForResult(cls, null, requestCode); } /** * 含有Bundle通过Class跳转界面 **/ public void startActivityForResult(Class<?> cls, Bundle bundle, int requestCode) { Intent intent = new Intent(); intent.setClass(getActivity(), cls); if (bundle != null) { intent.putExtras(bundle); } startActivityForResult(intent, requestCode); } /** * 含有Bundle通过Class跳转界面 **/ public void startActivity(Class<?> cls, Bundle bundle) { Intent intent = new Intent(); intent.setClass(getActivity(), cls); if (bundle != null) { intent.putExtras(bundle); } startActivity(intent); } /** * 开启加载进度条 */ public void startProgressDialog() { LoadingDialog.showDialogForLoading(getActivity()); } /** * 开启加载进度条 * * @param msg */ public void startProgressDialog(String msg) { LoadingDialog.showDialogForLoading(getActivity(), msg, true); } /** * 停止加载进度条 */ public void stopProgressDialog() { LoadingDialog.cancelDialogForLoading(); } /** * 短暂显示Toast提示(来自String) **/ public void showShortToast(String text) { ToastUtil.showShort(text); } /** * 短暂显示Toast提示(id) **/ public void showShortToast(int resId) { ToastUtil.showShort(resId); } /** * 长时间显示Toast提示(来自res) **/ public void showLongToast(int resId) { ToastUtil.showLong(resId); } /** * 长时间显示Toast提示(来自String) **/ public void showLongToast(String text) { ToastUtil.showLong(text); } public void showToastWithImg(String text,int res) { ToastUtil.showToastWithImg(text,res); } /** * 网络访问错误提醒 */ public void showNetErrorTip() { ToastUtil.showToastWithImg(getText(R.string.net_error).toString(),R.drawable.ic_wifi_off); } public void showNetErrorTip(String error) { ToastUtil.showToastWithImg(error,R.drawable.ic_wifi_off); } @Override public void onDestroyView() { super.onDestroyView(); ButterKnife.unbind(this); if (mPresenter != null) mPresenter.onDestroy(); mRxManager.clear(); } }
[ "1097919195@qq.com" ]
1097919195@qq.com
d2751e89fe1ff955250b71a7fb054ed9e85f9512
5ecd15baa833422572480fad3946e0e16a389000
/framework/Pipeline-Open/subsystems/pipeline/main/api/java/com/volantis/xml/pipeline/sax/cache/CacheEntry.java
7ce2cf2a6309344d05e1425b20ab1ebc1e1ce14c
[]
no_license
jabley/volmobserverce
4c5db36ef72c3bb7ef20fb81855e18e9b53823b9
6d760f27ac5917533eca6708f389ed9347c7016d
refs/heads/master
2021-01-01T05:31:21.902535
2009-02-04T02:29:06
2009-02-04T02:29:06
38,675,289
0
1
null
null
null
null
UTF-8
Java
false
false
3,778
java
/* This file is part of Volantis Mobility Server. Volantis Mobility Server 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. Volantis Mobility Server 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 Volantis Mobility Server.  If not, see <http://www.gnu.org/licenses/>. */ /* ---------------------------------------------------------------------------- * (c) Volantis Systems Ltd 2003. * ---------------------------------------------------------------------------- */ package com.volantis.xml.pipeline.sax.cache; /** * This class wraps entries into the cache. It also contains state * information as the entry can be marked as pending. This means that * the entry is not yet complete. */ public class CacheEntry { /** * The Object we wish to store in the cache. */ private Object cacheObject; /** * This flag determines whether the Object {@link #cacheObject} is in * a completed state. true if the Object is complete, otherwise false. */ private boolean pending = false; /** * Construct a new CacheEntry with the specified Object. This * CacheEntry will be in a non-pending state. * @param cacheObject - The Object that we wish to store in the cache. */ public CacheEntry(Object cacheObject) { this.cacheObject = cacheObject; } /** * Construct a new CacheEntry with the specified Object in the * specified pending state. * @param cacheObject - The Object that we wish to store in the cache. * @param pending - true if the Object is the cache is not in a * complete state, otherwise false. */ public CacheEntry(Object cacheObject, boolean pending) { this.cacheObject = cacheObject; this.pending = pending; } /** * Get the state of the stored Object. * @return true if the stored Object is in a pending (incomplete) * state, otherwise false. */ public boolean isPending() { return pending; } /** * Set the state of the stored Object. * @param pending - true to set the state to pending, otherwise false */ public void setPending(boolean pending) { this.pending = pending; } /** * Get the Object being cached. * @return The Object being cached. */ public Object getCacheObject() { return cacheObject; } /** * Set the object being cached. * @param object The object being cached. */ public void setCacheObject(Object object) { this.cacheObject = object; } } /* =========================================================================== Change History =========================================================================== $Log$ 20-Oct-04 5438/3 philws VBM:2004082706 Reformat production pipeline code 20-Oct-04 5438/1 philws VBM:2004082706 Transfer Pipeline source into MCS 04-Aug-03 294/1 allan VBM:2003070709 Fixed merge conflicts 31-Jul-03 217/3 allan VBM:2003071702 Fixed javadoc issue with contains and containsIdentity. 31-Jul-03 217/1 allan VBM:2003071702 Made HTTPMessageEntities into a set. 09-Jun-03 49/1 adrian VBM:2003060505 updated headers and cleaned up imports following changes required for addition of cacheBody elements =========================================================================== */
[ "iwilloug@b642a0b7-b348-0410-9912-e4a34d632523" ]
iwilloug@b642a0b7-b348-0410-9912-e4a34d632523
1d030d6b60d18ec2ce41f8e1a3a31401e5a8dc1f
5b61c916007327ab88b7a504f7236d793124707a
/shared/src/main/java/com/blockwithme/util/shared/Preconditions.java
693805ff47441aff5a45222f54b4d4b899abf3ad
[ "Apache-2.0" ]
permissive
skunkiferous/Util
72bd3ca128c7454d2d37c77230d722f5ca6bd305
bac4bc1b9db6868cc093e6edccb600f7fc6c4d2b
refs/heads/master
2020-04-17T07:35:50.401020
2014-12-08T06:18:39
2014-12-08T06:18:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,359
java
/* * Copyright (C) 2014 Sebastien Diot. * * 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.blockwithme.util.shared; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.Map; /** * Some non-Xtend compatible validation code * * @author monster */ public class Preconditions { public static <T> T requireNonNull(final T obj, final Object name) { if (obj == null) throw new NullPointerException(String.valueOf(name)); return obj; } public static String requireNonEmpty(final String obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.isEmpty()) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static boolean[] requireNonEmpty(final boolean[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static byte[] requireNonEmpty(final byte[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static short[] requireNonEmpty(final short[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static char[] requireNonEmpty(final char[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static int[] requireNonEmpty(final int[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static long[] requireNonEmpty(final long[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static float[] requireNonEmpty(final float[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static double[] requireNonEmpty(final double[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static <T> T[] requireNonEmpty(final T[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.length == 0) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static <T extends Collection<?>> T requireNonEmpty(final T obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.isEmpty()) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static <T extends Map<?, ?>> T requireNonEmpty(final T obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (obj.isEmpty()) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static <T extends Iterator<?>> T requireNonEmpty(final T obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } if (!obj.hasNext()) { throw new IllegalArgumentException("Empty: " + name); } return obj; } public static <T> T requireContains(final T obj, final T[] array, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } for (final T o : array) { if (o == obj) { return obj; } } throw new IllegalArgumentException("Unknown: " + name + " " + obj); } public static <T> T[] requireContainsNoNull(final T[] obj, final Object name) { if (obj == null) { throw new NullPointerException(String.valueOf(name)); } for (int i = 0; i < obj.length; i++) { final T o = obj[i]; if (o == null) { final String msg = name + "[" + i + "] ARRAY: " + Arrays.asList(obj); throw new NullPointerException(msg); } } return obj; } }
[ "s.diot@eurodata.de" ]
s.diot@eurodata.de
9fb5494477cd30932e129f6b70cfc92bca9f9814
a353245e46e3e5c510350cd7303b59b3aa557cd5
/src/main/java/demo/MDCTurboFilter.java
c3a3954a4a90920f5becb360fd31c57b6307682c
[]
no_license
rwinch/spring-session-logging
e9596f367a02e2628584c4b6496e454dfeb7529b
59192750a887be83b9bb6a8ca7ede906ae3b72b4
refs/heads/master
2016-09-06T12:19:11.098962
2016-03-02T19:26:03
2016-03-02T19:26:03
41,311,757
2
0
null
null
null
null
UTF-8
Java
false
false
1,559
java
/* * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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 demo; import org.slf4j.MDC; import org.slf4j.Marker; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.turbo.TurboFilter; import ch.qos.logback.core.spi.FilterReply; /** * @author Rob Winch * */ public class MDCTurboFilter extends TurboFilter { /* (non-Javadoc) * @see ch.qos.logback.classic.turbo.TurboFilter#decide(org.slf4j.Marker, ch.qos.logback.classic.Logger, ch.qos.logback.classic.Level, java.lang.String, java.lang.Object[], java.lang.Throwable) */ @Override public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t) { String mdcLogLevel = MDC.get(LoggingKey.LOGGING_KEY); if(mdcLogLevel == null) { return FilterReply.NEUTRAL; } Level newLevel = Level.valueOf(mdcLogLevel); if(level.isGreaterOrEqual(newLevel)) { return FilterReply.ACCEPT; } return FilterReply.NEUTRAL; } }
[ "rwinch@gopivotal.com" ]
rwinch@gopivotal.com
ce1b2eccf803a98da66951bfb161331ae6003a17
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/43/88.java
aba20d79278f68bbb2bade252a58c90166afe5f7
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
570
java
package <missing>; public class GlobalMembers { public static int ju(int x) { int j; for (j = 2;j < x;j++) { if (x % j == 0) { return 0; } } return 1; } public static int Main() { int i; int num; int flag = 0; int b; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { num = Integer.parseInt(tempVar); } for (i = 3;i <= num / 2;i = i + 2) { if (ju(i) == 1) { b = num - i; if (ju(b) == 1) { System.out.printf("%d %d",i,b); System.out.print("\n"); } } } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
2811ed0525309c9bf38639742f29663c7581f762
b5502ea9580e882a1c530f6e5914ce090e2d00a6
/experiment/CASSANDRA/cassandra/src/java/org/apache/cassandra/cql3/statements/CreateRoleStatement.java
cd262abae156195d6847184ba55c09e2e81baa40
[ "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-public-domain" ]
permissive
Lingzhi-Ouyang/Almost-Strong-Consistency-Cassandra
a3fb54a8c35805a6810532719d7a8da99998f997
2b9aa8e78e134fc8811ea6caff3daca1f4a92936
refs/heads/master
2021-07-09T01:13:04.424482
2020-11-03T03:12:13
2020-11-03T03:12:13
205,116,322
2
2
null
null
null
null
UTF-8
Java
false
false
4,359
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cassandra.cql3.statements; import org.apache.cassandra.auth.*; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.cql3.RoleName; import org.apache.cassandra.exceptions.*; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.transport.messages.ResultMessage; public class CreateRoleStatement extends AuthenticationStatement { private final RoleResource role; private final RoleOptions opts; private final boolean ifNotExists; public CreateRoleStatement(RoleName name, RoleOptions options, boolean ifNotExists) { this.role = RoleResource.role(name.getName()); this.opts = options; this.ifNotExists = ifNotExists; } public void checkAccess(ClientState state) throws UnauthorizedException { super.checkPermission(state, Permission.CREATE, RoleResource.root()); if (opts.getSuperuser().isPresent()) { if (opts.getSuperuser().get() && !state.getUser().isSuper()) throw new UnauthorizedException("Only superusers can create a role with superuser status"); } } public void validate(ClientState state) throws RequestValidationException { opts.validate(); if (role.getRoleName().isEmpty()) throw new InvalidRequestException("Role name can't be an empty string"); // validate login here before checkAccess to avoid leaking role existence to anonymous users. state.ensureNotAnonymous(); if (!ifNotExists && DatabaseDescriptor.getRoleManager().isExistingRole(role)) throw new InvalidRequestException(String.format("%s already exists", role.getRoleName())); } public ResultMessage execute(ClientState state) throws RequestExecutionException, RequestValidationException { // not rejected in validate() if (ifNotExists && DatabaseDescriptor.getRoleManager().isExistingRole(role)) return null; DatabaseDescriptor.getRoleManager().createRole(state.getUser(), role, opts); grantPermissionsToCreator(state); return null; } /** * Grant all applicable permissions on the newly created role to the user performing the request * see also: SchemaAlteringStatement#grantPermissionsToCreator and the overridden implementations * of it in subclasses CreateKeyspaceStatement & CreateTableStatement. * @param state */ private void grantPermissionsToCreator(ClientState state) { // The creator of a Role automatically gets ALTER/DROP/AUTHORIZE permissions on it if: // * the user is not anonymous // * the configured IAuthorizer supports granting of permissions (not all do, AllowAllAuthorizer doesn't and // custom external implementations may not) if (!state.getUser().isAnonymous()) { try { DatabaseDescriptor.getAuthorizer().grant(AuthenticatedUser.SYSTEM_USER, role.applicablePermissions(), role, RoleResource.role(state.getUser().getName())); } catch (UnsupportedOperationException e) { // not a problem, grant is an optional method on IAuthorizer } } } }
[ "lingzhi.ouyang@outlook.com" ]
lingzhi.ouyang@outlook.com
0f493b7c8b31179579f10342d74cfc5c371c9285
6ed32b9c157d783ad4b4fa74accfaee4fd63a3a4
/samediff/src/main/java/org/nd4j/autodiff/functions/impl/unary/transform/Sinh.java
3ad9bd0135912f89154b19fb5c839a80363f4652
[ "MIT", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
manaswiv/nd4j
8b59d7c22291838c23b05409e36df8229d5345c3
3d7afd15d3badefdcab891cc6b93f4e7234dca01
refs/heads/master
2021-01-21T13:15:23.048219
2017-09-01T08:32:45
2017-09-01T08:32:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package org.nd4j.autodiff.functions.impl.unary.transform; import org.nd4j.autodiff.ArrayField; import org.nd4j.autodiff.functions.AbstractUnaryFunction; import org.nd4j.autodiff.functions.DifferentialFunction; import org.nd4j.autodiff.samediff.SameDiff; import java.util.Collections; import java.util.List; public class Sinh extends AbstractUnaryFunction<ArrayField> { public Sinh(SameDiff sameDiff, DifferentialFunction<ArrayField> i_v, Object[] extraArgs) { super(sameDiff, i_v, extraArgs); } @Override public ArrayField doGetValue() { return a().sinh(arg().getValue(true)); } @Override public List<DifferentialFunction<ArrayField>> diff(List<DifferentialFunction<ArrayField>> i_v) { DifferentialFunction<ArrayField> ret = f().cosh(arg()); arg().setGradient(ret); return Collections.singletonList(ret); } @Override public String functionName() { return new org.nd4j.linalg.api.ops.impl.transforms.Sinh().name(); } }
[ "adam@skymind.io" ]
adam@skymind.io
32c6d0a1f0f6f80d59327b7673910c2666b8aa26
7b82d70ba5fef677d83879dfeab859d17f4809aa
/_part2/framework-generator/src/main/java/cn/backflow/generator/util/paranamer/NullParanamer.java
681f8d2736745ebae22ef2fc41c0255b8fe3d9eb
[ "MIT" ]
permissive
apollowesley/jun_test
fb962a28b6384c4097c7a8087a53878188db2ebc
c7a4600c3f0e1b045280eaf3464b64e908d2f0a2
refs/heads/main
2022-12-30T20:47:36.637165
2020-10-13T18:10:46
2020-10-13T18:10:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,273
java
/*** * * Copyright (c) 2007 Paul Hammant * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ package cn.backflow.generator.util.paranamer; import java.lang.reflect.AccessibleObject; /** * Implementation of Paranamer which adheres to the NullObject pattern * * @author Paul Hammant */ public class NullParanamer implements Paranamer { public String[] lookupParameterNames(AccessibleObject methodOrConstructor) { return new String[0]; } public String[] lookupParameterNames(AccessibleObject methodOrConstructor, boolean throwExceptionIfMissing) { if (throwExceptionIfMissing) { throw new ParameterNamesNotFoundException("NullParanamer implementation predictably finds no parameter names"); } return new String[0]; } }
[ "wujun728@hotmail.com" ]
wujun728@hotmail.com
f4a04dcba41b922ef2ec7c091d2201463a281af9
9b7dec08a72088c1e8ce518ea28e95810561d1f3
/lwh-springcloud-2020/cloud-consumer-feign-order80/src/main/java/com/lwhtarena/springcloud/OrderFeignMain80.java
be013dbcb86ad5e01497c6e33e059a8b9fd7cce8
[]
no_license
LWHTarena/lwh-example
6c9b763bca5a5a1557a14778a13a8cde1ffeb53e
e74096b50e49ea37b913b967cd3272ae13cda632
refs/heads/master
2022-12-21T09:50:27.766898
2021-05-01T08:31:34
2021-05-01T08:31:34
128,957,310
0
0
null
2022-12-16T15:41:55
2018-04-10T15:41:01
Java
UTF-8
Java
false
false
579
java
package com.lwhtarena.springcloud; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.openfeign.EnableFeignClients; /** * @author liwh * @Title: OrderFeignMain80 * @Package com.lwhtarena.springcloud * @Description: openFeign负载均衡 * @Version 1.0.0 * @date 2020/5/7 13:16 */ @SpringBootApplication @EnableFeignClients public class OrderFeignMain80 { public static void main(String[] args) { SpringApplication.run(OrderFeignMain80.class,args); } }
[ "lwhtarena@163.com" ]
lwhtarena@163.com
ecbb342402806dc1cfbda7e45b6f0a9ca9917e2b
d9477e8e6e0d823cf2dec9823d7424732a7563c4
/plugins/ShortcutDisplay/tags/rel_1_0/src/shortcutdisplay/SDChangeListener.java
3708695b3657f932484c1f47e9a589458dd1f243
[]
no_license
RobertHSchmidt/jedit
48fd8e1e9527e6f680de334d1903a0113f9e8380
2fbb392d6b569aefead29975b9be12e257fbe4eb
refs/heads/master
2023-08-30T02:52:55.676638
2018-07-11T13:28:01
2018-07-11T13:28:01
140,587,948
1
0
null
null
null
null
UTF-8
Java
false
false
1,004
java
package shortcutdisplay; import javax.swing.event.*; import java.awt.Component; import java.io.*; import java.util.Hashtable; import java.util.Vector; import org.gjt.sp.jedit.*; import org.gjt.sp.jedit.browser.VFSBrowser; import org.gjt.sp.jedit.io.*; import org.gjt.sp.jedit.msg.*; import org.gjt.sp.util.Log; import org.gjt.sp.jedit.gui.*; /** * Description of the Class * *@author jchoyt *@created December 17, 2005 */ public class SDChangeListener implements ChangeListener { /** * Description of the Method * *@param e Description of the Parameter */ public void stateChanged( ChangeEvent e ) { Log.log(Log.DEBUG,this,"got stateChanged event: " + e); ShortcutPrefixActiveEvent evt = ( ShortcutPrefixActiveEvent ) e; if ( evt.getActive() == true ) { ShortcutDisplay.displayShortcuts( evt.getBindings() ); } else { ShortcutDisplay.disposeShortcuts(); } } }
[ "nobody@6b1eeb88-9816-0410-afa2-b43733a0f04e" ]
nobody@6b1eeb88-9816-0410-afa2-b43733a0f04e
12d5b775b296b2f1bc35f57130a224b8455f1446
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/gradle--gradle/f24146cc5f956a1b03a515bbee4225e6f861b6ab/before/CLangPlugin.java
d8c53ab55d632a30a085c48300967b0adb9e5d9f
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
3,487
java
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.gradle.language.c.plugins; import com.google.common.collect.Maps; import org.gradle.api.Incubating; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.internal.service.ServiceRegistry; import org.gradle.language.base.internal.SourceTransformTaskConfig; import org.gradle.language.base.internal.registry.LanguageTransformContainer; import org.gradle.language.base.plugins.ComponentModelBasePlugin; import org.gradle.language.c.CSourceSet; import org.gradle.language.c.internal.DefaultCSourceSet; import org.gradle.language.c.tasks.CCompile; import org.gradle.language.c.tasks.CPreCompiledHeaderCompile; import org.gradle.language.nativeplatform.internal.DependentSourceSetInternal; import org.gradle.language.nativeplatform.internal.NativeLanguageTransform; import org.gradle.language.nativeplatform.internal.PCHCompileTaskConfig; import org.gradle.language.nativeplatform.internal.SourceCompileTaskConfig; import org.gradle.model.Mutate; import org.gradle.model.RuleSource; import org.gradle.nativeplatform.internal.DefaultPreprocessingTool; import org.gradle.nativeplatform.internal.pch.PchEnabledLanguageTransform; import org.gradle.platform.base.ComponentType; import org.gradle.platform.base.TypeBuilder; import java.util.Map; /** * Adds core C language support. */ @Incubating public class CLangPlugin implements Plugin<Project> { public void apply(final Project project) { project.getPluginManager().apply(ComponentModelBasePlugin.class); } @SuppressWarnings("UnusedDeclaration") static class Rules extends RuleSource { @ComponentType void registerLanguage(TypeBuilder<CSourceSet> builder) { builder.defaultImplementation(DefaultCSourceSet.class); builder.internalView(DependentSourceSetInternal.class); } @Mutate void registerLanguageTransform(LanguageTransformContainer languages, ServiceRegistry serviceRegistry) { languages.add(new C()); } } private static class C extends NativeLanguageTransform<CSourceSet> implements PchEnabledLanguageTransform<CSourceSet> { public Class<CSourceSet> getSourceSetType() { return CSourceSet.class; } public Map<String, Class<?>> getBinaryTools() { Map<String, Class<?>> tools = Maps.newLinkedHashMap(); tools.put("cCompiler", DefaultPreprocessingTool.class); return tools; } @Override public String getLanguageName() { return "c"; } public SourceTransformTaskConfig getTransformTask() { return new SourceCompileTaskConfig(this, CCompile.class); } public SourceTransformTaskConfig getPchTransformTask() { return new PCHCompileTaskConfig(this, CPreCompiledHeaderCompile.class); } } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
ce797d3f9323145c862c0b323277f0dead3148c0
40665051fadf3fb75e5a8f655362126c1a2a3af6
/ibinti-bugvm/fc03be43f5a999223672bc9d7ca0c0a2488ad7a7/6673/CAMetalLayer.java
6314b821eb1ac3fc32685b38ee8a829e64b42046
[]
no_license
fermadeiral/StyleErrors
6f44379207e8490ba618365c54bdfef554fc4fde
d1a6149d9526eb757cf053bc971dbd92b2bfcdf1
refs/heads/master
2020-07-15T12:55:10.564494
2019-10-24T02:30:45
2019-10-24T02:30:45
205,546,543
2
0
null
null
null
null
UTF-8
Java
false
false
3,106
java
/* * Copyright (C) 2013-2015 RoboVM AB * * 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.bugvm.apple.coreanimation; /*<imports>*/ import java.io.*; import java.nio.*; import java.util.*; import com.bugvm.objc.*; import com.bugvm.objc.annotation.*; import com.bugvm.objc.block.*; import com.bugvm.rt.*; import com.bugvm.rt.annotation.*; import com.bugvm.rt.bro.*; import com.bugvm.rt.bro.annotation.*; import com.bugvm.rt.bro.ptr.*; import com.bugvm.apple.foundation.*; import com.bugvm.apple.coregraphics.*; import com.bugvm.apple.coreimage.*; import com.bugvm.apple.coretext.*; import com.bugvm.apple.opengles.*; import com.bugvm.apple.metal.*; /*</imports>*/ /*<javadoc>*/ /** * @since Available in iOS 8.0 and later. */ /*</javadoc>*/ /*<annotations>*/@Library("QuartzCore") @NativeClass/*</annotations>*/ /*<visibility>*/public/*</visibility>*/ class /*<name>*/CAMetalLayer/*</name>*/ extends /*<extends>*/CALayer/*</extends>*/ /*<implements>*//*</implements>*/ { /*<ptr>*/public static class CAMetalLayerPtr extends Ptr<CAMetalLayer, CAMetalLayerPtr> {}/*</ptr>*/ /*<bind>*/static { ObjCRuntime.bind(CAMetalLayer.class); }/*</bind>*/ /*<constants>*//*</constants>*/ /*<constructors>*/ public CAMetalLayer() {} protected CAMetalLayer(SkipInit skipInit) { super(skipInit); } /*</constructors>*/ /*<properties>*/ @WeaklyLinked @Property(selector = "device") public native MTLDevice getDevice(); @WeaklyLinked @Property(selector = "setDevice:") public native void setDevice(MTLDevice v); @WeaklyLinked @Property(selector = "pixelFormat") public native MTLPixelFormat getPixelFormat(); @WeaklyLinked @Property(selector = "setPixelFormat:") public native void setPixelFormat(MTLPixelFormat v); @Property(selector = "framebufferOnly") public native boolean isFramebufferOnly(); @Property(selector = "setFramebufferOnly:") public native void setFramebufferOnly(boolean v); @Property(selector = "drawableSize") public native @ByVal CGSize getDrawableSize(); @Property(selector = "setDrawableSize:") public native void setDrawableSize(@ByVal CGSize v); @Property(selector = "presentsWithTransaction") public native boolean presentsWithTransaction(); @Property(selector = "setPresentsWithTransaction:") public native void setPresentsWithTransaction(boolean v); /*</properties>*/ /*<members>*//*</members>*/ /*<methods>*/ @Method(selector = "nextDrawable") public native CAMetalDrawable nextDrawable(); /*</methods>*/ }
[ "fer.madeiral@gmail.com" ]
fer.madeiral@gmail.com
6d67a95f4693db0ff69f3aedf2ce0f43bf4f1d20
941298fe825b6cf5b476620df6820c091cb1f362
/ch6/src/TvTest.java
7a4324dd9301b9b1caadbb4536b23578def7a1ef
[]
no_license
skyies12/java
05180adc9278daa0aae74a6b3b4fbd6727513eb8
ed2917de3b8b519b0efca2295510004e9947b22d
refs/heads/master
2020-05-03T18:41:28.286589
2019-04-01T02:09:12
2019-04-01T02:09:12
178,768,835
0
0
null
null
null
null
UTF-8
Java
false
false
366
java
class Tv { String color; boolean power; int channel; void power() { power = !power; } void channelUp() { ++channel; } void chnnelDown() { --channel; } } public class TvTest { public static void main(String[] args) { Tv t = new Tv(); t.channel = 7; t.chnnelDown(); System.out.println("현재 채널은 " + t.channel + "입니다."); } }
[ "skyies12@naver.com" ]
skyies12@naver.com
2c8253c5ceea3c237ef7599604e881e14a7063c0
2e39d5523e81cc7ec3f0d5b101e73e243e275888
/kotlin/algorithms/GuideToCP/classic-cs-problems/src/main/kotlin/com/br/cp/problems/package-info.java
d9db4ee57194a24ddce269daeaee401d3ae30b09
[]
no_license
chrislucas/competitive-programming
9c85aaa54199c114cc455992c4722a228dcdc891
3ad9a2ceb69afdea151f66243ef86582361b57ff
refs/heads/master
2023-07-29T19:02:56.353807
2023-07-17T13:57:00
2023-07-17T13:57:00
25,211,939
0
1
null
null
null
null
UTF-8
Java
false
false
295
java
package com.br.cp.problems; /** * Modulo para implementar os algoritmos ensinados no livro: * * Problemas classicos da da ciencia da computacao em pytohn de * Davic Kopec * * Como no momento tenho interesse de estudar Kotlin, os algoritmos serao implementados * nessa linguagem * * */
[ "christoffer.luccas@gmail.com" ]
christoffer.luccas@gmail.com
d6ee64e099d4401105e2985f54349176136e4135
4ca66f616ebd8c999f5917059cc21321e35ba851
/src/minecraft/net/minecraft/entity/player/PlayerCapabilities.java
ea9420a51128c8412708985a135232e1a8e5a80e
[]
no_license
MobbyGFX96/Jupiter
1c66c872b4944654c1554f6e3821a63332f5f2cb
c5ee2e16019fc57f5a7f3ecf4a78e9e64ab40221
refs/heads/master
2016-09-10T17:05:11.977792
2014-07-21T09:24:02
2014-07-21T09:24:02
22,002,806
5
0
null
null
null
null
UTF-8
Java
false
false
2,075
java
package net.minecraft.entity.player; import net.minecraft.nbt.NBTTagCompound; public class PlayerCapabilities { private static final String __OBFID = "CL_00001708"; public boolean disableDamage; public boolean isFlying; public boolean allowFlying; public boolean isCreativeMode; public boolean allowEdit = true; private float flySpeed = 0.05F; private float walkSpeed = 0.1F; public void writeCapabilitiesToNBT(NBTTagCompound p_75091_1_) { NBTTagCompound var2 = new NBTTagCompound(); var2.setBoolean("invulnerable", this.disableDamage); var2.setBoolean("flying", this.isFlying); var2.setBoolean("mayfly", this.allowFlying); var2.setBoolean("instabuild", this.isCreativeMode); var2.setBoolean("mayBuild", this.allowEdit); var2.setFloat("flySpeed", this.flySpeed); var2.setFloat("walkSpeed", this.walkSpeed); p_75091_1_.setTag("abilities", var2); } public void readCapabilitiesFromNBT(NBTTagCompound p_75095_1_) { if (p_75095_1_.func_150297_b("abilities", 10)) { NBTTagCompound var2 = p_75095_1_.getCompoundTag("abilities"); this.disableDamage = var2.getBoolean("invulnerable"); this.isFlying = var2.getBoolean("flying"); this.allowFlying = var2.getBoolean("mayfly"); this.isCreativeMode = var2.getBoolean("instabuild"); if (var2.func_150297_b("flySpeed", 99)) { this.flySpeed = var2.getFloat("flySpeed"); this.walkSpeed = var2.getFloat("walkSpeed"); } if (var2.func_150297_b("mayBuild", 1)) { this.allowEdit = var2.getBoolean("mayBuild"); } } } public float getFlySpeed() { return this.flySpeed; } public void setFlySpeed(float p_75092_1_) { this.flySpeed = p_75092_1_; } public float getWalkSpeed() { return this.walkSpeed; } public void setPlayerWalkSpeed(float p_82877_1_) { this.walkSpeed = p_82877_1_; } }
[ "MObbyGFX96@hotmail.co.uk" ]
MObbyGFX96@hotmail.co.uk
8f5cd6d7d086056a8be25c6f97961f338ac4ce9f
2c65c53ef5390bd70fd2ddb9bbc2b19027f2479f
/kangaroo-weixin-toolkit/src/main/java/io/github/pactstart/weixin/mp/message/inbound/LocationMessage.java
1872c2a44cb35fd7d1ab882ae3e354a3f0b1b3a8
[]
no_license
zt6220493/kangaroo
f37cdaa815708fb56e33d8f4ed7d83885551011a
16c8a9f7589ec33f01559d3308f8dd8e49493afe
refs/heads/master
2022-12-28T04:50:48.186699
2019-09-25T10:40:27
2019-09-25T10:40:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
836
java
package io.github.pactstart.weixin.mp.message.inbound; import org.dom4j.Element; /** * Created by Rex.Lei on 2017/7/28. */ public class LocationMessage extends AbstractReceivedMessage { private String locationX; private String locationY; private String scale; private String label; @Override public void readMore(Element root) { this.locationX = root.elementText("Location_X"); this.locationY = root.elementText("Location_Y"); this.scale = root.elementText("Scale"); this.label = root.elementText("Label"); } public String getLocationX() { return locationX; } public String getLocationY() { return locationY; } public String getScale() { return scale; } public String getLabel() { return label; } }
[ "1203208955@qq.com" ]
1203208955@qq.com
e79f5d327ece7b9047ffe3e1599b8aba47495774
d7c5121237c705b5847e374974b39f47fae13e10
/airspan.netspan/src/main/java/Netspan/NBI_18_0/Lte/TrafficManagementProfileGetResult.java
439019298c5b7c4055f1b55ac28b4e571815c89b
[]
no_license
AirspanNetworks/SWITModules
8ae768e0b864fa57dcb17168d015f6585d4455aa
7089a4b6456621a3abd601cc4592d4b52a948b57
refs/heads/master
2022-11-24T11:20:29.041478
2020-08-09T07:20:03
2020-08-09T07:20:03
184,545,627
1
0
null
2022-11-16T12:35:12
2019-05-02T08:21:55
Java
UTF-8
Java
false
false
2,411
java
package Netspan.NBI_18_0.Lte; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for TrafficManagementProfileGetResult complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="TrafficManagementProfileGetResult"&gt; * &lt;complexContent&gt; * &lt;extension base="{http://Airspan.Netspan.WebServices}WsResponse"&gt; * &lt;sequence&gt; * &lt;element name="TrafficManagementProfileResult" type="{http://Airspan.Netspan.WebServices}TrafficManagementProfileResult" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TrafficManagementProfileGetResult", propOrder = { "trafficManagementProfileResult" }) public class TrafficManagementProfileGetResult extends WsResponse { @XmlElement(name = "TrafficManagementProfileResult") protected List<TrafficManagementProfileResult> trafficManagementProfileResult; /** * Gets the value of the trafficManagementProfileResult property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the trafficManagementProfileResult property. * * <p> * For example, to add a new item, do as follows: * <pre> * getTrafficManagementProfileResult().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link TrafficManagementProfileResult } * * */ public List<TrafficManagementProfileResult> getTrafficManagementProfileResult() { if (trafficManagementProfileResult == null) { trafficManagementProfileResult = new ArrayList<TrafficManagementProfileResult>(); } return this.trafficManagementProfileResult; } }
[ "ggrunwald@airspan.com" ]
ggrunwald@airspan.com
d775f940537fbc58e2218a42c4354c5d0aa32929
03d61086047f041168f9a77b02a63a9af83f0f3f
/newrelic/src/main/java/com/newrelic/agent/deps/org/apache/http/impl/cookie/BrowserCompatSpec.java
ec800b936352d170a72a4fde527f2e6e9dd53fea
[]
no_license
masonmei/mx2
fa53a0b237c9e2b5a7c151999732270b4f9c4f78
5a4adc268ac1e52af1adf07db7a761fac4c83fbf
refs/heads/master
2021-01-25T10:16:14.807472
2015-07-30T21:49:33
2015-07-30T21:49:35
39,944,476
1
0
null
null
null
null
UTF-8
Java
false
false
6,666
java
// // Decompiled by Procyon v0.5.29 // package com.newrelic.agent.deps.org.apache.http.impl.cookie; import com.newrelic.agent.deps.org.apache.http.message.BufferedHeader; import java.util.ArrayList; import com.newrelic.agent.deps.org.apache.http.message.BasicHeaderElement; import com.newrelic.agent.deps.org.apache.http.message.BasicHeaderValueFormatter; import com.newrelic.agent.deps.org.apache.http.HeaderElement; import com.newrelic.agent.deps.org.apache.http.util.CharArrayBuffer; import com.newrelic.agent.deps.org.apache.http.message.ParserCursor; import com.newrelic.agent.deps.org.apache.http.FormattedHeader; import com.newrelic.agent.deps.org.apache.http.util.Args; import java.util.List; import com.newrelic.agent.deps.org.apache.http.Header; import com.newrelic.agent.deps.org.apache.http.cookie.MalformedCookieException; import com.newrelic.agent.deps.org.apache.http.cookie.CookieOrigin; import com.newrelic.agent.deps.org.apache.http.cookie.Cookie; import com.newrelic.agent.deps.org.apache.http.cookie.CookieAttributeHandler; import com.newrelic.agent.deps.org.apache.http.annotation.NotThreadSafe; @NotThreadSafe public class BrowserCompatSpec extends CookieSpecBase { private static final String[] DEFAULT_DATE_PATTERNS; private final String[] datepatterns; public BrowserCompatSpec(final String[] datepatterns, final BrowserCompatSpecFactory.SecurityLevel securityLevel) { if (datepatterns != null) { this.datepatterns = datepatterns.clone(); } else { this.datepatterns = BrowserCompatSpec.DEFAULT_DATE_PATTERNS; } switch (securityLevel) { case SECURITYLEVEL_DEFAULT: { this.registerAttribHandler("path", new BasicPathHandler()); break; } case SECURITYLEVEL_IE_MEDIUM: { this.registerAttribHandler("path", new BasicPathHandler() { public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { } }); break; } default: { throw new RuntimeException("Unknown security level"); } } this.registerAttribHandler("domain", new BasicDomainHandler()); this.registerAttribHandler("max-age", new BasicMaxAgeHandler()); this.registerAttribHandler("secure", new BasicSecureHandler()); this.registerAttribHandler("comment", new BasicCommentHandler()); this.registerAttribHandler("expires", new BasicExpiresHandler(this.datepatterns)); this.registerAttribHandler("version", new BrowserCompatVersionAttributeHandler()); } public BrowserCompatSpec(final String[] datepatterns) { this(datepatterns, BrowserCompatSpecFactory.SecurityLevel.SECURITYLEVEL_DEFAULT); } public BrowserCompatSpec() { this(null, BrowserCompatSpecFactory.SecurityLevel.SECURITYLEVEL_DEFAULT); } public List<Cookie> parse(final Header header, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(header, "Header"); Args.notNull(origin, "Cookie origin"); final String headername = header.getName(); if (!headername.equalsIgnoreCase("Set-Cookie")) { throw new MalformedCookieException("Unrecognized cookie header '" + header.toString() + "'"); } HeaderElement[] helems = header.getElements(); boolean versioned = false; boolean netscape = false; for (final HeaderElement helem : helems) { if (helem.getParameterByName("version") != null) { versioned = true; } if (helem.getParameterByName("expires") != null) { netscape = true; } } if (netscape || !versioned) { final NetscapeDraftHeaderParser parser = NetscapeDraftHeaderParser.DEFAULT; CharArrayBuffer buffer; ParserCursor cursor; if (header instanceof FormattedHeader) { buffer = ((FormattedHeader)header).getBuffer(); cursor = new ParserCursor(((FormattedHeader)header).getValuePos(), buffer.length()); } else { final String s = header.getValue(); if (s == null) { throw new MalformedCookieException("Header value is null"); } buffer = new CharArrayBuffer(s.length()); buffer.append(s); cursor = new ParserCursor(0, buffer.length()); } helems = new HeaderElement[] { parser.parseHeader(buffer, cursor) }; } return this.parse(helems, origin); } public List<Header> formatCookies(final List<Cookie> cookies) { Args.notEmpty(cookies, "List of cookies"); final CharArrayBuffer buffer = new CharArrayBuffer(20 * cookies.size()); buffer.append("Cookie"); buffer.append(": "); for (int i = 0; i < cookies.size(); ++i) { final Cookie cookie = cookies.get(i); if (i > 0) { buffer.append("; "); } final String cookieName = cookie.getName(); final String cookieValue = cookie.getValue(); if (cookie.getVersion() > 0 && (!cookieValue.startsWith("\"") || !cookieValue.endsWith("\""))) { BasicHeaderValueFormatter.INSTANCE.formatHeaderElement(buffer, new BasicHeaderElement(cookieName, cookieValue), false); } else { buffer.append(cookieName); buffer.append("="); if (cookieValue != null) { buffer.append(cookieValue); } } } final List<Header> headers = new ArrayList<Header>(1); headers.add(new BufferedHeader(buffer)); return headers; } public int getVersion() { return 0; } public Header getVersionHeader() { return null; } public String toString() { return "compatibility"; } static { DEFAULT_DATE_PATTERNS = new String[] { "EEE, dd MMM yyyy HH:mm:ss zzz", "EEE, dd-MMM-yy HH:mm:ss zzz", "EEE MMM d HH:mm:ss yyyy", "EEE, dd-MMM-yyyy HH:mm:ss z", "EEE, dd-MMM-yyyy HH-mm-ss z", "EEE, dd MMM yy HH:mm:ss z", "EEE dd-MMM-yyyy HH:mm:ss z", "EEE dd MMM yyyy HH:mm:ss z", "EEE dd-MMM-yyyy HH-mm-ss z", "EEE dd-MMM-yy HH:mm:ss z", "EEE dd MMM yy HH:mm:ss z", "EEE,dd-MMM-yy HH:mm:ss z", "EEE,dd-MMM-yyyy HH:mm:ss z", "EEE, dd-MM-yyyy HH:mm:ss z" }; } }
[ "dongxu.m@gmail.com" ]
dongxu.m@gmail.com
a812757a6aedac5faca044c948992deec9cbe11a
524f7bba8e6f7283b278a469466e538c7f63701e
/贝王-App源码/MStore安卓/mdwmall/src/main/java/com/qianseit/westore/ui/CustomListSelectorPopupWindow.java
0d0c95c49868915af3c776a4e349623580f958cb
[]
no_license
xiongdaxionger/BSLIFE
e63e3582f6eec8c95636be39839c5f29b69b36ee
198a8c15ad32de493404022b9e00b0fe7202de08
refs/heads/master
2020-05-16T10:00:49.652335
2019-04-24T08:56:29
2019-04-24T08:56:29
182,962,206
0
0
null
null
null
null
UTF-8
Java
false
false
5,859
java
package com.qianseit.westore.ui; import java.util.List; import org.json.JSONException; import org.json.JSONObject; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.view.KeyEvent; import android.view.View; import android.view.WindowManager; import android.view.View.OnClickListener; import android.view.View.OnKeyListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.PopupWindow; import android.widget.TextView; import com.beiwangfx.R; public abstract class CustomListSelectorPopupWindow extends PopupWindow { private Activity mActivity; private View mView; private TextView mTitleTextView; private ListView mListView; private List<CustomListSelectorBean> mLists; private CustomListSelectorAdapter mAdapter; private int mSelectedPosition = 0; private String mTitle; public CustomListSelectorPopupWindow(Activity activity, String title, List<CustomListSelectorBean> lists) { this.mActivity = activity; this.mLists = lists; mTitle = title; this.init(); } private void init() { this.mView = View.inflate(mActivity, R.layout.popup_custom_selector, null); this.mView.setFocusable(true); this.mView.setFocusableInTouchMode(true); this.mView.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (isShowing()) { dismiss(); return true; } return false; } }); this.setContentView(mView); WindowManager wm = (WindowManager) mView.getContext().getSystemService(Context.WINDOW_SERVICE); this.setWidth(wm.getDefaultDisplay().getWidth() * 4 / 5); this.setHeight(LayoutParams.WRAP_CONTENT); this.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); this.setTouchable(true); this.setFocusable(true); this.setOutsideTouchable(true); this.update(); mTitleTextView = (TextView) this.mView.findViewById(R.id.title); mTitleTextView.setText(mTitle); mListView = (ListView) this.mView.findViewById(R.id.listView1); mListView.setAdapter((mAdapter = new CustomListSelectorAdapter())); mListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { onSelected(position); dismiss(); } }); mView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (isShowing()) { dismiss(); } } }); } @Override public void dismiss() { WindowManager.LayoutParams params = mActivity.getWindow().getAttributes(); params.alpha = 1f; mActivity.getWindow().setAttributes(params); super.dismiss(); } @Override public void showAtLocation(View parent, int gravity, int x, int y) { beginShow(); super.showAtLocation(parent, gravity, x, y); } @Override public void showAsDropDown(View anchor) { // TODO Auto-generated method stub beginShow(); super.showAsDropDown(anchor); } @Override public void showAsDropDown(View anchor, int xoff, int yoff) { // TODO Auto-generated method stub beginShow(); super.showAsDropDown(anchor, xoff, yoff); } @SuppressLint("NewApi") @Override public void showAsDropDown(View anchor, int xoff, int yoff, int gravity) { // TODO Auto-generated method stub beginShow(); super.showAsDropDown(anchor, xoff, yoff, gravity); } void beginShow() { WindowManager.LayoutParams params = mActivity.getWindow().getAttributes(); params.alpha = 0.7f; mActivity.getWindow().setAttributes(params); } public void onSelected(int position) { if (mLists == null || mLists.size() <= position || position < 0) { return; } for (int i = 0; i < mLists.size(); i++) { mLists.get(i).mSelected = position == i; } mSelectedPosition = position; onItemSelected(mLists.get(position)); } private class CustomListSelectorAdapter extends BaseAdapter { private ViewHolder mHolder; @Override public int getCount() { return mLists.size(); } @Override public Object getItem(int position) { return mLists.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { mHolder = new ViewHolder(); convertView = View.inflate(mActivity, R.layout.item_custom_list_selector_popup, null); mHolder.mSelect = (Button) convertView.findViewById(R.id.button1); mHolder.mTitle = (TextView) convertView.findViewById(R.id.textView1); convertView.setTag(mHolder); } else { mHolder = (ViewHolder) convertView.getTag(); } CustomListSelectorBean nBean = mLists.get(position); mHolder.mSelect.setSelected(nBean.mSelected); mHolder.mTitle.setText(nBean.mName); return convertView; } private class ViewHolder { public TextView mTitle; public Button mSelect; } } public void notifyDataSetChanged() { this.mAdapter.notifyDataSetChanged(); } public abstract void onItemSelected(CustomListSelectorBean selectedBean); public static class CustomListSelectorBean { public String mID = ""; public String mName = ""; public String mType = ""; public boolean mSelected = false; public CustomListSelectorBean(String id, String type, String name, boolean selected) { mID = id; mType = type; mName = name; mSelected = selected; } public CustomListSelectorBean(String id, String name, boolean selected) { mID = id; mType = ""; mName = name; mSelected = selected; } } }
[ "xiongerxiongda@gmail.com" ]
xiongerxiongda@gmail.com
7126ceede4821419081f907a4527143621125233
d9477e8e6e0d823cf2dec9823d7424732a7563c4
/jEdit/branches/4.3.x/org/gjt/sp/jedit/io/RegexEncodingDetector.java
0415d5be547018e4cf7ed87c7da92b67e47db85c
[]
no_license
RobertHSchmidt/jedit
48fd8e1e9527e6f680de334d1903a0113f9e8380
2fbb392d6b569aefead29975b9be12e257fbe4eb
refs/heads/master
2023-08-30T02:52:55.676638
2018-07-11T13:28:01
2018-07-11T13:28:01
140,587,948
1
0
null
null
null
null
UTF-8
Java
false
false
3,473
java
/* * :tabSize=8:indentSize=8:noTabs=false: * :folding=explicit:collapseFolds=1: * * Copyright (C) 2008 Kazutoshi Satoda * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.gjt.sp.jedit.io; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.util.regex.Pattern; import java.util.regex.Matcher; import java.nio.CharBuffer; /** * An encoding detector which finds regex pattern. * * This reads the sample in the system default encoding for first some * lines and look for a regex pattern. This can fail if the * stream cannot be read in the system default encoding or the * pattern is not found at near the top of the stream. * * @since 4.3pre16 * @author Kazutoshi Satoda */ public class RegexEncodingDetector implements EncodingDetector { /** * A regex pattern matches to "Charset names" specified for * java.nio.charset.Charset. * @see <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/Charset.html#names">Charset names</a> */ public static final String VALID_ENCODING_PATTERN = "\\p{Alnum}[\\p{Alnum}\\-.:_]*"; private final Pattern pattern; private final String replacement; public RegexEncodingDetector(String pattern, String replacement) { this.pattern = Pattern.compile(pattern); this.replacement = replacement; } public String detectEncoding(InputStream sample) throws IOException { InputStreamReader reader = new InputStreamReader(sample); final int bufferSize = 1024; char[] buffer = new char[bufferSize]; int readSize = reader.read(buffer, 0, bufferSize); if (readSize > 0) { Matcher matcher = pattern.matcher( CharBuffer.wrap(buffer, 0, readSize)); // Tracking of this implicit state within Matcher // is required to know where is the start of // replacement after calling appendReplacement(). int appendPosition = 0; while (matcher.find()) { String extracted = extractReplacement( matcher, appendPosition, replacement); if (EncodingServer.hasEncoding(extracted)) { return extracted; } appendPosition = matcher.end(); } } return null; } /** * Returns a replaced string for a Matcher which has been matched * by find() method. */ private static String extractReplacement( Matcher found, int appendPosition, String replacement) { /* * It doesn't make sense to read before start, but * appendReplacement() requires to to it. */ int found_start = found.start(); int found_end = found.end(); int source_length = found_end - found_start; int length_before_match = found_start - appendPosition; StringBuffer replaced = new StringBuffer( length_before_match + (source_length * 2)); found.appendReplacement(replaced, replacement); return replaced.substring(length_before_match); } }
[ "Vampire0@6b1eeb88-9816-0410-afa2-b43733a0f04e" ]
Vampire0@6b1eeb88-9816-0410-afa2-b43733a0f04e
1060aaf2f72866134cc6dda60ee0ad9996212536
6f516315e7454a250ad09c6ac1a1bbffd284917b
/.svn/pristine/1a/1a4534e53bf3c358e0039dd9c241c9d2bfa54e7d.svn-base
26d3f86336ec8591f027950255991c26c7c8c4ae
[]
no_license
tianxiao666/rno-gsm
ee50b243f012615487f6a8a30e90bc01f4c20517
9527fae599c4f5ddb4f7b19da78cc36f2f33919d
refs/heads/master
2021-04-03T04:17:53.751162
2018-03-13T09:19:15
2018-03-13T09:19:15
125,024,357
0
0
null
null
null
null
UTF-8
Java
false
false
538
package com.hgicreate.rno.gsm.service.optimize; import com.hgicreate.rno.gsm.model.Page; import java.util.List; import java.util.Map; public interface AccordanceCheckService { /** *分页计算一致性检查 */ List<Map<String,Object>> calculateAccordanceByPage(Map<String,Object> condition,Page page,String order) throws Exception; /** *分页查询一致性检查 */ List<Map<String, Object>> inquireAccordanceByPage(Map<String, Object> condition, Page page,String order) throws Exception; }
[ "chao.xj@hgicreate.com" ]
chao.xj@hgicreate.com
f3781a31bc025392bcb9b5070e269f89b603a8d5
e19ec9029735f0a38a9245e9ac1c6a10af880238
/src/main/java/com/ssi/HQLFilteration.java
db05fef022633cbae416471249912dc9f81b33c6
[]
no_license
ssiedu/hibernate-first-21-05-19
8305e0c97fe20a6f6694173ecd9868b5c84da0a9
40a363a9601a444f58a3cc7a3cc709e80d02b5ee
refs/heads/master
2022-12-03T10:16:08.973881
2019-05-25T10:05:06
2019-05-25T10:05:06
187,812,560
0
0
null
2022-11-24T07:02:17
2019-05-21T10:08:39
Java
UTF-8
Java
false
false
562
java
package com.ssi; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; public class HQLFilteration { public static void main(String[] args) { Session session=DataUtility.getSF().openSession(); Query query=session.createQuery("select rno,name,branch from Student order by rno desc"); List<Object[]> students=query.list(); for(Object ar[]:students){ for(Object obj:ar){ System.out.println(obj); } System.out.println("__________________________________"); } session.close(); } }
[ "manoj.sarwate@ssiedu.in" ]
manoj.sarwate@ssiedu.in