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
9af72320258c272b8141ba809457051a3352b5cd
9a70020d409332b7db0e2e5e087f500a0e58217c
/BOJ/5800/Main.java
43ff0d17b6e9f136f9da40476f267daa262fe655
[ "MIT" ]
permissive
ISKU/Algorithm
daf5e9d5397eaf7dad2d6f7fb18c1c94d8f0246d
a51449e4757e07a9dcd1ff05f2ef4b53e25a9d2a
refs/heads/master
2021-06-22T09:42:45.033235
2021-02-01T12:45:28
2021-02-01T12:45:28
62,798,871
55
12
null
null
null
null
UTF-8
Java
false
false
795
java
/* * Author: Kim Min-Ho (ISKU) * Date: 2017.03.01 * Email: minho1a@hanmail.net * * https://github.com/ISKU/Algorithm * https://www.acmicpc.net/problem/5800 */ import java.util.Scanner; import java.util.Arrays; public class Main { public static void main(String... args) { Scanner input = new Scanner(System.in); int testCase = input.nextInt(); for (int X = 1; X <= testCase; X++) { int[] score = new int[input.nextInt()]; for (int i = 0; i < score.length; i++) score[i] = input.nextInt(); Arrays.sort(score); int maxGap = 0; for (int i = score.length - 1; i > 0; i--) maxGap = Math.max(maxGap, score[i] - score[i - 1]); System.out.printf("Class %d\nMax %d, Min %d, Largest gap %d\n", X, score[score.length - 1], score[0], maxGap); } } }
[ "minho1a@hanmail.net" ]
minho1a@hanmail.net
d7d3c6f561f2a153319d20f6883e469bbfcc7972
c85c460e7c7410e66aec5d2b1c5b44467a320d58
/src/test/java/com/alibaba/druid/bvt/sql/eval/EvalTest.java
d3f3da6bd0cd174a90597dd3de1696168bc192d9
[]
no_license
Pengxiaolong/druid
f51900708114a34872b79a397a254344f066bb54
cc6956c7df7c2037d8d2169cea068444b20f7d5d
refs/heads/master
2020-12-25T17:03:11.640854
2012-08-18T14:28:42
2012-08-18T14:28:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
package com.alibaba.druid.bvt.sql.eval; import junit.framework.Assert; import junit.framework.TestCase; import com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils; import com.alibaba.druid.util.JdbcUtils; public class EvalTest extends TestCase { public void testEval() throws Exception { Assert.assertEquals("A", SQLEvalVisitorUtils.evalExpr(JdbcUtils.MYSQL, "?", "A")); Assert.assertEquals(123, SQLEvalVisitorUtils.evalExpr(JdbcUtils.MYSQL, "?", 123)); } public void testEval_1() throws Exception { Assert.assertEquals("AB", SQLEvalVisitorUtils.evalExpr(JdbcUtils.MYSQL, "? + ?", "A", "B")); Assert.assertEquals(234, SQLEvalVisitorUtils.evalExpr(JdbcUtils.MYSQL, "? + ?", 123, 111)); } }
[ "szujobs@hotmail.com" ]
szujobs@hotmail.com
7740f2307c403820438544ef6d7213d61f81e030
22b9c697e549de334ac354dfc1d14223eff99121
/PaaS-SaaS_UIAccelerator/UIAcceleratorExtended/OSCProxyClient/src/com/oracle/ptsdemo/oscproxyclient/types/DataObject.java
13ed918366e6f6f30638c948b4c2367ac2f623cb
[ "BSD-3-Clause" ]
permissive
digideskio/oracle-cloud
50e0d24e937b3afc991ad9cb418aa2bb263a4372
80420e9516290e5d5bfd6c0fa2eaacbc11762ec7
refs/heads/master
2021-01-22T13:57:21.947497
2016-05-13T06:26:16
2016-05-13T06:26:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
750
java
package com.oracle.ptsdemo.oscproxyclient.types; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for DataObject complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="DataObject"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DataObject", namespace = "commonj.sdo") public abstract class DataObject { }
[ "shailendrapradhan@Shailendras-MacBook-Pro.local" ]
shailendrapradhan@Shailendras-MacBook-Pro.local
7fa33e1598782c591af6ccb308386c640bd55ffc
774d36285e48bd429017b6901a59b8e3a51d6add
/sources/com/google/android/gms/internal/drive/zzif.java
cac9db470678591c05ce0168c770a7679b792ad9
[]
no_license
jorge-luque/hb
83c086851a409e7e476298ffdf6ba0c8d06911db
b467a9af24164f7561057e5bcd19cdbc8647d2e5
refs/heads/master
2023-08-25T09:32:18.793176
2020-10-02T11:02:01
2020-10-02T11:02:01
300,586,541
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
package com.google.android.gms.internal.drive; import com.google.android.gms.common.util.GmsVersion; public final class zzif { public static final zzig zzld = new zzig("created", GmsVersion.VERSION_HALLOUMI); public static final zzih zzle = new zzih("lastOpenedTime", GmsVersion.VERSION_JARLSBERG); public static final zzij zzlf = new zzij("modified", GmsVersion.VERSION_HALLOUMI); public static final zzii zzlg = new zzii("modifiedByMe", GmsVersion.VERSION_HALLOUMI); public static final zzil zzlh = new zzil("sharedWithMe", GmsVersion.VERSION_HALLOUMI); public static final zzik zzli = new zzik("recency", GmsVersion.VERSION_SAGA); }
[ "jorge.luque@taiger.com" ]
jorge.luque@taiger.com
535e59e1b4f3d0de84d9499ecfcec37b5b2cde05
13da4b96dea7e2d32b9509244ba1413f15e735d0
/src/main/java/com/cofc/service/RechargeOrderService.java
2aa5e3d4b9e4e542c5199800576a60cb60a928a6
[]
no_license
gateshibill/shares100
f178d8a7377c72e705e1e337d18bdf61e2a222e4
7ccad7a4696873372cb6fb5d0bb60ca6183df76f
refs/heads/master
2022-12-21T07:55:00.747148
2020-09-24T03:23:13
2020-09-24T03:23:41
235,473,835
0
0
null
2022-12-10T03:56:33
2020-01-22T01:12:34
Java
UTF-8
Java
false
false
1,155
java
package com.cofc.service; import java.util.List; import org.apache.ibatis.annotations.Param; import com.cofc.pojo.RechargeOrder; public interface RechargeOrderService { public void addRechargeOrder(RechargeOrder rechargeOrder); public RechargeOrder getlistByRechargeId(@Param("rechargeId")Integer rechargeId); public void updateRechargeOrder(RechargeOrder rechargeOrder); public List<RechargeOrder> wxgetlistByUserId(@Param("userId")Integer userId,@Param("loginPlat")Integer loginPlat, @Param("pageNo")Integer pageNo,@Param("pageSize")Integer pageSize); //后台 public int getRechargeCount(@Param("order")RechargeOrder order); public List<RechargeOrder> getAllRechargeList(@Param("order")RechargeOrder order,@Param("page")Integer page,@Param("limit")Integer limit); //区分应用 public int getRechargeCountByLoginPlat(@Param("loginPlatList")List<String> loginPlatList,@Param("order")RechargeOrder order); public List<RechargeOrder> getAllRechargeListByLoginPlat(@Param("loginPlatList")List<String> loginPlatList, @Param("order")RechargeOrder order,@Param("page")Integer page,@Param("limit")Integer limit); }
[ "z1-bill@ik8s.com" ]
z1-bill@ik8s.com
d42e9a70873092777f915a5abfdcebdb432d405e
542efb2d447273d5142ef92129bbbdd9914344a2
/onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseThumbnailStreamRequestBuilder.java
27793fde0c9264045d4dff00ac04357432b4388c
[ "MIT" ]
permissive
spudi/onedrive-sdk-android
d8c58640345a7f7e6e35efc6e1c68384c93e21df
1553371690e52d9b4ff9c9ee0b89c44879b43711
refs/heads/master
2021-04-27T00:22:41.735684
2018-03-05T14:32:55
2018-03-05T14:32:55
123,801,688
0
0
MIT
2018-03-04T15:25:44
2018-03-04T15:25:44
null
UTF-8
Java
false
false
2,669
java
// ------------------------------------------------------------------------------ // Copyright (c) 2015 Microsoft Corporation // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // ------------------------------------------------------------------------------ package com.onedrive.sdk.generated; import com.onedrive.sdk.concurrency.*; import com.onedrive.sdk.core.*; import com.onedrive.sdk.extensions.*; import com.onedrive.sdk.http.*; import com.onedrive.sdk.generated.*; import com.onedrive.sdk.options.*; import com.onedrive.sdk.serializer.*; import java.util.*; // **NOTE** This file was generated by a tool and any changes will be overwritten. /** * The class for the Base Thumbnail Stream Request Builder. */ public class BaseThumbnailStreamRequestBuilder extends BaseRequestBuilder implements IBaseThumbnailStreamRequestBuilder { /** * The request builder for the ThumbnailStream * * @param requestUrl The request url * @param client The service client * @param options The options for this request */ public BaseThumbnailStreamRequestBuilder(final String requestUrl, final IOneDriveClient client, final List<Option> options) { super(requestUrl, client, options); } /** * Creates the request */ public IThumbnailStreamRequest buildRequest() { return buildRequest(getOptions()); } /** * Creates the request with specific options instead of the existing options */ public IThumbnailStreamRequest buildRequest(final List<Option> options) { return new ThumbnailStreamRequest(getRequestUrl(), getClient(), options); } }
[ "pnied@microsoft.com" ]
pnied@microsoft.com
a2efdcba57d840f5da8621daa5dff535981d4603
7372b52557f72a87f592f55a1e05ba86af3240be
/src/main/java/com/example/demo/DemoApplication.java
1e81ab09c2ea0412b9224fdfc049e3d8ccd16af7
[]
no_license
KiMiWaWonderful/VehicleDemoBackEnd
a3738ac7f0cd87c6b7c95865faa82f5ad5a26aa8
d951f61a709ce990ae16d61322417b290ab13862
refs/heads/master
2022-06-24T10:53:43.064513
2021-03-09T00:11:59
2021-03-09T00:11:59
249,587,582
2
0
null
2022-06-21T03:02:57
2020-03-24T01:52:40
Java
UTF-8
Java
false
false
392
java
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import tk.mybatis.spring.annotation.MapperScan; @SpringBootApplication @MapperScan("com.example.demo.mapper") public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
[ "l571209083m@gmail.com" ]
l571209083m@gmail.com
06c48c3af202fe9a29fe563aa495d5840cca86b7
190b5ae047d13b59072a0b3e41a92ec8887910e8
/_src/Chapter08/glassfish/lab5/src/ejb30/MDB/ProcessCustomerBean.java
8171d8d257411fdf4e72f144b0af06ee8a4946f8
[ "Apache-2.0" ]
permissive
paullewallencom/java-978-1-8471-9560-9
a240d32119c12e44951b079c1a23f9a203f503c4
b648d4da4cc0bb0be8804ee6e3b5c5b7405e3cd7
refs/heads/main
2023-02-06T13:11:46.712281
2020-12-28T02:55:23
2020-12-28T02:55:23
319,395,328
0
0
null
null
null
null
UTF-8
Java
false
false
3,040
java
package ejb30.MDB; import javax.persistence.EntityManager; import ejb30.entity.Customer; import javax.persistence.PersistenceContext; import javax.ejb.EJBException; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.ejb.MessageDriven; import javax.ejb.ActivationConfigProperty; import javax.jms.*; import javax.annotation.Resource; @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NonDurable"), @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NonDurable"), @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "Priority = 'HIGH'") }, mappedName="BankServiceJMSTopic" ) public class ProcessCustomerBean implements MessageListener { @Resource(mappedName="BankServiceConnectionFactory") private ConnectionFactory cf; @PersistenceContext(unitName="BankService") private EntityManager em; @PostConstruct public void init() { System.out.println("Post Constructor Method init() Invoked"); } public void onMessage(Message message) { try { if (message instanceof ObjectMessage) { ObjectMessage objmsg = (ObjectMessage) message; Customer cust = (Customer) objmsg.getObject(); Customer mergedCust = em.merge(cust); System.out.println("MDB: Customer persisted"); sendConfirmation(objmsg, cf); } else { System.out.println("Wrong type of message"); } } catch(Exception e) { throw new EJBException(e); } } private void sendConfirmation(ObjectMessage objmsg, ConnectionFactory cf) { Connection conn = null; try { Queue queue = (Queue) objmsg.getJMSReplyTo(); conn = cf.createConnection(); Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer mp = sess.createProducer(queue); TextMessage msg = sess.createTextMessage("Customer added to databae"); mp.send(msg); } catch (JMSException ex) { System.out.println("JMS Exception:" + ex.getMessage() ); } finally { try { conn.close(); // System.exit(0); // glassfish work around } catch (JMSException ex) { } } } @PreDestroy public void tidyUp() { System.out.println("Pre Destruction Method tidyUp() Invoked"); } }
[ "paullewallencom@users.noreply.github.com" ]
paullewallencom@users.noreply.github.com
d5414631b19029c6fce05bc8950befe2366706fa
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/hbase-20190101/src/main/java/com/aliyun/hbase20190101/models/AllocatePublicNetworkAddressRequest.java
6a6f9d24bbb2d597fc882fa95707689d5e3c2e60
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,009
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.hbase20190101.models; import com.aliyun.tea.*; public class AllocatePublicNetworkAddressRequest extends TeaModel { @NameInMap("ClientToken") public String clientToken; @NameInMap("ClusterId") public String clusterId; public static AllocatePublicNetworkAddressRequest build(java.util.Map<String, ?> map) throws Exception { AllocatePublicNetworkAddressRequest self = new AllocatePublicNetworkAddressRequest(); return TeaModel.build(map, self); } public AllocatePublicNetworkAddressRequest setClientToken(String clientToken) { this.clientToken = clientToken; return this; } public String getClientToken() { return this.clientToken; } public AllocatePublicNetworkAddressRequest setClusterId(String clusterId) { this.clusterId = clusterId; return this; } public String getClusterId() { return this.clusterId; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
4715e01342739a31a810d3860eafcf3371d2944f
b73058196b620bb0df995c31cd5e0ccdf0815758
/1.JavaSyntax/src/com/javarush/task/task07/task0721/Solution.java
b89cfceeb133433e10f148acea9f2534388ee5e0
[]
no_license
churakovIA/javarush
71eda59de48f55eb22a50ebf3863302798167742
8d8a359be84acca04c639dbfe09a0ff0a00d64af
refs/heads/master
2020-05-24T22:13:02.164584
2019-05-19T15:58:18
2019-05-19T15:58:18
187,493,333
0
0
null
null
null
null
UTF-8
Java
false
false
1,077
java
package com.javarush.task.task07.task0721; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.IntSummaryStatistics; /* Минимаксы в массивах */ public class Solution { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int maximum; int minimum; //напишите тут ваш код int[] nums = new int[20]; for(int i=0;i<nums.length;i++) nums[i] = Integer.parseInt(reader.readLine()); IntSummaryStatistics stats = Arrays.stream(nums).collect(IntSummaryStatistics::new, IntSummaryStatistics::accept, IntSummaryStatistics::combine); maximum = stats.getMax(); minimum = stats.getMin(); System.out.println(maximum); System.out.println(minimum); } }
[ "40851219+churakovIA@users.noreply.github.com" ]
40851219+churakovIA@users.noreply.github.com
279434c41bd9cb4f4d8213f232c5d3bb7b8ad0c0
81ef59adf10dc4b8749c55c26f028430cf4c3844
/src/test/java/com/example/cicdproj/CicdprojApplicationTests.java
5de182561d64851dbcdcc6fc2e3db434414cdb9a
[]
no_license
LionelBeato/shiny-octo-train
91244fe09778f9d16f784105db7018fafd9f0686
f2fdc8dc428f36ba0065bc15904a60ab843a8b6a
refs/heads/main
2023-01-09T20:37:18.583608
2020-11-11T19:34:07
2020-11-11T19:34:07
311,691,338
0
0
null
2020-11-11T14:30:13
2020-11-10T14:54:34
Java
UTF-8
Java
false
false
427
java
package com.example.cicdproj; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest class CicdprojApplicationTests { // @Autowired private MathController controller; @Test void contextLoads() { // assertThat(controller).isNotNull(); } }
[ "lionel.beato@gmail.com" ]
lionel.beato@gmail.com
2c09dadfdf63dbdbe58c2943a9ab8c1b58a2ccde
03fe0c3f265d1fab9511d20e29274d41fd076f3a
/design-pattern/src/main/java/com/jeiker/designpattern/struct/FlyweightDemo.java
6882930c909a6fc7872c4fd26e3f334fc804434b
[ "MIT" ]
permissive
jeikerxiao/design-pattern
7aa3c25f2c2f24fa0c6d4d5e567db452f5ec9fb7
97f9a63a0147b528e854bfbd01c9b0c85a67b268
refs/heads/master
2020-03-07T08:43:56.318533
2019-03-15T07:09:18
2019-03-15T07:09:18
127,386,847
0
0
null
null
null
null
UTF-8
Java
false
false
1,952
java
package com.jeiker.designpattern.struct; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Vector; /** * 享元模式的主要目的是实现对象的共享,即共享池,当系统中对象多的时候可以减少内存的开销,通常与工厂模式一起使用。 * 下面数据库连接池的代码 * 通过连接池的管理,实现了数据库连接的共享,不需要每一次都重新创建连接,节省了数据库重新创建的开销,提升了系统的性能! */ public class FlyweightDemo { private Vector<Connection> pool; /** * 公有属性 */ private String url = "jdbc:mysql://localhost:3306/test"; private String username = "root"; private String password = "root"; private String driverClassName = "com.mysql.jdbc.Driver"; private int poolSize = 100; private static FlyweightDemo instance = null; Connection conn = null; /** * 构造方法,做一些初始化工作 */ private FlyweightDemo() { pool = new Vector<Connection>(poolSize); for (int i = 0; i < poolSize; i++) { try { Class.forName(driverClassName); conn = DriverManager.getConnection(url, username, password); pool.add(conn); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } } /** * 返回连接到连接池 */ public synchronized void release() { pool.add(conn); } /** * 返回连接池中的一个数据库连接 */ public synchronized Connection getConnection() { if (pool.size() > 0) { Connection conn = pool.get(0); pool.remove(conn); return conn; } else { return null; } } }
[ "jeiker@126.com" ]
jeiker@126.com
4dddc4900398fd7519d504dac334a8799bbcd600
23e29b3faca0a2c6260bbd01698ea9e7f252d256
/app/src/main/java/com/android/fitz/fastreading/ui/activity/Test/ReadTestMainActivity.java
9f418a894ba678a31ce6e0cd7653f8b1ef9e06b6
[]
no_license
zq019633/fast
14d2288b227c40d03bc1fe2103a093332d594251
4223804459b93104f44f87785db836961e945a83
refs/heads/master
2020-09-28T04:18:04.122174
2019-12-08T15:08:38
2019-12-08T15:08:38
226,685,846
0
0
null
null
null
null
UTF-8
Java
false
false
4,977
java
package com.android.fitz.fastreading.ui.activity.Test; import android.graphics.Bitmap; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.view.View; import com.android.fitz.fastreading.R; import com.android.fitz.fastreading.adapter.ClassesMenuAdapter; import com.android.fitz.fastreading.adapter.ReadTestBookAdapter; import com.android.fitz.fastreading.base.AppApplication; import com.android.fitz.fastreading.base.BaseActivity; import com.android.fitz.fastreading.bean.BookEntity; import com.android.fitz.fastreading.constant.Constant; import com.android.fitz.fastreading.db.entity.Article; import com.android.fitz.fastreading.db.entity.Test; import com.android.fitz.fastreading.db.greendao.ArticleDao; import com.android.fitz.fastreading.db.greendao.DaoSession; import com.android.fitz.fastreading.db.greendao.TestDao; import com.android.library.widget.XRecyclerView; import com.chad.library.adapter.base.BaseQuickAdapter; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.OnClick; import rx.android.schedulers.AndroidSchedulers; import rx.functions.Action1; import rx.schedulers.Schedulers; public class ReadTestMainActivity extends BaseActivity { @BindView(R.id.recyclerview) XRecyclerView mRecyclerView; ReadTestBookAdapter adapter; TestDao testDao; @Override protected void initView() { initAdapter(); DaoSession daoSession = ((AppApplication) getApplication()).getDaoSession(); testDao = daoSession.getTestDao(); getBookData(); } @Override protected int getContentViewLayoutID() { return R.layout.activity_read_test_main; } @Override protected void initInjector() { } private void initAdapter() { //mSwipeRefreshLayout.setOnRefreshListener(this); mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); adapter = new ReadTestBookAdapter(R.layout.classes_book_list_item, new ArrayList<List<Test>>()); adapter.openLoadAnimation(); adapter.setOnItemChildClickListener(childClickListener); adapter.setEnableLoadMore(false); mRecyclerView.setAdapter(adapter); } BaseQuickAdapter.OnItemChildClickListener childClickListener = new BaseQuickAdapter.OnItemChildClickListener() { @Override public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) { List<Test> list = (List<Test>)adapter.getItem(position); Test test = null; switch (view.getId()){ case R.id.img1: test = list.get(0); break; case R.id.img2: test = list.get(1); break; case R.id.img3: test = list.get(2); break; case R.id.img4: test = list.get(3); break; } Bundle bundle = new Bundle(); bundle.putString(Constant.COMMON_KEY, test.getId()); //readyGo(TestReadingActivity.class, bundle); readyGo(TestReadingActivity.class, bundle); } }; @OnClick(R.id.back) public void onViewClicked() { finish(); } public void getBookData() { testDao .rx() .loadAll() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Action1<List<Test>>() { @Override public void call(List<Test> testList) { // for(int i =0; i <16; i ++){ // articlesList.add(articlesList.get(0)); // } int count = testList.size(); int j = 4 - (count % 4); for(int i = 0; i <j ; i++){ testList.add(new Test()); } List<List<Test>> mList = new ArrayList<>(); List<Test> list = new ArrayList<Test>(); for (int i = 0; i < testList.size(); i++) { Test item = testList.get(i); if(i % 4 == 0){ list = new ArrayList<Test>(); } if(item.getId() != null){ list.add(item); } if(i % 4 == 0){ if(list.size() > 0) { mList.add(list); } } } adapter.setNewData(mList); } }); } }
[ "1020498110@qq.com" ]
1020498110@qq.com
54aa7a53c527c2a0da7f9176e765a24863cef0e5
5b8c2dd9fcd176f5c77b959c8357402e7ce0474d
/lambda-workflow-core/src/main/java/com/yatop/lambda/workflow/core/richmodel/component/specification/CmptSpecCharValue.java
0085283e46068d6d169ea1340cce5139953fe2d4
[]
no_license
ruhengChen/lambda-mls
6cbfc5804193f68bbc98a5900d7e3fa91cf6ef00
2450c25c25c91bb3af1946fbf21206a6636d71d0
refs/heads/master
2020-04-20T05:45:30.853959
2019-02-13T02:36:57
2019-02-13T02:36:57
168,664,310
1
0
null
null
null
null
UTF-8
Java
false
false
350
java
package com.yatop.lambda.workflow.core.richmodel.component.specification; import com.yatop.lambda.base.model.CfCmptSpecCharValue; import com.yatop.lambda.workflow.core.richmodel.RichModel; public class CmptSpecCharValue extends RichModel<CfCmptSpecCharValue> { public CmptSpecCharValue(CfCmptSpecCharValue data) { super(data); } }
[ "tomlee714@126.com" ]
tomlee714@126.com
bf5b06669647c81f6cfc658efd51e6804d0682ee
b47825be975d3b40a550d82a0caedb97268efed6
/abstract-factory-pattern-complex/src/example3/HollywoodActionMovie.java
9bf2cf17f342c9dac5bf96d090fc7b42c8e31b2b
[]
no_license
kbhatt23/java-design-patterns
bd248c65fbc78992576fc2838121d64fa7a74e24
5e84e8e59f234b5283e6b65546d07464f0fe9fde
refs/heads/master
2023-02-05T19:02:11.815280
2023-02-02T08:42:45
2023-02-02T08:42:45
232,586,351
0
0
null
null
null
null
UTF-8
Java
false
false
178
java
package example3; public class HollywoodActionMovie implements HollywoodMovie{ @Override public void printMovieName() { System.out.println("Hollywood action movie"); } }
[ "admin@admin-PC" ]
admin@admin-PC
d6976b4b649b495bafe65aa6aed1e36f3e4d6954
8312f629dc85dbce8e925f49e13652792a0027cf
/src/main/java/mySpring/InjectByFieldTypeObjectConfigurer.java
a1093abe816ad1b092ff58af2af3b7f2026699f2
[]
no_license
Jeka1978/javacourse-nice-basic-2017
ea16421f9699f749df833cb089461057a2673168
753a011da7030c811877131d3fce2f040d3b2d25
refs/heads/master
2020-01-19T21:15:32.190887
2017-06-27T13:40:39
2017-06-27T13:40:39
94,214,217
0
0
null
null
null
null
UTF-8
Java
false
false
709
java
package mySpring; import lombok.SneakyThrows; import java.lang.reflect.Field; import static mySpring.ObjectFactory.getInstance; /** * Created by Evegeny on 27/06/2017. */ public class InjectByFieldTypeObjectConfigurer implements ObjectConfigurer { @Override @SneakyThrows public void configure(Object t) { Class<?> type = t.getClass(); Field[] fields = type.getDeclaredFields(); for (Field field : fields) { if (field.isAnnotationPresent(InjectByFieldType.class)) { Object object = getInstance().createObject(field.getType()); field.setAccessible(true); field.set(t,object); } } } }
[ "papakita2009" ]
papakita2009
6860a7ac4231a94b2b94213851a0e80453b7ae36
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/fc-20230330/src/main/java/com/aliyun/fc20230330/models/Resource.java
a635394cdbb52a97908c2ab025ea022a7d71ada0
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
873
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.fc20230330.models; import com.aliyun.tea.*; public class Resource extends TeaModel { @NameInMap("resourceArn") public String resourceArn; @NameInMap("tags") public java.util.Map<String, String> tags; public static Resource build(java.util.Map<String, ?> map) throws Exception { Resource self = new Resource(); return TeaModel.build(map, self); } public Resource setResourceArn(String resourceArn) { this.resourceArn = resourceArn; return this; } public String getResourceArn() { return this.resourceArn; } public Resource setTags(java.util.Map<String, String> tags) { this.tags = tags; return this; } public java.util.Map<String, String> getTags() { return this.tags; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
085810af69dd5d1343fb23ad96fd5eac05e119db
8816bd99163d4adc357e76664a64be036b9be1c1
/AL-Game7/data/scripts/system/handlers/quest/lakrum/_62568WeeklyProtectThe129thGarrison.java
ebfeae8f46480577c4297686540bdd2499561909
[]
no_license
w4terbomb/SPP-AionGermany
274b250b7b7b73cdd70485aef84b3900c205a928
a77b4ef188c69f2bc3b850e021545f9ad77e66f3
refs/heads/master
2022-11-25T23:31:21.049612
2019-09-23T13:45:58
2019-09-23T13:45:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,393
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 quest.lakrum; import com.aionemu.gameserver.model.DialogAction; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.questEngine.handlers.QuestHandler; import com.aionemu.gameserver.questEngine.model.QuestEnv; import com.aionemu.gameserver.questEngine.model.QuestState; import com.aionemu.gameserver.questEngine.model.QuestStatus; /** * @author QuestGenerator by Mariella */ public class _62568WeeklyProtectThe129thGarrison extends QuestHandler { private final static int questId = 62568; private final static int[] mobs = { 886079, 886080, 886081, 886082 }; public _62568WeeklyProtectThe129thGarrison() { super(questId); } @Override public void register() { qe.registerQuestNpc(836602).addOnQuestStart(questId); // Yubenros qe.registerQuestNpc(836602).addOnTalkEvent(questId); // Yubenros for (int mob : mobs) { qe.registerQuestNpc(mob).addOnKillEvent(questId); } } @Override public boolean onLvlUpEvent(QuestEnv env) { return defaultOnLvlUpEvent(env, 1000, true); } @Override public boolean onDialogEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); DialogAction dialog = env.getDialog(); int targetId = env.getTargetId(); if (qs == null || qs.getStatus() == QuestStatus.NONE || qs.canRepeat()) { if (targetId == 836602) { switch (dialog) { case QUEST_SELECT: { return sendQuestDialog(env, 4762); } case QUEST_ACCEPT_1: case QUEST_ACCEPT_SIMPLE: { return sendQuestStartDialog(env); } case QUEST_REFUSE_SIMPLE: { return closeDialogWindow(env); } default: break; } } } else if (qs.getStatus() == QuestStatus.START) { switch (targetId) { case 836602: { switch (dialog) { case QUEST_SELECT: { return sendQuestDialog(env, 1011); } case FINISH_DIALOG: { return sendQuestSelectionDialog(env); } default: break; } break; } default: break; } } return false; } /* @Override public boolean onKillEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs != null && qs.getStatus() == QuestStatus.START) { int var = qs.getQuestVarById(0); int var1 = qs.getQuestVarById(1); // (0) Step: 0, Count: 5, Mobs : 886079, 886080, 886081, 886082 if (var == 0 && var1 < 4) { return defaultOnKillEvent(env, mobs, var1, var1 + 1, 1); } else { qs.setQuestVar(1); updateQuestStatus(env); } } return false; } */ }
[ "conan_513@hotmail.com" ]
conan_513@hotmail.com
28c5aa42b14e203f9bd68fbfdfd3c3e29f8ead52
b956c702459bc1247186a6fc53687c1914bb2fd3
/src/main/java/Application.java
25c4c94a6419e968380e80ac402454b344093540
[]
no_license
recruiting-system/training_quiz-2020-4-6-3-29-42-292
29dec2d2fb10353e23a66d032d6f85e4a5b4f809
509d5a9a716ef8111d4ed17d25c3a478fdcdf7f7
refs/heads/master
2021-05-23T16:42:12.298598
2020-04-06T03:29:56
2020-04-06T03:29:56
253,385,624
0
0
null
null
null
null
UTF-8
Java
false
false
1,864
java
import java.util.Scanner; public class Application { public static void main(String[] args) { operateParking(); } public static void operateParking() { while (true) { System.out.println("1. 初始化数据\n2. 停车\n3. 取车\n4. 退出\n请输入你的选择(1~4):"); Scanner printItem = new Scanner(System.in); String choice = printItem.next(); if (choice.equals("4")) { System.out.println("系统已退出"); break; } handle(choice); } } private static void handle(String choice) { Scanner scanner = new Scanner(System.in); if (choice.equals("1")) { System.out.println("请输入初始化数据\n格式为\"停车场编号1:车位数,停车场编号2:车位数\" 如 \"A:8,B:9\":"); String initInfo = scanner.next(); init(initInfo); } else if (choice.equals("2")) { System.out.println("请输入车牌号\n格式为\"车牌号\" 如: \"A12098\":"); String carInfo = scanner.next(); String ticket = park(carInfo); String[] ticketDetails = ticket.split(","); System.out.format("已将您的车牌号为%s的车辆停到%s停车场%s号车位,停车券为:%s,请您妥善保存。\n", ticketDetails[2], ticketDetails[0], ticketDetails[1], ticket); } else if (choice.equals("3")) { System.out.println("请输入停车券信息\n格式为\"停车场编号1,车位编号,车牌号\" 如 \"A,1,8\":"); String ticket = scanner.next(); String car = fetch(ticket); System.out.format("已为您取到车牌号为%s的车辆,很高兴为您服务,祝您生活愉快!\n", car); } } public static void init(String initInfo) { } public static String park(String carNumber) { return ""; } public static String fetch(String ticket) { return ""; } }
[ "linwenjun@163.com" ]
linwenjun@163.com
559390e29f7a563db93a7e8238f027d8f7beab20
0f1a73dc0329cead4fa60981c1c1eb141d758a5d
/kfs-parent/core/src/main/java/org/kuali/kfs/sys/businessobject/options/KualiModuleValuesFinder.java
0c2706feff4872253e271def86647c2178e51878
[]
no_license
r351574nc3/kfs-maven
20d9f1a65c6796e623c4845f6d68834c30732503
5f213604df361a874cdbba0de057d4cd5ea1da11
refs/heads/master
2016-09-06T15:07:01.034167
2012-06-01T07:40:46
2012-06-01T07:40:46
3,441,165
0
0
null
null
null
null
UTF-8
Java
false
false
2,026
java
/* * Copyright 2011 The Kuali Foundation. * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.kfs.sys.businessobject.options; import java.util.ArrayList; import java.util.List; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.rice.kns.lookup.keyvalues.KeyValuesBase; import org.kuali.rice.kns.service.KNSServiceLocator; import org.kuali.rice.kns.service.KualiModuleService; import org.kuali.rice.kns.service.ModuleService; import org.kuali.rice.core.util.KeyLabelPair; /** * Value Finder for Units Of Measure. */ public class KualiModuleValuesFinder extends KeyValuesBase { /** * Returns code/description pairs of all Units Of Measure. * * @see org.kuali.rice.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues() */ public List<KeyLabelPair> getKeyValues() { KualiModuleService moduleService = SpringContext.getBean(KualiModuleService.class); List<ModuleService> results = moduleService.getInstalledModuleServices(); List<KeyLabelPair> labels = new ArrayList<KeyLabelPair>( results.size() ); labels.add(new KeyLabelPair("", "")); for (ModuleService module : results) { labels.add(new KeyLabelPair(module.getModuleConfiguration().getNamespaceCode(), SpringContext.getBean(KualiModuleService.class).getNamespaceName(module.getModuleConfiguration().getNamespaceCode()))); } return labels; } }
[ "r351574nc3@gmail.com" ]
r351574nc3@gmail.com
7dc25f9f7d80c5837e0251290d68e562bf699ab0
95e944448000c08dd3d6915abb468767c9f29d3c
/sources/com/google/android/gms/common/util/C15319b.java
786b628f2380df3993396009f2dfd5e41c34ca7c
[]
no_license
xrealm/tiktok-src
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
90f305b5f981d39cfb313d75ab231326c9fca597
refs/heads/master
2022-11-12T06:43:07.401661
2020-07-04T20:21:12
2020-07-04T20:21:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,992
java
package com.google.android.gms.common.util; import com.google.android.gms.common.internal.C15265q; import java.lang.reflect.Array; import java.util.Arrays; /* renamed from: com.google.android.gms.common.util.b */ public final class C15319b { /* renamed from: a */ public static <T> boolean m44556a(T[] tArr, T t) { int length = tArr != null ? tArr.length : 0; int i = 0; while (true) { if (i >= length) { i = -1; break; } else if (C15265q.m44381a(tArr[i], t)) { break; } else { i++; } } if (i >= 0) { return true; } return false; } /* renamed from: a */ public static <T> void m44553a(StringBuilder sb, T[] tArr) { int length = tArr.length; for (int i = 0; i < length; i++) { if (i != 0) { sb.append(","); } sb.append(tArr[i].toString()); } } /* renamed from: a */ public static void m44551a(StringBuilder sb, int[] iArr) { int length = iArr.length; for (int i = 0; i < length; i++) { if (i != 0) { sb.append(","); } sb.append(Integer.toString(iArr[i])); } } /* renamed from: a */ public static void m44552a(StringBuilder sb, long[] jArr) { int length = jArr.length; for (int i = 0; i < length; i++) { if (i != 0) { sb.append(","); } sb.append(Long.toString(jArr[i])); } } /* renamed from: a */ public static void m44550a(StringBuilder sb, float[] fArr) { int length = fArr.length; for (int i = 0; i < length; i++) { if (i != 0) { sb.append(","); } sb.append(Float.toString(fArr[i])); } } /* renamed from: a */ public static void m44549a(StringBuilder sb, double[] dArr) { int length = dArr.length; for (int i = 0; i < length; i++) { if (i != 0) { sb.append(","); } sb.append(Double.toString(dArr[i])); } } /* renamed from: a */ public static void m44555a(StringBuilder sb, boolean[] zArr) { int length = zArr.length; for (int i = 0; i < length; i++) { if (i != 0) { sb.append(","); } sb.append(Boolean.toString(zArr[i])); } } /* renamed from: a */ public static void m44554a(StringBuilder sb, String[] strArr) { int length = strArr.length; for (int i = 0; i < length; i++) { if (i != 0) { sb.append(","); } sb.append("\""); sb.append(strArr[i]); sb.append("\""); } } /* renamed from: a */ public static <T> T[] m44558a(T[]... tArr) { int i = 0; for (int i2 = 0; i2 < 2; i2++) { i += tArr[i2].length; } T[] copyOf = Arrays.copyOf(tArr[0], i); int length = tArr[0].length; for (int i3 = 1; i3 < 2; i3++) { T[] tArr2 = tArr[1]; System.arraycopy(tArr2, 0, copyOf, length, tArr2.length); } return copyOf; } /* renamed from: a */ public static <T> T[] m44557a(T[] tArr, T... tArr2) { if (tArr == null) { return null; } T[] tArr3 = (Object[]) Array.newInstance(tArr2.getClass().getComponentType(), tArr.length); int i = 0; for (T t : tArr) { if (!C15265q.m44381a(tArr2[0], t)) { int i2 = i + 1; tArr3[i] = t; i = i2; } } if (tArr3 == null) { return null; } if (i != tArr3.length) { tArr3 = Arrays.copyOf(tArr3, i); } return tArr3; } }
[ "65450641+Xyzdesk@users.noreply.github.com" ]
65450641+Xyzdesk@users.noreply.github.com
df9fb2805f098f812794e35e35fef63bd8a1efff
710e8c95f108ec19f619b59c17a835b375f20735
/demo/src/main/java/cn/bingoogolapple/refreshlayout/demo/ui/fragment/RefreshSwipeRecyclerViewFragment.java
c22d9139134aadc2c18c7038cc008245f5c0bacc
[ "Apache-2.0" ]
permissive
zhu260824/BGARefreshLayout-Android
6a788343733baed4d971124dce993194ea48fcd7
08839fe4cfdc150b3eb0196fce87e0a7ac7c6823
refs/heads/master
2021-01-18T07:26:01.349439
2016-06-29T03:03:33
2016-06-29T03:03:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,198
java
package cn.bingoogolapple.refreshlayout.demo.ui.fragment; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import java.util.List; import cn.bingoogolapple.androidcommon.adapter.BGAOnItemChildClickListener; import cn.bingoogolapple.androidcommon.adapter.BGAOnItemChildLongClickListener; import cn.bingoogolapple.androidcommon.adapter.BGAOnRVItemClickListener; import cn.bingoogolapple.androidcommon.adapter.BGAOnRVItemLongClickListener; import cn.bingoogolapple.refreshlayout.BGAMoocStyleRefreshViewHolder; import cn.bingoogolapple.refreshlayout.BGARefreshLayout; import cn.bingoogolapple.refreshlayout.demo.R; import cn.bingoogolapple.refreshlayout.demo.adapter.SwipeRecyclerViewAdapter; import cn.bingoogolapple.refreshlayout.demo.engine.DataEngine; import cn.bingoogolapple.refreshlayout.demo.model.RefreshModel; import cn.bingoogolapple.refreshlayout.demo.ui.activity.MainActivity; import cn.bingoogolapple.refreshlayout.demo.util.ThreadUtil; import cn.bingoogolapple.refreshlayout.demo.widget.Divider; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; /** * 作者:王浩 邮件:bingoogolapple@gmail.com * 创建时间:15/5/22 10:06 * 描述: */ public class RefreshSwipeRecyclerViewFragment extends BaseFragment implements BGARefreshLayout.BGARefreshLayoutDelegate, BGAOnRVItemClickListener, BGAOnRVItemLongClickListener, BGAOnItemChildClickListener, BGAOnItemChildLongClickListener { private SwipeRecyclerViewAdapter mAdapter; private BGARefreshLayout mRefreshLayout; private RecyclerView mDataRv; private int mNewPageNumber = 0; private int mMorePageNumber = 0; @Override protected void initView(Bundle savedInstanceState) { setContentView(R.layout.fragment_recyclerview_refresh); mRefreshLayout = getViewById(R.id.rl_recyclerview_refresh); mDataRv = getViewById(R.id.rv_recyclerview_data); } @Override protected void setListener() { mRefreshLayout.setDelegate(this); mAdapter = new SwipeRecyclerViewAdapter(mDataRv); mAdapter.setOnRVItemClickListener(this); mAdapter.setOnRVItemLongClickListener(this); mAdapter.setOnItemChildClickListener(this); mAdapter.setOnItemChildLongClickListener(this); mDataRv.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { if (RecyclerView.SCROLL_STATE_DRAGGING == newState) { mAdapter.closeOpenedSwipeItemLayoutWithAnim(); } } }); } @Override protected void processLogic(Bundle savedInstanceState) { mRefreshLayout.setCustomHeaderView(DataEngine.getCustomHeaderView(mApp), false); BGAMoocStyleRefreshViewHolder moocStyleRefreshViewHolder = new BGAMoocStyleRefreshViewHolder(mApp, true); moocStyleRefreshViewHolder.setOriginalImage(R.mipmap.bga_refresh_moooc); moocStyleRefreshViewHolder.setUltimateColor(R.color.imoocstyle); mRefreshLayout.setRefreshViewHolder(moocStyleRefreshViewHolder); mDataRv.addItemDecoration(new Divider(mApp)); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mApp); linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); mDataRv.setLayoutManager(linearLayoutManager); mDataRv.setAdapter(mAdapter); } @Override protected void onUserVisible() { mNewPageNumber = 0; mMorePageNumber = 0; mEngine.loadInitDatas().enqueue(new Callback<List<RefreshModel>>() { @Override public void onResponse(Call<List<RefreshModel>> call, Response<List<RefreshModel>> response) { mAdapter.setDatas(response.body()); } @Override public void onFailure(Call<List<RefreshModel>> call, Throwable t) { } }); } @Override public void onBGARefreshLayoutBeginRefreshing(BGARefreshLayout refreshLayout) { mNewPageNumber++; if (mNewPageNumber > 4) { mRefreshLayout.endRefreshing(); showToast("没有最新数据了"); return; } mEngine.loadNewData(mNewPageNumber).enqueue(new Callback<List<RefreshModel>>() { @Override public void onResponse(Call<List<RefreshModel>> call, final Response<List<RefreshModel>> response) { ThreadUtil.runInUIThread(new Runnable() { @Override public void run() { mRefreshLayout.endRefreshing(); mAdapter.addNewDatas(response.body()); mDataRv.smoothScrollToPosition(0); } }, MainActivity.LOADING_DURATION); } @Override public void onFailure(Call<List<RefreshModel>> call, Throwable t) { mRefreshLayout.endRefreshing(); } }); } @Override public boolean onBGARefreshLayoutBeginLoadingMore(BGARefreshLayout refreshLayout) { mMorePageNumber++; if (mMorePageNumber > 4) { mRefreshLayout.endLoadingMore(); showToast("没有更多数据了"); return false; } mEngine.loadMoreData(mMorePageNumber).enqueue(new Callback<List<RefreshModel>>() { @Override public void onResponse(Call<List<RefreshModel>> call, final Response<List<RefreshModel>> response) { ThreadUtil.runInUIThread(new Runnable() { @Override public void run() { mRefreshLayout.endLoadingMore(); mAdapter.addMoreDatas(response.body()); } }, MainActivity.LOADING_DURATION); } @Override public void onFailure(Call<List<RefreshModel>> call, Throwable t) { mRefreshLayout.endLoadingMore(); } }); return true; } @Override public void onItemChildClick(ViewGroup parent, View childView, int position) { if (childView.getId() == R.id.tv_item_swipe_delete) { mAdapter.closeOpenedSwipeItemLayoutWithAnim(); mAdapter.removeItem(position); } } @Override public boolean onItemChildLongClick(ViewGroup parent, View childView, int position) { if (childView.getId() == R.id.tv_item_swipe_delete) { showToast("长按了删除 " + mAdapter.getItem(position).title); return true; } return false; } @Override public void onRVItemClick(ViewGroup parent, View itemView, int position) { showToast("点击了条目 " + mAdapter.getItem(position).title); } @Override public boolean onRVItemLongClick(ViewGroup parent, View itemView, int position) { showToast("长按了条目 " + mAdapter.getItem(position).title); return true; } }
[ "bingoogolapple@gmail.com" ]
bingoogolapple@gmail.com
89054ee576885cedf18b9e40396eb6a186e973a4
071364b708800c74464250325ff01b5d016b9f97
/spring-vault-core/src/test/java/org/springframework/vault/core/VaultKeyValueTemplateIntegrationTests.java
d844538a82f3ea7670a0e3b69501d68295f4bd4b
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
aj-jaswanth/spring-vault
4ffb2302ed7bf85984fd597d6b5caac9281ff7e5
cc8d10c5a74fe02373241b3c6d885f0bafae09d1
refs/heads/master
2020-03-31T16:17:14.533631
2018-10-05T08:56:06
2018-10-05T08:56:12
152,368,692
0
0
Apache-2.0
2018-10-10T05:37:46
2018-10-10T05:37:45
null
UTF-8
Java
false
false
1,945
java
/* * Copyright 2018 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.springframework.vault.core; import java.util.HashMap; import java.util.Map; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.vault.core.VaultKeyValueOperationsSupport.KeyValueBackend; import org.springframework.vault.support.VaultResponse; import static org.assertj.core.api.Assertions.assertThat; /** * Integration tests for {@link VaultKeyValue2Template} using the non-versioned Key/Value * (k/v version 1) backend. * * @author Mark Paluch */ @RunWith(SpringRunner.class) @ContextConfiguration(classes = VaultIntegrationTestConfiguration.class) public class VaultKeyValueTemplateIntegrationTests extends AbstractVaultKeyValueTemplateIntegrationTests { public VaultKeyValueTemplateIntegrationTests() { super("secret", KeyValueBackend.unversioned()); } @Test public void shouldReadSecretWithTtl() { Map<String, Object> secret = new HashMap<>(); secret.put("key", "value"); secret.put("ttl", "5"); kvOperations.put("my-secret", secret); VaultResponse response = kvOperations.get("my-secret"); assertThat(response.getRequiredData()).containsEntry("key", "value"); assertThat(response.getLeaseDuration()).isEqualTo(5L); } }
[ "mpaluch@pivotal.io" ]
mpaluch@pivotal.io
522ee44d64bb2b45d1293e58abd78bd5d9706032
04e80a25d4cb0d783434d056ca2b6b37bf8c5729
/CreditoGrupalUtilitario/src/main/java/utilitario/mensajes/originacion/cheques/ContratoChequesRespuesta.java
dca3d90cf6bb7196adbbe8c99c9fe1cd0d473729
[]
no_license
FyGIntegracionContinua/CIOFF
bfbd2040de503bacc44e376899bddcd4e3db9fd6
20c63dbc01fea60a426ebd49227efb7b8c413567
refs/heads/master
2021-01-15T11:03:31.184075
2017-08-18T20:12:05
2017-08-18T20:12:05
99,607,645
0
1
null
null
null
null
UTF-8
Java
false
false
1,373
java
/** * Tensegrity - 2011 */ package utilitario.mensajes.originacion.cheques; import utilitario.mensajes.comun.EncabezadoRespuesta; import utilitario.mensajes.comun.ObjetoValor; /** * The Class ContratoChequesRespuesta. * * @author Juan Moreno * Encapsula los datos de la respuesta de la operacion RegistrarCliente... * <ul> * <li>Header con el resultado de la operacion</li> * <li>Bod con el resultados solicitado de la respuesta</li> * </ul> */ public final class ContratoChequesRespuesta extends ObjetoValor { /** * Instancia una nueva contrato cheques respuesta. */ public ContratoChequesRespuesta() { } /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; /** The header. */ private EncabezadoRespuesta header; /** The body. */ private ContratoChequesSICOV body; /** * Obtiene body. * * @return the body */ public ContratoChequesSICOV getBody() { return body; } /** * Establece body. * * @param body the body to set */ public void setBody(ContratoChequesSICOV body) { this.body = body; } /** * Obtiene header. * * @return the header */ public final EncabezadoRespuesta getHeader() { return header; } /** * Establece header. * * @param header the header to set */ public final void setHeader(EncabezadoRespuesta header) { this.header = header; } }
[ "christian.lopez@fygsolutions.com" ]
christian.lopez@fygsolutions.com
d37b9804e6cdc4d846218cb632e6eef3a676ef39
934e2ff6ff95030317490c91cc00a672ebe306fe
/src/main/java/org/wildfly/common/function/ExceptionIntFunction.java
e7e7c9fc355f6a74cab5011384952f344bfe9200
[ "Apache-2.0" ]
permissive
wildfly/wildfly-common
49e2bb7d51fe39ebedc33e8488db37cb5fe027f5
88fadfaadb91b82885e1fac1c9b1579e56663625
refs/heads/main
2023-08-29T22:47:46.308346
2023-08-03T14:12:31
2023-08-03T14:12:31
22,608,597
14
50
Apache-2.0
2023-08-03T14:12:33
2014-08-04T15:08:22
Java
UTF-8
Java
false
false
1,660
java
/* * JBoss, Home of Professional Open Source. * Copyright 2016 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.common.function; import org.wildfly.common.Assert; /** * A one-argument integer function which can throw an exception. * * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a> */ @FunctionalInterface public interface ExceptionIntFunction<R, E extends Exception> { /** * Applies this function to the given arguments. * * @param value the argument * @return the function result * @throws E if an exception occurs */ R apply(int value) throws E; default <R2> ExceptionIntFunction<R2, E> andThen(ExceptionFunction<? super R, ? extends R2, ? extends E> after) { Assert.checkNotNullParam("after", after); return t -> after.apply(apply(t)); } default <T> ExceptionFunction<T, R, E> compose(ExceptionToIntFunction<? super T, ? extends E> before) { Assert.checkNotNullParam("before", before); return t -> apply(before.apply(t)); } }
[ "david.lloyd@redhat.com" ]
david.lloyd@redhat.com
0fbd0a5c5cfefcb36b884ba9aa6942d6fbede57a
e1520517adcdd4ee45fb7b19e7002fdd5a46a02a
/polardbx-optimizer/src/main/java/com/alibaba/polardbx/optimizer/core/sequence/bean/AlterSequence.java
12d1a96316c84f6f74dcd0cc874548f7a2e2f02d
[ "Apache-2.0" ]
permissive
huashen/galaxysql
7702969269d7f126d36f269e3331ed1c8da4dc20
b6c88d516367af105d85c6db60126431a7e4df4c
refs/heads/main
2023-09-04T11:40:36.590004
2021-10-25T15:43:14
2021-10-25T15:43:14
421,088,419
1
0
null
null
null
null
UTF-8
Java
false
false
4,567
java
/* * Copyright [2013-2021], Alibaba Group Holding Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.polardbx.optimizer.core.sequence.bean; import com.alibaba.polardbx.common.constants.SequenceAttribute; import com.alibaba.polardbx.common.constants.SequenceAttribute.Type; import com.alibaba.polardbx.optimizer.core.sequence.sequence.IAlterSequence; import com.alibaba.polardbx.optimizer.utils.ExplainResult; /** * alter sequence * * @author agapple 2014年12月18日 下午7:00:51 * @since 5.1.17 */ public abstract class AlterSequence extends Sequence<IAlterSequence> implements IAlterSequence { protected Type type = Type.NA; protected long start = SequenceAttribute.NA; protected int increment = SequenceAttribute.NA; protected long maxValue = SequenceAttribute.NA; protected int cycle = SequenceAttribute.NA; public AlterSequence(String schemaName, String name) { this.name = name; this.schemaName = schemaName; } @Override public String toStringWithInden(int inden, ExplainResult.ExplainMode mode) { StringBuilder sb = new StringBuilder(); sb.append("ALTER SEQUENCE ").append(name); if (type != Type.NA) { sb.append(" CHANGE TO ").append(type.getKeyword()); } if (start > 0) { sb.append(" START WITH ").append(start); } if (increment > 0) { sb.append(" INCREMENT BY ").append(increment); } if (maxValue > 0) { sb.append(" MAXVALUE ").append(maxValue); } if (cycle == SequenceAttribute.NOCYCLE) { sb.append(" NOCYCLE"); } else if (cycle == SequenceAttribute.CYCLE) { sb.append(" CYCLE"); } return sb.toString(); } protected abstract AlterSequence getAlterSequence(String schemaName, String name); public Type getType() { return type; } public void setType(Type type) { this.type = type; } public long getStart() { return start; } public void setStart(long start) { this.start = start; } public int getIncrement() { return increment; } public void setIncrement(int increment) { this.increment = increment; } public long getMaxValue() { return maxValue; } public void setMaxValue(long maxValue) { this.maxValue = maxValue; } public int getCycle() { return cycle; } public void setCycle(int cycle) { this.cycle = cycle; } @Override public SEQUENCE_DDL_TYPE getSequenceDdlType() { return SEQUENCE_DDL_TYPE.ALTER_SEQUENCE; } @Override public String getSql() { StringBuilder sb = new StringBuilder(); sb.append("REPLACE INTO ").append(SequenceAttribute.DEFAULT_GROUP_TABLE_NAME).append("("); sb.append(SequenceAttribute.DEFAULT_ID_COLUMN).append(", "); sb.append(SequenceAttribute.DEFAULT_NAME_COLUMN).append(", "); sb.append(SequenceAttribute.DEFAULT_VALUE_COLUMN).append(", "); sb.append(SequenceAttribute.DEFAULT_GMT_MODIFIED_COLUMN).append(") "); sb.append("VALUES(NULL, '%s', %s, NOW())"); return String.format(sb.toString(), name, String.valueOf(start > 1 ? start : 0)); } public String getSql(Type existingType) { String sql = null; switch (existingType) { case GROUP: sql = getSqlConvertedFromGroup(); break; case SIMPLE: sql = getSqlConvertedFromSimple(); break; case TIME: sql = getSqlConvertedFromTimeBased(); break; default: sql = getSqlWithoutConversion(); break; } return sql; } protected abstract String getSqlConvertedFromGroup(); protected abstract String getSqlConvertedFromSimple(); protected abstract String getSqlConvertedFromTimeBased(); protected abstract String getSqlWithoutConversion(); }
[ "chenmo.cm@alibaba-inc.com" ]
chenmo.cm@alibaba-inc.com
34d45362dd8470a3e0a52d97345db0dd4ae26922
f673f867379ab0bbd9f3ec3bb0761adbb50c6a1f
/book/example/src/main/java/ch04/EchoServerHandler.java
13c6817d4f9937a1b2a60ac021e25bbec8467bdf
[]
no_license
zacscoding/netty-demo
a720ec3ea76d5a721f2e51b732818c0012ba3c6b
316f23a15ee465189121c2b8c61c55013a347265
refs/heads/master
2021-06-27T11:39:04.344751
2019-08-02T09:35:57
2019-08-02T09:35:57
168,475,751
0
0
null
2021-06-07T18:20:47
2019-01-31T06:37:31
Java
UTF-8
Java
false
false
1,417
java
package ch04; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import java.nio.charset.Charset; import lombok.extern.slf4j.Slf4j; /** * @GitHub : https://github.com/zacscoding */ @Slf4j public class EchoServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRegistered(ChannelHandlerContext ctx) throws Exception { super.channelRegistered(ctx); logger.info("channelRegistered() is called"); } @Override public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { super.channelUnregistered(ctx); logger.info("channelUnregistered() is called"); } @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); logger.info("channelActive() is called"); } @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { String readMessage = ((ByteBuf) msg).toString(Charset.defaultCharset()); logger.info("receive message : {}", readMessage); ctx.write(msg); logger.info("channelRead() is called"); } @Override public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { logger.info("channelReadComplete() is called"); ctx.flush(); } }
[ "zaccoding725@gmail.com" ]
zaccoding725@gmail.com
0ee08bf45d820a33a40d2fb64f844672450078c1
70a232b68d76cf4109c56ec65d2b996f2034e9de
/leetcode/src/leetcode/N216_CombinationSum3.java
5788b4cd78288cb8147f2c343fd11b868c4d58e2
[]
no_license
zerghua/leetcode
e4da1d26480301b33eac173866b82a8491120a15
a4b64f55ca123710cb04768e2b18237bc54b784c
refs/heads/master
2021-01-23T17:30:58.949633
2017-10-22T03:22:28
2017-10-22T03:22:28
42,380,356
13
0
null
null
null
null
UTF-8
Java
false
false
2,016
java
package leetcode; import java.util.*; /** * Created by Hua on 5/28/2016. Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers. Ensure that numbers within the set are sorted in ascending order. Example 1: Input: k = 3, n = 7 Output: [[1,2,4]] Example 2: Input: k = 3, n = 9 Output: [[1,2,6], [1,3,5], [2,3,4]] */ public class N216_CombinationSum3 { // no company // backtracking // 18 / 18 test cases passed. // 1 ms class Solution { public List<List<Integer>> combinationSum3(int k, int n) { List<List<Integer>> ret = new ArrayList(); dfs(ret, new LinkedList(), k, 1, n); // k in [1,9] return ret; } public void dfs(List<List<Integer>> ret, LinkedList<Integer> list, int k, int start, int n){ if(list.size() == k){ if(n == 0) ret.add(new ArrayList(list)); return; } for(int i=start; i<=9; i++){ list.add(i); dfs(ret, list, k, i+1, n-i); list.removeLast(); } } } // a few notes: // 1. no 1,4,4 // 2. only 1,3,5, not 1,5,3 // 1 ms public List<List<Integer>> combinationSum3(int k, int n) { List<List<Integer>> ret = new ArrayList<List<Integer>>(); combinationSum3(k,n, 1, new ArrayList<Integer>(), ret); return ret; } private void combinationSum3(int k, int n, int start, ArrayList<Integer> list, List<List<Integer>> ret) { if(k==0){ if(n==0) ret.add(new ArrayList<>(list)); return; } if(start > n) return; for(int i=start; i<=9; i++){ list.add(i); combinationSum3(k-1, n-i, i+1, list, ret); //i+1 instead of start+1 list.remove(list.size()-1); } } }
[ "zerghua@gmail.com" ]
zerghua@gmail.com
eb6c5eff84e3b97ce33c03a4e4e35a9121a29a70
80de5652a86ba8cec31a99f68d84d6a0d6911722
/src/test/java/it/computerproject/it/kangu/erp/security/DomainUserDetailsServiceIntTest.java
cb2246e6d6cbefd7711c7d066c1e41bc0b0b8bd1
[]
no_license
lukaphp/kangu-erp
ce53f549957230e7046d520b90ccf6687a7a371f
c25323e49e0ab95fa2645fb32431510c3c392c6a
refs/heads/master
2020-04-24T19:09:55.365056
2019-02-23T18:54:39
2019-02-23T18:54:39
172,203,442
0
0
null
2019-02-23T18:54:40
2019-02-23T10:54:06
Java
UTF-8
Java
false
false
4,650
java
package it.computerproject.it.kangu.erp.security; import it.computerproject.it.kangu.erp.KanguErpApp; import it.computerproject.it.kangu.erp.domain.User; import it.computerproject.it.kangu.erp.repository.UserRepository; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import java.util.Locale; import static org.assertj.core.api.Assertions.assertThat; /** * Test class for DomainUserDetailsService. * * @see DomainUserDetailsService */ @RunWith(SpringRunner.class) @SpringBootTest(classes = KanguErpApp.class) @Transactional public class DomainUserDetailsServiceIntTest { private static final String USER_ONE_LOGIN = "test-user-one"; private static final String USER_ONE_EMAIL = "test-user-one@localhost"; private static final String USER_TWO_LOGIN = "test-user-two"; private static final String USER_TWO_EMAIL = "test-user-two@localhost"; private static final String USER_THREE_LOGIN = "test-user-three"; private static final String USER_THREE_EMAIL = "test-user-three@localhost"; @Autowired private UserRepository userRepository; @Autowired private UserDetailsService domainUserDetailsService; private User userOne; private User userTwo; private User userThree; @Before public void init() { userOne = new User(); userOne.setLogin(USER_ONE_LOGIN); userOne.setPassword(RandomStringUtils.random(60)); userOne.setActivated(true); userOne.setEmail(USER_ONE_EMAIL); userOne.setFirstName("userOne"); userOne.setLastName("doe"); userOne.setLangKey("en"); userRepository.save(userOne); userTwo = new User(); userTwo.setLogin(USER_TWO_LOGIN); userTwo.setPassword(RandomStringUtils.random(60)); userTwo.setActivated(true); userTwo.setEmail(USER_TWO_EMAIL); userTwo.setFirstName("userTwo"); userTwo.setLastName("doe"); userTwo.setLangKey("en"); userRepository.save(userTwo); userThree = new User(); userThree.setLogin(USER_THREE_LOGIN); userThree.setPassword(RandomStringUtils.random(60)); userThree.setActivated(false); userThree.setEmail(USER_THREE_EMAIL); userThree.setFirstName("userThree"); userThree.setLastName("doe"); userThree.setLangKey("en"); userRepository.save(userThree); } @Test @Transactional public void assertThatUserCanBeFoundByLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByLoginIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmail() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test(expected = UsernameNotFoundException.class) @Transactional public void assertThatUserCanNotBeFoundByEmailIgnoreCase() { domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH)); } @Test @Transactional public void assertThatEmailIsPrioritizedOverLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_EMAIL); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test(expected = UserNotActivatedException.class) @Transactional public void assertThatUserNotActivatedExceptionIsThrownForNotActivatedUsers() { domainUserDetailsService.loadUserByUsername(USER_THREE_LOGIN); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
4055f00719aaa4459c95537c98ab537546fb3411
d4261417db59c92bb118cb7ec12c0bc43c85d62f
/src/de/uni/bielefeld/sc/hterhors/psink/obie/projects/soccerplayer/ontology/interfaces/ISimonBurman.java
a5e985c5a3a985f4576fa0ad77f69b6fa326c2ed
[ "Apache-2.0" ]
permissive
berezovskyi/SoccerPlayerOntology
ed3a24a7ace88ba209f5439a49b04c11a8e6034a
c7dafee008911b45a2b9e8c55ffd43c1e69c3660
refs/heads/master
2022-06-20T02:17:21.385038
2018-09-21T17:09:38
2018-09-21T17:09:38
149,870,122
0
0
Apache-2.0
2022-05-20T22:00:24
2018-09-22T11:19:31
Java
UTF-8
Java
false
false
584
java
package de.uni.bielefeld.sc.hterhors.psink.obie.projects.soccerplayer.ontology.interfaces; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.annotations.AssignableSubInterfaces; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.annotations.ImplementationClass; import de.uni.bielefeld.sc.hterhors.psink.obie.projects.soccerplayer.ontology.classes.SimonBurman; /** * * @author hterhors * * * Sep 6, 2018 */ @ImplementationClass(get = SimonBurman.class) @AssignableSubInterfaces(get = {}) public interface ISimonBurman extends ISoccerPlayer { }
[ "hterhors@techfak.uni-bielefeld.de" ]
hterhors@techfak.uni-bielefeld.de
e1722536753fadfa529bf5b4e952cea9943266ae
ed562660f211c2e6504d4cc360cdaa298fc2a712
/app/src/main/java/mcxtzhang/itemdecorationdemo/ui/SwipeDelMenuActivity.java
fb81413e79f3786fbd5d47c8713bfbb1803a61b5
[]
no_license
zAndroidDeveloper/ItemDecorationIndexBar
b191032d4c808ee5aa8325b44f29ffc428bb3a7b
62c784e9c07d854635d409d1b1b64289fc5147f8
refs/heads/master
2020-06-18T21:42:04.377606
2016-11-28T04:41:18
2016-11-28T04:41:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,554
java
package mcxtzhang.itemdecorationdemo.ui; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.TextView; import com.mcxtzhang.indexlib.IndexBar.widget.IndexBar; import com.mcxtzhang.indexlib.suspension.TitleItemDecoration; import java.util.ArrayList; import java.util.List; import mcxtzhang.itemdecorationdemo.CityBean; import mcxtzhang.itemdecorationdemo.R; import mcxtzhang.itemdecorationdemo.adapter.SwipeDelMenuAdapter; import mcxtzhang.itemdecorationdemo.decoration.DividerItemDecoration; /** * 介绍:组装SwipeDelMenu的Activity * (Activity不需要进行任何的修改 ) * 和WeChatActivity一模一样 * 作者:zhangxutong * 邮箱:mcxtzhang@163.com * 主页:http://blog.csdn.net/zxt0601 * 时间: 2016/11/7. */ public class SwipeDelMenuActivity extends AppCompatActivity { private static final String TAG = "zxt"; private static final String INDEX_STRING_TOP = "↑"; private RecyclerView mRv; private SwipeDelMenuAdapter mAdapter; private LinearLayoutManager mManager; private List<CityBean> mDatas = new ArrayList<>(); private TitleItemDecoration mDecoration; /** * 右侧边栏导航区域 */ private IndexBar mIndexBar; /** * 显示指示器DialogText */ private TextView mTvSideBarHint; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRv = (RecyclerView) findViewById(R.id.rv); mRv.setLayoutManager(mManager = new LinearLayoutManager(this)); mAdapter = new SwipeDelMenuAdapter(this, mDatas); mRv.setAdapter(mAdapter); mRv.addItemDecoration(mDecoration = new TitleItemDecoration(this, mDatas)); //如果add两个,那么按照先后顺序,依次渲染。 //mRv.addItemDecoration(new TitleItemDecoration2(this,mDatas)); mRv.addItemDecoration(new DividerItemDecoration(SwipeDelMenuActivity.this, DividerItemDecoration.VERTICAL_LIST)); //使用indexBar mTvSideBarHint = (TextView) findViewById(R.id.tvSideBarHint);//HintTextView mIndexBar = (IndexBar) findViewById(R.id.indexBar);//IndexBar //模拟线上加载数据 initDatas(getResources().getStringArray(R.array.provinces)); } /** * 组织数据源 * * @param data * @return */ private void initDatas(final String[] data) { //延迟两秒 模拟加载数据中.... getWindow().getDecorView().postDelayed(new Runnable() { @Override public void run() { mDatas = new ArrayList<>(); //微信的头部 也是可以右侧IndexBar导航索引的, // 但是它不需要被ItemDecoration设一个标题titile mDatas.add((CityBean) new CityBean("新的朋友").setTop(true).setBaseIndexTag(INDEX_STRING_TOP)); mDatas.add((CityBean) new CityBean("群聊").setTop(true).setBaseIndexTag(INDEX_STRING_TOP)); mDatas.add((CityBean) new CityBean("标签").setTop(true).setBaseIndexTag(INDEX_STRING_TOP)); mDatas.add((CityBean) new CityBean("公众号").setTop(true).setBaseIndexTag(INDEX_STRING_TOP)); for (int i = 0; i < data.length; i++) { CityBean cityBean = new CityBean(); cityBean.setCity(data[i]);//设置城市名称 mDatas.add(cityBean); } mAdapter.setDatas(mDatas); mAdapter.notifyDataSetChanged(); mIndexBar.setmPressedShowTextView(mTvSideBarHint)//设置HintTextView .setNeedRealIndex(true)//设置需要真实的索引 .setmLayoutManager(mManager)//设置RecyclerView的LayoutManager .setmSourceDatas(mDatas)//设置数据 .invalidate(); mDecoration.setmDatas(mDatas); } }, 2000); } /** * 更新数据源 * * @param view */ public void updateDatas(View view) { for (int i = 0; i < 99; i++) { mDatas.add(new CityBean("东京")); mDatas.add(new CityBean("大阪")); } mAdapter.notifyDataSetChanged(); mIndexBar.setmSourceDatas(mDatas); } }
[ "zhangxutong@imcoming.cn" ]
zhangxutong@imcoming.cn
63f5db6dc710fda1a0c367ec8539fba1375ccc94
5095c94365c79436e0f1c98a50405ae8e27a89eb
/atomicobjects-fuse/src/test/java/net/catchpole/io/file/FileModelTest.java
624b2c33a41798d83f2bbb0d660ef3bb6be5c92b
[ "Apache-2.0" ]
permissive
slipperyseal/atomicobjects
f5da8a832681550d8efc84d03e6c64b5f7a3bf49
212f9d830386fe9947f7770ab673273c007dc88d
refs/heads/slippery
2023-03-10T18:40:25.499262
2023-02-26T01:27:55
2023-02-26T01:27:55
20,993,244
3
1
Apache-2.0
2022-06-13T03:48:50
2014-06-19T08:25:25
Java
UTF-8
Java
false
false
1,210
java
package net.catchpole.io.file; // Copyright 2014 catchpole.net // // 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. import net.catchpole.model.Model; import net.catchpole.trace.Core; import net.catchpole.trace.Trace; import org.junit.Test; import java.io.File; public class FileModelTest { private Trace trace = Core.getTrace(); @Test public void testFileModel() { recurse(new FileModel(new File("./src/test/net")), trace); } public void recurse(Model model, Trace trace) { trace.info(model.getName()); Trace subTrace = trace.drill(); for (Model subModel : model) { recurse(subModel, subTrace); } } }
[ "christian@catchpole.net" ]
christian@catchpole.net
043188bfb974e3ebfd59d5d5bde8405293694ed9
37b259964dac90775452f17ca3ba242b9f26f505
/jadx-cli/src/test/java/jadx/cli/RenameConverterTest.java
961a49eac60863dcb4fa59f8983966b0e683eed9
[ "Apache-2.0", "BSD-3-Clause", "LGPL-2.1-only", "EPL-1.0", "CC-BY-2.5", "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
bobolau/jadx
dcaaa1b368d6f94c9a0952c33301b047915c8016
da6f6fa6acff36b4188525f4667b119684288e39
refs/heads/master
2021-01-16T19:11:34.169875
2019-04-17T10:37:54
2019-04-17T10:37:54
100,151,732
0
0
Apache-2.0
2019-04-17T10:37:55
2017-08-13T03:35:20
Java
UTF-8
Java
false
false
1,240
java
package jadx.cli; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Set; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import jadx.api.JadxArgs.RENAME; import jadx.cli.JadxCLIArgs.RenameConverter; public class RenameConverterTest { private RenameConverter converter; @BeforeEach public void init() { converter = new RenameConverter("someParam"); } @Test public void all() { Set<RENAME> set = converter.convert("all"); assertEquals(3, set.size()); assertTrue(set.contains(RENAME.CASE)); assertTrue(set.contains(RENAME.VALID)); assertTrue(set.contains(RENAME.PRINTABLE)); } @Test public void none() { Set<RENAME> set = converter.convert("none"); assertTrue(set.isEmpty()); } @Test public void wrong() { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> converter.convert("wrong"), "Expected convert() to throw, but it didn't"); assertEquals("wrong is unknown for parameter someParam, " + "possible values are 'case', 'valid' and 'printable'", thrown.getMessage()); } }
[ "skylot@gmail.com" ]
skylot@gmail.com
59e1d5d2768722d0863255d6b0dceabaf808b71e
e1af7696101f8f9eb12c0791c211e27b4310ecbc
/MCP/temp/src/minecraft/net/minecraft/util/IntegerCache.java
082632e4d8e6b287a967afeef0e1b5eac651e682
[]
no_license
VinmaniaTV/Mania-Client
e36810590edf09b1d78b8eeaf5cbc46bb3e2d8ce
7a12b8bad1a8199151b3f913581775f50cc4c39c
refs/heads/main
2023-02-12T10:31:29.076263
2021-01-13T02:29:35
2021-01-13T02:29:35
329,156,099
0
0
null
null
null
null
UTF-8
Java
false
false
460
java
package net.minecraft.util; public class IntegerCache { private static final Integer[] field_181757_a = new Integer['\uffff']; public static Integer func_181756_a(int p_181756_0_) { return p_181756_0_ > 0 && p_181756_0_ < field_181757_a.length ? field_181757_a[p_181756_0_] : p_181756_0_; } static { int i = 0; for(int j = field_181757_a.length; i < j; ++i) { field_181757_a[i] = i; } } }
[ "vinmaniamc@gmail.com" ]
vinmaniamc@gmail.com
1040d328d74ab377831980178679dcaa807af2d6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/32/32_13b7268fe52cd399458a1165ea9b53c8eca5db28/TestHashPartitioner/32_13b7268fe52cd399458a1165ea9b53c8eca5db28_TestHashPartitioner_t.java
8f5e725880ac7b8bbef2703399eaed2a23ea2771
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,681
java
package org.apache.solr.cloud; /* * 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. */ import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.http.impl.client.RoutedRequest; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.common.cloud.CompositeIdRouter; import org.apache.solr.common.cloud.DocCollection; import org.apache.solr.common.cloud.DocRouter; import org.apache.solr.common.cloud.DocRouter; import org.apache.solr.common.cloud.DocRouter.Range; import org.apache.solr.common.cloud.PlainIdRouter; import org.apache.solr.common.cloud.Slice; import org.apache.solr.common.util.Hash; public class TestHashPartitioner extends SolrTestCaseJ4 { public void testMapHashes() throws Exception { DocRouter hp = DocRouter.DEFAULT; List<Range> ranges; // make sure the partitioner uses the "natural" boundaries and doesn't suffer from an off-by-one ranges = hp.partitionRange(2, hp.fullRange()); assertEquals(Integer.MIN_VALUE, ranges.get(0).min); assertEquals(0x80000000, ranges.get(0).min); assertEquals(0xffffffff, ranges.get(0).max); assertEquals(0x00000000, ranges.get(1).min); assertEquals(0x7fffffff, ranges.get(1).max); ranges = hp.partitionRange(2, 0, 0x7fffffff); assertEquals(0x00000000, ranges.get(0).min); assertEquals(0x3fffffff, ranges.get(0).max); assertEquals(0x40000000, ranges.get(1).min); assertEquals(0x7fffffff, ranges.get(1).max); for (int i = 1; i <= 30000; i += 13) { ranges = hp.partitionRange(i, hp.fullRange()); assertEquals(i, ranges.size()); assertTrue("First range does not start before " + Integer.MIN_VALUE + " it is:" + ranges.get(0).min, ranges.get(0).min <= Integer.MIN_VALUE); assertTrue("Last range does not end after " + Integer.MAX_VALUE + " it is:" + ranges.get(ranges.size() - 1).max, ranges.get(ranges.size() - 1).max >= Integer.MAX_VALUE); for (Range range : ranges) { String s = range.toString(); Range newRange = hp.fromString(s); assertEquals(range, newRange); } } } public int hash(String id) { // our hashing is defined to be murmurhash3 on the UTF-8 bytes of the key. return Hash.murmurhash3_x86_32(id, 0, id.length(), 0); } public void testHashCodes() throws Exception { DocRouter router = DocRouter.getDocRouter(PlainIdRouter.NAME); assertTrue(router instanceof PlainIdRouter); DocCollection coll = createCollection(4, router); doNormalIdHashing(coll); } public void doNormalIdHashing(DocCollection coll) throws Exception { assertEquals(4, coll.getSlices().size()); doId(coll, "b", "shard1"); doId(coll, "c", "shard2"); doId(coll, "d", "shard3"); doId(coll, "e", "shard4"); } public void doId(DocCollection coll, String id, String expectedShard) { DocRouter router = coll.getRouter(); Slice target = router.getTargetSlice(id, null, null, coll); assertEquals(expectedShard, target.getName()); } public void testCompositeHashCodes() throws Exception { DocRouter router = DocRouter.getDocRouter(CompositeIdRouter.NAME); assertTrue(router instanceof CompositeIdRouter); router = DocRouter.DEFAULT; assertTrue(router instanceof CompositeIdRouter); DocCollection coll = createCollection(4, router); doNormalIdHashing(coll); // ensure that the shard hashed to is only dependent on the first part of the compound key doId(coll, "b!foo", "shard1"); doId(coll, "c!bar", "shard2"); doId(coll, "d!baz", "shard3"); doId(coll, "e!qux", "shard4"); // syntax to specify bits. Anything over 2 should give the same results as above (since only top 2 bits // affect our 4 slice collection). doId(coll, "b/2!foo", "shard1"); doId(coll, "c/2!bar", "shard2"); doId(coll, "d/2!baz", "shard3"); doId(coll, "e/2!qux", "shard4"); doId(coll, "b/32!foo", "shard1"); doId(coll, "c/32!bar", "shard2"); doId(coll, "d/32!baz", "shard3"); doId(coll, "e/32!qux", "shard4"); } /*** public void testPrintHashCodes() throws Exception { // from negative to positive, the upper bits of the hash ranges should be // shard1: 11 // shard2: 10 // shard3: 00 // shard4: 01 String[] highBitsToShard = {"shard3","shard4","shard1","shard2"}; for (int i = 0; i<26; i++) { String id = new String(Character.toChars('a'+i)); int hash = hash(id); System.out.println("hash of " + id + " is " + Integer.toHexString(hash) + " high bits=" + (hash>>>30) + " shard="+highBitsToShard[hash>>>30]); } } ***/ DocCollection createCollection(int nSlices, DocRouter router) { List<Range> ranges = router.partitionRange(nSlices, router.fullRange()); Map<String,Slice> slices = new HashMap<String,Slice>(); for (int i=0; i<ranges.size(); i++) { Range range = ranges.get(i); Slice slice = new Slice("shard"+(i+1), null, map("range",range)); slices.put(slice.getName(), slice); } DocCollection coll = new DocCollection("collection1", slices, null, router); return coll; } // from negative to positive, the upper bits of the hash ranges should be // shard1: top bits:10 80000000:bfffffff // shard2: top bits:11 c0000000:ffffffff // shard3: top bits:00 00000000:3fffffff // shard4: top bits:01 40000000:7fffffff /*** hash of a is 3c2569b2 high bits=0 shard=shard3 hash of b is 95de7e03 high bits=2 shard=shard1 hash of c is e132d65f high bits=3 shard=shard2 hash of d is 27191473 high bits=0 shard=shard3 hash of e is 656c4367 high bits=1 shard=shard4 hash of f is 2b64883b high bits=0 shard=shard3 hash of g is f18ae416 high bits=3 shard=shard2 hash of h is d482b2d3 high bits=3 shard=shard2 hash of i is 811a702b high bits=2 shard=shard1 hash of j is ca745a39 high bits=3 shard=shard2 hash of k is cfbda5d1 high bits=3 shard=shard2 hash of l is 1d5d6a2c high bits=0 shard=shard3 hash of m is 5ae4385c high bits=1 shard=shard4 hash of n is c651d8ac high bits=3 shard=shard2 hash of o is 68348473 high bits=1 shard=shard4 hash of p is 986fdf9a high bits=2 shard=shard1 hash of q is ff8209e8 high bits=3 shard=shard2 hash of r is 5c9373f1 high bits=1 shard=shard4 hash of s is ff4acaf1 high bits=3 shard=shard2 hash of t is ca87df4d high bits=3 shard=shard2 hash of u is 62203ae0 high bits=1 shard=shard4 hash of v is bdafcc55 high bits=2 shard=shard1 hash of w is ff439d1f high bits=3 shard=shard2 hash of x is 3e9a9b1b high bits=0 shard=shard3 hash of y is 477d9216 high bits=1 shard=shard4 hash of z is c1f69a17 high bits=3 shard=shard2 ***/ }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ca91b0b820dd41aa0515bf1d43683ea72d353ca6
7a58d08e242b6dc28e9ba9a61865275353883423
/src/thinkinjava/chapter11_holding/AdapterMethodIdiom.java
1326aecc800614768acf56b4a164aec9307babac
[]
no_license
zjxht62/learnJava
8bcf10dc7ee4f6ad001983273a22a76f55870de2
f25357ce44b82aeb2560688bb66a74851fbe51f0
refs/heads/master
2022-01-21T04:17:23.288413
2022-01-17T06:11:37
2022-01-17T06:11:37
210,154,936
0
0
null
null
null
null
UTF-8
Java
false
false
1,260
java
package thinkinjava.chapter11_holding;//: holding/AdapterMethodIdiom.java // The "Adapter Method" idiom allows you to use foreach // with additional kinds of Iterables. import java.util.*; class ReversibleArrayList<T> extends ArrayList<T> { public ReversibleArrayList(Collection<T> c) { super(c); } public Iterable<T> reversed() { return new Iterable<T>() { public Iterator<T> iterator() { return new Iterator<T>() { int current = size() - 1; public boolean hasNext() { return current > -1; } public T next() { return get(current--); } public void remove() { // Not implemented throw new UnsupportedOperationException(); } }; } }; } } public class AdapterMethodIdiom { public static void main(String[] args) { ReversibleArrayList<String> ral = new ReversibleArrayList<String>( Arrays.asList("To be or not to be".split(" "))); // Grabs the ordinary iterator via iterator(): for(String s : ral) System.out.print(s + " "); System.out.println(); // Hand it the Iterable of your choice for(String s : ral.reversed()) System.out.print(s + " "); } } /* Output: To be or not to be be to not or be To *///:~
[ "zhao_ji_xiang@126.com" ]
zhao_ji_xiang@126.com
53cd746bb754e24fcb6ed11183f3ab4f5f3f905e
d65daec0af64efa416a64fecfa5c6e051e30450a
/Switz/app/src/main/java/com/prt2121/switz/LocTypeAdapter.java
0510a77062c6bb99917b8df2badee78eeca2d542
[ "Apache-2.0" ]
permissive
pt2121/android-workspace
365e32d74061fa6e70fcb2f358563335f4440bc7
c6e8e8dfa79571b0139e1e88cb64b51a5c464fcd
refs/heads/master
2021-05-31T11:32:07.412180
2016-02-28T21:18:26
2016-02-28T21:18:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,913
java
package com.prt2121.switz; import com.google.gson.Gson; import android.content.SharedPreferences; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SwitchCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import javax.inject.Inject; /** * Created by pt2121 on 3/13/15. */ public class LocTypeAdapter extends RecyclerView.Adapter<LocTypeAdapter.ViewHolder> { @Inject SharedPreferences mPreferences; @Inject Gson mGson; private static final String TAG = LocTypeAdapter.class.getSimpleName(); private LocType[] mTypes; public LocTypeAdapter(LocType[] types) { mTypes = types; SwitzApp.getInstance().getGraph().inject(this); } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()) .inflate(R.layout.type_row_item, parent, false); return new ViewHolder(v); } @Override public void onBindViewHolder(ViewHolder holder, int position) { holder.mTextView.setText(mTypes[position].name); holder.mSwitchCompat.setChecked(mTypes[position].isChecked()); holder.mSwitchCompat.setOnCheckedChangeListener((buttonView, isChecked) -> { LocTypeModule.updateLocType(mPreferences, mGson, position, isChecked); }); } @Override public int getItemCount() { return mTypes.length; } public static class ViewHolder extends RecyclerView.ViewHolder { public final TextView mTextView; public final SwitchCompat mSwitchCompat; public ViewHolder(View v) { super(v); mTextView = (TextView) v.findViewById(R.id.typeTextView); mSwitchCompat = (SwitchCompat) v.findViewById(R.id.locSwitch); } } }
[ "banqfirn@gmail.com" ]
banqfirn@gmail.com
8fe6579041cbb5871275992b4bb332f3d5709752
d32a91f7abd23aa553bc6f6473dfe0d073428d36
/sourceCode/李刚的权威指南/source_code/16/16.2/simpleQuery/src/lee/Jasper2Pdf.java
1a7501e380f9693bc39a15043ffb6bf7bac5079b
[]
no_license
hongzhangzhao/yui
67f6a06a7b6b3d808b8c10176946c624a3cf2245
205a18a6b9da09d34ef2042e00e62b9dc644d69f
refs/heads/master
2021-01-24T06:47:32.438606
2018-02-11T20:02:24
2018-02-11T20:02:24
93,319,891
1
0
null
null
null
null
GB18030
Java
false
false
1,005
java
package lee; import net.sf.jasperreports.engine.*; import java.util.*; import java.sql.*; /** * @author yeeku.H.lee kongyeeku@163.com * @version 1.0 * <br>Copyright (C), 2005-2008, yeeku.H.Lee * <br>This program is protected by copyright laws. * <br>Program Name: * <br>Date: */ public class Jasper2Pdf { public static void main(String[] args) throws Exception { Map params = new HashMap(); params.put("id" , 1); JasperRunManager.runReportToPdfFile("simpleQuery.jasper" , "simpleQuery.pdf" , params , getConnection()); System.out.println("直接从Jasper文件创建一个PDF文档"); System.exit(0); } private static Connection getConnection() throws ClassNotFoundException, SQLException { String driver = "com.mysql.jdbc.Driver"; String connectString = "jdbc:mysql://localhost/j2ee"; String user = "root"; String password = "32147"; Class.forName(driver); Connection conn = DriverManager.getConnection(connectString, user, password); return conn; } }
[ "hongzhangzhao@outlook.com" ]
hongzhangzhao@outlook.com
7c45f7ffdd1478ec646f469175cac8399b619999
e457376950380dd6e09e58fa7bee3d09e2a0f333
/python-impl/src/main/java/com/jetbrains/python/impl/testing/RunnableUnitTestFilter.java
554d97bb44fca0600df2bf56e3ca39ab4d5716bd
[ "Apache-2.0" ]
permissive
consulo/consulo-python
b816b7b9a4b346bee5d431ef6c39fdffe40adf40
e191cd28f043c1211eb98af42d3c0a40454b2d98
refs/heads/master
2023-08-09T02:27:03.585942
2023-07-09T08:33:47
2023-07-09T08:33:47
12,317,018
0
0
Apache-2.0
2020-06-05T17:16:50
2013-08-23T07:16:43
Java
UTF-8
Java
false
false
1,375
java
/* * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.jetbrains.python.impl.testing; import consulo.annotation.component.ComponentScope; import consulo.annotation.component.ExtensionAPI; import consulo.component.extension.ExtensionPointName; import consulo.language.psi.PsiFile; import consulo.module.Module; import javax.annotation.Nonnull; /** * Filters out Python unit tests for which it doesn't make sense to run the standard unit test configuration, * and which are (possibly) run by other configurations instead. * * @author yole */ @ExtensionAPI(ComponentScope.APPLICATION) public interface RunnableUnitTestFilter { ExtensionPointName<RunnableUnitTestFilter> EP_NAME = ExtensionPointName.create(RunnableUnitTestFilter.class); boolean isRunnableUnitTest(PsiFile script, @Nonnull Module module); }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
63a7e9ee6dc4fb4192493f69ce32cd035558a4a0
ab91edf364c66071c0ec5777595033fc8cde8113
/panda-glue/src/main/java/panda/ioc/aop/config/InterceptorPair.java
8f464c181e3a6c0ceed020c9eab74e839838f9ea
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
pandafw/panda
054a5262cb006382ca22858925329a928fec844b
5ab4c335dae0dba34995f13863f11be790b14548
refs/heads/master
2023-08-31T03:40:26.800171
2023-08-29T08:11:50
2023-08-29T08:11:50
78,275,890
10
1
Apache-2.0
2022-11-08T11:20:35
2017-01-07T11:47:02
Java
UTF-8
Java
false
false
839
java
package panda.ioc.aop.config; import panda.aop.MethodInterceptor; import panda.aop.MethodMatcher; /** * @author wendal(wendal1985@gmail.com) */ public class InterceptorPair { private MethodInterceptor methodInterceptor; private MethodMatcher methodMatcher; public InterceptorPair(MethodInterceptor methodInterceptor, MethodMatcher methodMatcher) { super(); this.methodInterceptor = methodInterceptor; this.methodMatcher = methodMatcher; } public MethodInterceptor getMethodInterceptor() { return methodInterceptor; } public void setMethodInterceptor(MethodInterceptor methodInterceptor) { this.methodInterceptor = methodInterceptor; } public MethodMatcher getMethodMatcher() { return methodMatcher; } public void setMethodMatcher(MethodMatcher methodMatcher) { this.methodMatcher = methodMatcher; } }
[ "yf.frank.wang@outlook.com" ]
yf.frank.wang@outlook.com
0f03d8788dca6e10cdc44f492391757242d8af54
41a063b1aa25afe84ca86bc8727e0148f9ac5e0c
/cms-web/src/main/java/org/xupan/cms/weixin/filter/AuthFilter.java
7ef78bae35fc3aecd5d5df8ce471a991ed8c403a
[ "Apache-2.0" ]
permissive
panda726548/cms-web
3c76320e89216f13dacaa4b08b6da0956f71e56e
bf5debcab1f867b9cf1f3e9ce9a78ac144b35f7a
refs/heads/master
2022-12-29T15:03:29.339919
2019-12-22T09:17:05
2019-12-22T09:17:05
230,026,532
2
0
Apache-2.0
2022-12-16T01:52:24
2019-12-25T02:06:15
JavaScript
UTF-8
Java
false
false
1,272
java
package org.xupan.cms.weixin.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.xupan.basic.model.User; /** * 过滤器 * @author Administrator * */ public class AuthFilter implements Filter{ @Override public void destroy() { } @Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpReq = (HttpServletRequest)req; HttpServletResponse httpResp = (HttpServletResponse)resp; String url = httpReq.getRequestURI(); if(url.indexOf("resources")>0||url.indexOf("login")>0||url.indexOf("/wreceive")>0) { chain.doFilter(httpReq, httpResp); return; } else { User u = (User)httpReq.getSession().getAttribute("user"); if(u==null) { httpResp.sendRedirect(httpReq.getContextPath()+"/user/login"); return; } chain.doFilter(httpReq, httpResp); } } @Override public void init(FilterConfig cfg) throws ServletException { } }
[ "498617606@qq.com" ]
498617606@qq.com
c285c40b97e87fd2dba3fa4f7481635294626d60
e463036bded7c86cfef24dbda9a37d582b197c29
/c1/old/partion25_large/sub17.java
f271fbc9f184e3ceb9135f81c4e44e15c05f312c
[]
no_license
Himatsubu/JRThrash
f05d446ec4e4d5f717aca63b9bca8db2237177d9
1f11080a86f3ac9a11a463b2237af87e60d66db3
refs/heads/master
2020-04-15T13:36:39.096625
2017-02-21T06:30:47
2017-02-21T06:30:47
59,081,414
0
0
null
null
null
null
UTF-8
Java
false
false
980
java
import net.njlab.sample.annotation.*; public class sub17 extends Thread{ final float[] u = new float[1024]; //final float[] q = new float[1024]; final float[] result = new float[1024]; @JRThrashUnroll(unrollNum=6, loopVariableName="k",unrollType=JRThrashUnroll.copyLoopVar) public void run(){ int k,j; float r1 = 0.2f; float r2 = 0.2f; float dt = 0.0005f; float dx = 0.05f; float dy = 0.05f; float q; for(j=20;j<=25;j++){ for(k=14;k<=19;k++){ //q=100f*dx*(j-1)*dy*(k-1); result[j*31+k]= u[j*31+k]+r1*(u[(j+1)*31+k]-2.0f*u[j*31+k]+u[(j-1)*31+k]) +r2*(u[j*31+k+1]-2.0f*u[j*31+k]+u[j*31+k-1])+dt*100f*dx*(j-1)*dy*(k-1); } } /* uu[j][k]= u[j][k]+r1*(u[j+1][k]-2.0f*u[j][k]+u[j-1][k]) +r2*(u[j][k+1]-2.0f*u[j][k]+u[j][k-1])+dt*q[j][k]; sub[i].u[3]=u[j*31+k]; sub[i].u[1]=u[j*31+k-1]; sub[i].u[5]=u[j*31+k+1]; sub[i].u[2]=u[(j-1)*31+k]; sub[i].u[4]=u[(j+1)*31+k]; */ } }
[ "keitaro.871@gmail.com" ]
keitaro.871@gmail.com
6665415155b849fd67f812193f0ce5fb461938b9
9b2db7e84535c45c3081e6d9ccefde6538f114ec
/ph-collection/src/main/java/com/helger/collection/multimap/MultiHashMapLinkedHashMapBased.java
fdde7aa4e30e8dad6d3423a69c30b398c5723584
[ "Apache-2.0" ]
permissive
zhujiancom/ph-commons
a1039023392b88474359eda81335daec76c89776
f8ff80afe5ba919019a73d3153380fa9f3cb5071
refs/heads/master
2021-07-12T06:20:15.159581
2017-10-15T19:55:05
2017-10-15T19:55:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,169
java
/** * Copyright (C) 2014-2017 Philip Helger (www.helger.com) * philip[at]helger[dot]com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.helger.collection.multimap; import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.helger.commons.annotation.ReturnsMutableCopy; import com.helger.commons.collection.impl.CommonsLinkedHashMap; import com.helger.commons.collection.impl.ICommonsOrderedMap; public class MultiHashMapLinkedHashMapBased <KEYTYPE1, KEYTYPE2 extends Comparable <? super KEYTYPE2>, VALUETYPE> extends AbstractMultiHashMapMapBased <KEYTYPE1, KEYTYPE2, VALUETYPE, ICommonsOrderedMap <KEYTYPE2, VALUETYPE>> { public MultiHashMapLinkedHashMapBased () {} public MultiHashMapLinkedHashMapBased (@Nonnull final KEYTYPE1 aKey, @Nonnull final KEYTYPE2 aInnerKey, @Nullable final VALUETYPE aValue) { super (aKey, aInnerKey, aValue); } public MultiHashMapLinkedHashMapBased (@Nullable final KEYTYPE1 aKey, @Nullable final Map <? extends KEYTYPE2, ? extends VALUETYPE> aValue) { super (aKey, aValue); } public MultiHashMapLinkedHashMapBased (@Nullable final Map <? extends KEYTYPE1, ? extends Map <? extends KEYTYPE2, ? extends VALUETYPE>> aCont) { super (aCont); } @Override @Nonnull @ReturnsMutableCopy protected CommonsLinkedHashMap <KEYTYPE2, VALUETYPE> createNewInnerMap () { return new CommonsLinkedHashMap<> (); } }
[ "philip@helger.com" ]
philip@helger.com
6ec954308d6a6d89b49f37376456cdd307da5bc1
bfcd3c3d2349a5a1ce67b307463f73dbd2f82364
/core/src/test/java/cn/leancloud/NetworkingDetectorMock.java
aff4b0ac784844b3f7e5acd62d5716e90d668c9d
[ "Apache-2.0" ]
permissive
leancloud/java-unified-sdk
02bf727fdcde33d9172a2eac46976f8dd5e71f62
4dee5b1ff167493a001052b56fd817c8865fdd2b
refs/heads/master
2023-06-26T05:10:08.906059
2023-06-14T08:04:54
2023-06-14T08:04:54
121,136,295
51
27
Apache-2.0
2023-06-14T08:01:37
2018-02-11T15:20:02
Java
UTF-8
Java
false
false
417
java
package cn.leancloud; import cn.leancloud.network.NetworkingDetector; public class NetworkingDetectorMock implements NetworkingDetector { private volatile boolean isConnected = true; public void setConnected(boolean connected) { this.isConnected = connected; } public boolean isConnected() { return this.isConnected; } public NetworkType getNetworkType() { return NetworkType.WIFI; } }
[ "jwfing@gmail.com" ]
jwfing@gmail.com
01f97b94706881ecd2983ffd5f9de0e7a12da2d9
48530c408142d91661906c0c963be3f96552ae67
/src/main/java/org/openclinica/ns/rules_test/v31/RulesTest.java
c76c4fe299b1129f08d85a07cce9eaf2eb568130
[]
no_license
jkeremian/ocodm
664f0a233af7d6e87e9df517dc7d89154c2dfda8
26cb2b65ff8eaf14e9da71c4c9ac49ed88c5d6d0
refs/heads/master
2021-01-21T05:50:05.423671
2017-08-24T15:57:38
2017-08-24T15:57:38
33,999,844
1
0
null
2015-04-15T14:48:33
2015-04-15T14:48:33
null
UTF-8
Java
false
false
4,635
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.08.24 at 11:41:29 AM EDT // package org.openclinica.ns.rules_test.v31; 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.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.openclinica.ns.rules.v31.Rules; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element ref="{http://www.openclinica.org/ns/rules/v3.1}Rules"/&gt; * &lt;element name="Valid" type="{http://www.w3.org/2001/XMLSchema}boolean"/&gt; * &lt;element ref="{http://www.openclinica.org/ns/RulesTest/v3.1}Parameters" maxOccurs="unbounded"/&gt; * &lt;element ref="{http://www.openclinica.org/ns/RulesTest/v3.1}RulesTestMessages" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "rules", "valid", "parameters", "rulesTestMessages" }) @XmlRootElement(name = "RulesTest") public class RulesTest { @XmlElement(name = "Rules", namespace = "http://www.openclinica.org/ns/rules/v3.1", required = true) protected Rules rules; @XmlElement(name = "Valid") protected boolean valid; @XmlElement(name = "Parameters", required = true) protected List<ParameterType> parameters; @XmlElement(name = "RulesTestMessages", required = true) protected List<RulesTestMessagesType> rulesTestMessages; /** * Gets the value of the rules property. * * @return * possible object is * {@link Rules } * */ public Rules getRules() { return rules; } /** * Sets the value of the rules property. * * @param value * allowed object is * {@link Rules } * */ public void setRules(Rules value) { this.rules = value; } /** * Gets the value of the valid property. * */ public boolean isValid() { return valid; } /** * Sets the value of the valid property. * */ public void setValid(boolean value) { this.valid = value; } /** * Gets the value of the parameters 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 parameters property. * * <p> * For example, to add a new item, do as follows: * <pre> * getParameters().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ParameterType } * * */ public List<ParameterType> getParameters() { if (parameters == null) { parameters = new ArrayList<ParameterType>(); } return this.parameters; } /** * Gets the value of the rulesTestMessages 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 rulesTestMessages property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRulesTestMessages().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link RulesTestMessagesType } * * */ public List<RulesTestMessagesType> getRulesTestMessages() { if (rulesTestMessages == null) { rulesTestMessages = new ArrayList<RulesTestMessagesType>(); } return this.rulesTestMessages; } }
[ "krikor.krumlian@gmail.com" ]
krikor.krumlian@gmail.com
a0e7fb9907331c162ce04d889f1e2c85bd064872
1385f704f09e5d2239773b539229f86e5a3df003
/dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryParamsTest.java
1e113ad56ea16909c1f420a164e8a324bd0a9d65
[ "BSD-3-Clause" ]
permissive
hispindia/PLAN-2.22
685af400a458d2dd5d79e1a51c2338c6f60d65b8
e25d2d4eb2164f8f6f84208334e60768a96c7543
refs/heads/master
2020-05-25T14:13:00.336780
2017-03-14T11:07:57
2017-03-14T11:07:57
84,938,376
0
0
null
null
null
null
UTF-8
Java
false
false
6,852
java
package org.hisp.dhis.analytics; /* * Copyright (c) 2004-2016, University of Oslo * 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 the HISP project 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. */ import static org.hisp.dhis.common.DimensionalObject.DATA_X_DIM_ID; import static org.hisp.dhis.common.DimensionalObject.PERIOD_DIM_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.hisp.dhis.DhisConvenienceTest; import org.hisp.dhis.common.BaseDimensionalObject; import org.hisp.dhis.common.DimensionType; import org.hisp.dhis.common.DimensionalItemObject; import org.hisp.dhis.common.DimensionalObject; import org.hisp.dhis.common.DimensionalObjectUtils; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataset.DataSet; import org.hisp.dhis.period.Period; import org.junit.Before; import org.junit.Test; import com.google.common.collect.Lists; /** * @author Lars Helge Overland */ public class DataQueryParamsTest extends DhisConvenienceTest { private DataElement deA; private DataElement deB; private DataElement deC; private DataSet dsA; private DataSet dsB; @Before public void setUpTest() { deA = createDataElement( 'A' ); deB = createDataElement( 'B' ); deC = createDataElement( 'C' ); dsA = createDataSet( 'A', null ); dsB = createDataSet( 'B', null ); } @Test public void testSetGetDataElements() { List<? extends DimensionalItemObject> dataElements = Lists.newArrayList( deA, deB, deC ); List<? extends DimensionalItemObject> dataSets = Lists.newArrayList( dsA, dsB ); DataQueryParams params = new DataQueryParams(); params.setDataElements( dataElements ); params.setDataSets( dataSets ); assertEquals( 3, params.getDataElements().size() ); assertTrue( params.getDataElements().containsAll( dataElements ) ); assertEquals( 2, params.getDataSets().size() ); assertTrue( params.getDataSets().containsAll( dataSets ) ); } @Test public void testGetDimensionFromParam() { assertEquals( DATA_X_DIM_ID, DimensionalObjectUtils.getDimensionFromParam( "dx:D348asd782j;kj78HnH6hgT;9ds9dS98s2" ) ); } @Test public void testGetDimensionItemsFromParam() { List<String> expected = new ArrayList<>( Lists.newArrayList( "D348asd782j", "kj78HnH6hgT", "9ds9dS98s2" ) ); assertEquals( expected, DimensionalObjectUtils.getDimensionItemsFromParam( "de:D348asd782j;kj78HnH6hgT;9ds9dS98s2" ) ); } @Test public void testGetLevelFromLevelParam() { assertEquals( 4, DimensionalObjectUtils.getLevelFromLevelParam( "LEVEL-4-dFsdfejdf2" ) ); assertEquals( 0, DimensionalObjectUtils.getLevelFromLevelParam( "LEVEL" ) ); assertEquals( 0, DimensionalObjectUtils.getLevelFromLevelParam( "LEVEL-gFd" ) ); } @Test public void testGetMeasureCriteriaFromParam() { Map<MeasureFilter, Double> expected = new HashMap<>(); expected.put( MeasureFilter.GT, 100d ); expected.put( MeasureFilter.LT, 200d ); assertEquals( expected, DataQueryParams.getMeasureCriteriaFromParam( "GT:100;LT:200" ) ); } @Test public void testHasPeriods() { DataQueryParams params = new DataQueryParams(); assertFalse( params.hasPeriods() ); List<DimensionalItemObject> periods = new ArrayList<>(); params.getDimensions().add( new BaseDimensionalObject( PERIOD_DIM_ID, DimensionType.PERIOD, periods ) ); assertFalse( params.hasPeriods() ); params.removeDimension( PERIOD_DIM_ID ); assertFalse( params.hasPeriods() ); periods.add( new Period() ); params.getDimensions().add( new BaseDimensionalObject( PERIOD_DIM_ID, DimensionType.PERIOD, periods ) ); assertTrue( params.hasPeriods() ); } @Test public void testPruneToDimensionType() { DataQueryParams params = new DataQueryParams(); params.getDimensions().add( new BaseDimensionalObject( DimensionalObject.DATA_X_DIM_ID, DimensionType.DATA_X, null, null, Lists.newArrayList( createIndicator( 'A', null ), createIndicator( 'B', null ) ) ) ); params.getDimensions().add( new BaseDimensionalObject( DimensionalObject.ORGUNIT_DIM_ID, DimensionType.ORGANISATIONUNIT, null, null, Lists.newArrayList( createOrganisationUnit( 'A' ), createOrganisationUnit( 'B' ) ) ) ); params.getFilters().add( new BaseDimensionalObject( DimensionalObject.PERIOD_DIM_ID, DimensionType.PERIOD, null, null, Lists.newArrayList( createPeriod( "201201" ), createPeriod( "201202" ) ) ) ); assertEquals( 2, params.getDimensions().size() ); assertEquals( 1, params.getFilters().size() ); params.pruneToDimensionType( DimensionType.ORGANISATIONUNIT ); assertEquals( 1, params.getDimensions().size() ); assertEquals( DimensionType.ORGANISATIONUNIT, params.getDimensions().get( 0 ).getDimensionType() ); assertEquals( 0, params.getFilters().size() ); } }
[ "mithilesh.hisp@gmail.com" ]
mithilesh.hisp@gmail.com
669936d3432c98b1080d5e278998ee8a980f2fab
3adc2e99a48961bc2b8f45f125af09a00703e4b9
/ssmEsayUI_v1.0/src/main/java/com/shang/biz/IUserRolesBiz.java
54c71d722054c11e307ee3c3776d60e1259a5b51
[]
no_license
Spole0168/m2_runProjects
065ef4e76a57146999acdbe175a277d9812b2f36
e5288b82030d537ddf39d836ad71a86aa11eb402
refs/heads/master
2021-09-04T11:29:57.883836
2018-01-18T08:57:41
2018-01-18T08:57:41
112,138,588
0
0
null
null
null
null
UTF-8
Java
false
false
373
java
package com.shang.biz; import com.shang.base.IBaseBiz; import com.shang.dal.model.UserRoles; public interface IUserRolesBiz extends IBaseBiz<UserRoles>{ /** * 根据用户id 删除 UR信息 * @param uid */ public void delUrsByUid(String uid); /** * 根据角色 id 删除 UR信息 * @param uid */ public void delUrsByRid(String rid); }
[ "Spole_168@qq.com" ]
Spole_168@qq.com
a8c49587f24c9fdd885677465d90bdca77aad680
26cae485443d8adff8abc7ebac7c2324691a6574
/2010/week4/lab/Exp.java
58d2ef282adaa0e5a2bab6149a7e6db100776098
[]
no_license
igococha/proglang
f06d36493f67ff167f421cbe58612efdbb18c334
2c2711947322b1582dbbaa58005d2999e202db97
refs/heads/master
2021-01-15T22:56:54.886042
2017-08-10T12:29:43
2017-08-10T12:29:43
99,920,188
0
0
null
null
null
null
UTF-8
Java
false
false
7,094
java
/* Generated By:JavaCC: Do not edit this line. Exp.java */ public class Exp implements ExpConstants { /* Entry Point to parser */ static final public void S() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NUM: case 8: E(); jj_consume_token(EOL); break; case EOL: jj_consume_token(EOL); break; case 0: jj_consume_token(0); break; default: jj_la1[0] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } // Productio: E -> T ( + T | - T)* static final public void E() throws ParseException { T(); label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 6: case 7: ; break; default: jj_la1[1] = jj_gen; break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 6: jj_consume_token(6); T(); break; case 7: jj_consume_token(7); T(); break; default: jj_la1[2] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } // Production: T -> ?????? static final public void T() throws ParseException { F(); } // Production: F -> number | ( E ) static final public void F() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NUM: jj_consume_token(NUM); break; case 8: jj_consume_token(8); E(); jj_consume_token(9); break; default: jj_la1[3] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } static private boolean jj_initialized_once = false; static public ExpTokenManager token_source; static SimpleCharStream jj_input_stream; static public Token token, jj_nt; static private int jj_ntk; static private int jj_gen; static final private int[] jj_la1 = new int[4]; static private int[] jj_la1_0; static { jj_la1_0(); } private static void jj_la1_0() { jj_la1_0 = new int[] {0x131,0xc0,0xc0,0x110,}; } public Exp(java.io.InputStream stream) { this(stream, null); } public Exp(java.io.InputStream stream, String encoding) { if (jj_initialized_once) { System.out.println("ERROR: Second call to constructor of static parser. You must"); System.out.println(" either use ReInit() or set the JavaCC option STATIC to false"); System.out.println(" during parser generation."); throw new Error(); } jj_initialized_once = true; try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source = new ExpTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 4; i++) jj_la1[i] = -1; } static public void ReInit(java.io.InputStream stream) { ReInit(stream, null); } static public void ReInit(java.io.InputStream stream, String encoding) { try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 4; i++) jj_la1[i] = -1; } public Exp(java.io.Reader stream) { if (jj_initialized_once) { System.out.println("ERROR: Second call to constructor of static parser. You must"); System.out.println(" either use ReInit() or set the JavaCC option STATIC to false"); System.out.println(" during parser generation."); throw new Error(); } jj_initialized_once = true; jj_input_stream = new SimpleCharStream(stream, 1, 1); token_source = new ExpTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 4; i++) jj_la1[i] = -1; } static public void ReInit(java.io.Reader stream) { jj_input_stream.ReInit(stream, 1, 1); token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 4; i++) jj_la1[i] = -1; } public Exp(ExpTokenManager tm) { if (jj_initialized_once) { System.out.println("ERROR: Second call to constructor of static parser. You must"); System.out.println(" either use ReInit() or set the JavaCC option STATIC to false"); System.out.println(" during parser generation."); throw new Error(); } jj_initialized_once = true; token_source = tm; token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 4; i++) jj_la1[i] = -1; } public void ReInit(ExpTokenManager tm) { token_source = tm; token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 4; i++) jj_la1[i] = -1; } static final private Token jj_consume_token(int kind) throws ParseException { Token oldToken; if ((oldToken = token).next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; if (token.kind == kind) { jj_gen++; return token; } token = oldToken; jj_kind = kind; throw generateParseException(); } static final public Token getNextToken() { if (token.next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; jj_gen++; return token; } static final public Token getToken(int index) { Token t = token; for (int i = 0; i < index; i++) { if (t.next != null) t = t.next; else t = t.next = token_source.getNextToken(); } return t; } static final private int jj_ntk() { if ((jj_nt=token.next) == null) return (jj_ntk = (token.next=token_source.getNextToken()).kind); else return (jj_ntk = jj_nt.kind); } static private java.util.Vector jj_expentries = new java.util.Vector(); static private int[] jj_expentry; static private int jj_kind = -1; static public ParseException generateParseException() { jj_expentries.removeAllElements(); boolean[] la1tokens = new boolean[10]; for (int i = 0; i < 10; i++) { la1tokens[i] = false; } if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 4; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1<<j)) != 0) { la1tokens[j] = true; } } } } for (int i = 0; i < 10; i++) { if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; jj_expentries.addElement(jj_expentry); } } int[][] exptokseq = new int[jj_expentries.size()][]; for (int i = 0; i < jj_expentries.size(); i++) { exptokseq[i] = (int[])jj_expentries.elementAt(i); } return new ParseException(token, exptokseq, tokenImage); } static final public void enable_tracing() { } static final public void disable_tracing() { } }
[ "igor@siveroni.com" ]
igor@siveroni.com
01f1fdae7178345ceeecdf829ce6f97d0a2378f1
46ef04782c58b3ed1d5565f8ac0007732cddacde
/uml/diagram.editor.activity/src/org/modelio/diagram/editor/activity/elements/callbehavior/GmCallBehaviorImageStyleKeys.java
5ddbb819177c4ea24ecd43891408a0d235c49941
[]
no_license
daravi/modelio
844917412abc21e567ff1e9dd8b50250515d6f4b
1787c8a836f7e708a5734d8bb5b8a4f1a6008691
refs/heads/master
2020-05-26T17:14:03.996764
2019-05-23T21:30:10
2019-05-23T21:30:45
188,309,762
0
1
null
null
null
null
UTF-8
Java
false
false
2,077
java
/* * Copyright 2013-2018 Modeliosoft * * This file is part of Modelio. * * Modelio 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. * * Modelio 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 Modelio. If not, see <http://www.gnu.org/licenses/>. * */ package org.modelio.diagram.editor.activity.elements.callbehavior; import com.modeliosoft.modelio.javadesigner.annotations.objid; import org.modelio.diagram.editor.activity.style.ActivityAbstractStyleKeyProvider; import org.modelio.diagram.styles.core.StyleKey; /** * This class provides the StyleKey constants for a GmCallBehavior when its representation mode is RepresentationMode.IMAGE */ @objid ("29bc9ff2-55b6-11e2-877f-002564c97630") public class GmCallBehaviorImageStyleKeys extends ActivityAbstractStyleKeyProvider { @objid ("d16e444c-55c0-11e2-9337-002564c97630") static final StyleKey REPMODE = GmCallBehaviorStructuredStyleKeys.REPMODE; @objid ("d16e444e-55c0-11e2-9337-002564c97630") static final StyleKey FONT = GmCallBehaviorStructuredStyleKeys.FONT; @objid ("d16e4450-55c0-11e2-9337-002564c97630") static final StyleKey TEXTCOLOR = GmCallBehaviorStructuredStyleKeys.TEXTCOLOR; @objid ("d16e4452-55c0-11e2-9337-002564c97630") static final StyleKey SHOWSTEREOTYPES = GmCallBehaviorStructuredStyleKeys.SHOWSTEREOTYPES; @objid ("d16e4454-55c0-11e2-9337-002564c97630") static final StyleKey SHOWTAGS = GmCallBehaviorStructuredStyleKeys.SHOWTAGS; @objid ("d16e4456-55c0-11e2-9337-002564c97630") static final StyleKey AUTOSHOWPINS = GmCallBehaviorStructuredStyleKeys.AUTOSHOWPINS; }
[ "puya@motionmetrics.com" ]
puya@motionmetrics.com
d9f51ed2f6c2c2d1d33775f216a2ac63e8daca90
4700124b7f23b134de3a5d976ade369489cf79c8
/src/backoffice/style/pageComponents/BrandTitle.java
1804eb6b46061b836166f35d3a428dbb61076f29
[]
no_license
Linusdalin/Pukka3
962974aa3bc33085400bd6e7ef386c8097c851f7
992860ff36ca0318e9de6b993c5324cdd6bafcf8
refs/heads/master
2016-09-05T10:48:16.561070
2015-07-07T14:42:29
2015-07-07T14:42:29
32,646,810
0
0
null
null
null
null
UTF-8
Java
false
false
668
java
package backoffice.style.pageComponents; import backoffice.common.BackofficeInterface; import backoffice.style.HtmlBlock; /** * Created with IntelliJ IDEA. * User: Linus * Date: 2015-03-22 * Time: 12:23 * To change this template use File | Settings | File Templates. */ public class BrandTitle { private BackofficeInterface backoffice; public BrandTitle(BackofficeInterface backoffice){ this.backoffice = backoffice; } public HtmlBlock render(){ return new HtmlBlock( " <a class=\"navbar-brand\" href=\"/home\">"+ backoffice.getSystemTitle()+"</a>\n"); } }
[ "linus.dalin@itclarifies.com" ]
linus.dalin@itclarifies.com
e31ab0dc38e11bd8194e77bb341143332b5471a0
ab493903f6a1d60e0db76a2045ca5456afa5ad6a
/src/main/java/in/ravikalla/cloudanalysis/security/jwt/JWTFilter.java
ab10a7eb621e2644dc7203deb89a1c69a48ea788
[]
no_license
ravikalla/cloudanalysis
88224f94c5312297c0c4dd8cdd82ec31cf37ba40
0c057f38a5bc2b5bc3460cee413d4a6f7a04ee82
refs/heads/master
2022-12-23T16:14:13.975871
2019-07-18T01:08:52
2019-07-18T01:08:52
197,486,087
0
0
null
2022-12-16T05:02:12
2019-07-18T01:08:45
Java
UTF-8
Java
false
false
1,852
java
package in.ravikalla.cloudanalysis.security.jwt; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.util.StringUtils; import org.springframework.web.filter.GenericFilterBean; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import java.io.IOException; /** * Filters incoming requests and installs a Spring Security principal if a header corresponding to a valid user is * found. */ public class JWTFilter extends GenericFilterBean { public static final String AUTHORIZATION_HEADER = "Authorization"; private TokenProvider tokenProvider; public JWTFilter(TokenProvider tokenProvider) { this.tokenProvider = tokenProvider; } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; String jwt = resolveToken(httpServletRequest); if (StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt)) { Authentication authentication = this.tokenProvider.getAuthentication(jwt); SecurityContextHolder.getContext().setAuthentication(authentication); } filterChain.doFilter(servletRequest, servletResponse); } private String resolveToken(HttpServletRequest request){ String bearerToken = request.getHeader(AUTHORIZATION_HEADER); if (StringUtils.hasText(bearerToken) && bearerToken.startsWith("Bearer ")) { return bearerToken.substring(7); } return null; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
728d42a8de4b00e9dac7eb3710ab26ce441dab3c
f0c76b285c34b771886753ac21acf382c34cec1b
/cpa/src/main/java/org/castor/cpa/jpa/info/JPAClassAnnotationProcessingService.java
c734dd9127001a243073ec3f75990e22e1cdaa4a
[]
no_license
thinkum-contrib/castor
60048f9910a3ea5399aac586b632cf2a47773b7f
26ac040bf40bf06c02f1c1a77ccfa9968372a459
refs/heads/master
2020-04-21T15:30:31.704288
2014-01-01T20:48:45
2014-01-01T20:48:45
169,671,509
1
0
null
null
null
null
UTF-8
Java
false
false
3,253
java
/* * Copyright 2008 Werner Guttmann, Peter Schmidt * * 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.castor.cpa.jpa.info; import org.castor.core.annotationprocessing.BaseTargetAwareAnnotationProcessingService; import org.castor.cpa.jpa.processors.classprocessors.JPACacheProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPAEntityProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPAInheritanceProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPAMappedSuperclassProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPANamedNativeQueriesProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPANamedNativeQueryProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPANamedQueriesProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPANamedQueryProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPASequenceGeneratorClassProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPATableGeneratorClassProcessor; import org.castor.cpa.jpa.processors.classprocessors.JPATableProcessor; /** * This is a standard {@link BaseTargetAwareAnnotationProcessingService} * initialized with JPA Annotation processors for class bound JPA annotations. * * @author <a href="mailto:peter-list AT stayduebeauty DOT com">Peter Schmidt</a> * @author <a href="mailto:wguttmn AT codehaus DOT org">Werner Guttmann</a> * @version $Revision$ $Date$ * @since 1.3 */ public class JPAClassAnnotationProcessingService extends BaseTargetAwareAnnotationProcessingService { //----------------------------------------------------------------------------------- /** * Instantiate a {@link BaseTargetAwareAnnotationProcessingService} with JPA * Annotation processors for class bound JPA annotations. */ public JPAClassAnnotationProcessingService() { this.addAnnotationProcessor(new JPAEntityProcessor()); this.addAnnotationProcessor(new JPAMappedSuperclassProcessor()); this.addAnnotationProcessor(new JPATableProcessor()); this.addAnnotationProcessor(new JPAInheritanceProcessor()); this.addAnnotationProcessor(new JPANamedQueryProcessor()); this.addAnnotationProcessor(new JPANamedNativeQueryProcessor()); this.addAnnotationProcessor(new JPANamedQueriesProcessor()); this.addAnnotationProcessor(new JPANamedNativeQueriesProcessor()); this.addAnnotationProcessor(new JPACacheProcessor()); this.addAnnotationProcessor(new JPASequenceGeneratorClassProcessor()); this.addAnnotationProcessor(new JPATableGeneratorClassProcessor()); } //----------------------------------------------------------------------------------- }
[ "rjoachim@b24b0d9a-6811-0410-802a-946fa971d308" ]
rjoachim@b24b0d9a-6811-0410-802a-946fa971d308
234621814027ccca50eb53aeee9e324145623aed
27af35647ca8a90e9eb26a38f6cee054a9a6e23d
/yun_kuangjia2019/geeklibs/slbappcomm/src/main/java/com/example/slbappcomm/widgets/CustomRoundAngleImageView.java
3f47c3b74273899479307699e6678540bed4e165
[]
no_license
geeklx/myappkuangjia20190806
6007614bd8e45c53ddc5fcebd47e9f1499236c69
8fbfdd0223af16cdc5cfb5434c49b26c41d3958a
refs/heads/master
2020-06-30T07:37:28.804826
2019-08-20T07:09:45
2019-08-20T07:09:45
200,767,192
9
2
null
null
null
null
UTF-8
Java
false
false
4,044
java
package com.example.slbappcomm.widgets; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Path; import android.os.Build; import androidx.appcompat.widget.AppCompatImageView; import android.util.AttributeSet; import android.util.Log; import android.view.View; import com.example.slbappcomm.R; public class CustomRoundAngleImageView extends AppCompatImageView { float width, height; private int defaultRadius = 0; private int radius; private int leftTopRadius; private int rightTopRadius; private int rightBottomRadius; private int leftBottomRadius; public CustomRoundAngleImageView(Context context) { this(context, null); init(context, null); } public CustomRoundAngleImageView(Context context, AttributeSet attrs) { this(context, attrs, 0); init(context, attrs); } public CustomRoundAngleImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context, attrs); } private void init(Context context, AttributeSet attrs) { if (Build.VERSION.SDK_INT < 18) { setLayerType(View.LAYER_TYPE_SOFTWARE, null); } // 读取配置 TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.Custom_Round_Image_View); radius = array.getDimensionPixelOffset(R.styleable.Custom_Round_Image_View_radius, defaultRadius); leftTopRadius = array.getDimensionPixelOffset(R.styleable.Custom_Round_Image_View_left_top_radius, defaultRadius); rightTopRadius = array.getDimensionPixelOffset(R.styleable.Custom_Round_Image_View_right_top_radius, defaultRadius); rightBottomRadius = array.getDimensionPixelOffset(R.styleable.Custom_Round_Image_View_right_bottom_radius, defaultRadius); leftBottomRadius = array.getDimensionPixelOffset(R.styleable.Custom_Round_Image_View_left_bottom_radius, defaultRadius); Log.e("radius", "radius --> " + radius); //如果四个角的值没有设置,那么就使用通用的radius的值。 if (defaultRadius == leftTopRadius) { leftTopRadius = radius; } if (defaultRadius == rightTopRadius) { rightTopRadius = radius; } if (defaultRadius == rightBottomRadius) { rightBottomRadius = radius; } if (defaultRadius == leftBottomRadius) { leftBottomRadius = radius; } array.recycle(); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); width = getWidth(); height = getHeight(); } @Override protected void onDraw(Canvas canvas) { //这里做下判断,只有图片的宽高大于设置的圆角距离的时候才进行裁剪 int maxLeft = Math.max(leftTopRadius, leftBottomRadius); int maxRight = Math.max(rightTopRadius, rightBottomRadius); int minWidth = maxLeft + maxRight; int maxTop = Math.max(leftTopRadius, rightTopRadius); int maxBottom = Math.max(leftBottomRadius, rightBottomRadius); int minHeight = maxTop + maxBottom; if (width >= minWidth && height > minHeight) { Path path = new Path(); //四个角:右上,右下,左下,左上 path.moveTo(leftTopRadius, 0); path.lineTo(width - rightTopRadius, 0); path.quadTo(width, 0, width, rightTopRadius); path.lineTo(width, height - rightBottomRadius); path.quadTo(width, height, width - rightBottomRadius, height); path.lineTo(leftBottomRadius, height); path.quadTo(0, height, 0, height - leftBottomRadius); path.lineTo(0, leftTopRadius); path.quadTo(0, 0, leftTopRadius, 0); canvas.clipPath(path); } super.onDraw(canvas); } }
[ "liangxiao@smart-haier.com" ]
liangxiao@smart-haier.com
1f81002ee054e1015c4521a92302c2837c8c0dbf
2bd62a0a91451d454d5b130ff91465d35d210646
/src/main/java/com/kobe/nucleus/security/SpringSecurityAuditorAware.java
6af90089d9a7182e52af3ec4d5f1b20a3661ec59
[]
no_license
kkobena/nucleus
ce54c036a489da5618e0f3b035761e01387494cb
62ff795f09cd015b844db53d3e3025cbf3ca39eb
refs/heads/master
2023-08-14T20:52:52.631997
2021-09-29T11:30:42
2021-09-29T11:30:42
256,178,120
0
0
null
null
null
null
UTF-8
Java
false
false
542
java
package com.kobe.nucleus.security; import com.kobe.nucleus.config.Constants; import java.util.Optional; import org.springframework.data.domain.AuditorAware; import org.springframework.stereotype.Component; /** * Implementation of {@link AuditorAware} based on Spring Security. */ @Component public class SpringSecurityAuditorAware implements AuditorAware<String> { @Override public Optional<String> getCurrentAuditor() { return Optional.of(SecurityUtils.getCurrentUserLogin().orElse(Constants.SYSTEM_ACCOUNT)); } }
[ "badoukobena@gmail.com" ]
badoukobena@gmail.com
b7d711a30edf2c94849d8e898d961fe1cb20b2e9
e89dc01c95b8b45404f971517c2789fd21657749
/src/main/java/com/alipay/api/domain/InteligentItemInfo.java
25fda51d8298d04a6230310507971b516a814ac4
[ "Apache-2.0" ]
permissive
guoweiecust/alipay-sdk-java-all
3370466eec70c5422c8916c62a99b1e8f37a3f46
bb2b0dc8208a7a0ab8521a52f8a5e1fcef61aeb9
refs/heads/master
2023-05-05T07:06:47.823723
2021-05-25T15:26:21
2021-05-25T15:26:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,946
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 智能营销券的单品信息 * * @author auto create * @since 1.0, 2018-01-22 16:20:14 */ public class InteligentItemInfo extends AlipayObject { private static final long serialVersionUID = 1646497684531375725L; /** * 券适用的单品码列表 最少配置1个单品码 最多配置500个单品码 */ @ApiListField("item_ids") @ApiField("string") private List<String> itemIds; /** * 单品图片列表 单品图片不能超过3张 */ @ApiListField("item_imgs") @ApiField("string") private List<String> itemImgs; /** * 单品券详细介绍跳转链接 */ @ApiField("item_link") private String itemLink; /** * 单品名称 */ @ApiField("item_name") private String itemName; /** * 单品券说明 */ @ApiField("item_text") private String itemText; /** * 单品券适用的商品列表中,每一个商品最高可享受优惠的件数; 如:券适用于A,B两种商品,该字段设置为1,则用券A,B两种商品每种最多只有一件可享受优惠; */ @ApiField("max_discount_num") private String maxDiscountNum; /** * 单品券适用商品列表中,每种商品享受优惠最低购买件数的门槛; 如:券适用于A,B两种商品,该字段设置为3,则A,B两种商品每种最少需要购买3件才可享受优惠; */ @ApiField("min_consume_num") private String minConsumeNum; /** * 单品的原价,单位元 必须为合法金额类型字符串,如9.99 */ @ApiField("original_price") private String originalPrice; /** * 券适用SKU的最低消费金额门槛 如券适用A,B两个SKU,该字段设置的值为100,则订单中购买A,B两个SKU的合计金额需大于100元才可用券 */ @ApiField("sku_min_consume") private String skuMinConsume; /** * 如果一个单品券适用A,B,C三个单品,若设置了该字段为2,则在一笔交易中,A,B,C三个单品加起来最多只有俩件能够享受优惠 */ @ApiField("total_max_discount_num") private String totalMaxDiscountNum; public List<String> getItemIds() { return this.itemIds; } public void setItemIds(List<String> itemIds) { this.itemIds = itemIds; } public List<String> getItemImgs() { return this.itemImgs; } public void setItemImgs(List<String> itemImgs) { this.itemImgs = itemImgs; } public String getItemLink() { return this.itemLink; } public void setItemLink(String itemLink) { this.itemLink = itemLink; } public String getItemName() { return this.itemName; } public void setItemName(String itemName) { this.itemName = itemName; } public String getItemText() { return this.itemText; } public void setItemText(String itemText) { this.itemText = itemText; } public String getMaxDiscountNum() { return this.maxDiscountNum; } public void setMaxDiscountNum(String maxDiscountNum) { this.maxDiscountNum = maxDiscountNum; } public String getMinConsumeNum() { return this.minConsumeNum; } public void setMinConsumeNum(String minConsumeNum) { this.minConsumeNum = minConsumeNum; } public String getOriginalPrice() { return this.originalPrice; } public void setOriginalPrice(String originalPrice) { this.originalPrice = originalPrice; } public String getSkuMinConsume() { return this.skuMinConsume; } public void setSkuMinConsume(String skuMinConsume) { this.skuMinConsume = skuMinConsume; } public String getTotalMaxDiscountNum() { return this.totalMaxDiscountNum; } public void setTotalMaxDiscountNum(String totalMaxDiscountNum) { this.totalMaxDiscountNum = totalMaxDiscountNum; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
47d22678c11bdd70657d4e553713ad54d40e3e81
a00326c0e2fc8944112589cd2ad638b278f058b9
/src/main/java/000/148/060/CWE89_SQL_Injection__Property_executeQuery_73b.java
b5184463a4db7680e71c674624d72b8244c8e5a2
[]
no_license
Lanhbao/Static-Testing-for-Juliet-Test-Suite
6fd3f62713be7a084260eafa9ab221b1b9833be6
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
refs/heads/master
2020-08-24T13:34:04.004149
2019-10-25T09:26:00
2019-10-25T09:26:00
216,822,684
0
1
null
2019-11-08T09:51:54
2019-10-22T13:37:13
Java
UTF-8
Java
false
false
6,454
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE89_SQL_Injection__Property_executeQuery_73b.java Label Definition File: CWE89_SQL_Injection.label.xml Template File: sources-sinks-73b.tmpl.java */ /* * @description * CWE: 89 SQL Injection * BadSource: Property Read data from a system property * GoodSource: A hardcoded string * Sinks: executeQuery * GoodSink: Use prepared statement and executeQuery (properly) * BadSink : data concatenated into SQL statement used in executeQuery(), which could result in SQL Injection * Flow Variant: 73 Data flow: data passed in a LinkedList from one method to another in different source files in the same package * * */ import java.util.LinkedList; import java.sql.*; import java.util.logging.Level; public class CWE89_SQL_Injection__Property_executeQuery_73b { public void badSink(LinkedList<String> dataLinkedList ) throws Throwable { String data = dataLinkedList.remove(2); Connection dbConnection = null; Statement sqlStatement = null; ResultSet resultSet = null; try { dbConnection = IO.getDBConnection(); sqlStatement = dbConnection.createStatement(); /* POTENTIAL FLAW: data concatenated into SQL statement used in executeQuery(), which could result in SQL Injection */ resultSet = sqlStatement.executeQuery("select * from users where name='"+data+"'"); IO.writeLine(resultSet.getRow()); /* Use ResultSet in some way */ } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql); } finally { try { if (resultSet != null) { resultSet.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql); } try { if (sqlStatement != null) { sqlStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Statement", exceptSql); } try { if (dbConnection != null) { dbConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } /* goodG2B() - use GoodSource and BadSink */ public void goodG2BSink(LinkedList<String> dataLinkedList ) throws Throwable { String data = dataLinkedList.remove(2); Connection dbConnection = null; Statement sqlStatement = null; ResultSet resultSet = null; try { dbConnection = IO.getDBConnection(); sqlStatement = dbConnection.createStatement(); /* POTENTIAL FLAW: data concatenated into SQL statement used in executeQuery(), which could result in SQL Injection */ resultSet = sqlStatement.executeQuery("select * from users where name='"+data+"'"); IO.writeLine(resultSet.getRow()); /* Use ResultSet in some way */ } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql); } finally { try { if (resultSet != null) { resultSet.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql); } try { if (sqlStatement != null) { sqlStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Statement", exceptSql); } try { if (dbConnection != null) { dbConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } /* goodB2G() - use BadSource and GoodSink */ public void goodB2GSink(LinkedList<String> dataLinkedList ) throws Throwable { String data = dataLinkedList.remove(2); Connection dbConnection = null; PreparedStatement sqlStatement = null; ResultSet resultSet = null; try { /* FIX: Use prepared statement and executeQuery (properly) */ dbConnection = IO.getDBConnection(); sqlStatement = dbConnection.prepareStatement("select * from users where name=?"); sqlStatement.setString(1, data); resultSet = sqlStatement.executeQuery(); IO.writeLine(resultSet.getRow()); /* Use ResultSet in some way */ } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql); } finally { try { if (resultSet != null) { resultSet.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql); } try { if (sqlStatement != null) { sqlStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing PreparedStatement", exceptSql); } try { if (dbConnection != null) { dbConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } }
[ "anhtluet12@gmail.com" ]
anhtluet12@gmail.com
6fef0ced39b91571deab6ac7a1ed33d7542bb8b3
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/31/31_b86ed73db2028058344bdd3b18a8057d7fa754df/PoWorkbenchPage/31_b86ed73db2028058344bdd3b18a8057d7fa754df_PoWorkbenchPage_t.java
26dffc20e3af2f75729cc3111435124f6d8318eb
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,015
java
/******************************************************************************* * <copyright> * * Copyright (c) 2005, 2012 SAP AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * SAP AG - initial API, implementation and documentation * Bug 336488 - DiagramEditor API * mwenz - Bug 374918 - Let default paste use LocalSelectionTransfer * * </copyright> * *******************************************************************************/ package org.eclipse.graphiti.bot.pageobjects; import static org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.syncExec; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.awt.AWTException; import java.awt.Robot; import java.util.List; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.graphiti.bot.tests.AbstractGFTests; import org.eclipse.graphiti.bot.tests.GFOtherTests; import org.eclipse.graphiti.mm.pictograms.Diagram; import org.eclipse.graphiti.ui.editor.DiagramEditor; import org.eclipse.graphiti.ui.editor.DiagramEditorInput; import org.eclipse.graphiti.ui.services.GraphitiUi; import org.eclipse.swt.SWT; import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotPerspective; import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor; import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; import org.eclipse.swtbot.swt.finder.results.IntResult; import org.eclipse.swtbot.swt.finder.results.VoidResult; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.ide.IDE; /** * Encapsulates SWTBot for operations on the active workbench page. * */ public class PoWorkbenchPage extends PageObject{ /** * @return */ public SWTBotGefEditor getGefEditor() { SWTBotEditor activeEditor = bot.activeEditor(); String title = activeEditor.getTitle(); SWTBotGefEditor ed = bot.gefEditor(title); return ed; } public int openDiagramEditorFromFile(final IFile diagFile) { return syncExec(new IntResult() { public Integer run() { try { IEditorPart ed = IDE.openEditor(getWorkbenchPage(), diagFile, org.eclipse.graphiti.ui.editor.DiagramEditor.DIAGRAM_EDITOR_ID); GFOtherTests.assertTrue("Editor must be a diagram editor: " + ed, ed instanceof DiagramEditor); } catch (PartInitException e) { GFOtherTests.fail(e.getMessage()); } return getWorkbenchPage().getEditorReferences().length; } }); } public int openDiagramEditorFromObject(final Diagram diagram) { Resource resource = diagram.eResource(); assertNotNull(resource); return syncExec(new IntResult() { public Integer run() { IWorkbenchPage page = getWorkbenchPage(); try { IEditorInput input = DiagramEditorInput.createEditorInput(diagram, GraphitiUi.getExtensionManager() .getDiagramTypeProviderId(diagram.getDiagramTypeId())); IEditorPart ed = IDE.openEditor(page, input, DiagramEditor.DIAGRAM_EDITOR_ID); assertTrue("Editor must be a diagram editor: " + ed, ed instanceof DiagramEditor); } catch (PartInitException e) { fail(e.getMessage()); } return page.getEditorReferences().length; } }); } private IWorkbenchPage getWorkbenchPage() { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); return page; } public void shutdownEditor(final SWTBotGefEditor diagramEditor) { // Close popups. syncExec(new VoidResult() { public void run() { // Using SWTBot yields an exception since a keyboard layout file for DE is not available. // bot.activeShell().pressShortcut(SWT.NONE, SWT.ESC); try { Robot r = new Robot(); r.keyPress(SWT.ESC); r.keyRelease(SWT.ESC); } catch (AWTException e) { e.printStackTrace(); } } }); diagramEditor.saveAndClose(); } public void shutdownEditor(final DiagramEditor diagramEditor) { // Close popups. syncExec(new VoidResult() { public void run() { // Using SWTBot yields an exception since a keyboard layout file for DE is not available. // bot.activeShell().pressShortcut(SWT.NONE, SWT.ESC); try { Robot r = new Robot(); r.keyPress(SWT.ESC); r.keyRelease(SWT.ESC); } catch (AWTException e) { e.printStackTrace(); } diagramEditor.doSave(new NullProgressMonitor()); bot.editorByTitle(diagramEditor.getTitle()).close(); } }); } public void closeAllEditors() { List<? extends SWTBotEditor> editors = bot.editors(); for (SWTBotEditor editor : editors) { editor.close(); } } public void closeActiveEditor(){ SWTBotEditor activeEditor = bot.activeEditor(); activeEditor.close(); } public void openGraphitiTestPerspective() { syncExec(new VoidResult() { public void run() { SWTBotPerspective p = bot.perspectiveById("org.eclipse.graphiti.examples.common.perspective.GFPerspective"); p.activate(); bot.activeShell().widget.setMaximized(true); } }); } public void closeWelcomeView(AbstractGFTests abstractGFTests) { try { bot.viewByTitle("Welcome").close(); } catch (WidgetNotFoundException e) { // do nothing } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
6f57abc4701d9398d8572ca1a5226febaebf6533
9cb5b088e22c32734245e770f533e5b776eec053
/spring-entity/src/main/java/entity/CheckBeanPostProcessorImpl.java
ba8908a4552456da0743e2fc1eed74869f4d7ec1
[]
no_license
lxchinesszz/Spring-Framework-learn
454dd7b5593c03ccba031c327874b1b18fe52002
b8c22b200b532829c105f122c8b6c0d0d43c06ac
refs/heads/master
2020-03-21T01:50:51.000951
2018-09-29T09:29:01
2018-09-29T09:29:01
137,966,051
3
0
null
null
null
null
UTF-8
Java
false
false
1,481
java
package entity; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; import utils.Console; import java.lang.reflect.Field; /** * 该方法会在Bean初始化前和初始化后执行 * * @author liuxin * @version Id: CheckBeanPostProcessor.java, v 0.1 2018/6/26 上午9:09 */ public class CheckBeanPostProcessorImpl implements BeanPostProcessor { @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { Console.customerNormal("postProcessBeforeInitialization", "执行"); //Person的name属性是写死的,所以初始化前就有 if (bean instanceof Person) { ((Person) bean).say(); } return bean; } @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { Console.customerNormal("postProcessAfterInitialization", "执行"); //在类初始化后我们反射修改他 if (bean instanceof Person) { try { Field name = ((Person) bean).getClass().getDeclaredField("name"); name.setAccessible(true); name.set(bean,"CUSTOMER"); } catch (NoSuchFieldException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } return bean; } }
[ "lxchinesszz@163.com" ]
lxchinesszz@163.com
1e93e4729de0bda9d8144f530b438ef1ac4e92d5
e57bf1b4927601b06172e0c1f1cb79fa325024b2
/library/src/main/java/pony/xcode/media/adapter/MediaBasePagerAdapter.java
b8eb84914b717fe5910b09aea7641ce2eb8e19c0
[]
no_license
gallopmark/MediaPicker
cc217c3f26853ff9e744637c86aaae998b7aff83
b0b7f718bc8312129d8eac9cf601c8722599f866
refs/heads/master
2021-05-18T07:33:30.264047
2020-06-08T06:54:41
2020-06-08T06:54:41
251,180,820
0
0
null
null
null
null
UTF-8
Java
false
false
1,037
java
package pony.xcode.media.adapter; import android.content.Context; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.viewpager.widget.PagerAdapter; import java.util.List; public class MediaBasePagerAdapter<T> extends PagerAdapter { Context mContext; List<T> mDataList; OnPagerItemClickListener mListener; MediaBasePagerAdapter(Context context, List<T> dataList) { this.mContext = context; this.mDataList = dataList; } @Override public int getCount() { return mDataList == null ? 0 : mDataList.size(); } @Override public boolean isViewFromObject(@NonNull View view, @NonNull Object o) { return view == o; } @Override public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { container.removeView((View) object); } public void setOnPagerItemClickListener(OnPagerItemClickListener listener) { this.mListener = listener; } }
[ "i23xiaoyan@qq.com" ]
i23xiaoyan@qq.com
2b5b5909cd070ec88983b4ae4d7db9d3ecacfa9b
fde6280cf9b09fad04918331b5c2256a94e4394c
/map/src/main/java/com/map/feature/OnLocationChangeListener.java
6a3a523c39a2a28b2ff4f9b4703d37fb767aa164
[]
no_license
ozcoco/AndroidNavigationDemo
cd867397ff785328f8375a1dc52c5fc7bdede2af
57176e4dca45e127928dd9ec5f5e5f0a8a4b057b
refs/heads/master
2020-04-30T00:11:34.228176
2019-05-17T08:27:09
2019-05-17T08:27:09
176,496,786
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
package com.map.feature; import com.map.entity.Location; public interface OnLocationChangeListener { void onLocationChange(Location location); }
[ "857527916@qq.com" ]
857527916@qq.com
b40755ad26074c1b23d4a244400df6e6fb2f27b3
0493ffe947dad031c7b19145523eb39209e8059a
/OpenJdk8uTest/src/test/java/util/concurrent/SynchronousQueue/Fairness.java
049fe7528c29a4e836034dc57e49a64d3d24adac
[]
no_license
thelinh95/Open_Jdk8u_Test
7612f1b63b5001d1df85c1df0d70627b123de80f
4df362a71e680dbd7dfbb28c8922e8f20373757a
refs/heads/master
2021-01-16T19:27:30.506632
2017-08-13T23:26:05
2017-08-13T23:26:05
100,169,775
0
1
null
null
null
null
UTF-8
Java
false
false
3,104
java
package test.java.util.concurrent.SynchronousQueue; /* * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @bug 4992438 6633113 * @summary Checks that fairness setting is respected. */ import java.util.concurrent.BlockingQueue; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; import test.java.util.concurrent.*; import test.java.util.concurrent.locks.*; public class Fairness { private static void testFairness(boolean fair, final BlockingQueue<Integer> q) throws Throwable { final ReentrantLock lock = new ReentrantLock(); final Condition ready = lock.newCondition(); final int threadCount = 10; final Throwable[] badness = new Throwable[1]; lock.lock(); for (int i = 0; i < threadCount; i++) { final Integer I = i; Thread t = new Thread() { public void run() { try { lock.lock(); ready.signal(); lock.unlock(); q.put(I); } catch (Throwable t) { badness[0] = t; }}}; t.start(); ready.await(); // Probably unnecessary, but should be bullet-proof while (t.getState() == Thread.State.RUNNABLE) Thread.yield(); } for (int i = 0; i < threadCount; i++) { int j = q.take(); // Non-fair queues are lifo in our implementation if (fair ? j != i : j != threadCount - 1 - i) throw new Error(String.format("fair=%b i=%d j=%d%n", fair, i, j)); } if (badness[0] != null) throw new Error(badness[0]); } public static void main(String[] args) throws Throwable { testFairness(false, new SynchronousQueue<Integer>()); testFairness(false, new SynchronousQueue<Integer>(false)); testFairness(true, new SynchronousQueue<Integer>(true)); } }
[ "truongthelinh95@gmail.com" ]
truongthelinh95@gmail.com
4ed001f092613fbc4353cfa8dd1baf3bf1d664f2
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_1482494_0/java/Phil217/ProblemB.java
9f4b04d231c6900e3cd1405d0f23ae666bbd6e65
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
Java
false
false
2,253
java
package problemB; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class ProblemB { public static void main(String[] args) throws FileNotFoundException { // Scanner sc = new Scanner(new File("B-practice.in")); Scanner sc = new Scanner(new File("B-small.in")); // Scanner sc = new Scanner(new File("B-large.in")); int cases = sc.nextInt(); for (int i = 1; i <= cases; i++) { int T = sc.nextInt(); int[][] stars = new int[T][2]; for (int j = 0; j < stars.length; j++) { for (int k = 0; k < 2; k++) { stars[j][k] = sc.nextInt(); } } int[] starsGotten = new int[T]; int solved = 0; int hasStars = 0; int trys = solve(T, stars, starsGotten, solved, hasStars); if (trys == -1) { System.out.format("Case #%d: Too Bad\n", i); } else { System.out.format("Case #%d: %d\n", i, trys); } } } private static int solve(int T, int[][] stars, int[] starsGotten, int solved, int hasStars) { boolean change = false; int trys = 0; do { if (solved == T) { break; } trys++; change = false; // solve for (int j = 0; j < starsGotten.length; j++) { if (starsGotten[j] == 0) { if (stars[j][1] <= hasStars) { solved++; hasStars += 2; starsGotten[j] = 2; change = true; break; } } } // 1->2 if (!change) { for (int j = 0; j < starsGotten.length; j++) { if (starsGotten[j] == 1) { if (stars[j][1] <= hasStars) { solved++; hasStars += 1; starsGotten[j] = 2; change = true; break; } } } } // 0->1 if (!change) { int min = -1; for (int j = 0; j < starsGotten.length; j++) { if (starsGotten[j] == 0) { if (stars[j][0] <= hasStars) { int[] cl = starsGotten.clone(); cl[j] = 1; int test = solve(T, stars, cl, solved, hasStars + 1); if (min == -1 || test < min) { min = test; } } } } if (min == -1) { return min; } return min + trys; } } while (change); if (solved < T) { return -1; } return trys; } }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
6f01969dd72498f5e333579f6d0e206707910663
473b76b1043df2f09214f8c335d4359d3a8151e0
/benchmark/bigclonebenchdata_completed/727437.java
27cb14b594b5f0c65343960bbbcec2a44f556482
[]
no_license
whatafree/JCoffee
08dc47f79f8369af32e755de01c52d9a8479d44c
fa7194635a5bd48259d325e5b0a190780a53c55f
refs/heads/master
2022-11-16T01:58:04.254688
2020-07-13T20:11:17
2020-07-13T20:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,222
java
import java.io.*; import java.lang.*; import java.util.*; import java.math.*; import java.net.*; import java.applet.*; import java.security.*; class c727437 { public void elimina(Pedido pe) throws Throwable, errorSQL, errorConexionBD { System.out.println("GestorPedido.elimina()"); int id =(int)(Object) pe.getId(); String sql; Statement stmt = null; try { MyHelperClass gd = new MyHelperClass(); gd.begin(); sql = "DELETE FROM pedido WHERE id=" + id; System.out.println("Ejecutando: " + sql); // MyHelperClass gd = new MyHelperClass(); stmt =(Statement)(Object) gd.getConexion().createStatement(); stmt.executeUpdate(sql); System.out.println("executeUpdate"); // MyHelperClass gd = new MyHelperClass(); gd.commit(); System.out.println("commit"); stmt.close(); } catch (ArithmeticException e) { MyHelperClass gd = new MyHelperClass(); gd.rollback(); throw new errorSQL(e.toString()); } catch (ArrayIndexOutOfBoundsException e) { System.err.println("Error en GestorPedido.elimina(): " + e); } catch (ArrayStoreException e) { System.err.println("Error en GestorPedido.elimina(): " + e); } } } // Code below this line has been added to remove errors class MyHelperClass { public MyHelperClass begin(){ return null; } public MyHelperClass commit(){ return null; } public MyHelperClass createStatement(){ return null; } public MyHelperClass rollback(){ return null; } public MyHelperClass getConexion(){ return null; }} class Pedido { public MyHelperClass getId(){ return null; }} class errorSQL extends Exception{ public errorSQL(String errorMessage) { super(errorMessage); } } class errorConexionBD extends Exception{ public errorConexionBD(String errorMessage) { super(errorMessage); } } class Statement { public MyHelperClass close(){ return null; } public MyHelperClass executeUpdate(String o0){ return null; }} class SQLException extends Exception{ public SQLException(String errorMessage) { super(errorMessage); } }
[ "piyush16066@iiitd.ac.in" ]
piyush16066@iiitd.ac.in
8879f808d1ca590ec3cfa055743a68a021c42cdf
26394d0446ddcf0bc15c85f1ea188d133780fe77
/C2203L/JP1/07-11-2022/myapp/src/main/java/com/myapp/aptech/Person.java
41b30fd5f31f66a0424d4a6ea0bbcd40e8bb1be2
[]
no_license
sunlight3d/Aptech
608a18c6ea72f9248da91d205a194b6ceb247187
b6246d83c8d876d69b6a22f5ec52a802d5d5173b
refs/heads/master
2023-08-16T18:18:23.189028
2023-08-16T13:46:19
2023-08-16T13:46:19
297,259,105
14
28
null
2022-08-25T06:45:45
2020-09-21T07:17:07
JavaScript
UTF-8
Java
false
false
1,104
java
package com.myapp.aptech; import java.util.Scanner; public class Person { private String name; //instance fields private Integer age;//instance fields public void input() throws Exception{ System.out.println("Enter name: "); this.name = (new Scanner(System.in)).next(); System.out.println("Enter age: "); int age = (new Scanner(System.in)).nextInt(); if(age < 0) { throw new Exception("Age cannot be negative"); } this.age = age; } public void display() { // System.out.println("name: "+this.name + // "age: "+this.age); System.out.println(String.format("name: %s, age: %d\n", name,age)); } //getter public String getName() { return name; } //setter public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } //public abstract void doSomething();//no implementation }
[ "sunlight4d@gmail.com" ]
sunlight4d@gmail.com
b550bda47270889b8ea90814245c2d12ff652909
ed5159d056e98d6715357d0d14a9b3f20b764f89
/src/irvine/oeis/a149/A149095.java
0873da8a5a97401e858eab3c92428ea676071607
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
588
java
package irvine.oeis.a149; // Generated by gen_seq4.pl walk23 3 5 1 220200201122110 at 2019-07-08 22:06 // DO NOT EDIT here! import irvine.oeis.WalkCubeSequence; /** * A149095 Number of walks within <code>N^3</code> (the first octant of <code>Z^3)</code> starting at <code>(0,0,0)</code> and consisting of n steps taken from <code>{(-1, -1, 0), (-1, 0, 0), (-1, 0, 1), (1, -1, -1), (1, 1, 0)}</code>. * @author Georg Fischer */ public class A149095 extends WalkCubeSequence { /** Construct the sequence. */ public A149095() { super(0, 3, 5, "", 1, "220200201122110"); } }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
4e24997036b2b397130592faac3c0081042ec8b6
8b066c92cdfcabce6a7ca76d9ce0aaedc2be1bc2
/afterburner/src/test/java/com/fasterxml/jackson/module/afterburner/deser/merge/CollectionMergeTest.java
11dcea1c7a8e62a2ba2b52d6023b6f0f897d389e
[ "Apache-2.0" ]
permissive
FasterXML/jackson-modules-base
5393e4c4e5057b6632111e2dfc8a6e6e67d46082
758b7004e63b5600853143b0d5586911e50b2dbf
refs/heads/2.16
2023-08-22T17:56:42.294790
2023-08-03T03:49:22
2023-08-03T03:49:22
50,140,860
164
89
Apache-2.0
2023-08-03T03:49:23
2016-01-21T22:24:00
Java
UTF-8
Java
false
false
3,096
java
package com.fasterxml.jackson.module.afterburner.deser.merge; import java.util.*; import com.fasterxml.jackson.annotation.JsonMerge; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.module.afterburner.AfterburnerTestBase; public class CollectionMergeTest extends AfterburnerTestBase { static class CollectionWrapper { @JsonMerge public Collection<String> bag = new TreeSet<String>(); { bag.add("a"); } } static class MergedList { @JsonMerge public List<String> values = new ArrayList<>(); { values.add("a"); } } static class MergedEnumSet { @JsonMerge public EnumSet<ABC> abc = EnumSet.of(ABC.B); } static class MergedX<T> { @JsonMerge T value; public MergedX(T v) { value = v; } protected MergedX() { } public void setValue(T v) { value = v; } } /* /******************************************************** /* Test methods /******************************************************** */ private final ObjectMapper MAPPER = mapperBuilder() // 26-Oct-2016, tatu: Make sure we'll report merge problems by default .disable(MapperFeature.IGNORE_MERGE_FOR_UNMERGEABLE) .build(); public void testCollectionMerging() throws Exception { CollectionWrapper w = MAPPER.readValue(aposToQuotes("{'bag':['b']}"), CollectionWrapper.class); assertEquals(2, w.bag.size()); assertTrue(w.bag.contains("a")); assertTrue(w.bag.contains("b")); } public void testListMerging() throws Exception { MergedList w = MAPPER.readValue(aposToQuotes("{'values':['x']}"), MergedList.class); assertEquals(2, w.values.size()); assertTrue(w.values.contains("a")); assertTrue(w.values.contains("x")); } // Test that uses generic type public void testGenericListMerging() throws Exception { Collection<String> l = new ArrayList<>(); l.add("foo"); MergedX<Collection<String>> input = new MergedX<Collection<String>>(l); MergedX<Collection<String>> result = MAPPER .readerFor(new TypeReference<MergedX<Collection<String>>>() {}) .withValueToUpdate(input) .readValue(aposToQuotes("{'value':['bar']}")); assertSame(input, result); assertEquals(2, result.value.size()); Iterator<String> it = result.value.iterator(); assertEquals("foo", it.next()); assertEquals("bar", it.next()); } public void testEnumSetMerging() throws Exception { MergedEnumSet result = MAPPER.readValue(aposToQuotes("{'abc':['A']}"), MergedEnumSet.class); assertEquals(2, result.abc.size()); assertTrue(result.abc.contains(ABC.B)); // original assertTrue(result.abc.contains(ABC.A)); // added } }
[ "tatu.saloranta@iki.fi" ]
tatu.saloranta@iki.fi
cd5bf17265c981d6b2694186d2ec7215b8385e2b
4d6f449339b36b8d4c25d8772212bf6cd339f087
/netreflected/src/Framework/UIAutomationProvider,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35/system/windows/automation/provider/IScrollProviderImplementation.java
fc6bff43e73ce2c8346582b11a9cfcfe5ba11879
[ "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
8,095
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 system.windows.automation.provider; import org.mases.jcobridge.*; import org.mases.jcobridge.netreflection.*; import java.util.ArrayList; // Import section import system.windows.automation.ScrollAmount; /** * The base .NET class managing System.Windows.Automation.Provider.IScrollProvider, UIAutomationProvider, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. Extends {@link NetObject}. * <p> * * See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Automation.Provider.IScrollProvider" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Automation.Provider.IScrollProvider</a> */ public class IScrollProviderImplementation extends NetObject implements IScrollProvider { /** * Fully assembly qualified name: UIAutomationProvider, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 */ public static final String assemblyFullName = "UIAutomationProvider, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; /** * Assembly name: UIAutomationProvider */ public static final String assemblyShortName = "UIAutomationProvider"; /** * Qualified class name: System.Windows.Automation.Provider.IScrollProvider */ public static final String className = "System.Windows.Automation.Provider.IScrollProvider"; static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName); /** * The type managed from JCOBridge. See {@link JCType} */ public static JCType classType = createType(); static JCEnum enumInstance = null; JCObject classInstance = null; static JCType createType() { try { return bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName)); } catch (JCException e) { return null; } } void addReference(String ref) throws Throwable { try { bridge.AddReference(ref); } catch (JCNativeException jcne) { throw translateException(jcne); } } public IScrollProviderImplementation(Object instance) throws Throwable { super(instance); if (instance instanceof JCObject) { classInstance = (JCObject) instance; } else throw new Exception("Cannot manage object, it is not a JCObject"); } public String getJCOAssemblyName() { return assemblyFullName; } public String getJCOClassName() { return className; } public String getJCOObjectName() { return className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); } public Object getJCOInstance() { return classInstance; } public JCType getJCOType() { return classType; } /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link IScrollProvider}, a cast assert is made to check if types are compatible. */ public static IScrollProvider ToIScrollProvider(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new IScrollProviderImplementation(from.getJCOInstance()); } // Methods section public void Scroll(ScrollAmount horizontalAmount, ScrollAmount verticalAmount) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("Scroll", horizontalAmount == null ? null : horizontalAmount.getJCOInstance(), verticalAmount == null ? null : verticalAmount.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void SetScrollPercent(double horizontalPercent, double verticalPercent) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("SetScrollPercent", horizontalPercent, verticalPercent); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Properties section public boolean getHorizontallyScrollable() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (boolean)classInstance.Get("HorizontallyScrollable"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public boolean getVerticallyScrollable() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (boolean)classInstance.Get("VerticallyScrollable"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public double getHorizontalScrollPercent() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (double)classInstance.Get("HorizontalScrollPercent"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public double getHorizontalViewSize() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (double)classInstance.Get("HorizontalViewSize"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public double getVerticalScrollPercent() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (double)classInstance.Get("VerticalScrollPercent"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public double getVerticalViewSize() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (double)classInstance.Get("VerticalViewSize"); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Instance Events section }
[ "mario.mastrodicasa@masesgroup.com" ]
mario.mastrodicasa@masesgroup.com
44aee82c90210198bd62e7d309a50b7859d65e70
c5254a0b2d3ec92f32517f5fa3dc439c1a7a70ee
/old/bridge/Clothes.java
7c3448539088155a6da56a2498db97f88a54a8a7
[]
no_license
Tralo/PatternStudy
af86ec3fafbaa431fc9e14fb84766a72e39c39dc
16d001620cbb40f136122e7c52d7fa68f9d9178f
refs/heads/master
2020-12-07T20:24:45.770237
2017-02-01T07:52:01
2017-02-01T07:52:01
66,948,570
0
0
null
null
null
null
UTF-8
Java
false
false
268
java
package bridge; public class Clothes extends Product { @Override public void beProducted() { System.out.println("生产出的衣服是这个样子的..."); } @Override public void beSelled() { System.out.println("生产出的衣服卖出去了..."); } }
[ "13580548169@163.com" ]
13580548169@163.com
b0555964f14f428c089f2b9f1832444f24dcd341
0d87c209d3cc2f0e6da1521e49ce54e14bd2a5d5
/src/main/java/org/example/Application.java
b02df6c58c3fb054997d6f3b34bf59b4051e7f8d
[]
no_license
sdelamo/talk-2020-07-introduction-to-micronaut-jug-stuttgart
0281df37f5d1aec8939a77257ed32a60889d65bb
b320fcbf48169accc7b5a369918f3000088c6e7c
refs/heads/master
2022-11-28T19:48:29.237684
2020-08-16T17:10:26
2020-08-16T17:10:26
283,835,179
2
0
null
null
null
null
UTF-8
Java
false
false
360
java
package org.example; import io.micronaut.runtime.Micronaut; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.info.Info; @OpenAPIDefinition(info = @Info(version = "0.1", title = "jug")) public class Application { public static void main(String[] args) { Micronaut.run(Application.class, args); } }
[ "sergio.delamo@softamo.com" ]
sergio.delamo@softamo.com
814e9d10074c674e2945794e86e6486040093897
fc6c869ee0228497e41bf357e2803713cdaed63e
/weixin6519android1140/src/sourcecode/com/tencent/tmassistantsdk/logreport/GetSettingEngine.java
f92083f33e9b9ddf0f63a6b5324cd5090713282f
[]
no_license
hyb1234hi/reverse-wechat
cbd26658a667b0c498d2a26a403f93dbeb270b72
75d3fd35a2c8a0469dbb057cd16bca3b26c7e736
refs/heads/master
2020-09-26T10:12:47.484174
2017-11-16T06:54:20
2017-11-16T06:54:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,977
java
package com.tencent.tmassistantsdk.logreport; import com.tencent.tmassistantsdk.network.GetSettingHttpRequest; import com.tencent.tmassistantsdk.network.IGetSettingHttpListener; import com.tencent.tmassistantsdk.protocol.ProtocolPackage; import com.tencent.tmassistantsdk.protocol.jce.GetSettingsRequest; import com.tencent.tmassistantsdk.protocol.jce.GetSettingsResponse; import com.tencent.tmassistantsdk.protocol.jce.SettingsCfg; import com.tencent.tmassistantsdk.protocol.jce.StatCfg; import com.tencent.tmassistantsdk.util.GlobalUtil; import com.tencent.tmassistantsdk.util.TMLog; import java.util.ArrayList; public class GetSettingEngine implements IGetSettingHttpListener { protected static final String TAG = "GetSettingEngine"; protected static GetSettingEngine mInstance = null; protected GetSettingHttpRequest httpRequest = null; public static GetSettingEngine getInstance() { try { if (mInstance == null) { mInstance = new GetSettingEngine(); } GetSettingEngine localGetSettingEngine = mInstance; return localGetSettingEngine; } finally {} } public void cancleRequest() { try { if (this.httpRequest != null) { this.httpRequest.cancleRequest(); this.httpRequest = null; } return; } finally { localObject = finally; throw ((Throwable)localObject); } } public void onSettingHttpRequestFinish(GetSettingsRequest paramGetSettingsRequest, GetSettingsResponse paramGetSettingsResponse, boolean paramBoolean) { this.httpRequest = null; if (paramBoolean) { if ((paramGetSettingsResponse.settings != null) && (paramGetSettingsResponse.settings.size() > 0)) { paramGetSettingsRequest = (SettingsCfg)paramGetSettingsResponse.settings.get(0); if ((paramGetSettingsRequest != null) && (paramGetSettingsRequest.cfg != null)) { paramGetSettingsRequest = (StatCfg)ProtocolPackage.bytes2JceObj(paramGetSettingsRequest.cfg, StatCfg.class); if (paramGetSettingsRequest == null) { break label84; } GlobalUtil.getInstance().setNetTypeValue(paramGetSettingsRequest.netType); } } for (;;) { TMLog.i("GetSettingEngine", "response.settings is null !"); return; label84: TMLog.i("GetSettingEngine", "response StatCfg is null !"); } } TMLog.i("GetSettingEngine", "get settings failed!"); } public void sendRequest() { if (this.httpRequest != null) { return; } this.httpRequest = new GetSettingHttpRequest(); this.httpRequest.setGetSettingHttpListener(this); this.httpRequest.sendSettingRequest(); } } /* Location: D:\tools\apktool\weixin6519android1140\jar\classes2-dex2jar.jar!\com\tencent\tmassistantsdk\logreport\GetSettingEngine.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "robert0825@gmail.com" ]
robert0825@gmail.com
90a4bd1d46dbfdfa8b3e6d149a9fd44e80da9cf3
d704ec43f7a5a296b91f5de0023def92f013dcda
/core/src/main/java/org/elasticsearch/discovery/Discovery.java
a3126300401be219700e444785e30a22ee8c774c
[ "Apache-2.0", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
diegopacheco/elassandra
e4ede3085416750d4a71bcdf1ae7b77786b6cc36
d7f85d1768d5ca8e7928d640609dd5a777b2523c
refs/heads/master
2021-01-12T08:24:05.935475
2016-12-15T06:53:09
2016-12-15T06:53:09
76,563,249
0
1
Apache-2.0
2023-03-20T11:53:08
2016-12-15T13:46:19
Java
UTF-8
Java
false
false
4,091
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.discovery; import java.io.IOException; import java.net.InetAddress; import java.util.Map; import java.util.Set; import java.util.UUID; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.elasticsearch.cluster.ClusterChangedEvent; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.node.service.NodeService; /** * A pluggable module allowing to implement discovery of other nodes, publishing of the cluster * state to all nodes, electing a master of the cluster that raises cluster state change * events. */ public interface Discovery extends LifecycleComponent<Discovery> { DiscoveryNode localNode(); /* void addListener(InitialStateDiscoveryListener listener); void removeListener(InitialStateDiscoveryListener listener); */ String nodeDescription(); /** * Here as a hack to solve dep injection problem... */ void setNodeService(@Nullable NodeService nodeService); /** * Another hack to solve dep injection problem..., note, this will be called before * any start is called. */ //void setRoutingService(RoutingService routingService); /** * Publish all the changes to the cluster from the master (can be called just by the master). The publish * process should not publish this state to the master as well! (the master is sending it...). * * The {@link AckListener} allows to keep track of the ack received from nodes, and verify whether * they updated their own cluster state or not. */ //void publish(ClusterChangedEvent clusterChangedEvent, AckListener ackListener); void publishX1(ClusterState clusterState); void publishX2(ClusterState clusterState); void connectToNodes(); /* public static interface AckListener { void onNodeAck(DiscoveryNode node, @Nullable Throwable t); void onTimeout(); } */ /** * Triggers the first join cycle */ void startInitialJoin(); public DiscoveryNodes nodes(); public Map<UUID, ShardRoutingState> getShardRoutingStates(String index); /** * Set index shard state in the gossip endpoint map (must be synchronized). * @param index * @param shardRoutingState (remove index shard state if null) * @throws JsonGenerationException * @throws JsonMappingException * @throws IOException */ void putShardRoutingState(final String index, final ShardRoutingState shardRoutingState) throws JsonGenerationException, JsonMappingException, IOException; /** * Block until clusterState.metadata.version < expected version for all alive nodes. * @param version * @param ackTimeout * @throws Exception */ boolean awaitMetaDataVersion(final long version, final TimeValue ackTimeout) throws Exception; }
[ "vroyer@vroyer.org" ]
vroyer@vroyer.org
2d52dd73d89bdc8655400d9c1e1cab56df76899e
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/scanner/model/ag$d$$ExternalSyntheticLambda0.java
67fd01bf1f472aa807c3014fc78f50bb4c8b982f
[]
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
374
java
package com.tencent.mm.plugin.scanner.model; public final class ag$d$$ExternalSyntheticLambda0 implements Runnable { public final void run() {} } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes9.jar * Qualified Name: com.tencent.mm.plugin.scanner.model.ag.d..ExternalSyntheticLambda0 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
b9462a25c39793e1dc1e972cfa137c336269651c
09be72f1c3639f8f809b1e169970acc96f289bd7
/src/feinno-ha/src/feinno-ha/src/main/java/com/feinno/ha/interfaces/worker/HAWorkerAgentCallbackService.java
224ce1802f5e7d9e4af167f3fbfc5fc1c7890d6d
[]
no_license
philiahe/angel
ffdfbad0a1ac29280bad209e2cd662654cd7fe81
18eac04bd61144fb882c8581719d4eb86b5a8923
refs/heads/master
2020-04-12T13:59:46.454878
2015-01-20T07:10:56
2015-01-20T07:10:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
669
java
/* * FAE, Feinno App Engine * * Create by gaolei May 15, 2012 * * Copyright (c) 2012 北京新媒传信科技有限公司 */ package com.feinno.ha.interfaces.worker; import com.feinno.ha.interfaces.configuration.HAConfigArgs; import com.feinno.rpc.server.RpcMethod; import com.feinno.rpc.server.RpcService; /** * * 由客户端Worker提供的duplex回调服务 * * @author 高磊 gaolei@feinno.com */ @RpcService("HAWorkerAgentCallbackService") public interface HAWorkerAgentCallbackService { /** * * 通知配置过期 */ @RpcMethod("NotifyConfigExpired") public void notifyConfigExpired(HAConfigArgs args); }
[ "honghao@feinno.com" ]
honghao@feinno.com
193cbdf53444086ab19bff9ea0f93481e95de4b0
e63db9eaac8299c2bd16847f084c59cdd08cead6
/branches/services/ReservasServlet/src/java/services/confirmReserve/ConfirmReserveService.java
21a50b3ae353f5a79031a93696416b65d1b0c835
[]
no_license
BGCX261/zonales-svn-to-git
974432530b3358b0c2d774ed2f5e9472b5618ab8
8008a68284efc58fced9a5e042dd165da1e94f90
refs/heads/master
2021-01-18T14:38:22.068945
2015-08-25T15:43:33
2015-08-25T15:43:33
41,586,043
0
0
null
null
null
null
UTF-8
Java
false
false
4,544
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package services.confirmReserve; import services.*; import entities.BaseEntity; import entities.JosReserve; import entities.JosReserveHasJosResources; import entities.JosReserveHasJosResourcesPK; import java.io.IOException; import java.io.PrintWriter; import java.sql.Time; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.StringTokenizer; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import model.ReserveModel; import model.ReservesHasResourcesModel; import model.ResourcesModel; /** * * @author Nosotros */ public class ConfirmReserveService { public void serve(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ResourcesModel resourcesModel = new ResourcesModel(); ReservesHasResourcesModel reservesHasResourcesModel = new ReservesHasResourcesModel(); ReserveModel reserveModel = new ReserveModel(); String sResponse = ""; PrintWriter out = response.getWriter(); String sResources = request.getParameter("resources"); String sDateYear = request.getParameter("dateYear"); String sDateMonth = request.getParameter("dateMonth"); String sDateDay = request.getParameter("dateDay"); String sHour = request.getParameter("hour"); String sDuration = request.getParameter("duration"); String sUser = request.getParameter("user"); List<Integer> resources = new ArrayList<Integer>(); StringTokenizer tokenizer = new StringTokenizer(sResources, ","); while (tokenizer.hasMoreElements()) { resources.add(Integer.valueOf(tokenizer.nextElement().toString())); } Calendar hour = Calendar.getInstance(); hour.setTime(Time.valueOf(sHour)); Calendar date = Calendar.getInstance(); date.set(Integer.valueOf(sDateYear), Integer.valueOf(sDateMonth) - 1, Integer.valueOf(sDateDay), hour.get(Calendar.HOUR_OF_DAY), hour.get(Calendar.MINUTE), hour.get(Calendar.SECOND) ); Calendar duration = Calendar.getInstance(); duration.setTime(Time.valueOf(sDuration)); int userId = Integer.valueOf(sUser); for (int i = 0; i < resources.size(); i++) { resourcesModel.setSelected(resources.get(i)); List<BaseEntity> reservesList = resourcesModel.getReserves(date); for (int j = 0; j < reservesList.size(); j++) { reserveModel.setSelected( ((JosReserveHasJosResourcesPK)((JosReserveHasJosResources)reservesList.get(0)).getPK()).getReserveId() ); Date raaux = reserveModel.getSelected().getDatetimeRealization(); Calendar ra = Calendar.getInstance(); ra.setTime(raaux); Date daaux = reserveModel.getSelected().getDuration(); Calendar da = Calendar.getInstance(); da.setTime(daaux); Boolean available = Boolean.FALSE; available = Helper.checkReserve(ra, da, date, duration); if (!available) { sResponse = sResponse + "Error: ResourceId " + resources.get(i) + " no disponible; "; } } } if ("".compareTo(sResponse) == 0) { JosReserve josReserve = new JosReserve(null, userId, new Date(), date.getTime(), duration.getTime(), new Date()); reserveModel.setSelected(josReserve); try { reserveModel.persist(true); } catch (Exception ex) { sResponse = "Error de persistencia" + ex.getStackTrace(); } for (int i = 0; i < resources.size(); i++) { reservesHasResourcesModel.setSelected(new JosReserveHasJosResources(reserveModel.getSelected().getReserveId(), resources.get(i))); try { reservesHasResourcesModel.persist(true); } catch (Exception ex) { sResponse = "Error de persistencia" + ex.getStackTrace(); } } sResponse = reserveModel.getSelected().getReserveId() + ";" + reserveModel.getSelected().getExpiry(); } out.print(sResponse); } }
[ "you@example.com" ]
you@example.com
166ef2ff17085a563f82ae4f47b7ecab1ff64535
35c15a89db538491f301d130acba8f1afc6bd6f3
/73.矩阵置零.java
016946f45dac2a6eed0e6e74db1f684735d04de1
[]
no_license
ajacker/leetcode
47ae70fbfd44b5eea0a050aba73ea23cc31dc1b6
72c576d3edcc98309938ea62106b1af091b6623e
refs/heads/master
2020-09-07T03:11:37.340200
2020-08-17T12:22:59
2020-08-17T12:22:59
220,638,961
1
0
null
null
null
null
UTF-8
Java
false
false
792
java
/* * @lc app=leetcode.cn id=73 lang=java * * [73] 矩阵置零 */ // @lc code=start class Solution { public void setZeroes(int[][] matrix) { int R = matrix.length; int C = matrix[0].length; Set<Integer> rows = new HashSet<Integer>(); Set<Integer> cols = new HashSet<Integer>(); for (int i = 0; i < R; i++) { for (int j = 0; j < C; j++) { if (matrix[i][j] == 0) { rows.add(i); cols.add(j); } } } for (int i = 0; i < R; i++) { for (int j = 0; j < C; j++) { if (rows.contains(i) || cols.contains(j)) { matrix[i][j] = 0; } } } } } // @lc code=end
[ "ajacker@foxmail.com" ]
ajacker@foxmail.com
0c4bbc2f094f51ab386b54a6228429a552398abb
82cc2675fdc5db614416b73307d6c9580ecbfa0c
/eb-service/quartz-service/src/main/java/cn/comtom/quartz/utils/ScheduleUtils.java
ae960a681587944e37e16751fa05889afce2b8d7
[]
no_license
hoafer/ct-ewbsv2.0
2206000c4d7c3aaa2225f9afae84a092a31ab447
bb94522619a51c88ebedc0dad08e1fd7b8644a8c
refs/heads/master
2022-11-12T08:41:26.050044
2020-03-20T09:05:36
2020-03-20T09:05:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,103
java
package cn.comtom.quartz.utils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.quartz.CronScheduleBuilder; import org.quartz.CronTrigger; import org.quartz.JobBuilder; import org.quartz.JobDetail; import org.quartz.JobKey; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.Trigger; import org.quartz.TriggerBuilder; import org.quartz.TriggerKey; import org.quartz.impl.JobDetailImpl; import org.quartz.impl.matchers.GroupMatcher; import cn.comtom.quartz.exception.RRException; /** * 定时任务工具类 * @author wj */ public class ScheduleUtils { /** * 创建任务 */ public static void createJob(Scheduler scheduler, String cronExpression, String jobName,String jobGroup,String jobDescription,Class clazz) { try { TriggerKey triggerKey = TriggerKey.triggerKey(jobName, jobGroup); //构建job信息 JobDetail jobDetail = JobBuilder.newJob(clazz).withIdentity(jobName,jobGroup).withDescription(jobDescription).build(); //表达式调度构建器 CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression) .withMisfireHandlingInstructionDoNothing(); //按新的cronExpression表达式构建一个新的trigger CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); scheduler.scheduleJob(jobDetail, trigger); } catch (SchedulerException e) { throw new RRException("创建定时任务失败", e); } } /** * 更新任务 */ public static void updateJob(Scheduler scheduler, String cronExpression,String jobName,String jobGroup) { try { TriggerKey triggerKey = TriggerKey.triggerKey(jobName, jobGroup); // 表达式调度构建器 CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression); CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); // 按新的cronExpression表达式重新构建trigger trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); // 按新的trigger重新设置job执行 scheduler.rescheduleJob(triggerKey, trigger); } catch (SchedulerException e) { throw new RRException("更新定时任务失败"); } } /** * 启动任务(一次,用于测试) */ private static void startJob(Scheduler scheduler,String jobName,String jobGroup) { try { JobKey jobKey = JobKey.jobKey(jobName, jobGroup); scheduler.triggerJob(jobKey); } catch (Exception e) { throw new RRException("启动定时任务失败"); } } /** * 任务暂停 */ public static void pauseJob(Scheduler scheduler,String jobName,String jobGroup) { try{ JobKey jobKey = JobKey.jobKey(jobName, jobGroup); scheduler.pauseJob(jobKey); }catch (Exception e){ throw new RRException("暂停定时任务失败"); } } /** * 任务删除 */ public static void delJob(Scheduler scheduler,String jobName,String jobGroup) { try{ JobKey jobKey = JobKey.jobKey(jobName, jobGroup); scheduler.deleteJob(jobKey); }catch (Exception e){ throw new RRException("删除定时任务失败"); } } /** * 任务恢复 */ public static void resumeJob(Scheduler scheduler,String jobName,String jobGroup){ try{ JobKey jobKey = JobKey.jobKey(jobName, jobGroup); scheduler.resumeJob(jobKey); }catch (Exception e){ throw new RRException("恢复定时任务失败"); } } /** * 全部定时任务 */ public static List<Map<String,Object>> getAllJobs(Scheduler scheduler) { List<Map<String,Object>> mapList = new ArrayList<Map<String,Object>>(); try { //获取Scheduler下的所有group List<String> triggerGroupNames = scheduler.getTriggerGroupNames(); for (String groupName : triggerGroupNames) { //组装group的匹配,为了模糊获取所有的triggerKey或者jobKey GroupMatcher groupMatcher = GroupMatcher.groupEquals(groupName); //获取所有的triggerKey Set<TriggerKey> triggerKeySet = scheduler.getTriggerKeys(groupMatcher); for (TriggerKey triggerKey : triggerKeySet) { //通过triggerKey在scheduler中获取trigger对象 CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); //获取trigger拥有的Job JobKey jobKey = trigger.getJobKey(); JobDetailImpl jobDetail = (JobDetailImpl) scheduler.getJobDetail(jobKey); Trigger.TriggerState triggerState = scheduler.getTriggerState(triggerKey); //组装页面需要显示的数据 Map<String,Object> map=new HashMap<String,Object>(); map.put("groupName",groupName); map.put("jobDetailName",jobDetail.getName()); map.put("jobDescription",jobDetail.getDescription()); map.put("triggerState",triggerState.name()); map.put("jobClassName",jobDetail.getJobClass().getName()); map.put("jobCronExpression",trigger.getCronExpression()); map.put("previousFireTime",trigger.getPreviousFireTime()); map.put("nextFireTime",trigger.getNextFireTime()); mapList.add(map); } } } catch (Exception e) { } return mapList; } }
[ "568656253@qq.com" ]
568656253@qq.com
ae91b39717ff2ac2351c2625b3c5c08041f10525
c70148e6e0f5a23309dbb78c74e6f9a7f4edeeaa
/org.modeldriven.alf/src/org/modeldriven/alf/fuml/mapping/FumlMappingFactory.java
63bea457aa77413ff7d6233935beea37dc3320a5
[]
no_license
lschuetze/Alf-Reference-Implementation
9fdf03c23e8c98a97a216a5df0c6e9857395ff52
c1390c5898a16862af38b1413050ce9b3b294692
refs/heads/master
2021-01-17T09:31:48.014486
2016-02-22T20:02:08
2016-02-22T20:02:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,348
java
/******************************************************************************* * Copyright 2011-2013 Data Access Technologies, Inc. (Model Driven Solutions) * All rights reserved worldwide. This program and the accompanying materials * are made available for use under the terms of the GNU General Public License * (GPL) version 3 that accompanies this distribution and is available at * http://www.gnu.org/licenses/gpl-3.0.html. For alternative licensing terms, * contact Model Driven Solutions. *******************************************************************************/ package org.modeldriven.alf.fuml.mapping; import org.modeldriven.alf.mapping.Mapping; import org.modeldriven.alf.mapping.MappingFactory; public class FumlMappingFactory extends MappingFactory { @Override public Mapping instantiateMapping(Object source) { if (source == null) { return new ErrorMapping(source, "Null source."); } else { String className = source.getClass().getName(). replace(".syntax", ".fuml.mapping") + "Mapping"; try { return (Mapping)Class.forName(className).newInstance(); } catch (Exception e) { return new ErrorMapping(source, "No mapping: " + className); } } } }
[ "ed-s@modeldriven.com" ]
ed-s@modeldriven.com
8fe705ad77dec33249647f8c78b93ac5bbab61ea
d71fc6f733e494f35f1ea855f25c5e830efea632
/kernel/impl/fabric3-introspection-java/src/test/java/org/fabric3/introspection/java/annotation/ConsumerProcessorTestCase.java
ab269acc73ff6f7743e1caa26226da75e222ed7a
[ "Apache-2.0" ]
permissive
carecon/fabric3-core
d92ba6aa847386ee491d16f7802619ee1f65f493
14a6c6cd5d7d3cabf92e670ac89432a5f522c518
refs/heads/master
2020-04-02T19:54:51.148466
2018-12-06T19:56:50
2018-12-06T19:56:50
154,750,871
0
0
null
2018-10-25T23:39:54
2018-10-25T23:39:54
null
UTF-8
Java
false
false
3,534
java
/* * Fabric3 * Copyright (c) 2009-2015 Metaform Systems * * 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. * * Portions originally based on Apache Tuscany 2007 * licensed under the Apache 2.0 license. */ package org.fabric3.introspection.java.annotation; import java.lang.reflect.Method; import java.util.Map; import junit.framework.TestCase; import org.fabric3.api.model.type.component.ComponentType; import org.fabric3.api.model.type.component.Consumer; import org.fabric3.api.model.type.java.InjectingComponentType; import org.fabric3.introspection.java.DefaultIntrospectionHelper; import org.fabric3.spi.introspection.DefaultIntrospectionContext; import org.fabric3.spi.introspection.TypeMapping; import org.fabric3.spi.introspection.java.IntrospectionHelper; public class ConsumerProcessorTestCase extends TestCase { private ConsumerProcessor processor; private InjectingComponentType componentType; private DefaultIntrospectionContext context; public void testMethod() throws Exception { Method method = TestClass.class.getDeclaredMethod("onEvent", String.class); org.fabric3.api.annotation.Consumer annotation = method.getAnnotation(org.fabric3.api.annotation.Consumer.class); TypeMapping mapping = new TypeMapping(); context.addTypeMapping(TestClass.class, mapping); processor.visitMethod(annotation, method, TestClass.class, componentType, context); assertEquals(0, context.getErrors().size()); Map<String, Consumer<ComponentType>> consumers = componentType.getConsumers(); Consumer<ComponentType> definition = consumers.get("onEvent"); assertEquals(String.class, definition.getType().getType()); } public void testSequenceMethod() throws Exception { Method method = TestClass.class.getDeclaredMethod("onSequenceEvent", String.class); org.fabric3.api.annotation.Consumer annotation = method.getAnnotation(org.fabric3.api.annotation.Consumer.class); TypeMapping mapping = new TypeMapping(); context.addTypeMapping(TestClass.class, mapping); processor.visitMethod(annotation, method, TestClass.class, componentType, context); assertEquals(0, context.getErrors().size()); Map<String, Consumer<ComponentType>> consumers = componentType.getConsumers(); Consumer definition = consumers.get("onSequenceEvent"); assertEquals(2, definition.getSequence()); } protected void setUp() throws Exception { super.setUp(); IntrospectionHelper helper = new DefaultIntrospectionHelper(); processor = new ConsumerProcessor(helper); componentType = new InjectingComponentType(); context = new DefaultIntrospectionContext(); } public static class TestClass { @org.fabric3.api.annotation.Consumer public void onEvent(String message) { } @org.fabric3.api.annotation.Consumer(sequence = 2) public void onSequenceEvent(String message) { } } }
[ "jim.marino@gmail.com" ]
jim.marino@gmail.com
50c4841d8e2e3d9af4e7e28d190980b495f72563
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/80_wheelwebtool-wheel.components.DateInput-1.0-7/wheel/components/DateInput_ESTest_scaffolding.java
8b94c0d80ad7abcf350923c1b799f1ef103bbe6f
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
532
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Oct 25 22:42:00 GMT 2019 */ package wheel.components; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class DateInput_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
5051ef305aadc1e1e9a7274c0cffe5628575f27b
898f37b871c17fb5b869790eb1d4f26efa9a643b
/src/main/java/com/muyundefeng/extractor/input/InputDocument.java
f12cf826cceeeb64f3c8392af99087af1efc64cc
[]
no_license
muyundefeng/Tinity
d16e906a5259d242e052dcd249df0efbcb9f0fd8
6fdbad026f6ed4777d03521034fa1d3bcbe2fd99
refs/heads/master
2021-01-20T15:13:19.035688
2017-05-16T03:26:48
2017-05-16T03:26:48
90,738,574
0
0
null
null
null
null
UTF-8
Java
false
false
2,731
java
package com.muyundefeng.extractor.input; import com.muyundefeng.extractor.trinity.Text; import com.muyundefeng.extractor.util.ProcessHtmlUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; import java.util.ArrayList; import java.util.List; /** * @author lisheng * 处理输入的html文档,并将html文档转化为字符串 */ public class InputDocument { private static final String FILE_DIR = "/home/lisheng/work/ExperData/htmls/chinanews/"; private static Logger logger = LoggerFactory.getLogger(InputDocument.class); /** * 读取指定目录之下的文件列表 * * @throws IOException */ @SuppressWarnings("Duplicates") public static List<Text> getDefaultReadHtml() throws IOException { List<Text> texts = new ArrayList<Text>(); File file = new File(FILE_DIR); if (!file.exists()) logger.error("this file is not exist!"); String htmlName[] = file.list();//得到文件列表 for (String str : htmlName) { File file2 = new File(FILE_DIR + str); String sourceText = ""; if (file2.isFile()) { InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(file2)); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String Line = ""; while ((Line = bufferedReader.readLine()) != null) { sourceText += Line + "\n"; } String afterProcessHtml = ProcessHtmlUtils.rmSomeScript(sourceText); System.out.println(afterProcessHtml); // System.exit(0); Text text = new Text(afterProcessHtml); texts.add(text); } } return texts; } /** * 自定义输入html文件 * * @param filesNames * @throws IOException */ public static List<Text> getDefiniteReadHtml(String... filesNames) throws IOException { List<Text> texts = new ArrayList<Text>(); for (String str : filesNames) { File file2 = new File(str); String sourceText = ""; if (file2.isFile()) { InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(file2)); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String Line = ""; while ((Line = bufferedReader.readLine()) != null) { sourceText += Line; } Text text = new Text(sourceText); texts.add(text); } } return texts; } }
[ "2533604335@qq.com" ]
2533604335@qq.com
c5179323f9d785f7abe075254a1571c73f8538d2
70123d8b25800e4a1743626822eb651c38513cd7
/daemon/0060-Tomcat/test/com/rift/coad/daemon/tomcat/security/CoadunationRealmTest.java
38350702021739245549524ee779dff1bf40b405
[]
no_license
brettchaldecott/dipforge
bb9205cddaba60d61ab7f65b58c22a058264b698
ca2fe194156754d142fc48fdb8b963f37aa7c6a3
refs/heads/master
2021-03-19T12:14:25.926735
2016-01-22T12:06:22
2016-01-22T12:06:22
1,043,676
2
1
null
null
null
null
UTF-8
Java
false
false
5,593
java
/* * CoadunationLib: The coaduntion implementation library. * Copyright (C) 2007 2015 Burntjam * * This library 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 library 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * CoadunationRealmTest.java * JUnit based test */ package com.rift.coad.daemon.tomcat.security; // java imports import java.io.IOException; import java.security.Principal; import java.util.Set; import java.util.List; import java.util.ArrayList; import java.util.Iterator; // log 4 j imports import org.apache.log4j.Logger; // junit imports import junit.framework.*; // tomcat imports import javax.servlet.http.HttpServletResponse; import org.apache.catalina.Realm; import org.apache.catalina.deploy.SecurityConstraint; import org.apache.catalina.deploy.LoginConfig; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.realm.RealmBase; import org.apache.catalina.realm.Constants; import org.apache.catalina.realm.GenericPrincipal; // coadunation imports import com.rift.coad.lib.security.SessionManager; import com.rift.coad.lib.security.ThreadsPermissionContainer; import com.rift.coad.lib.security.ThreadsPermissionContainerAccessor; import com.rift.coad.lib.security.login.LoginManager; import com.rift.coad.lib.security.user.UserSessionManager; import com.rift.coad.lib.security.user.UserSessionManagerAccessor; import com.rift.coad.lib.security.user.UserStoreManager; import com.rift.coad.lib.security.user.UserStoreManagerAccessor; import com.rift.coad.lib.thread.CoadunationThreadGroup; import com.rift.coad.security.BasicPrincipal; import com.rift.coad.lib.security.login.SessionLogin; import com.rift.coad.lib.security.login.handlers.PasswordInfoHandler; import com.rift.coad.lib.security.UserSession; import com.rift.coad.lib.security.RoleManager; import com.rift.coad.lib.security.Role; /** * The coadunation coadunation realm test * * @author brett */ public class CoadunationRealmTest extends TestCase { public CoadunationRealmTest(String testName) { super(testName); } protected void setUp() throws Exception { } protected void tearDown() throws Exception { } /** * Test of getName method, of class com.rift.coad.daemon.tomcat.security.CoadunationRealm. */ public void testGetName() { System.out.println("getName"); CoadunationRealm instance = new CoadunationRealm(); String expResult = instance.getClass().getName(); String result = instance.getName(); assertEquals(expResult, result); } /** * Test of getPassword method, of class com.rift.coad.daemon.tomcat.security.CoadunationRealm. */ public void testGetPassword() { System.out.println("getPassword"); String username = "test"; CoadunationRealm instance = new CoadunationRealm(); String expResult = null; String result = instance.getPassword(username); assertEquals(expResult, result); } /** * Test of getPrincipal method, of class com.rift.coad.daemon.tomcat.security.CoadunationRealm. */ public void testGetPrincipal() { System.out.println("getPrincipal"); String username = "test"; CoadunationRealm instance = new CoadunationRealm(); Principal expResult = new BasicPrincipal("test"); Principal result = instance.getPrincipal(username); assertEquals(expResult, result); } /** * Test of authenticate method, of class com.rift.coad.daemon.tomcat.security.CoadunationRealm. */ public void testAuthenticate() throws Exception { System.out.println("authenticate"); ThreadsPermissionContainer permissions = new ThreadsPermissionContainer(); ThreadsPermissionContainerAccessor.init(permissions); SessionManager.init(permissions); UserStoreManager userStoreManager = new UserStoreManager(); UserStoreManagerAccessor.init(userStoreManager); UserSessionManager sessionManager = new UserSessionManager(permissions, userStoreManager); UserSessionManagerAccessor.init(sessionManager); LoginManager.init(sessionManager,userStoreManager); // instanciate the thread manager CoadunationThreadGroup threadGroup = new CoadunationThreadGroup(sessionManager, userStoreManager); // add a user to the session for the current thread RoleManager.getInstance(); String username = "test"; String credentials = "112233"; CoadunationRealm instance = new CoadunationRealm(); CoadunationGenericPrincipal result = (CoadunationGenericPrincipal)instance.authenticate(username, credentials); assertEquals("test", result.getSession().getName()); } }
[ "brett.chaldecott@gmail.com" ]
brett.chaldecott@gmail.com
dabca37d962023b3765aad27156e3579ccb21bee
3d145b67d60021dd3909f76d579949ba0fc719e8
/platform/platform-impl/src/com/intellij/ide/ui/laf/intellij/MacIntelliJButtonUI.java
3c422c9f6301bf0648a4eed34005dd1073f6372b
[ "Apache-2.0" ]
permissive
shanyaodan/intellij-community
cfcf2ca6c08034bc0215ba194ecde67a5bd0ad44
a5cd6ac6102731ea9b557dcc1c684340f7d8432a
refs/heads/master
2021-01-24T00:53:12.270012
2015-08-17T23:55:58
2015-08-17T23:58:32
40,955,877
1
0
null
2015-08-18T06:53:50
2015-08-18T06:53:50
null
UTF-8
Java
false
false
5,823
java
/* * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.ide.ui.laf.intellij; import com.intellij.ide.ui.laf.darcula.DarculaLaf; import com.intellij.ide.ui.laf.darcula.ui.DarculaButtonUI; import com.intellij.ui.Gray; import sun.swing.SwingUtilities2; import javax.swing.*; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicHTML; import javax.swing.text.View; import java.awt.*; /** * @author Konstantin Bulenkov */ public class MacIntelliJButtonUI extends DarculaButtonUI { private static Rectangle viewRect = new Rectangle(); private static Rectangle textRect = new Rectangle(); private static Rectangle iconRect = new Rectangle(); private static final Icon LEFT = DarculaLaf.loadIcon("buttonLeft.png"); private static final Icon RIGHT = DarculaLaf.loadIcon("buttonRight.png"); private static final Icon MIDDLE = DarculaLaf.loadIcon("buttonMiddle.png"); private static final Icon LEFT_SELECTED = DarculaLaf.loadIcon("selectedButtonLeft.png"); private static final Icon RIGHT_SELECTED = DarculaLaf.loadIcon("selectedButtonRight.png"); private static final Icon MIDDLE_SELECTED = DarculaLaf.loadIcon("selectedButtonMiddle.png"); private static final Icon LEFT_FOCUSED = DarculaLaf.loadIcon("focusedButtonLeft.png"); private static final Icon RIGHT_FOCUSED = DarculaLaf.loadIcon("focusedButtonRight.png"); private static final Icon MIDDLE_FOCUSED = DarculaLaf.loadIcon("focusedButtonMiddle.png"); private static final Icon LEFT_SELECTED_FOCUSED = DarculaLaf.loadIcon("focusedSelectedButtonLeft.png"); private static final Icon RIGHT_SELECTED_FOCUSED = DarculaLaf.loadIcon("focusedSelectedButtonRight.png"); private static final Icon MIDDLE_SELECTED_FOCUSED = DarculaLaf.loadIcon("focusedSelectedButtonMiddle.png"); private static final Icon HELP_BUTTON = DarculaLaf.loadIcon("helpButton.png"); private static final Icon HELP_BUTTON_FOCUSED = DarculaLaf.loadIcon("focusedHelpButton.png"); @SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"}) public static ComponentUI createUI(JComponent c) { return new MacIntelliJButtonUI(); } @Override public void paint(Graphics g, JComponent c) { int w = c.getWidth(); int h = c.getHeight(); if (isHelpButton(c)) { Icon icon = c.hasFocus() ? HELP_BUTTON_FOCUSED : HELP_BUTTON; int x = (w - icon.getIconWidth()) / 2; int y = (h - icon.getIconHeight()) / 2; icon.paintIcon(c, g, x, y); } else { AbstractButton b = (AbstractButton) c; String text = layout(b, SwingUtilities2.getFontMetrics(b, g), b.getWidth(), b.getHeight()); boolean isDefault = b instanceof JButton && ((JButton)b).isDefaultButton(); boolean isFocused = c.hasFocus(); if (isSquare(c)) { g.setColor(Gray.xFF); g.fillRect(1, 1, w - 2, h - 2); g.setColor(Gray.xB4); g.drawRect(1, 1, w - 2, h - 2); } else { int x = isFocused ? 0 : 2; int y = isFocused ? 0 : (h - viewRect.height) / 2; Icon icon; icon = isDefault ? isFocused ? LEFT_SELECTED_FOCUSED : LEFT_SELECTED : isFocused ? LEFT_FOCUSED : LEFT; icon.paintIcon(b, g, x, y); x += icon.getIconWidth(); int stop = w - (isFocused ? 0 : 2) - (isFocused ? RIGHT_FOCUSED.getIconWidth() : RIGHT.getIconWidth()); Graphics gg = g.create(0, 0, w, h); gg.setClip(x, y, stop - x, h); icon = isDefault ? isFocused ? MIDDLE_SELECTED_FOCUSED : MIDDLE_SELECTED : isFocused ? MIDDLE_FOCUSED : MIDDLE; while (x < stop) { icon.paintIcon(b, gg, x, y); x += icon.getIconWidth(); } gg.dispose(); icon = isDefault ? isFocused ? RIGHT_SELECTED_FOCUSED : RIGHT_SELECTED : isFocused ? RIGHT_FOCUSED : RIGHT; icon.paintIcon(b, g, stop, y); clearTextShiftOffset(); } // Paint the Icon if(b.getIcon() != null) { paintIcon(g,c,iconRect); } if (text != null && !text.isEmpty()){ View v = (View) c.getClientProperty(BasicHTML.propertyKey); if (v != null) { v.paint(g, textRect); } else { paintText(g, b, textRect, text); } } } } private String layout(AbstractButton b, FontMetrics fm, int width, int height) { Insets i = b.getInsets(); viewRect.x = i.left; viewRect.y = i.top; viewRect.width = width - (i.right + viewRect.x); viewRect.height = height - (i.bottom + viewRect.y); textRect.x = textRect.y = textRect.width = textRect.height = 0; iconRect.x = iconRect.y = iconRect.width = iconRect.height = 0; // layout the text and icon return SwingUtilities.layoutCompoundLabel( b, fm, b.getText(), b.getIcon(), b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), viewRect, iconRect, textRect, b.getText() == null ? 0 : b.getIconTextGap()); } @Override public Dimension getPreferredSize(JComponent c) { Dimension size = super.getPreferredSize(c); return new Dimension(size.width + 16, 27); } }
[ "kb@jetbrains.com" ]
kb@jetbrains.com
49403be69a8c3f9af9f3319d09b5ff9d8b07b759
44ce357ee9ca8df2f399f7e0fcdf385b7b34c245
/src/main/java/org/apache/commons/math3/optim/linear/LinearConstraintSet.java
f30ea7afeb8c5ef2dd70a774e503b1b260e7ed27
[]
no_license
silas1037/SkEye
a8712f273e1cadd69e0be7d993963016df227cb5
ed0ede814ee665317dab3209b8a33e38df24a340
refs/heads/master
2023-01-20T20:25:00.940114
2020-11-29T04:01:05
2020-11-29T04:01:05
315,267,911
0
0
null
null
null
null
UTF-8
Java
false
false
832
java
package org.apache.commons.math3.optim.linear; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; import org.apache.commons.math3.optim.OptimizationData; public class LinearConstraintSet implements OptimizationData { private final Set<LinearConstraint> linearConstraints = new LinkedHashSet(); public LinearConstraintSet(LinearConstraint... constraints) { for (LinearConstraint c : constraints) { this.linearConstraints.add(c); } } public LinearConstraintSet(Collection<LinearConstraint> constraints) { this.linearConstraints.addAll(constraints); } public Collection<LinearConstraint> getConstraints() { return Collections.unmodifiableSet(this.linearConstraints); } }
[ "silas1037@163.com" ]
silas1037@163.com
e93ddbe56cd8e8d6ffce07e3c1252c82e5882231
8bb66a930319e743a245d4ff871493fd0dcb9988
/src/main/java/com/dvnb/repositories/Act2090702Repo.java
f7197181966b5aed5014afe647127b3d281e523d
[]
no_license
vht1092/DVNB
615e351c752cc9029569f037d853fc3020e5fb77
cd51d033a3e8c5d39fc6e91934eabb17f2847bfa
refs/heads/master
2023-04-24T17:15:07.363472
2021-05-11T09:08:49
2021-05-11T09:08:49
365,904,908
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
package com.dvnb.repositories; import java.math.BigDecimal; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import com.dvnb.entities.Act2090702; @Repository public interface Act2090702Repo extends JpaRepository<Act2090702, String> { Page<Act2090702> findAll(Pageable page); Act2090702 findOneByKy(@Param("ky") String ky); void deleteByKy(@Param("ky") String ky); void deleteByKyAndUsrId(@Param("ky") String ky,@Param("usrId") String usrId); }
[ "vht1092@gmail.com" ]
vht1092@gmail.com
6cfdc4d4cb50cbd9c75926d30fd2822372f164b2
aaa9e75b246ebe67d22659d6eeaac91c8121989d
/src/main/java/com/iqmsoft/boot/react/jpa/companies/db/jpa/CompaniesJPARepository.java
15a27364de758205fb0e4a7c46212be0ddf14335
[]
no_license
Murugar/SpringBootReactMongoJPA
8e68956683db6ceebc89c7b264a2a411c8f58533
f7baa8aaa85c1313cd063543ba4a2f5b21f45dc8
refs/heads/master
2021-01-19T09:55:35.172345
2018-08-12T05:44:28
2018-08-12T05:44:28
87,800,212
0
0
null
null
null
null
UTF-8
Java
false
false
464
java
package com.iqmsoft.boot.react.jpa.companies.db.jpa; import java.util.List; import org.springframework.context.annotation.Profile; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; @Profile("jpa") public interface CompaniesJPARepository extends JpaRepository<CompanyJPAImpl, Long> { @Query("SELECT DISTINCT a FROM companies a LEFT JOIN FETCH a.owners vp") List<CompanyJPAImpl> findAll(); }
[ "davanon2014@gmail.com" ]
davanon2014@gmail.com
e2028b22f17f8d0bc00586eb81a2c2f0b473bc1a
0cb23b719c0057676f8d94dd436af53befd7bc34
/attic/db/jedis/JedisDB.java
76d4e64b9614f4173eb2dbe00481af902d34a00c
[ "MIT" ]
permissive
fireduck64/jelectrum
15e145c238c5fdb10e62938907ce938f04990b08
d1ee320966b732bab0569d9dfb6c047ec5267229
refs/heads/master
2022-07-13T03:38:48.324223
2022-06-21T20:40:41
2022-06-21T20:40:41
22,323,519
41
16
null
2015-09-26T07:27:35
2014-07-27T22:03:57
Java
UTF-8
Java
false
false
1,026
java
package jelectrum.db.jedis; import jelectrum.db.DB; import jelectrum.Config; import jelectrum.db.DBMap; import jelectrum.db.DBMapSet; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; public class JedisDB extends DB { private JedisPool pool; private String db_name; public JedisDB(Config config) throws Exception { super(config); config.require("redis_db_name"); db_name = config.get("redis_db_name"); JedisPoolConfig pconf = new JedisPoolConfig(); if (config.isSet("redis_max_connections")) { pconf.setMaxTotal(config.getInt("redis_max_connections")); } pool = new JedisPool(pconf, "localhost"); System.out.println("Redis max connections: " + pconf.getMaxTotal()); open(); } protected DBMap openMap(String name) throws Exception { return new JedisMap(pool, db_name + "/" + name); } protected DBMapSet openMapSet(String name) throws Exception { return new JedisMapSet(pool, db_name + "/" + name); } }
[ "fireduck@gmail.com" ]
fireduck@gmail.com
863bb6540bf630cc97a8cefc8fb6e8a1799b0d26
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.ocms-OCMS/sources/com/facebook/oxygen/common/verification/ExternalSignatureType.java
d7f63aebdfa0d62cc806c753acd6f1b57d83c96c
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
715
java
package com.facebook.oxygen.common.verification; import com.facebook.infer.annotation.Nullsafe; @Nullsafe(Nullsafe.Mode.LOCAL) public enum ExternalSignatureType { NONE(AlgorithmConstants.LEGACY_ALG), OZONE(AlgorithmConstants.LEGACY_ALG), FULL(AlgorithmConstants.FULL_HASH), V2COMPAT(AlgorithmConstants.ASBC_MERKLE_TREE_HASH), OCULUS_FULL(AlgorithmConstants.FULL_HASH); public final int signatureAlgorithm; public static class AlgorithmConstants { public static int ASBC_MERKLE_TREE_HASH = 1; public static int FULL_HASH = 0; public static int LEGACY_ALG = -1; } private ExternalSignatureType(int i) { this.signatureAlgorithm = i; } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
caa4b5441326d86ae907375489fd3f57d44eeede
59517d1a52dffdf1817e356a2fab9f8516556558
/src/main/java/abused_master/Block/TE/TileEnergyBankT3.java
2a7833395535ba8b96e79e78274a8a01fa9808f6
[ "MIT" ]
permissive
SwordKorn20/EnergyPlus
6ef2f174976b162f8081814a00a5815c562ebd14
57d8fe4c890f50c733f54646d0f2c9adc206c1c4
refs/heads/master
2021-01-15T22:19:44.746470
2016-05-30T15:35:10
2016-05-30T15:35:18
60,021,058
0
0
null
2016-05-30T15:38:38
2016-05-30T15:38:36
Java
UTF-8
Java
false
false
1,523
java
package abused_master.Block.TE; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyReceiver; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; public class TileEnergyBankT3 extends TileEntity implements IEnergyReceiver, IEnergyProvider { protected EnergyStorage storage = new EnergyStorage(50000000); private ItemStack[] inventory; private String customName; @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); storage.readFromNBT(nbt); } @Override public NBTTagCompound writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); storage.writeToNBT(nbt); return nbt; } public void TileEntityEnergyBank() { } /* IEnergyConnection */ @Override public boolean canConnectEnergy(EnumFacing from) { return true; } /* IEnergyReceiver */ @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate) { return storage.receiveEnergy(maxReceive, simulate); } /* IEnergyProvider */ @Override public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate) { return storage.extractEnergy(maxExtract, simulate); } /* IEnergyHandler */ @Override public int getEnergyStored(EnumFacing from) { return storage.getEnergyStored(); } @Override public int getMaxEnergyStored(EnumFacing from) { return storage.getMaxEnergyStored(); } }
[ "techperson71@gmail.com" ]
techperson71@gmail.com
bb66dcdae13587eb308190f58eba0121246a6fff
4abd603f82fdfa5f5503c212605f35979b77c406
/html/Programs/hw1-diff/r04546032-108-0/Diff.java
5216c84751f2f21b547ba10be392c3c3a27391c0
[]
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
5,977
java
import java.io.FileReader; import java.io.BufferedReader; import java.util.Arrays; import java.util.ArrayList; public class Percolation { WeightedQuickUnionUF wuf; int opensites; boolean[][] grid; public int size; int space = 0; int[][] Grid; public Percolation(int N) { int spaces = N * N; . this.grid = new boolean[N][N]; int count = 0; Grid = new int[N][N]; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { grid[i][j] = false; Grid[i][j] = count; count++; } } //先upper virtual的相連 for (int a = 0; a < N; a++) { wuf.union(N * N, a); } //lower virtual connect /* for (int b = N * (N - 1); b <= N * N - 1; b++) { wuf.union(N * N + 1, b); }*/ }// end constructor; public void open(int i, int j) { if (this.grid[i][j] == false) { this.grid[i][j] = true; } }//end open public boolean isOpen(int i, int j) { return this.grid[i][j]; }//end isOpen public boolean isFull(int i, int j) { if (isOpen(i, j)) { if (wuf.connected(Grid[i][j], (size * size))) { return true; } }//end for return false; }//end isFull /* * checks if any space on the bottom is full returns true * if there is one false other wise */ public boolean percolates(int N) { for (int i = 0; i < N; i++) { if (isFull(i, N - 1)) { return true; } } return false; }//end percolates /* * checks if any space on the bottom is full returns true * if there is one false other wise */ public static void main(String[] args) throws Exception { try (BufferedReader br = new BufferedReader(new FileReader(args[0]))) { String number = br.readLine(); int N = Integer.parseInt(number); ArrayList<Integer> temp = new ArrayList<>(); String[] data; String line; while ((line = br.readLine()) != null) { data = line.split("",""); temp.add(Integer.parseInt(data[0])); temp.add(Integer.parseInt(data[1])); } Integer[] temp2 = temp.toArray(new Integer[temp.size()]); for (int i = 0; i < temp.size(); i++) { temp2[i]--; } int size = N; int testedTimes = 1; // Percolation perc = new Percolation(size); int i = 0; int j = 1; Percolation perc = new Percolation(size); int coordinates[] = new int[size * size + 1]; for (int a = 0; a < size * size + 1; a++) { coordinates[a] = a; } while (testedTimes != (temp2.length / 2 + 1)) { int x = temp2[i]; int y = temp2[j]; // int X =temp2[i+2]; // int Y = temp2[j+2]; perc.open(x, y); // perc.open(X, Y); //perc.wuf.union(perc.coordinates[perc.grid[x][y]], perc.coordinates[perc.grid[X][Y]]); if (coordinates[perc.Grid[x][y]] % N != (N - 1)) {//right 1 if (x == N - 1) { if (perc.isOpen(x, y + 1) == true) { perc.wuf.union(perc.Grid[x][y], perc.Grid[x][y + 1]); } } else { if (perc.isOpen(x , y+1) == true) { perc.wuf.union(perc.Grid[x][y], perc.Grid[x][y+1]); } } } if (coordinates[perc.Grid[x][y]] % N != 0) {//left 1 if (x == 0) { if (perc.isOpen(x, y - 1) == true) { perc.wuf.union(perc.Grid[x][y], perc.Grid[x][y - 1]); } } else { if (perc.isOpen(x , y-1) == true) { perc.wuf.union(perc.Grid[x][y], perc.Grid[x][y-1]); } } } if (coordinates[perc.Grid[x][y]] > (N - 1)) {//up 1 if (y == 0) { if (perc.isOpen(x - 1, y) == true) { perc.wuf.union(perc.Grid[x][y], perc.Grid[x - 1][y]); } } else { if (perc.isOpen(x-1, y) == true) { perc.wuf.union(perc.Grid[x][y], perc.Grid[x-1][y]); } } } if (coordinates[perc.Grid[x][y]] < N * (N - 1)) {//down 1 if (y == N - 1) { if ((perc.isOpen(x + 1, y)) == true) { perc.wuf.union(perc.Grid[x][y], perc.Grid[x + 1][y]); } } else { if ((perc.isOpen(x+1, y)) == true) { perc.wuf.union(perc.Grid[x][y], perc.Grid[x+1][y]); } } } testedTimes++; if (perc.percolates(N)) { System.out.println((x + 1) + "","" + (y + 1)); break; } i += 2; j += 2; }//end while(TestedTimes<tests) if (testedTimes == (temp2.length / 2 + 1)) { System.out.println(""-1""); } //end while(TestedTimes<tests) } } }
[ "dn070017@gmail.com" ]
dn070017@gmail.com
fdca4c57c7f62ee087147a5ae982fd8011c5b5c2
fbace72b13f5074255662cfc1a6df10092ad18e9
/src/main/java/com/pleosoft/feign/acs/core/model/TagPaging.java
1cfab2cfc41abf37fd39b2b244464cae12d03c2a
[ "Apache-2.0" ]
permissive
PleoSoft/acs-feign-client
7e2814876a45932e42e61260847c1ef3dac02104
fb3d3c85d04e5eb1db7aaa37a9474feb8accfdd9
refs/heads/master
2021-08-17T07:06:43.863360
2020-05-13T18:57:49
2020-05-13T18:57:49
183,176,979
5
0
null
null
null
null
UTF-8
Java
false
false
2,071
java
/** * Copyright 2019 Pleo Soft d.o.o. (pleosoft.com) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.pleosoft.feign.acs.core.model; import java.util.Objects; import javax.validation.Valid; import javax.validation.constraints.NotNull; import org.springframework.validation.annotation.Validated; import com.fasterxml.jackson.annotation.JsonProperty; @Validated public class TagPaging { @JsonProperty("list") private TagPagingList list = null; public TagPaging list(TagPagingList list) { this.list = list; return this; } /** * Get list * * @return list **/ @NotNull @Valid public TagPagingList getList() { return list; } public void setList(TagPagingList list) { this.list = list; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TagPaging tagPaging = (TagPaging) o; return Objects.equals(this.list, tagPaging.list); } @Override public int hashCode() { return Objects.hash(list); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TagPaging {\n"); sb.append(" list: ").append(toIndentedString(list)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "daniel@pleosoft.com" ]
daniel@pleosoft.com
5c69d462e7ff141e08a0d01365e303fa75123c84
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava18/Foo816.java
ee4e913fcce79bc518f9a9131b64d767bb0d9a9e
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package applicationModulepackageJava18; public class Foo816 { public void foo0() { new applicationModulepackageJava18.Foo815().foo5(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
ff20ea635f497ac70d3555936ee86beb3f07bee6
2e0cc0149c43ca57ead8bed253f99698c968d604
/app/src/main/java/com/lezhian/academiccircle/mvp/presenter/impl/RegisterPresenterImpl.java
dd627ba90b9cb2282cbe2136d7f5590be17167fa
[]
no_license
Dreamer206602/AcademicCircle
be0af7bcc680a542b3851ded0672f791d7138803
d0178f430a238ab90c6b7cf56e4e1e417045a1bb
refs/heads/master
2021-01-20T20:48:16.874834
2016-07-10T10:51:26
2016-07-10T10:51:26
61,537,337
0
0
null
null
null
null
UTF-8
Java
false
false
1,375
java
package com.lezhian.academiccircle.mvp.presenter.impl; import android.app.Activity; import com.lezhian.academiccircle.mvp.bean.BaseBean; import com.lezhian.academiccircle.mvp.model.RegisterModel; import com.lezhian.academiccircle.mvp.presenter.BasePresenter; import com.lezhian.academiccircle.mvp.view.BaseView; import com.lezhian.academiccircle.network.NetWork; import com.lezhian.academiccircle.utils.LogUtils; import rx.android.schedulers.AndroidSchedulers; import rx.functions.Action1; import rx.schedulers.Schedulers; /** * Created by hww on 2016/7/7. */ public class RegisterPresenterImpl extends BasePresenter implements RegisterModel.RegisterPresenter { public RegisterPresenterImpl(Activity activity, BaseView view) { super(activity, view); } @Override public void getRegister(String name, String pass) { NetWork.getApi().getSignUp(name,pass) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Action1<BaseBean>() { @Override public void call(BaseBean baseBean) { LogUtils.d("Regis", baseBean.getMessage()); LogUtils.d("Regis", baseBean.getStatus()+""); mView.showLoading(); } }); } }
[ "boobooMX@163.com" ]
boobooMX@163.com
5193370d4d18c3b17569b38001624a118f2244ab
a03ddb4111faca852088ea25738bc8b3657e7b5c
/TestTransit/src/jp/co/yahoo/yconnect/sdk/R$style.java
6e817b28aeb0479fa074c8a463f1259691e61979
[]
no_license
randhika/TestMM
5f0de3aee77b45ca00f59cac227450e79abc801f
4278b34cfe421bcfb8c4e218981069a7d7505628
refs/heads/master
2020-12-26T20:48:28.446555
2014-09-29T14:37:51
2014-09-29T14:37:51
24,874,176
2
0
null
null
null
null
UTF-8
Java
false
false
397
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package jp.co.yahoo.yconnect.sdk; // Referenced classes of package jp.co.yahoo.yconnect.sdk: // R public static final class { public static final int AppTheme = 0x7f0e0003; public () { } }
[ "metromancn@gmail.com" ]
metromancn@gmail.com
9b5eb3fd84975e08ddbc1f9a1d72c9331bed5578
857f67b0cd6371af48fd19bf30254ad70cb01f00
/src/main/sbxx/designpattern/builder/Wrapper.java
b3c92efffe6816c84e47c7ff6ace71adc682e27a
[]
no_license
Dairy-cn/sbxx
d5a3cf6640379df36eb0c42f5a2cc5f26364166a
e4e0a6f5fa1b8d020c5febdf206044e375674f36
refs/heads/master
2023-07-30T10:40:50.488040
2021-10-02T04:51:49
2021-10-02T04:51:49
350,996,119
0
0
null
null
null
null
UTF-8
Java
false
false
182
java
package main.sbxx.designpattern.builder; /** * @author Dair * @since */ public class Wrapper implements Packing { @Override public String pack() { return "Wrapper"; } }
[ "2997266712@qq.com" ]
2997266712@qq.com
605b616e1ce2bb42f487005710621128acff2c1a
f3698795f174340106c66885bb57ac72134c58c8
/quality/idatrix-quality-cloud/src/main/java/com/ys/idatrix/quality/dto/step/steps/flow/SPSwitchCase.java
026b8e326b7735a0a0bbd551afa197fc427495a7
[]
no_license
ahandful/CloudETL
6e5c195953a944cdc62702b100bd7bcd629b4aee
bb4be62e8117082cd656741ecae33e4262ad3fb5
refs/heads/master
2020-09-13T01:33:43.749781
2019-04-18T02:12:08
2019-04-18T02:13:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,144
java
package com.ys.idatrix.quality.dto.step.steps.flow; import java.util.HashMap; import java.util.List; import java.util.Map; import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.trans.TransMeta; import org.pentaho.di.trans.step.StepDataInterface; import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMeta; import org.pentaho.di.trans.step.StepMetaInterface; import org.pentaho.di.trans.steps.switchcase.SwitchCaseMeta; import org.pentaho.di.trans.steps.switchcase.SwitchCaseTarget; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import com.ys.idatrix.quality.dto.step.parts.SwitchCaseTargetDto; import com.ys.idatrix.quality.dto.step.steps.StepParameter; import com.ys.idatrix.quality.recovery.trans.ResumeStepDataParser; import com.ys.idatrix.quality.toolkit.analyzer.trans.step.StepDataRelationship; import com.ys.idatrix.quality.toolkit.analyzer.trans.step.StepDataRelationshipParser; import net.sf.json.JSONObject; /** * Step - SwitchCase. 转换 org.pentaho.di.trans.steps.switchcase.SwitchCaseMeta * * @author XH * @since 2017-09-05 */ @Component("SPSwitchCase") @Scope("prototype") public class SPSwitchCase implements StepParameter, StepDataRelationshipParser ,ResumeStepDataParser { String fieldname; boolean isContains; int caseValueType; String caseValueFormat; String caseValueDecimal; String caseValueGroup; String defaultTargetStepname; List<SwitchCaseTargetDto> caseTargets; /** * @return the fieldname */ public String getFieldname() { return fieldname; } /** * @param 设置 * fieldname */ public void setFieldname(String fieldname) { this.fieldname = fieldname; } /** * @return the isContains */ public boolean isContains() { return isContains; } /** * @param 设置 * isContains */ public void setContains(boolean isContains) { this.isContains = isContains; } /** * @return the caseValueType */ public int getCaseValueType() { return caseValueType; } /** * @param 设置 * caseValueType */ public void setCaseValueType(int caseValueType) { this.caseValueType = caseValueType; } /** * @return the caseValueFormat */ public String getCaseValueFormat() { return caseValueFormat; } /** * @param 设置 * caseValueFormat */ public void setCaseValueFormat(String caseValueFormat) { this.caseValueFormat = caseValueFormat; } /** * @return the caseValueDecimal */ public String getCaseValueDecimal() { return caseValueDecimal; } /** * @param 设置 * caseValueDecimal */ public void setCaseValueDecimal(String caseValueDecimal) { this.caseValueDecimal = caseValueDecimal; } /** * @return the caseValueGroup */ public String getCaseValueGroup() { return caseValueGroup; } /** * @param 设置 * caseValueGroup */ public void setCaseValueGroup(String caseValueGroup) { this.caseValueGroup = caseValueGroup; } /** * @return the defaultTargetStepname */ public String getDefaultTargetStepname() { return defaultTargetStepname; } /** * @param 设置 * defaultTargetStepname */ public void setDefaultTargetStepname(String defaultTargetStepname) { this.defaultTargetStepname = defaultTargetStepname; } /** * @return the caseTargets */ public List<SwitchCaseTargetDto> getCaseTargets() { return caseTargets; } /** * @param 设置 * caseTargets */ public void setCaseTargets(List<SwitchCaseTargetDto> caseTargets) { this.caseTargets = caseTargets; } @Override public Object getParameterObject(Object json) { JSONObject jsonObj = JSONObject.fromObject(json); Map<String, Class<?>> classMap = new HashMap<>(); classMap.put("caseTargets", SwitchCaseTargetDto.class); return (SPSwitchCase) JSONObject.toBean(jsonObj, SPSwitchCase.class, classMap); } @Override public Object encodeParameterObject(StepMeta stepMeta) { StepMetaInterface stepMetaInterface = stepMeta.getStepMetaInterface(); SPSwitchCase spSwitchCase = new SPSwitchCase(); SwitchCaseMeta switchcasemeta = (SwitchCaseMeta) stepMetaInterface; spSwitchCase.setFieldname(switchcasemeta.getFieldname()); spSwitchCase.setCaseValueType(switchcasemeta.getCaseValueType()); spSwitchCase.setCaseValueFormat(switchcasemeta.getCaseValueFormat()); spSwitchCase.setCaseValueDecimal(switchcasemeta.getCaseValueDecimal()); spSwitchCase.setCaseValueGroup(switchcasemeta.getCaseValueGroup()); spSwitchCase.setDefaultTargetStepname(switchcasemeta.getDefaultTargetStepname()); spSwitchCase.setContains(switchcasemeta.isContains()); spSwitchCase.setCaseTargets( transListToList(switchcasemeta.getCaseTargets(), new DtoTransData<SwitchCaseTargetDto>() { @Override public SwitchCaseTargetDto dealData(Object obj, int index) { SwitchCaseTarget sct = (SwitchCaseTarget) obj; SwitchCaseTargetDto sctd = new SwitchCaseTargetDto(); sctd.setCaseValue(sct.caseValue); sctd.setCaseTargetStep( sct.caseTargetStep != null ? sct.caseTargetStep.getName() : sct.caseTargetStepname); return sctd; } })); return spSwitchCase; } @Override public void decodeParameterObject(StepMeta stepMeta, Object po, List<DatabaseMeta> databases,TransMeta transMeta) throws Exception { StepMetaInterface stepMetaInterface = stepMeta.getStepMetaInterface(); SPSwitchCase spSwitchCase = (SPSwitchCase) po; SwitchCaseMeta switchcasemeta = (SwitchCaseMeta) stepMetaInterface; switchcasemeta.setFieldname(spSwitchCase.getFieldname()); switchcasemeta.setCaseValueType(spSwitchCase.getCaseValueType()); switchcasemeta.setCaseValueFormat(spSwitchCase.getCaseValueFormat()); switchcasemeta.setCaseValueDecimal(spSwitchCase.getCaseValueDecimal()); switchcasemeta.setCaseValueGroup(spSwitchCase.getCaseValueGroup()); switchcasemeta.setDefaultTargetStepname(spSwitchCase.getDefaultTargetStepname()); switchcasemeta.setContains(spSwitchCase.isContains()); switchcasemeta .setCaseTargets(transListToList(spSwitchCase.getCaseTargets(), new DtoTransData<SwitchCaseTarget>() { @Override public SwitchCaseTarget dealData(Object obj, int index) { SwitchCaseTargetDto sctd = (SwitchCaseTargetDto) obj; SwitchCaseTarget sct = new SwitchCaseTarget(); sct.caseValue = sctd.getCaseValue(); sct.caseTargetStepname = sctd.getCaseTargetStep(); return sct; } })); switchcasemeta.searchInfoAndTargetSteps(transMeta.getSteps()); } /* * 覆盖方法:getStepDataAndRelationship */ @Override public void getStepDataAndRelationship(TransMeta transMeta, StepMeta stepMeta, StepDataRelationship sdr) { //没有改变 } @Override public boolean preRunHandle(TransMeta transMeta ,StepMeta stepMeta ,StepMetaInterface stepMetaInterface,StepDataInterface stepDataInterface , StepInterface stepInterface) throws Exception { //该组件只有分发,没有复制模式 stepMeta.setDistributes(true); return true ; } @Override public int stepType() { return 12; } }
[ "xionghan@gdbigdata.com" ]
xionghan@gdbigdata.com
e90642e52ada774759d748b24e656a05453672e5
85ce97a20f9f043f8979c06537e22c439c61aafb
/src/main/java/com.ssm.demo/service/PersonService.java
6d2f30adaacdda97eaac54c9d8cf73f2fc81abc3
[]
no_license
HYVincent/SsmDemo
63b62f878dfb922c9fd88834f74e245c548bd89a
65e3cbb2b1a027f415227d783f65a94ea63d4a22
refs/heads/master
2020-04-16T22:19:00.136706
2019-01-16T03:09:57
2019-01-16T03:09:57
165,962,580
0
0
null
null
null
null
UTF-8
Java
false
false
281
java
package com.ssm.demo.service; import com.ssm.demo.entity.Person; /** * @author Vincent Vincent * @version v1.0 * @name SsmDemo * @page com.ssm.demo.service * @class describe * @date 2019/1/16 10:09 */ public interface PersonService { Person findPersonById(long id); }
[ "1032006226@qq.com" ]
1032006226@qq.com
3c0b14a75e0ed94580be61b8bc020c52df47e7da
6e3c5dfd47175d647ab4bf0e6c80e2cd44df7580
/TP_Factory_IIT/src/type_of_pizzaStore/TunisStylePizzaStore.java
b8a29495a78f3a12aea65e7c3559e8f2584535ea
[]
no_license
dorolyci4/Design-Pattern-Exercices
4f4981520a112adfab963fc897af2b2e2a67e31a
c0f4b623433b813d6b638c5760804daa818696dd
refs/heads/master
2022-04-27T22:27:27.705809
2020-01-25T23:02:06
2020-01-25T23:02:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
592
java
package type_of_pizzaStore; import pizza.Pizza; import pizzaStore.PizzaStore; import typeofpizza.TunisStyleCheesePizza; import typeofpizza.TunisStyleClamPizza; import typeofpizza.TunisStylePepperoniPizza; public class TunisStylePizzaStore extends PizzaStore { @Override public Pizza createPizza(String type) { Pizza pizza = null; if (type.equals("cheese")) { pizza = new TunisStyleCheesePizza(); } else if (type.equals("pepperoni")) { pizza = new TunisStylePepperoniPizza(); } else if (type.equals("clam")) { pizza = new TunisStyleClamPizza(); } return pizza; } }
[ "Hassen.BenSlima" ]
Hassen.BenSlima
aae4ab6b74e305fd1c0b272bd914bd4b7857ccce
1e904dd623e3670f314d33c30b0485a574c18b87
/jonylibrary/src/main/java/com/babuwyt/jonylibrary/zxing/camera/PreviewCallback.java
7dfcbb92e90222247daece396c95f923aa77706c
[]
no_license
jon-yuan/wytapp
9096885d25e7a46ced8cff90f0ac2f7d12cafc38
41d06b7494e3396c203e82ef3171c5c3e960ad7a
refs/heads/master
2021-08-23T13:50:11.012348
2017-12-05T03:34:16
2017-12-05T03:34:16
113,126,887
0
0
null
null
null
null
UTF-8
Java
false
false
1,985
java
/* * Copyright (C) 2010 ZXing 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 com.babuwyt.jonylibrary.zxing.camera; import android.graphics.Point; import android.hardware.Camera; import android.os.Handler; import android.os.Message; import android.util.Log; final class PreviewCallback implements Camera.PreviewCallback { private static final String TAG = PreviewCallback.class.getSimpleName(); private final CameraConfigurationManager configManager; private final boolean useOneShotPreviewCallback; private Handler previewHandler; private int previewMessage; PreviewCallback(CameraConfigurationManager configManager, boolean useOneShotPreviewCallback) { this.configManager = configManager; this.useOneShotPreviewCallback = useOneShotPreviewCallback; } void setHandler(Handler previewHandler, int previewMessage) { this.previewHandler = previewHandler; this.previewMessage = previewMessage; } public void onPreviewFrame(byte[] data, Camera camera) { Point cameraResolution = configManager.getCameraResolution(); if (!useOneShotPreviewCallback) { camera.setPreviewCallback(null); } if (previewHandler != null) { Message message = previewHandler.obtainMessage(previewMessage, cameraResolution.x, cameraResolution.y, data); message.sendToTarget(); previewHandler = null; } else { Log.d(TAG, "Got preview callback, but no handler for it"); } } }
[ "yw_loveyou@163.com" ]
yw_loveyou@163.com
3b90e372c1a8153a67884f2a9a8b2dfe076f4ae2
1f0cb0b6f4c74ff706254baf5b028bc9417615f9
/spring-micro-repositories/spring-micro-repositories-oracle/spring-micro-repositories-oracle-modules_1/spring-micro-repositories-oracle-patient_1/src/main/java/org/example/spring/repositories/oracle/patient/dao/impl/TPatientTeamDaoImpl.java
6cad117e01349bca378b4c0fc584884db59aceaf
[]
no_license
yuan50697105/spring-build-project-1
af448da5e3676a99c22aaaca6de4fb9e8ea55811
967fc586637146d8ab3f80bd518ed50bf70dae90
refs/heads/master
2022-07-22T13:45:00.442964
2021-06-03T02:53:19
2021-06-03T02:53:19
359,333,990
0
0
null
null
null
null
UTF-8
Java
false
false
1,073
java
package org.example.spring.repositories.oracle.patient.dao.impl; import com.baomidou.mybatisplus.core.conditions.Wrapper; import lombok.AllArgsConstructor; import org.example.spring.plugins.mybatis.dao.impl.TkBaseDaoImpl; import org.example.spring.repositories.oracle.patient.dao.TPatientTeamDao; import org.example.spring.repositories.oracle.patient.mapper.TPatientTeamMapper; import org.example.spring.repositories.oracle.patient.table.po.TPatientTeam; import org.example.spring.repositories.oracle.patient.table.query.TPatientTeamQuery; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; @Repository @AllArgsConstructor @Transactional public class TPatientTeamDaoImpl extends TkBaseDaoImpl<TPatientTeam, TPatientTeamQuery, TPatientTeamMapper> implements TPatientTeamDao { @Override protected Wrapper<TPatientTeam> queryWrapper(TPatientTeamQuery tPatientTeamQuery) { return null; } @Override public boolean existById(Long id) { return baseMapper.existById(id); } }
[ "710575900@qq.com" ]
710575900@qq.com
92674460be19ceb9877e953a5b816e2182bb2b20
51cf675220f03e6e67c1f14dbc4218d0672e41b3
/decomp_muvi_apk/muvi_apk/app/src/main/java/powermobia/utils/MMPO.java
ec595b1d178481cf74e98019b8923fa8b00c5551
[]
no_license
guminov/muvi_kseries_research
3da0aa0d7e770d9fc261ebafc67565e59eb858f3
8c282872c9050eca546297e4ebfe5daf85555c6d
refs/heads/master
2022-01-09T14:44:41.420243
2015-03-28T18:36:06
2015-03-28T18:36:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
868
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package powermobia.utils; // Referenced classes of package powermobia.utils: // MStream public final class MMPO { private int mMpo; public MMPO() { } private native int native_MPOAdd(int i, int j); private native int native_MPOCreate(int i); private native int native_MPODestroy(int i); public int AddJpgtoMPO(MStream mstream) { int i = mstream.getNativeHandle(); return native_MPOAdd(mMpo, i); } public int Destroy() { return native_MPODestroy(mMpo); } public boolean Init(MStream mstream) { mMpo = native_MPOCreate(mstream.getNativeHandle()); return mMpo != 0; } }
[ "wyatt.neal+git@gmail.com" ]
wyatt.neal+git@gmail.com