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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6f6d7f5aaa8d3cebeed445800e7e5362319e74da | 20690c149ab09c578ddd48a90d1b3c7d1e59bdf5 | /MVCInitBinderApp13/src/main/java/com/nt/command/RegisterCommand.java | ed2a6a3545e0151cefe3837e0851320ecb588a3f | [] | no_license | pratikrohokale/SPRINGREF | 37a244bef6cb6a2348ea2b2ff4c00f61fd3bc8f1 | 669ffdecbc89286e576d31b6ff34f2cb03376a3c | refs/heads/master | 2022-12-21T15:23:52.446440 | 2019-06-20T04:53:53 | 2019-06-20T04:53:53 | 192,850,898 | 0 | 0 | null | 2022-12-16T08:44:49 | 2019-06-20T04:54:08 | Java | UTF-8 | Java | false | false | 861 | java | package com.nt.command;
import java.util.Date;
public class RegisterCommand {
private int no;
private String name;
private Date dob;
private Date doj;
private Date dom;
public int getNo() {
return no;
}
public void setNo(int no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getDob() {
return dob;
}
public void setDob(Date dob) {
this.dob = dob;
}
public Date getDoj() {
return doj;
}
public void setDoj(Date doj) {
this.doj = doj;
}
public Date getDom() {
return dom;
}
public void setDom(Date dom) {
this.dom = dom;
}
@Override
public String toString() {
return "RegisterCommand [no=" + no + ", name=" + name + ", dob=" + dob + ", doj=" + doj + ", dom=" + dom + "]";
}
}//class
| [
"prohokale01@gmail.com"
] | prohokale01@gmail.com |
afdfa6b0d3aa07407274fc7aa13a0cb6a5bb95f0 | a00326c0e2fc8944112589cd2ad638b278f058b9 | /src/main/java/000/145/919/CWE83_XSS_Attribute__Servlet_connect_tcp_02.java | f0c49ad2d4bbdea81209b0f26aaa475d3ed603c9 | [] | 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,230 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE83_XSS_Attribute__Servlet_connect_tcp_02.java
Label Definition File: CWE83_XSS_Attribute__Servlet.label.xml
Template File: sources-sink-02.tmpl.java
*/
/*
* @description
* CWE: 83 Cross Site Scripting (XSS) in attributes; Examples(replace QUOTE with an actual double quote): ?img_loc=http://www.google.comQUOTE%20onerror=QUOTEalert(1) and ?img_loc=http://www.google.comQUOTE%20onerror=QUOTEjavascript:alert(1)
* BadSource: connect_tcp Read data using an outbound tcp connection
* GoodSource: A hardcoded string
* BadSink: printlnServlet XSS in img src attribute
* Flow Variant: 02 Control flow: if(true) and if(false)
*
* */
import javax.servlet.http.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.Socket;
import java.util.logging.Level;
public class CWE83_XSS_Attribute__Servlet_connect_tcp_02 extends AbstractTestCaseServlet
{
/* uses badsource and badsink */
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
if (true)
{
data = ""; /* Initialize data */
/* Read data using an outbound tcp connection */
{
Socket socket = null;
BufferedReader readerBuffered = null;
InputStreamReader readerInputStream = null;
try
{
/* Read data using an outbound tcp connection */
socket = new Socket("host.example.org", 39544);
/* read input from socket */
readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data using an outbound tcp connection */
data = readerBuffered.readLine();
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* clean up stream reading objects */
try
{
if (readerBuffered != null)
{
readerBuffered.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO);
}
try
{
if (readerInputStream != null)
{
readerInputStream.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO);
}
/* clean up socket objects */
try
{
if (socket != null)
{
socket.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO);
}
}
}
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = null;
}
if (data != null)
{
/* POTENTIAL FLAW: Input is not verified/sanitized before use in an image tag */
response.getWriter().println("<br>bad() - <img src=\"" + data + "\">");
}
}
/* goodG2B1() - use goodsource and badsink by changing true to false */
private void goodG2B1(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
if (false)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = null;
}
else
{
/* FIX: Use a hardcoded string */
data = "foo";
}
if (data != null)
{
/* POTENTIAL FLAW: Input is not verified/sanitized before use in an image tag */
response.getWriter().println("<br>bad() - <img src=\"" + data + "\">");
}
}
/* goodG2B2() - use goodsource and badsink by reversing statements in if */
private void goodG2B2(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
if (true)
{
/* FIX: Use a hardcoded string */
data = "foo";
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = null;
}
if (data != null)
{
/* POTENTIAL FLAW: Input is not verified/sanitized before use in an image tag */
response.getWriter().println("<br>bad() - <img src=\"" + data + "\">");
}
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B1(request, response);
goodG2B2(request, response);
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"anhtluet12@gmail.com"
] | anhtluet12@gmail.com |
9ce653c57fa4b5fee14be3a24c82e5cbb76d1878 | 40cd4da5514eb920e6a6889e82590e48720c3d38 | /desktop/applis/apps/bean/bean_games/pokemonbean/src/main/java/aiki/beans/items/ItemForBattleBeanClickFailStatus.java | 06921143bded72705816f752e20f7c9f1eda759f | [] | no_license | Cardman/projects | 02704237e81868f8cb614abb37468cebb4ef4b31 | 23a9477dd736795c3af10bccccb3cdfa10c8123c | refs/heads/master | 2023-08-17T11:27:41.999350 | 2023-08-15T07:09:28 | 2023-08-15T07:09:28 | 34,724,613 | 4 | 0 | null | 2020-10-13T08:08:38 | 2015-04-28T10:39:03 | Java | UTF-8 | Java | false | false | 456 | java | package aiki.beans.items;
import aiki.beans.PokemonBeanStruct;
import code.bean.nat.*;
import code.bean.nat.*;
import code.bean.nat.*;
import code.bean.nat.*;
public class ItemForBattleBeanClickFailStatus implements NatCaller{
@Override
public NaSt re(NaSt _instance, NaSt[] _args){
return new NaStSt(( (ItemForBattleBean) ((PokemonBeanStruct)_instance).getInstance()).clickFailStatus(NaPa.convertToNumber(_args[0]).intStruct()));
}
}
| [
"f.desrochettes@gmail.com"
] | f.desrochettes@gmail.com |
ef1777aa943bb0bb3c1dde63faf64e75275fea85 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-12667-8-5-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/web/DownloadAction_ESTest.java | 543e56e18d82ef28121035359e42e30965c6c8e3 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | /*
* This file was automatically generated by EvoSuite
* Tue Apr 07 17:27:11 UTC 2020
*/
package com.xpn.xwiki.web;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class DownloadAction_ESTest extends DownloadAction_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
6b73a620d42cef7f8df645c44c1a05314f310db3 | cfe621e8c36e6ac5053a2c4f7129a13ea9f9f66b | /AndroidApplications/com.zeptolab.ctr.ads-912244/src/com/flurry/sdk/dt.java | 7cf8589ee404e4cee48782e172070fe166a05567 | [] | no_license | linux86/AndoirdSecurity | 3165de73b37f53070cd6b435e180a2cb58d6f672 | 1e72a3c1f7a72ea9cd12048d9874a8651e0aede7 | refs/heads/master | 2021-01-11T01:20:58.986651 | 2016-04-05T17:14:26 | 2016-04-05T17:14:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,157 | java | package com.flurry.sdk;
import android.os.Looper;
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.zeptolab.ctr.billing.google.utils.IabHelper;
import java.io.IOException;
public class dt {
private static final String a;
static {
a = dt.class.getSimpleName();
}
public static synchronized Info a() {
Info c;
synchronized (dt.class) {
if (Looper.getMainLooper().getThread() == Thread.currentThread()) {
throw new IllegalStateException("Must be called from a background thread!");
}
c = b() ? c() : null;
}
return c;
}
public static boolean b() {
boolean z = false;
try {
int isGooglePlayServicesAvailable = GooglePlayServicesUtil.isGooglePlayServicesAvailable(dl.a().b());
if (isGooglePlayServicesAvailable == 0) {
return true;
}
el.d(a, "Google Play Services not available - connection result: " + isGooglePlayServicesAvailable);
return z;
} catch (Exception e) {
el.d(a, "Google Play Services not available - " + e);
return z;
}
}
private static Info c() {
int i = IabHelper.BILLING_RESPONSE_RESULT_ERROR;
Info info = null;
try {
return AdvertisingIdClient.getAdvertisingIdInfo(dl.a().b());
} catch (IOException e) {
el.a(i, a, "Exception in readAdvertisingInfo():" + e);
return info;
} catch (GooglePlayServicesNotAvailableException e2) {
el.a(i, a, "Exception in readAdvertisingInfo():" + e2);
return info;
} catch (GooglePlayServicesRepairableException e3) {
el.a(i, a, "Exception in readAdvertisingInfo():" + e3);
return info;
}
}
} | [
"jack.luo@mail.utoronto.ca"
] | jack.luo@mail.utoronto.ca |
b8f1d933a65862e6bd98c66c2b1049252d96dd9f | c531d8b9644bcfe916f4b0665db96c39611196d5 | /emolance-server/src/main/java/com/emolance/domain/Authority.java | f4e57b303033d0285e490b78cae43a98a9031740 | [] | no_license | psych-tech/smart-pm | 68f39f4eecf2d4df0a10f0794f9aeed574ebf09c | d5670a411a1d6e9664dcf8949938ebe166e966a9 | refs/heads/master | 2020-04-11T03:00:19.839524 | 2018-02-26T00:34:37 | 2018-02-26T00:34:37 | 33,431,347 | 0 | 0 | null | 2017-12-06T01:54:00 | 2015-04-05T05:23:44 | Java | UTF-8 | Java | false | false | 1,306 | java | package com.emolance.domain;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* An authority (a security role) used by Spring Security.
*/
@Entity
@Table(name = "JHI_AUTHORITY")
public class Authority implements Serializable {
@NotNull
@Size(min = 0, max = 50)
@Id
@Column(length = 50)
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Authority authority = (Authority) o;
if (name != null ? !name.equals(authority.name) : authority.name != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
return name != null ? name.hashCode() : 0;
}
@Override
public String toString() {
return "Authority{" +
"name='" + name + '\'' +
"}";
}
}
| [
"yu.sun.cs@gmail.com"
] | yu.sun.cs@gmail.com |
b7db3d0414bfc6e7cd29363c758e4e640d55f583 | 952789d549bf98b84ffc02cb895f38c95b85e12c | /V_2.x/Server/tags/SpagoBI-2.5.0(20100412)/SpagoBIProject/src/it/eng/spagobi/chiron/serializer/ThresholdValueJSONSerializer.java | ca3fd017a815540ae6e3ca70b8c3cb910cf12c18 | [] | no_license | emtee40/testingazuan | de6342378258fcd4e7cbb3133bb7eed0ebfebeee | f3bd91014e1b43f2538194a5eb4e92081d2ac3ae | refs/heads/master | 2020-03-26T08:42:50.873491 | 2015-01-09T16:17:08 | 2015-01-09T16:17:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | package it.eng.spagobi.chiron.serializer;
import it.eng.spagobi.kpi.threshold.bo.ThresholdValue;
import java.util.Locale;
import org.json.JSONObject;
public class ThresholdValueJSONSerializer implements Serializer{
public static final String ID = "id";
public static final String LABEL = "label";
public Object serialize(Object o, Locale locale)
throws SerializationException {
JSONObject result = null;
if( !(o instanceof ThresholdValue) ) {
throw new SerializationException("ThresholdValueJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
}
try {
ThresholdValue tresholdValue = (ThresholdValue)o;
result = new JSONObject();
result.put(ID, tresholdValue.getId());
result.put(LABEL, tresholdValue.getLabel());
} catch (Throwable t) {
throw new SerializationException("An error occurred while serializing object: " + o, t);
} finally {
}
return result;
}
}
| [
"franceschini@99afaf0d-6903-0410-885a-c66a8bbb5f81"
] | franceschini@99afaf0d-6903-0410-885a-c66a8bbb5f81 |
49f460ff8ec46a2135db073801b94fb84a446bb3 | 00b65bbac1db2097687f89ee37b05464af788512 | /app/src/main/java/com/sskj/bfex/common/Constants.java | b059ce8c84ac9784e2bde4ded84c7b730774673b | [] | no_license | lvzhihao100/bfex | 69d6e6c8b76331a81f75d9a94f5a7abdd6bc5964 | d8580c544862e4c5978b1bd1f0205dd6e4ec9660 | refs/heads/master | 2020-03-21T22:34:19.909083 | 2018-06-29T10:14:02 | 2018-06-29T10:14:02 | 139,134,758 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,155 | java | package com.sskj.bfex.common;
/**
* Created by Administrator on 2018/4/2 0002.
*/
public class Constants {
public static final String SP_Mobile = "sp_mobile";
public static final String NULL_Str = "";
public static final String PHONE = "phone";
public static final String IS_RESET = "isReset";
public static final String USER = "user";
public static final int USER_LOGIN = 1000;
public static final int USER_LOGOUT = 1005;
public static final int WALLET_ADDRESS_MANAGE = 1001;
public static final int PAY_PWD_INPUT = 1002;
public static final int SUCCESS = 1;
public static final String ADDRESS = "address";
public static final String NOTICE = "notice";
public static final int TRANSACTION = 111;
public static final int LEVELTRANSACTION = 0x1110;
/**
* 用户数据对象(序列化对象)
*/
public static final String SP_USER_INFO = "sp_user_email";
/**
* 用户登录状态 boolean 类型
*/
public static final String SP_LOGIN_STATUS = "sp_login_status";
public static final String CODE = "code";
public static final String COIN_TYPE = "coin_type";
public static final String ID = "id";
public static final int MARKET = 1102;
/**
* 登录状态 true and false
*/
public static boolean mIsLogin = false;
public static String mobile;
/**
* 获取提现地址
* startActForResult requestCode
*/
public static final int CASH_ADDRESS = 1100;
/**
* 绑定邮箱
* startActForResult requestCode
*/
public static final int BIND_EMAIL_CODE = 1101;
/**
* 设置交易密码
* startActForResult requestCode
*/
public static final int PAY_PWD_SETTING_CODE = 1102;
/**
* 实名认证
* startActForResult requestCode
*/
public static final int VERIFY_IDENT_CODE = 1103;
/**
* 扫描钱包地址二维码
*/
public static final int SACN_QR = 1104;
/**
* 相机权限
*/
public static int PERMISSION_REQUEST_CAMERA = 2000;
}
| [
"1030753080@qq.com"
] | 1030753080@qq.com |
aaecd89dc4b4887f260d26e204594b8de5fba3cd | 70c02331108b52d4443a77f4e8a0b0cad2a4c62c | /myFunctionInterface/src/com/yjj_05/PredicateDemo01.java | 24b93d1798827d8c6a78231f16eb8bf94d000548 | [] | no_license | yjj1029/Java-Restudy | c771cf43bc074ff50c0147807212a8dd10870216 | a0d5f77b68673b462a63d1006b749358b04e2539 | refs/heads/master | 2022-12-13T11:47:20.407282 | 2020-09-04T12:39:43 | 2020-09-04T12:39:43 | 284,646,416 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,017 | java | package com.yjj_05;
import java.util.function.Predicate;
/*
Predicate<T>:常用的四个方法
boolean test(T t):对给定的参数进行判断(判断逻辑由Lambda表达式实现),返回一个布尔值
default Predicate<T> negate():返回一个逻辑的否定,对应逻辑非
Predicate<T>接口通常用于判断参数是否满足指定的条件
*/
public class PredicateDemo01 {
public static void main(String[] args) {
// boolean b1 = checkString("hello",(String s) -> {
// return s.length()>8;
// });
boolean b1 = checkString("hello", s -> s.length() > 8);
System.out.println(b1);
boolean b2 = checkString("helloworld",s -> s.length() > 8);
System.out.println(b2);
}
//判断给定的字符串是否满足要求
private static boolean checkString(String s, Predicate<String> pre) {
// return pre.test(s);
// return !pre.test(s);
return pre.negate().test(s);
}
}
| [
"924621887@qq.com"
] | 924621887@qq.com |
1b12c7d2191e8e2a7ffa7412c283408fc8ed9adb | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/apache/zookeeper/server/jersey/SessionTest.java | f4d3b21bd081601265dc2a801fea865106e94b7c | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 4,310 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.zookeeper.server.jersey;
import ClientResponse.Status.CREATED;
import ClientResponse.Status.NO_CONTENT;
import ClientResponse.Status.OK;
import MediaType.APPLICATION_JSON;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.WebResource.Builder;
import java.io.IOException;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.Stat;
import org.apache.zookeeper.server.jersey.jaxb.ZSession;
import org.codehaus.jettison.json.JSONException;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SessionTest extends Base {
protected static final Logger LOG = LoggerFactory.getLogger(SessionTest.class);
@Test
public void testCreateNewSession() throws JSONException {
ZSession session = createSession();
Assert.assertEquals(session.id.length(), 36);
// use out-of-band method to verify
Assert.assertTrue(ZooKeeperService.isConnected(Base.CONTEXT_PATH, session.id));
}
@Test
public void testSessionExpires() throws InterruptedException {
ZSession session = createSession("1");
// use out-of-band method to verify
Assert.assertTrue(ZooKeeperService.isConnected(Base.CONTEXT_PATH, session.id));
// wait for the session to be closed
Thread.sleep(1500);
Assert.assertFalse(ZooKeeperService.isConnected(Base.CONTEXT_PATH, session.id));
}
@Test
public void testDeleteSession() {
ZSession session = createSession("30");
WebResource wr = sessionsr.path(session.id);
Builder b = wr.accept(APPLICATION_JSON);
Assert.assertTrue(ZooKeeperService.isConnected(Base.CONTEXT_PATH, session.id));
ClientResponse cr = b.delete(ClientResponse.class, null);
Assert.assertEquals(NO_CONTENT, cr.getClientResponseStatus());
Assert.assertFalse(ZooKeeperService.isConnected(Base.CONTEXT_PATH, session.id));
}
@Test
public void testSendHeartbeat() throws InterruptedException {
ZSession session = createSession("2");
Thread.sleep(1000);
WebResource wr = sessionsr.path(session.id);
Builder b = wr.accept(APPLICATION_JSON);
ClientResponse cr = b.put(ClientResponse.class, null);
Assert.assertEquals(OK, cr.getClientResponseStatus());
Thread.sleep(1500);
Assert.assertTrue(ZooKeeperService.isConnected(Base.CONTEXT_PATH, session.id));
Thread.sleep(1000);
Assert.assertFalse(ZooKeeperService.isConnected(Base.CONTEXT_PATH, session.id));
}
@Test
public void testCreateEphemeralZNode() throws IOException, InterruptedException, KeeperException {
ZSession session = createSession("30");
WebResource wr = znodesr.path("/").queryParam("op", "create").queryParam("name", "ephemeral-test").queryParam("ephemeral", "true").queryParam("session", session.id).queryParam("null", "true");
Builder b = wr.accept(APPLICATION_JSON);
ClientResponse cr = b.post(ClientResponse.class);
Assert.assertEquals(CREATED, cr.getClientResponseStatus());
Stat stat = new Stat();
zk.getData("/ephemeral-test", false, stat);
ZooKeeper sessionZK = ZooKeeperService.getClient(Base.CONTEXT_PATH, session.id);
Assert.assertEquals(stat.getEphemeralOwner(), sessionZK.getSessionId());
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
ed1f0178e1d3216af36250227b6aa666f96ae6a0 | 2b1821134bb02ec32f71ddbc63980d6e9c169b65 | /design-patterns/src/main/java/com/github/mdssjc/dp/state/concrete/StateC.java | 87314106a36951ada552fbc007000b41895f57d8 | [] | no_license | mdssjc/study | a52f8fd6eb1f97db0ad523131f45d5caf914f01b | 2ca51a968e254a01900bffdec76f1ead2acc8912 | refs/heads/master | 2023-04-04T18:24:06.091047 | 2023-03-17T00:55:50 | 2023-03-17T00:55:50 | 39,316,435 | 3 | 1 | null | 2023-03-04T00:50:33 | 2015-07-18T23:53:39 | Java | UTF-8 | Java | false | false | 650 | java | package com.github.mdssjc.dp.state.concrete;
import com.github.mdssjc.dp.state.State;
import com.github.mdssjc.dp.state.context.Context;
/**
* Implementação do StateC.
*
* @author Marcelo dos Santos
*
*/
public class StateC implements State {
private final Context context;
public StateC(final Context context) {
this.context = context;
}
@Override
public void handleA() {
System.out.println("Nops");
}
@Override
public void handleB() {
System.out.println("Set state B");
this.context.setState(this.context.getStateB());
}
@Override
public void handleC() {
System.out.println("State C");
}
}
| [
"mdssjc@gmail.com"
] | mdssjc@gmail.com |
bd76adf9d608adf0db9b023f6d0850d21c1b06bd | d1608a8b3ba821b2fb5ac97b4669330d5e8da923 | /poo/Operacion.java | 60445a93fdb0fe628185239f63dd4e640e5f5991 | [] | no_license | Isardbp/Learn_Java | 32d55f30d83e20f1efa1db3e47e5103fe2d1b6cd | b30086d8e570c8a9a306e8c67a32c290242fb5fe | refs/heads/master | 2020-03-26T07:22:26.374856 | 2018-08-16T20:01:15 | 2018-08-16T20:01:15 | 144,651,400 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 825 | java | import javax.swing.JOptionPane;
public class Operacion{
int numero1;
int numero2;
int suma;
int resta;
int multiplicar;
int division;
public void leerNumeros(){
numero1 = Integer.parseInt(JOptionPane.showInputDialog("Digite un número: "));
numero2 = Integer.parseInt(JOptionPane.showInputDialog("Digite un número: "));
}
public void sumar(){
suma = numero1 + numero2;
}
public void restar(){
resta = numero1 - numero2;
}
public void multiplicar(){
multiplicar = numero1 * numero2;
}
public void dividir(){
division= numero1 / numero2;
}
public void mostrarResultados(){
System.out.println("La suma es: " + suma);
System.out.println("La resta es: " + resta);
System.out.println("La multipicacion es: " + multiplicar);
System.out.println("La division es: " +division);
}
}
| [
"root@localhost.localdomain"
] | root@localhost.localdomain |
0c1cd53fa9e7ce9d28ee1bdd31c2e22a732d8ade | 3dc7be30a4fe5a377adc7aab7a04c784ed81b715 | /WebContent/WEB-INF/src/jsf/Costbook.java | 005cfd8a3b5a553dcfcb4d21a3c84ad6d01b3f6b | [] | no_license | phm1qazxsw2/mca_beta2 | b6ba15fcc4ba653a8fc2287d7d1bca2b97d498f7 | 63af91469f86474a5edd15ab886363839e9fa9af | refs/heads/master | 2021-01-18T13:02:54.771704 | 2015-03-04T03:32:01 | 2015-03-04T03:32:01 | 30,103,400 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,145 | java | package jsf;
import java.util.*;
import java.sql.*;
import java.util.Date;
import com.axiom.util.*;
public class Costbook
{
private int id;
private Date created;
private Date modified;
private int costbookOutIn;
private int costbookCostcheckId;
private Date costbookAccountDate;
private int costbookCosttradeId;
private String costbookName;
private int costbookLogId;
private String costbookLogPs;
private int costbookAttachStatus;
private int costbookAttachType;
private int costbookTotalMoney;
private int costbookTotalNum;
private int costbookPaiedMoney;
private int costbookPaiedStatus;
private int costbookPaidNum;
private int costbookVerifyStatus;
private int costbookVerifyId;
private Date costbookVerifyDate;
private String costbookVerifyPs;
private int costbookActive;
private String costbookActivePs;
public Costbook() {}
public void init
(
int id,
Date created,
Date modified,
int costbookOutIn,
int costbookCostcheckId,
Date costbookAccountDate,
int costbookCosttradeId,
String costbookName,
int costbookLogId,
String costbookLogPs,
int costbookAttachStatus,
int costbookAttachType,
int costbookTotalMoney,
int costbookTotalNum,
int costbookPaiedMoney,
int costbookPaiedStatus,
int costbookPaidNum,
int costbookVerifyStatus,
int costbookVerifyId,
Date costbookVerifyDate,
String costbookVerifyPs,
int costbookActive,
String costbookActivePs )
{
this.id = id;
this.created = created;
this.modified = modified;
this.costbookOutIn = costbookOutIn;
this.costbookCostcheckId = costbookCostcheckId;
this.costbookAccountDate = costbookAccountDate;
this.costbookCosttradeId = costbookCosttradeId;
this.costbookName = costbookName;
this.costbookLogId = costbookLogId;
this.costbookLogPs = costbookLogPs;
this.costbookAttachStatus = costbookAttachStatus;
this.costbookAttachType = costbookAttachType;
this.costbookTotalMoney = costbookTotalMoney;
this.costbookTotalNum = costbookTotalNum;
this.costbookPaiedMoney = costbookPaiedMoney;
this.costbookPaiedStatus = costbookPaiedStatus;
this.costbookPaidNum = costbookPaidNum;
this.costbookVerifyStatus = costbookVerifyStatus;
this.costbookVerifyId = costbookVerifyId;
this.costbookVerifyDate = costbookVerifyDate;
this.costbookVerifyPs = costbookVerifyPs;
this.costbookActive = costbookActive;
this.costbookActivePs = costbookActivePs;
}
public int getId () { return id; }
public Date getCreated () { return created; }
public Date getModified () { return modified; }
public int getCostbookOutIn () { return costbookOutIn; }
public int getCostbookCostcheckId () { return costbookCostcheckId; }
public Date getCostbookAccountDate () { return costbookAccountDate; }
public int getCostbookCosttradeId () { return costbookCosttradeId; }
public String getCostbookName () { return costbookName; }
public int getCostbookLogId () { return costbookLogId; }
public String getCostbookLogPs () { return costbookLogPs; }
public int getCostbookAttachStatus () { return costbookAttachStatus; }
public int getCostbookAttachType () { return costbookAttachType; }
public int getCostbookTotalMoney () { return costbookTotalMoney; }
public int getCostbookTotalNum () { return costbookTotalNum; }
public int getCostbookPaiedMoney () { return costbookPaiedMoney; }
public int getCostbookPaiedStatus () { return costbookPaiedStatus; }
public int getCostbookPaidNum () { return costbookPaidNum; }
public int getCostbookVerifyStatus () { return costbookVerifyStatus; }
public int getCostbookVerifyId () { return costbookVerifyId; }
public Date getCostbookVerifyDate () { return costbookVerifyDate; }
public String getCostbookVerifyPs () { return costbookVerifyPs; }
public int getCostbookActive () { return costbookActive; }
public String getCostbookActivePs () { return costbookActivePs; }
public void setId (int id) { this.id = id; }
public void setCreated (Date created) { this.created = created; }
public void setModified (Date modified) { this.modified = modified; }
public void setCostbookOutIn (int costbookOutIn) { this.costbookOutIn = costbookOutIn; }
public void setCostbookCostcheckId (int costbookCostcheckId) { this.costbookCostcheckId = costbookCostcheckId; }
public void setCostbookAccountDate (Date costbookAccountDate) { this.costbookAccountDate = costbookAccountDate; }
public void setCostbookCosttradeId (int costbookCosttradeId) { this.costbookCosttradeId = costbookCosttradeId; }
public void setCostbookName (String costbookName) { this.costbookName = costbookName; }
public void setCostbookLogId (int costbookLogId) { this.costbookLogId = costbookLogId; }
public void setCostbookLogPs (String costbookLogPs) { this.costbookLogPs = costbookLogPs; }
public void setCostbookAttachStatus (int costbookAttachStatus) { this.costbookAttachStatus = costbookAttachStatus; }
public void setCostbookAttachType (int costbookAttachType) { this.costbookAttachType = costbookAttachType; }
public void setCostbookTotalMoney (int costbookTotalMoney) { this.costbookTotalMoney = costbookTotalMoney; }
public void setCostbookTotalNum (int costbookTotalNum) { this.costbookTotalNum = costbookTotalNum; }
public void setCostbookPaiedMoney (int costbookPaiedMoney) { this.costbookPaiedMoney = costbookPaiedMoney; }
public void setCostbookPaiedStatus (int costbookPaiedStatus) { this.costbookPaiedStatus = costbookPaiedStatus; }
public void setCostbookPaidNum (int costbookPaidNum) { this.costbookPaidNum = costbookPaidNum; }
public void setCostbookVerifyStatus (int costbookVerifyStatus) { this.costbookVerifyStatus = costbookVerifyStatus; }
public void setCostbookVerifyId (int costbookVerifyId) { this.costbookVerifyId = costbookVerifyId; }
public void setCostbookVerifyDate (Date costbookVerifyDate) { this.costbookVerifyDate = costbookVerifyDate; }
public void setCostbookVerifyPs (String costbookVerifyPs) { this.costbookVerifyPs = costbookVerifyPs; }
public void setCostbookActive (int costbookActive) { this.costbookActive = costbookActive; }
public void setCostbookActivePs (String costbookActivePs) { this.costbookActivePs = costbookActivePs; }
}
| [
"peter.lin@phm.com.tw"
] | peter.lin@phm.com.tw |
da0fe3fe559d3cf1fad4ae3b7eb807b8e53aef41 | 9d0517091fe2313c40bcc88a7c82218030d2075c | /providers/softlayer/src/test/java/org/jclouds/softlayer/compute/functions/VirtualGuestToNodeMetadataTest.java | 868e788eb76b8ab20d57f625f8e69ad3b07ba5a6 | [
"Apache-2.0"
] | permissive | nucoupons/Mobile_Applications | 5c63c8d97f48e1051049c5c3b183bbbaae1fa6e6 | 62239dd0f17066c12a86d10d26bef350e6e9bd43 | refs/heads/master | 2020-12-04T11:49:53.121041 | 2020-01-04T12:00:04 | 2020-01-04T12:00:04 | 231,754,011 | 0 | 0 | Apache-2.0 | 2020-01-04T12:02:30 | 2020-01-04T11:46:54 | Java | UTF-8 | Java | false | false | 5,125 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.softlayer.compute.functions;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import java.util.Set;
import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.functions.GroupNamingConvention;
import org.jclouds.domain.Location;
import org.jclouds.domain.LocationBuilder;
import org.jclouds.domain.LocationScope;
import org.jclouds.softlayer.domain.Datacenter;
import org.jclouds.softlayer.domain.OperatingSystem;
import org.jclouds.softlayer.domain.PowerState;
import org.jclouds.softlayer.domain.SoftwareDescription;
import org.jclouds.softlayer.domain.SoftwareLicense;
import org.jclouds.softlayer.domain.VirtualGuest;
import org.testng.annotations.Test;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.inject.Guice;
/**
* Tests the function that transforms SoftLayer VirtualGuest to NodeMetadata.
*/
@Test(groups = "unit", testName = "VirtualGuestToNodeMetadataTest")
public class VirtualGuestToNodeMetadataTest {
VirtualGuestToImage virtualGuestToImage = Guice.createInjector().getInstance(VirtualGuestToImage.class);
VirtualGuestToHardware virtualGuestToHardware = Guice.createInjector().getInstance(VirtualGuestToHardware.class);
GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class);
Location location = new LocationBuilder().id("test")
.description("example")
.scope(LocationScope.ZONE)
.build();
Supplier<Set<? extends Location>> locationSupplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.of(location));
@Test
public void testVirtualGuestToNodeMetadata() {
VirtualGuest virtualGuest = createVirtualGuest();
NodeMetadata nodeMetadata = new VirtualGuestToNodeMetadata(locationSupplier, namingConvention,
virtualGuestToImage, virtualGuestToHardware).apply(virtualGuest);
assertNotNull(nodeMetadata);
assertEquals(nodeMetadata.getName(), virtualGuest.getHostname());
assertNotNull(nodeMetadata.getLocation());
assertEquals(nodeMetadata.getLocation().getId(), location.getId());
assertEquals(nodeMetadata.getHostname(), virtualGuest.getFullyQualifiedDomainName());
assertEquals(nodeMetadata.getHardware().getRam(), virtualGuest.getMaxMemory());
assertTrue(nodeMetadata.getHardware().getProcessors().size() == 1);
assertEquals(Iterables.get(nodeMetadata.getHardware().getProcessors(), 0).getCores(), (double) virtualGuest.getStartCpus());
assertEquals(nodeMetadata.getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(nodeMetadata.getOperatingSystem().getVersion(), "12.04");
assertEquals(nodeMetadata.getOperatingSystem().is64Bit(), true);
}
private VirtualGuest createVirtualGuest() {
return VirtualGuest.builder()
.domain("example.com")
.hostname("host1")
.fullyQualifiedDomainName("host1.example.com")
.id(1301396)
.maxMemory(1024)
.startCpus(1)
.localDiskFlag(true)
.operatingSystem(OperatingSystem.builder().id("UBUNTU_LATEST")
.operatingSystemReferenceCode("UBUNTU_LATEST")
.softwareLicense(SoftwareLicense.builder()
.softwareDescription(SoftwareDescription.builder()
.version("12.04-64 Minimal for CCI")
.referenceCode("UBUNTU_12_64")
.longDescription("Ubuntu Linux 12.04 LTS Precise Pangolin - Minimal Install (64 bit)")
.build())
.build())
.build())
.datacenter(Datacenter.builder().name("test").build())
.powerState(PowerState.builder().keyName(VirtualGuest.State.RUNNING).build())
.build();
}
}
| [
"Administrator@fdp"
] | Administrator@fdp |
f53f53d970eb01d498470fe84c64fce40140cb2f | 98e53f3932ecce2a232d0c314527efe49f62e827 | /org.rcfaces.core/src-jsf2_2/org/rcfaces/core/internal/facelets/ServerDataHandler.java | aff88831d0b433f78db6ca21bde28988f87fdea2 | [] | no_license | Vedana/rcfaces-2 | f053a4ebb8bbadd02455d89a5f1cb870deade6da | 4112cfe1117c4bfcaf42f67fe5af32a84cf52d41 | refs/heads/master | 2020-04-02T15:03:08.653984 | 2014-04-18T09:36:54 | 2014-04-18T09:36:54 | 11,175,963 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,634 | java | /*
* $Id: ServerDataHandler.java,v 1.1 2014/02/05 16:05:53 jbmeslin Exp $
*/
package org.rcfaces.core.internal.facelets;
import javax.faces.component.UIComponent;
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.TagAttribute;
import javax.faces.view.facelets.TagConfig;
import javax.faces.view.facelets.TagException;
import javax.faces.view.facelets.TagHandler;
import org.rcfaces.core.internal.manager.IServerDataManager;
/**
*
* @author Olivier Oeuillot (latest modification by $Author: jbmeslin $)
* @version $Revision: 1.1 $ $Date: 2014/02/05 16:05:53 $
*/
public class ServerDataHandler extends TagHandler {
private final TagAttribute name;
private final TagAttribute value;
public ServerDataHandler(TagConfig config) {
super(config);
this.name = this.getRequiredAttribute("name");
this.value = this.getRequiredAttribute("value");
}
public void apply(FaceletContext ctx, UIComponent parent) {
if (parent == null) {
throw new TagException(this.tag, "Parent UIComponent was null");
}
// only process if the parent is new to the tree
if (parent.getParent() != null) {
return;
}
IServerDataManager serverDataCapability = (IServerDataManager) parent;
String nameValue = name.getValue(ctx);
if (value.isLiteral()) {
serverDataCapability.setServerData(nameValue, value.getValue());
return;
}
serverDataCapability.setServerData(nameValue,
value.getValueExpression(ctx, Object.class));
}
}
| [
"jbmeslin@vedana.com"
] | jbmeslin@vedana.com |
ad8992311f36e99399b2bfe4911682ebe5ec122a | a94d20a6346d219c84cc97c9f7913f1ce6aba0f8 | /saksbehandling/webapp/src/main/java/no/nav/foreldrepenger/web/local/development/JettyLoginResource.java | 2149ea5aecfaf8e30090978328505fa912e4a8da | [
"MIT"
] | permissive | junnae/spsak | 3c8a155a1bf24c30aec1f2a3470289538c9de086 | ede4770de33bd896d62225a9617b713878d1efa5 | refs/heads/master | 2020-09-11T01:56:53.748986 | 2019-02-06T08:14:42 | 2019-02-06T08:14:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 650 | java | package no.nav.foreldrepenger.web.local.development;
import javax.enterprise.context.RequestScoped;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
import java.net.URI;
/**
* Innlogging ved kjøring lokalt.
* <p>
* Se utviklerhåndbok for hvordan dette fungerer.
*/
@Path("/login")
@RequestScoped
public class JettyLoginResource {
@GET
@Path("")
public Response login() {
// når vi har kommet hit, er brukeren innlogget og har fått ID-token. Kan da gjøre redirect til hovedsiden for VL
return Response.temporaryRedirect(URI.create("http://localhost:9000/")).build();
}
}
| [
"roy.andre.gundersen@nav.no"
] | roy.andre.gundersen@nav.no |
b887865957fdc4941b79f6192b01291c9b109777 | 4bec34f9f496db1f092d71b3dedbc77e2b9d2ee1 | /cbs.api.contest.service/src/main/java/com/lifeix/cbs/contest/bean/fb/FbLiveWordsListResponse.java | b131ed47e4c65366b7061bfeed6f748656bbff28 | [] | no_license | 888xin/cbs.api | 08ec358363f1d7a0fc9037cf6746cc441c879497 | d9667aa1933fd9f0e02d2be97bc8aa7b8c8fe782 | refs/heads/master | 2020-03-27T07:14:56.367782 | 2018-08-26T11:49:04 | 2018-08-26T11:50:00 | 146,175,221 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 615 | java | package com.lifeix.cbs.contest.bean.fb;
import java.util.List;
import com.lifeix.user.beans.ListResponse;
import com.lifeix.user.beans.Response;
public class FbLiveWordsListResponse extends ListResponse implements Response {
private static final long serialVersionUID = 3118161620809592219L;
private List<FbLiveWordsResponse> live_words;
@Override
public String getObjectName() {
return null;
}
public List<FbLiveWordsResponse> getLive_words() {
return live_words;
}
public void setLive_words(List<FbLiveWordsResponse> live_words) {
this.live_words = live_words;
}
}
| [
"888xin@sina.com"
] | 888xin@sina.com |
6e04f5b41c653aeb6abc7854a06db5d412e059c1 | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdasApi21/applicationModule/src/test/java/applicationModulepackageJava11/Foo393Test.java | e983f8a87a98292c3d3c6dd0e1845b0f7b392367 | [] | 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 | 482 | java | package applicationModulepackageJava11;
import org.junit.Test;
public class Foo393Test {
@Test
public void testFoo0() {
new Foo393().foo0();
}
@Test
public void testFoo1() {
new Foo393().foo1();
}
@Test
public void testFoo2() {
new Foo393().foo2();
}
@Test
public void testFoo3() {
new Foo393().foo3();
}
@Test
public void testFoo4() {
new Foo393().foo4();
}
@Test
public void testFoo5() {
new Foo393().foo5();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
42db7c9de5cb8daecb38775dcf3c02af9ff620a9 | dff1127ec023fa044a90eb6a2134e8d93b25d23a | /cache/trunk/coconut-cache-test/test-adapter/test-adapter-map/src/main/java/org/coconut/cache/test/adapter/map/MapAdapterFactory.java | cd3c412849cde2cb4719fbc9cb3d888e2159ee3d | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | codehaus/coconut | 54d98194e401bd98659de4bb72e12b7e24ba71e4 | f2bc1fc516c65a9d0fd76ffb3bb148309ef1ba76 | refs/heads/master | 2023-08-31T00:18:48.501510 | 2008-04-24T09:28:52 | 2008-04-24T09:28:52 | 36,364,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | /* Copyright 2004 - 2007 Kasper Nielsen <kasper@codehaus.org> Licensed under
* the Apache 2.0 License, see http://coconut.codehaus.org/license.
*/
package org.coconut.cache.test.adapter.map;
import java.util.Map;
import org.coconut.cache.test.adapter.CacheAdapterFactory;
import org.coconut.cache.test.adapter.CacheTestAdapter;
/**
* @author <a href="mailto:kasper@codehaus.org">Kasper Nielsen</a>
* @version $Id: Cache.java,v 1.2 2005/04/27 15:49:16 kasper Exp $
*/
public class MapAdapterFactory implements CacheAdapterFactory {
private final Class<? extends Map> c;
public MapAdapterFactory(Class<? extends Map> c) {
this.c = c;
}
/**
* @see coconut.cache.test.adapter.CacheAdapterProvider#createAdapter()
*/
public CacheTestAdapter createAdapter() throws Exception {
return new MapAdapter(c.newInstance());
}
/**
* @see coconut.cache.test.adapter.CacheAdapterProvider#supportsPut()
*/
public boolean supportsPut() {
return true;
}
public String toString() {
return c.getCanonicalName();
}
}
| [
"kasper@0b154b62-a015-0410-9c24-a35e082c6f94"
] | kasper@0b154b62-a015-0410-9c24-a35e082c6f94 |
9cf73e2ed1efb76418c3885e9fbdf7d7c3159919 | 9f2c80833b9e72636a747884ddd562cb728a7a2b | /app/src/main/java/bc/yxdc/com/bean/LogisticsBean.java | 072a41941b1400190e19d2e6071e810421533e97 | [] | no_license | gamekonglee/txdc | 1bfa8b216123334f6dd0da39d4493964872d0453 | 8daca524021597a7035c6d3d2cff64939a5d90b4 | refs/heads/master | 2020-06-27T00:09:54.703830 | 2019-11-12T01:51:23 | 2019-11-12T01:51:23 | 199,793,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 738 | java | package bc.yxdc.com.bean;
/**
* Created by gamekonglee on 2018/9/26.
*/
public class LogisticsBean {
public String name;
public String phone;
public String address;
public String id;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
| [
"451519474@qq.com"
] | 451519474@qq.com |
c3d12e534cb11f8dd1f7f7ac87b38517f7d16f82 | 8e7c337291bc1ae400073d0e2850001ece672eb8 | /app/src/main/java/com/gdglapaz/io/legotbbtiot/ui/activities/MainActivity.java | 7d7fa8305e745a3b79b2b699693efff38e56e0b4 | [] | no_license | andres-vasquez/LegoTbbTIot | 633fd64090cb1b9ad6fa84e35a23acbdbc76b165 | 98b43c25714977bc1f7f9be9964c12c17ccbd25f | refs/heads/master | 2021-01-17T08:44:18.282699 | 2016-06-13T00:52:19 | 2016-06-13T00:52:19 | 60,423,212 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,266 | java | package com.gdglapaz.io.legotbbtiot.ui.activities;
import android.app.DialogFragment;
import android.content.Context;
import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SwitchCompat;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.ToggleButton;
import com.firebase.client.Firebase;
import com.gdglapaz.io.legotbbtiot.R;
import com.gdglapaz.io.legotbbtiot.controller.FirebaseController;
import com.gdglapaz.io.legotbbtiot.model.Sensors;
import com.gdglapaz.io.legotbbtiot.ui.dialog.AboutDialog;
import com.gdglapaz.io.legotbbtiot.utils.Constants;
public class MainActivity extends AppCompatActivity implements OnCheckedChangeListener{
public static final String LOG_TAG=MainActivity.class.getSimpleName();
private Context context;
private RelativeLayout rlyVibrator;
private RelativeLayout rlyMiniFan;
private RelativeLayout rlyLight;
private RelativeLayout rlyButton;
private RelativeLayout rlyLightSensor;
private SwitchCompat switchVibrator;
private SwitchCompat switchMiniFan;
private SwitchCompat switchLight;
private ToggleButton btnPushButton;
private SeekBar seekBarLightSensor;
private TextView txtLightSensor;
private TextView txtFirebaseUrl;
private Sensors objSensor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
/* Using FIREBASE URL */
txtFirebaseUrl.setText(Constants.FIREBASE_URL);
Firebase.setAndroidContext(context);
/* Add events to UI components */
switchVibrator.setOnCheckedChangeListener(this);
switchLight.setOnCheckedChangeListener(this);
switchMiniFan.setOnCheckedChangeListener(this);
/* Listener for Firebase Data Changes */
new FirebaseController(new FirebaseController.DataChanges() {
@Override
public void onDataChanged(Sensors objSensor){
/* Update UI components from Firebase Data */
updateSwitch(switchVibrator,objSensor.getBrrr());
updateSwitch(switchMiniFan,objSensor.getCooldown());
updateSwitch(switchLight,objSensor.getRedlight());
if(objSensor.getPushbutton()==Constants.STATE_ACTIVE){
btnPushButton.setChecked(true);
}
else{
btnPushButton.setChecked(false);
}
/* Light Sensor UI components */
txtLightSensor.setText(String.valueOf(objSensor.getSunlight()));
seekBarLightSensor.setProgress(objSensor.getSunlight());
}
}).getData();
}
private void init(){
context=this;
objSensor=new Sensors();
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
rlyVibrator=(RelativeLayout)findViewById(R.id.rlyVibrator);
rlyMiniFan=(RelativeLayout)findViewById(R.id.rlyMiniFan);
rlyLight=(RelativeLayout)findViewById(R.id.rlyLight);
rlyButton=(RelativeLayout)findViewById(R.id.rlyButton);
rlyLightSensor=(RelativeLayout)findViewById(R.id.rlyLightSensor);
switchVibrator=(SwitchCompat)findViewById(R.id.switchVibrator);
switchMiniFan=(SwitchCompat)findViewById(R.id.switchMiniFan);
switchLight=(SwitchCompat)findViewById(R.id.switchLight);
btnPushButton=(ToggleButton)findViewById(R.id.btnPushButton);
seekBarLightSensor=(SeekBar)findViewById(R.id.seekBarLightSensor);
seekBarLightSensor.setMax(Constants.SUN_LIGHT_MAX);
txtLightSensor=(TextView)findViewById(R.id.txtLightSensor);
txtFirebaseUrl=(TextView)findViewById(R.id.txtFirebaseUrl);
/* Hide title of App over Image */
CollapsingToolbarLayout collapsingToolbarLayout=(CollapsingToolbarLayout) findViewById(R.id.collapser);
collapsingToolbarLayout.setExpandedTitleColor(getResources().getColor(android.R.color.transparent));
}
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isPressed) {
int state;
if(isPressed){
state=Constants.STATE_ACTIVE;
}
else{
state= Constants.STATE_INACTIVE;
}
switch (compoundButton.getId()){
case R.id.switchVibrator:
objSensor.setBrrr(state);
break;
case R.id.switchMiniFan:
objSensor.setCooldown(state);
break;
case R.id.switchLight:
objSensor.setRedlight(state);
break;
default:
Log.e(LOG_TAG,"Different Switch checked");
break;
}
FirebaseController.sendData(objSensor);
}
/***
* Update Switch state
* @param switchCompat UI Component SwitchCompat
* @param state State to update
*/
private void updateSwitch(SwitchCompat switchCompat, int state){
if(state==Constants.STATE_ACTIVE) {
switchCompat.setChecked(true);
}
else{
switchCompat.setChecked(false);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
if(item.getItemId()==R.id.about){
/* Show About Dialog */
DialogFragment dialog = AboutDialog.newInstance();
dialog.show(MainActivity.this.getFragmentManager(), Constants.ABOUT_TAG);
}
return super.onOptionsItemSelected(item);
}
}
| [
"andres.vasquez.a@hotmail.com"
] | andres.vasquez.a@hotmail.com |
e3042f2f79704b4557b4518a735663d67d08d73e | a0c750f0ec36a4dbca4d7ab7cd3a476008e6f474 | /src/main/java/com/alibaba/dubbo/remoting/transport/dispatcher/ChannelHandlers.java | f73d25608d6082ed9cc84dcb4d42e102c3527b53 | [] | no_license | Fyypumpkin/dubbo-decompile-source | dc7251f6db19e6f8134ed49360add502a71f698b | 2510460f89dec2d7bc11769507cc37882f9b7ba7 | refs/heads/master | 2020-06-10T10:25:00.460681 | 2019-06-25T04:26:55 | 2019-06-25T04:26:55 | 193,633,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,163 | java | /*
* Decompiled with CFR 0.139.
*/
package com.alibaba.dubbo.remoting.transport.dispatcher;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.alibaba.dubbo.remoting.ChannelHandler;
import com.alibaba.dubbo.remoting.Dispatcher;
import com.alibaba.dubbo.remoting.exchange.support.header.HeartbeatHandler;
import com.alibaba.dubbo.remoting.transport.MultiMessageHandler;
public class ChannelHandlers {
private static ChannelHandlers INSTANCE = new ChannelHandlers();
public static ChannelHandler wrap(ChannelHandler handler, URL url) {
return ChannelHandlers.getInstance().wrapInternal(handler, url);
}
protected ChannelHandlers() {
}
protected ChannelHandler wrapInternal(ChannelHandler handler, URL url) {
return new MultiMessageHandler(new HeartbeatHandler(ExtensionLoader.getExtensionLoader(Dispatcher.class).getAdaptiveExtension().dispatch(handler, url)));
}
protected static ChannelHandlers getInstance() {
return INSTANCE;
}
static void setTestingChannelHandlers(ChannelHandlers instance) {
INSTANCE = instance;
}
}
| [
"fyypumpkin@gmail.com"
] | fyypumpkin@gmail.com |
c61ef66e2391d2c34bd0d13cde04cbea13a81f30 | 4aa90348abcb2119011728dc067afd501f275374 | /app/src/main/java/com/tencent/mm/plugin/normsg/utils/b$e.java | c1d88a8e83a29f7f1aba5d6d3b6b8278a8c971ac | [] | no_license | jambestwick/HackWechat | 0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6 | 6a34899c8bfd50d19e5a5ec36a58218598172a6b | refs/heads/master | 2022-01-27T12:48:43.446804 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | null | UTF-8 | Java | false | false | 1,583 | java | package com.tencent.mm.plugin.normsg.utils;
import android.os.IBinder;
import android.os.IInterface;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
class b$e implements InvocationHandler {
final /* synthetic */ b oTi;
protected final IInterface oTt;
b$e(b bVar, IInterface iInterface) {
this.oTi = bVar;
this.oTt = iInterface;
}
public Object invoke(Object obj, Method method, Object[] objArr) {
try {
if ("asBinder".equals(method.getName())) {
return asBinder();
}
return method.invoke(this.oTt, objArr);
} catch (InvocationTargetException e) {
Throwable targetException = e.getTargetException();
if (targetException instanceof RuntimeException) {
throw targetException;
}
Class[] exceptionTypes = method.getExceptionTypes();
if (exceptionTypes != null && exceptionTypes.length > 0) {
for (Class isAssignableFrom : method.getExceptionTypes()) {
if (isAssignableFrom.isAssignableFrom(targetException.getClass())) {
throw targetException;
}
}
}
b.a(this.oTi, targetException);
return b.b(method);
} catch (Throwable th) {
b.a(this.oTi, th);
return b.b(method);
}
}
public IBinder asBinder() {
return this.oTt.asBinder();
}
}
| [
"malin.myemail@163.com"
] | malin.myemail@163.com |
fcd94f94cd6cc417c6fe01be585f13564ef2a64b | c67283ba530c1cc91aa03dff0eea066ed6d4add5 | /HBProj27-merge(-)Vsupdate(-)UseCase/src/com/nt/dao/StockMarketDAOImpl.java | 148b3f0571ecb010e920feb2e18dc8908fea3295 | [] | no_license | NCENalanda/hibernate | 699a18e211e234fe0b02e6131dbc99678bdae95e | a6d858a7407fcb2d90f05614aab611c9d09173a5 | refs/heads/master | 2022-12-05T08:25:17.400914 | 2019-05-28T07:14:01 | 2019-05-28T07:14:01 | 188,974,056 | 1 | 0 | null | 2022-11-24T07:02:22 | 2019-05-28T07:10:09 | Java | UTF-8 | Java | false | false | 2,100 | java | package com.nt.dao;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import com.nt.domain.StockShare;
import com.nt.utility.HibernateUtil;
public class StockMarketDAOImpl implements StockMarketDAO {
@Override
public boolean insertStock(StockShare share) {
Session ses=null;
Transaction tx=null;
boolean flag=false;
//get Session
ses=HibernateUtil.getSession();
try{
tx=ses.beginTransaction();
ses.save(share);
flag=true;
}
catch(HibernateException he){
flag=false;
he.printStackTrace();
}
catch(Exception e){
flag=false;
e.printStackTrace();
}
finally{
if(flag==true)
tx.commit();
else
tx.rollback();
HibernateUtil.closeSession(ses);
}
return flag;
}//method
@Override
public StockShare getStock(int stockId) {
Session ses=null;
StockShare share=null;
//get Session
ses=HibernateUtil.getSession();
try{
share=ses.get(StockShare.class,stockId);
}
catch(HibernateException he){
he.printStackTrace();
}
catch(Exception e){
e.printStackTrace();
}
finally{
HibernateUtil.closeSession(ses);
}
return share;
}
@Override
public boolean updateStock(int stockId, float newValue) {
Session ses=null;
StockShare share=null,share1=null;
Transaction tx=null;
boolean flag=false;
//get Session
ses=HibernateUtil.getSession();
share=getStock(stockId);
try{
tx=ses.beginTransaction();
//modify stockValue
share.setCurrentPrice(newValue);
//get Stock status
share1=ses.get(StockShare.class,stockId);
if(share1.getStatus().equalsIgnoreCase("active")){
//ses.update(share); //throws NonUniqueObjectException
ses.merge(share);
//share1.setCurrentPrice(share.getCurrentPrice());
flag=true;
}
}
catch(HibernateException he){
flag=false;
he.printStackTrace();
}
catch(Exception e){
flag=false;
e.printStackTrace();
}
finally{
if(flag==true)
tx.commit();
else
tx.rollback();
HibernateUtil.closeSession(ses);
}
return flag;
}
}
| [
"aaush0101@gmail.com"
] | aaush0101@gmail.com |
ccf8385e17c3aae4f04157e91a7e04b6dc67acef | 25cfbbb243aef9514848b160b0e8d7ba31d44a7d | /src/main/java/com/tencentcloudapi/faceid/v20180301/models/CheckPhoneAndNameRequest.java | 72bc4dfd51f15fe3040a68141215acc70e849659 | [
"Apache-2.0"
] | permissive | feixueck/tencentcloud-sdk-java | ceaf3c493eec493878c0373f5d07f6fe34fa5f7b | ebdfb9cf12ce7630f53b387e2ac8d17471c6c7d0 | refs/heads/master | 2021-08-17T15:37:34.198968 | 2021-01-08T01:30:26 | 2021-01-08T01:30:26 | 240,156,902 | 0 | 0 | Apache-2.0 | 2021-01-08T02:57:29 | 2020-02-13T02:04:37 | Java | UTF-8 | Java | false | false | 1,957 | java | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.faceid.v20180301.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class CheckPhoneAndNameRequest extends AbstractModel{
/**
* ⼿机号
*/
@SerializedName("Mobile")
@Expose
private String Mobile;
/**
* 姓名
*/
@SerializedName("Name")
@Expose
private String Name;
/**
* Get ⼿机号
* @return Mobile ⼿机号
*/
public String getMobile() {
return this.Mobile;
}
/**
* Set ⼿机号
* @param Mobile ⼿机号
*/
public void setMobile(String Mobile) {
this.Mobile = Mobile;
}
/**
* Get 姓名
* @return Name 姓名
*/
public String getName() {
return this.Name;
}
/**
* Set 姓名
* @param Name 姓名
*/
public void setName(String Name) {
this.Name = Name;
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "Mobile", this.Mobile);
this.setParamSimple(map, prefix + "Name", this.Name);
}
}
| [
"tencentcloudapi@tenent.com"
] | tencentcloudapi@tenent.com |
802a7bc5f71e4a9ff08e083e85c55aef04e7407f | a14deb218f7e90e16e9fdcfe7723b924a7851f2b | /src/main/java/net/sourceforge/plantuml/openiconic/PSystemOpenIconicFactory.java | 804a8586d99d6bd9ef90d87c752c479b3d0c589c | [
"Apache-2.0"
] | permissive | btomala/sbt-plantuml-plugin | aac0dc27b5597452cc8dd5c3cd2576c8565cfc28 | 7b710ebbd9da6c9b5e95c66c592cf9a021f42987 | refs/heads/master | 2021-01-16T18:57:14.036051 | 2016-02-26T14:45:05 | 2016-02-26T14:45:05 | 67,075,540 | 0 | 0 | null | 2016-09-07T18:27:29 | 2016-08-31T21:42:49 | Java | UTF-8 | Java | false | false | 1,512 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2014, Arnaud Roques
*
* Project Info: http://plantuml.sourceforge.net
*
* This file is part of PlantUML.
*
* 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.
*
*
* Original Author: Arnaud Roques
*/
package net.sourceforge.plantuml.openiconic;
import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.PSystemSingleLineFactory;
public class PSystemOpenIconicFactory extends PSystemSingleLineFactory {
@Override
protected AbstractPSystem executeLine(String line) {
final String lineLower = StringUtils.goLowerCase(line);
if (lineLower.startsWith("openiconic ")) {
final int idx = line.indexOf(' ');
return new PSystemOpenIconic(lineLower.substring(idx + 1), 1.0);
}
return null;
}
}
| [
"adam@ashannon.us"
] | adam@ashannon.us |
51b9f23cd3ded4a33d7b4dced112227e9f653301 | 27da12a5a06278ef0d4a8e3436161821ecc4effc | /auto-interface-test-web/src/main/java/com/auto/yaotao/AutoInterfaceTest.java | f2b36f18955fa406f9a0f750666fcdb1308ccf14 | [] | no_license | yaotaoyingluo/auto-interface-test | 72e36dc4453a453876b1e9f92d92e07ed039b9e5 | 2755da6115ecff486f615c3d80b2d5047d07c2b8 | refs/heads/master | 2023-04-01T11:46:45.873118 | 2021-04-09T10:09:52 | 2021-04-09T10:09:52 | 355,477,285 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 578 | java | package com.auto.yaotao;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
* @Auther yaotao
* @Date 2021/4/7
*/
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class AutoInterfaceTest{
public static void main(String[] args){
try {
SpringApplication.run(AutoInterfaceTest.class,args);
}catch (Exception e){
e.printStackTrace();
}
}
}
| [
"11"
] | 11 |
2f5eee5186bebaba45f2f9d49af788578f6b2b2a | 7c1ff80b3f641780dc6fdc805339b61ddc990d2e | /scribble-demos/scrib/travel/src/travel/BookingS.java | 6d59298fa78024e0bcfe30bacb7a453aad85ef9a | [
"Apache-2.0"
] | permissive | scribble/scribble-java | e37e0f0b93d38d6a2d63868f444badeb84ad2ff9 | 723660a81ee40a094163d9c63a93778cbc97af6e | refs/heads/master | 2021-06-03T16:53:16.599506 | 2021-05-21T13:10:46 | 2021-05-21T13:10:46 | 1,465,143 | 43 | 20 | NOASSERTION | 2021-10-19T11:09:06 | 2011-03-10T19:59:46 | Java | UTF-8 | Java | false | false | 2,456 | java | /**
* Copyright 2008 The Scribble 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 travel;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import org.scribble.main.ScribRuntimeException;
import org.scribble.runtime.message.ObjectStreamFormatter;
import org.scribble.runtime.net.ScribServerSocket;
import org.scribble.runtime.net.SocketChannelServer;
import org.scribble.runtime.session.MPSTEndpoint;
import org.scribble.runtime.util.Buf;
import travel.Travel.Booking.Booking;
import travel.Travel.Booking.roles.S;
import travel.Travel.Booking.statechans.S.Booking_S_1;
import travel.Travel.Booking.statechans.S.Booking_S_1_Cases;
public class BookingS
{
public static void main(String[] args) throws IOException,
ScribRuntimeException, ExecutionException, InterruptedException
{
try (ScribServerSocket ss_C = new SocketChannelServer(8888);
ScribServerSocket ss_A = new SocketChannelServer(9999))
{
while (true)
{
Booking booking = new Booking();
try (MPSTEndpoint<Booking, S> se = new MPSTEndpoint<>(booking,
Booking.S, new ObjectStreamFormatter()))
{
//S.register(Booking.A, ss_A);
se.accept(ss_C, Booking.C);
se.accept(ss_A, Booking.A);
Buf<String> payment = new Buf<>();
Booking_S_1 s1 = new Booking_S_1(se);
Booking_S_1_Cases s1cases;
X: while (true)
{
s1cases = s1.branch(Booking.A);
switch (s1cases.op)
{
case Dummy:
s1 = s1cases.receive(Booking.Dummy);
break;
case No:
s1cases.receive(Booking.No);
break X;
case Yes:
System.out.println("Yes: ");
s1cases.receive(Booking.Yes)
.receive(Booking.C, Booking.Payment, payment)
.send(Booking.C, Booking.Ack);
break X;
}
}
System.out.println("Done:");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}
}
| [
"raymond.hu@imperial.ac.uk"
] | raymond.hu@imperial.ac.uk |
96e8f54b591ed2b953daf3f7553374952ab0df05 | b4de5ebbbf264d474c9a9bbcaf72cbe25a47e340 | /obj/Debug/110/android/src/crc6464307ed53f287045/ProUsersAdapter.java | 5977f7b843c5e04e965068c6cbe2baf099862c5e | [] | no_license | stc2020/Agrinoble-Mobile-App-Android | a2c3baac1601d4e74b66c87c97c238a0762c8870 | a1889e90cf67c7c135928957b109a3c7753c46b5 | refs/heads/main | 2023-07-26T19:21:52.224285 | 2021-09-02T00:52:30 | 2021-09-02T00:52:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,782 | java | package crc6464307ed53f287045;
public class ProUsersAdapter
extends androidx.recyclerview.widget.RecyclerView.Adapter
implements
mono.android.IGCUserPeer,
com.bumptech.glide.ListPreloader.PreloadModelProvider
{
/** @hide */
public static final String __md_methods;
static {
__md_methods =
"n_getItemCount:()I:GetGetItemCountHandler\n" +
"n_onCreateViewHolder:(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;:GetOnCreateViewHolder_Landroid_view_ViewGroup_IHandler\n" +
"n_onBindViewHolder:(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V:GetOnBindViewHolder_Landroidx_recyclerview_widget_RecyclerView_ViewHolder_IHandler\n" +
"n_onViewRecycled:(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;)V:GetOnViewRecycled_Landroidx_recyclerview_widget_RecyclerView_ViewHolder_Handler\n" +
"n_getItemId:(I)J:GetGetItemId_IHandler\n" +
"n_getItemViewType:(I)I:GetGetItemViewType_IHandler\n" +
"n_getPreloadItems:(I)Ljava/util/List;:GetGetPreloadItems_IHandler:Bumptech.Glide.ListPreloader/IPreloadModelProviderInvoker, Xamarin.Android.Glide\n" +
"n_getPreloadRequestBuilder:(Ljava/lang/Object;)Lcom/bumptech/glide/RequestBuilder;:GetGetPreloadRequestBuilder_Ljava_lang_Object_Handler:Bumptech.Glide.ListPreloader/IPreloadModelProviderInvoker, Xamarin.Android.Glide\n" +
"";
mono.android.Runtime.register ("WoWonder.Activities.Tabbes.Adapters.ProUsersAdapter, WoWonder", ProUsersAdapter.class, __md_methods);
}
public ProUsersAdapter ()
{
super ();
if (getClass () == ProUsersAdapter.class)
mono.android.TypeManager.Activate ("WoWonder.Activities.Tabbes.Adapters.ProUsersAdapter, WoWonder", "", this, new java.lang.Object[] { });
}
public ProUsersAdapter (android.app.Activity p0)
{
super ();
if (getClass () == ProUsersAdapter.class)
mono.android.TypeManager.Activate ("WoWonder.Activities.Tabbes.Adapters.ProUsersAdapter, WoWonder", "Android.App.Activity, Mono.Android", this, new java.lang.Object[] { p0 });
}
public int getItemCount ()
{
return n_getItemCount ();
}
private native int n_getItemCount ();
public androidx.recyclerview.widget.RecyclerView.ViewHolder onCreateViewHolder (android.view.ViewGroup p0, int p1)
{
return n_onCreateViewHolder (p0, p1);
}
private native androidx.recyclerview.widget.RecyclerView.ViewHolder n_onCreateViewHolder (android.view.ViewGroup p0, int p1);
public void onBindViewHolder (androidx.recyclerview.widget.RecyclerView.ViewHolder p0, int p1)
{
n_onBindViewHolder (p0, p1);
}
private native void n_onBindViewHolder (androidx.recyclerview.widget.RecyclerView.ViewHolder p0, int p1);
public void onViewRecycled (androidx.recyclerview.widget.RecyclerView.ViewHolder p0)
{
n_onViewRecycled (p0);
}
private native void n_onViewRecycled (androidx.recyclerview.widget.RecyclerView.ViewHolder p0);
public long getItemId (int p0)
{
return n_getItemId (p0);
}
private native long n_getItemId (int p0);
public int getItemViewType (int p0)
{
return n_getItemViewType (p0);
}
private native int n_getItemViewType (int p0);
public java.util.List getPreloadItems (int p0)
{
return n_getPreloadItems (p0);
}
private native java.util.List n_getPreloadItems (int p0);
public com.bumptech.glide.RequestBuilder getPreloadRequestBuilder (java.lang.Object p0)
{
return n_getPreloadRequestBuilder (p0);
}
private native com.bumptech.glide.RequestBuilder n_getPreloadRequestBuilder (java.lang.Object p0);
private java.util.ArrayList refList;
public void monodroidAddReference (java.lang.Object obj)
{
if (refList == null)
refList = new java.util.ArrayList ();
refList.add (obj);
}
public void monodroidClearReferences ()
{
if (refList != null)
refList.clear ();
}
}
| [
"89942132+AgrinobleAGN@users.noreply.github.com"
] | 89942132+AgrinobleAGN@users.noreply.github.com |
f9f8ade03ad7e8526b78ffb7fcba7b540130742f | 08888a29fc00788e49390cbf6590a9c5b9a88f95 | /cgtjr/academics/math/geometry/shapebndry/Bndry.java | 2ff8e7d3203dee0ba6afb0c24cc6069bba552c76 | [] | no_license | hellohung1229/cgtjr_csa | eebfd3f8f04deb89ca4346b13b79c87640527f58 | 5591dc8c2ec22fd4d94d1895b83c1313f1537df9 | refs/heads/master | 2021-04-15T05:00:42.743118 | 2017-10-23T20:43:33 | 2017-10-23T20:43:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package cgtjr.academics.math.geometry.shapebndry;
public interface Bndry
{
public boolean isInBndry(double r,double t,double p);
} | [
"clayton.g.thomas@gmail.com"
] | clayton.g.thomas@gmail.com |
62377c8f0958f625059550c43948a60fcf1b5265 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/spring-projects--spring-framework/42b5d6dd7edda6121bd87852805471ea53074985/after/ExposeInvocationInterceptorTests.java | a66b4f1b05ff47b52155ce2bb64e70b4ea586276 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,665 | java | /*
* Copyright 2002-2013 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.aop.interceptor;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
import org.aopalliance.intercept.MethodInvocation;
import org.junit.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.Resource;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
/**
* Non-XML tests are in AbstractAopProxyTests
*
* @author Rod Johnson
* @author Chris Beams
*/
public final class ExposeInvocationInterceptorTests {
private static final Resource CONTEXT =
qualifiedResource(ExposeInvocationInterceptorTests.class, "context.xml");
@Test
public void testXmlConfig() {
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(bf).loadBeanDefinitions(CONTEXT);
ITestBean tb = (ITestBean) bf.getBean("proxy");
String name= "tony";
tb.setName(name);
// Fires context checks
assertEquals(name, tb.getName());
}
}
abstract class ExposedInvocationTestBean extends TestBean {
@Override
public String getName() {
MethodInvocation invocation = ExposeInvocationInterceptor.currentInvocation();
assertions(invocation);
return super.getName();
}
@Override
public void absquatulate() {
MethodInvocation invocation = ExposeInvocationInterceptor.currentInvocation();
assertions(invocation);
super.absquatulate();
}
protected abstract void assertions(MethodInvocation invocation);
}
class InvocationCheckExposedInvocationTestBean extends ExposedInvocationTestBean {
@Override
protected void assertions(MethodInvocation invocation) {
assertTrue(invocation.getThis() == this);
assertTrue("Invocation should be on ITestBean: " + invocation.getMethod(),
ITestBean.class.isAssignableFrom(invocation.getMethod().getDeclaringClass()));
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
14194e0932a224f899b0a836ecc32f1d311bc17e | 09dd033f6b7e831924dd85ecf6c8a692d431db7c | /esb/org.wso2.developerstudio.eclipse.esb/src/org/wso2/developerstudio/eclipse/esb/mediators/impl/ClassMediatorImpl.java | a704f05d5f92fa190d819e9566aebbd2c23193a9 | [
"Apache-2.0"
] | permissive | sumuditha-viraj/developer-studio | 354c4402b3f4667344b0454f585f3aca9589b858 | cef47b9847bed96c241b9a070bfa00ecc6716ef0 | refs/heads/master | 2021-01-17T23:44:15.476712 | 2018-08-22T07:34:53 | 2018-08-22T07:34:53 | 30,071,053 | 0 | 0 | null | 2015-01-30T16:10:08 | 2015-01-30T12:29:53 | Java | UTF-8 | Java | false | false | 7,752 | java | /*
* Copyright 2009-2010 WSO2, Inc. (http://wso2.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.wso2.developerstudio.eclipse.esb.mediators.impl;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.w3c.dom.Element;
import org.wso2.developerstudio.eclipse.esb.impl.MediatorImpl;
import org.wso2.developerstudio.eclipse.esb.mediators.ClassMediator;
import org.wso2.developerstudio.eclipse.esb.mediators.ClassProperty;
import org.wso2.developerstudio.eclipse.esb.mediators.MediatorsPackage;
import org.wso2.developerstudio.eclipse.esb.util.ObjectValidator;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Class Mediator</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.wso2.developerstudio.eclipse.esb.mediators.impl.ClassMediatorImpl#getClassName <em>Class Name</em>}</li>
* <li>{@link org.wso2.developerstudio.eclipse.esb.mediators.impl.ClassMediatorImpl#getProperties <em>Properties</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ClassMediatorImpl extends MediatorImpl implements ClassMediator {
/**
* The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClassName()
* @generated
* @ordered
*/
protected static final String CLASS_NAME_EDEFAULT = "class_name";
/**
* The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClassName()
* @generated
* @ordered
*/
protected String className = CLASS_NAME_EDEFAULT;
/**
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProperties()
* @generated
* @ordered
*/
protected EList<ClassProperty> properties;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ClassMediatorImpl() {
super();
}
/**
* {@inheritDoc}
*/
public void doLoad(Element self) throws Exception {
setClassName(self.getAttribute("name"));
loadObjects(self, "property", ClassProperty.class, new ObjectHandler<ClassProperty>() {
public void handle(ClassProperty object) {
getProperties().add(object);
}
});
super.doLoad(self);
}
/**
* {@inheritDoc}
*/
public Element doSave(Element parent) throws Exception {
Element self = createChildElement(parent, "class");
self.setAttribute("name", getClassName());
for (ClassProperty property : getProperties()) {
property.save(self);
}
if(description!=null)
description.save(self);
addComments(self);
return self;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MediatorsPackage.Literals.CLASS_MEDIATOR;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getClassName() {
return className;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setClassName(String newClassName) {
String oldClassName = className;
className = newClassName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MediatorsPackage.CLASS_MEDIATOR__CLASS_NAME, oldClassName, className));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ClassProperty> getProperties() {
if (properties == null) {
properties = new EObjectContainmentEList<ClassProperty>(ClassProperty.class, this, MediatorsPackage.CLASS_MEDIATOR__PROPERTIES);
}
return properties;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case MediatorsPackage.CLASS_MEDIATOR__PROPERTIES:
return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case MediatorsPackage.CLASS_MEDIATOR__CLASS_NAME:
return getClassName();
case MediatorsPackage.CLASS_MEDIATOR__PROPERTIES:
return getProperties();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MediatorsPackage.CLASS_MEDIATOR__CLASS_NAME:
setClassName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MediatorsPackage.CLASS_MEDIATOR__CLASS_NAME:
setClassName(CLASS_NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MediatorsPackage.CLASS_MEDIATOR__CLASS_NAME:
return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
case MediatorsPackage.CLASS_MEDIATOR__PROPERTIES:
return properties != null && !properties.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (className: ");
result.append(className);
result.append(')');
return result.toString();
}
public Map<String, ObjectValidator> validate() {
ObjectValidator objectValidator = new ObjectValidator();
Map<String, String> validateMap = new HashMap<String, String>();
Map<String, ObjectValidator> mediatorValidateMap = new HashMap<String, ObjectValidator>();
if(null==getClassName() || getClassName().trim().isEmpty()){
validateMap.put("Class Name", "Class Name is empty");
}
objectValidator.setMediatorErrorMap(validateMap);
mediatorValidateMap.put("Class Mediator", objectValidator);
return mediatorValidateMap;
}
} //ClassMediatorImpl
| [
"harshana@wso2.com"
] | harshana@wso2.com |
5803259da39cdc0f9e3e7460cc3a3c32143235cb | 6ded85cb1fbd7dd5bed6a085b92404f957d47ed3 | /src/main/java/com/mcjty/rftools/blocks/logic/TimerTileEntity.java | 40f5711561b1683ce121ddad47487255d95ab3d4 | [
"MIT"
] | permissive | Vexatos/RFTools | 96bda80dd87261decff3839636b47d2c9d469b6e | 5f619a1b934f1f4cf675587efffd922d43e2e237 | refs/heads/master | 2021-01-18T05:02:08.919538 | 2015-03-30T15:23:26 | 2015-03-30T15:23:26 | 33,139,328 | 0 | 0 | null | 2015-03-30T18:07:43 | 2015-03-30T18:07:42 | null | UTF-8 | Java | false | false | 3,221 | java | package com.mcjty.rftools.blocks.logic;
import com.mcjty.entity.GenericTileEntity;
import com.mcjty.entity.SyncedValue;
import com.mcjty.rftools.blocks.BlockTools;
import com.mcjty.rftools.network.Argument;
import net.minecraft.nbt.NBTTagCompound;
import java.util.Map;
public class TimerTileEntity extends GenericTileEntity {
public static final String CMD_SETDELAY = "setDelay";
public static final String CMD_SETCURRENT = "setDelay";
// For pulse detection.
private boolean prevIn = false;
private int delay = 1;
private int timer = 0;
private SyncedValue<Boolean> redstoneOut = new SyncedValue<Boolean>(false);
public TimerTileEntity() {
registerSyncedObject(redstoneOut);
}
public int getDelay() {
return delay;
}
public void setDelay(int delay) {
this.delay = delay;
timer = delay;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
@Override
protected void checkStateServer() {
super.checkStateServer();
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
boolean newvalue = BlockTools.getRedstoneSignalIn(meta);
boolean pulse = newvalue && !prevIn;
prevIn = newvalue;
markDirty();
if (pulse) {
timer = delay;
}
boolean newout;
timer--;
if (timer <= 0) {
timer = delay;
newout = true;
} else {
newout = false;
}
if (newout != redstoneOut.getValue()) {
redstoneOut.setValue(newout);
notifyBlockUpdate();
}
}
@Override
protected int updateMetaData(int meta) {
meta = super.updateMetaData(meta);
Boolean value = redstoneOut.getValue();
return BlockTools.setRedstoneSignalOut(meta, value == null ? false : value);
}
@Override
public void readFromNBT(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
redstoneOut.setValue(tagCompound.getBoolean("rs"));
prevIn = tagCompound.getBoolean("prevIn");
timer = tagCompound.getInteger("timer");
}
@Override
public void readRestorableFromNBT(NBTTagCompound tagCompound) {
super.readRestorableFromNBT(tagCompound);
delay = tagCompound.getInteger("delay");
}
@Override
public void writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
Boolean value = redstoneOut.getValue();
tagCompound.setBoolean("rs", value == null ? false : value);
tagCompound.setBoolean("prevIn", prevIn);
tagCompound.setInteger("timer", timer);
}
@Override
public void writeRestorableToNBT(NBTTagCompound tagCompound) {
super.writeRestorableToNBT(tagCompound);
tagCompound.setInteger("delay", delay);
}
@Override
public boolean execute(String command, Map<String, Argument> args) {
boolean rc = super.execute(command, args);
if (rc) {
return true;
}
if (CMD_SETDELAY.equals(command)) {
setDelay(args.get("delay").getInteger());
return true;
}
return false;
}
}
| [
"mcjty1@gmail.com"
] | mcjty1@gmail.com |
2bf4ca7782c59c30666f3cfd7506027a8dededa5 | fb4ed872c056d4c7de5886f9585e02c9f7f9c9b6 | /scout/net.sakilapp.server/src/net/sakilapp/server/services/custom/security/AccessControlService.java | 24baf9794c1f5bede6f72468e148eb2871aa6adc | [] | no_license | jmini/sakilapp | f382e1a2f0737faa74e87b40e618f1d9823c015a | 78940015dc4c3853395459058655ce6c99d7b1e1 | refs/heads/master | 2021-01-23T20:13:26.717676 | 2013-08-15T04:10:05 | 2013-08-15T06:31:30 | 32,659,775 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,112 | java | /*******************************************************************************
* Copyright (c) 2010 BSI Business Systems Integration 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:
* BSI Business Systems Integration AG - initial API and implementation
******************************************************************************/
package net.sakilapp.server.services.custom.security;
import java.security.AllPermission;
import java.security.Permissions;
import org.eclipse.scout.rt.server.services.common.security.AbstractAccessControlService;
public class AccessControlService extends AbstractAccessControlService {
@Override
protected Permissions execLoadPermissions() {
Permissions permissions = new Permissions();
//TODO feduser fill access control service
permissions.add(new AllPermission());
return permissions;
}
}
| [
"dev@jmini.fr"
] | dev@jmini.fr |
300282dfbba4092d524f74eefd1e361a49ea0139 | a5161c5e7ceda6bb7e9ecf4252d64ca1776043c5 | /runoob-java-example/ConditonalOperator.java | 1831f2bed1469f34a253d382d9cf3fc3d1094195 | [] | no_license | vaithwee/java-tutorial-demo | ca4a1c971eb368f7c195153f47c8d6b6a5a7783d | 936be64ead9b6aa897d95da657d85a7e7be5442f | refs/heads/master | 2020-03-31T17:59:00.868644 | 2018-11-28T15:34:33 | 2018-11-28T15:34:33 | 152,441,537 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 275 | java | public class ConditonalOperator {
public static void main(String[] args) {
int a = 10;
int b;
b = (a==1)?20:30;
System.out.println("value of b is " + b);
b = (a==10)?20:30;
System.out.println("value of b is " + b);
}
} | [
"vaithwee@yeah.net"
] | vaithwee@yeah.net |
f5a02603c8ad08fb39ab5793a891cd594a83a697 | 98afa6b600ca438c04f4084dc56e61f871c8bcb9 | /hms-data/src/main/java/com/urt/persistence/impl/subscription/SubscriptionDaoHibernate.java | 6589823d8c6b9ea110019f9c048db8e932a68bd0 | [] | no_license | RaviThejaGoud/hospital | 88d2f4fc8c3152af2411d0a8f722e7528e6a008d | 55a4a51f31b988d82c432474e62fde611f5622d8 | refs/heads/master | 2021-04-10T01:18:30.174761 | 2018-03-19T15:47:09 | 2018-03-19T15:47:09 | 125,875,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 988 | java | package com.urt.persistence.impl.subscription;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import com.churchgroup.util.object.ObjectFunctions;
import com.urt.persistence.impl.base.UniversalHibernateDao;
import com.urt.persistence.interfaces.subscription.SubscriptionDao;
import com.urt.persistence.model.customer.Customer;
import com.urt.util.common.RayGunException;
@Transactional
public class SubscriptionDaoHibernate extends UniversalHibernateDao implements SubscriptionDao {
public List<Customer> findExistCustomer(String keyWord) {
try{
List customerList=this.getAllHqlQuery("from Customer where custEmail='"+keyWord+"'");
if(!ObjectFunctions.isNullOrEmpty(customerList)){
return (List<Customer>) customerList;
}
}catch (Exception ex) {
ex.printStackTrace();RayGunException raygex = new RayGunException();raygex.sendRayGunException(ex);raygex=null;
}
return null;
}
}
| [
"ravisiva523@gmail.com"
] | ravisiva523@gmail.com |
b97fe3616eee4e20f4b848674bce694780555d48 | 09e2be2a1f2ce62c1b4dda21654af2c5eac99866 | /src/main/java/com/saas/socialmedia/web/rest/vm/ManagedUserVM.java | b16d876db5423634ed591bb6776995ef8bce705d | [] | no_license | Sree1894/SocialMediaManagement-Repo | b67ffe7480013fa85882e1f49ef17a7feb9db295 | f1dd415f23cd0fe01b1fb81ed1bc5eb2b8d3df8d | refs/heads/master | 2022-12-22T03:01:23.624200 | 2020-02-14T09:58:11 | 2020-02-14T09:58:11 | 240,477,790 | 0 | 0 | null | 2022-12-16T05:12:49 | 2020-02-14T09:57:56 | Java | UTF-8 | Java | false | false | 834 | java | package com.saas.socialmedia.web.rest.vm;
import com.saas.socialmedia.service.dto.UserDTO;
import javax.validation.constraints.Size;
/**
* View Model extending the UserDTO, which is meant to be used in the user management UI.
*/
public class ManagedUserVM extends UserDTO {
public static final int PASSWORD_MIN_LENGTH = 4;
public static final int PASSWORD_MAX_LENGTH = 100;
@Size(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH)
private String password;
public ManagedUserVM() {
// Empty constructor needed for Jackson.
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "ManagedUserVM{" + super.toString() + "} ";
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
42d291182619726aae5c9f8b5b6ac06744cb1907 | 42c50e58c738d67fd65105172c3291fbedfc1ecb | /src/com/szit/arbitrate/client/utils/ClientUtils.java | 4d0d65bed361e78f4a3168d2a1047a826fd3fc97 | [] | no_license | xmxnkj/interact | 44860df5ad4550f972c26a5bab32460d9228d5c2 | f97b4631fc6bffcfc4606cac36286e6e59165f4e | refs/heads/master | 2020-08-08T20:31:53.681178 | 2019-01-10T07:33:31 | 2019-01-10T07:33:31 | 213,910,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,399 | java | package com.szit.arbitrate.client.utils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.hsit.common.utils.CommonUtil;
import com.szit.arbitrate.client.entity.Client;
import com.szit.arbitrate.client.service.ClientService;
public class ClientUtils {
@Autowired
private ClientService clientService;
public static boolean isLoginSessionTheSame(HttpServletRequest request){
HttpSession session = request.getSession();
String clientId = (String) session.getAttribute("clientId");
HttpSession newSession = null;
if(CommonUtil.sessionMap.containsKey(clientId)){
newSession = CommonUtil.sessionMap.get(clientId);
}
if(session.getId().equals(newSession.getId())){
return true;
}else{
return false;
}
}
public String isLoginSessionOnline(HttpServletRequest request){
HttpSession session = request.getSession();
String clientId = (String) session.getAttribute("clientId");
if(StringUtils.isEmpty(clientId)){
return "";
}
Client client = clientService.getById(clientId);
String requestSessionId = session.getId();
if(requestSessionId.equals(client.getSessionId()==null?"":client.getSessionId())){
return clientId;
}else{
return "";
}
}
}
| [
"chenwu0@aliyun.com"
] | chenwu0@aliyun.com |
39cd12fd0e644b44848b9083bd7620aa6683d8c9 | bb97c227560600a09d59dda8f5608ff1b460f177 | /src/POS/bir_session/a.java | a93237fc8cd2893337f6e5cf235785a5f8a70741 | [] | no_license | yespickmeup/Kwikdel | e1c6ee1833336bc21fa1d2697016f52d914a4dae | 95c947aef087b296d99e14a9bef455cfab196ac4 | refs/heads/master | 2021-01-10T01:12:51.706614 | 2016-09-13T04:22:16 | 2016-09-13T04:22:16 | 51,805,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 549 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package POS.bir_session;
import POS.util.DateUtils;
import java.util.Date;
/**
*
* @author Maytopacka
*/
public class a {
public static void main(String[] args) {
Date now = new Date();
Date a=new Date();
DateUtils.add_day(a, -2);
System.out.println(a + " - "+now);
int count = DateUtils.count_days(a, now);
System.out.println(count);
}
}
| [
"rpascua.synsoftech@gmail.com"
] | rpascua.synsoftech@gmail.com |
e00ec16261485400e7eca763ccc7395231bd6760 | 3dbda028a27190c4e9614c1cfffa751458d398c8 | /Spring/SpringPro2/src/test/java/cn/zhen77/test/SpringTest.java | d684705d010c0275f6232597b3159896d8559140 | [] | no_license | Zhen7-7/FrameWork | 264c372cd31ed6a98170520a9f1d47ad102dd8a1 | 87c07e9fc97b9fec70419ac5862eebb4941f5c50 | refs/heads/master | 2023-05-07T06:33:05.177730 | 2021-05-25T10:36:16 | 2021-05-25T10:36:16 | 331,942,347 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,683 | java | package cn.zhen77.test;
import cn.zhen77.aop.proxy01.UserService;
import cn.zhen77.aop.proxy01.UserServiceImpl;
import cn.zhen77.aop.proxy01.UserServiceProxy;
import cn.zhen77.aop.proxy02.JDKProxy;
import cn.zhen77.aop.proxy02.StudentService;
import cn.zhen77.aop.proxy02.StudentServiceImpl;
import cn.zhen77.aop.proxy03.CGLibproxy;
import cn.zhen77.aop.proxy03.UserSub;
import cn.zhen77.aop.proxy03.UserSuper;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* @author : zhen77
* @date: 2021/1/30 - 01 - 30 - 17:17
* @Description: cn.zhen77.test
* @version: 1.0
*/
public class SpringTest{
@Test
public void test() throws Exception {
ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
UserService usi = (UserService) app.getBean("usi");
usi.add();
usi.delet();
}
@Test
public void test1() throws Exception {
ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
UserService userService= (UserService)app.getBean("proxy");
userService.add();
userService.delet();
}
@Test
public void test2() throws Exception{
ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
JDKProxy jdkProxy = (JDKProxy) app.getBean("jdkproxy");
StudentService student = (StudentService)jdkProxy.createProxyInstance(new StudentServiceImpl());
student.add();
UserService user = (UserService) jdkProxy.createProxyInstance( new UserServiceImpl());
user.add();
user.delet();
}
@Test
public void test3(){
ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
CGLibproxy cglibproy = (CGLibproxy) app.getBean("cglibproxy");
UserSuper userSuper = (UserSuper) cglibproy.createProxyInstance(new UserSub());
userSuper.add();
}
@Test
public void test4() throws Exception {
ApplicationContext app = new ClassPathXmlApplicationContext("applicationSpring.xml");
cn.zhen77.aop.springxml.UserService user = (cn.zhen77.aop.springxml.UserService) app.getBean("usi");
user.add();
user.delete();
}
@Test
public void test5()throws Exception{
ApplicationContext app = new ClassPathXmlApplicationContext("applicationAspectj.xml");
cn.zhen77.aop.springaspectj.UserService user = (cn.zhen77.aop.springaspectj.UserService) app.getBean("userServiceImpl");
user.add();
user.delete();
}
}
| [
"Zhen18103690519@gmail.com"
] | Zhen18103690519@gmail.com |
7c78410b23d29511027440c7f50118e7cb23e4b3 | 5585d7f4a78f5158121e0d0ec127427e888f3ca7 | /generator/src/test/java/org/stjs/generator/writer/fields/Fields25.java | 163a229b3a856b8774d5ad265966cdaff8a08cfe | [
"Apache-2.0"
] | permissive | mcanthony/st-js | d22076cc029326da07170d13aaf74a18faddd416 | 27b78d8197d19d07bcf3b8fbb2b5ade6097c9dab | refs/heads/master | 2020-12-11T07:38:18.725689 | 2015-10-21T10:17:36 | 2015-10-21T10:17:36 | 45,141,051 | 2 | 0 | null | 2015-10-28T20:51:14 | 2015-10-28T20:51:14 | null | UTF-8 | Java | false | false | 261 | java | package org.stjs.generator.writer.fields;
import org.stjs.javascript.annotation.Template;
public class Fields25 {
@Template("property")
public int field;
public static void main(String[] args) {
Fields25 obj = new Fields25();
int n = obj.field;
}
}
| [
"ax.craciun@gmail.com"
] | ax.craciun@gmail.com |
2e8b35cfe19787e6c38410e359d5ec44839fe886 | 10d77fabcbb945fe37e15ae438e360a89a24ea05 | /graalvm/transactions/fork/narayana/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/reaper/ReaperTestCase.java | c81ef220bad8e84168a0731c778212316162bbaf | [
"LGPL-2.1-only",
"Apache-2.0",
"LGPL-2.1-or-later",
"LicenseRef-scancode-other-copyleft"
] | permissive | nmcl/scratch | 1a881605971e22aa300487d2e57660209f8450d3 | 325513ea42f4769789f126adceb091a6002209bd | refs/heads/master | 2023-03-12T19:56:31.764819 | 2023-02-05T17:14:12 | 2023-02-05T17:14:12 | 48,547,106 | 2 | 1 | Apache-2.0 | 2023-03-01T12:44:18 | 2015-12-24T15:02:58 | Java | UTF-8 | Java | false | false | 7,729 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2007, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* 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,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* (C) 2007,
* @author JBoss, a division of Red Hat.
*/
package com.hp.mwtests.ts.arjuna.reaper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.util.SortedSet;
import java.util.TreeSet;
import org.jboss.byteman.contrib.bmunit.BMScript;
import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.arjuna.ats.arjuna.common.Uid;
import com.arjuna.ats.arjuna.coordinator.Reapable;
import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
import com.arjuna.ats.internal.arjuna.coordinator.ReaperElement;
/**
* Exercises some aspects of the TransactionReaper functionality.
*
* @author jonathan.halliday@redhat.com, 2007-04-30
*/
@RunWith(BMUnitRunner.class)
@BMScript("reaper")
public class ReaperTestCase extends ReaperTestCaseControl
{
@Test
public void testReaper() throws Exception
{
TransactionReaper reaper = TransactionReaper.transactionReaper();
Reapable reapable = new MockReapable(new Uid());
Reapable reapable2 = new MockReapable(new Uid());
Reapable reapable3 = new MockReapable(new Uid());
ReaperElement reaperElement = new ReaperElement(reapable, 30);
ReaperElement reaperElement2 = new ReaperElement(reapable2, 20);
ReaperElement reaperElement3 = new ReaperElement(reapable3, 10);
// test that ordering is by timeout, regardless of insertion order
SortedSet sortedSet = new TreeSet();
sortedSet.add(reaperElement);
sortedSet.add(reaperElement3);
sortedSet.add(reaperElement2);
assertEquals(sortedSet.first(), reaperElement3);
assertEquals(sortedSet.last(), reaperElement);
// test insertion of timeout=0 is a nullop
reaper.insert(reapable, 0);
assertEquals(0, reaper.numberOfTransactions());
assertEquals(0, reaper.numberOfTimeouts());
reaper.remove(reapable);
// test that duplicate insertion fails
reaper.insert(reapable, 10);
assertEquals(1, reaper.numberOfTransactions());
assertEquals(1, reaper.numberOfTimeouts());
try {
reaper.insert(reapable, 10);
fail("duplicate insert failed to blow up");
} catch(Exception e) {
}
reaper.remove(reapable);
assertEquals(0, reaper.numberOfTransactions());
assertEquals(0, reaper.numberOfTimeouts());
// test that timeout change fails
reaper.insert(reapable, 10);
try {
reaper.insert(reapable, 20);
fail("timeout change insert failed to blow up");
} catch(Exception e) {
}
assertEquals(1, reaper.numberOfTransactions());
assertEquals(1, reaper.numberOfTimeouts());
assertEquals(10, reaper.getTimeout(reapable));
reaper.remove(reapable);
assertEquals(0, reaper.numberOfTransactions());
assertEquals(0, reaper.numberOfTimeouts());
// enable a repeatable rendezvous before checking the reapable queue
enableRendezvous("reaper1", true);
// enable a repeatable rendezvous before scheduling a reapable in the worker queue for cancellation
enableRendezvous("reaper2", true);
// enable a repeatable rendezvous before checking the worker queue
enableRendezvous("reaperworker1", true);
// test reaping
reaper.insert(reapable, 1); // seconds
reaper.insert(reapable2, 2);
// the reaper will be latched before it processes any of the reapables
triggerRendezvous("reaper1");
assertEquals(2, reaper.numberOfTransactions());
assertEquals(2, reaper.numberOfTimeouts());
// ensure we have waited at lest 1 second so the first reapable is timed out
triggerWait(1000);
// let the reaper proceed with the dequeue and add the entry to the work queue
triggerRendezvous("reaper1");
triggerRendezvous("reaper2");
triggerRendezvous("reaper2");
// now latch the reaper worker at the dequeue
triggerRendezvous("reaperworker1");
// we shoudl still have two reapables in the reaper queue
assertEquals(2, reaper.numberOfTransactions());
assertEquals(2, reaper.numberOfTimeouts());
// now let the worker process the work queue element -- it should not call cancel since the
// mock reapable will not claim to be running
triggerRendezvous("reaperworker1");
// latch the reaper and reaper worker before they check their respective queues
// latch the reaper before it dequeues the next reapable
triggerRendezvous("reaper1");
triggerRendezvous("reaperworker1");
// we should now have only 1 element in the reaper queue
assertEquals(1, reaper.numberOfTransactions());
assertEquals(1, reaper.numberOfTimeouts());
// ensure we have waited at lest 1 second so the second reapable is timed out
triggerWait(1000);
// now let the reaper proceed with the next dequeue and enqueue the reapable for the worker to process
triggerRendezvous("reaper1");
triggerRendezvous("reaper2");
triggerRendezvous("reaper2");
// relatch the reaper next time round the loop so we can be sure it is not monkeying around
// with the transactions queue
triggerRendezvous("reaper1");
// the worker is still latched so we should still have one entry in the work queue
assertEquals(1, reaper.numberOfTransactions());
assertEquals(1, reaper.numberOfTimeouts());
// now let the worker process the work queue element -- it should not call cancel since the
// mock reapable wil not claim to be running
triggerRendezvous("reaperworker1");
// latch reaper worker again so we know it has finished processing the element
triggerRendezvous("reaperworker1");
assertEquals(0, reaper.numberOfTransactions());
assertEquals(0, reaper.numberOfTimeouts());
}
public class MockReapable implements Reapable
{
public MockReapable(Uid uid)
{
this.uid = uid;
}
public boolean running()
{
return false; //To change body of implemented methods use File | Settings | File Templates.
}
public boolean preventCommit()
{
return false; //To change body of implemented methods use File | Settings | File Templates.
}
public int cancel()
{
return 0; //To change body of implemented methods use File | Settings | File Templates.
}
public Uid get_uid()
{
return uid;
}
private Uid uid;
}
}
| [
"mlittle@redhat.com"
] | mlittle@redhat.com |
b0dfb2a4256a8e98633233a31b7cb5cc0a8685a0 | 844278ef535f10214b471008bc76b212c8ca2d7b | /src/main/java/Algorithm/Solutions/LeetCode/LeetCode43.java | 7b0bf3c975da0ade1b31f85e4e2c237bfa29d2bd | [] | no_license | Sunxy88/PracticingCoding | 3dd510a54d50f90acfe8506a196c12ae28cbf217 | 73027bc56cabc24d39ac8cc8c18bf1665504453f | refs/heads/master | 2023-08-29T13:26:01.981206 | 2021-10-22T12:55:14 | 2021-10-22T12:55:14 | 255,333,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,609 | java | package Algorithm.Solutions.LeetCode;
public class LeetCode43 {
public String multiply(String num1, String num2) {
if (num1 == null || num2 == null || num1.length() == 0 || num2.length() == 0)
return "0";
if (num1.equals("0") || num2.equals("0"))
return "0";
String res = "0";
for (int i = num2.length() - 1; i >= 0; i--) {
int carry = 0;
StringBuilder sb = new StringBuilder();
for (int j = 0; j < num2.length() - 1 - i; j++)
sb.append(0);
int n2 = num2.charAt(i) - '0';
for (int j = num1.length() - 1; j >= 0 || carry != 0; j--) {
int n1 = j < 0 ? 0 : num1.charAt(j) - '0';
int product = (n1 * n2 + carry) % 10;
sb.append(product);
carry = (n1 * n2 + carry) / 10;
}
res = addStrings(res, sb.reverse().toString());
}
return res;
}
private String addStrings(String num1, String num2) {
if (num1.equals("0"))
return num2;
if (num2.equals("0"))
return num1;
StringBuilder sb = new StringBuilder();
int carry = 0;
for (int i = num1.length() - 1, j = num2.length() - 1; i >=0 || j >= 0 || carry != 0; i--, j--) {
int x = i < 0 ? 0 : num1.charAt(i) - '0';
int y = j < 0 ? 0 : num2.charAt(j) - '0';
int sum = (x + y + carry) % 10;
sb.append(sum);
carry = (x + y + carry) / 10;
}
return sb.reverse().toString();
}
}
| [
"sungxisx@icloud.com"
] | sungxisx@icloud.com |
7871947a8cc9a183d1d48fbdf4507df8a0f9e1b5 | 1b50fe1118a908140b6ba844a876ed17ad026011 | /core/src/main/java/org/narrative/network/core/security/NarrativeAuthenticationToken.java | a95738f742e1326a7c52c2f79485725735c1b079 | [
"MIT"
] | permissive | jimador/narrative | a6df67a502a913a78cde1f809e6eb5df700d7ee4 | 84829f0178a0b34d4efc5b7dfa82a8929b5b06b5 | refs/heads/master | 2022-04-08T13:50:30.489862 | 2020-03-07T15:12:30 | 2020-03-07T15:12:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,138 | java | package org.narrative.network.core.security;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import java.util.Collection;
/**
* Post-authentication token which contains the {@link org.narrative.network.core.security.NarrativeUserDetails}
* generated during authentication.
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class NarrativeAuthenticationToken extends AbstractAuthenticationToken {
private static final long serialVersionUID = -1L;
private final NarrativeUserDetails principal;
@Builder
public NarrativeAuthenticationToken(Collection<? extends GrantedAuthority> authorities, NarrativeUserDetails principal, boolean isAuthenticated) {
super(authorities);
this.principal = principal;
this.setAuthenticated(isAuthenticated);
}
@Override
public String getCredentials() {
return principal != null ? principal.getPassword() : null;
}
}
| [
"brian@narrative.org"
] | brian@narrative.org |
0bef866a0da69bd3d3c689ae58657bf5235b51ea | f4fc6069155b1e8c765c0cb9ef19195cbee3c18e | /Week_01/206.reverse-linked-list3.java | 088e5a1b5a5edf35c25856ff3e202413e5868b2d | [] | no_license | jiayouxujin/AlgorithmQIUZHAO | 18962b0299d7b113fc20b749a31dcee66aec8b15 | 5b92e3c1dffda21147a9611f82479e2ae2f98b08 | refs/heads/master | 2022-12-17T00:12:07.935694 | 2020-09-18T11:22:44 | 2020-09-18T11:22:44 | 279,088,950 | 0 | 0 | null | 2020-07-12T15:07:21 | 2020-07-12T15:07:20 | null | UTF-8 | Java | false | false | 663 | java | /*
* @lc app=leetcode id=206 lang=java
*
* [206] Reverse Linked List
*/
// @lc code=start
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode() {}
* ListNode(int val) { this.val = val; }
* ListNode(int val, ListNode next) { this.val = val; this.next = next; }
* }
*/
class Solution {
public ListNode reverseList(ListNode head) {
ListNode newHead=null;
while(head!=null){
ListNode current=head.next;
head.next=newHead;
newHead=head;
head=current;
}
return newHead;
}
}
// @lc code=end
| [
"1319039722@qq.com"
] | 1319039722@qq.com |
3806796287939a74e3cb3a4564eecdfde4a2b94e | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /eclipseswt_cluster/29871/tar_0.java | 30cb626f4609dd32f7501f6d422fecb5226d1097 | [] | no_license | martinezmatias/GenPat-data-C3 | 63cfe27efee2946831139747e6c20cf952f1d6f6 | b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4 | refs/heads/master | 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,042 | java | /*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.widgets;
import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.*;
public class TreeColumn extends Item {
Tree parent;
int width;
boolean resizable = true;
public TreeColumn (Tree parent, int style) {
this (parent, style, checkNull (parent).getColumnCount ());
}
public TreeColumn (Tree parent, int style, int index) {
super (parent, checkStyle (style), index);
if (!(0 <= index && index <= parent.getColumnCount ())) error (SWT.ERROR_INVALID_RANGE);
this.parent = parent;
parent.addColumn (this, index);
}
public void addControlListener (ControlListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Resize, typedListener);
addListener (SWT.Move, typedListener);
}
public void addSelectionListener (SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection, typedListener);
addListener (SWT.DefaultSelection, typedListener);
}
static Tree checkNull (Tree tree) {
if (tree == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
return tree;
}
static int checkStyle (int style) {
return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
}
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
public void dispose () {
if (isDisposed ()) return;
Rectangle parentBounds = parent.getClientArea ();
int x = getX ();
Tree parent = this.parent;
dispose (true);
int width = parentBounds.width - x;
parent.redraw (x, 0, width, parentBounds.height, false);
if (parent.getHeaderVisible ()) {
parent.header.redraw (x, 0, width, parent.getHeaderHeight (), false);
}
}
void dispose (boolean notifyParent) {
super.dispose (); /* the use of super is intentional here */
if (notifyParent) parent.removeColumn (this);
parent = null;
}
public int getAlignment () {
checkWidget ();
if ((style & SWT.CENTER) != 0) return SWT.CENTER;
if ((style & SWT.RIGHT) != 0) return SWT.RIGHT;
return SWT.LEFT;
}
int getIndex () {
TreeColumn[] columns = parent.getColumns ();
for (int i = 0; i < columns.length; i++) {
if (columns[i] == this) return i;
}
return -1;
}
public Tree getParent () {
checkWidget ();
return parent;
}
int getPreferredWidth () {
if (!parent.getHeaderVisible ()) return 0;
return 0; // TODO
}
public boolean getResizable () {
checkWidget ();
return resizable;
}
public int getWidth () {
checkWidget ();
return width;
}
int getX () {
int index = getIndex ();
int result = -parent.horizontalOffset;
for (int i = 0; i < index; i++) {
result += parent.columns [i].width;
}
return result;
}
void paint (GC gc) {
int padding = parent.getHeaderPadding ();
int x = getX ();
int startX = x + padding;
if ((style & SWT.LEFT) == 0) {
int contentWidth = gc.textExtent (text, SWT.DRAW_MNEMONIC).x;
if (image != null) {
contentWidth += image.getBounds ().width + Tree.MARGIN_IMAGE;
}
if ((style & SWT.RIGHT) != 0) {
startX = Math.max (startX, x + width - padding - contentWidth);
} else { /* SWT.CENTER */
startX = Math.max (startX, x + (width - contentWidth) / 2);
}
}
int headerHeight = parent.getHeaderHeight ();
/* restrict the clipping region to the header cell */
gc.setClipping (
x + padding,
padding,
width - 2 * padding,
headerHeight - 2 * padding);
if (image != null) {
Rectangle imageBounds = image.getBounds ();
int drawHeight = Math.min (imageBounds.height, headerHeight - 2 * padding);
gc.drawImage (
image,
0, 0,
imageBounds.width, imageBounds.height,
startX, (headerHeight - drawHeight) / 2,
imageBounds.width, drawHeight);
startX += imageBounds.width + Tree.MARGIN_IMAGE;
}
if (text.length () > 0) {
int fontHeight = parent.fontHeight;
gc.drawText (text, startX, (headerHeight - fontHeight) / 2, SWT.DRAW_MNEMONIC);
}
}
public void pack () {
checkWidget ();
TreeItem[] availableItems = parent.availableItems;
if (availableItems.length == 0) return;
int index = getIndex ();
int width = getPreferredWidth ();
for (int i = 0; i < availableItems.length; i++) {
width = Math.max (width, availableItems [i].getPreferredWidth (index));
}
parent.updateColumnWidth (this, width);
}
public void removeControlListener (ControlListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null) return;
eventTable.unhook (SWT.Move, listener);
eventTable.unhook (SWT.Resize, listener);
}
public void removeSelectionListener (SelectionListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
removeListener (SWT.Selection, listener);
removeListener (SWT.DefaultSelection, listener);
}
public void setAlignment (int alignment) {
checkWidget ();
if (getIndex () == 0) return; /* column 0 can only have left-alignment */
if ((style & alignment) != 0) return; /* same value */
style &= ~(SWT.LEFT | SWT.CENTER | SWT.RIGHT);
style |= alignment;
int x = getX ();
parent.redraw (x, 0, width, parent.getClientArea ().height, false);
if (parent.getHeaderVisible ()) {
parent.header.redraw (x, 0, width, parent.getHeaderHeight (), false);
}
}
public void setImage (Image value) {
checkWidget ();
if (value == image) return;
if (value != null && value.equals (image)) return; /* same value */
super.setImage (value);
/*
* If this is the first image being put into the header then the header
* height may be adjusted, in which case a full redraw is needed.
*/
if (parent.headerImageHeight == 0) {
int oldHeaderHeight = parent.getHeaderHeight ();
parent.setHeaderImageHeight (value.getBounds ().height);
if (oldHeaderHeight != parent.getHeaderHeight ()) {
parent.header.redraw ();
parent.redraw ();
return;
}
}
parent.header.redraw (getX (), 0, width, parent.getHeaderHeight (), false);
}
public void setResizable (boolean value) {
checkWidget ();
resizable = value;
}
public void setText (String value) {
checkWidget ();
if (value == null) error (SWT.ERROR_NULL_ARGUMENT);
if (value.equals (text)) return; /* same value */
super.setText (value);
parent.header.redraw (getX (), 0, width, parent.getHeaderHeight (), false);
}
public void setWidth (int value) {
checkWidget ();
if (width == value) return; /* same value */
parent.updateColumnWidth (this, value);
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
dd796d48d8e3ae088d09d368f6b13df758da8bf0 | 5b0c5bc2d609615522a2b3cf1085899a9f3f59b4 | /ExcelConversionDatabase/src/MySqlConversion.java | 4d6eb20f2ea7e5e456f512284cf209169e3a322d | [] | no_license | clncon/javaweb | b21aee9744f9a68b6f55770e947c33208854215e | ac88a572bbe50e1c8552487758dcd0c2973cf133 | refs/heads/master | 2020-12-14T06:17:21.931227 | 2017-03-04T02:35:56 | 2017-03-04T02:35:56 | 83,633,624 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 4,595 | java | import java.util.regex.*;
import java.util.*;
import java.io.*;
import java.sql.*;
public class MySqlConversion {
public static void main(String[] args) {
Connection conn = null;
Statement stat = null;
PreparedStatement pstat = null;
ResultSet rs = null;
String sql = "create table student(Id int(11) primary key, Name varchar(20), Gender varchar(5), myClass varchar(20), English int(11), Math int(11), Chinese int(11))";
String regex = ",([^,]*)(?=,)";
File file = new File("H://Student.csv");
BufferedReader br = null;
FileReader fr = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost/mydb3", "root", "root");
//删除表,创建表语句
stat = conn.createStatement();
try {
stat.execute("drop table Student");
} catch (SQLException e) {
System.out.println("初始删表失败!");
}
stat.execute(sql);
fr = new FileReader(file);
br = new BufferedReader(fr);
//标题
String aaa = br.readLine();
System.out.println(aaa);
//pstat = conn.prepareStatement("insert into Student (ksh,xm,xb,xh,xzb,zymc,xy,sfzh,cc,xz,tddw,wyyzdm,dqdm,kslb,mz,zzmm,csrq,ks,kstz,tc,lxdh,yzbm,jtdz,byzx) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
int count = 0;
while ((aaa=br.readLine()) != null) {
int i = 0;
boolean flag = true;
pstat = conn.prepareStatement("insert into student (Id, Name, Gender, myClass, English, Math, Chinese) values (?, ?, ?, ?, ?, ?, ?)");
//pstat = conn.prepareStatement("insert into Student (ksh,xm,xb,xh,xzb,zymc,xy,sfzh,cc,xz,tddw,wyyzdm,dqdm,kslb,mz,zzmm,csrq,ks,kstz,tc,lxdh,yzbm,jtdz,byzx) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
aaa = ","+aaa+",";
// System.out.println(aaa);
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(aaa);
matcher.find();
while (matcher.find()) {
String temp = matcher.group(1);
//System.out.println((i+1) + " " + temp);
++i;
if (i == 4) {
pstat.setObject(1, temp);
}
if (i == 2) {
pstat.setObject(2, temp);
}
if (i == 3) {
pstat.setObject(3, temp);
}
/*if (i == 5) {
if (temp.endsWith("班")) {
int position = temp.length()-2;
String classStr = "0" + temp.substring(position);
System.out.println("班级 : " + classStr);
pstat.setObject(4, classStr);
} else {
flag = false;
break;
}
} */
if (i == 5) {
if(count <= 50) {
temp = "01班";
} else if (count<=100) {
temp = "02班";
} else if (count<=150) {
temp = "03班";
} else if (count<=200) {
temp = "04班";
} else if (count<=250) {
temp = "05班";
} else if (count<=300) {
temp = "06班";
} else if (count<=350) {
temp = "07班";
} else if (count<=400) {
temp = "08班";
} else if (count<=450) {
temp = "09班";
} else if (count<=500) {
temp = "10班";
}
pstat.setObject(4, temp);
}
//break;
int english = (int)(Math.random()*50+51);
int math = (int)(Math.random()*50+51);
int chinese = (int)(Math.random()*50+51);
pstat.setInt(5, english);
pstat.setInt(6, math);
pstat.setInt(7, chinese);
//
//
//// pstat.setString(i, temp);
//// System.out.println(i + " " + temp);
// if (i>=24) break;
}
// if (flag) {
//
// pstat.executeUpdate();
// }
pstat.executeUpdate();
pstat.close();
pstat = null;
count++;
System.out.println("正插入第" + count + "条记录!");
if (count > 500) {
break;
}
}
} catch (ClassNotFoundException e) {
System.out.println("缺少Oracle驱动程序!");
} catch (SQLException e) {
//System.out.println("Oracle执行出错!");
e.printStackTrace();
} catch (FileNotFoundException e) {
//e.printStackTrace();
System.out.println("读取文件不存在!");
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (stat != null) {
stat.close();
}
if (conn != null) {
conn.close();
}
} catch (SQLException e) {
System.out.println("连接关闭错误");
}
}
}
}
| [
"clncon@163.com"
] | clncon@163.com |
7ea4ad4a3f3f5a485cb3b1fd74263197e78aaccf | dfe5caf190661c003619bfe7a7944c527c917ee4 | /src/main/java/com/vmware/vim25/ClusterComputeResourceHCIConfigInfo.java | b44f0bcd869d95743d4270534d1147160dc86c1b | [
"BSD-3-Clause"
] | permissive | timtasse/vijava | c9787f9f9b3116a01f70a89d6ea29cc4f6dc3cd0 | 5d75bc0bd212534d44f78e5a287abf3f909a2e8e | refs/heads/master | 2023-06-01T08:20:39.601418 | 2022-10-31T12:43:24 | 2022-10-31T12:43:24 | 150,118,529 | 4 | 1 | BSD-3-Clause | 2023-05-01T21:19:53 | 2018-09-24T14:46:15 | Java | UTF-8 | Java | false | false | 1,925 | java | package com.vmware.vim25;
import java.util.Arrays;
/**
* This data object captures a subset of initial configuration of the cluster, which was configured by calling the ConfigureHCI_Task method.
*
* @author Stefan Dilk <stefan.dilk@freenet.ag>
* @since 6.7.1
*/
public class ClusterComputeResourceHCIConfigInfo extends DynamicData {
private ManagedObjectReference[] configuredHosts;
private ClusterComputeResourceDVSSetting[] dvsSetting;
private ClusterComputeResourceHostConfigurationProfile hostConfigProfile;
private String workflowState;
@Override
public String toString() {
return "ClusterComputeResourceHCIConfigInfo{" +
"configuredHosts=" + Arrays.toString(configuredHosts) +
", dvsSetting=" + Arrays.toString(dvsSetting) +
", hostConfigProfile=" + hostConfigProfile +
", workflowState='" + workflowState + '\'' +
"} " + super.toString();
}
public ManagedObjectReference[] getConfiguredHosts() {
return configuredHosts;
}
public void setConfiguredHosts(final ManagedObjectReference[] configuredHosts) {
this.configuredHosts = configuredHosts;
}
public ClusterComputeResourceDVSSetting[] getDvsSetting() {
return dvsSetting;
}
public void setDvsSetting(final ClusterComputeResourceDVSSetting[] dvsSetting) {
this.dvsSetting = dvsSetting;
}
public ClusterComputeResourceHostConfigurationProfile getHostConfigProfile() {
return hostConfigProfile;
}
public void setHostConfigProfile(final ClusterComputeResourceHostConfigurationProfile hostConfigProfile) {
this.hostConfigProfile = hostConfigProfile;
}
public String getWorkflowState() {
return workflowState;
}
public void setWorkflowState(final String workflowState) {
this.workflowState = workflowState;
}
}
| [
"stefan.dilk@freenet.ag"
] | stefan.dilk@freenet.ag |
55d4dcd50d9dec7eee59bbe117379905499b78a9 | ca57c3651db75069fcbbb7c5190e6a328331660e | /src/com/siwuxie095/forme/designpattern/category/chapter2nd/example2nd/Main.java | e8c8181fc113c9ffbd306a0785a99972ec415167 | [] | no_license | gouyanzhan/HelloWorld | f915ec8eabf8878b0c01fb8ec29b869e6fd68c5f | 8cd9dc117d301d10207690052f2f27de2d9b9e2c | refs/heads/master | 2022-03-25T07:31:52.842092 | 2022-03-11T07:08:30 | 2022-03-11T07:08:30 | 164,224,001 | 1 | 1 | null | 2019-01-07T14:18:44 | 2019-01-05T14:52:23 | Java | UTF-8 | Java | false | false | 4,520 | java | package com.siwuxie095.forme.designpattern.category.chapter2nd.example2nd;
/**
* @author Jiajing Li
* @date 2019-08-11 14:22:43
*/
public class Main {
/**
* 认识观察者模式:
*
* 先来看看报纸和杂志的订阅是怎么回事:
* 1、报社的业务就是出版报纸;
* 2、向某家报社订阅报纸,只要他们有新报纸出版,就会给你送来。
* 只要你是他们的订户,你就会一直收到新报纸;
* 3、当你不想再看报纸的时候,取消订阅,他们就不会再送新报纸来;
* 4、只要报社还在运营,就会一直有人(或单位)向他们订阅报纸或
* 取消订阅报纸;
*
* 出版者 + 订阅者 = 观察者模式
* 如果你了解报纸的订阅是怎么回事,其实就知道观察者模式是怎么回
* 事,只是名称不太一样:出版者改称为 "主题"(Subject),订阅
* 者改称为 "观察者"(Observer)。
* 即:
* 主题对象管理某些数据。当主题内的数据改变就会通知观察者。观察
* 者已经订阅(注册)主题以便在主题数据改变时能够收到更新。
* 一旦数据改变,新的数据会以某种形式送到观察者手上。
*
* (出版-订阅 或 发布-订阅)
*
* 观察者模式:
* 定义对象之间的一对多依赖,这样一来,当一个对象改变状态时,它
* 的所有依赖者都会收到通知并自动更新。
*
* 主题和观察者定义了一对多的关系。观察者依赖于此主题,只要主题
* 状态一有变化,观察者就会被通知。根据通知的风格,观察者可能因
* 此新值而更新。
*
* 实现观察者模式的方法不止一种,但是以包含 Subject 与 Observer
* 接口的类设计的做法最常见。
*
* 问:
* 这和一对多的关系有何关联?
* 答:
* 利用观察者模式,主题是具有状态的对象,并且可以控制这些状态。
* 也就是说,有 "一个" 具有状态的主题。另一方面,观察者使用这
* 些状态,虽然这些状态并不属于他们。有许多的观察者,依赖主题
* 来告诉他们状态何时改变了。这就产生了一个关系:"一个" 主题对
* "多个" 观察者的关系。
*
* 问:
* 其间的依赖是如何产生的?
* 答:
* 因为主题是真正拥有数据的人,观察者是主题的依赖者,在数据变化
* 时更新,这样比起让许多对象控制同一份数据来,可以得到更干净的
* OO 设计。
*
*
*
* 松耦合的威力
*
* 当两个对象之间松耦合,它们依然可以交互,但是不太清楚彼此的细节。
* 观察者提供了一种对象设计,让主题和观察者之间松耦合。
*
* 为什么呢?
*
* 关于观察者的一切,主题只知道观察者实现了某个接口(也就是 Observer
* 接口)。主题不需要知道观察者的具体类是谁、做了些什么或其他任何细节。
*
* 任何时候都可以增加新的观察者。因为主题唯一依赖的东西是一个实现 Observer
* 接口的对象列表,所以可以随时增加新的观察者。事实上,在运行时可以用
* 新的观察者取代现有的观察者,主题不会受到任何影响。同样的,也可以在
* 任何时候删除某些观察者。
*
* 有新类型的观察者出现时,主题的代码不需要修改。假如有个新的具体类需要
* 当观察者,我们不需要为了兼容新类型而修改主题的代码,所有要做的就是在
* 新的类里实现此观察者接口,然后注册为观察者即可。主题不在乎别的,它只
* 会发送通知给所有实现了观察者接口的对象。
*
* 我们可以独立的复用主题和观察者。如果我们在其他地方需要使用主题或观察
* 者,可以轻易的复用,因为二者并非紧耦合。
*
*
*
* 九个 OO 原则之第四个设计原则:
* 为了交互对象之间的松耦合设计而努力。
*
* 松耦合的设计之所以能让我们建立又弹性的 OO 系统,能够应对变化,是因为
* 对象之间的互相依赖降到了最低。
*/
public static void main(String[] args) {
}
}
| [
"834879583@qq.com"
] | 834879583@qq.com |
7e2ba8026dbcc3401c21e5a8344804cda4f72816 | 84c8fcfacb3170a4b8ec442b852d5d4e542fab54 | /src/pack5/Test2.java | 5cf98f7c4e40078187c21b246502d1ae6ea98933 | [] | no_license | hyuneun/java3 | 6e2876f86ed1e4a9ec21a93c575597e387f23e6a | 507c82393a47d86d44c099555536f056cd601d5e | refs/heads/master | 2021-05-03T20:19:48.567180 | 2016-10-04T01:10:52 | 2016-10-04T01:10:52 | 69,923,687 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,225 | java | package pack5;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
public class Test2{
ArrayList<Test1> list = new ArrayList<>();
public void insert(File file) throws Exception{
BufferedReader br = new BufferedReader(new FileReader(file));
String oneline;
while((oneline = br.readLine()) != null){
String arr [] = oneline.split(",");
String a = arr[0] + "\t";
String b = arr[1] + "\t";
String c = arr[2] + "\t";
String d = arr[3] + "\t";
String e = arr[4] + "\t";
Test1 t1 = new Test1();
t1.setBun(a);
t1.setIrum(b);
t1.setBuya(c);
t1.setDeng(d);
t1.setTime(e);
list.add(t1);
}
br.close();
}
public void show(){
System.out.println("번호\t이름\t분야\t등록일\t\t시간");
for(Test1 t1: list){
System.out.println(t1.getBun() + t1.getIrum() + t1.getBuya() + t1.getDeng() + t1.getTime());
}
System.out.println("건수" + list.size() + "건");
}
public static void main(String[] args) throws Exception {
Test2 t2 = new Test2();
File file = new File("c:/work/kbs.csv");
t2.insert(file);
t2.show();
}
}
| [
"user@user-PC"
] | user@user-PC |
95af999621c8e56bfceb8b786a8e8de41e73a9b9 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/test/alluxio/server/ft/MultiWorkerIntegrationTest.java | 7224f1c79e4f3da137be76969c027f4bfbbd9cf4 | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 7,312 | java | /**
* The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
* (the "License"). You may not use this work except in compliance with the License, which is
* available at www.apache.org/licenses/LICENSE-2.0
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied, as more fully set forth in the License.
*
* See the NOTICE file distributed with this work for information regarding copyright ownership.
*/
package alluxio.server.ft;
import PropertyKey.Name;
import PropertyKey.USER_BLOCK_SIZE_BYTES_DEFAULT;
import PropertyKey.USER_FILE_BUFFER_BYTES;
import PropertyKey.WORKER_MEMORY_SIZE;
import PropertyKey.WORKER_TIERED_STORE_RESERVER_ENABLED;
import WritePType.MUST_CACHE;
import alluxio.AlluxioURI;
import alluxio.Constants;
import alluxio.client.block.BlockWorkerInfo;
import alluxio.client.file.FileInStream;
import alluxio.client.file.FileSystem;
import alluxio.client.file.FileSystemTestUtils;
import alluxio.client.file.URIStatus;
import alluxio.client.file.policy.FileWriteLocationPolicy;
import alluxio.client.file.policy.RoundRobinPolicy;
import alluxio.conf.AlluxioConfiguration;
import alluxio.grpc.CreateFilePOptions;
import alluxio.grpc.OpenFilePOptions;
import alluxio.testutils.BaseIntegrationTest;
import alluxio.testutils.LocalAlluxioClusterResource;
import alluxio.util.io.BufferUtils;
import alluxio.wire.WorkerNetAddress;
import java.util.stream.StreamSupport;
import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import static FindFirstFileWriteLocationPolicy.sWorkerAddress;
/**
* Tests a cluster containing multiple workers.
*/
public final class MultiWorkerIntegrationTest extends BaseIntegrationTest {
private static final int NUM_WORKERS = 4;
private static final int WORKER_MEMORY_SIZE_BYTES = Constants.MB;
private static final int BLOCK_SIZE_BYTES = (MultiWorkerIntegrationTest.WORKER_MEMORY_SIZE_BYTES) / 2;
public static class FindFirstFileWriteLocationPolicy implements FileWriteLocationPolicy {
// Set this prior to sending the create request to FSM.
private static WorkerNetAddress sWorkerAddress;
public FindFirstFileWriteLocationPolicy(AlluxioConfiguration alluxioConf) {
}
@Override
public WorkerNetAddress getWorkerForNextBlock(Iterable<BlockWorkerInfo> workerInfoList, long blockSizeBytes) {
return StreamSupport.stream(workerInfoList.spliterator(), false).filter(( x) -> x.getNetAddress().equals(FindFirstFileWriteLocationPolicy.sWorkerAddress)).findFirst().get().getNetAddress();
}
}
@Rule
public LocalAlluxioClusterResource mResource = new LocalAlluxioClusterResource.Builder().setProperty(WORKER_MEMORY_SIZE, MultiWorkerIntegrationTest.WORKER_MEMORY_SIZE_BYTES).setProperty(USER_BLOCK_SIZE_BYTES_DEFAULT, MultiWorkerIntegrationTest.BLOCK_SIZE_BYTES).setProperty(USER_FILE_BUFFER_BYTES, MultiWorkerIntegrationTest.BLOCK_SIZE_BYTES).setProperty(WORKER_TIERED_STORE_RESERVER_ENABLED, false).setNumWorkers(MultiWorkerIntegrationTest.NUM_WORKERS).build();
@Test
public void writeLargeFile() throws Exception {
int fileSize = (MultiWorkerIntegrationTest.NUM_WORKERS) * (MultiWorkerIntegrationTest.WORKER_MEMORY_SIZE_BYTES);
AlluxioURI file = new AlluxioURI("/test");
FileSystem fs = mResource.get().getClient();
FileSystemTestUtils.createByteFile(fs, file.getPath(), fileSize, CreateFilePOptions.newBuilder().setWriteType(MUST_CACHE).setFileWriteLocationPolicy(RoundRobinPolicy.class.getCanonicalName()).build());
URIStatus status = fs.getStatus(file);
Assert.assertEquals(100, status.getInAlluxioPercentage());
try (FileInStream inStream = fs.openFile(file)) {
Assert.assertEquals(fileSize, IOUtils.toByteArray(inStream).length);
}
}
@Test
@LocalAlluxioClusterResource.Config(confParams = { Name.USER_SHORT_CIRCUIT_ENABLED, "false", Name.USER_BLOCK_SIZE_BYTES_DEFAULT, "16MB", Name.USER_NETWORK_READER_CHUNK_SIZE_BYTES, "64KB", Name.WORKER_MEMORY_SIZE, "1GB" })
public void readRecoverFromLostWorker() throws Exception {
int offset = 17 * (Constants.MB);
int length = 33 * (Constants.MB);
int total = offset + length;
// creates a test file on one worker
AlluxioURI filePath = new AlluxioURI("/test");
createFileOnWorker(total, filePath, mResource.get().getWorkerAddress());
FileSystem fs = mResource.get().getClient();
try (FileInStream in = fs.openFile(filePath, OpenFilePOptions.getDefaultInstance())) {
byte[] buf = new byte[total];
int size = in.read(buf, 0, offset);
replicateFileBlocks(filePath);
mResource.get().getWorkerProcess().stop();
size += in.read(buf, offset, length);
Assert.assertEquals(total, size);
Assert.assertTrue(BufferUtils.equalIncreasingByteArray(offset, size, buf));
}
}
@Test
@LocalAlluxioClusterResource.Config(confParams = { Name.USER_SHORT_CIRCUIT_ENABLED, "false", Name.USER_BLOCK_SIZE_BYTES_DEFAULT, "4MB", Name.USER_NETWORK_READER_CHUNK_SIZE_BYTES, "64KB", Name.WORKER_MEMORY_SIZE, "1GB" })
public void readOneRecoverFromLostWorker() throws Exception {
int offset = 1 * (Constants.MB);
int length = 5 * (Constants.MB);
int total = offset + length;
// creates a test file on one worker
AlluxioURI filePath = new AlluxioURI("/test");
FileSystem fs = mResource.get().getClient();
createFileOnWorker(total, filePath, mResource.get().getWorkerAddress());
try (FileInStream in = fs.openFile(filePath, OpenFilePOptions.getDefaultInstance())) {
byte[] buf = new byte[total];
int size = in.read(buf, 0, offset);
replicateFileBlocks(filePath);
mResource.get().getWorkerProcess().stop();
for (int i = 0; i < length; i++) {
int result = in.read();
Assert.assertEquals(result, ((i + size) & 255));
}
}
}
@Test
@LocalAlluxioClusterResource.Config(confParams = { Name.USER_SHORT_CIRCUIT_ENABLED, "false", Name.USER_BLOCK_SIZE_BYTES_DEFAULT, "4MB", Name.USER_NETWORK_READER_CHUNK_SIZE_BYTES, "64KB", Name.WORKER_MEMORY_SIZE, "1GB" })
public void positionReadRecoverFromLostWorker() throws Exception {
int offset = 1 * (Constants.MB);
int length = 7 * (Constants.MB);
int total = offset + length;
// creates a test file on one worker
AlluxioURI filePath = new AlluxioURI("/test");
FileSystem fs = mResource.get().getClient();
createFileOnWorker(total, filePath, mResource.get().getWorkerAddress());
try (FileInStream in = fs.openFile(filePath, OpenFilePOptions.getDefaultInstance())) {
byte[] buf = new byte[length];
replicateFileBlocks(filePath);
mResource.get().getWorkerProcess().stop();
int size = in.positionedRead(offset, buf, 0, length);
Assert.assertEquals(length, size);
Assert.assertTrue(BufferUtils.equalIncreasingByteArray(offset, size, buf));
}
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
f1e618467f8261f174ae974e845ecdac07ab7b47 | 18c70f2a4f73a9db9975280a545066c9e4d9898e | /rtz/mirror/mirror-indication/src/main/java/com/aspire/common/DruidAutoConfiguration.java | aecc6785fa9d545cf7700c8e0043e0674b5ba536 | [] | no_license | iu28igvc9o0/cmdb_aspire | 1fe5d8607fdacc436b8a733f0ea44446f431dfa8 | 793eb6344c4468fe4c61c230df51fc44f7d8357b | refs/heads/master | 2023-08-11T03:54:45.820508 | 2021-09-18T01:47:25 | 2021-09-18T01:47:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,978 | java | package com.aspire.common;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.support.http.StatViewServlet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
import java.sql.SQLException;
@Configuration
@EnableConfigurationProperties(DruidProperties.class)
@ConditionalOnClass(DruidDataSource.class)
@ConditionalOnProperty(prefix = "druid", name = "url")
@AutoConfigureBefore(DataSourceAutoConfiguration.class)
public class DruidAutoConfiguration {
@Autowired private DruidProperties properties;
/**
* dataSource: 数据源bean. <br/>
* <p>
* 作者: Administrator
*
* @return DataSource
*/
@Bean public DataSource dataSource() {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setUrl(properties.getUrl());
dataSource.setUsername(properties.getUsername());
dataSource.setPassword(properties.getPassword());
if (properties.getInitialSize() > 0) {
dataSource.setInitialSize(properties.getInitialSize());
}
if (properties.getMaxActive() > 0) {
dataSource.setMaxActive(properties.getMaxActive());
}
if (properties.getMaxWait() > 0) {
dataSource.setMaxWait(properties.getMaxWait());
}
if (properties.getMinIdle() > 0) {
dataSource.setMinIdle(properties.getMinIdle());
}
if (properties.getValidationQuery() != null) {
dataSource.setValidationQuery(properties.getValidationQuery());
}
dataSource.setTestOnBorrow(properties.isTestOnBorrow());
try {
dataSource.init();
} catch (SQLException e) {
throw new RuntimeException(e);
}
return dataSource;
}
/**
* druidServlet: druid管理servlet. <br/>
* <p>
* 作者: Administrator
*
* @return ServletRegistrationBean
*/
@Bean public ServletRegistrationBean druidServlet() {
StatViewServlet druidServlet = new StatViewServlet();
ServletRegistrationBean druidServletRegistration = new ServletRegistrationBean();
druidServletRegistration.setServlet(druidServlet);
druidServletRegistration.addInitParameter("allow", "127.0.0.1");
druidServletRegistration.addUrlMappings("/druid/*");
return druidServletRegistration;
}
} | [
"jiangxuwen7515@163.com"
] | jiangxuwen7515@163.com |
c7a2bef0225aa483c7e0ef9ff227b95c4fbbc5a1 | 4a627a99cdf202019fa4088ca23316e9cc427e7b | /nyd-cash-base/nyd-cash-base-dao/src/test/java/com/tasfe/zh/base/dao/test/TestTmpUserDao.java | 9aaf9c5769b8f94075340b0ff87fd5355c6c8654 | [] | no_license | P79N6A/zlqb | 4bdcc62db76f8b4fdd4176c06812c9bd8ac2148b | 66a8781e74216ead7ea4969d89972c16e9d45b54 | refs/heads/master | 2020-07-13T14:18:36.941485 | 2019-08-26T12:22:20 | 2019-08-26T12:22:20 | 205,096,175 | 0 | 1 | null | 2019-08-29T06:30:30 | 2019-08-29T06:30:30 | null | UTF-8 | Java | false | false | 2,895 | java | package com.tasfe.zh.base.dao.test;
//import com.google.common.collect.Maps;
import com.tasfe.zh.base.dao.mybatis.plugins.page.MybatisPageRequest;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.*;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-db.xml"})
@Slf4j
//@Transactional
public class TestTmpUserDao {
@Autowired
private TmpUserDao tmpUserDao;
private List<TmpUser> getUsr(int count) {
List<TmpUser> users = new ArrayList<>();
for (int i = 0; i < count; i++) {
TmpUser tmpUser = new TmpUser();
tmpUser.setUsername("lp," + UUID.randomUUID().toString());
tmpUser.setPhoto("my photo path" + i);
users.add(tmpUser);
}
return users;
}
//@Transactional(readOnly=false)
@Test
public void testSave() {
TmpUser tmpUser = new TmpUser();
tmpUser.setUsername("lp," + UUID.randomUUID().toString());
tmpUser.setPhoto("my photo path");
tmpUserDao.save(tmpUser);
}
@Test
public void testBatchSave() {
List<TmpUser> users = getUsr(100);
tmpUserDao.save(users);
}
@Test
public void queryAll() {
//Map<String,Object> searchParam = Maps.newHashMap() ;
Map<String, Object> searchParam = new HashMap<>();
Page<TmpUser> result = tmpUserDao.findAll(searchParam, new MybatisPageRequest(0, 1));
System.out.println(result.getTotalPages());
//log.info("result->{}", JSON.toJSONString(result , true));
}
@Test
public void query() {
// 每个数据库的容量
int total = 8000000;
// 不停变化sv的值
int sv = 54495;
for (int i = 1; i < 8000000; i++) {
sv = i;
System.out.println("======" + sv);
// 规划集群中数据库的数量(一主,三从)
int dbCount = 4;
// 规划数据表的数据量,算法不受库的限制
int tbCount = 2;
// 倍增因子
long divisor = Math.round(sv / total);
// 系数
long coefficient = sv % total;
// 库
long ds = coefficient % dbCount + divisor * dbCount;
// 表
long tb = coefficient % tbCount;
System.out.println("db_" + ds + ".tb_" + tb);
}
}
// 分裤分表
public static void main(String[] args) {
}
}
| [
"hhh@d55a9f32-8471-450d-bba4-b89e090b5caa"
] | hhh@d55a9f32-8471-450d-bba4-b89e090b5caa |
9b2dcdddbee4f8accfe993dbb6b0840390b5fd43 | dafcdd6347a1be928df01b5a5bf47527f38d029f | /GoogleMapTest/src/com/example/googlemaptest/parser/InputStreamParser.java | 700f8f6e087f9e9fd3628115dfdea6ea8350eafc | [] | no_license | sunleesi/android-education-project | b62e63076619cb927490fe1585c6a7a0169c79a5 | 31c1e520275ba0445b3288e0626fe5717193bd7b | refs/heads/master | 2021-01-10T03:06:12.607555 | 2015-06-01T06:38:54 | 2015-06-01T06:38:54 | 36,643,841 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 242 | java | package com.example.googlemaptest.parser;
import java.io.InputStream;
abstract public class InputStreamParser {
abstract public void doParse(InputStream is) throws InputStreamParserException;
abstract public Object getResult();
}
| [
"dongja94@gmail.com"
] | dongja94@gmail.com |
93090f7375dd2e5ea70da19a29671679edecfbf7 | f6899a2cf1c10a724632bbb2ccffb7283c77a5ff | /glassfish-3.0/admin/rest/src/main/java/org/glassfish/admin/rest/resources/ApplicationResource.java | fa6a45875b876efa8d127941ebaebfb160d8c18b | [] | no_license | Appdynamics/OSS | a8903058e29f4783e34119a4d87639f508a63692 | 1e112f8854a25b3ecf337cad6eccf7c85e732525 | refs/heads/master | 2023-07-22T03:34:54.770481 | 2021-10-28T07:01:57 | 2021-10-28T07:01:57 | 19,390,624 | 2 | 13 | null | 2023-07-08T02:26:33 | 2014-05-02T22:42:20 | null | UTF-8 | Java | false | false | 3,696 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can obtain
* a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
* or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
* Sun designates this particular file as subject to the "Classpath" exception
* as provided by Sun in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the License
* Header, with the fields enclosed by brackets [] replaced by your own
* identifying information: "Portions Copyrighted [year]
* [name of copyright owner]"
*
* Contributor(s):
*
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package org.glassfish.admin.rest.resources;
import javax.ws.rs.*;
import org.glassfish.admin.rest.TemplateResource;
import com.sun.enterprise.config.serverbeans.Application;
public class ApplicationResource extends TemplateResource<Application> {
@Path("enable/")
public ApplicationEnableResource getApplicationEnableResource() {
ApplicationEnableResource resource = resourceContext.getResource(ApplicationEnableResource.class);
return resource;
}
@Path("disable/")
public ApplicationDisableResource getApplicationDisableResource() {
ApplicationDisableResource resource = resourceContext.getResource(ApplicationDisableResource.class);
return resource;
}
@Override
public String[][] getCommandResourcesPaths() {
return new String[][]{{"enable", "POST"}, {"disable", "POST"}};
}
@Path("module/")
public ListModuleResource getModuleResource() {
ListModuleResource resource = resourceContext.getResource(ListModuleResource.class);
resource.setEntity(getEntity().getModule() );
return resource;
}
@Path("web-service-endpoint/")
public ListWebServiceEndpointResource getWebServiceEndpointResource() {
ListWebServiceEndpointResource resource = resourceContext.getResource(ListWebServiceEndpointResource.class);
resource.setEntity(getEntity().getWebServiceEndpoint() );
return resource;
}
@Path("engine/")
public ListEngineResource getEngineResource() {
ListEngineResource resource = resourceContext.getResource(ListEngineResource.class);
resource.setEntity(getEntity().getEngine() );
return resource;
}
@Path("property/")
public ListPropertyResource getPropertyResource() {
ListPropertyResource resource = resourceContext.getResource(ListPropertyResource.class);
resource.setEntity(getEntity().getProperty() );
return resource;
}
}
| [
"ddimalanta@appdynamics.com"
] | ddimalanta@appdynamics.com |
79a8a288eb39217043f6447884307ca2da4024ec | a3e9b29faae804b59d784d6a26cdd2f8ca842af4 | /src/org/springframework/web/servlet/view/InternalResourceViewResolver.java | b4d805c7a8ba4f6281167bb5b02bfb7b3a8f8d1f | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | enrpan/spring-framework-2.5 | 29d8326c3535ecafd25ba9ca65c1907807f192a2 | e375bb6d66cdaf06ce764bb05e213af78aa5c8e9 | refs/heads/master | 2021-01-17T16:20:57.811749 | 2017-03-06T21:56:33 | 2017-03-06T21:56:33 | 84,124,820 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,290 | java | /*
* Copyright 2002-2007 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.web.servlet.view;
import org.springframework.util.ClassUtils;
/**
* Convenient subclass of {@link UrlBasedViewResolver} that supports
* {@link InternalResourceView} (i.e. Servlets and JSPs) and subclasses
* such as {@link JstlView} and
* {@link org.springframework.web.servlet.view.tiles.TilesView}.
*
* <p>The view class for all views generated by this resolver can be specified
* via {@link #setViewClass}. See {@link UrlBasedViewResolver}'s javadoc for details.
* The default is {@link InternalResourceView}, or {@link JstlView} if the
* JSTL API is present.
*
* <p>BTW, it's good practice to put JSP files that just serve as views under
* WEB-INF, to hide them from direct access (e.g. via a manually entered URL).
* Only controllers will be able to access them then.
*
* <p><b>Note:</b> When chaining ViewResolvers, an InternalResourceViewResolver
* always needs to be last, as it will attempt to resolve any view name,
* no matter whether the underlying resource actually exists.
*
* @author Juergen Hoeller
* @since 17.02.2003
* @see #setViewClass
* @see #setPrefix
* @see #setSuffix
* @see #setRequestContextAttribute
* @see InternalResourceView
* @see JstlView
* @see org.springframework.web.servlet.view.tiles.TilesView
*/
public class InternalResourceViewResolver extends UrlBasedViewResolver {
private static final boolean jstlPresent =
ClassUtils.isPresent("javax.servlet.jsp.jstl.fmt.LocalizationContext");
private Boolean alwaysInclude;
private Boolean exposeContextBeansAsAttributes;
/**
* Sets the default {@link #setViewClass view class} to {@link #requiredViewClass}:
* by default {@link InternalResourceView}, or {@link JstlView} if the JSTL API
* is present.
*/
public InternalResourceViewResolver() {
Class viewClass = requiredViewClass();
if (viewClass.equals(InternalResourceView.class) && jstlPresent) {
viewClass = JstlView.class;
}
setViewClass(viewClass);
}
/**
* This resolver requires {@link InternalResourceView}.
*/
protected Class requiredViewClass() {
return InternalResourceView.class;
}
/**
* Specify whether to always include the view rather than forward to it.
* <p>Default is "false". Switch this flag on to enforce the use of a
* Servlet include, even if a forward would be possible.
* @see InternalResourceView#setAlwaysInclude
*/
public void setAlwaysInclude(boolean alwaysInclude) {
this.alwaysInclude = Boolean.valueOf(alwaysInclude);
}
/**
* Set whether to make all Spring beans in the application context accessible
* as request attributes, through lazy checking once an attribute gets accessed.
* <p>This will make all such beans accessible in plain <code>${...}</code>
* expressions in a JSP 2.0 page, as well as in JSTL's <code>c:out</code>
* value expressions.
* <p>Default is "false".
* @see InternalResourceView#setExposeContextBeansAsAttributes
*/
public void setExposeContextBeansAsAttributes(boolean exposeContextBeansAsAttributes) {
this.exposeContextBeansAsAttributes = Boolean.valueOf(exposeContextBeansAsAttributes);
}
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
InternalResourceView view = (InternalResourceView) super.buildView(viewName);
if (this.alwaysInclude != null) {
view.setAlwaysInclude(this.alwaysInclude.booleanValue());
}
if (this.exposeContextBeansAsAttributes != null) {
view.setExposeContextBeansAsAttributes(this.exposeContextBeansAsAttributes.booleanValue());
}
return view;
}
}
| [
"epsbgt@gmail.com"
] | epsbgt@gmail.com |
b8b0db17d1eec3eaf724fe235640f217024bf4ae | c3ed361065d32f4af944aa460f585d147676c977 | /sources/org/apache/http/impl/io/HttpResponseParser.java | 298dfa52b9fe62496651b5b852dfbe13285646a0 | [] | no_license | akshaydhone/Mp3updated | 4b950db21a4bee578a34605595fa226f80b732f9 | 10a97bc59c3d827f50e585847289eb8ecbf8e57d | refs/heads/master | 2020-04-30T20:52:01.309420 | 2019-03-22T06:01:52 | 2019-03-22T06:01:52 | 177,080,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,550 | java | package org.apache.http.impl.io;
import java.io.IOException;
import org.apache.http.HttpException;
import org.apache.http.HttpMessage;
import org.apache.http.HttpResponseFactory;
import org.apache.http.NoHttpResponseException;
import org.apache.http.ParseException;
import org.apache.http.annotation.NotThreadSafe;
import org.apache.http.io.SessionInputBuffer;
import org.apache.http.message.LineParser;
import org.apache.http.message.ParserCursor;
import org.apache.http.params.HttpParams;
import org.apache.http.util.Args;
import org.apache.http.util.CharArrayBuffer;
@NotThreadSafe
@Deprecated
public class HttpResponseParser extends AbstractMessageParser<HttpMessage> {
private final CharArrayBuffer lineBuf = new CharArrayBuffer(128);
private final HttpResponseFactory responseFactory;
public HttpResponseParser(SessionInputBuffer buffer, LineParser parser, HttpResponseFactory responseFactory, HttpParams params) {
super(buffer, parser, params);
this.responseFactory = (HttpResponseFactory) Args.notNull(responseFactory, "Response factory");
}
protected HttpMessage parseHead(SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException {
this.lineBuf.clear();
if (sessionBuffer.readLine(this.lineBuf) == -1) {
throw new NoHttpResponseException("The target server failed to respond");
}
return this.responseFactory.newHttpResponse(this.lineParser.parseStatusLine(this.lineBuf, new ParserCursor(0, this.lineBuf.length())), null);
}
}
| [
"dhoneakshay39@gmail.com"
] | dhoneakshay39@gmail.com |
93f3a6a5374fdc5710f408eeeacad38318847c75 | 9bd0afb9b1b9886a37b17d21ee5b6f2a8bac4eea | /Domain/src/org/jphototagger/domain/metadata/selections/RepositoryInfoCountOfMetaDataValues.java | b87a41a11b46dd8ccc7dc7bec7b2bab78afb0362 | [] | no_license | ebaumann/jphototagger | 2d37a256e8373e3704b9e19adfb32f6debcdccbe | b9411c3a2c289f65d82be15d7033a00644e1e210 | refs/heads/master | 2023-04-12T21:46:34.382467 | 2023-03-16T18:02:42 | 2023-03-16T18:02:42 | 32,269,356 | 15 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,602 | java | package org.jphototagger.domain.metadata.selections;
import java.util.ArrayList;
import java.util.List;
import org.jphototagger.domain.metadata.MetaDataValue;
import org.jphototagger.domain.metadata.exif.ExifLensMetaDataValue;
import org.jphototagger.domain.metadata.exif.ExifRecordingEquipmentMetaDataValue;
import org.jphototagger.domain.metadata.file.FilesFilenameMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpDcCreatorMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpDcRightsMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpDcSubjectsSubjectMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpIptc4xmpcoreLocationMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpPhotoshopAuthorspositionMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpPhotoshopCaptionwriterMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpPhotoshopCityMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpPhotoshopCountryMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpPhotoshopCreditMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpPhotoshopSourceMetaDataValue;
import org.jphototagger.domain.metadata.xmp.XmpPhotoshopStateMetaDataValue;
/**
* @author Elmar Baumann
*/
public final class RepositoryInfoCountOfMetaDataValues {
private static final List<MetaDataValue> META_DATA_VALUES = new ArrayList<>();
static {
META_DATA_VALUES.add(FilesFilenameMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpDcSubjectsSubjectMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpIptc4xmpcoreLocationMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpPhotoshopAuthorspositionMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpDcCreatorMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpPhotoshopCityMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpPhotoshopStateMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpPhotoshopCountryMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpDcRightsMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpPhotoshopCreditMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpPhotoshopSourceMetaDataValue.INSTANCE);
META_DATA_VALUES.add(XmpPhotoshopCaptionwriterMetaDataValue.INSTANCE);
META_DATA_VALUES.add(ExifRecordingEquipmentMetaDataValue.INSTANCE);
META_DATA_VALUES.add(ExifLensMetaDataValue.INSTANCE);
}
public static List<MetaDataValue> get() {
return new ArrayList<>(META_DATA_VALUES);
}
private RepositoryInfoCountOfMetaDataValues() {
}
}
| [
"ebaumann@localhost"
] | ebaumann@localhost |
985d954ddd705a825bb8b7e647fdb2477bb14c7a | 9fce01d889bf907b87b618c97c4b83cd3a69155d | /gy/javaprog/_OOTPJava1/Feladatmegoldasok/16KarlancCsomagolo/String/Leghosszabb/Leghosszabb.java | d97bdbf32ff304a084b7a4f765c95101bebe67d6 | [] | no_license | 8emi95/elte-ik-pt1 | c235dea0f11f90f96487f232ff9122497c86d4a6 | 45c24fe8436c29054b7a8ffecb2f55dbd3cb3f42 | refs/heads/master | 2020-04-29T09:16:14.310592 | 2019-03-16T19:48:50 | 2019-03-16T19:48:50 | 176,018,106 | 0 | 0 | null | null | null | null | ISO-8859-2 | Java | false | false | 1,089 | java | /*
* Feladatmegoldások/16. fejezet
* Leghossszabb.java
*
* Angster Erzsébet: OO tervezés és programozás, Java I. kötet
* 2001.02.01.
*/
import extra.*;
public class Leghosszabb {
static void aFeladat() {
String szo;
String leghosszabb = "";
szo = Console.readLine("Szó: ");
while (!szo.equals("")) {
if (szo.length() > leghosszabb.length())
leghosszabb = szo;
szo = Console.readLine("Szó: ");
}
System.out.println("A leghosszabb szó: "+leghosszabb);
}
static void bFeladat() {
String szo;
String leghosszabbak = "";
int maxHossz = -1;
szo = Console.readLine("Szó: ");
while (!szo.equals("")) {
if (szo.length() > maxHossz) {
maxHossz = szo.length();
leghosszabbak = szo;
}
else if (szo.length() == maxHossz) {
leghosszabbak = leghosszabbak + ", " + szo;
}
szo = Console.readLine("Szó: ");
}
System.out.println("A leghosszabb szavak: "+leghosszabbak);
}
public static void main(String[] args) {
aFeladat();
bFeladat();
}
}
| [
"8emi95@inf.elte.hu"
] | 8emi95@inf.elte.hu |
5b43828ffde2ad070dfb6713365c141a01d54d3d | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/assertj/core/api/doublepredicate/DoublePredicateAssert_rejects_Test.java | f71fe2e4f1e5e720094c0506de9701429ae8490e | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 3,427 | java | /**
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright 2012-2019 the original author or authors.
*/
package org.assertj.core.api.doublepredicate;
import PredicateDescription.GIVEN;
import java.util.List;
import java.util.function.DoublePredicate;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.DoublePredicateAssertBaseTest;
import org.assertj.core.error.NoElementsShouldMatch;
import org.assertj.core.error.ShouldNotAccept;
import org.assertj.core.util.FailureMessages;
import org.junit.jupiter.api.Test;
/**
*
*
* @author Filip Hrisafov
*/
public class DoublePredicateAssert_rejects_Test extends DoublePredicateAssertBaseTest {
@Test
public void should_fail_when_predicate_is_null() {
Assertions.assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(((DoublePredicate) (null))).rejects(1.0, 2.0, 3.0)).withMessage(FailureMessages.actualIsNull());
}
@Test
public void should_pass_when_predicate_does_not_accept_value() {
DoublePredicate predicate = ( val) -> val <= 2;
Assertions.assertThat(predicate).rejects(3.0);
}
@Test
public void should_fail_when_predicate_accepts_value() {
DoublePredicate predicate = ( val) -> val <= 2;
Predicate<Double> wrapPredicate = predicate::test;
double expectedValue = 2.0;
Assertions.assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(predicate).rejects(expectedValue)).withMessage(ShouldNotAccept.shouldNotAccept(wrapPredicate, expectedValue, GIVEN).create());
}
@Test
public void should_fail_when_predicate_accepts_value_with_string_description() {
DoublePredicate predicate = ( val) -> val <= 2;
Predicate<Double> wrapPredicate = predicate::test;
double expectedValue = 2.0;
Assertions.assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(predicate).as("test").rejects(expectedValue)).withMessage(("[test] " + (ShouldNotAccept.shouldNotAccept(wrapPredicate, expectedValue, GIVEN).create())));
}
@Test
public void should_fail_when_predicate_accepts_some_value() {
DoublePredicate predicate = ( num) -> num <= 2;
double[] matchValues = new double[]{ 1.0, 2.0, 3.0 };
List<Double> matchValuesList = DoubleStream.of(matchValues).boxed().collect(Collectors.toList());
Assertions.assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(predicate).rejects(matchValues)).withMessage(NoElementsShouldMatch.noElementsShouldMatch(matchValuesList, 1.0, GIVEN).create());
}
@Test
public void should_pass_when_predicate_accepts_no_value() {
DoublePredicate predicate = ( num) -> num <= 2;
Assertions.assertThat(predicate).rejects(3.0, 4.0, 5.0);
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
9388f760d245ab634623433230dde2ef1d922140 | 784017131b5eadffd3bec254f9304225e648d3a3 | /app/src/main/java/p005b/p006a/p007a/p008a/p009a/p012c/PriorityThreadPoolExecutor.java | 9af44885f99321bc69699a2b59ae4256da51a682 | [] | no_license | Nienter/kdshif | e6126b3316f4b6e15a7dc6a67253f5729515fb4c | 4d65454bb331e4439ed948891aa0173655d66934 | refs/heads/master | 2022-12-03T19:57:04.981078 | 2020-08-06T11:28:14 | 2020-08-06T11:28:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,972 | java | package p005b.p006a.p007a.p008a.p009a.p012c;
import android.annotation.TargetApi;
import java.util.concurrent.Callable;
import java.util.concurrent.RunnableFuture;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/* renamed from: b.a.a.a.a.c.k */
public class PriorityThreadPoolExecutor extends ThreadPoolExecutor {
/* renamed from: a */
private static final int f214a = Runtime.getRuntime().availableProcessors();
/* renamed from: b */
private static final int f215b = (f214a + 1);
/* renamed from: c */
private static final int f216c = ((f214a * 2) + 1);
/* renamed from: b.a.a.a.a.c.k$a */
/* compiled from: PriorityThreadPoolExecutor */
protected static final class C0448a implements ThreadFactory {
/* renamed from: a */
private final int f217a;
public C0448a(int i) {
this.f217a = i;
}
public Thread newThread(Runnable runnable) {
Thread thread = new Thread(runnable);
thread.setPriority(this.f217a);
thread.setName("Queue");
return thread;
}
}
<T extends Runnable & Dependency & C0449l & PriorityProvider> PriorityThreadPoolExecutor(int i, int i2, long j, TimeUnit timeUnit, DependencyPriorityBlockingQueue<T> cVar, ThreadFactory threadFactory) {
super(i, i2, j, timeUnit, cVar, threadFactory);
prestartAllCoreThreads();
}
/* renamed from: a */
public static <T extends Runnable & Dependency & C0449l & PriorityProvider> PriorityThreadPoolExecutor m264a(int i, int i2) {
return new PriorityThreadPoolExecutor(i, i2, 1, TimeUnit.SECONDS, new DependencyPriorityBlockingQueue(), new C0448a(10));
}
/* renamed from: a */
public static PriorityThreadPoolExecutor m263a() {
return m264a(f215b, f216c);
}
/* access modifiers changed from: protected */
public <T> RunnableFuture<T> newTaskFor(Runnable runnable, T t) {
return new PriorityFutureTask(runnable, t);
}
/* access modifiers changed from: protected */
public <T> RunnableFuture<T> newTaskFor(Callable<T> callable) {
return new PriorityFutureTask(callable);
}
@TargetApi(9)
public void execute(Runnable runnable) {
if (PriorityTask.isProperDelegate(runnable)) {
super.execute(runnable);
} else {
super.execute(newTaskFor(runnable, null));
}
}
/* access modifiers changed from: protected */
public void afterExecute(Runnable runnable, Throwable th) {
C0449l lVar = (C0449l) runnable;
lVar.setFinished(true);
lVar.setError(th);
getQueue().recycleBlockedQueue();
super.afterExecute(runnable, th);
}
/* renamed from: b */
public DependencyPriorityBlockingQueue getQueue() {
return (DependencyPriorityBlockingQueue) super.getQueue();
}
}
| [
"niu@eptonic.com"
] | niu@eptonic.com |
8b0091cf3d1dddce92f1dbb0df25a1de54ee3b12 | 70bfed6caf20d08e69930afcd2304507cd416176 | /src/main/java/com/insigma/mvc/serviceimp/common/jms/listener/topic/JmsTopicMessageListenerCleintA.java | 697812541f5127b37da85e3bce340701ff1c8b89 | [] | no_license | wengweng85/wxjy-web-api-common | 1a8897c164c91827daad8db400bbd66dda7072e4 | f533861ddc710798a176c5351e794317150c7349 | refs/heads/master | 2021-05-09T23:06:10.736052 | 2018-02-01T03:29:36 | 2018-02-01T03:29:36 | 118,771,414 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,250 | java | package com.insigma.mvc.serviceimp.common.jms.listener.topic;
import javax.annotation.Resource;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import javax.jms.StreamMessage;
import javax.jms.TextMessage;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.stereotype.Component;
import com.insigma.mvc.service.common.log.ApiLogService;
/**
* 消息接收服务
*
* @author wengsh
*/
@Component
public class JmsTopicMessageListenerCleintA implements MessageListener {
@Resource
private ApiLogService logservice;
/**
* 接收消息
*/
@Override
public void onMessage(Message message) {
try {
// 如果是文本消息
if (message instanceof TextMessage) {
TextMessage tm = (TextMessage) message;
}
// 如果是Map消息
if (message instanceof MapMessage) {
MapMessage mm = (MapMessage) message;
System.out.println("MapMessage:\t" + mm.getString("msgId"));
}
// 如果是Object消息
if (message instanceof ObjectMessage) {
ObjectMessage om = (ObjectMessage) message;
Object exampleUser = (Object) om.getObject();
System.out.println("ObjectMessage:\t" + ToStringBuilder.reflectionToString(exampleUser));
}
// 如果是bytes消息
if (message instanceof BytesMessage) {
byte[] b = new byte[1024];
int len = -1;
BytesMessage bm = (BytesMessage) message;
while ((len = bm.readBytes(b)) != -1) {
System.out.println(new String(b, 0, len));
}
}
// 如果是Stream消息
if (message instanceof StreamMessage) {
StreamMessage sm = (StreamMessage) message;
System.out.println(sm.readString());
System.out.println(sm.readInt());
}
} catch (JMSException e) {
e.printStackTrace();
}
}
}
| [
"whengshaohui@163.com"
] | whengshaohui@163.com |
6d1c2f4067639b6eef9dbc6279311772aafa0aaf | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /Mate20-9.0/src/main/java/com/android/server/security/securityprofile/$$Lambda$PolicyEngine$y8ZWBmdZk6eAk13PmjJk7plltsI.java | 236f1640afd95279b7e017fe99b6fe802a87aa4c | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 815 | java | package com.android.server.security.securityprofile;
import com.android.server.security.securityprofile.PolicyEngine;
import org.json.JSONObject;
/* renamed from: com.android.server.security.securityprofile.-$$Lambda$PolicyEngine$y8ZWBmdZk6eAk13PmjJk7plltsI reason: invalid class name */
/* compiled from: lambda */
public final /* synthetic */ class $$Lambda$PolicyEngine$y8ZWBmdZk6eAk13PmjJk7plltsI implements PolicyEngine.RuleToKey {
public static final /* synthetic */ $$Lambda$PolicyEngine$y8ZWBmdZk6eAk13PmjJk7plltsI INSTANCE = new $$Lambda$PolicyEngine$y8ZWBmdZk6eAk13PmjJk7plltsI();
private /* synthetic */ $$Lambda$PolicyEngine$y8ZWBmdZk6eAk13PmjJk7plltsI() {
}
public final String getKey(JSONObject jSONObject) {
return PolicyEngine.lambda$createLookup$1(jSONObject);
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
0d84d98dabcb0d69466b4036cf84660645825067 | 00cb6f98d9796ca777afc9d26cb557b6f5fe3cda | /mygo/mygo-alipay/src/main/java/com/alipay/api/response/AlipayDaoweiOrderConfirmResponse.java | 498fafef995b560b7b11bcb76f9e2b25491f83f7 | [] | no_license | caizhongao/mygo | e79a493948443e6bb17a4390d0b31033cd98d377 | 08a36fe0aced49fc46f4541af415d6e86d77d9c9 | refs/heads/master | 2020-09-06T12:45:37.350935 | 2017-06-26T05:51:50 | 2017-06-26T05:51:50 | 94,418,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 366 | java | package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.daowei.order.confirm response.
*
* @author auto create
* @since 1.0, 2017-03-20 14:01:05
*/
public class AlipayDaoweiOrderConfirmResponse extends AlipayResponse {
private static final long serialVersionUID = 8176959593275461283L;
}
| [
"mufeng@juanpi.com"
] | mufeng@juanpi.com |
9a299c250bdb80ec7d784a92846151c352b835ac | acf193f05da76f12932569c1856de4bd1ed1e778 | /android/app/src/debug/java/com/autumn_limit_26576/ReactNativeFlipper.java | 875a6b7071b07e6346c40538c6f08ecc7ce2b487 | [] | no_license | crowdbotics-apps/autumn-limit-26576 | 04bdda27fa4b8060bfd382b89e759f720dae3146 | d04629fae1b2ef35cf9f75254cafdbbe2f87e0d0 | refs/heads/master | 2023-04-21T04:20:55.374550 | 2021-05-11T22:27:39 | 2021-05-11T22:27:39 | 366,527,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,273 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.autumn_limit_26576;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"team@crowdbotics.com"
] | team@crowdbotics.com |
bbfeecd0899962d71584c4db973df8ba90c6cd8e | 03fd5c6b56ab31115216802841fe663926409fed | /app/src/main/java/com/baigu/dms/common/view/circleimage/transfer/transfer/RemoteThumState.java | 4b8a187d79c711ef0a3d9ec8bf2525d6a3b47e69 | [] | no_license | wbq501/tby | dccfe8637edbd0f8db1a179293ba6e044168febd | db881aed32ee9f19131e04f6b257d4bc8b116c8b | refs/heads/master | 2020-03-18T13:56:00.487498 | 2018-06-22T03:37:33 | 2018-06-22T03:37:33 | 134,817,745 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,983 | java | package com.baigu.dms.common.view.circleimage.transfer.transfer;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import com.baigu.dms.common.view.circleimage.transfer.loader.ImageLoader;
import com.baigu.dms.common.view.circleimage.transfer.style.IProgressIndicator;
import com.baigu.dms.common.view.circleimage.transfer.view.image.TransferImage;
import java.util.List;
/**
* 用户指定了缩略图路径,使用该路径加载缩略图,
* 并使用 {@link TransferImage#CATE_ANIMA_TOGETHER} 动画类型展示图片
* <p>
* Created by hitomi on 2017/5/4.
* <p>
* email: 196425254@qq.com
*/
class RemoteThumState extends TransferState {
RemoteThumState(TransferLayout transfer) {
super(transfer);
}
@Override
public void prepareTransfer(final TransferImage transImage, int position) {
final TransferConfig config = transfer.getTransConfig();
ImageLoader imageLoader = config.getImageLoader();
String imgUrl = config.getThumbnailImageList().get(position);
if (imageLoader.isLoaded(imgUrl)) {
imageLoader.loadThumbnailAsync(imgUrl, transImage, new ImageLoader.ThumbnailCallback() {
@Override
public void onFinish(Drawable drawable) {
transImage.setImageDrawable(drawable == null
? config.getMissDrawable(context) : drawable);
}
});
} else {
transImage.setImageDrawable(config.getMissDrawable(context));
}
}
@Override
public TransferImage createTransferIn(final int position) {
TransferConfig config = transfer.getTransConfig();
TransferImage transImage = createTransferImage(
config.getOriginImageList().get(position));
transformThumbnail(config.getThumbnailImageList().get(position), transImage, true);
transfer.addView(transImage, 1);
return transImage;
}
@Override
public void transferLoad(final int position) {
TransferAdapter adapter = transfer.getTransAdapter();
final TransferConfig config = transfer.getTransConfig();
final TransferImage targetImage = transfer.getTransAdapter().getImageItem(position);
final ImageLoader imageLoader = config.getImageLoader();
final IProgressIndicator progressIndicator = config.getProgressIndicator();
progressIndicator.attach(position, adapter.getParentItem(position));
if (config.isJustLoadHitImage()) {
// 如果用户设置了 JustLoadHitImage 属性,说明在 prepareTransfer 中已经
// 对 TransferImage 裁剪且设置了占位图, 所以这里直接加载原图即可
loadSourceImage(targetImage.getDrawable(), position, targetImage, progressIndicator);
} else {
String thumUrl = config.getThumbnailImageList().get(position);
if (imageLoader.isLoaded(thumUrl)) {
imageLoader.loadThumbnailAsync(thumUrl, targetImage, new ImageLoader.ThumbnailCallback() {
@Override
public void onFinish(Drawable drawable) {
if (drawable == null)
drawable = config.getMissDrawable(context);
loadSourceImage(drawable, position, targetImage, progressIndicator);
}
});
} else {
loadSourceImage(config.getMissDrawable(context), position, targetImage, progressIndicator);
}
}
}
private void loadSourceImage(Drawable drawable, final int position, final TransferImage targetImage, final IProgressIndicator progressIndicator) {
final TransferConfig config = transfer.getTransConfig();
config.getImageLoader().showSourceImage(config.getSourceImageList().get(position),
targetImage, drawable, new ImageLoader.SourceCallback() {
@Override
public void onStart() {
progressIndicator.onStart(position);
}
@Override
public void onProgress(int progress) {
progressIndicator.onProgress(position, progress);
}
@Override
public void onFinish() {
}
@Override
public void onDelivered(int status) {
switch (status) {
case ImageLoader.STATUS_DISPLAY_SUCCESS:
progressIndicator.onFinish(position); // onFinish 只是说明下载完毕,并没更新图像
// 启用 TransferImage 的手势缩放功能
targetImage.enable();
// 绑定点击关闭 Transferee
transfer.bindOnOperationListener(targetImage, position);
break;
case ImageLoader.STATUS_DISPLAY_FAILED: // 加载失败,显示加载错误的占位图
targetImage.setImageDrawable(config.getErrorDrawable(context));
break;
}
}
});
}
@Override
public TransferImage transferOut(final int position) {
TransferImage transImage = null;
TransferConfig config = transfer.getTransConfig();
List<ImageView> originImageList = config.getOriginImageList();
if (position < originImageList.size()) {
transImage = createTransferImage(
originImageList.get(position));
transformThumbnail(config.getThumbnailImageList().get(position), transImage, false);
transfer.addView(transImage, 1);
}
return transImage;
}
}
| [
"749937855@qq.com"
] | 749937855@qq.com |
ea9b92da7243dfe24584a23643e300de6c961c3c | d71fc6f733e494f35f1ea855f25c5e830efea632 | /extension/binding/fabric3-binding-rs-jersey/src/main/java/org/fabric3/binding/rs/runtime/provider/ProviderRegistry.java | a40de34283d9934f831bcb09baa22c9f1d2db29a | [
"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 | 2,422 | 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.
*/
package org.fabric3.binding.rs.runtime.provider;
import java.lang.annotation.Annotation;
import java.net.URI;
import java.util.Collection;
/**
* Manages JAX-RS providers such as filters and context resolver providers.
*/
public interface ProviderRegistry {
/**
* Registers a global filter.
*
* @param uri a unique filter identifier
* @param filter the filter
*/
void registerGlobalProvider(URI uri, Object filter);
/**
* Returns registered global filters.
*
* @return the global filters
*/
Collection<Object> getGlobalProvider();
/**
* Registers a name filter.
*
* @param filterUri a unique filter identifier
* @param annotation the name binding annotation the filter is applied for
* @param filter the filter
*/
void registerNameFilter(URI filterUri, Class<? extends Annotation> annotation, Object filter);
/**
* Returns name filters that are applied for the given annotation.
*
* @param annotation the name binding annotation the filter is applied for
* @return the filter
*/
Collection<Object> getNameFilters(Class<? extends Annotation> annotation);
/**
* Unregisters a global filter.
*
* @param filterUri the filter identifier
* @return the response filter or null if one is not registered for the identifier
*/
Object unregisterGlobalFilter(URI filterUri);
/**
* Unregisters a name filter.
*
* @param filterUri a unique filter identifier
* @param annotationClass the binding the filter is applied for
* @return the filter or null if one is not registered for the annotation
*/
Object unregisterNameFilter(URI filterUri, Class<? extends Annotation> annotationClass);
}
| [
"jim.marino@gmail.com"
] | jim.marino@gmail.com |
3b627a61bccb7fb87cfb807f18913288ee87f998 | 998bac2df6af03de0d17b128ce843cc37d554a16 | /nuxeo-core/nuxeo-core-bulk/src/main/java/org/nuxeo/ecm/core/bulk/computation/BulkStatusComputation.java | bbd593193c6572963e3db5d79c5c3c36b6697de3 | [
"Apache-2.0"
] | permissive | qsdj/nuxeo | f41e34226c5ff31b366645aa8ca5951008f2d9d6 | 482df02d8faa2f4b0c9ef783911c4d4b1b342ca4 | refs/heads/master | 2020-04-04T18:02:21.967388 | 2018-11-02T07:46:51 | 2018-11-02T14:20:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,256 | java | /*
* (C) Copyright 2018 Nuxeo SA (http://nuxeo.com/) and others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Contributors:
* Funsho David
*/
package org.nuxeo.ecm.core.bulk.computation;
import static org.nuxeo.ecm.core.bulk.message.BulkStatus.State.ABORTED;
import static org.nuxeo.ecm.core.bulk.message.BulkStatus.State.COMPLETED;
import static org.nuxeo.ecm.core.bulk.message.BulkStatus.State.UNKNOWN;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuxeo.ecm.core.bulk.BulkCodecs;
import org.nuxeo.ecm.core.bulk.BulkService;
import org.nuxeo.ecm.core.bulk.BulkServiceImpl;
import org.nuxeo.ecm.core.bulk.message.BulkStatus;
import org.nuxeo.lib.stream.codec.Codec;
import org.nuxeo.lib.stream.computation.AbstractComputation;
import org.nuxeo.lib.stream.computation.ComputationContext;
import org.nuxeo.lib.stream.computation.Record;
import org.nuxeo.runtime.api.Framework;
/**
* Saves the status into a key value store.
* <p>
* Inputs:
* <ul>
* <li>i1: Reads {@link BulkStatus} sharded by command id</li>
* </ul>
* Outputs:
* <ul>
* <li>o1: Write {@link BulkStatus} full into the done stream.</li>
* </ul>
* </p>
*
* @since 10.2
*/
public class BulkStatusComputation extends AbstractComputation {
private static final Log log = LogFactory.getLog(BulkStatusComputation.class);
public BulkStatusComputation(String name) {
super(name, 1, 1);
}
@Override
public void processRecord(ComputationContext context, String inputStreamName, Record record) {
Codec<BulkStatus> codec = BulkCodecs.getStatusCodec();
BulkStatus recordStatus = codec.decode(record.getData());
BulkServiceImpl bulkService = (BulkServiceImpl) Framework.getService(BulkService.class);
BulkStatus status;
if (!recordStatus.isDelta()) {
status = recordStatus;
} else {
status = bulkService.getStatus(recordStatus.getCommandId());
if (UNKNOWN.equals(status.getState())) {
// this requires a manual intervention, the kv store might have been lost
log.error(String.format("Stopping processing, unknown status for command: %s, offset: %s, record: %s.",
recordStatus.getCommandId(), context.getLastOffset(), record));
context.askForTermination();
return;
}
status.merge(recordStatus);
}
byte[] statusAsBytes = bulkService.setStatus(status);
if (status.getState() == COMPLETED || recordStatus.getState() == ABORTED) {
context.produceRecord(OUTPUT_1, status.getCommandId(), statusAsBytes);
}
context.askForCheckpoint();
}
}
| [
"bdelbosc@nuxeo.com"
] | bdelbosc@nuxeo.com |
995d4365caf00c07d727cd8aa8d51b36b66b7af0 | 11370b9a66ef66e0a15b87d72f793cb2d533daf0 | /app/src/main/java/com/rainwood/oa/model/domain/MineData.java | e5c77c0e0f3708f725a897901489221ced3569ef | [] | no_license | maple00/RainWoodOA | 04bff7c8909694520520767f4457758ef0b1d542 | 0973eedd7f801322ec617f28c4ad05ba12f8b247 | refs/heads/master | 2020-12-10T10:37:35.401905 | 2020-08-11T10:51:55 | 2020-08-11T10:51:55 | 233,565,868 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,977 | java | package com.rainwood.oa.model.domain;
import java.io.Serializable;
import java.util.List;
/**
* @Author: a797s
* @Date: 2020/6/11 16:15
* @Desc: 个人中心数据
*/
public final class MineData implements Serializable {
/**
* 员工姓名
*/
private String staffName;
/**
* 工作职位
*/
private String job;
/**
* 手机号
*/
private String tel;
/**
* 入职时间
*/
private String entryTime;
/**
* 在岗状态
*/
private String state;
/**
* 工作天数
*/
private String entryDay;
/**
* 会计账户金额
*/
private String money;
/**
* 结算金额
*/
private String lastMoney;
/**
* 团队基金
*/
private String teamFund;
/**
* 基本工资
*/
private String basePay;
/**
* 岗位津贴
*/
private String subsidy;
/**
* 员工头像
*/
private String ico;
/**
* 个人中心模块
*/
private List<IconAndFont> button;
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getJob() {
return job;
}
public void setJob(String job) {
this.job = job;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getEntryTime() {
return entryTime;
}
public void setEntryTime(String entryTime) {
this.entryTime = entryTime;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getEntryDay() {
return entryDay;
}
public void setEntryDay(String entryDay) {
this.entryDay = entryDay;
}
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
public String getLastMoney() {
return lastMoney;
}
public void setLastMoney(String lastMoney) {
this.lastMoney = lastMoney;
}
public String getTeamFund() {
return teamFund;
}
public void setTeamFund(String teamFund) {
this.teamFund = teamFund;
}
public String getBasePay() {
return basePay;
}
public void setBasePay(String basePay) {
this.basePay = basePay;
}
public String getSubsidy() {
return subsidy;
}
public void setSubsidy(String subsidy) {
this.subsidy = subsidy;
}
public String getIco() {
return ico;
}
public void setIco(String ico) {
this.ico = ico;
}
public List<IconAndFont> getButton() {
return button;
}
public void setButton(List<IconAndFont> button) {
this.button = button;
}
}
| [
"a797shaoxuesong@163.com"
] | a797shaoxuesong@163.com |
66788b7d64ad7a3296ca6047e0c7b09bcc2e57ed | cb8b4f91c893355227345b95393456536a516541 | /src/main/java/com/authine/cloudpivot/web/api/controller/DutyInfoController.java | 188051f4573bed03638acb04153d4698ff1da7cb | [] | no_license | sengeiou/whxf | fbfcdacd24829a81b971b7aa6271475ab74cfb8d | ff715afbf2af35fe9b81435f1a0a5441d6923605 | refs/heads/master | 2023-04-05T11:57:03.691897 | 2021-04-16T03:35:44 | 2021-04-16T03:35:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,489 | java | package com.authine.cloudpivot.web.api.controller;
import com.authine.cloudpivot.engine.enums.ErrCode;
import com.authine.cloudpivot.web.api.controller.base.BaseController;
import com.authine.cloudpivot.web.api.dto.BrigadeDutyInfoDto;
import com.authine.cloudpivot.web.api.dto.StationDutyInfoDto;
import com.authine.cloudpivot.web.api.service.DutyInfoService;
import com.authine.cloudpivot.web.api.utils.DateUtils;
import com.authine.cloudpivot.web.api.view.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @author wangyong
* @time 2020/5/13 14:50
*/
@Api(value = "值班信息", tags = "二次开发:值班信息")
@RestController
@Slf4j
@RequestMapping("/controller/stationDutyInfo")
public class DutyInfoController extends BaseController {
@Autowired
DutyInfoService dutyInfoService;
/**
* 根据消防站id,日期获取消防站今日值班信息
*
* @param stationId 消防站id
* @param date 日期
* @return 消防站今日值班信息
* @author wangyong
*/
@ApiOperation(value = "根据消防站id获取消防站的今日值班信息")
@GetMapping("/getStationDutyInfoByStationId")
public ResponseResult<Object> getStationDutyInfoByStationId(@ApiParam(value = "消防站id") String stationId, @ApiParam(value = "日期") Date date) {
StationDutyInfoDto stationDutyInfo = dutyInfoService.getStationDutyInfoByStationId(stationId, DateUtils.getYearMonthDateTime(date));
return this.getErrResponseResult(stationDutyInfo, ErrCode.OK.getErrCode(), ErrCode.OK.getErrMsg());
}
@ApiOperation(value = "根据大队id以及日期获取大队的今日值班信息")
@GetMapping("/getBrigadeDutyInfoByBrigadeId")
public ResponseResult<Object> getBrigadeDutyInfoByBrigadeId(@ApiParam(value = "大队id") String brigadeId, @ApiParam(value = "日期") Date date) {
BrigadeDutyInfoDto brigadeDutyInfo = dutyInfoService.getBrigadeDutyInfoByBrigadeId(brigadeId, date);
return this.getErrResponseResult(brigadeDutyInfo, ErrCode.OK.getErrCode(), ErrCode.OK.getErrMsg());
}
}
| [
"1950746552@qq.com"
] | 1950746552@qq.com |
b17fd1bded41775e4df084b685ef11f83c60fdde | 18f318cbc3337cb7c880d2d1ce84d2133b8c1865 | /kubernetes/src/main/java/io/kubernetes/client/models/V1beta1DaemonSetCondition.java | c9f0539bb9c324cc9da6b17b7282440a995fadef | [
"Apache-2.0"
] | permissive | vardin/k8sAPI | 55208a0f264fab412475682bf2882782f4e509c8 | a56ecc7ee8dfd8f5fa0a763dd9ba6fdc3129c4c4 | refs/heads/master | 2022-12-21T11:28:55.583792 | 2019-05-23T06:38:47 | 2019-05-23T06:38:47 | 188,171,946 | 0 | 1 | Apache-2.0 | 2022-12-14T20:34:59 | 2019-05-23T06:09:33 | Java | UTF-8 | Java | false | false | 5,189 | java | /*
* Kubernetes
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v1.13.5
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.kubernetes.client.models;
import java.util.Objects;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.joda.time.DateTime;
/**
* DaemonSetCondition describes the state of a DaemonSet at a certain point.
*/
@ApiModel(description = "DaemonSetCondition describes the state of a DaemonSet at a certain point.")
public class V1beta1DaemonSetCondition {
@SerializedName("lastTransitionTime")
private DateTime lastTransitionTime = null;
@SerializedName("message")
private String message = null;
@SerializedName("reason")
private String reason = null;
@SerializedName("status")
private String status = null;
@SerializedName("type")
private String type = null;
public V1beta1DaemonSetCondition lastTransitionTime(DateTime lastTransitionTime) {
this.lastTransitionTime = lastTransitionTime;
return this;
}
/**
* Last time the condition transitioned from one status to another.
* @return lastTransitionTime
**/
@ApiModelProperty(value = "Last time the condition transitioned from one status to another.")
public DateTime getLastTransitionTime() {
return lastTransitionTime;
}
public void setLastTransitionTime(DateTime lastTransitionTime) {
this.lastTransitionTime = lastTransitionTime;
}
public V1beta1DaemonSetCondition message(String message) {
this.message = message;
return this;
}
/**
* A human readable message indicating details about the transition.
* @return message
**/
@ApiModelProperty(value = "A human readable message indicating details about the transition.")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public V1beta1DaemonSetCondition reason(String reason) {
this.reason = reason;
return this;
}
/**
* The reason for the condition's last transition.
* @return reason
**/
@ApiModelProperty(value = "The reason for the condition's last transition.")
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public V1beta1DaemonSetCondition status(String status) {
this.status = status;
return this;
}
/**
* Status of the condition, one of True, False, Unknown.
* @return status
**/
@ApiModelProperty(required = true, value = "Status of the condition, one of True, False, Unknown.")
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public V1beta1DaemonSetCondition type(String type) {
this.type = type;
return this;
}
/**
* Type of DaemonSet condition.
* @return type
**/
@ApiModelProperty(required = true, value = "Type of DaemonSet condition.")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1beta1DaemonSetCondition v1beta1DaemonSetCondition = (V1beta1DaemonSetCondition) o;
return Objects.equals(this.lastTransitionTime, v1beta1DaemonSetCondition.lastTransitionTime) &&
Objects.equals(this.message, v1beta1DaemonSetCondition.message) &&
Objects.equals(this.reason, v1beta1DaemonSetCondition.reason) &&
Objects.equals(this.status, v1beta1DaemonSetCondition.status) &&
Objects.equals(this.type, v1beta1DaemonSetCondition.type);
}
@Override
public int hashCode() {
return Objects.hash(lastTransitionTime, message, reason, status, type);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1beta1DaemonSetCondition {\n");
sb.append(" lastTransitionTime: ").append(toIndentedString(lastTransitionTime)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" reason: ").append(toIndentedString(reason)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).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 ");
}
}
| [
"bburns@microsoft.com"
] | bburns@microsoft.com |
49fa3bb27ddad1e9827b5453860610856246e0c7 | 0a94e4bb6bdf5c54ebba25cecafa72215266843a | /2.JavaCore/src/com/javarush/task/task11/task1117/Solution.java | d4c4b35843ec673745890c5aa424bda7144ac341 | [] | no_license | Senat77/JavaRush | 8d8fb6e59375656a545825585118febd2e1637f4 | 68dc0139da96617ebcad967331dcd24f9875d8ee | refs/heads/master | 2020-05-19T18:50:31.534629 | 2018-09-25T14:00:31 | 2018-09-25T14:00:31 | 185,160,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,547 | java | package com.javarush.task.task11.task1117;
/*
Альтернативная цепочка наследования
Расставь правильно "цепочку наследования" в классах: Carnivore (плотоядное животное), Cow (корова), Dog (собака), Pig (свинья), Animal (животное).
Требования:
1. В классе Solution должен быть public класс Carnivore (плотоядное животное).
2. В классе Solution должен быть public класс Cow (корова).
3. В классе Solution должен быть public класс Dog (собака).
4. В классе Solution должен быть public класс Pig (свинья).
5. В классе Solution должен быть public класс Animal (животное).
6. Класс Carnivore должен быть унаследован от класса Animal.
7. Класс Cow должен быть унаследован от класса Animal.
8. Класс Dog должен быть унаследован от класса Carnivore.
9. Класс Pig должен быть унаследован от класса Animal.
*/
public class Solution {
public static void main(String[] args) {
}
public class Carnivore extends Animal {
}
public class Cow extends Animal {
}
public class Dog extends Carnivore {
}
public class Pig extends Animal {
}
public class Animal {
}
}
| [
"sergii.senatorov@gmail.com"
] | sergii.senatorov@gmail.com |
8a37f198ea5155a384bb5edad490d826d7225b8a | 815cb2f74b1c48835d2763df6dbf2fd673772dd0 | /bpm/bonita-core/bonita-process-instance/bonita-process-instance-model-impl/src/main/java/org/bonitasoft/engine/core/process/instance/model/builder/impl/SManualTaskInstanceBuilderImpl.java | ac0395c5c50ed8cdaaf58e9923f731ce5d920dff | [] | no_license | Melandro/bonita-engine | 04238b7b1f6daefbf568e2985f9ad990e66d2a10 | bd4a9ab2492d5e9843a90fd9bbfe14700eb4bddb | refs/heads/master | 2021-01-15T18:36:29.949274 | 2013-08-14T14:22:15 | 2013-08-14T14:47:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,410 | java | /**
* Copyright (C) 2011 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
* 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
* version 2.1 of the License.
* 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
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
package org.bonitasoft.engine.core.process.instance.model.builder.impl;
import org.bonitasoft.engine.core.process.instance.model.SManualTaskInstance;
import org.bonitasoft.engine.core.process.instance.model.STaskPriority;
import org.bonitasoft.engine.core.process.instance.model.builder.SManualTaskInstanceBuilder;
import org.bonitasoft.engine.core.process.instance.model.impl.SFlowNodeInstanceImpl;
import org.bonitasoft.engine.core.process.instance.model.impl.SManualTaskInstanceImpl;
/**
* @author Baptiste Mesta
* @author Matthieu Chaffotte
* @author Celine Souchet
*/
public class SManualTaskInstanceBuilderImpl extends SHumanTaskInstanceBuilderImpl implements SManualTaskInstanceBuilder {
private SManualTaskInstanceImpl activityInst;
@Override
public SManualTaskInstanceBuilder createNewManualTaskInstance(final String name, final long flowNodeDefinitionId, final long rootContainerId,
final long parentContainerId, final long actorId, final long processDefinitionId, final long rootProcessInstanceId,
final long parentProcessInstanceId) {
activityInst = new SManualTaskInstanceImpl(name, flowNodeDefinitionId, rootContainerId, parentContainerId, actorId, STaskPriority.NORMAL,
processDefinitionId,
rootProcessInstanceId);
activityInst.setLogicalGroup(PARENT_PROCESS_INSTANCE_INDEX, parentProcessInstanceId);
return this;
}
@Override
public SManualTaskInstance done() {
return activityInst;
}
@Override
protected SFlowNodeInstanceImpl getEntity() {
return activityInst;
}
}
| [
"emmanuel.duchastenier@bonitasoft.com"
] | emmanuel.duchastenier@bonitasoft.com |
1aff358e1320b22bdb28c2600d298c13319c6253 | fb3f91fb6c18bb93c5d51b58d13e201203833994 | /Trabajos/Sernanp/sources/diana/src/proyecto/dao/CategoriaAnpDAO.java | 24b80cdf23eeb66c14007f4b1214965db9f2b779 | [] | no_license | cgb-extjs-gwt/avgust-extjs-generator | d24241e594078eb8af8e33e99be64e56113a1c0c | 30677d1fef4da73e2c72b6c6dfca85d492e1a385 | refs/heads/master | 2023-07-20T04:39:13.928605 | 2018-01-16T18:17:23 | 2018-01-16T18:17:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,650 | java | package proyecto.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.stereotype.Repository;
import proyecto.constants.RowMappersConstants;
import proyecto.constants.SqlConstants;
import proyecto.util.ConexionBD;
import proyecto.vo.Archivo;
import proyecto.vo.Categoriaanp;
@Repository
public class CategoriaAnpDAO {
private SimpleJdbcTemplate simpleJdbcTemplate;
private JdbcTemplate jdbcTemplate;
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
@Autowired
public void init(DataSource dataSource) {
this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
this.jdbcTemplate=new JdbcTemplate(dataSource);
this.namedParameterJdbcTemplate=new NamedParameterJdbcTemplate(dataSource);
}
public List<Categoriaanp> listar(Categoriaanp categoriaanp){
StringBuffer sqlb = new StringBuffer(SqlConstants.listaCategoriaAnp);
if(categoriaanp.getIdcategoriaanp()!=0 ){
sqlb.append(" and c.idcategoriaanp=" );
sqlb.append(categoriaanp.getIdcategoriaanp());
}
String sql =sqlb.toString();
return this.jdbcTemplate.query(sql, new RowMappersConstants.CategoriaAnpMapper());
}
// JCEV 24-07-2012
public List<Categoriaanp> listarCategoriasAnps(){
StringBuffer sqlb = new StringBuffer(SqlConstants.listaCategoriaAnp);
String sql = sqlb.toString();
return this.jdbcTemplate.query(sql, new RowMappersConstants.CategoriaAnpMapper());
}
/*
public List<Categoriaanp> listar(Categoriaanp categoriaanp) {
Connection cn = null;
PreparedStatement st = null;
ResultSet rs = null;
StringBuffer sqlb = new StringBuffer(SqlConstants.listaCategoriaAnp);
sqlb.append(" and c.estado=" );
sqlb.append(categoriaanp.getEstado());
sqlb.append(" order by c.descategoriaanp " );
String sql =sqlb.toString();
System.out.println(sql);
List<Categoriaanp> lista=new ArrayList<Categoriaanp>();
try{
cn=dt.obtenerConexion();
st=cn.prepareStatement(sql);
rs=st.executeQuery();
while(rs.next()){
Categoriaanp c=new Categoriaanp();
c.setIdcategoriaanp(rs.getInt("idcategoriaanp"));
c.setCodcategoriaanp(rs.getString("codcategoriaanp"));
c.setDescategoriaanp(rs.getString("descategoriaanp"));
c.setSiglascategoriaanp(rs.getString("siglascategoriaanp"));
c.setEstado(rs.getInt("estado"));
lista.add(c);
}
dt.cerrarConexion(cn,rs,st);
}catch(SQLException e){
e.printStackTrace();
}
catch(Exception e){
e.printStackTrace();
}
return lista;
}
*/
/*
public UsuarioVO insertar(UsuarioVO vo) throws DAOException {
Session session = getSession();
Transaction tx = session.beginTransaction();// habre transsaccion
session.save(vo);
tx.commit();
session.close();
return vo;
}
public UsuarioVO actualizar(UsuarioVO vo) throws DAOException {
Session session = getSession();
Transaction tx = session.beginTransaction();
session.update(vo);
tx.commit();
session.close();
return vo;
}
public void eliminar(UsuarioVO vo) throws DAOException {
Session session = getSession();
Transaction tx = session.beginTransaction();
session.delete(vo);
tx.commit();
session.close();
}
*/
}
| [
"raffo8924@gmail.com"
] | raffo8924@gmail.com |
b80df8948358c014b9729777787b739bbd4447fd | f34602b407107a11ce0f3e7438779a4aa0b1833e | /professor/dvl/roadnet-client/src/main/java/com/roadnet/apex/datacontracts/ShiftDaysResultShiftDaysResultItem.java | c61f77799d34034c43df79ad3a3e32cec927a26f | [] | no_license | ggmoura/treinar_11836 | a447887dc65c78d4bd87a70aab2ec9b72afd5d87 | 0a91f3539ccac703d9f59b3d6208bf31632ddf1c | refs/heads/master | 2022-06-14T13:01:27.958568 | 2020-04-04T01:41:57 | 2020-04-04T01:41:57 | 237,103,996 | 0 | 2 | null | 2022-05-20T21:24:49 | 2020-01-29T23:36:21 | Java | UTF-8 | Java | false | false | 4,892 | java |
package com.roadnet.apex.datacontracts;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
import org.datacontract.schemas._2004._07.roadnet_apex_server_services.DataTransferObject;
/**
* <p>Classe Java de ShiftDaysResult.ShiftDaysResultItem complex type.
*
* <p>O seguinte fragmento do esquema especifica o conteúdo esperado contido dentro desta classe.
*
* <pre>
* <complexType name="ShiftDaysResult.ShiftDaysResultItem">
* <complexContent>
* <extension base="{http://schemas.datacontract.org/2004/07/Roadnet.Apex.Server.Services.DataTransferObjectMapping}DataTransferObject">
* <sequence>
* <element name="DayOfWeekFlags" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="ErrorCode" type="{http://roadnet.com/apex/DataContracts/}TransferErrorCode" minOccurs="0"/>
* <element name="OrderEntityKey" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
* <element name="Set" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ShiftDaysResult.ShiftDaysResultItem", propOrder = {
"dayOfWeekFlags",
"errorCode",
"orderEntityKey",
"set"
})
public class ShiftDaysResultShiftDaysResultItem
extends DataTransferObject
{
@XmlElementRef(name = "DayOfWeekFlags", namespace = "http://roadnet.com/apex/DataContracts/", type = JAXBElement.class, required = false)
protected JAXBElement<String> dayOfWeekFlags;
@XmlElementRef(name = "ErrorCode", namespace = "http://roadnet.com/apex/DataContracts/", type = JAXBElement.class, required = false)
protected JAXBElement<TransferErrorCode> errorCode;
@XmlElementRef(name = "OrderEntityKey", namespace = "http://roadnet.com/apex/DataContracts/", type = JAXBElement.class, required = false)
protected JAXBElement<Long> orderEntityKey;
@XmlElementRef(name = "Set", namespace = "http://roadnet.com/apex/DataContracts/", type = JAXBElement.class, required = false)
protected JAXBElement<String> set;
/**
* Obtém o valor da propriedade dayOfWeekFlags.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getDayOfWeekFlags() {
return dayOfWeekFlags;
}
/**
* Define o valor da propriedade dayOfWeekFlags.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setDayOfWeekFlags(JAXBElement<String> value) {
this.dayOfWeekFlags = value;
}
/**
* Obtém o valor da propriedade errorCode.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link TransferErrorCode }{@code >}
*
*/
public JAXBElement<TransferErrorCode> getErrorCode() {
return errorCode;
}
/**
* Define o valor da propriedade errorCode.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link TransferErrorCode }{@code >}
*
*/
public void setErrorCode(JAXBElement<TransferErrorCode> value) {
this.errorCode = value;
}
/**
* Obtém o valor da propriedade orderEntityKey.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link Long }{@code >}
*
*/
public JAXBElement<Long> getOrderEntityKey() {
return orderEntityKey;
}
/**
* Define o valor da propriedade orderEntityKey.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link Long }{@code >}
*
*/
public void setOrderEntityKey(JAXBElement<Long> value) {
this.orderEntityKey = value;
}
/**
* Obtém o valor da propriedade set.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getSet() {
return set;
}
/**
* Define o valor da propriedade set.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setSet(JAXBElement<String> value) {
this.set = value;
}
}
| [
"gleidson.gmoura@gmail.com"
] | gleidson.gmoura@gmail.com |
3e3a71283e9f0ba697d351c36ac27b6e0c9872c6 | a4f1a8877c721c4275cb4d945abeb5da508792e3 | /utterVoiceCommandsBETA_source_from_JADX/com/brandall/nutter/C0144c.java | 28fac650017b4ad249f9ddeb686aa1f9296fb99d | [] | no_license | coolchirag/androidRepez | 36e686d0b2349fa823d810323034a20e58c75e6a | 8d133ed7c523bf15670535dc8ba52556add130d9 | refs/heads/master | 2020-03-19T14:23:46.698124 | 2018-06-13T14:01:34 | 2018-06-13T14:01:34 | 136,620,480 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,224 | java | package com.brandall.nutter;
import android.widget.Toast;
import br.com.dina.ui.widget.C0100d;
final class C0144c implements C0100d {
final /* synthetic */ ActivityAccount f998a;
private C0144c(ActivityAccount activityAccount) {
this.f998a = activityAccount;
}
public final void mo73a(int i) {
if (ServiceTTS.f854f) {
Toast.makeText(this.f998a, "Disabled during tutorial", 0).show();
return;
}
switch (i) {
case 0:
ActivityAccount.m481a(this.f998a);
return;
case 1:
ActivityAccount.m483b(this.f998a);
return;
case 2:
ActivityAccount.m484c(this.f998a);
return;
case 3:
ActivityAccount.m485d(this.f998a);
return;
case 4:
ActivityAccount.m486e(this.f998a);
return;
case 5:
if (lx.m1436k(this.f998a).matches("a")) {
ActivityAccount.m487f(this.f998a);
return;
}
return;
default:
return;
}
}
}
| [
"j.chirag5555@gmail.com"
] | j.chirag5555@gmail.com |
29e3a4bdd75f6ee215b1e6dd7105dc7d2128ff99 | 9a2f1aa0a83fb2f2fea0a5196966c1d9bd14b75c | /03_Addition/AdditionUIMVC.java | 91b5e5d946ba219042966d9757edc80fd41f6ab4 | [] | no_license | SiyuanZeng/14_GUI | 66b48700619042fff311ac2fa29640ec1593c92c | 7d11fe7190d7c0029846df08f20120af5731e00e | refs/heads/master | 2022-11-25T00:25:53.502351 | 2016-09-28T06:17:00 | 2016-09-28T06:17:00 | 65,368,079 | 0 | 0 | null | 2022-11-16T07:18:38 | 2016-08-10T09:12:06 | Java | UTF-8 | Java | false | false | 2,271 | java | import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
public class AdditionUI extends JFrame{
JTextField txtNumber1;
JTextField txtNumber2;
JTextField txtSum;
JButton bttnAdd;
JButton bttnClear;
Calculator calc;
public AdditionUI(Calculator c){
calc = c;
setLayout(new GridLayout(4, 4));
setSize(250,150);
add(new JLabel("First Number: "));
add(txtNumber1 = new JTextField(10));
add(new JLabel("Second Number: "));
add(txtNumber2 = new JTextField(10));
add(new JLabel("Sum: "));
add(txtSum = new JTextField(10));
txtSum.setEnabled(false);
ActionListener l = new AdditionListener();
bttnAdd = new JButton("Add");
bttnAdd.addActionListener(l);
add(bttnAdd);
bttnClear = new JButton("Clear");
bttnClear.addActionListener(l);
add(bttnClear);
}
private class AdditionListener implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == bttnAdd){
addNumbers();
}else if(e.getSource()== bttnClear){
clearFields();
}
}
private void addNumbers(){
try{
calc.setOperand1(Double.parseDouble(txtNumber1.getText()));
calc.setOperand2(Double.parseDouble(txtNumber2.getText()));
calc.add();
txtSum.setText(String.valueOf(calc.getResult()));
}catch(Exception ex){
JOptionPane.showMessageDialog(AdditionUI.this, "Error occured computing sum");
ex.printStackTrace();
}
}
private void clearFields(){
txtNumber1.setText("");
txtNumber2.setText("");
txtSum.setText("");
}
}
public static void main(String args[]){
Calculator calc = new Calculator();
JFrame app = new AdditionUI(calc);
app.setTitle("Sum Application");
app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
app.setVisible(true);
}
}
public class Calculator {
private double operand1, operand2, result;
public void setOperand1(int o) {
operand1 = o;
}
public void setOperand2(int o) {
operand2 = o;
}
public void add() {
result = operand1 + operand2;
}
public double getResult() {
return result;
}
} | [
"siyuanzeng@gmail.com"
] | siyuanzeng@gmail.com |
2e80ebf1c1c920880d17e63420a9ad5c3b104ce1 | d1ea5077c83cb2e93fe69e3d19a2e26efe894a0e | /src/main/java/com/rograndec/feijiayun/chain/business/distr/parent/vo/RequestBaseOrderVO.java | 16549795813dcc544a1703e6d31650ff3f74e5cd | [] | no_license | Catfeeds/rog-backend | e89da5a3bf184e4636169e7492a97dfd0deef2a1 | 109670cfec6cbe326b751e93e49811f07045e531 | refs/heads/master | 2020-04-05T17:36:50.097728 | 2018-10-22T16:23:55 | 2018-10-22T16:23:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,480 | java | package com.rograndec.feijiayun.chain.business.distr.parent.vo;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModelProperty;
/**
* 版权:融贯资讯 <br/>
* 作者:xingjian.lan@rograndec.com <br/>
* 生成日期:2017/9/30 <br/>
* 描述:配送单调用其它单据生成配送单保存传参
*/
public class RequestBaseOrderVO {
@ApiModelProperty(value = "要货单位ID",required = true)
private Long requestUnitId;
@ApiModelProperty(value = "基础单据明细",required = true)
private Long baseOrderDtlId;
@ApiModelProperty(value = "配货数量",required = true)
private BigDecimal quantity;
@ApiModelProperty(value = "行号",required = true)
private Integer lineNum;
public Long getRequestUnitId() {
return requestUnitId;
}
public void setRequestUnitId(Long requestUnitId) {
this.requestUnitId = requestUnitId;
}
public Long getBaseOrderDtlId() {
return baseOrderDtlId;
}
public void setBaseOrderDtlId(Long baseOrderDtlId) {
this.baseOrderDtlId = baseOrderDtlId;
}
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public Integer getLineNum() {
return lineNum;
}
public void setLineNum(Integer lineNum) {
this.lineNum = lineNum;
}
}
| [
"ruifeng.jia@rograndec.com"
] | ruifeng.jia@rograndec.com |
6a0acde56b9f115443761de2a8a2b4b21858b1d8 | 2f4a058ab684068be5af77fea0bf07665b675ac0 | /app/com/facebook/katana/c2dm/SystemTrayErrorNotificationPostActivity$4.java | c59f91504775b667d9d95713a516a800ac0cd2e4 | [] | no_license | cengizgoren/facebook_apk_crack | ee812a57c746df3c28fb1f9263ae77190f08d8d2 | a112d30542b9f0bfcf17de0b3a09c6e6cfe1273b | refs/heads/master | 2021-05-26T14:44:04.092474 | 2013-01-16T08:39:00 | 2013-01-16T08:39:00 | 8,321,708 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 658 | java | package com.facebook.katana.c2dm;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
class SystemTrayErrorNotificationPostActivity$4
implements DialogInterface.OnClickListener
{
public void onClick(DialogInterface paramDialogInterface, int paramInt)
{
this.a.finish();
this.a.startActivity(new Intent("android.settings.ADD_ACCOUNT_SETTINGS"));
}
}
/* Location: /data1/software/jd-gui/com.facebook.katana_2.0_liqucn.com-dex2jar.jar
* Qualified Name: com.facebook.katana.c2dm.SystemTrayErrorNotificationPostActivity.4
* JD-Core Version: 0.6.0
*/ | [
"macluz@msn.com"
] | macluz@msn.com |
a50c303b5217c8659326a73c7052d9eea366e0b6 | 76ad64ad8a606e03f3b6d92dba99cd9eb22fd366 | /kikaha-core/source/kikaha/core/modules/websocket/WebSocketHandler.java | 8978eea5845f2b88856152875c0ec3f4ca8e42db | [
"Apache-2.0"
] | permissive | Skullabs/kikaha | 069cd66d1dbfda9bface09d12a13436c6f2a8804 | 0df3ca87e1ffe50e5f53b582fc0f734ac69e422c | refs/heads/version-2.1.x | 2023-08-27T12:43:15.321098 | 2021-06-14T04:11:42 | 2021-06-14T04:11:42 | 20,723,726 | 73 | 27 | Apache-2.0 | 2023-04-15T20:20:58 | 2014-06-11T12:09:38 | Java | UTF-8 | Java | false | false | 369 | java | package kikaha.core.modules.websocket;
import io.undertow.websockets.core.CloseMessage;
import java.io.IOException;
public interface WebSocketHandler {
void onOpen( final WebSocketSession session );
void onText( final WebSocketSession session, final String message ) throws IOException;
void onClose( final WebSocketSession session, final CloseMessage cm );
}
| [
"miere00@gmail.com"
] | miere00@gmail.com |
ed71ab7a89187a02d505bf8336a3d58d930d9787 | b0430f6099849ca4f0b4bebab71b65031a8fee80 | /springboot-jpa/src/test/java/com/example/demo/SpringbootJpaApplicationTests.java | 1240a8f29d534343dd1229069d7bc72368c7526f | [] | no_license | zhaodewang/spring-boot-all | af74456031ef559d46e7ed4c4ae05a392feaed88 | 475be14a08544b89d43746b8618c898639c4d207 | refs/heads/master | 2021-07-04T23:03:33.417966 | 2017-09-25T08:25:55 | 2017-09-25T08:25:55 | 103,111,994 | 3 | 0 | null | 2017-09-25T08:25:56 | 2017-09-11T08:47:21 | Java | UTF-8 | Java | false | false | 340 | java | package com.example.demo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringbootJpaApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"jiaozhiguang@126.com"
] | jiaozhiguang@126.com |
e94cb5abcb71552fd9a8a93898b0e0c9d03563b7 | 11fced7d40e3e46d85a2d5afea272dbc6ad8c3c2 | /src/chapter13/PE1306_TestImproveFigurePanel.java | c35cff5f7fffeca3e11b063f6c107a538b0e9520 | [] | no_license | Lo1s/JavaIntroduction | 152c94c45f99992df9e32fc5608eda617cd8b9d5 | 9aa4f37210706ec30f49a15ed339dfff3d175f47 | refs/heads/master | 2016-09-06T17:55:26.432493 | 2015-07-03T09:34:38 | 2015-07-03T09:34:38 | 37,971,996 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 969 | java | /**
*
*/
package chapter13;
import java.awt.GridLayout;
import javax.swing.JFrame;
/**
* @author hydRa
*
*/
public class PE1306_TestImproveFigurePanel extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
public PE1306_TestImproveFigurePanel() {
setLayout(new GridLayout(2, 2));
add(new PE1306_ImproveFigurePanel(PE1306_ImproveFigurePanel.ARC));
add(new PE1306_ImproveFigurePanel(PE1306_ImproveFigurePanel.POLYGON));
add(new PE1306_ImproveFigurePanel(PE1306_ImproveFigurePanel.ARC, true));
add(new PE1306_ImproveFigurePanel(PE1306_ImproveFigurePanel.POLYGON, true));
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame frame = new PE1306_TestImproveFigurePanel();
frame.setTitle("Exercise13_06");
frame.setSize(300, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
| [
"hydRwa@gmail.com"
] | hydRwa@gmail.com |
0e26f4a65fa05a15ee29102ab71c6aaf1f6b212a | b85d0ce8280cff639a80de8bf35e2ad110ac7e16 | /com/fossil/cce.java | 29a971f57c20bd4fc2ca937a829e081c602e8bbe | [] | no_license | MathiasMonstrey/fosil_decompiled | 3d90433663db67efdc93775145afc0f4a3dd150c | 667c5eea80c829164220222e8fa64bf7185c9aae | refs/heads/master | 2020-03-19T12:18:30.615455 | 2018-06-07T17:26:09 | 2018-06-07T17:26:09 | 136,509,743 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 359 | java | package com.fossil;
import com.fossil.cay.C1982c;
final class cce implements Runnable {
private /* synthetic */ C1982c bLp;
private /* synthetic */ caz bLt;
cce(C1982c c1982c, caz com_fossil_caz) {
this.bLp = c1982c;
this.bLt = com_fossil_caz;
}
public final void run() {
this.bLp.bKK.m5904a(this.bLt);
}
}
| [
"me@mathiasmonstrey.be"
] | me@mathiasmonstrey.be |
45627e22f6dc0727360522c3ce2e6b4f0ed0adbe | 52db46cda46618dbd3028e5f54df0864c8ff65b8 | /src/main/java/com/intellij/uiDesigner/impl/propertyInspector/editors/AbstractTextFieldEditor.java | 1dc5b46aa668b08f69ee3a3444c423c2385816f0 | [
"Apache-2.0"
] | permissive | consulo/consulo-ui-designer | 73279cdcce6b7006200a08aba56493ae1bd46ac9 | 1a7872cd107c90d8775d3c0e433b4a14bbae418f | refs/heads/master | 2023-08-31T00:23:34.185990 | 2023-05-07T11:01:58 | 2023-05-07T11:01:58 | 13,801,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,138 | java | /*
* Copyright 2000-2009 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.uiDesigner.impl.propertyInspector.editors;
import com.intellij.uiDesigner.impl.propertyInspector.PropertyEditor;
import com.intellij.uiDesigner.impl.propertyInspector.InplaceContext;
import com.intellij.uiDesigner.impl.radComponents.RadComponent;
import consulo.ui.ex.awt.UIUtil;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author yole
*/
public abstract class AbstractTextFieldEditor<V> extends PropertyEditor<V> {
protected final JTextField myTf;
protected AbstractTextFieldEditor() {
myTf = new JTextField();
myTf.addActionListener(new MyActionListener());
}
public void updateUI() {
SwingUtilities.updateComponentTreeUI(myTf);
}
protected void setValueFromComponent(RadComponent component, V value) {
myTf.setText(value == null ? "" : value.toString());
}
public JComponent getComponent(final RadComponent ignored, final V value, final InplaceContext inplaceContext) {
setValueFromComponent(ignored, value);
if(inplaceContext != null) {
myTf.setBorder(UIUtil.getTextFieldBorder());
if (inplaceContext.isStartedByTyping()) {
myTf.setText(Character.toString(inplaceContext.getStartChar()));
}
}
else{
myTf.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
}
return myTf;
}
protected final class MyActionListener implements ActionListener {
public void actionPerformed(final ActionEvent e){
fireValueCommitted(true, false);
}
}
}
| [
"vistall.valeriy@gmail.com"
] | vistall.valeriy@gmail.com |
6bea350b5fddb90f2fd6b81c4cde4a04fd665ed9 | a466bc80061d8686a6ba9547c88a005201b556c2 | /app/src/main/java/cc/bocang/bocang/utils/ImageUtil.java | 2e4c5b1eadbcbf7925051c2ccff1ec21f193e901 | [] | no_license | gamekonglee/yangguang | 22e1bcd2ff5882d155c3c5684042769208dd1a70 | 0b23b8e6e86143843352cc9a1a6b25d17e94da64 | refs/heads/master | 2020-07-05T15:06:25.775305 | 2019-09-25T09:59:25 | 2019-09-25T09:59:25 | 202,680,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,429 | java | package cc.bocang.bocang.utils;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.view.View;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* Created by xpHuang on 2016/8/13.
*/
public class ImageUtil {
/**
* 以最省内存的方式读取本地资源的图片
*
* @param context
* 上下文
* @param resId
* 本地资源图片id
* @return Bitmap
*/
public static Bitmap getBitmapById(Context context, int resId) {
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inPreferredConfig = Bitmap.Config.RGB_565;
opt.inPurgeable = true;
opt.inInputShareable = true;
InputStream is = context.getResources().openRawResource(resId);
return BitmapFactory.decodeStream(is, null, opt);
}
/**
* 根据一个网络连接(String)获取bitmap图像
*
* @param imageUri
* @return
*/
public static Bitmap getbitmap(String imageUri) {
// 显示网络上的图片
Bitmap bitmap = null;
try {
URL myFileUrl = new URL(imageUri);
HttpURLConnection conn = (HttpURLConnection) myFileUrl
.openConnection();
conn.setDoInput(true);
conn.connect();
InputStream is = conn.getInputStream();
bitmap = BitmapFactory.decodeStream(is);
is.close();
} catch (OutOfMemoryError e) {
e.printStackTrace();
bitmap = null;
} catch (IOException e) {
e.printStackTrace();
bitmap = null;
}
return bitmap;
}
// /**
// * 把Bitmap转Byte
// * @Author HEH
// * @EditTime 2010-07-19 上午11:45:56
// */
// public static byte[] Bitmap2Bytes(Bitmap bm){
// ByteArrayOutputStream baos = new ByteArrayOutputStream();
// bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
// return baos.toByteArray();
// }
public static byte[] getBitmapByte(Bitmap bitmap){
ByteArrayOutputStream out = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
bitmap.recycle();//自由选择是否进行回收
// byte[] result = out.toByteArray();//转换成功了
try {
out.close();
} catch (Exception e) {
e.printStackTrace();
}
return out.toByteArray();
}
// 将Bitmap转换成InputStream
public static InputStream Bitmap2InputStream(Bitmap bm) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 100, baos);
InputStream is = new ByteArrayInputStream(baos.toByteArray());
return is;
}
// Drawable转换成InputStream
public static InputStream Drawable2InputStream(Drawable d) {
Bitmap bitmap = drawable2Bitmap(d);
return Bitmap2InputStream(bitmap);
}
// Drawable转换成Bitmap
public static Bitmap drawable2Bitmap(Drawable drawable) {
Bitmap bitmap = Bitmap
.createBitmap(
drawable.getIntrinsicWidth(),
drawable.getIntrinsicHeight(),
drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888
: Bitmap.Config.RGB_565);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),
drawable.getIntrinsicHeight());
drawable.draw(canvas);
return bitmap;
}
public static synchronized byte[] drawableToByte(Drawable drawable) {
if (drawable != null) {
Bitmap bitmap = Bitmap
.createBitmap(
drawable.getIntrinsicWidth(),
drawable.getIntrinsicHeight(),
drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888
: Bitmap.Config.RGB_565);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),
drawable.getIntrinsicHeight());
drawable.draw(canvas);
int size = bitmap.getWidth() * bitmap.getHeight() * 4;
// 创建一个字节数组输出流,流的大小为size
ByteArrayOutputStream baos = new ByteArrayOutputStream(size);
// 设置位图的压缩格式,质量为100%,并放入字节数组输出流中
bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);
// 将字节数组输出流转化为字节数组byte[]
byte[] imagedata = baos.toByteArray();
return imagedata;
}
return null;
}
public static Bitmap takeScreenShot(Activity activity) {
// View是你需要截图的View
View view = activity.getWindow().getDecorView();
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
Bitmap b1 = view.getDrawingCache();
// 获取状态栏高度
Rect frame = new Rect();
activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
int statusBarHeight = frame.top;
// 获取屏幕长和高
int width = activity.getWindowManager().getDefaultDisplay().getWidth();
int height = activity.getWindowManager().getDefaultDisplay()
.getHeight();
// 去掉标题栏
Bitmap b = Bitmap.createBitmap(b1, 0, statusBarHeight, width, height
- statusBarHeight);
view.destroyDrawingCache();
return b;
}
/**
* Bitmap转换成byte[]并且进行压缩,压缩到不大于maxkb
* @param bitmap
* @param IMAGE_SIZE
* @return
*/
public static byte[] bitmap2Bytes(Bitmap bitmap, int maxkb) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, output);
int options = 100;
while (output.toByteArray().length/1024 > maxkb&& options != 10) {
output.reset(); //清空output
bitmap.compress(Bitmap.CompressFormat.JPEG, options, output);//这里压缩options%,把压缩后的数据存放到output中
options -= 10;
}
return output.toByteArray();
}
public static Bitmap createThumbBitmap(Bitmap bm,int newWidth,int newHeight) {
// 获得图片的宽高
int width = bm.getWidth();
int height = bm.getHeight();
// 计算缩放比例
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;
// 取得想要缩放的matrix参数
Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
// 得到新的图片
Bitmap newbm = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true);
return newbm;
}
}
| [
"451519474@qq.com"
] | 451519474@qq.com |
7ec485a5b86d7cd1834e09180661c7f58037531f | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project70/src/main/java/org/gradle/test/performance70_1/Production70_60.java | 9b186a0f8a68cbbe2e0c08a1485df3450c7e0bcf | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 302 | java | package org.gradle.test.performance70_1;
public class Production70_60 extends org.gradle.test.performance16_1.Production16_60 {
private final String property;
public Production70_60() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
d58b95a762ff771b1ec996e6b858da32d588da2d | 9892dcbf85a70b4c09281a54472c6815df7848e8 | /optaplanner-core/src/main/java/org/optaplanner/core/impl/heuristic/selector/move/generic/ChangeMove.java | 6b6d685585812b46ea73651640ab7aafbaf04b6b | [
"Apache-2.0"
] | permissive | vidya-iyengar/optaplanner | c8ec18effdfbae6984f4ff2500b56012b50f325e | f8926abd847b553a031c087593c8edeae559e6e6 | refs/heads/master | 2021-01-22T14:38:46.099182 | 2016-03-14T11:53:05 | 2016-03-14T11:53:05 | 46,541,935 | 0 | 0 | null | 2015-11-20T05:39:17 | 2015-11-20T05:39:16 | null | UTF-8 | Java | false | false | 4,148 | java | /*
* Copyright 2011 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.optaplanner.core.impl.heuristic.selector.move.generic;
import java.util.Collection;
import java.util.Collections;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor;
import org.optaplanner.core.impl.heuristic.move.AbstractMove;
import org.optaplanner.core.impl.heuristic.move.Move;
import org.optaplanner.core.impl.score.director.ScoreDirector;
public class ChangeMove extends AbstractMove {
protected final Object entity;
protected final GenuineVariableDescriptor variableDescriptor;
protected final Object toPlanningValue;
public ChangeMove(Object entity, GenuineVariableDescriptor variableDescriptor,
Object toPlanningValue) {
this.entity = entity;
this.variableDescriptor = variableDescriptor;
this.toPlanningValue = toPlanningValue;
}
public Object getEntity() {
return entity;
}
public Object getToPlanningValue() {
return toPlanningValue;
}
// ************************************************************************
// Worker methods
// ************************************************************************
public boolean isMoveDoable(ScoreDirector scoreDirector) {
Object oldValue = variableDescriptor.getValue(entity);
return !ObjectUtils.equals(oldValue, toPlanningValue);
}
public Move createUndoMove(ScoreDirector scoreDirector) {
Object oldValue = variableDescriptor.getValue(entity);
return new ChangeMove(entity, variableDescriptor, oldValue);
}
@Override
protected void doMoveOnGenuineVariables(ScoreDirector scoreDirector) {
scoreDirector.beforeVariableChanged(variableDescriptor, entity);
variableDescriptor.setValue(entity, toPlanningValue);
scoreDirector.afterVariableChanged(variableDescriptor, entity);
}
// ************************************************************************
// Introspection methods
// ************************************************************************
@Override
public String getSimpleMoveTypeDescription() {
return getClass().getSimpleName() + "(" + variableDescriptor.getSimpleEntityAndVariableName() + ")";
}
public Collection<? extends Object> getPlanningEntities() {
return Collections.singletonList(entity);
}
public Collection<? extends Object> getPlanningValues() {
return Collections.singletonList(toPlanningValue);
}
public boolean equals(Object o) {
if (this == o) {
return true;
} else if (o instanceof ChangeMove) {
ChangeMove other = (ChangeMove) o;
return new EqualsBuilder()
.append(entity, other.entity)
.append(variableDescriptor, other.variableDescriptor)
.append(toPlanningValue, other.toPlanningValue)
.isEquals();
} else {
return false;
}
}
public int hashCode() {
return new HashCodeBuilder()
.append(entity)
.append(variableDescriptor)
.append(toPlanningValue)
.toHashCode();
}
public String toString() {
Object oldValue = variableDescriptor.getValue(entity);
return entity + " {" + oldValue + " -> " + toPlanningValue + "}";
}
}
| [
"gds.geoffrey.de.smet@gmail.com"
] | gds.geoffrey.de.smet@gmail.com |
cec4f8132f60c4393419eb367217cdabea394731 | 4266e5085a5632df04c63dc3b11b146ef4be40fa | /exercises/week4/exercise7/dorothy/src/main/java/academy/everyonecodes/dorothy/DorothyApplication.java | 5ea11a289ec7073d9c9d5786df7e5f767942c449 | [] | no_license | uanave/springboot-module | ab918e8e4d6b228dcabcfb1b040458eb9c705977 | 3842925501ef3f08add19ca7ed055a3f84260088 | refs/heads/master | 2022-12-27T17:29:22.130619 | 2020-10-13T14:04:33 | 2020-10-13T14:04:33 | 246,023,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package academy.everyonecodes.dorothy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DorothyApplication {
public static void main(String[] args) {
SpringApplication.run(DorothyApplication.class, args);
}
}
| [
"uanavasile@gmail.com"
] | uanavasile@gmail.com |
d2860c6c2e0a37fce22b89375cce3ffd59b6dd90 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-418-13-26-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/listener/chaining/AbstractChainingListener_ESTest.java | 2f10c7b971ce037e3495b3f1dcbb99fce8515cfd | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 592 | java | /*
* This file was automatically generated by EvoSuite
* Fri Apr 03 03:07:50 UTC 2020
*/
package org.xwiki.rendering.listener.chaining;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class AbstractChainingListener_ESTest extends AbstractChainingListener_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
93408d2989055699804e3f243e835d672b23aad2 | e37de6db1d0f1ca70f48ffc5eafc6e43744bc980 | /mondrian/mondrian-model/src/main/java/com/tonbeller/jpivot/table/SlicerBuilder.java | aa25c00b3f60db61c84e7b89f308b8d70ebd4fb3 | [] | no_license | cnopens/BA | 8490e6e83210343a35bb1e5a6769209a16557e3f | ba58acf949af1249cc637ccf50702bb28462d8ad | refs/heads/master | 2021-01-20T16:38:38.479034 | 2014-11-13T00:44:00 | 2014-11-13T00:44:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | /*
* ====================================================================
* This software is subject to the terms of the Common Public License
* Agreement, available at the following URL:
* http://www.opensource.org/licenses/cpl.html .
* Copyright (C) 2003-2004 TONBELLER AG.
* All Rights Reserved.
* You must accept the terms of that agreement to use this software.
* ====================================================================
*
*
*/
package com.tonbeller.jpivot.table;
import org.json.simple.JSONObject;
import org.w3c.dom.Element;
import com.tonbeller.jpivot.olap.model.Member;
/**
* Created on 18.10.2002
*
* @author av
*/
public interface SlicerBuilder extends PartBuilder {
Element build(Member m);
JSONObject buildJo(Member m);
}
| [
"panbasten@126.com"
] | panbasten@126.com |
a9c4737f9cbcaf756d81ed66c0bc7449cf3aa669 | bf249b20d0cbb0794bdf631c7adf110315aab812 | /src/main/java/com/gl/ecomm/roadAccident/service/impl/WeatherConditionsServiceImpl.java | 66a3a0eeed32ae5500c58f02ec36f76b43430d02 | [
"Apache-2.0"
] | permissive | gavin2lee/ecomm | 2c5104234ff26f87de281bad59f0a9778d5b03e8 | 04fea34e3a63e6775077380393155d960600a1b6 | refs/heads/master | 2021-01-01T05:18:01.880954 | 2016-05-12T06:24:26 | 2016-05-12T06:24:26 | 57,892,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,055 | java | package com.gl.ecomm.roadAccident.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import com.gl.ecomm.roadAccident.mapper.WeatherConditionsMapper;
import com.gl.ecomm.roadAccident.model.WeatherConditions;
import com.gl.ecomm.roadAccident.service.WeatherConditionsService;
public class WeatherConditionsServiceImpl implements WeatherConditionsService {
@Autowired
private WeatherConditionsMapper weatherConditionsMapper;
public WeatherConditionsMapper getWeatherConditionsMapper() {
return weatherConditionsMapper;
}
public void setWeatherConditionsMapper(WeatherConditionsMapper weatherConditionsMapper) {
this.weatherConditionsMapper = weatherConditionsMapper;
}
@Override
public WeatherConditions getWeatherConditions(Integer code) {
return weatherConditionsMapper.findWeatherConditions(code);
}
@Override
public void addWeatherConditions(WeatherConditions wc) {
weatherConditionsMapper.insertWeatherConditions(wc);
}
@Override
public void clear() {
weatherConditionsMapper.truncate();
}
}
| [
"gavin2lee@163.com"
] | gavin2lee@163.com |
a8744c88596fb7474ec9b884d669bc3b27639bfc | 8e9e10734775849c1049840727b63de749c06aae | /src/java/com/webify/shared/edi/model/hipaa837p/Loop2305.java | 566c4152c0dc3c7aba722454d7442eadccdc1231 | [] | no_license | mperham/edistuff | 6ee665082b7561d73cb2aa49e7e4b0142b14eced | ebb03626514d12e375fa593e413f1277a614ab76 | refs/heads/master | 2023-08-24T00:17:34.286847 | 2020-05-04T21:31:42 | 2020-05-04T21:31:42 | 261,299,559 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | package com.webify.shared.edi.model.hipaa837p;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.webify.shared.edi.model.hipaa837p.beans.BaseLoop2305;
/*
* BaseLoop2305 subclass, put any business logic in this class
*/
public class Loop2305 extends BaseLoop2305 {
private static final Log log = LogFactory.getLog(Loop2305.class);
/*
* Uncomment this to hook into the input validation. This method is
* called when an EDI file is parsed into a document.
protected void validate(EDIInputStream eis) {
super.validate(eis);
}
*/
}
| [
"mperham@gmail.com"
] | mperham@gmail.com |
5458f6ca777e82d9869243df475d9eb5429073d4 | d6b388ca2be1bac9399f881da644e6ebccffa90c | /src/gradingTools/comp524f22/assignment4/Assignment4Requirements.java | b3d2419442cb27f823c033239d3f91fce38f4983 | [
"MIT"
] | permissive | pdewan/Comp524AllChecks | 832746de30376848664a0b6fe860cb13f60a03f6 | 796c6ba4857063cc068d5a25188efb33e0455294 | refs/heads/master | 2023-09-06T04:18:43.574108 | 2023-09-04T01:32:44 | 2023-09-04T01:32:44 | 192,162,652 | 0 | 0 | MIT | 2023-07-22T08:28:53 | 2019-06-16T07:28:24 | Java | UTF-8 | Java | false | false | 855 | java | package gradingTools.comp524f22.assignment4;
import grader.basics.project.BasicProjectIntrospection;
import grader.junit.AJUnitProjectRequirements;
import gradingTools.sharedTestCase.DocumentEnclosedTestCase;
public class Assignment4Requirements extends AJUnitProjectRequirements {
public Assignment4Requirements() {
// Comp533TraceUtility.setTurnOn(true);
// Comp533TraceUtility.setTracing();
// GraderTraceUtility.setTurnOn(true);
// GraderTraceUtility.setTracing();
addDueDate("11/01/2022 01:00:00", 1.05);
addDueDate("11/03/2022 01:00:00", 1.0);
addDueDate("11/10/2022 01:00:00", 0.9);
addDueDate("11/17/2022 01:00:00", 0.70);
BasicProjectIntrospection.setUseMainClass(true);
addJUnitTestSuite(F22Assignment4Suite.class);
addFeature("Screenshots enclosed", 3, new DocumentEnclosedTestCase());
}
}
| [
"dewan@cs.unc.edu"
] | dewan@cs.unc.edu |
74dff07a6077f9e66230d4ce0ff5b7c4cdff7dbc | e49bef1b36c879b1f0366cb80ab5a3ae745aabd3 | /sources/com/google/android/gms/internal/p001firebaseauthapi/zzew.java | a71249c2139526f4c7fa814facc2e13a888f9b04 | [] | no_license | mathias-mike/EplStars | 2e154f6ac0bee3cd1c9bafd7e6ce9bd47ce9bf67 | 7c7b86b6c892d974567f62c92793e76edd0d09d7 | refs/heads/master | 2023-07-23T11:16:33.160876 | 2021-09-02T10:07:51 | 2021-09-02T10:07:51 | 124,019,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | package com.google.android.gms.internal.p001firebaseauthapi;
/* renamed from: com.google.android.gms.internal.firebase-auth-api.zzew reason: invalid package */
/* compiled from: com.google.firebase:firebase-auth@@20.0.2 */
public final class zzew extends zzzz<zzex, zzew> implements zzabh {
private zzew() {
super(zzex.zzf);
}
/* synthetic */ zzew(zzev zzev) {
super(zzex.zzf);
}
public final zzew zza(zzfd zzfd) {
if (this.zzb) {
zzi();
this.zzb = false;
}
zzex.zzf((zzex) this.zza, zzfd);
return this;
}
public final zzew zzb(zzhu zzhu) {
if (this.zzb) {
zzi();
this.zzb = false;
}
zzex.zzg((zzex) this.zza, zzhu);
return this;
}
}
| [
"leesanmoj@gmail.com"
] | leesanmoj@gmail.com |
b4b30a1060bd4c5749893bf9f0b455a7c274105a | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project43/src/test/java/org/gradle/test/performance43_4/Test43_381.java | 5acb29232972e0dcdde1167cc37f22cc893c8df9 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance43_4;
import static org.junit.Assert.*;
public class Test43_381 {
private final Production43_381 production = new Production43_381("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
55f35e4a1c4202ad8b39caf7d1f21e9f0fda5a3a | 127b3f3be47561ba076a22b9bbdc4d911469292e | /app/src/main/java/com/cqyanyu/backing/ui/presenter/home/WarnPresenter.java | 7b35cfc023a7dcf909a3cf4d725b2c7cf0d01b0f | [] | no_license | csw14n0/AndroidProtect1 | 4b6566ff8b88d4824c37e6667db8fb31a39e80ae | 68dc13be32507264db5bc679d915430a124277b0 | refs/heads/master | 2020-06-16T18:14:44.903232 | 2017-11-08T10:32:05 | 2017-11-08T10:32:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,911 | java | package com.cqyanyu.backing.ui.presenter.home;
import android.text.TextUtils;
import com.alibaba.fastjson.JSON;
import com.cqyanyu.backing.ConstHost;
import com.cqyanyu.backing.ui.entity.warn.HostWarnEntity;
import com.cqyanyu.backing.ui.entity.warn.WaterSystemEntity;
import com.cqyanyu.backing.ui.fragment.alarm.AlarmFragment;
import com.cqyanyu.backing.ui.holder.warn.HostWarnHolder;
import com.cqyanyu.backing.ui.holder.warn.WaterSystemHolder;
import com.cqyanyu.backing.ui.mvpview.warn.HostWarnView;
import com.cqyanyu.backing.ui.presenter.base.XPagePresenter;
import com.cqyanyu.mvpframework.utils.http.ParamsMap;
import java.util.List;
import cn.bingoogolapple.refreshlayout.BGARefreshLayout;
/**
* 告警处理
* Created by Administrator on 2017/7/11.
*/
public class WarnPresenter extends XPagePresenter<HostWarnView> implements BGARefreshLayout.BGARefreshLayoutDelegate {
private int pagecount = 20;
private int pageindex = 0;
@Override
public void initPresenter() {
if (getView() != null) {
/**初始化RecyclerView*/
setRecyclerView();
/**为RecyclerView绑定数据*/
switch (getView().getLabel()) {
case AlarmFragment.LABEL_VALUE_HOST://主机
mRecyclerView.getAdapter().bindHolder(new HostWarnHolder());
break;
case AlarmFragment.LABEL_VALUE_WATER_SYSTEM://水系统
mRecyclerView.getAdapter().bindHolder(new WaterSystemHolder());
break;
}
}
}
@Override
protected ParamsMap getParamsMap() {
ParamsMap paramsMap = new ParamsMap();
//paramsMap.put("mcondition", "");//搜索条件
paramsMap.put("pageindex", pageindex + "");
paramsMap.put("count", "" + pagecount);
return paramsMap;
}
@Override
protected String getURL() {
switch (getView().getLabel()) {
case AlarmFragment.LABEL_VALUE_HOST://主机
return ConstHost.GET_HOST_ALARM_URL;
case AlarmFragment.LABEL_VALUE_WATER_SYSTEM://水系统
return ConstHost.GET_WARN_SYSTEM_URL;
}
return "";
}
@Override
protected Class getClazz() {
switch (getView().getLabel()) {
case AlarmFragment.LABEL_VALUE_HOST://主机
return HostWarnEntity.class;
case AlarmFragment.LABEL_VALUE_WATER_SYSTEM://水系统
return WaterSystemEntity.class;
}
return null;
}
@Override
public void refresh() {
pageindex = 0;
super.refresh();
}
@Override
protected void onXSuccess(String result) {
try {
if (!TextUtils.isEmpty(result)) {
org.json.JSONObject object = new org.json.JSONObject(result);
int total = object.optInt("total");
int count = object.optInt("count");
String trueResult = object.optString("rows");
List mList = JSON.parseArray(trueResult, getClazz());
if (mList != null && mList.size() > 0) {
/**显示数据*/
if (getView() != null) getView().hasShowData(true);
setData(mList);
/**设置当前页数*/
pageindex += count;
/**设置是否可以下拉加载*/
isLoad = pageindex < total;
return;
}
}
} catch (Exception e) {
e.getStackTrace();
}
if (pageindex == 0) onLoadNoData();
}
@Override
protected void setData(List mList) {
if (pageindex == 0) {
mRecyclerView.getAdapter().setData(0, mList);
} else {
mRecyclerView.getAdapter().addDataAll(0, mList);
}
}
} | [
"1763831144@qq.com"
] | 1763831144@qq.com |
64712aa214d59022ac9be687d2c966ad13578bad | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/branches/config/common/src/main/java/com/tc/management/beans/logging/TCLoggingBroadcaster.java | 3fab216fa36ed32e72ce2d008f9ce5c0010b46be | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,233 | java | /*
* All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
*/
package com.tc.management.beans.logging;
import com.tc.management.AbstractTerracottaMBean;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import javax.management.MBeanNotificationInfo;
import javax.management.NotCompliantMBeanException;
import javax.management.Notification;
public final class TCLoggingBroadcaster extends AbstractTerracottaMBean implements TCLoggingBroadcasterMBean {
private static final String LOGGING_EVENT_TYPE = "tc.logging.event";
private static final MBeanNotificationInfo[] NOTIFICATION_INFO;
static {
final String[] notifTypes = new String[] { LOGGING_EVENT_TYPE };
final String name = Notification.class.getName();
final String description = "Each notification sent contains a Terracotta logging event";
NOTIFICATION_INFO = new MBeanNotificationInfo[] { new MBeanNotificationInfo(notifTypes, name, description) };
}
private final AtomicLong sequenceNumber = new AtomicLong(0L);
private final TCLoggingHistoryProvider tcLoggingHistoryProvider = new TCLoggingHistoryProvider();
public void reset() {
// nothing to reset
}
public TCLoggingBroadcaster() throws NotCompliantMBeanException {
super(TCLoggingBroadcasterMBean.class, true);
}
@Override
public MBeanNotificationInfo[] getNotificationInfo() {
return NOTIFICATION_INFO;
}
public void broadcastLogEvent(final String event) {
final Notification notif = new Notification(LOGGING_EVENT_TYPE, this, sequenceNumber.incrementAndGet(),
System.currentTimeMillis(), event);
sendNotification(notif);
tcLoggingHistoryProvider.push(new Notification(notif.getType(), getClass().getName(), notif.getSequenceNumber(),
notif.getTimeStamp(), notif.getMessage()));
}
@Override
public List<Notification> getLogNotifications() {
return tcLoggingHistoryProvider.getLogNotifications();
}
@Override
public List<Notification> getLogNotificationsSince(long timestamp) {
return tcLoggingHistoryProvider.getLogNotificationsSince(timestamp);
}
}
| [
"teck@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | teck@7fc7bbf3-cf45-46d4-be06-341739edd864 |
ac386bd8d05ffa753a999900a8f38d893a169949 | 0f07875056ac8f6429f554b14a73b351cf216940 | /legacy-pojo-integration/src/main/java/com/abien/business/patterns/lpi/control/IncompatibleMessenger.java | b9bb535d7d7d94ab662ce958f7590a358471141f | [] | no_license | dlee0113/java_ee_patterns_and_best_practices | b40b541d46799b634b52ffc5a31daf1e08236cc5 | 195a8ddf73e656d9acb21293141d6b38a47d0069 | refs/heads/master | 2020-06-30T03:26:52.852948 | 2015-04-01T12:35:15 | 2015-04-01T12:35:15 | 33,245,536 | 15 | 12 | null | null | null | null | UTF-8 | Java | false | false | 551 | java | package com.abien.business.patterns.lpi.control;
/**
*
* @author adam bien, adam-bien.com
*/
public class IncompatibleMessenger {
private String host;
private int port;
public void setHost(String host) {
this.host = host;
}
public void setPort(int port) {
this.port = port;
}
public void connect(){
System.out.println("Connecting " + host + ":" + port);
}
public void send(String msg){
System.out.println("Sending " + msg + " to " + host + ":" + port);
}
}
| [
"dlee0113@gmail.com"
] | dlee0113@gmail.com |
0ea99f677fb5ff89f89ebb7dd1e524bc43bffa78 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/third-party/other/external-module-0302/src/java/external_module_0302/a/Foo0.java | c30d9b84f7ca9de3b10ea248a1cca93ce824c14e | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,282 | java | package external_module_0302.a;
import java.util.logging.*;
import java.util.zip.*;
import javax.annotation.processing.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see javax.net.ssl.ExtendedSSLSession
* @see javax.rmi.ssl.SslRMIClientSocketFactory
* @see java.awt.datatransfer.DataFlavor
*/
@SuppressWarnings("all")
public abstract class Foo0<K> implements external_module_0302.a.IFoo0<K> {
java.beans.beancontext.BeanContext f0 = null;
java.io.File f1 = null;
java.rmi.Remote f2 = null;
public K element;
public static Foo0 instance;
public static Foo0 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return null;
}
public String getName() {
return element.toString();
}
public void setName(String string) {
return;
}
public K get() {
return element;
}
public void set(Object element) {
this.element = (K)element;
}
public K call() throws Exception {
return (K)getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
08c1dc8384f8e2a0ada651342092792b3f12ef04 | 8af28ba2d64949abab6a80598c4f1cb2ebffaddf | /utils_library/src/main/java/com/duoduolicai360/utils_library/utils/DisplayUtils.java | f96a9291a321002ca5e982d3687af384f4b05f9c | [] | no_license | shiweigang789/MyMultifunctionApp | b944ccea035172c9b5efa61f3c84361410a5049f | 3b02f9bbce8cd01abd982a9bc00c491c1c133a71 | refs/heads/master | 2021-06-21T03:32:28.564677 | 2017-08-16T02:33:32 | 2017-08-16T02:33:32 | 100,325,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,333 | java | package com.duoduolicai360.utils_library.utils;
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.nfc.Tag;
import android.util.DisplayMetrics;
public class DisplayUtils {
/**
* 根据手机的分辨率从 dp 的单位 转成为 px(像素)
*/
public static int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
/**
* 根据手机的分辨率从 px(像素) 的单位 转成为 dp
*/
public static int px2dip(Context context, float pxValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (pxValue / scale + 0.5f);
}
/**
* 得到的屏幕的宽度
*/
public static int getWidthPx(Activity activity) {
// DisplayMetrics 一个描述普通显示信息的结构,例如显示大小、密度、字体尺寸
DisplayMetrics displaysMetrics = new DisplayMetrics();// 初始化一个结构
activity.getWindowManager().getDefaultDisplay().getMetrics(displaysMetrics);// 对该结构赋值
return displaysMetrics.widthPixels;
}
/**
* 得到的屏幕的高度
*/
public static int getHeightPx(Activity activity) {
// DisplayMetrics 一个描述普通显示信息的结构,例如显示大小、密度、字体尺寸
DisplayMetrics displaysMetrics = new DisplayMetrics();// 初始化一个结构
activity.getWindowManager().getDefaultDisplay().getMetrics(displaysMetrics);// 对该结构赋值
return displaysMetrics.heightPixels;
}
/**
* 得到屏幕的dpi
* @param activity
* @return
*/
public static int getDensityDpi(Activity activity) {
// DisplayMetrics 一个描述普通显示信息的结构,例如显示大小、密度、字体尺寸
DisplayMetrics displaysMetrics = new DisplayMetrics();// 初始化一个结构
activity.getWindowManager().getDefaultDisplay().getMetrics(displaysMetrics);// 对该结构赋值
return displaysMetrics.densityDpi;
}
/**
* 返回状态栏/通知栏的高度
*
* @param activity
* @return
*/
public static int getStatusHeight(Activity activity) {
Rect frame = new Rect();
activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
int statusBarHeight = frame.top;
return statusBarHeight;
}
}
| [
"shiweigang789@126.com"
] | shiweigang789@126.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.