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
71ff6a888c33e5003a728245b889afc6fa7c2a5d
7c01f9b8c697cc412a40480218a1e991c485d9a9
/src/main/java/codingbat/functional1/Lower.java
5ce036e069de5bdedd446a14a2ae7efe13df0156
[]
no_license
ThomassenMichiel/CodingChallenges
5d8c4e8b4921a387edc7aa0fbf43be6c8097307e
4c5f147fd144c4c61a6d1ef1e0ef0025a441616b
refs/heads/master
2023-06-25T17:15:10.189768
2023-03-16T08:53:57
2023-03-16T08:53:57
220,125,452
0
0
null
2023-06-14T22:21:04
2019-11-07T01:33:04
Java
UTF-8
Java
false
false
296
java
package codingbat.functional1; import java.util.List; import java.util.stream.Collectors; public class Lower { public List<String> lower(List<String> strings) { return strings.stream() .map(String::toLowerCase) .collect(Collectors.toList()); } }
[ "bunzzbunzz@gmail.com" ]
bunzzbunzz@gmail.com
e8a01d6f6e2714d536d8704bb4b53f30b8d1c25d
16f7922e19077474ecf66d26282e93c5dd6fe42b
/01Code/01Code/com.tiuweb.family/com.tiuweb.family/com.tiuweb.family.service/src/main/java/com/tiuweb/family/items/mapper/TblServcieItemRoleMapper.java
66e711c4e2009286dab00e9766acbea66151831c
[]
no_license
lanshitou/family
72427f076abd82160771467d20927a385aaa0d73
7a4e63a23d0d40dbe81b30ed153af7d40f62c227
refs/heads/master
2020-04-13T11:24:29.073145
2018-12-26T11:42:47
2018-12-26T11:42:47
163,173,424
0
0
null
null
null
null
UTF-8
Java
false
false
1,019
java
/* * @(#) TblServcieItemRoleMapper 2017-07-17 11:02:23 * * Copyright 2003 by TiuWeb Corporation. * 51 zhangba six Road, xian, PRC 710065 // Replace with xian’s address * * All rights reserved. * * This software is the confidential and proprietary information of * TiuWeb Corporation. You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with TiuWeb. */ package com.tiuweb.family.items.mapper; import com.tiuweb.climb.framework.commons.dao.BaseMapper; import com.tiuweb.family.items.domain.TblServcieItemRole; /** * * <p>Title: 签约服务项目所需角色</p> * <p>Description: TODO 签约服务项目所需角色Mapper层 * * @author Z.J. * @version 1.00.00 创建时间:2017-07-17 11:02:23 * <pre> * 修改记录: * 版本号 修改人 修改日期 修改内容 * */ public interface TblServcieItemRoleMapper extends BaseMapper<TblServcieItemRole, String>{ }
[ "444858933@qq.com" ]
444858933@qq.com
6a00aeb4934ee3536aab30911b8312fa328f562c
33dfbe39654f5626c3cb15609cc7bfb9474f1d90
/redirect/src/main/java/com/adyen/checkout/redirect/RedirectUtil.java
bd0a511b876e8f99e6b8cf89c1df8b683e00d2d1
[ "MIT" ]
permissive
Facebook-Governance/adyen-android
3ff123dbee3b151fb5b240e61bd99bb2c4e3038f
d610af129537387c349efa8d13f9d71fa8e83446
refs/heads/develop
2023-02-04T04:22:57.800616
2020-10-16T14:35:40
2020-10-16T14:35:40
305,311,012
0
0
null
2020-10-19T08:15:27
2020-10-19T08:15:26
null
UTF-8
Java
false
false
6,634
java
/* * Copyright (c) 2019 Adyen N.V. * * This file is open source and available under the MIT license. See the LICENSE file for more info. * * Created by caiof on 1/4/2019. */ package com.adyen.checkout.redirect; import static com.adyen.checkout.redirect.ResolveResult.Type.APPLICATION; import static com.adyen.checkout.redirect.ResolveResult.Type.DEFAULT_BROWSER; import static com.adyen.checkout.redirect.ResolveResult.Type.RESOLVER_ACTIVITY; import static com.adyen.checkout.redirect.ResolveResult.Type.UNKNOWN; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.net.Uri; import android.support.annotation.NonNull; import android.support.customtabs.CustomTabsIntent; import com.adyen.checkout.base.ui.util.ThemeUtil; import com.adyen.checkout.core.code.Lint; import com.adyen.checkout.core.exception.CheckoutException; import com.adyen.checkout.core.exception.NoConstructorException; import com.adyen.checkout.core.log.LogUtil; import com.adyen.checkout.core.log.Logger; import org.json.JSONException; import org.json.JSONObject; public final class RedirectUtil { private static final String TAG = LogUtil.getTag(); /** * The suggested scheme to be used in the intent filter to receive the redirect result. * This value should be the beginning of the `returnUr` sent on the payments/ call. */ @NonNull public static final String REDIRECT_RESULT_SCHEME = BuildConfig.checkoutRedirectScheme + "://"; private static final String PAYLOAD_PARAMETER = "payload"; private static final String REDIRECT_RESULT_PARAMETER = "redirectResult"; private static final String PAYMENT_RESULT_PARAMETER = "PaRes"; private static final String MD_PARAMETER = "MD"; private static final String RESOLVER_ACTIVITY_PACKAGE_NAME = "android"; @NonNull static ResolveResult determineResolveResult(@NonNull Context context, @NonNull Uri uri) { final Intent intent = new Intent(Intent.ACTION_VIEW, uri); final Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://")); try { final PackageManager packageManager = context.getPackageManager(); final ResolveInfo resolveInfo = packageManager.resolveActivity(intent, 0); final ResolveInfo browserInfo = packageManager.resolveActivity(browserIntent, PackageManager.MATCH_DEFAULT_ONLY); final String resolvedPackageName = resolveInfo != null ? resolveInfo.activityInfo.packageName : null; final String browserPackageName = browserInfo != null ? browserInfo.activityInfo.packageName : null; if (resolvedPackageName != null) { if (resolvedPackageName.equals(RESOLVER_ACTIVITY_PACKAGE_NAME)) { return new ResolveResult(RESOLVER_ACTIVITY, resolveInfo); } else if (resolvedPackageName.equals(browserPackageName)) { return new ResolveResult(DEFAULT_BROWSER, resolveInfo); } else { return new ResolveResult(APPLICATION, resolveInfo); } } } catch (Exception e) { return new ResolveResult(UNKNOWN, null); } return new ResolveResult(UNKNOWN, null); } /** * A redirect may return to the application using the ReturnUrl when properly setup in an Intent Filter. Is usually contains result information * as parameters on that returnUrl. This method parses those results and returns a {@link JSONObject} to be used in the details call. * * <p/> * We are not handling the case for returnUrlQueryString detail, merchants who use that custom scenario should parse the URL themselves. * * @param data The returned Uri * @return The parsed value to be passed on the payments/details call, on the details parameter. */ @NonNull public static JSONObject parseRedirectResult(@NonNull Uri data) throws CheckoutException { Logger.d(TAG, "parseRedirectResult - " + data.toString()); final JSONObject result = new JSONObject(); for (String parameter : data.getQueryParameterNames()) { // getQueryParameter already does HTML decoding if (PAYLOAD_PARAMETER.equals(parameter)) { try { result.put(PAYLOAD_PARAMETER, data.getQueryParameter(parameter)); } catch (JSONException e) { throw new CheckoutException("Error creating Redirect payload.", e); } } if (REDIRECT_RESULT_PARAMETER.equals(parameter)) { try { result.put(REDIRECT_RESULT_PARAMETER, data.getQueryParameter(parameter)); } catch (JSONException e) { throw new CheckoutException("Error creating Redirect result parameter.", e); } } if (PAYMENT_RESULT_PARAMETER.equals(parameter)) { try { result.put(PAYMENT_RESULT_PARAMETER, data.getQueryParameter(parameter)); } catch (JSONException e) { throw new CheckoutException("Error creating Redirect payment result.", e); } } if (MD_PARAMETER.equals(parameter)) { try { result.put(MD_PARAMETER, data.getQueryParameter(parameter)); } catch (JSONException e) { throw new CheckoutException("Error creating Redirect MD.", e); } } } return result; } /** * Creates the intent that will start the redirect. * @param context Any context. * @param uri The Uri to redirect to. * @return And intent that targets either another app or a Web page. */ @SuppressWarnings(Lint.MERCHANT_VISIBLE) @NonNull public static Intent createRedirectIntent(@NonNull Context context, @NonNull Uri uri) { if (RedirectUtil.determineResolveResult(context, uri).getType() == APPLICATION) { return new Intent(Intent.ACTION_VIEW, uri); } else { final CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder() .setShowTitle(true) .setToolbarColor(ThemeUtil.getPrimaryThemeColor(context)) .build(); customTabsIntent.intent.setData(uri); return customTabsIntent.intent; } } private RedirectUtil() { throw new NoConstructorException(); } }
[ "git-manager@adyen.com" ]
git-manager@adyen.com
b58e94ae1474ad07639eba5998bdf922154f351c
19ba8f487f1bc8965b6155469acae4d5059c77c5
/src/main/java/mx/tiendas3b/tdexpress/entities/HeaderGastos.java
957536745c38cd2cc3f1c11cc2a89483337ec1f1
[]
no_license
opelayoa/tdexpress
a7c8460159786b3a7ee2f40912788fd62c17cb07
d917858db7dcbce94d42c7e2d940af80c72ea11f
refs/heads/master
2020-04-26T14:31:52.936070
2019-06-10T02:11:55
2019-06-10T02:11:55
173,617,629
0
0
null
null
null
null
UTF-8
Java
false
false
1,889
java
package mx.tiendas3b.tdexpress.entities; // Generated 6/03/2019 08:17:38 AM by Hibernate Tools 4.3.5.Final import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import static javax.persistence.GenerationType.IDENTITY; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * HeaderGastos generated by hbm2java */ @Entity @Table(name = "header_gastos", catalog = "itaid") public class HeaderGastos implements java.io.Serializable { private Integer id; private int userid; private int headerPedidoId; private Date fecha; private boolean status; public HeaderGastos() { } public HeaderGastos(int userid, int headerPedidoId, Date fecha, boolean status) { this.userid = userid; this.headerPedidoId = headerPedidoId; this.fecha = fecha; this.status = status; } @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false) public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } @Column(name = "userid", nullable = false) public int getUserid() { return this.userid; } public void setUserid(int userid) { this.userid = userid; } @Column(name = "header_pedido_id", nullable = false) public int getHeaderPedidoId() { return this.headerPedidoId; } public void setHeaderPedidoId(int headerPedidoId) { this.headerPedidoId = headerPedidoId; } @Temporal(TemporalType.DATE) @Column(name = "fecha", nullable = false, length = 10) public Date getFecha() { return this.fecha; } public void setFecha(Date fecha) { this.fecha = fecha; } @Column(name = "status", nullable = false) public boolean isStatus() { return this.status; } public void setStatus(boolean status) { this.status = status; } }
[ "od.pelayo@gmail.com" ]
od.pelayo@gmail.com
f3af8af8980db771d8177edea431f103d3a46911
7c83b3cf100af54fc1aa9b82b9367f9a58696372
/src/main/java/org/lanternpowered/server/network/status/LanternFavicon.java
c13ea96433667a57305167795fbdd673defee4b0
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
GustaveHooghmoed/LanternServer
c971eb284fdc18554f4aceefef47f40f116e4f14
61b3d181e87d571bcea01fbab8093a0a718578f8
refs/heads/master
2021-05-14T14:29:46.643758
2017-09-21T13:15:46
2017-12-30T14:10:59
115,972,253
1
0
null
2018-01-02T03:48:32
2018-01-02T03:48:32
null
UTF-8
Java
false
false
6,395
java
/* * This file is part of LanternServer, licensed under the MIT License (MIT). * * Copyright (c) LanternPowered <https://www.lanternpowered.org> * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.lanternpowered.server.network.status; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufInputStream; import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; import io.netty.handler.codec.base64.Base64; import org.spongepowered.api.network.status.Favicon; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.nio.charset.StandardCharsets; import java.nio.file.Path; import javax.imageio.ImageIO; public class LanternFavicon implements Favicon { private final BufferedImage decoded; private final String encoded; private LanternFavicon(BufferedImage decoded, String encoded) { this.encoded = encoded; this.decoded = decoded; } /** * Gets the encoded string of the favicon. * * @return the encoded string */ public String getEncoded() { return this.encoded; } @Override public BufferedImage getImage() { return this.decoded; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof LanternFavicon)) { return false; } LanternFavicon that = (LanternFavicon) o; return Objects.equal(this.encoded, that.encoded); } @Override public int hashCode() { return this.encoded.hashCode(); } @Override public String toString() { return MoreObjects.toStringHelper(this) .addValue(this.decoded) .toString(); } /** * Loads the favicon from the buffered image. * * @param image the image * @return the favicon */ public static Favicon load(BufferedImage image) throws IOException { return new LanternFavicon(image, encode(checkNotNull(image, "image"))); } /** * Loads the favicon from the raw favicon data. * * @param raw the raw data * @return the favicon */ public static Favicon load(String raw) throws IOException { return new LanternFavicon(decode(checkNotNull(raw, "raw")), raw); } /** * Loads the favicon from the image path. * * @param path the path * @return the favicon */ public static Favicon load(Path path) throws IOException { return load(ImageIO.read(checkNotNull(path, "path").toFile())); } /** * Loads the favicon from the url. * * @param url the url * @return the favicon */ public static Favicon load(URL url) throws IOException { return load(ImageIO.read(checkNotNull(url, "url"))); } /** * Loads the favicon from the input stream. * * @param in the input stream * @return the favicon */ public static Favicon load(InputStream in) throws IOException { return load(ImageIO.read(checkNotNull(in, "in"))); } private static final String FAVICON_PREFIX = "data:image/png;base64,"; /** * Encodes the buffered image into the encoded favicon string. * * @param image the buffered image * @return the favicon string */ private static String encode(BufferedImage image) throws IOException { checkArgument(image.getWidth() == 64, "favicon must be 64 pixels wide"); checkArgument(image.getHeight() == 64, "favicon must be 64 pixels high"); ByteBuf buf = Unpooled.buffer(); try { ImageIO.write(image, "PNG", new ByteBufOutputStream(buf)); ByteBuf base64 = Base64.encode(buf); try { return FAVICON_PREFIX + base64.toString(StandardCharsets.UTF_8); } finally { base64.release(); } } finally { buf.release(); } } /** * Decodes the buffered image from the encoded favicon string. * * @param encoded the encoded string * @return the buffered image */ private static BufferedImage decode(String encoded) throws IOException { checkArgument(encoded.startsWith(FAVICON_PREFIX), "unknown favicon format"); ByteBuf base64 = Unpooled.copiedBuffer(encoded.substring(FAVICON_PREFIX.length()), StandardCharsets.UTF_8); try { ByteBuf buf = Base64.decode(base64); try { BufferedImage result = ImageIO.read(new ByteBufInputStream(buf)); checkState(result.getWidth() == 64, "favicon must be 64 pixels wide"); checkState(result.getHeight() == 64, "favicon must be 64 pixels high"); return result; } finally { buf.release(); } } finally { base64.release(); } } }
[ "seppevolkaerts@hotmail.com" ]
seppevolkaerts@hotmail.com
c3465ff5f50c4c4cf97590fd8a4e150b5b6a95f5
e42d47cee8fc93e3cd38084ce31528f70863164a
/src/main/java/com/taufik/ServletInitializer.java
d0e1cdc2d46cd2de6e75785f2bd3b843ad75e9dc
[]
no_license
taufikbudianto/ApiSystemPerpustakaan
ac96f8e911dbf513a02f9ced2b51a28621b5c9dc
00a82d12a4d6380d3c19560faa1d37269eae922f
refs/heads/master
2021-07-08T14:42:30.947443
2017-10-03T09:34:19
2017-10-03T09:34:19
105,634,696
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package com.taufik; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(ProjectPerpustakaanApplication.class); } }
[ "taufikagusbudiyanto@gmail.com" ]
taufikagusbudiyanto@gmail.com
6a2d02acd386c68cfce0fe71a3c8343be7c30fad
e475d02258fa33720de8ff4673acce1f0129743f
/src/test/java/com/altran/wide/application/web/rest/UserJWTControllerIntTest.java
3aeed1ded613ad48461f4454a7739a2d1bdffe10
[]
no_license
jadozr/wide-application
15d894d8a754411b66e512f209f6e2dfe1a579a9
65c3c2c0c35c4371bb603e5dbb98ba3e0cc001de
refs/heads/master
2020-04-04T11:11:45.613585
2018-11-02T15:01:49
2018-11-02T15:01:49
155,881,054
0
0
null
null
null
null
UTF-8
Java
false
false
4,943
java
package com.altran.wide.application.web.rest; import com.altran.wide.application.WideApplicationApp; import com.altran.wide.application.domain.User; import com.altran.wide.application.repository.UserRepository; import com.altran.wide.application.security.jwt.TokenProvider; import com.altran.wide.application.web.rest.errors.ExceptionTranslator; import com.altran.wide.application.web.rest.vm.LoginVM; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.isEmptyString; import static org.hamcrest.Matchers.not; /** * Test class for the UserJWTController REST controller. * * @see UserJWTController */ @RunWith(SpringRunner.class) @SpringBootTest(classes = WideApplicationApp.class) public class UserJWTControllerIntTest { @Autowired private TokenProvider tokenProvider; @Autowired private AuthenticationManager authenticationManager; @Autowired private UserRepository userRepository; @Autowired private PasswordEncoder passwordEncoder; @Autowired private ExceptionTranslator exceptionTranslator; private MockMvc mockMvc; @Before public void setup() { UserJWTController userJWTController = new UserJWTController(tokenProvider, authenticationManager); this.mockMvc = MockMvcBuilders.standaloneSetup(userJWTController) .setControllerAdvice(exceptionTranslator) .build(); } @Test @Transactional public void testAuthorize() throws Exception { User user = new User(); user.setLogin("user-jwt-controller"); user.setEmail("user-jwt-controller@example.com"); user.setActivated(true); user.setPassword(passwordEncoder.encode("test")); userRepository.saveAndFlush(user); LoginVM login = new LoginVM(); login.setUsername("user-jwt-controller"); login.setPassword("test"); mockMvc.perform(post("/api/authenticate") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(login))) .andExpect(status().isOk()) .andExpect(jsonPath("$.id_token").isString()) .andExpect(jsonPath("$.id_token").isNotEmpty()) .andExpect(header().string("Authorization", not(nullValue()))) .andExpect(header().string("Authorization", not(isEmptyString()))); } @Test @Transactional public void testAuthorizeWithRememberMe() throws Exception { User user = new User(); user.setLogin("user-jwt-controller-remember-me"); user.setEmail("user-jwt-controller-remember-me@example.com"); user.setActivated(true); user.setPassword(passwordEncoder.encode("test")); userRepository.saveAndFlush(user); LoginVM login = new LoginVM(); login.setUsername("user-jwt-controller-remember-me"); login.setPassword("test"); login.setRememberMe(true); mockMvc.perform(post("/api/authenticate") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(login))) .andExpect(status().isOk()) .andExpect(jsonPath("$.id_token").isString()) .andExpect(jsonPath("$.id_token").isNotEmpty()) .andExpect(header().string("Authorization", not(nullValue()))) .andExpect(header().string("Authorization", not(isEmptyString()))); } @Test @Transactional public void testAuthorizeFails() throws Exception { LoginVM login = new LoginVM(); login.setUsername("wrong-user"); login.setPassword("wrong password"); mockMvc.perform(post("/api/authenticate") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(login))) .andExpect(status().isUnauthorized()) .andExpect(jsonPath("$.id_token").doesNotExist()) .andExpect(header().doesNotExist("Authorization")); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
64253b4e5bc55ec096fd29ddd6b0a5ca0c5c2343
de8eca94dc4b263a14cbd10e75827719e8f21233
/dmn-tck-it/dmn-tck-it-translator/src/test/java/com/gs/dmn/generated/tck/cl3_0004_lending_singleton/AbstractTest0004Lending.java
7b8f9747e551c0baaf577fed2f4a45c70c964ce4
[ "MIT", "Apache-2.0" ]
permissive
Mayank-Bhardwaj-404/jdmn
559dddac36b47075e97aad4dd69068a74c040d89
9dab9bf6e8952a30ff07e0771ef0ab4cd26c869f
refs/heads/master
2023-07-11T09:45:31.016832
2021-07-08T15:24:12
2021-07-08T15:24:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,425
java
package com.gs.dmn.generated.tck.cl3_0004_lending_singleton; public abstract class AbstractTest0004Lending extends com.gs.dmn.runtime.DefaultDMNBaseDecision { public void execute() { long count = 1000000000L; for (int i = 0; i< count; i++) { applyDecision(); } } private void applyDecision() { long start = System.currentTimeMillis(); com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_ = new com.gs.dmn.runtime.annotation.AnnotationSet(); com.gs.dmn.runtime.listener.EventListener eventListener_ = new com.gs.dmn.runtime.listener.NopEventListener(); com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_ = new com.gs.dmn.runtime.external.DefaultExternalFunctionExecutor(); com.gs.dmn.runtime.cache.Cache cache_ = new com.gs.dmn.runtime.cache.DefaultCache(); // Initialize input data com.gs.dmn.generated.tck.cl3_0004_lending_singleton.type.TApplicantData applicantData = new com.gs.dmn.generated.tck.cl3_0004_lending_singleton.type.TApplicantDataImpl(number("35"), "EMPLOYED", true, "M", new com.gs.dmn.generated.tck.cl3_0004_lending_singleton.type.MonthlyImpl(number("2000"), number("6000"), number("0"))); com.gs.dmn.generated.tck.cl3_0004_lending_singleton.type.TRequestedProduct requestedProduct = new com.gs.dmn.generated.tck.cl3_0004_lending_singleton.type.TRequestedProductImpl(number("350000"), "STANDARD LOAN", number("0.0395"), number("360")); com.gs.dmn.generated.tck.cl3_0004_lending_singleton.type.TBureauData bureauData = new com.gs.dmn.generated.tck.cl3_0004_lending_singleton.type.TBureauDataImpl(false, number("649")); String supportingDocuments = "YES"; // Check Strategy checkValues("BUREAU", makeStrategy().apply(applicantData, requestedProduct, annotationSet_, eventListener_, externalExecutor_, cache_)); // Check Routing checkValues("ACCEPT", makeRouting().apply(applicantData, bureauData, requestedProduct, annotationSet_, eventListener_, externalExecutor_, cache_)); long end = System.currentTimeMillis(); System.out.printf("Took %d ms%n", end - start); } private void checkValues(Object expected, Object actual) { com.gs.dmn.runtime.Assert.assertEquals(expected, actual); } protected abstract Routing makeRouting(); protected abstract Strategy makeStrategy(); }
[ "opatrascoiu@yahoo.com" ]
opatrascoiu@yahoo.com
2fd3e5dd67a627a98d65a0d9ae4b2cd6e4166443
7646ca765934a7ceccf5d7d5a4c9e43ad126afe1
/src/main/java/com/pdk/manage/common/wapper/flow/FlowTypeDataTableQueryArgWapper.java
99c6e39f23a6fdcbd9130c990839111954db413c
[]
no_license
88886/pdk-manage
2e7e9994f525d0ece942c15a8cd979e94dc67606
132b70f103f2011f4838e860648547a44fcffd41
refs/heads/master
2021-05-30T10:28:30.454363
2015-12-18T05:45:31
2015-12-18T05:45:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
472
java
package com.pdk.manage.common.wapper.flow; import com.pdk.manage.common.wapper.AbstractDataTableQueryArgWapper; import java.util.Arrays; import java.util.List; /** * Created by hubo on 2015/8/12 */ public class FlowTypeDataTableQueryArgWapper extends AbstractDataTableQueryArgWapper { @Override public List<String> getColNameList() { return Arrays.asList("", "id", "code", "name","isAutoAssignDeliver", "deliverId", "status"); } }
[ "hubo02090209@sina.com" ]
hubo02090209@sina.com
27c887504e3e197665048d0b60ae38eb3ebbd3ab
4ea26ecca7cba07973dacad8620b954717f9fd37
/3. Generics/GenericsEXERCISES/pb10_Tuple/pb10_Tuple/Tuple.java
79ec0eb2438ecdd9467c9682d15842c1375449c6
[]
no_license
warumNicht/Java-OOP-Advanced-july-2018
2f986fbed66c0ac8f70bdc957b2ca1861be9f488
214407b5f1f742d5b4a9f058797f9dabb6a331b6
refs/heads/master
2020-03-22T19:35:51.226910
2018-08-11T07:36:36
2018-08-11T07:36:36
140,539,445
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package pb10_Tuple; public class Tuple<T,E> { private T item1; private E item2; public Tuple(T item1, E item2) { this.item1 = item1; this.item2 = item2; } public T getItem1() { return item1; } public E getItem2() { return item2; } @Override public String toString() { StringBuilder res=new StringBuilder(); res.append(this.item1) .append(" -> ") .append(this.item2); return res.toString(); } }
[ "andrey_st_minev@yahoo.com" ]
andrey_st_minev@yahoo.com
4d96af3c472c123e38cabc74ebb061c7b4dfd67f
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module1413/src/java/module1413/a/Foo1.java
acf93be147985ce222f347828170a3b917f9e313
[ "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,497
java
package module1413.a; import javax.lang.model.*; import javax.management.*; import javax.naming.directory.*; /** * 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 java.nio.file.FileStore * @see java.sql.Array * @see java.util.logging.Filter */ @SuppressWarnings("all") public abstract class Foo1<N> extends module1413.a.Foo0<N> implements module1413.a.IFoo1<N> { java.util.zip.Deflater f0 = null; javax.annotation.processing.Completion f1 = null; javax.lang.model.AnnotatedConstruct f2 = null; public N element; public static Foo1 instance; public static Foo1 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module1413.a.Foo0.create(input); } public String getName() { return module1413.a.Foo0.getInstance().getName(); } public void setName(String string) { module1413.a.Foo0.getInstance().setName(getName()); return; } public N get() { return (N)module1413.a.Foo0.getInstance().get(); } public void set(Object element) { this.element = (N)element; module1413.a.Foo0.getInstance().set(this.element); } public N call() throws Exception { return (N)module1413.a.Foo0.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
7571b188bdb47015c10458ac7d231743f0fbaf69
66bc28edcced3e0ff87ee38a842f6306ff64366e
/app/src/main/java/com/yh/autocontrolwechat/bean/CarInfoBean.java
4c480de1870ec09f8ec5700ceb9e77a91e8c1122
[]
no_license
liudong1024/WeChatAutoClick
08f63154242515ff981770a3701153f5a6b30b57
cfee5d88344577c4aa6fd90a84b2e376da9d31c3
refs/heads/master
2020-08-30T01:47:54.027772
2019-10-30T02:28:12
2019-10-30T02:28:12
218,228,295
0
0
null
null
null
null
UTF-8
Java
false
false
2,756
java
package com.yh.autocontrolwechat.bean; import java.util.List; public class CarInfoBean { /** * title : 奥迪 奥迪A4L 2.0 TFSI 技术型 * displacement : null * diplacement_standard : 国四 * mile_age : 10.9 * color : 黑色 * transfer_time : 1 * tellphone : 18514204444 * desc : null * city : 北京 * price : 9.4万元 */ public String title; public String displacement; public String diplacement_standard; public String mile_age; public String color; public int transfer_time; public String tellphone; public String desc; public String city; public String price; public String buy_date; public String source; public String images; public String getImages() { return images; } public void setImages(String images) { this.images = images; } public String getSource() { return source; } public void setSource(String source) { this.source = source; } public String getBuy_date() { return buy_date; } public void setBuy_date(String buy_date) { this.buy_date = buy_date; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDisplacement() { return displacement; } public void setDisplacement(String displacement) { this.displacement = displacement; } public String getDiplacement_standard() { return diplacement_standard; } public void setDiplacement_standard(String diplacement_standard) { this.diplacement_standard = diplacement_standard; } public String getMile_age() { return mile_age; } public void setMile_age(String mile_age) { this.mile_age = mile_age; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public int getTransfer_time() { return transfer_time; } public void setTransfer_time(int transfer_time) { this.transfer_time = transfer_time; } public String getTellphone() { return tellphone; } public void setTellphone(String tellphone) { this.tellphone = tellphone; } public Object getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } }
[ "l" ]
l
9c7ee2ffd917ef35ce5d7233fb305ad7f31d1f58
7aa02f902ad330c70b0b34ec2d4eb3454c7a3fc1
/p007b/p010e/C0277l.java
b17f14b236d7f4e731c9c2ffd65b1e1fe88b22b7
[]
no_license
hisabimbola/andexpensecal
5e42c7e687296fae478dfd39abee45fae362bc5b
c47e6f0a1a6e24fe1377d35381b7e7e37f1730ee
refs/heads/master
2021-01-19T15:20:25.262893
2016-08-11T16:00:49
2016-08-11T16:00:49
100,962,347
1
0
null
2017-08-21T14:48:33
2017-08-21T14:48:33
null
UTF-8
Java
false
false
722
java
package p007b.p010e; import p007b.p008a.ab; import p007b.p010e.p017a.C0252o; import p007b.p011c.C0214b; import p007b.p011c.C0215c; import p007b.p011c.C0216e; /* renamed from: b.e.l */ public class C0277l extends C0252o { public C0277l() { this(C0242r.f1836a, C0274h.f1944a); } public C0277l(ab abVar) { this(C0242r.f1836a, abVar); } public C0277l(C0278m c0278m) { this(c0278m, C0274h.f1944a); } public C0277l(C0278m c0278m, ab abVar) { super(c0278m, abVar); } public void m1840b(C0214b c0214b, C0215c c0215c, C0216e c0216e) { super.m1797b(c0214b, c0215c, c0216e); } public void m1841c(boolean z) { super.m1798c(z); } }
[ "m.ravinther@yahoo.com" ]
m.ravinther@yahoo.com
3d39a523c450da58d0400a2ea32f3ce34a283405
8063c2ea7920df9b18def06b729f5b00db53b0fa
/Tiger_ViewPager/android-framework-viewpager/src/main/java/com/mn/tiger/widget/viewpager/FragmentPagerAdapter.java
6fa3a0ade2127ffa944bda7356b1dab7de6f2edc
[]
no_license
SmallTigerBrother/TigerFrameworkForAS
9060ebefd3fcc6939f9f57ae0fa291b28f181400
258d1e0e6a00e49615793a503aa92cbd1770c787
refs/heads/2.0.0
2021-04-15T10:06:32.175391
2018-11-21T08:08:30
2018-11-21T08:08:30
39,196,409
7
3
null
2018-06-12T05:48:42
2015-07-16T12:48:16
Java
UTF-8
Java
false
false
5,874
java
/* * Copyright (C) 2011 The Android Open Source Project * * 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.mn.tiger.widget.viewpager; import android.app.Fragment; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.os.Parcelable; import android.support.v4.view.PagerAdapter; import android.util.Log; import android.view.View; import android.view.ViewGroup; /** * Implementation of {@link android.support.v4.view.PagerAdapter} that * represents each page as a {@link Fragment} that is persistently kept in the * fragment manager as long as the user can return to the page. * * <p> * This version of the pager is best for use when there are a handful of * typically more static fragments to be paged through, such as a set of tabs. * The fragment of each page the user visits will be kept in memory, though its * view hierarchy may be destroyed when not visible. This can result in using a * significant amount of memory since fragment instances can hold on to an * arbitrary amount of state. For larger sets of pages, consider * {@link FragmentStatePagerAdapter}. * * <p> * When using FragmentPagerAdapter the host ViewPager must have a valid ID set. * </p> * * <p> * Subclasses only need to implement {@link #getItem(int)} and * {@link #getCount()} to have a working adapter. * * <p> * Here is an example implementation of a pager containing fragments of lists: * * {@sample * development/samples/Support4Demos/src/com/example/android/supportv4/app/ * FragmentPagerSupport.java complete} * * <p> * The <code>R.layout.fragment_pager</code> resource of the top-level fragment * is: * * {@sample development/samples/Support4Demos/res/layout/fragment_pager.xml * complete} * * <p> * The <code>R.layout.fragment_pager_list</code> resource containing each * individual fragment's layout is: * * {@sample development/samples/Support4Demos/res/layout/fragment_pager_list.xml * complete} */ public abstract class FragmentPagerAdapter extends PagerAdapter { private static final String TAG = "FragmentPagerAdapter"; private static final boolean DEBUG = false; private final FragmentManager mFragmentManager; private FragmentTransaction mCurTransaction = null; private Fragment mCurrentPrimaryItem = null; public FragmentPagerAdapter(FragmentManager fm) { mFragmentManager = fm; } /** * Return the Fragment associated with a specified position. */ public abstract Fragment getItem(int position); @Override public void startUpdate(ViewGroup container) { } @Override public Object instantiateItem(ViewGroup container, int position) { if (mCurTransaction == null) { mCurTransaction = mFragmentManager.beginTransaction(); } final long itemId = getItemId(position); // Do we already have this fragment? String name = makeFragmentName(container.getId(), itemId); Fragment fragment = mFragmentManager.findFragmentByTag(name); if (fragment != null) { if (DEBUG) Log.v(TAG, "Attaching item #" + itemId + ": f=" + fragment); mCurTransaction.attach(fragment); } else { fragment = getItem(position); if (DEBUG) Log.v(TAG, "Adding item #" + itemId + ": f=" + fragment); mCurTransaction.add(container.getId(), fragment, makeFragmentName(container.getId(), itemId)); } if (fragment != mCurrentPrimaryItem) { fragment.setMenuVisibility(false); fragment.setUserVisibleHint(false); } return fragment; } @Override public void destroyItem(ViewGroup container, int position, Object object) { if (mCurTransaction == null) { mCurTransaction = mFragmentManager.beginTransaction(); } if (DEBUG) Log.v(TAG, "Detaching item #" + getItemId(position) + ": f=" + object + " v=" + ((Fragment) object).getView()); mCurTransaction.detach((Fragment) object); } @Override public void setPrimaryItem(ViewGroup container, int position, Object object) { Fragment fragment = (Fragment) object; if (fragment != mCurrentPrimaryItem) { if (mCurrentPrimaryItem != null) { mCurrentPrimaryItem.setMenuVisibility(false); mCurrentPrimaryItem.setUserVisibleHint(false); } if (fragment != null) { fragment.setMenuVisibility(true); fragment.setUserVisibleHint(true); } mCurrentPrimaryItem = fragment; } } @Override public void finishUpdate(ViewGroup container) { if (mCurTransaction != null) { mCurTransaction.commitAllowingStateLoss(); mCurTransaction = null; mFragmentManager.executePendingTransactions(); } } @Override public boolean isViewFromObject(View view, Object object) { return ((Fragment) object).getView() == view; } @Override public Parcelable saveState() { return null; } @Override public void restoreState(Parcelable state, ClassLoader loader) { } /** * Return a unique identifier for the item at the given position. * * <p> * The default implementation returns the given position. Subclasses should * override this method if the positions of items can change. * </p> * * @param position * Position within this adapter * @return Unique identifier for the item at position */ public long getItemId(int position) { return position; } private static String makeFragmentName(int viewId, long id) { return "android:switcher:" + viewId + ":" + id; } }
[ "664674103@qq.com" ]
664674103@qq.com
83c20f3589f04df84db71faf8330e2bf9eecbc68
2686270607044710a4185b39f9a78efaa9b3ff09
/old/other-algo/src/main/java/com/shine/other/leetcode/Test51.java
60d724f7fe1e9f6bf17ceaeb0930c21ffedc6b69
[]
no_license
CoinShine/algo
5c6747c03eb3e9d153e71673b52f371ed19b3e21
50f1d241dceb1ec036188ac921c1959f43428293
refs/heads/master
2022-11-28T14:47:11.211597
2022-11-21T15:06:45
2022-11-21T15:06:45
205,323,094
4
0
null
2022-11-21T15:18:00
2019-08-30T06:54:05
Java
UTF-8
Java
false
false
4,733
java
package com.shine.other.leetcode; import org.junit.Test; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; /** * DESCRIPTION:N皇后问题 * 使用回溯法,解决N皇后问题 * 定义N*N的二维数组为棋盘,首先放置皇后 * 比如在(x,y)位置放置皇后,然后将皇后的攻击范围更新为1, * 然后放置下一个皇后,以此类推,如果放置了N个皇后,则记录下来 * 如果没有放置到N个皇后,不能再放置皇后,则向前回溯 * * @author Shine * @create 9/16/2019 12:09 PM */ public class Test51 { public List<List<String>> solveNQueens(int n) { List<List<String>> re = new ArrayList<>(); // 最终结果 int[][] mark = new int[n][n]; // 标记棋盘是否可以放置皇后的二维数组 String[][] location = new String[n][n];// 存储某一次的摆放结果 //初始化mark和location for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { mark[i][j] = 0; location[i][j] = "."; } } generation(0, n, location, re, mark); return re; } /** * k代表完成了几个皇后的放置,正好放置到第k行皇后 * mark表示棋盘的标记数组 * * @param k * @param n * @param location * @param re * @param mark */ private void generation(int k, int n, String[][] location, List<List<String>> re, int[][] mark) { if (k == n) { // 当k==n时,说明完成了第0到第n-1行的皇后放置,此时所有皇后都放置完成,记录结果 re.add(convert2Re(location)); return; } for (int i = 0; i < n; i++) { // 尝试k行的第0到n-1列 if (mark[k][i] == 0) { // 如果mark[k][i] == 0 说明可以放置皇后 int[][] tempMark = new int[n][n];// 记录回溯前的mark镜像,深拷贝二维数组 for (int j = 0; j < n; j++) { System.arraycopy(mark[j], 0, tempMark[j], 0, n); } location[k][i] = "Q"; //记录当前放置皇后的位置 putQueen(k, i, mark); // 放置皇后,更新坐标 generation(k + 1, n, location, re, mark); mark = tempMark; //将mark重新赋值为回溯前的状态 location[k][i] = "."; //将当前尝试的皇后位置重新置为· } } } /** * 将location二维数组转换成list * * @param location */ private List<String> convert2Re(String[][] location) { List<String> list = new ArrayList<>(); for (String[] strings : location) { StringBuilder sb = new StringBuilder(); for (String s1 : strings) { sb.append(s1); } list.add(sb.toString()); } return list; } /** * 放置皇后,更新皇后的攻击范围 * x是横坐标,y为纵坐标,mark为棋盘 * * @param x * @param y * @param mark */ public void putQueen(int x, int y, int[][] mark) { // 定义方向数组 int[] dx = {-1, -1, -1, 0, 0, 1, 1, 1}; int[] dy = {1, 0, -1, 1, -1, 1, 0, -1}; // 放置皇后 mark[x][y] = 1; for (int i = 1; i < mark.length; i++) { for (int j = 0; j < 8; j++) { // 8个方向更新皇后的攻击范围 int new_x = x + i * dx[j]; int new_y = y + i * dy[j]; if (new_x >= 0 && new_x < mark.length && new_y >= 0 && new_y < mark.length) { mark[new_x][new_y] = 1; } } } } @Test public void test01() { List<List<String>> lists = solveNQueens2(4); System.out.println(lists.size()); } private List<List<Integer>> result = new ArrayList<>(); private Set<Integer> cols = new HashSet<>(); private Set<Integer> pie = new HashSet<>(); private Set<Integer> na = new HashSet<>(); public List<List<String>> solveNQueens2(int n) { if(n<2) return new ArrayList<>(); DFS(n,0,new ArrayList<>()); return generate_result(n); } public void DFS(int n,int row, List<Integer> curr_state){ // 递归终止条件 if(row>=n){ result.add(new ArrayList<>(curr_state)); return; } for (int col = 0; col < n; col++) { if(cols.contains(col) || pie.contains(row+col) || na.contains(row-col)){ continue; } cols.add(col); pie.add(row+col); na.add(row-col); curr_state.add(col); DFS(n,row+1,curr_state); // 回溯 cols.remove(col); pie.remove(row+col); na.remove(row-col); curr_state.remove(curr_state.size()-1); } } public List<List<String>> generate_result(int n){ System.out.println(result.toString()); List<List<String>> re = new ArrayList<>(); for (List<Integer> list : result) { List<String> element = new ArrayList<>(); for (Integer i : list) { StringBuilder s = new StringBuilder(); for (int j = 0; j < i; j++) { s.append("."); } s.append("Q"); for (int j = 0; j < n-i-1; j++) { s.append("."); } element.add(s.toString()); } re.add(element); } return re; } }
[ "null" ]
null
45c36bdaeab62a22a09b9ec4bcfe9d719d1d0693
f28dce60491e33aefb5c2187871c1df784ccdb3a
/src/main/java/com/alibaba/fastjson/parser/deserializer/SqlDateDeserializer.java
706371f5bc7df3b0b6731eb20d8ef2c46c99a19c
[ "Apache-2.0" ]
permissive
JackChan1999/boohee_v5.6
861a5cad79f2bfbd96d528d6a2aff84a39127c83
221f7ea237f491e2153039a42941a515493ba52c
refs/heads/master
2021-06-11T23:32:55.977231
2017-02-14T18:07:04
2017-02-14T18:07:04
81,962,585
8
6
null
null
null
null
UTF-8
Java
false
false
1,901
java
package com.alibaba.fastjson.parser.deserializer; import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.parser.DefaultJSONParser; import com.alibaba.fastjson.parser.JSONScanner; import java.lang.reflect.Type; import java.text.ParseException; import java.util.Date; public class SqlDateDeserializer extends AbstractDateDeserializer implements ObjectDeserializer { public static final SqlDateDeserializer instance = new SqlDateDeserializer(); protected <T> T cast(DefaultJSONParser parser, Type clazz, Object fieldName, Object val) { if (val == null) { return null; } T val2; if (val instanceof Date) { val2 = new java.sql.Date(((Date) val).getTime()); } else if (val instanceof Number) { val2 = new java.sql.Date(((Number) val).longValue()); } else if (val instanceof String) { String strVal = (String) val; if (strVal.length() == 0) { return null; } long longVal; JSONScanner dateLexer = new JSONScanner(strVal); try { if (dateLexer.scanISO8601DateIfMatch()) { longVal = dateLexer.getCalendar().getTimeInMillis(); } else { T sqlDate = new java.sql.Date(parser.getDateFormat().parse(strVal).getTime()); dateLexer.close(); return sqlDate; } } catch (ParseException e) { longVal = Long.parseLong(strVal); } catch (Throwable th) { dateLexer.close(); } dateLexer.close(); return new java.sql.Date(longVal); } else { throw new JSONException("parse error : " + val); } return val2; } public int getFastMatchToken() { return 2; } }
[ "jackychan2040@gmail.com" ]
jackychan2040@gmail.com
eeee92eed101050bbcae83606bb27a5184631987
d1273b3c011ff99e253566127d3294c5b880aa10
/src/main/java/com/mmj/app/lucene/solr/pojo/SearchField.java
dc8f30b855e715aeba727c34a0fbff58b22f63d8
[]
no_license
zhuwenqiancn/shopping.plat
2dfee1debe3f8267361556816fb3fa24655c81e7
802464b94cae4af252d9506b74475d6bb495547b
refs/heads/master
2020-05-18T00:44:26.069581
2019-01-13T15:57:24
2019-01-13T15:57:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
/* * Copyright 2011-2016 ZuoBian.com All right reserved. This software is the confidential and proprietary information of * ZuoBian.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only * in accordance with the terms of the license agreement you entered into with ZuoBian.com. */ package com.mmj.app.lucene.solr.pojo; /** * @author zxc Sep 2, 2014 1:41:35 PM */ public interface SearchField { }
[ "zhangxiongcai337@gmail.com" ]
zhangxiongcai337@gmail.com
f2385f0561132b4ff98ff331e4ef058bb95f025f
2b2fcb1902206ad0f207305b9268838504c3749b
/WakfuClientSources/srcx/class_9088_dGB.java
1d9db676706e421b46bba9f9d467e3741cc39121
[]
no_license
shelsonjava/Synx
4fbcee964631f747efc9296477dee5a22826791a
0cb26d5473ba1f36a3ea1d7163a5b9e6ebcb0b1d
refs/heads/master
2021-01-15T13:51:41.816571
2013-11-17T10:46:22
2013-11-17T10:46:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
594
java
import java.util.ArrayList; import java.util.List; public class dGB implements aFO { private List lRj = new ArrayList(); public void a(aGK paramaGK) { this.lRj.add(paramaGK); } public List bqe() { return this.lRj; } public boolean a(dGB paramdGB) { int i = this.lRj.size(); if (i != paramdGB.lRj.size()) { return false; } for (int j = 0; j < i; j++) { aQS localaQS1 = (aQS)this.lRj.get(j); aQS localaQS2 = (aQS)paramdGB.lRj.get(j); if (!localaQS1.at(localaQS2)) { return false; } } return true; } }
[ "music_inme@hotmail.fr" ]
music_inme@hotmail.fr
ad6bd5fe5bb4b5a258ce657a4afd786daed47a49
569017408f09abe67b5de6f5d3f84b32b6ae555a
/Algorithms/src/main/java/com/inzahgi/algorithms/chapter2_5/Transaction.java
112324959e72f5bb33e90aa8042fbed37f3bb256
[]
no_license
inzahgi/algorithms_train
da08698efd827ecae2c581873bf3bd2d82688fe1
18038d77ae5bf6d5a219077f67fde4a06febde2e
refs/heads/master
2020-05-07T06:03:52.465246
2020-04-19T13:27:11
2020-04-19T13:27:11
180,299,395
0
0
null
null
null
null
UTF-8
Java
false
false
1,182
java
package com.inzahgi.algorithms.chapter2_5; import java.util.Comparator; import com.inzahgi.algorithms.chapter2_1.Date; import com.inzahgi.algorithms.chapter2_1.Date; public class Transaction { private final String who; // customer private final Date when; // date private final double amount; // amount public Transaction(String who, Date when, double amount) { this.who = who; this.when = when; this.amount = amount; } public String getWho() { return who; } public Date getWhen() { return when; } public double getAmount() { return amount; } public static class WhoOrder implements Comparator<Transaction> { @Override public int compare(Transaction v, Transaction w) { return v.who.compareTo(w.who); } } public static class WhenOrder implements Comparator<Transaction> { @Override public int compare(Transaction v, Transaction w) { return v.when.compareTo(w.when); } } public static class HowMuchOrder implements Comparator<Transaction> { @Override public int compare(Transaction v, Transaction w) { if (v.amount < w.amount) { return -1; } if (v.amount > w.amount) { return 1; } return 0; } } }
[ "inzahgi@126.com" ]
inzahgi@126.com
a772e77b7d22d7016e0df2001a1b9fc1f120799b
7915a8f60252d1b83bf008869ca886812973ab0b
/gs-service-core/src/main/java/com/fbee/modules/form/extend/StaffInfoForm.java
c4fd534f3fcea6ec19af1dde4f7522dbecfbd67e
[]
no_license
lidonghao1116/gs-service
50de25f8f0fa8a4b0bf761d059f92c68a1a7f718
e69225bee731aa7e41d4a2c1099358bcafde6486
refs/heads/master
2020-03-22T19:16:52.004890
2018-01-24T02:15:20
2018-01-24T02:15:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,545
java
package com.fbee.modules.form.extend; public class StaffInfoForm { private int tenantId;//租户id private String itemCode;//服务工种代码 private String servicePrice;//服务价格代码 private String experence;//工作经验代码 private String age;//年龄代码 private String zodiac;//属相代码 private String education;//教育代码 private String nativePlace;//籍贯代码 private String sex;//性别 private String workStatus;//工作状态代码 private String serviceNature;//服务类型代码 private String ageBy;//年龄排序 private String priceBy;//价格排序 private String experienceBy;//经验排序 private String unit;//单位 public String getUnit() { return unit; } public void setUnit(String unit) { this.unit = unit; } public String getAgeBy() { return ageBy; } public void setAgeBy(String ageBy) { this.ageBy = ageBy; } public String getPriceBy() { return priceBy; } public void setPriceBy(String priceBy) { this.priceBy = priceBy; } public String getExperienceBy() { return experienceBy; } public void setExperienceBy(String experienceBy) { this.experienceBy = experienceBy; } public String getServiceNature() { return serviceNature; } public void setServiceNature(String serviceNature) { this.serviceNature = serviceNature; } public int getTenantId() { return tenantId; } public void setTenantId(int tenantId) { this.tenantId = tenantId; } public String getItemCode() { return itemCode; } public void setItemCode(String itemCode) { this.itemCode = itemCode; } public String getServicePrice() { return servicePrice; } public void setServicePrice(String servicePrice) { this.servicePrice = servicePrice; } public String getExperence() { return experence; } public void setExperence(String experence) { this.experence = experence; } public String getAge() { return age; } public void setAge(String age) { this.age = age; } public String getZodiac() { return zodiac; } public void setZodiac(String zodiac) { this.zodiac = zodiac; } public String getEducation() { return education; } public void setEducation(String education) { this.education = education; } public String getNativePlace() { return nativePlace; } public void setNativePlace(String nativePlace) { this.nativePlace = nativePlace; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getWorkStatus() { return workStatus; } public void setWorkStatus(String workStatus) { this.workStatus = workStatus; } }
[ "lzcrwxl@163.com" ]
lzcrwxl@163.com
6ab2b5189d5bcc55f7196db79cd317a22c35e662
feae203bd6d5c8a0bfd8951ab8683651dabd3264
/moneyjinn-mapstruct-converter/src/main/java/org/laladev/moneyjinn/converter/CompareDataFormatIdMapper.java
a1ef41342135b2c5e81f242729c2e938716e4e0d
[ "BSD-2-Clause" ]
permissive
OlliL/moneyjinn-server
8b6658daa7f43493ad58284d9dc55561ea21b605
be42aa4b3c19dfe094c09cd8b942cb27843c7ade
refs/heads/master
2023-08-17T10:43:19.614073
2023-08-12T10:17:09
2023-08-12T10:17:09
41,574,937
2
1
null
null
null
null
UTF-8
Java
false
false
340
java
package org.laladev.moneyjinn.converter; import org.laladev.moneyjinn.converter.config.MapStructConfig; import org.laladev.moneyjinn.model.comparedata.CompareDataFormatID; import org.mapstruct.Mapper; @Mapper(config = MapStructConfig.class) public interface CompareDataFormatIdMapper extends EntityIdMapper<CompareDataFormatID, Long> { }
[ "lehmann@ans-netz.de" ]
lehmann@ans-netz.de
e272f227daeed4316e807c4600545f0f4ee0d954
3260c69f21ee33f48d8cb25011d9bc2ed4260234
/src/RestSharp/Parameter.java
5f658be5a0a1907aa6c7c9d95c421d627bdc507c
[]
no_license
Javonet-io-user/27c215a9-3ad8-498a-b800-58ce58f788c3
879790a1389a7e6cc6db71f3aadaf72582fd1d0f
eae69b001762233528d361318f872ea245968611
refs/heads/master
2020-07-09T08:47:55.006988
2019-08-23T05:45:33
2019-08-23T05:45:33
203,931,803
0
0
null
null
null
null
UTF-8
Java
false
false
4,428
java
package RestSharp; import Common.Activation; import static Common.JavonetHelper.Convert; import static Common.JavonetHelper.getGetObjectName; import static Common.JavonetHelper.getReturnObjectName; import static Common.JavonetHelper.ConvertToConcreteInterfaceImplementation; import Common.JavonetHelper; import Common.MethodTypeAnnotation; import com.javonet.Javonet; import com.javonet.JavonetException; import com.javonet.JavonetFramework; import com.javonet.api.NObject; import com.javonet.api.NEnum; import com.javonet.api.keywords.NRef; import com.javonet.api.keywords.NOut; import com.javonet.api.NControlContainer; import java.util.concurrent.atomic.AtomicReference; import java.util.Iterator; import java.lang.*; import RestSharp.*; import jio.System.*; public class Parameter { protected NObject javonetHandle; /** SetProperty */ @MethodTypeAnnotation(type = "SetField") public void setName(java.lang.String value) { try { javonetHandle.set("Name", value); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** GetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.String getName() { try { java.lang.String res = javonetHandle.get("Name"); if (res == null) return ""; return (java.lang.String) res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return ""; } } /** SetProperty */ @MethodTypeAnnotation(type = "SetField") public void setValue(Object value) { try { javonetHandle.set("Value", value); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** GetProperty */ @MethodTypeAnnotation(type = "GetField") public Object getValue() { try { Object res = javonetHandle.<NObject>get("Value"); if (res == null) return null; return ConvertToConcreteInterfaceImplementation(res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** SetProperty */ @MethodTypeAnnotation(type = "SetField") public void setType(ParameterType value) { try { javonetHandle.set("Type", NEnum.fromJavaEnum(value)); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** GetProperty */ @MethodTypeAnnotation(type = "GetField") public ParameterType getType() { try { Object res = javonetHandle.<NEnum>get("Type"); if (res == null) return null; return ParameterType.valueOf(((NEnum) res).getValueName()); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** SetProperty */ @MethodTypeAnnotation(type = "SetField") public void setContentType(java.lang.String value) { try { javonetHandle.set("ContentType", value); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** GetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.String getContentType() { try { java.lang.String res = javonetHandle.get("ContentType"); if (res == null) return ""; return (java.lang.String) res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return ""; } } public Parameter() { try { javonetHandle = Javonet.New("RestSharp.Parameter"); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } public Parameter(NObject handle) { this.javonetHandle = handle; } public void setJavonetHandle(NObject handle) { this.javonetHandle = handle; } /** Method */ @MethodTypeAnnotation(type = "Method") public java.lang.String ToString() { try { java.lang.String res = javonetHandle.invoke("ToString"); if (res == null) return ""; return (java.lang.String) res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return ""; } } static { try { Activation.initializeJavonet(); } catch (java.lang.Exception e) { e.printStackTrace(); } } }
[ "support@javonet.com" ]
support@javonet.com
8df7f4c6545b177d8fb9771a602fbf68cef00cae
ba44e8867d176d74a6ca0a681a4f454ca0b53cad
/resources/testscript/Workflow/OnlineCache/OLC_Menu_ReturnSingle_E2EHelper.java
6ff7d69660ac1fab70c20007525cd2a45518f27d
[]
no_license
eric2323223/FATPUS
1879e2fa105c7e7683afd269965d8b59a7e40894
989d2cf49127d88fdf787da5ca6650e2abd5a00e
refs/heads/master
2016-09-15T19:10:35.317021
2012-06-29T02:32:36
2012-06-29T02:32:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,340
java
// DO NOT EDIT: This file is automatically generated. // // Only the associated template file should be edited directly. // Helper class files are automatically regenerated from the template // files at various times, including record actions and test object // insertion actions. Any changes made directly to a helper class // file will be lost when automatically updated. package resources.testscript.Workflow.OnlineCache; import com.rational.test.ft.object.interfaces.*; import com.rational.test.ft.object.interfaces.SAP.*; import com.rational.test.ft.object.interfaces.WPF.*; import com.rational.test.ft.object.interfaces.siebel.*; import com.rational.test.ft.object.interfaces.flex.*; import com.rational.test.ft.object.interfaces.dojo.*; import com.rational.test.ft.script.*; import com.rational.test.ft.vp.IFtVerificationPoint; /** * Script Name : <b>OLC_Menu_ReturnSingle_E2E</b><br> * Generated : <b>2011/10/21 12:12:28 AM</b><br> * Description : Helper class for script<br> * Original Host : Windows XP x86 5.1 build 2600 Service Pack 2 <br> * * @since October 21, 2011 * @author eric */ public abstract class OLC_Menu_ReturnSingle_E2EHelper extends RationalTestScript { protected OLC_Menu_ReturnSingle_E2EHelper() { setScriptName("testscript.Workflow.OnlineCache.OLC_Menu_ReturnSingle_E2E"); } }
[ "eric2323223@gmail.com" ]
eric2323223@gmail.com
09df87835bb517405760fc14429857a906360dae
836aeeb5310276ff2fd9bc4dbd27fb46acd66377
/hotcomm-community-parse/src/main/java/com/hotcomm/community/parse/utils/ConvertHelp.java
2de08adbb11dc9220dc3750ab2864057152dd7ef
[]
no_license
jiajiales/hotcomm-communitys
d345488ad5a7459110bc63952ec759e3e66ba55d
abda57b2bb1ed5a2eece156e622b7aec2195a8ba
refs/heads/master
2020-04-22T17:14:05.153135
2019-02-13T15:44:54
2019-02-13T15:44:54
170,533,655
2
1
null
null
null
null
UTF-8
Java
false
false
4,873
java
package com.hotcomm.community.parse.utils; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class ConvertHelp { private static String[] binaryArray = { "0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111" }; /** * 字符串转16进制字节数组 * * @param hexString * @return */ public static byte[] strToToHexByte(String hexString) { hexString = hexString.replace(" ", ""); if ((hexString.length() % 2) != 0) hexString += " "; byte[] returnBytes = new byte[hexString.length() / 2]; for (int i = 0; i < returnBytes.length; i++) returnBytes[i] = (byte) Integer.parseInt(hexString.substring(i * 2, i * 2 + 2), 16); return returnBytes; } /** * 取整数的某一位 <param name="_Resource">要取某一位的整数</param> * <param name="_Mask">要取的位置索引,自右至左为0-7</param> * <returns>返回某一位的值(0或者1)</returns> */ public static int getIntegerSomeBit(int _Resource, int _Mask) { return _Resource >> _Mask & 1; } /** * 将整数的某位置为0或1 * * @param _Mask整数的某位 * @param a整数 * @param flag是否置1,TURE表示置1,FALSE表示置0 * @return返回修改过的值 */ public static int setIntegerSomeBit(int _Mask, int a, boolean flag) { if (flag) { a |= (0x1 << _Mask); } else { a &= ~(0x1 << _Mask); } return a; } /** * 字节数组转16进制字符串 --无空格 * * @param bytes * @return */ public static String StringParseByte(byte[] bytes) { String returnStr = ""; if (bytes != null) { for (int i = 0; i < bytes.length; i++) { returnStr += String.format("%02x", new Integer(bytes[i] & 0xff)); } } return returnStr; } /** * 获取当前时间 * * @return */ public static String getOnTime() { Date day = new Date(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 设置日期格式 return df.format(day); } /** * 时区时间格式转换为yyyy-MM-dd HH:mm:ss格式 * * @param UTCString * @return */ public static String UTCStringtODefaultString(String UTCString) { UTCString = UTCString.replace("Z", " UTC"); SimpleDateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z"); SimpleDateFormat defaultFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = null; try { date = utcFormat.parse(UTCString); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return defaultFormat.format(date); } public static byte ConvertBCD(String b) { // 高四位 byte b1 = (byte) (Byte.parseByte(b) / 10); // 低四位 byte b2 = (byte) (Byte.parseByte(b) % 10); return (byte) ((b1 << 4) | b2); } /** * 字符串转化成为16进制字符串 * * @param s * @return */ public static String strTo16(String s) { String str = ""; for (int i = 0; i < s.length(); i++) { int ch = (int) s.charAt(i); String s4 = Integer.toHexString(ch); str = str + s4; } return str; } /** * 16进制字符串转10进制字符串 返回值以逗号分割 * * @param s * @return */ public static String s16To10str(String s) { String str = ""; for (int i = 0; i < (s.length() / 2); i++) { if ((i + 1) == (s.length() / 2)) { str = str + String.valueOf(Integer.parseInt(s.substring(i * 2), 16)); } else { str = str + String.valueOf(Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16)) + ","; } } return str; } /** * 字符串转ASCII码 * * @param value * @return */ public static String stringToAscii(String value) { StringBuffer sbu = new StringBuffer(); char[] chars = value.toCharArray(); for (int i = 0; i < chars.length; i++) { if (i != chars.length - 1) { sbu.append((int) chars[i]).append(","); } else { sbu.append((int) chars[i]); } } return sbu.toString(); } /** * ASCII码转字符串 * * @param value * @return */ public static String asciiToString(String value) { StringBuffer sbu = new StringBuffer(); String[] chars = value.split(","); for (int i = 0; i < chars.length; i++) { sbu.append((char) Integer.parseInt(chars[i])); } return sbu.toString(); } /** * 16进制转二进制 * * @param src * @return */ public static String bytes2BinaryStr(byte[] bArray) { String outStr = ""; int pos = 0; for (byte b : bArray) { // 高四位 pos = (b & 0xF0) >> 4; outStr += binaryArray[pos]; // 低四位 pos = b & 0x0F; outStr += binaryArray[pos]; } return outStr; } }
[ "562910919@qq.com" ]
562910919@qq.com
cf84abf66216586d65ac789290c59a5540797318
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_188f4dec4713cf2ebfdaff9893085ee21a958719/ItemWandRenderer/9_188f4dec4713cf2ebfdaff9893085ee21a958719_ItemWandRenderer_s.java
7bca9fff660adc5f07a971184d69fb3a28bb9e5f
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,600
java
/** * Majyyka * * ItemWandRenderer.scala * * @author Myo-kun * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) */ package majyyka.client; import java.util.LinkedList; import majyyka.api.Wand; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; public class ItemWandRenderer implements IItemRenderer { private ModelWand modelWand; public LinkedList<ResourceLocation> wandTextures = new LinkedList<ResourceLocation>(); public LinkedList<String> wandNames = new LinkedList<String>(Wand.wands().keySet()); public ItemWandRenderer() { modelWand = new ModelWand(); } public boolean handleRenderType(ItemStack stack, ItemRenderType renderType) { return true; } public boolean shouldUseRenderHelper(ItemRenderType renderType, ItemStack stack, ItemRendererHelper helper) { return true; } public void renderItem(ItemRenderType renderType, ItemStack stack, Object... data) { switch (renderType) { case ENTITY: renderWand(0, 0, 0, 0.5F, stack); return; case EQUIPPED: renderWand(0, 1, 1, 0.5F, stack); return; case INVENTORY: renderWand(0, 0, 0, 0.5F, stack); return; default: renderWand(0, 0, 0, 0.5F, stack); return; } } private void renderWand(float x, float y, float z, float scale, ItemStack stack) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glTranslatef(x, y, z); GL11.glScalef(scale, scale, scale); GL11.glRotatef(180, 0, 1, 0); for (int i = 0; i < Wand.wands().size(); i++) { wandTextures.add(new ResourceLocation("majyyka", "textures/models/wands/" + wandNames.get(i))); } if (stack.hasTagCompound()) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(wandTextures.get(stack.stackTagCompound.getInteger("WandTypeIndex"))); } modelWand.render(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
50a61d97478afa564a52560ffe46359d8a9f5f52
a49214ec0c3367e834b92ec97edd879da63e8e0a
/EE/HelloServlet/src/com/sketchproject/helloservlet/servlets/StartServlet2.java
901426469a7b6b1dfbb4f6d2a7917895010e00cf
[]
no_license
anggadarkprince/learn-java
9010343d7a0e03a05996d0d0b386ab41ebb67a70
ae86cf00ad2eb7681756d51703e6b0e7931327ad
refs/heads/master
2021-01-12T12:09:27.609585
2017-05-11T13:21:44
2017-05-11T13:21:44
72,321,806
0
0
null
null
null
null
UTF-8
Java
false
false
852
java
package com.sketchproject.helloservlet.servlets; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Created by angga on 04/12/16. */ @WebServlet("/StartServlet2") public class StartServlet2 extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dispatcher = request.getRequestDispatcher("/ResultServlet.do"); dispatcher.forward(request, response); } }
[ "anggadarkprince@gmail.com" ]
anggadarkprince@gmail.com
839429a870aba7b3cbb349b87ca0a427eb25090d
f0daa8b59ca5accb6920aa61007c6bd10d6e2961
/src/test/java/mr/MR18_1TestIndex3Loop3NumOfThreads5.java
0eb5802eaa71be9cbffa476e996f7997b0b12463
[]
no_license
phantomDai/cptiscas
09b211ff984c228471d9ab28f8c5c05f946c753c
83e3ef777b7677c913a0839f8dd8e4df1bc20e0e
refs/heads/master
2021-07-05T10:54:16.856267
2019-06-06T06:18:12
2019-06-06T06:18:12
143,225,040
0
0
null
null
null
null
UTF-8
Java
false
false
379
java
package mr; import junit.framework.TestCase; import org.junit.After; import org.junit.Before; import org.junit.Test; public class MR18_1TestIndex3Loop3NumOfThreads5 extends TestCase{ MR18_1 mr; @Before public void setUp(){ mr = new MR18_1(); } @After public void tearDown(){ mr = null; } @Test public void testMR(){ mr.executeService(3,3,5,"FineGrainedHeap"); } }
[ "daihepeng@sina.cn" ]
daihepeng@sina.cn
ad0bb349524244a484d6594c4bd61c2d291cb591
be55285edbca96a3cdcf1c945e4363aa8455f15e
/src/main/java/co/iay/leetcode/Tester/Easy/TestPathSumIII.java
02d57df5f3983827f20995fe3aa5fcc1b7f9dd81
[]
no_license
liaoaoyang/LeetCode
03ce3ddfdf55968f719c857bc9f42f0cdd40e20f
338f8137c3223b4f1d73b9b96f85637ea54975f9
refs/heads/master
2021-01-16T23:41:42.275307
2019-04-25T00:05:16
2019-04-25T00:05:16
55,667,787
1
0
null
null
null
null
UTF-8
Java
false
false
651
java
package co.iay.leetcode.Tester.Easy; import co.iay.leetcode.DataStructures.TreeNode; import co.iay.leetcode.Easy.PathSumIII; import org.junit.Assert; import org.junit.Test; public class TestPathSumIII { private PathSumIII p = new PathSumIII(); @Test public void testPathSumIIICase1() { TreeNode t = TreeNode.buildTree(new Integer[]{10, 5, -3, 3, 2, null, 11, 3, -2, null, 1}); Assert.assertEquals(3, p.pathSum(t, 8)); } @Test public void testPathSumIIICase3() { TreeNode t = TreeNode.buildTree(new Integer[]{1, -2, -3, 1, 3, -2, null, -1}); Assert.assertEquals(4, p.pathSum(t, -1)); } }
[ "liaoaoyang@gmail.com" ]
liaoaoyang@gmail.com
76f6f25e14e41137bbfbe98497b7e059a7b8cee9
3191d2bd485a3e0f456aa60799f6e0ea4c9ff1fe
/commodity/src/test/java/com/cn/commodity/CommodityApplicationTests.java
98051736db49eacb3e9adaa78866cb74ba6c2218
[]
no_license
812406210/springboot2.0-mysql-redis
0c5b8bbf6dd71c6af0a01986506978aadae64e5f
49eca47a6cf48e0fe2720c24e3eb772360ec9a6e
refs/heads/master
2020-04-03T11:38:02.592358
2018-10-29T14:52:19
2018-10-29T14:52:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,780
java
package com.cn.commodity; import com.alibaba.fastjson.JSONObject; import com.cn.commodity.service.RedisService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.util.ArrayList; import java.util.List; @RunWith(SpringRunner.class) @SpringBootTest public class CommodityApplicationTests { /* @Test public void contextLoads() { } */ private JSONObject json = new JSONObject(); @Autowired private RedisService redisService; @Test public void contextLoads() throws Exception { } /** * 插入字符串 */ @Test public void setString() { redisService.set("redis_string_test", "springboot redis test"); } /** * 获取字符串 */ @Test public void getString() { String result = redisService.get("redis_string_test"); System.out.println(result); } /** * 插入对象 */ @Test public void setObject() { Person person = new Person("person", "male"); redisService.set("redis_obj_test", json.toJSONString(person)); } /** * 获取对象 */ @Test public void getObject() { String result = redisService.get("redis_obj_test"); Person person = json.parseObject(result, Person.class); System.out.println(json.toJSONString(person)); } /** * 插入对象List */ @Test public void setList() { Person person1 = new Person("person1", "male"); Person person2 = new Person("person2", "female"); Person person3 = new Person("person3", "male"); List<Person> list = new ArrayList<>(); list.add(person1); list.add(person2); list.add(person3); redisService.set("redis_list_test", json.toJSONString(list)); } /** * 获取list */ @Test public void getList() { String result = redisService.get("redis_list_test"); List<String> list = json.parseArray(result, String.class); System.out.println(list); } @Test public void remove() { redisService.remove("redis_list_test"); } } class Person { private String name; private String sex; public Person() { } public Person(String name, String sex) { this.name = name; this.sex = sex; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
8678cf89fd946c7b20aba4677bc24f9f9466bdc5
e5a5a6128c43835c83d4943793400e17331756db
/src/test/java/com/Calculadora/OperationsTest.java
05bc1e9e1353ddf1b041287c38e5fab726e4ed3e
[]
no_license
milogr96/DemoCalculadora-2
91ebe4329a342e72d388089cf76a6c9806452d1f
11e4cc15716541a6623a45bc49e0b5982528c68c
refs/heads/main
2023-08-22T19:49:13.923223
2021-10-21T02:09:12
2021-10-21T02:09:12
419,546,265
0
0
null
null
null
null
UTF-8
Java
false
false
960
java
package com.Calculadora; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest public class OperationsTest{ private Operations calculadora; public void escenario() { calculadora= new Operations(); } @Test public void add() { escenario(); assertTrue(calculadora.add(3,3)==(6)); assertFalse(calculadora.add(3,3)==(8)); } @Test public void substract() { escenario(); assertTrue(calculadora.substract(3,3)==(0)); assertFalse(calculadora.substract(3,3)==(10)); } @Test public void multiply() { escenario(); assertTrue(calculadora.multiply(3,3)==(9)); assertFalse(calculadora.multiply(3,3)==(12)); } @Test public void divide() { escenario(); assertTrue(calculadora.divide(3,3)==(1)); assertFalse(calculadora.divide(3,3)==(15)); } }
[ "you@example.com" ]
you@example.com
0200fe844840bf88999b39e3b167031b624010f8
9e20645e45cc51e94c345108b7b8a2dd5d33193e
/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
a565ca969190409fae64120d8623b2901755748d
[]
no_license
Enryu99/L2jMobius-01-11
2da23f1c04dcf6e88b770f6dcbd25a80d9162461
4683916852a03573b2fe590842f6cac4cc8177b8
refs/heads/master
2023-09-01T22:09:52.702058
2021-11-02T17:37:29
2021-11-02T17:37:29
423,405,362
2
2
null
null
null
null
UTF-8
Java
false
false
3,305
java
/* * This file is part of the L2J Mobius project. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.gameserver.model.Inventory; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; public class CharInfo extends ServerBasePacket { private final PlayerInstance _cha; public CharInfo(PlayerInstance cha) { _cha = cha; } @Override public void writeImpl() { writeC(0x03); writeD(_cha.getX()); writeD(_cha.getY()); writeD(_cha.getZ()); writeD(_cha.getHeading()); writeD(_cha.getObjectId()); writeS(_cha.getName()); writeD(_cha.getRace()); writeD(_cha.getSex()); writeD(_cha.getClassId()); writeD(0); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HEAD)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LHAND)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_GLOVES)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_CHEST)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LEGS)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FEET)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_BACK)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_LRHAND)); writeD(_cha.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_UNDER)); writeD(0); writeD(_cha.getMagicalSpeed()); writeD(_cha.getPhysicalSpeed()); writeD(_cha.getPvpFlag()); writeD(_cha.getKarma()); writeD(_cha.getRunSpeed()); writeD(_cha.getWalkSpeed()); writeD(50); writeD(50); writeD(_cha.getFloatingRunSpeed()); writeD(_cha.getFloatingWalkSpeed()); writeD(_cha.getFlyingRunSpeed()); writeD(_cha.getFlyingWalkSpeed()); writeF(_cha.getMovementMultiplier()); writeF(_cha.getAttackSpeedMultiplier()); writeF(_cha.getCollisionRadius()); writeF(_cha.getCollisionHeight()); writeD(_cha.getHairStyle()); writeD(_cha.getHairColor()); writeD(_cha.getFace()); writeS(_cha.getTitle()); writeD(_cha.getClanId()); writeD(_cha.getClanId()); writeD(16); writeD(_cha.getAllyId()); writeD(0); writeC(_cha.getWaitType()); writeC(_cha.getMoveType()); if (_cha.isInCombat()) { writeC(1); } else { writeC(0); } if (_cha.isDead()) { writeC(1); } else { writeC(0); } writeC(0); writeC(0); writeC(0); writeH(0); writeC(0); } }
[ "MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b" ]
MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b
f1eb60fd1b36992deeccf0e4b4d859a9d0c7cafc
baecaee1eb75a6eacf583ae6db41fd5b18eef67d
/app/src/main/java/com/gzeinnumer/viewpagernonswipable/helper/ViewPagerNonSwipable.java
019bfee632628e57e51d1b5241d198c70debe96d
[]
no_license
gzeinnumer/ViewPagerNonSwipable
ae45cd3946351ad58c6dfbe572022d5807982718
ea984573cb22d15e8c8dc6ea7dc78fc01839d14f
refs/heads/master
2023-01-07T19:42:24.939165
2020-11-10T09:06:46
2020-11-10T09:06:46
281,746,889
0
0
null
null
null
null
UTF-8
Java
false
false
1,092
java
package com.gzeinnumer.viewpagernonswipable.helper; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import androidx.viewpager.widget.ViewPager; public class ViewPagerNonSwipable extends ViewPager { private boolean swipeable; public ViewPagerNonSwipable(Context context) { super(context); setSwipeable(false); } public ViewPagerNonSwipable(Context context, AttributeSet attrs) { super(context, attrs); this.swipeable = true; setSwipeable(false); } @Override public boolean onTouchEvent(MotionEvent event) { if (this.swipeable) { return super.onTouchEvent(event); } return false; } @Override public boolean onInterceptTouchEvent(MotionEvent event) { if (this.swipeable) { return super.onInterceptTouchEvent(event); } return false; } // setSwipeable(false) -> call in activity public void setSwipeable(boolean swipeable) { this.swipeable = swipeable; } }
[ "m.fadli.zein.17@gmail.com" ]
m.fadli.zein.17@gmail.com
83f52830ced9babb050c65698ceab48597e246d6
4dcdab2b7e086fad289efc49904a48af203a5569
/Java/src/Backtracking/Combinations.java
9903865e263341c0f4f34d7ae33e212ade063b95
[]
no_license
jamie2017/EverydayCoding
9d70f59dfe298debced978f36b3be4ea178133d7
8a5107438411756ae85721b09c192747b3035dc0
refs/heads/master
2021-04-26T21:49:27.449050
2018-03-08T23:29:53
2018-03-08T23:29:53
124,162,965
0
0
null
null
null
null
UTF-8
Java
false
false
602
java
package Backtracking; import java.util.ArrayList; import java.util.List; /** * Created by jianmei on 6/30/16. */ public class Combinations { public List<List<Integer>> combine(int n, int k) { List<List<Integer>> rst = new ArrayList<List<Integer>>(); dfs(rst, new ArrayList<Integer>(),1,n,k); return rst; } private void dfs(List<List<Integer>> rst, List<Integer> list, int pos, int n, int k) { if (list.size() == k) { rst.add(new ArrayList<>(list)); return; } for(int i = pos; i <= n; i++) { list.add(i); dfs(rst,list,i + 1,n,k); list.remove(list.size()-1); } } }
[ "yjm.code@gmail.com" ]
yjm.code@gmail.com
c3b0bfa7a00b8281f07f8260b177b5ce83283d1a
bf935e5ea7d1789435e630d547209703bd01e128
/src/command/Stereo.java
5e589dbf059c9e6cdbfe5572b2b5610982c28825
[]
no_license
hzmtracy/Java_Design
2c53602bad3f04bd0afbb1580b0955ac2505de00
c50188d094daf1212d38d6ece8e236a31a3adee7
refs/heads/master
2020-07-12T19:56:37.252519
2019-03-27T15:11:25
2019-03-27T15:11:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package command; /** * Created by http://teachcourse.cn on 2018/03/22. */ public class Stereo { String name; public Stereo(String name) { this.name = name; } public void on() { System.out.println(name + " stereo is on"); } public void setCd() { System.out.println(name + " stereo is set for CD input"); } public void setVolume(int i) { System.out.println(name + " stereo volume set to " + i); } public void setDvd() { } public void setRadio() { } public void off() { System.out.println(name + " stereo is off"); } }
[ "123456" ]
123456
08478c41d56142deef7a0997d9a1301573d06967
2ca93846ab8f638a7d8cd80f91566ee3632cf186
/Variant Programs/1/1-16/storeroom/BroadsheetRelationRosters.java
dcd35e06ea734f4fbfae13f34f356d41fa37cf11
[ "MIT" ]
permissive
hjc851/SourceCodePlagiarismDetectionDataset
729483c3b823c455ffa947fc18d6177b8a78a21f
f67bc79576a8df85e8a7b4f5d012346e3a76db37
refs/heads/master
2020-07-05T10:48:29.980984
2019-08-15T23:51:55
2019-08-15T23:51:55
202,626,196
0
0
null
null
null
null
UTF-8
Java
false
false
6,627
java
package storeroom; import java.util.Iterator; import java.lang.Iterable; import java.util.ConcurrentModificationException; import java.util.NoSuchElementException; public class BroadsheetRelationRosters<T> implements Iterable<T> { private static final String synX1512String = "}\n"; private static final String synX1511String = "\n"; private static final String synX1510String = "]\t"; private static final String synX1509String = "["; private static final int synX1508int = 0; private static final String synX1507String = " {\n"; private static final String synX1506String = " is not in the list"; private static final String synX1505String = "Target "; private final Hub<T> guerite; public synchronized void putConclusion(T estimates) { this.pasteSoonerNub(estimates, this.guerite); } private synchronized void injectingUntilNoose(T databases, Hub<T> priority) { Hub<T> untriedHub; untriedHub = (new Hub<T>(databases, priority.drawSoon(), priority)); priority.drawSoon().placedLast(untriedHub); priority.orderedAgain(untriedHub); this.numbers++; this.modeEnumerate++; } public synchronized void tuckLaterObjective(T results, T focussed) throws ArrayStoreException { RegistryBattologize abysm; abysm = (new RegistryBattologize()); while (abysm.hasNext()) { if (abysm.next() == focussed) { this.injectingUntilNoose(results, abysm.prevailing); return; } } throw new ArrayStoreException((synX1505String + focussed + synX1506String)); } public synchronized String toString() { StringBuffer fender; RegistryBattologize subroutine; int i; fender = (new StringBuffer(this.hashCode() + synX1507String)); subroutine = (new RegistryBattologize()); i = (synX1508int); while (subroutine.hasNext()) { fender.append((synX1509String + i + synX1510String + subroutine.next() + synX1511String)); i++; } fender.append(synX1512String); return fender.toString(); } private class RegistryBattologize implements Iterator<T> { public synchronized void remove() throws ConcurrentModificationException { Hub<T> benchmark; if (this.iloBit != BroadsheetRelationRosters.this.modeEnumerate) throw new ConcurrentModificationException( ("Iterator " + this.hashCode() + " is out of sync")); if (!this.adjacentPossessesPastDescribed) throw new ConcurrentModificationException( "Next has not been called on iterator " + this.hashCode()); this.adjacentPossessesPastDescribed = (false); benchmark = (this.prevailing); this.prevailing = (this.prevailing.havePervious()); this.prevailing.orderedAgain(benchmark.drawSoon()); benchmark.drawSoon().placedLast(this.prevailing); this.iloBit++; BroadsheetRelationRosters.this.modeEnumerate++; BroadsheetRelationRosters.this.numbers--; } private int iloBit = 0; public synchronized boolean hasNext() { return (this.prevailing.drawSoon() != BroadsheetRelationRosters.this.guerite); } public RegistryBattologize() { this.prevailing = (BroadsheetRelationRosters.this.guerite); this.iloBit = (BroadsheetRelationRosters.this.modeEnumerate); this.adjacentPossessesPastDescribed = (false); } private boolean adjacentPossessesPastDescribed = false; private Hub<T> prevailing = null; public synchronized T next() throws ConcurrentModificationException, NoSuchElementException { if (this.iloBit != BroadsheetRelationRosters.this.modeEnumerate) throw new ConcurrentModificationException( ("Iterator " + this.hashCode() + " is out of sync")); if (!this.hasNext()) throw new NoSuchElementException( ("List " + BroadsheetRelationRosters.this.hashCode() + " has no more elements")); this.adjacentPossessesPastDescribed = (true); this.prevailing = (this.prevailing.drawSoon()); return this.prevailing.makeIndicators(); } } private synchronized void pasteSoonerNub(T tabulations, Hub<T> achieve) { Hub<T> originalAntenna; originalAntenna = (new Hub<T>(tabulations, achieve, achieve.havePervious())); achieve.havePervious().orderedAgain(originalAntenna); achieve.placedLast(originalAntenna); this.numbers++; this.modeEnumerate++; } public synchronized boolean isEmpty() { return (this.guerite.drawSoon() == this.guerite); } public synchronized T disposeNet() { Hub<T> point; point = (this.guerite.havePervious()); this.guerite.placedLast(point.havePervious()); point.havePervious().orderedAgain(this.guerite); if (this.numbers > 0) this.numbers--; this.modeEnumerate++; return point.makeIndicators(); } private int numbers = 0; public BroadsheetRelationRosters() { this.guerite = (new Hub<T>(null, null, null)); this.guerite.orderedAgain(this.guerite); this.guerite.placedLast(this.guerite); this.numbers = (0); this.modeEnumerate = (0); } public synchronized int reckoning() { return this.numbers; } public synchronized T seniorPreclude() { return this.guerite.havePervious().makeIndicators(); } public synchronized void tuckEarlierObjective(T statistical, T aiming) throws ArrayStoreException { RegistryBattologize ace; ace = (new RegistryBattologize()); while (ace.hasNext()) { if (ace.next() == aiming) { this.pasteSoonerNub(statistical, ace.prevailing); return; } } throw new ArrayStoreException(("Target " + aiming + " is not in the list")); } public synchronized void transferTarget(T information) { RegistryBattologize struct; struct = (new RegistryBattologize()); while (struct.hasNext()) { if (struct.next() == information) { struct.remove(); return; } } throw new ArrayStoreException(("Object " + information + " was not found")); } public synchronized void embedOutset(T study) { this.injectingUntilNoose(study, this.guerite); } public synchronized Iterator<T> iterator() { return new RegistryBattologize(); } public synchronized T undoBasic() { Hub<T> prey; prey = (this.guerite.drawSoon()); this.guerite.orderedAgain(prey.drawSoon()); prey.drawSoon().placedLast(this.guerite); if (this.numbers > 0) this.numbers--; this.modeEnumerate++; return prey.makeIndicators(); } private int modeEnumerate = 0; public synchronized T forwardVictim() { return this.guerite.drawSoon().makeIndicators(); } }
[ "hayden.cheers@me.com" ]
hayden.cheers@me.com
b8479dc03886cdb25554a80ac90c4e1296762582
f78a70b345f68e71fec5a7057ea019bd157db74f
/rheem-platforms/rheem-spark/src/main/java/org/qcri/rheem/spark/operators/SparkObjectFileSource.java
dfce40e713599c2ca8707b3cb88694a9f2f36328
[ "Apache-2.0" ]
permissive
saad749/rheem
3bee18634b5cdcf1349d2f5a5577d1fa5efcaee3
7fc4bac43dd96978f797174933d224ad669f1066
refs/heads/master
2021-01-13T08:14:22.488118
2016-10-21T11:04:46
2016-10-21T11:04:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,100
java
package org.qcri.rheem.spark.operators; import org.apache.spark.api.java.JavaRDD; import org.qcri.rheem.basic.channels.FileChannel; import org.qcri.rheem.core.optimizer.OptimizationContext; import org.qcri.rheem.core.plan.rheemplan.ExecutionOperator; import org.qcri.rheem.core.plan.rheemplan.Operator; import org.qcri.rheem.core.plan.rheemplan.UnarySource; import org.qcri.rheem.core.platform.ChannelDescriptor; import org.qcri.rheem.core.platform.ChannelInstance; import org.qcri.rheem.core.types.DataSetType; import org.qcri.rheem.core.util.Tuple; import org.qcri.rheem.core.util.fs.FileSystems; import org.qcri.rheem.spark.channels.RddChannel; import org.qcri.rheem.spark.execution.SparkExecutor; import org.qcri.rheem.spark.platform.SparkPlatform; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Collection; import java.util.Collections; import java.util.List; /** * {@link Operator} for the {@link SparkPlatform} that creates a sequence file. * * @see SparkObjectFileSink */ public class SparkObjectFileSource<T> extends UnarySource<T> implements SparkExecutionOperator { private final Logger logger = LoggerFactory.getLogger(this.getClass()); private final String sourcePath; public SparkObjectFileSource(DataSetType<T> type) { this(null, type); } public SparkObjectFileSource(String sourcePath, DataSetType<T> type) { super(type); this.sourcePath = sourcePath; } @Override public Tuple<Collection<OptimizationContext.OperatorContext>, Collection<ChannelInstance>> evaluate( ChannelInstance[] inputs, ChannelInstance[] outputs, SparkExecutor sparkExecutor, OptimizationContext.OperatorContext operatorContext) { final String sourcePath; if (this.sourcePath != null) { assert inputs.length == 0; sourcePath = this.sourcePath; } else { FileChannel.Instance input = (FileChannel.Instance) inputs[0]; sourcePath = input.getSinglePath(); } RddChannel.Instance output = (RddChannel.Instance) outputs[0]; final String actualInputPath = FileSystems.findActualSingleInputPath(sourcePath); final JavaRDD<Object> rdd = sparkExecutor.sc.objectFile(actualInputPath); this.name(rdd); output.accept(rdd, sparkExecutor); return ExecutionOperator.modelLazyExecution(inputs, outputs, operatorContext); } @Override protected ExecutionOperator createCopy() { return new SparkObjectFileSource<>(this.sourcePath, this.getType()); } @Override public String getLoadProfileEstimatorConfigurationKey() { return "rheem.spark.objectfilesource.load"; } @Override public List<ChannelDescriptor> getSupportedInputChannels(int index) { return Collections.singletonList(FileChannel.HDFS_OBJECT_FILE_DESCRIPTOR); } @Override public List<ChannelDescriptor> getSupportedOutputChannels(int index) { return Collections.singletonList(RddChannel.UNCACHED_DESCRIPTOR); } }
[ "sebastian.kruse@hpi.de" ]
sebastian.kruse@hpi.de
482e9979ac449c540ae168f35ea932bef9caa286
a09de5ed9e8ec584af1766b24f7c9647b099ae43
/baseview/src/main/java/com/common/baseview/event/EventHelp.java
7d64a2e6d19ed8c342800d1a2fb0638ed4fa2849
[]
no_license
ren19890419/xunji
398a912c6b9ea36906f68cae12a510cbe55669d6
0ab3fe1e5dcf7523617443b723cb2dc7e4917b9e
refs/heads/master
2023-04-16T05:54:33.863890
2020-04-10T16:37:12
2020-04-10T16:37:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,990
java
package com.common.baseview.event; import com.common.lib.utils.GsonUtil; /** * 作者:zh * 时间:1/23/19 8:27 PM * 描述: */ public class EventHelp { static EventHelpClient sClient; public static void setClient(EventHelpClient client){ sClient =client; } public static void submitViewEvent(String referer,String mode,String title,String url) { EventDataBean eventBean = new EventDataBean() .setEtype(EventDataBean.etypeView) .setReferer(referer) .setTitle(title) .setMode(mode) .setUrl(url); sClient.submitJsonEvent(GsonUtil.toGsonString(eventBean)); } public static void submitViewEvent(String referer,String mode,String title,String url,int id) { EventDataBean eventBean = new EventDataBean() .setEtype(EventDataBean.etypeView) .setReferer(referer) .setTitle(title) .setMode(mode) .setUrl(url) .setProductId(id); sClient.submitJsonEvent(GsonUtil.toGsonString(eventBean)); } public static void submitClickEvent(String referer,String mode,String title,String url) { EventDataBean eventBean = new EventDataBean() .setEtype(EventDataBean.etypeClick) .setReferer(referer) .setMode(mode) .setTitle(title) .setUrl(url); sClient.submitJsonEvent(GsonUtil.toGsonString(eventBean)); } public static void submitClickProEvent(String referer,String mode,String title,String url,int id) { EventDataBean eventBean = new EventDataBean() .setEtype(EventDataBean.etypeClick) .setReferer(referer) .setMode(mode) .setTitle(title) .setUrl(url) .setProductId(id); sClient.submitJsonEvent(GsonUtil.toGsonString(eventBean)); } }
[ "593746220@qq.com" ]
593746220@qq.com
2e23b242471793efca3e304c2ad7dc90d56e7a1e
64e3f2b8d6abff582d8dff2f200e0dfc708a5f4b
/2016/DevoxxPL/App.java
35ba9a20cbb52b278f38029ae85de70930ea043e
[]
no_license
tedneward/Demos
a65df9d5a0390e3fdfd100c33bbc756c83d4899e
28fff1c224e1f6e28feb807a05383d7dc1361cc5
refs/heads/master
2023-01-11T02:36:24.465319
2019-11-30T09:03:45
2019-11-30T09:03:45
239,251,479
0
0
null
2023-01-07T14:38:21
2020-02-09T05:21:15
Java
UTF-8
Java
false
false
1,467
java
import java.util.*; public class App { public static void main(String... args) { List<Person> people = Arrays.asList( new Person("Ted", "Neward", 45), new Person("Matt", "Stine", 35), new Person("Neal", "Ford", 55), new Person("Charlotte", "Neward", 39), new Person("Michael", "Neward", 22), new Person("Matthew", "Neward", 16) ); List<Person> drinkers = Lists.filter(people, new Function1<Boolean, Person>() { public Boolean apply(Person p) { return p.getAge() > 20; } }); List<Integer> ages = Lists.transform(new Function1<Integer, Person>() { public Integer apply(Person p) { return p.getAge(); } }, people); for (Integer i : ages) { System.out.println(i); } Integer totalAges = Lists.fold(0, people, new Function2<Integer, Integer, Person>() { public Integer apply(Integer current, Person p) { return current + p.getAge(); } }); System.out.println(totalAges); String xml = Lists.fold("<persons>", people, new Function2<String, String, Person>() { public String apply(String current, Person p) { return current + "<person firstName='" + p.getFirstName() + "' lastName='" + p.getLastName() + "'>"; } }) + "</persons>"; System.out.println(xml); for (Person p : drinkers) { System.out.println("Here, have a beer, " + p.getFirstName()); } } }
[ "ted@tedneward.com" ]
ted@tedneward.com
4a75a118e70c0a99f242960d853607b90177d454
2150eb71a131f9dc0b55fc8cc7f05819ca61bc2a
/src/main/java/com/manhui/gsl/jbqgsl/dao/web/meetingmanager/MeetingPersonMapper.java
d9c408132248ea1e29ee81cfdb00a76c7b4c8cb6
[]
no_license
juexingzero/qgsl1
20c73d85a50d906d8260b9144cb26c0205e3fe0f
a01313f0babb3102afa5d47e415587f9c03fc874
refs/heads/master
2020-04-08T21:32:54.027201
2018-11-30T01:16:42
2018-11-30T01:20:55
159,748,468
0
0
null
null
null
null
UTF-8
Java
false
false
919
java
package com.manhui.gsl.jbqgsl.dao.web.meetingmanager; import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.Mapper; import com.manhui.gsl.jbqgsl.model.MeetingPerson; @Mapper public interface MeetingPersonMapper { //选择人员 Integer insertMeetingPerson(List<MeetingPerson> mpList); List<MeetingPerson> queryMeetingPersonList(String meeting_id); Integer updateMeetingPerson(MeetingPerson mp); Integer deleteMeetingPerson(MeetingPerson mp); //选择签到人员 Integer queryMeetingPersonNum(String meeting_id); List<MeetingPerson> getMeetingPersonLists(Map<String, Object> conditions); Integer queryMeetingPersonTotal( Map<String, Object> conditions ); //查询投票人数 Integer querypersonNum(String vote_options); List<MeetingPerson> queryvotePerson(Map<String, Object> conditions); Integer queryvotePersonNum(Map<String, Object> conditions); }
[ "610761341@qq.com" ]
610761341@qq.com
99312ff205921a683e84899bf2221ef08b10003e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_32a1fcb5682049aacfbd06c32b630f166c23f643/TestReflect/34_32a1fcb5682049aacfbd06c32b630f166c23f643_TestReflect_s.java
0135c17b592eba618f823ba3759dad88e315814b
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,097
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.avro; import java.io.*; import java.net.*; import java.util.*; import java.nio.ByteBuffer; import junit.framework.TestCase; import org.codehaus.jackson.map.JsonNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.avro.*; import org.apache.avro.Protocol.Message; import org.apache.avro.io.*; import org.apache.avro.ipc.*; import org.apache.avro.generic.*; import org.apache.avro.specific.*; import org.apache.avro.reflect.*; import org.apache.avro.util.*; import org.apache.avro.Test.TestRecord; public class TestReflect extends TestCase { private static final Logger LOG = LoggerFactory.getLogger(TestProtocolSpecific.class); private static final File FILE = new File("src/test/schemata/test.js"); private static final Protocol PROTOCOL; static { try { PROTOCOL = Protocol.parse(FILE); } catch (IOException e) { throw new RuntimeException(e); } } public void testRecord() throws IOException { assertEquals(PROTOCOL.getTypes().get("TestRecord"), ReflectData.getSchema(TestRecord.class)); } public void testProtocol() throws IOException { assertEquals(PROTOCOL, ReflectData.getProtocol(Test.class)); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
04e534f1322365d4bfbfc78699e276af3a5640a3
4d41728f620d6be9916b3c8446da9e01da93fa4c
/src/main/java/org/bukkit/conversations/ConversationCanceller.java
c2ee5c7358e2fb117349c56405d2ca0507453b3f
[]
no_license
TechCatOther/um_bukkit
a634f6ccf7142b2103a528bba1c82843c0bc4e44
836ed7a890b2cb04cd7847eff2c59d7a2f6d4d7b
refs/heads/master
2020-03-22T03:13:57.898936
2018-07-02T09:20:00
2018-07-02T09:20:00
139,420,415
3
2
null
null
null
null
UTF-8
Java
false
false
1,035
java
package org.bukkit.conversations; /** * A ConversationCanceller is a class that cancels an active {@link * Conversation}. A Conversation can have more than one ConversationCanceller. */ public interface ConversationCanceller extends Cloneable { /** * Sets the conversation this ConversationCanceller can optionally cancel. * * @param conversation A conversation. */ public void setConversation(Conversation conversation); /** * Cancels a conversation based on user input. * * @param context Context information about the conversation. * @param input The input text from the user. * @return True to cancel the conversation, False otherwise. */ public boolean cancelBasedOnInput(ConversationContext context, String input); /** * Allows the {@link ConversationFactory} to duplicate this * ConversationCanceller when creating a new {@link Conversation}. * <p> * Implementing this method should reset any internal object state. * * @return A clone. */ public ConversationCanceller clone(); }
[ "alone.inbox@gmail.com" ]
alone.inbox@gmail.com
7081a480f0a19258dc457dfabe7706d1a681da9d
000e9ddd9b77e93ccb8f1e38c1822951bba84fa9
/java/classes2/com/umeng/analytics/pro/da.java
902cefc3bb9a4ec039a6be75044da3a39fff07e9
[ "Apache-2.0" ]
permissive
Paladin1412/house
2bb7d591990c58bd7e8a9bf933481eb46901b3ed
b9e63db1a4975b614c422fed3b5b33ee57ea23fd
refs/heads/master
2021-09-17T03:37:48.576781
2018-06-27T12:39:38
2018-06-27T12:41:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
746
java
package com.umeng.analytics.pro; public class da { public final String a; public final byte b; public final short c; public da() { this("", (byte)0, (short)0); } public da(String paramString, byte paramByte, short paramShort) { this.a = paramString; this.b = paramByte; this.c = paramShort; } public boolean a(da paramda) { return (this.b == paramda.b) && (this.c == paramda.c); } public String toString() { return "<TField name:'" + this.a + "' type:" + this.b + " field-id:" + this.c + ">"; } } /* Location: /Users/gaoht/Downloads/zirom/classes2-dex2jar.jar!/com/umeng/analytics/pro/da.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ght163988@autonavi.com" ]
ght163988@autonavi.com
3ae979ddf4a757959ab754fb3ed182bac299f116
76852b1b29410436817bafa34c6dedaedd0786cd
/sources-2020-07-19-tempmail/sources/com/google/android/gms/internal/ads/zzeav.java
e7327d6be7ee54162203d6341b99c6df3e6e53a8
[]
no_license
zteeed/tempmail-apks
040e64e07beadd8f5e48cd7bea8b47233e99611c
19f8da1993c2f783b8847234afb52d94b9d1aa4c
refs/heads/master
2023-01-09T06:43:40.830942
2020-11-04T18:55:05
2020-11-04T18:55:05
310,075,224
0
0
null
null
null
null
UTF-8
Java
false
false
1,446
java
package com.google.android.gms.internal.ads; /* compiled from: com.google.android.gms:play-services-ads@@19.2.0 */ public enum zzeav implements zzegg { UNKNOWN_HASH(0), SHA1(1), SHA384(2), SHA256(3), SHA512(4), UNRECOGNIZED(-1); /* renamed from: b reason: collision with root package name */ private final int f8466b; private zzeav(int i2) { this.f8466b = i2; } public static zzeav f(int i2) { if (i2 == 0) { return UNKNOWN_HASH; } if (i2 == 1) { return SHA1; } if (i2 == 2) { return SHA384; } if (i2 == 3) { return SHA256; } if (i2 != 4) { return null; } return SHA512; } public final int i() { if (this != UNRECOGNIZED) { return this.f8466b; } throw new IllegalArgumentException("Can't get the number of an unknown enum value."); } public final String toString() { StringBuilder sb = new StringBuilder("<"); sb.append(zzeav.class.getName()); sb.append('@'); sb.append(Integer.toHexString(System.identityHashCode(this))); if (this != UNRECOGNIZED) { sb.append(" number="); sb.append(i()); } sb.append(" name="); sb.append(name()); sb.append('>'); return sb.toString(); } }
[ "zteeed@minet.net" ]
zteeed@minet.net
e9bbad77329193f85473159bebf85325f0790f26
ff389edb555331bec0ef02126148438e6bbfb5f9
/iflym-mybatis/src/main/java/io/iflym/mybatis/domain/info/EntityInfo.java
25c9c8ae4676907e7279a45233825447473e1d74
[]
no_license
flym/iflymio
038a14feafed9ffb118af0810235562958511b5f
1162d59d8ce6bab860024b3d078e14e933cec7b0
refs/heads/master
2022-12-27T07:41:56.304796
2021-03-22T08:51:09
2021-03-22T08:51:09
124,005,655
0
1
null
2022-12-16T04:26:24
2018-03-06T02:01:34
Java
UTF-8
Java
false
false
5,549
java
package io.iflym.mybatis.domain.info; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import io.iflym.mybatis.domain.Entity; import io.iflym.mybatis.domain.annotation.Column; import lombok.AccessLevel; import lombok.Getter; import lombok.val; import java.lang.reflect.Field; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import static io.iflym.mybatis.domain.info.ColumnInfo.UNDEFINED; /** * 对一个域模型的描述,每一个域模型均需要有相应的对象对其进行描述,以持有相应的结构信息 * * @author flym * Created by flym on 2017/8/29. */ @Getter public class EntityInfo<T extends Entity> { /** * 此模型所对应的类 */ private Class<T> clazz; /** * 相应的数据表信息 */ private TableInfo table; /** * 相应的列信息 */ @Getter(AccessLevel.NONE) private Map<Field, ColumnInfo> columnMap; /** * 为一个类构建出相应的模型对象 */ public static <T extends Entity> EntityInfo<T> build(Class<T> clazz) { val entityInfo = new EntityInfo<T>(); entityInfo.clazz = clazz; entityInfo.table = TableInfo.build(clazz); val fieldList = allField(clazz); val columnMap = Maps.<Field, ColumnInfo>newLinkedHashMap(); val handledSet = Sets.<String>newHashSet(); val naturalOrder = new AtomicInteger(); fieldList.forEach(f -> { val name = f.getName(); if(handledSet.contains(name)) { return; } handledSet.add(name); val columnInfo = ColumnInfo.build(f, naturalOrder.getAndIncrement()); columnMap.put(f, columnInfo); }); entityInfo.columnMap = columnMap; return entityInfo; } /** * 返回所有字段,此返回字段按照继承体系, 优先级降低,即最末层的优先级最高 * 对于使用者,如果下层类有字段覆盖上层,则在使用时应使用contains进行判断和处理 */ private static List<Field> allField(Class clazz) { List<Field> resultList = Lists.newArrayList(); Class currentClass = clazz; while(currentClass != Object.class) { for(Field field : currentClass.getDeclaredFields()) { val anno = field.getAnnotation(Column.class); if(anno == null) { continue; } resultList.add(field); } currentClass = currentClass.getSuperclass(); } return resultList; } @Getter(AccessLevel.NONE) private transient List<ColumnInfo> columnList; /** * 获取此实体对象所有的列信息 */ public List<ColumnInfo> getColumnList() { if(columnList == null) { return columnList = Lists.newArrayList(columnMap.values()); } return columnList; } @Getter(AccessLevel.NONE) private transient List<ColumnInfo> idColumnList; /** * 获取此实体对象的主键列 */ public List<ColumnInfo> getIdColumnList() { if(idColumnList == null) { idColumnList = getColumnList().stream().filter(ColumnInfo::isIdColumn).collect(Collectors.toList()); } return idColumnList; } @Getter(AccessLevel.NONE) private transient Map<String, List<ColumnInfo>> uniqueKeyColumnMap; private static Comparator<ColumnInfo> uniqueKeyComparator = Comparator.<ColumnInfo>comparingInt(t -> t.getUniqueId().order()) .thenComparingInt(ColumnInfo::getFieldNaturalOrder); /** * 获取此实体对象的UK列 * 如果无, 则返回 emptyList */ public List<ColumnInfo> getUniqueIdColumnList(String group) { if(uniqueKeyColumnMap == null) { Map<String, List<ColumnInfo>> tmpMap = Maps.newHashMap(); getColumnList().stream().filter(ColumnInfo::isUniqueIdColumn).forEach(t -> { val groupName = t.getUniqueId().group(); tmpMap.computeIfAbsent(groupName, any -> Lists.newArrayList()).add(t); }); tmpMap.values().forEach(t -> t.sort(uniqueKeyComparator)); uniqueKeyColumnMap = tmpMap; } return uniqueKeyColumnMap.getOrDefault(group, Collections.emptyList()); } @Getter(AccessLevel.NONE) private transient ColumnInfo deleteTagColumn = UNDEFINED; /** 获取删除标记的列 */ public ColumnInfo getDeleteTagColumn() { if(deleteTagColumn == UNDEFINED) { deleteTagColumn = getColumnList().stream().filter(ColumnInfo::isDeleteTagColumn).findFirst().orElse(null); } return deleteTagColumn; } /** * 获取此实体对象指定属性的列信息 */ public ColumnInfo getColumn(Field property) { return columnMap.get(property); } @Getter(AccessLevel.NONE) private transient Map<String, ColumnInfo> propertyNameColumnMap; public ColumnInfo getColumn(String property) { if(propertyNameColumnMap == null) { Map<String, ColumnInfo> tmpMap = Maps.newLinkedHashMap(); columnMap.forEach((k, v) -> tmpMap.put(k.getName(), v)); propertyNameColumnMap = tmpMap; } return propertyNameColumnMap.get(property); } }
[ "www@iflym.com" ]
www@iflym.com
fda70d2eda7f3b3beac4587af9651d0acd343c7e
ae69e30f8eb4ff2cd47e2336b2a2b31f271a3e5a
/Java/leetcode/medium/P_229.java
6ac7c4e889a80509d04b8a2082dafd5b378b7fc4
[]
no_license
bdugersuren/CompetitiveProgramming
f35048ef8e5345c5219c992f2be8b84e1f7f1cb8
cd571222aabe3de952d90d6ddda055aa3b8c08d9
refs/heads/master
2023-05-12T00:45:15.065209
2021-05-14T13:24:53
2021-05-14T13:24:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,392
java
package leetcode.medium; import java.util.ArrayList; import java.util.List; @SuppressWarnings("ConstantConditions") public class P_229 { // Boyer-Moore majority vote -> https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_majority_vote_algorithm public List<Integer> majorityElement(int[] nums) { Integer candidate1 = null, candidate2 = null; int count1 = 0, count2 = 0; for (int num : nums) { if (candidate1 != null && candidate1 == num) { count1++; } else if (candidate2 != null && candidate2 == num) { count2++; } else if (count1 == 0) { candidate1 = num; count1++; } else if (count2 == 0) { candidate2 = num; count2++; } else { count1--; count2--; } } final List<Integer> res = new ArrayList<>(); final int target = nums.length / 3; count1 = 0; count2 = 0; for (int num : nums) { if (candidate1 != null && num == candidate1) { count1++; } if (candidate2 != null && num == candidate2) { count2++; } } if (count1 > target) { res.add(candidate1); } if (count2 > target) { res.add(candidate2); } return res; } }
[ "nirvana_rsc@yahoo.com" ]
nirvana_rsc@yahoo.com
1b81a63ddba01139d912a946eb1feaf680e79f9b
d629b668de50e4a969e04d8a2d98aea3823fc384
/src/main/java/com/projeto/Controle/ControleClientes.java
6984f9e99355228a6288d7513025b110ba92526c
[]
no_license
eduardofpu/jasper
edf8281c56195a4a1afa694d19caa016415d5804
6603615ede8e414b72bc6af6a24e22f47f93935b
refs/heads/master
2021-01-10T12:30:50.322708
2016-03-30T17:58:12
2016-03-30T18:02:17
55,075,928
1
0
null
null
null
null
UTF-8
Java
false
false
1,731
java
package com.projeto.Controle; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.projeto.Entity.Clientes; import com.projeto.Repositorio.RepositorioBairro; import com.projeto.Repositorio.RepositorioCidade; import com.projeto.Repositorio.RepositorioCliente; import com.projeto.Repositorio.RepositorioEstado; @Controller public class ControleClientes { @Autowired RepositorioCliente repositorioCliente; @Autowired RepositorioBairro repositorioBairro; @Autowired RepositorioCidade repositorioCidade; @Autowired RepositorioEstado repositorioEstado; @RequestMapping(value = "/cliente") public String listarClientes(Clientes clientes, Model model) { model.addAttribute("clientes", repositorioCliente.findAll()); model.addAttribute("bairros", repositorioBairro.findAllOrderByNome()); model.addAttribute("cidades", repositorioCidade.findAllOrderByNome()); model.addAttribute("estados", repositorioEstado.findAllOrderByNome()); if (clientes.getIdCliente() != null) { model.addAttribute("cliente", repositorioCliente.findOne(clientes.getIdCliente())); } else { model.addAttribute("cliente", new Clientes()); } return "cliente"; } @RequestMapping(value = "/cliente/salve") public String salvarCliente(Clientes clientes) { repositorioCliente.save(clientes); return "redirect:/cliente"; } @RequestMapping(value = "/cliente/del") public String deletarCliente(Clientes clientes) { repositorioCliente.delete(clientes); return "redirect:/cliente"; } }
[ "eduardo27_minotauro@hotmail.com" ]
eduardo27_minotauro@hotmail.com
4bae5860202c3a941cb32eb818b6672391fb3e3b
42bb692d9140736c468e7ae328564c12b830b4be
/bitcamp-javaproject/src27/main/java/bitcamp/java106/pms/controller/teammember/TeamMemberDeleteController.java
a4a7ef91a219c7cae8cd36fd0759435ad50a9b00
[]
no_license
kimkwanhee/bitcamp
b047f4cc391d2c43bad858f2ffb4f3a6a3779aa2
0245693f83b06d773365b9b5b6b3d4747877d070
refs/heads/master
2021-01-24T10:28:06.247239
2018-08-20T03:13:18
2018-08-20T03:13:18
123,054,178
0
0
null
null
null
null
UTF-8
Java
false
false
2,314
java
// Controller 규칙에 따라 메서드 작성 package bitcamp.java106.pms.controller.teammember; import java.util.Scanner; import bitcamp.java106.pms.annotation.Component; import bitcamp.java106.pms.controller.Controller; import bitcamp.java106.pms.dao.TeamDao; import bitcamp.java106.pms.dao.TeamMemberDao; import bitcamp.java106.pms.domain.Team; @Component("team/member/delete") public class TeamMemberDeleteController implements Controller { Scanner keyScan; TeamDao teamDao; TeamMemberDao teamMemberDao; public TeamMemberDeleteController(Scanner scanner, TeamDao teamDao, TeamMemberDao teamMemberDao) { this.keyScan = scanner; this.teamDao = teamDao; this.teamMemberDao = teamMemberDao; } public void service(String menu, String teamName) { if (teamName == null) { System.out.println("팀명을 입력하시기 바랍니다."); return; } Team team = teamDao.get(teamName); if (team == null) { System.out.printf("%s 팀은 존재하지 않습니다.", teamName); return; } System.out.print("삭제할 팀원은? "); String memberId = keyScan.nextLine(); if (!teamMemberDao.isExist(teamName, memberId)) { System.out.println("이 팀의 회원이 아닙니다."); return; } teamMemberDao.deleteMember(teamName, memberId); System.out.println("[팀 멤버 삭제]"); System.out.println("삭제하였습니다."); } } //ver 26 - TeamMemberController에서 delete() 메서드를 추출하여 클래스로 정의. //ver 23 - @Component 애노테이션을 붙인다. //ver 18 - ArrayList가 적용된 TeamMemberDao를 사용한다. //ver 17 - TeamMemberDao 클래스를 사용하여 팀 멤버의 아이디를 관리한다. //ver 16 - 인스턴스 변수를 직접 사용하는 대신 겟터, 셋터 사용. // ver 15 - 팀 멤버를 등록, 조회, 삭제할 수 있는 기능 추가. // ver 14 - TeamDao를 사용하여 팀 데이터를 관리한다. // ver 13 - 시작일, 종료일을 문자열로 입력 받아 Date 객체로 변환하여 저장.
[ "rhdwn1955@naver.com" ]
rhdwn1955@naver.com
4360055956926f4136add44edcd2a946c57bf0e1
b7e206810d2365e82fcac0f2b57210f06665e4c2
/interlok-core/src/main/java/com/adaptris/core/util/UnmodifiableListIterator.java
3f4125426a39c2d5c389a00292550656ec5475e0
[ "Apache-2.0" ]
permissive
adaptris/interlok
33b829fb1979f6bbcb230a2f2592c48d0aecf680
5eeb78cfa620fb16a9827be862180118e777afc5
refs/heads/develop
2023-09-01T19:52:09.830345
2023-08-28T10:51:49
2023-08-28T11:08:15
44,253,783
28
11
Apache-2.0
2023-09-13T17:15:43
2015-10-14T14:37:52
Java
UTF-8
Java
false
false
1,841
java
/* * Copyright 2015 Adaptris Ltd. * * 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.adaptris.core.util; import java.util.ListIterator; /** * Iterator implementation. * <p> * The optional operations, {@link ListIterator#add(Object)}, * {@link ListIterator#set(Object)}, {@link ListIterator#remove()} are not * supported. * </p> * * @author lchan * */ public class UnmodifiableListIterator<E> implements ListIterator<E> { private ListIterator<E> baseIterator; public UnmodifiableListIterator(ListIterator<E> itr) { baseIterator = itr; } @Override public void add(E e) { throw new UnsupportedOperationException(); } @Override public boolean hasNext() { return baseIterator.hasNext(); } @Override public boolean hasPrevious() { return baseIterator.hasPrevious(); } @Override public E next() { return baseIterator.next(); } @Override public int nextIndex() { return baseIterator.nextIndex(); } @Override public E previous() { return baseIterator.previous(); } @Override public int previousIndex() { return baseIterator.previousIndex(); } @Override public void remove() { throw new UnsupportedOperationException(); } @Override public void set(E e) { throw new UnsupportedOperationException(); } }
[ "lewin.chan@adaptris.com" ]
lewin.chan@adaptris.com
8d3b8573db1919383f8b9707692c992405ecad86
331a54444ea173841a87d8fe5fbff59a73e6f5fc
/jrpc-core/src/main/java/com/dinstone/jrpc/transport/AbstractAcceptance.java
590ab93c02cf813adc4daaf933c00f611ca1f97b
[ "Apache-2.0" ]
permissive
dzdqfq/jrpc
2c58e878c647c5d5967213b5ce9e7c15a34f6e8d
b830f206d578cc3a0580a6ac2b274040d25bc3c5
refs/heads/master
2021-10-09T06:51:43.595196
2018-12-23T02:22:00
2018-12-23T02:22:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,795
java
/* * Copyright (C) 2013~2017 dinstone<dinstone@163.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.dinstone.jrpc.transport; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.UndeclaredThrowableException; import java.net.InetSocketAddress; import com.dinstone.jrpc.RpcException; import com.dinstone.jrpc.invoker.ServiceInvoker; import com.dinstone.jrpc.protocol.Call; import com.dinstone.jrpc.protocol.Request; import com.dinstone.jrpc.protocol.Response; import com.dinstone.jrpc.protocol.Result; public abstract class AbstractAcceptance implements Acceptance { protected ServiceInvoker serviceInvoker; protected TransportConfig transportConfig; protected InetSocketAddress serviceAddress; public AbstractAcceptance(ServiceInvoker serviceInvoker, TransportConfig transportConfig, InetSocketAddress serviceAddress) { if (serviceInvoker == null) { throw new IllegalArgumentException("serviceInvoker is null"); } this.serviceInvoker = serviceInvoker; this.serviceAddress = serviceAddress; this.transportConfig = transportConfig; } @Override public Response handle(Request request) { Result result = null; Call call = request.getCall(); try { Object resObj = serviceInvoker.invoke(call.getService(), call.getGroup(), call.getMethod(), call.getTimeout(), call.getParams(), call.getParamTypes()); result = new Result(200, resObj); } catch (RpcException e) { result = new Result(e.getCode(), e.getMessage()); } catch (NoSuchMethodException e) { result = new Result(405, "unkown method: [" + call.getGroup() + "]" + e.getMessage()); } catch (IllegalArgumentException | IllegalAccessException e) { String message = "illegal access: [" + call.getGroup() + "]" + call.getService() + "." + call.getMethod() + "(): " + e.getMessage(); result = new Result(502, message); } catch (InvocationTargetException e) { Throwable t = getTargetException(e); String message = "service exception: " + call.getGroup() + "]" + call.getService() + "." + call.getMethod() + "(): " + t.getMessage(); result = new Result(500, message); } catch (Throwable e) { String message = "service exception: " + call.getGroup() + "]" + call.getService() + "." + call.getMethod() + "(): " + e.getMessage(); result = new Result(509, message); } return new Response(request.getMessageId(), request.getSerializeType(), result); } private Throwable getTargetException(InvocationTargetException e) { Throwable t = e.getTargetException(); if (t instanceof UndeclaredThrowableException) { UndeclaredThrowableException ut = (UndeclaredThrowableException) t; t = ut.getCause(); if (t instanceof InvocationTargetException) { return getTargetException((InvocationTargetException) t); } } return t; } }
[ "dinstone@163.com" ]
dinstone@163.com
bfa98ef711fc53285228379d6cda0ab2432cec2f
f03e3844eb2f4aea7d7bb2c2297173fd9a1e95fe
/src/com/agloco/spring/ClearDBCacheAfterAdvice.java
2da717646567983e9fcd06b861c8869ffd3a0516
[]
no_license
harrysun2006/ag_Admin
786e2069862de1aaffd519af10c7c388585c3cd8
4ff3fa98aefce96bb950958075596f615e9eccdc
refs/heads/master
2020-05-18T03:17:56.363517
2014-09-03T10:37:04
2014-09-03T10:37:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package com.agloco.spring; import java.lang.reflect.Method; import com.liferay.portal.spring.hibernate.CacheRegistry; public class ClearDBCacheAfterAdvice implements org.springframework.aop.AfterReturningAdvice { public void afterReturning(Object returnValue, Method method, Object[] args, Object target) { CacheRegistry.clear(); } }
[ "harrysun2006@gmail.com" ]
harrysun2006@gmail.com
420f3f4c6f3346f1b7c8843337959026fa4702bc
b7a3f838ed814e60df5b248d889e6a624a8480e9
/sample-java/src/main/java/learningtest/com/rabbitmq/client/example/routing/ReceiveLogsDirect.java
93813d7501b6fb893f740b79963f62c781e733a0
[]
no_license
izeye/sample-java
cb4fb4972fe766db41d5a8497110d56181f4fcb8
dfcdc6f71169b88c446a70fc1aa195168e487d10
refs/heads/master
2021-01-01T06:55:25.586591
2019-11-05T05:19:09
2019-11-05T05:19:09
13,823,838
0
1
null
2020-07-01T19:49:06
2013-10-24T05:56:18
Java
UTF-8
Java
false
false
1,601
java
package learningtest.com.rabbitmq.client.example.routing; import java.io.IOException; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.ConsumerCancelledException; import com.rabbitmq.client.QueueingConsumer; import com.rabbitmq.client.ShutdownSignalException; public class ReceiveLogsDirect { private static final String EXCHANGE_NAME = "direct_logs"; public static void main(String[] args) throws IOException, ShutdownSignalException, ConsumerCancelledException, InterruptedException { ConnectionFactory factory = new ConnectionFactory(); factory.setHost("localhost"); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); channel.exchangeDeclare(EXCHANGE_NAME, "direct"); String queueName = channel.queueDeclare().getQueue(); if (args.length < 1) { System.err .println("Usage: ReceiveLogsDirect [info] [warning] [error]"); System.exit(1); } for (String severity : args) { channel.queueBind(queueName, EXCHANGE_NAME, severity); } System.out.println(" [*] Waiting for messages. To exit press CTRL+C"); QueueingConsumer consumer = new QueueingConsumer(channel); channel.basicConsume(queueName, true, consumer); while (true) { QueueingConsumer.Delivery delivery = consumer.nextDelivery(); String message = new String(delivery.getBody()); String routingKey = delivery.getEnvelope().getRoutingKey(); System.out.println(" [x] Received '" + routingKey + "':'" + message + "'"); } } }
[ "izeye@naver.com" ]
izeye@naver.com
b88442e3c8db5cea920d2c41b1e2a188f64b0677
911ef4bb157b36103b64167acba89fa61f4f8202
/cloud2020/seata-order-service2001/src/main/java/com/leolian/springcloud/alibaba/seata/service/StorageService.java
5c9e6d7dd9a4cae3cda89168c8e9cf52e06aee32
[]
no_license
comeonlian/springcloud
d2edcd1090925508ed5f1ad0d076daac7d95df4d
5fe37ebe7a8922e67c830ca6e1d84201a9b5f8c9
refs/heads/master
2023-03-22T00:15:14.983371
2020-06-17T15:17:49
2020-06-17T15:17:49
344,332,518
0
0
null
null
null
null
UTF-8
Java
false
false
602
java
package com.leolian.springcloud.alibaba.seata.service; import com.leolian.springcloud.alibaba.seata.domain.CommonResult; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @Component @FeignClient(value = "seata-storage-service") public interface StorageService { @GetMapping("/storage/decrease") CommonResult decrease(@RequestParam("productId") Long productId, @RequestParam("count") Integer count); }
[ "lianliang@oppo.com" ]
lianliang@oppo.com
5dcd8f9acd06e3807655be6ac854abd0f9e452b5
3e5d48682d511a6096f6d09c0b5e5b0603819b0c
/.metadata/.plugins/org.eclipse.wst.server.core/tmp3/work/Catalina/localhost/lession02-servlet/org/apache/jsp/message_jsp.java
1b453b779fa9e8267577e1fa6514908b1736fdce
[]
no_license
huyhue/jsp_servlet
c138a45ed8e09ce9505a737e7938526fb411c23d
979db1e7ba41f27fb9e7c43aff859aca0c4bcc72
refs/heads/master
2022-04-26T11:14:15.267067
2020-04-29T10:10:21
2020-04-29T10:10:21
259,890,324
0
0
null
null
null
null
UTF-8
Java
false
false
5,574
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/8.5.54 * Generated at: 2020-04-29 08:19:24 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class message_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent, org.apache.jasper.runtime.JspSourceImports { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; private static final java.util.Set<java.lang.String> _jspx_imports_packages; private static final java.util.Set<java.lang.String> _jspx_imports_classes; static { _jspx_imports_packages = new java.util.HashSet<>(); _jspx_imports_packages.add("javax.servlet"); _jspx_imports_packages.add("javax.servlet.http"); _jspx_imports_packages.add("javax.servlet.jsp"); _jspx_imports_classes = null; } private volatile javax.el.ExpressionFactory _el_expressionfactory; private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public java.util.Set<java.lang.String> getPackageImports() { return _jspx_imports_packages; } public java.util.Set<java.lang.String> getClassImports() { return _jspx_imports_classes; } public javax.el.ExpressionFactory _jsp_getExpressionFactory() { if (_el_expressionfactory == null) { synchronized (this) { if (_el_expressionfactory == null) { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); } } } return _el_expressionfactory; } public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() { if (_jsp_instancemanager == null) { synchronized (this) { if (_jsp_instancemanager == null) { _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } } } return _jsp_instancemanager; } public void _jspInit() { } public void _jspDestroy() { } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final java.lang.String _jspx_method = request.getMethod(); if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) { response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET, POST or HEAD. Jasper also permits OPTIONS"); return; } final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=ISO-8859-1"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\r\n"); out.write("<!DOCTYPE html>\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write("<meta charset=\"ISO-8859-1\">\r\n"); out.write("<title>Java Server Page</title>\r\n"); out.write("</head>\r\n"); out.write("<body>\r\n"); out.write("\t<h1>\r\n"); out.write("\t\t"); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${myMSG }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null)); out.write("\r\n"); out.write("\t</h1>\r\n"); out.write("\t<a href=\"message.html\">Go to Message HTML !</a>\r\n"); out.write("\t<form action=\"message.html\" method=\"get\">\r\n"); out.write("\t\t<label>Name : </label>\r\n"); out.write("\t\t<input type=\"text\" name=\"txtName\">\r\n"); out.write("\t\t<button type=\"submit\">Submit Form</button>\r\n"); out.write("\t</form>\r\n"); out.write("</body>\r\n"); out.write("</html>"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
[ "tpgiahuy5@gmail.com" ]
tpgiahuy5@gmail.com
198f313c5a171329dc76a53b9fb756fca40ca1d3
1f7a8a0a76e05d096d3bd62735bc14562f4f071a
/NeverPuk/net/wn.java
3161f09b09095cef4892a50c54db1d8cbf09a9b0
[]
no_license
yunusborazan/NeverPuk
b6b8910175634523ebd4d21d07a4eb4605477f46
a0e58597858de2fcad3524daaea656362c20044d
refs/heads/main
2023-05-10T09:08:02.183430
2021-06-13T17:17:50
2021-06-13T17:17:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,623
java
package net; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonSyntaxException; import java.lang.reflect.Type; import java.util.Arrays; import java.util.Iterator; import net.xn; import net.zk; import net.cb.t; import net.cr.n; import net.n0.ks; import net.nm.i; import net.nv.s; import net.nx.f; import net.r.h; import net.u.j; import net.y7.r; import net.yz.c; import net.yz.p; public class wn { public static final wn Z = new wn(0, new net.yz.m_[0], new net.yz.m_[0], s.e.n); private final int e; private final net.yz.m_[] I; private final net.yz.m_[] T; private final s.e n; public wn(int var1, net.yz.m_[] var2, net.yz.m_[] var3, s.e var4) { this.e = var1; this.I = var2; this.T = var3; this.n = var4; } public void W(final h var1) { var1.E(this.e); zk.l.p(); r var3 = (new r.g(var1.j())).n(var1).w(); boolean var4 = false; net.yz.m_[] var5 = this.I; int var6 = var5.length; int var7 = 0; if(var7 < var6) { net.yz.m_ var8 = var5[var7]; Iterator var9 = var1.hl.o().k(var8).g(var1.Q(), var3).iterator(); if(var9.hasNext()) { ks var10 = (ks)var9.next(); if(var1.p(var10)) { var1.hl.L((net.r.r)null, var1.b, var1.hS, var1.hr, net.nb.l.oM, p.PLAYERS, 0.2F, ((var1.Q().nextFloat() - var1.Q().nextFloat()) * 0.7F + 1.0F) * 2.0F); var4 = true; } i var11 = var1.Y(var10, false); if(var11 != null) { var11.F(); var11.l(var1.Q()); } } ++var7; } if(this.T.length > 0) { var1.x(this.T); } final f var13 = var1.t9; s var14 = this.n.z(var13.J()); net.nv.f var16 = new net.nv.f() { public String Q() { return var1.Q(); } public t b() { return var1.b(); } public void r(t var1x) { } public boolean n(int var1x, String var2) { boolean var3 = zk.l.p(); return var1x <= 2; } public j z() { return var1.z(); } public net.u.r A() { return var1.A(); } public net.yv.r T() { return var1.hl; } public net.ne.l P() { return var1; } public boolean x() { return var13.w1[0].N().b("commandBlockOutput"); } public void n(net.nv.l var1x, int var2) { var1.n(var1x, var2); } public f E() { return var1.E(); } private static xn a(xn var0) { return var0; } }; var13.J().W(var14, var16); } public String toString() { return "AdvancementRewards{experience=" + this.e + ", loot=" + Arrays.toString(this.I) + ", recipes=" + Arrays.toString(this.T) + ", function=" + this.n + '}'; } private static xn a(xn var0) { return var0; } public static class l implements JsonDeserializer { public wn N(JsonElement var1, Type var2, JsonDeserializationContext var3) throws JsonParseException { zk.l.D(); JsonObject var5 = c.V(var1, "rewards"); int var6 = c.t(var5, "experience", 0); JsonArray var7 = c.D(var5, "loot", new JsonArray()); net.yz.m_[] var8 = new net.yz.m_[var7.size()]; int var9 = 0; if(var9 < var8.length) { var8[var9] = new net.yz.m_(c.m(var7.get(var9), "loot[" + var9 + "]")); ++var9; } JsonArray var14 = c.D(var5, "recipes", new JsonArray()); net.yz.m_[] var10 = new net.yz.m_[var14.size()]; byte var11 = 0; if(var11 < var10.length) { var10[var11] = new net.yz.m_(c.m(var14.get(var11), "recipes[" + var11 + "]")); net.cr.s var12 = n.o(var10[var11]); throw new JsonSyntaxException("Unknown recipe \'" + var10[var11] + "\'"); } else { s.e var15; if(var5.has("function")) { var15 = new s.e(new net.yz.m_(c.X(var5, "function"))); } else { var15 = s.e.n; } return new wn(var6, var8, var10, var15); } } private static JsonParseException a(JsonParseException var0) { return var0; } } }
[ "68544940+Lazy-Hero@users.noreply.github.com" ]
68544940+Lazy-Hero@users.noreply.github.com
e40a78a3eade70873f2437a9b45fa00c2730865e
2f5cd5ba8a78edcddf99c7e3c9c19829f9dbd214
/java/practise/src/choose/ChooseAiYN.java
504f5531c0d760cbe0a9f9e8ae969f783083942b
[]
no_license
HTplex/Storage
5ff1f23dfe8c05a0a8fe5354bb6bbc57cfcd5789
e94faac57b42d6f39c311f84bd4ccb32c52c2d30
refs/heads/master
2021-01-10T17:43:20.686441
2016-04-05T08:56:57
2016-04-05T08:56:57
55,478,274
1
1
null
2020-10-28T20:35:29
2016-04-05T07:43:17
Java
UTF-8
Java
false
false
244
java
package choose; import javax.swing.JOptionPane; public class ChooseAiYN { public static void main(String[]args){ int answer=JOptionPane.showConfirmDialog(null, "are you a idiot?"); JOptionPane.showMessageDialog(null, answer); } }
[ "htplex@gmail.com" ]
htplex@gmail.com
225f3bd56ad4187486530ac131cb56d780e1ae41
da0efa8ffd08b86713aad007f10794c4b04d8267
/com/telkom/mwallet/home/C1572g.java
198d80b0b6a2a7b48c31e6762b6ef5ae8393b0e1
[]
no_license
ibeae/tcash
e200c209c63fdfe63928b94846824d7091533f8a
4bd25deb63ea7605202514f6a405961a14ef2553
refs/heads/master
2020-05-05T13:09:34.582260
2017-09-07T06:19:19
2017-09-07T06:19:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,332
java
package com.telkom.mwallet.home; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentManager; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager.LayoutParams; import android.widget.LinearLayout; import com.skcc.wallet.core.p057a.C1216a; import com.telkom.mwallet.C1359a; import com.telkom.mwallet.R; import com.telkom.mwallet.p064a.C1358h; import com.telkom.mwallet.tcash.TCashActivity; import com.telkom.mwallet.tcash.TCashAirtimeActivity; import com.telkom.mwallet.tcash.TCashTransferActivity; public class C1572g extends DialogFragment { private static C1359a f3774h; int f3775a; int f3776b; int f3777c; int f3778d; int f3779e; boolean f3780f; private ArcMenuView f3781g; class C15701 implements OnClickListener { final /* synthetic */ C1572g f3772a; C15701(C1572g c1572g) { this.f3772a = c1572g; } public void onClick(View view) { this.f3772a.dismiss(); ((HomeActivity) C1572g.f3774h).m5750q(); } } private class C1571a implements OnClickListener { final /* synthetic */ C1572g f3773a; private C1571a(C1572g c1572g) { this.f3773a = c1572g; } public void onClick(View view) { Intent intent; int intValue = ((Integer) view.getTag()).intValue(); C1216a.m4522b("onClick", "on Menu " + intValue); switch (intValue) { case 0: intent = new Intent(C1572g.f3774h, TCashAirtimeActivity.class); intent.putExtra(C1358h.f2940k, C1358h.f2943n); break; case 2: intent = new Intent(C1572g.f3774h, TCashActivity.class); intent.putExtra("CALL_MENU", "TCASH_PAYMENT"); intent.putExtra(C1358h.f2940k, C1358h.f2943n); break; case 3: if (((HomeActivity) C1572g.f3774h).m5749p()) { intent = new Intent(C1572g.f3774h, TCashTransferActivity.class); intent.putExtra(C1358h.f2940k, C1358h.f2943n); break; } this.f3773a.dismiss(); ((HomeActivity) C1572g.f3774h).m5751r(); return; case 4: intent = new Intent(C1572g.f3774h, TCashActivity.class); intent.putExtra("CALL_MENU", "TCASH_TOKEN"); intent.putExtra(C1358h.f2940k, C1358h.f2943n); break; default: return; } intent.setFlags(536870912); C1572g.f3774h.startActivity(intent); this.f3773a.dismiss(); } } public static C1572g m5777a(C1359a c1359a) { C1572g c1572g = new C1572g(); f3774h = c1359a; return c1572g; } public void m5778a(FragmentManager fragmentManager, int i, int i2, int i3, boolean z) { show(fragmentManager, "ArcMenu"); this.f3777c = i; this.f3779e = i3; this.f3780f = z; this.f3778d = i2; } public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { getDialog().getWindow().requestFeature(1); View inflate = layoutInflater.inflate(R.layout.fragment_menu, viewGroup, false); DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); this.f3775a = displayMetrics.widthPixels; this.f3776b = displayMetrics.heightPixels; float f = displayMetrics.density; C1216a.m4522b("SCREEN", "DeviceWidth " + this.f3775a); C1216a.m4522b("SCREEN", "DeviceHeight " + this.f3776b); C1216a.m4522b("SCREEN", "density " + f); C1216a.m4522b("SCREEN", "dp " + (((float) this.f3775a) / f) + " x " + (((float) this.f3776b) / f)); LayoutParams attributes = getDialog().getWindow().getAttributes(); attributes.width = -1; attributes.height = -1; attributes.gravity = 80; getDialog().setCanceledOnTouchOutside(false); this.f3781g = (ArcMenuView) inflate.findViewById(R.id.menuContainer); this.f3781g.setHomeTopMargin(this.f3777c); this.f3781g.setHomeClickListener(new C15701(this)); return inflate; } public void onStart() { super.onStart(); Window window = getDialog().getWindow(); window.setBackgroundDrawableResource(17170445); window.setWindowAnimations(R.style.dialog_animation_fade); LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.f3781g.getLayoutParams(); layoutParams.width = this.f3775a; layoutParams.height = this.f3776b; if (!this.f3780f) { window.addContentView(f3774h.getLayoutInflater().inflate(R.layout.fragment_help_home_menu, null), new ViewGroup.LayoutParams(this.f3775a, this.f3779e - this.f3778d)); } this.f3781g.m5727a(new C1571a()); } }
[ "igedetirtanata@gmail.com" ]
igedetirtanata@gmail.com
f7fa4bf5fab89b2779e84ded697710ce219c1eb5
eb5af3e0f13a059749b179c988c4c2f5815feb0f
/eclipsecode/jdbc_employee/src/com/woniuxy/jdbctest/JDBCTest9_getAllEmployees.java
c2ddd3db280d29c3e9a097cccfa3143fe1144406
[]
no_license
xiakai007/wokniuxcode
ae686753da5ec3dd607b0246ec45fb11cf6b8968
d9918fb349bc982f0ee9d3ea3bf7537e11d062a2
refs/heads/master
2023-04-13T02:54:15.675440
2021-05-02T05:09:47
2021-05-02T05:09:47
363,570,147
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package com.woniuxy.jdbctest; import java.util.List; import com.woniuxy.daos.EmployeeDao; import com.woniuxy.entities.Employee; public class JDBCTest9_getAllEmployees { public static void main(String[] args) { EmployeeDao epd = new EmployeeDao(); List<Employee> listEmpls = epd.getAllEmployees(); for(Employee empl:listEmpls) { System.out.println(empl); } } }
[ "980385778@qq.com" ]
980385778@qq.com
6104b22bbee2f81e68a3f7e3e7210fe066f847ac
de3c2d89f623527b35cc5dd936773f32946025d2
/src/main/java/com/scwang/smartrefresh/layout/p527a/RefreshContent.java
731c4fc3b54327c5dd796955599c671032af9b43
[]
no_license
ren19890419/lvxing
5f89f7b118df59fd1da06aaba43bd9b41b5da1e6
239875461cb39e58183ac54e93565ec5f7f28ddb
refs/heads/master
2023-04-15T08:56:25.048806
2020-06-05T10:46:05
2020-06-05T10:46:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
889
java
package com.scwang.smartrefresh.layout.p527a; import android.animation.ValueAnimator.AnimatorUpdateListener; import android.view.MotionEvent; import android.view.View; /* renamed from: com.scwang.smartrefresh.layout.a.e */ public interface RefreshContent { /* renamed from: a */ AnimatorUpdateListener mo30940a(int i); /* renamed from: a */ View mo30941a(); /* renamed from: a */ void mo30942a(int i, int i2, int i3); /* renamed from: a */ void mo30943a(MotionEvent motionEvent); /* renamed from: a */ void mo30944a(RefreshKernel iVar, View view, View view2); /* renamed from: a */ void mo30945a(ScrollBoundaryDecider kVar); /* renamed from: a */ void mo30946a(boolean z); /* renamed from: b */ View mo30947b(); /* renamed from: c */ boolean mo30948c(); /* renamed from: d */ boolean mo30949d(); }
[ "593746220@qq.com" ]
593746220@qq.com
989411e096cda4b3de502136cc79d43ff99685cf
cadae5810bb583f949ab2579f6454d85529ea142
/HomeMateMobile/src/main/java/com/orvibo/homemate/device/allone2/epg/ProgramInfoPushDialogActivity.java
158c65fab874bc3f7c00bc29cb3ad51bd0bc1232
[]
no_license
MyStar219/LifeUp_Android
80c1802d0cd51b1988fbd6780d2b445d89336752
98c215edb56ec0510f46c36c9dd86bb414a0fc9a
refs/heads/master
2021-01-24T07:47:02.091663
2017-06-05T02:44:06
2017-06-05T02:44:06
93,357,878
4
0
null
null
null
null
UTF-8
Java
false
false
3,044
java
package com.orvibo.homemate.device.allone2.epg; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.View; import com.smartgateway.app.R; import com.orvibo.homemate.bo.Device; import com.orvibo.homemate.bo.InfoPushMsg; import com.orvibo.homemate.bo.InfoPushProgram; import com.orvibo.homemate.common.BaseActivity; import com.orvibo.homemate.dao.DeviceDao; import com.orvibo.homemate.data.IntentKey; import com.orvibo.homemate.view.custom.DialogFragmentTwoButton; /** * Created by Allen on 2016/7/25. */ public class ProgramInfoPushDialogActivity extends BaseActivity implements DialogInterface.OnCancelListener { private DialogFragmentTwoButton dialogFragmentTwoButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); InfoPushMsg infoPushMsg = (InfoPushMsg) intent.getSerializableExtra("infoPushMsg"); dealInfoPush(infoPushMsg); } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); if (dialogFragmentTwoButton != null) { dialogFragmentTwoButton.dismiss(); } InfoPushMsg infoPushMsg = (InfoPushMsg) intent.getSerializableExtra("infoPushMsg"); dealInfoPush(infoPushMsg); } private void dealInfoPush(InfoPushMsg infoPushMsg) { if (infoPushMsg == null) { return; } dialogFragmentTwoButton = new DialogFragmentTwoButton(); dialogFragmentTwoButton.setTitle(infoPushMsg.getText()); dialogFragmentTwoButton.setOnCancelListener(this); dialogFragmentTwoButton.setLeftButtonText(getString(R.string.goto_program_subscribe)); dialogFragmentTwoButton.setLeftTextColor(getResources().getColor(R.color.green)); dialogFragmentTwoButton.setRightButtonText(getString(R.string.subscribe_success_shutdown)); dialogFragmentTwoButton.setRightTextColor(getResources().getColor(R.color.black)); InfoPushProgram infoPushProgram = infoPushMsg.getInfoPushProgram(); final Device device = new DeviceDao().selDevice(infoPushProgram.getUid(), infoPushProgram.getDeviceId()); dialogFragmentTwoButton.setOnTwoButtonClickListener(new DialogFragmentTwoButton.OnTwoButtonClickListener() { @Override public void onLeftButtonClick(View view) { Intent intent = new Intent(mContext, ProgramSubscribeActivity.class); intent.putExtra(IntentKey.DEVICE, device); mContext.startActivity(intent); finish(); } @Override public void onRightButtonClick(View view) { finish(); } }); dialogFragmentTwoButton.show(getFragmentManager(), ""); } @Override public void onCancel(DialogInterface dialog) { finish(); } @Override protected void onDestroy() { super.onDestroy(); } }
[ "star1985219@yahoo.com" ]
star1985219@yahoo.com
7b4c1c718b35a5da6e749306c4f7201b428602ed
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/autogen/a/if.java
3429a59622976c38b212a55bdf732577b5b95f8d
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
972
java
package com.tencent.mm.autogen.a; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.sdk.event.IEvent; public final class if extends IEvent { public a hJB; public if() { this((byte)0); } private if(byte paramByte) { AppMethodBeat.i(168880); this.hJB = new a(); this.order = false; this.callback = null; AppMethodBeat.o(168880); } public static final class a { public int adFlag; public int hJC; public int hJD; public int hJE; public int hJF; public String hJG; public int hJH; public long hJI; public int hJp; public long id; public int likeCount; public int liveStatus; public int type; public String username; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar * Qualified Name: com.tencent.mm.autogen.a.if * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
cb22b98c10e91aea621bdf0bffa9bd15ee82b4ac
c3e730d86586b2f7b58dd27a3b494d2c9970f0f0
/ndisconf-server/src/main/java/com/nsb/ndisconf/server/disconf/web/service/app/dao/impl/AppDaoImpl.java
f339bd7d9e69ccd1fdfb3c01f9b873b05fe6fc34
[ "Apache-2.0" ]
permissive
Dorae132/ndisconf
0be3f1b86936e20d60d5a35ed52094993b26927c
e6d84e1fbfb0f3d8b610d60cb6ec2e3f02639fba
refs/heads/master
2020-03-22T10:52:40.036660
2018-10-23T03:34:39
2018-10-23T03:34:39
139,933,310
3
0
null
2018-10-23T03:34:40
2018-07-06T04:31:20
Java
UTF-8
Java
false
false
1,047
java
package com.nsb.ndisconf.server.disconf.web.service.app.dao.impl; import java.util.List; import java.util.Set; import org.apache.commons.collections.CollectionUtils; import org.springframework.stereotype.Service; import com.nsb.ndisconf.server.disconf.web.service.app.bo.App; import com.nsb.ndisconf.server.disconf.web.service.app.dao.AppDao; import com.nsb.ndisconf.server.dsp.common.dao.AbstractDao; import com.nsb.ndisconf.server.dsp.common.dao.Columns; import com.nsb.ndisconf.server.unbiz.common.genericdao.operator.Match; /** * @author liaoqiqi * @version 2014-6-16 */ @Service public class AppDaoImpl extends AbstractDao<Long, App> implements AppDao { @Override public App getByName(String name) { return findOne(new Match(Columns.NAME, name)); } @Override public List<App> getByIds(Set<Long> ids) { if (CollectionUtils.isEmpty(ids)) { return findAll(); } return find(match(Columns.APP_ID, ids)); } @Override public int getCount() { return count(); } }
[ "nsb_2017@163.com" ]
nsb_2017@163.com
5ea448441712bd5b2a2b9460daee9aa554e5f267
13cbb329807224bd736ff0ac38fd731eb6739389
/javax/management/NotificationEmitter.java
c920895ecef80a770053f300a10afe8ee5caf96e
[]
no_license
ZhipingLi/rt-source
5e2537ed5f25d9ba9a0f8009ff8eeca33930564c
1a70a036a07b2c6b8a2aac6f71964192c89aae3c
refs/heads/master
2023-07-14T15:00:33.100256
2021-09-01T04:49:04
2021-09-01T04:49:04
401,933,858
0
0
null
null
null
null
UTF-8
Java
false
false
469
java
package javax.management; public interface NotificationEmitter extends NotificationBroadcaster { void removeNotificationListener(NotificationListener paramNotificationListener, NotificationFilter paramNotificationFilter, Object paramObject) throws ListenerNotFoundException; } /* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\javax\management\NotificationEmitter.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.0.7 */
[ "michael__lee@yeah.net" ]
michael__lee@yeah.net
33155df78abb0811375a7889ff9d8a0ed350f5aa
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_191/Testnull_19050.java
05adff3074007d69ed166736cb37ca5a1fd48ecf
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_191; import static org.junit.Assert.*; public class Testnull_19050 { private final Productionnull_19050 production = new Productionnull_19050("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
acc36fc8ca0bff4497c0dab4262cd106a8fa4e39
11a2368d21539326149a3f316dc5a8038841101b
/app/src/main/java/com/engloryintertech/small/jscustom/Js2JavaActivity.java
d7a09f715d93ff76c63618e21ba6696ade24575f
[ "Apache-2.0" ]
permissive
XinRan5312/JpushIMAndUmengPay
f4392da05618f426d5569ac0ebfbe96c263481a8
2c5ba6f5a8d5b7dea83217a242c212d28b00128a
refs/heads/master
2021-01-12T16:42:56.671671
2016-10-20T07:31:39
2016-10-20T07:31:39
71,436,469
2
0
null
null
null
null
UTF-8
Java
false
false
2,317
java
package com.engloryintertech.small.jscustom; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Button; import android.widget.Toast; import com.engloryintertech.small.R; /** * Created by admin on 2016/9/28. */ public class Js2JavaActivity extends Activity { private Button btn_show,btn_hide; private WebView wv; private JsInterface JSInterface2 = new JsInterface(); @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.js2java); btn_show = (Button)findViewById(R.id.btn_java2js_show); btn_hide = (Button)findViewById(R.id.btn_java2js_hide); wv = (WebView)findViewById(R.id.wv_js2java); wv.getSettings().setJavaScriptEnabled(true); wv.addJavascriptInterface(JSInterface2,"JSInterface2"); wv.setWebViewClient(new webviewClient()); wv.loadUrl("file:///android_asset/testjs_ai.html"); } class webviewClient extends WebViewClient { @Override public void onPageFinished(WebView view, String url) { // TODO Auto-generated method stub super.onPageFinished(view, url); btn_show.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Toast.makeText(getBaseContext(), "You click show button", 1000).show(); wv.loadUrl(String.format("javascript:java2js(0)"));//这里是java端调用webview的JS } }); btn_hide.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Toast.makeText(getBaseContext(), "You click hide button", 1000).show(); wv.loadUrl(String.format("javascript:java2js(1)"));//这里是java端调用webview的JS } }); JSInterface2.setWvClientClickListener(new webviewClick());//这里就是js调用java端的具体实现 } } class webviewClick implements JsInterface.wvClientClickListener { @Override public void wvHasClickEnvent() { // TODO Auto-generated method stub Toast.makeText(getBaseContext(), "link be on click", 1000).show(); } } }
[ "qixinh@jumei.com" ]
qixinh@jumei.com
1c59c5b1b442ac866d239923fade6eb16f036ffd
1d1345b6c7ac4af811cec7e792fc17691f97d135
/src/com/pisen/router/core/flashtransfer/scan/DeviceScanService.java
d3175afc0a462e10fa9a278158a0a1e912c86ebe
[]
no_license
simahuan/cloud-v3.2
75c5937d7866481d4e8e28ab53a5be4c43ecfa84
87cd4389311b0dc6cf92cfc3a3387789cb960e6e
refs/heads/master
2020-04-17T13:33:12.175828
2019-01-20T04:42:53
2019-01-20T04:42:53
166,620,344
0
2
null
null
null
null
UTF-8
Java
false
false
7,422
java
package com.pisen.router.core.flashtransfer.scan; import java.io.IOException; import java.net.InetAddress; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.StatusLine; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpHead; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.HttpConnectionParams; import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Binder; import android.os.IBinder; import android.text.TextUtils; import android.util.Log; import com.pisen.router.common.utils.NetUtil; import com.pisen.router.core.flashtransfer.FlashTransferConfig; import com.pisen.router.core.flashtransfer.FlashTransferManager; import com.pisen.router.core.flashtransfer.WifiApManager; import com.pisen.router.core.flashtransfer.scan.DeviceScanHandler.OnScanResultCallback; import com.pisen.router.core.flashtransfer.scan.protocol.UserInfoPtlV2; import com.pisen.router.ui.phone.flashtransfer.FlashTransferNetUtil; /** * 设备扫描服务 * @author ldj * @version 1.0 2015年5月22日 上午9:14:47 */ public class DeviceScanService extends Service implements OnScanResultCallback{ private static final boolean DEBUG = false; private static final String TAG = DeviceScanService.class.getSimpleName(); private DeviceScanBinder binder = new DeviceScanBinder(); private DeviceScanHandler deviceScanHandler; private ConnectChangedReceiver receiver; private List<OnScanResultCallback> callbacks; private FlashTransferNetUtil netUtil; @Override public void onCreate() { super.onCreate(); if(DEBUG) Log.d(TAG, "===onCreate==="); init(); registReceiver(); } @Override public IBinder onBind(Intent intent) { return binder; } private void registReceiver() { IntentFilter in = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); receiver = new ConnectChangedReceiver(); registerReceiver(receiver, in); } private void unregisterReceiver() { if(receiver != null) { unregisterReceiver(receiver); receiver = null; } } @Override public void onDestroy() { if(DEBUG) Log.e(TAG, "===onDestroy==="); releaseAllResouce(); super.onDestroy(); } public void releaseAllResouce() { releaseNetworkRelated(); unregisterReceiver(); if(netUtil.isWifiApEnabled()) { netUtil.closeAp(); } } private void init() { netUtil = FlashTransferNetUtil.getInstance(getApplicationContext()); // netUtil = new FlashTransferNetUtil(getApplicationContext()); callbacks = new ArrayList<DeviceScanHandler.OnScanResultCallback>(); } /** * 初始化DeviceScanHandler */ private boolean initScanHandler() { if(NetUtil.isWifiConnected(getApplicationContext()) || netUtil.isWifiApEnabled()) { InetAddress broadcastAddr = NetUtil.getBroadcast(NetUtil.getLocalIpAddress()); if(broadcastAddr != null) { deviceScanHandler = new DeviceScanHandler(broadcastAddr, FlashTransferConfig.PORT_UDP_BROADCAST, FlashTransferConfig.PORT_UDP_SINGLE_SEND); deviceScanHandler.setOnScanResultCallback(this); if(DEBUG) Log.d(TAG, "init called, deviceScanHandlered,broadcastAddr->" + broadcastAddr.getHostAddress()); return true; }else { if(DEBUG) Log.e(TAG, "init called, but can not get broadcast addr!!"); return false; } }else { if(DEBUG) Log.e(TAG, "init called, but wifi is not valided, skip init deviceScanHandler"); return false; } } /** * 扫描局域网设备 */ public boolean scanDevice() { if(deviceScanHandler != null) { deviceScanHandler.stopTimerScan(); noticeIOSOffline(); deviceScanHandler = null; } boolean result = initScanHandler(); if(result) { deviceScanHandler.startTimerScan(); } return result; } public void stopScanDevice() { releaseNetworkRelated(); } /** * 释放网络相关资源 */ private void releaseNetworkRelated() { noticeIOSOffline(); // 无连接时停止扫描 if (deviceScanHandler != null) { deviceScanHandler.stopTimerScan(); deviceScanHandler = null; } FlashTransferManager.release(true); DeviceContainer.getInstance(getApplicationContext()).reset(); } public void requestConnect(String targetIp) { if (deviceScanHandler != null && !TextUtils.isEmpty(targetIp)) { deviceScanHandler.requestConnect(targetIp); } } /** * 通知ios设备下线 * XXX */ private void noticeIOSOffline() { if(DEBUG) Log.d(TAG, "===noticeIOSOffline==="); final List<UserInfoPtlV2> users = new ArrayList<UserInfoPtlV2>(DeviceContainer.getInstance(getApplicationContext()).getUserList()); new Thread(new Runnable() { @Override public void run() { DefaultHttpClient client = new DefaultHttpClient(); // 设置连接超时时间为5s HttpConnectionParams.setConnectionTimeout(client.getParams(), 5000); HttpConnectionParams.setSoTimeout(client.getParams(), 10000); for(UserInfoPtlV2 u : users) { if(u.hostType.contains(FlashTransferConfig.PHONE_TYPE_IOS)) { HttpHead request = new HttpHead(String.format("http://%s:%s", u.hostIp, FlashTransferConfig.PORT_HTTP_RECV_FILE)); request.setHeader("actionType", "stopServer"); request.setHeader("Content-Length", "0"); try { HttpResponse response = client.execute(request); StatusLine statusLine = response.getStatusLine(); int statusCode = statusLine.getStatusCode(); if(statusCode == HttpStatus.SC_OK) { if(DEBUG) Log.d(TAG, "success"); }else { if(DEBUG) Log.d(TAG, "failed"); } request.abort(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } client.getConnectionManager().shutdown(); } }).start(); } @Override public void online(UserInfoPtlV2 user) { DeviceContainer.getInstance(getApplicationContext()).addDevice(user); for(OnScanResultCallback s : callbacks) { s.online(user); } } @Override public void offline(UserInfoPtlV2 user) { DeviceContainer.getInstance(getApplicationContext()).removeDevice(user.hostIp); for(OnScanResultCallback s : callbacks) { s.offline(user); } } /** * 设置用户扫描结果回调接口 * @param callback */ public void registOnScanResultCallback(OnScanResultCallback callback) { callbacks.add(callback); } public void unregistOnScanResultCallback(OnScanResultCallback callback) { callbacks.remove(callback); } public class DeviceScanBinder extends Binder { public DeviceScanService getService() { return DeviceScanService.this; } } private class ConnectChangedReceiver extends BroadcastReceiver { private ConnectivityManager cm; public ConnectChangedReceiver() { cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); } @Override public void onReceive(Context context, Intent intent) { NetworkInfo ni = cm.getActiveNetworkInfo(); if (!new WifiApManager(getApplicationContext()).isWifiApEnabled() &&(ni == null || !ni.isConnectedOrConnecting())) { if(DEBUG) Log.d(TAG, "connect is disconnct!!"); releaseNetworkRelated(); } } } }
[ "455215547@qq.com" ]
455215547@qq.com
d025a44b476686eb88980541a9df460ebb0113cb
1074c97cdd65d38c8c6ec73bfa40fb9303337468
/rda0105-agl-aus-java-a43926f304e3/xms-delivery/src/main/java/com/gms/delivery/dhl/xmlpi/datatype/pickup/request/CurrencyRoleTypeCode.java
81898d7a97e679712f971f064c2b4cd69ea300a9
[]
no_license
gahlawat4u/repoName
0361859254766c371068e31ff7be94025c3e5ca8
523cf7d30018b7783e90db98e386245edad34cae
refs/heads/master
2020-05-17T01:26:00.968575
2019-04-29T06:11:52
2019-04-29T06:11:52
183,420,568
0
0
null
null
null
null
UTF-8
Java
false
false
1,347
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.01.18 at 07:53:58 PM ICT // package com.gms.delivery.dhl.xmlpi.datatype.pickup.request; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CurrencyRoleTypeCode. * <p> * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="CurrencyRoleTypeCode"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="5"/> * &lt;enumeration value="BILLC"/> * &lt;enumeration value="PULCL"/> * &lt;enumeration value="INVCU"/> * &lt;enumeration value="BASEC"/> * &lt;/restriction> * &lt;/simpleType> * </pre> */ @XmlType(name = "CurrencyRoleTypeCode") @XmlEnum public enum CurrencyRoleTypeCode { BILLC, PULCL, INVCU, BASEC; public String value() { return name(); } public static CurrencyRoleTypeCode fromValue(String v) { return valueOf(v); } }
[ "sachin.gahlawat19@gmail.com" ]
sachin.gahlawat19@gmail.com
3d0d2e25761c3809915c3e0f6f322a9f2feb84c1
992905f13b869d6f9d9e09767d0f2ef3aa46dbf7
/source/desktop/src/test/java/org/pcsoft/framework/jnode3d/desktop/JNode3DWindowTest.java
0668ba0c386b351d4dfe6640aa7061111b237377
[ "Apache-2.0" ]
permissive
KleinerHacker/JNode3D
78baa3cdac5a318439bf1e40756b05cb6c3008cc
2abc0ca46a1534d99f775a7ae9b6119aca072ba2
refs/heads/master
2020-03-07T05:00:47.214301
2018-04-19T19:49:48
2018-04-19T19:49:48
127,283,047
1
0
null
null
null
null
UTF-8
Java
false
false
1,398
java
package org.pcsoft.framework.jnode3d.desktop; import org.pcsoft.framework.jnode3d.config.JNode3DConfiguration; import org.pcsoft.framework.jnode3d.config.JNode3DConfigurationBuilder; import java.io.IOException; public class JNode3DWindowTest extends JNode3DTest { public static void main(String[] args) throws IOException { final JNode3DConfiguration configuration = JNode3DConfigurationBuilder.create() .withVSync(true) .build(); final JNode3DWindow window3D = new JNode3DWindow(configuration); window3D.setTitle("Test Window"); window3D.setResizable(false); window3D.setWidth(800); window3D.setHeight(600); window3D.getAmbientLight().setPower(0.1f); window3D.getDirectionalLight().setPower(0.5f); buildScene(window3D); // new AnimationBase() { // private long counter = 0L; // // @Override // protected void loop(long timeDelta) { // counter += timeDelta; // // window3D.setAmbientLight(new AmbientLight(Color.WHITE, (float) Math.abs(Math.sin(counter * 0.000000001)))); // window3D.setDirectionalLight(new DirectionalLight(Color.WHITE, (float) Math.abs(Math.sin(counter * 0.0000000001)))); // } // }.start(); window3D.showAndWait(); window3D.terminate(); } }
[ "Christoph.Pfeiffer.Berlin@freenet.de" ]
Christoph.Pfeiffer.Berlin@freenet.de
f57cb1ae94ce175eacfa68d0f200db340218c98a
b0355ea17fade964d91836ea21f15a42e58c8c4b
/src/fu/hao/intellidroid/core/analysis/AndroidAppDFSPathFinder.java
1de23903ba342a4186c83aea7a3fbb259f7dc990
[]
no_license
majestyhao/MyIntelliDroid
6f748a92b662e2ce2588bf5820d49a87338c4ac4
7700f6df266675dce4badbb0bdf2c1ec2dfe1dcf
refs/heads/master
2020-05-22T01:06:45.100677
2016-09-27T16:26:26
2016-09-27T16:26:26
63,128,859
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
package fu.hao.intellidroid.core.analysis; import com.ibm.wala.ipa.callgraph.CGNode; import com.ibm.wala.util.collections.Filter; import com.ibm.wala.util.graph.Graph; import com.ibm.wala.util.graph.traverse.DFSPathFinder; /** * Description: Perform dfs for node that matches certain criteria * If found, it reports a path to the first node found. * Authors: Hao Fu(haofu@ucdavis.edu) * Date: 2016/9/2 */ public class AndroidAppDFSPathFinder extends DFSPathFinder<CGNode> { public AndroidAppDFSPathFinder(Graph<CGNode> graph, CGNode node, Filter<CGNode> filter) { super(graph, node, filter); } }
[ "jamesfuhao@gmail.com" ]
jamesfuhao@gmail.com
21ebd69886a76409c0d95b6418d57ef38b1cf1a5
fb91f96c6deb06ed1289231bf9c96ce64ce4f57a
/src/main/java/pl/asie/charset/module/storage/barrels/BarrelUpgradeOutputSupplier.java
40c4143b341b88b01a9f733fe6a4c0d70dcd3726
[]
no_license
CharsetMC/Charset
b314c044b618bc66be6b8ddd2f4326553c7efcfa
401e25a10399c19adf1ed893b94dd5867c07a1f0
refs/heads/1.12-stable
2022-09-22T19:59:22.751395
2022-08-31T20:56:19
2022-08-31T20:56:19
47,063,120
59
54
null
2019-07-21T07:11:19
2015-11-29T12:43:17
Java
UTF-8
Java
false
false
2,480
java
/* * Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020 Adrian Siekierka * * This file is part of Charset. * * Charset is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Charset 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 Charset. If not, see <http://www.gnu.org/licenses/>. */ package pl.asie.charset.module.storage.barrels; import com.google.gson.JsonObject; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.JsonUtils; import net.minecraftforge.common.crafting.JsonContext; import pl.asie.charset.lib.recipe.IOutputSupplier; import pl.asie.charset.lib.recipe.IOutputSupplierFactory; import pl.asie.charset.lib.recipe.IngredientMatcher; import pl.asie.charset.lib.recipe.RecipeCharset; public class BarrelUpgradeOutputSupplier implements IOutputSupplier { private final BarrelUpgrade upgradeType; private BarrelUpgradeOutputSupplier(BarrelUpgrade upgradeType) { this.upgradeType = upgradeType; } @Override public ItemStack getCraftingResult(RecipeCharset recipe, IngredientMatcher matcher, InventoryCrafting inv) { for (Ingredient i : matcher.getMatchedIngredients()) { ItemStack is = matcher.getStack(i); if (is.getItem() instanceof ItemDayBarrel || is.getItem() instanceof ItemMinecartDayBarrel) { is = is.copy(); is.setCount(1); return TileEntityDayBarrel.addUpgrade(is, upgradeType); } } return null; } @Override public ItemStack getDefaultOutput() { return new ItemStack(CharsetStorageBarrels.barrelCartItem); } public static class Factory implements IOutputSupplierFactory { @Override public IOutputSupplier parse(JsonContext context, JsonObject json) { return new BarrelUpgradeOutputSupplier(BarrelUpgrade.valueOf(JsonUtils.getString(json, "upgrade"))); } } }
[ "kontakt@asie.pl" ]
kontakt@asie.pl
2391e7ebd88c057e90a298f84cd2e4ebaed82a55
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/test/com/annimon/stream/longstreamtests/MapTest.java
0a5aa17738edf79de3e96390f91b71fdb9d3eed5
[]
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
652
java
package com.annimon.stream.longstreamtests; import com.annimon.stream.LongStream; import com.annimon.stream.function.LongUnaryOperator; import org.hamcrest.Matchers; import org.junit.Test; public final class MapTest { @Test public void testMap() { LongUnaryOperator negator = new LongUnaryOperator() { @Override public long applyAsLong(long operand) { return -operand; } }; LongStream.of(10L, 20L, 30L).map(negator).custom(assertElements(Matchers.arrayContaining((-10L), (-20L), (-30L)))); LongStream.empty().map(negator).custom(assertIsEmpty()); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
e103243f53b1467e9a4f957a977bb06b3733e4ec
217de722a86cd2a28a787c6b214c25c11c6dc4d2
/zcloud-auth/zcloud-auth-service/src/main/java/com/jfatty/zcloud/auth/config/EhcacheConfig.java
c1143f4c2ac35a5a4f8002ce40140102b913db42
[]
no_license
dizhaung/zcloud-1
a7e2f419a3a47de8ffffdc44b3acdd7783b85901
38d17288d60b3a1c079a4b6a51d29356a37c4db2
refs/heads/master
2023-05-09T19:47:04.986295
2020-09-01T07:27:10
2020-09-01T07:27:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,001
java
package com.jfatty.zcloud.auth.config; /** * 描述 * * @author jfatty on 2019/12/13 * @email jfatty@163.com */ import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.ehcache.EhCacheCacheManager; import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; /** * 配置ehcache * */ @Configuration @EnableCaching public class EhcacheConfig { @Bean public EhCacheManagerFactoryBean cacheManagerFactoryBean(){ EhCacheManagerFactoryBean bean = new EhCacheManagerFactoryBean(); bean.setConfigLocation(new ClassPathResource("ehcache.xml")); bean.setShared(true); return bean; } @Bean public EhCacheCacheManager ehCacheCacheManager(EhCacheManagerFactoryBean bean){ return new EhCacheCacheManager(bean.getObject()); } }
[ "zealsoft#yeah.net" ]
zealsoft#yeah.net
0dc4144a65eb312c3b85573e0c8232c0017f1c27
8c5e64d7000edf7a201179eeb1020c591d8fd0cd
/Minecraft/build/tmp/recompileMc/sources/net/minecraftforge/fml/common/registry/ForgeRegistries.java
4f2ecca8de8e71c64a7545144c52a6987c2fca05
[ "LGPL-2.0-or-later", "LGPL-2.1-only", "BSD-3-Clause", "MIT" ]
permissive
shaw-wong/Malmo
1f1bec86ff5b2c8038540d029a9d2288201e0f3a
2683891206e8ab7f015d5d0feb6b5a967f02c94f
refs/heads/master
2021-06-25T13:14:30.097602
2018-06-03T14:25:19
2018-06-03T14:25:19
125,961,215
1
0
MIT
2018-04-10T05:34:35
2018-03-20T04:35:00
Java
UTF-8
Java
false
false
2,921
java
/* * Minecraft Forge * Copyright (c) 2016. * * 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package net.minecraftforge.fml.common.registry; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.item.Item; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionType; import net.minecraft.util.SoundEvent; import net.minecraft.world.biome.Biome; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; /** * A class that exposes static references to all vanilla and Forge registries. * Created to have a central place to access the registries directly if modders need. * It is still advised that if you are registering things to go through {@link GameRegistry} register methods, but queries and iterations can use this. */ public class ForgeRegistries { static { init(); } // This must be above the fields so we guarantee it's run before findRegistry is called. Yay static inializers public static final IForgeRegistry<Block> BLOCKS = GameRegistry.findRegistry(Block.class); public static final IForgeRegistry<Item> ITEMS = GameRegistry.findRegistry(Item.class); public static final IForgeRegistry<Potion> POTIONS = GameRegistry.findRegistry(Potion.class); public static final IForgeRegistry<Biome> BIOMES = GameRegistry.findRegistry(Biome.class); public static final IForgeRegistry<SoundEvent> SOUND_EVENTS = GameRegistry.findRegistry(SoundEvent.class); public static final IForgeRegistry<PotionType> POTION_TYPES = GameRegistry.findRegistry(PotionType.class); public static final IForgeRegistry<Enchantment> ENCHANTMENTS = GameRegistry.findRegistry(Enchantment.class); public static final IForgeRegistry<VillagerProfession> VILLAGER_PROFESSIONS = GameRegistry.findRegistry(VillagerProfession.class); public static final IForgeRegistry<EntityEntry> ENTITIES = GameRegistry.findRegistry(EntityEntry.class); /** * This function is just to make sure static inializers in other classes have run and setup their registries before we query them. */ private static void init() { GameData.getMain(); VillagerRegistry.instance(); } }
[ "254664427@qq.com" ]
254664427@qq.com
7aea20ef31ae256f37642e6225ff15f54251b497
52019a46c8f25534afa491a5f68bf5598e68510b
/plugins/dnd-viewer/src/main/java/org/nakedobjects/plugins/dnd/viewer/border/LineStyleWindowBorder.java
e85422955406bb189aef49352bcf00f696e88d3a
[ "Apache-2.0" ]
permissive
JavaQualitasCorpus/nakedobjects-4.0.0
e765b4980994be681e5562584ebcf41e8086c69a
37ee250d4c8da969eac76749420064ca4c918e8e
refs/heads/master
2023-08-29T13:48:01.268876
2020-06-02T18:07:23
2020-06-02T18:07:23
167,005,009
0
1
Apache-2.0
2022-06-10T22:44:43
2019-01-22T14:08:50
Java
UTF-8
Java
false
false
2,560
java
package org.nakedobjects.plugins.dnd.viewer.border; import org.nakedobjects.metamodel.commons.debug.DebugString; import org.nakedobjects.plugins.dnd.Canvas; import org.nakedobjects.plugins.dnd.ColorsAndFonts; import org.nakedobjects.plugins.dnd.Toolkit; import org.nakedobjects.plugins.dnd.View; import org.nakedobjects.plugins.dnd.ViewState; import org.nakedobjects.plugins.dnd.viewer.action.WindowControl; import org.nakedobjects.plugins.dnd.viewer.drawing.Color; import org.nakedobjects.plugins.dnd.viewer.drawing.Location; import org.nakedobjects.plugins.dnd.viewer.drawing.Size; import org.nakedobjects.plugins.dnd.viewer.drawing.Text; public class LineStyleWindowBorder implements BorderDrawing { private final static Text TITLE_STYLE = Toolkit.getText(ColorsAndFonts.TEXT_TITLE_SMALL); private int titlebarHeight = Math.max(WindowControl.HEIGHT + View.VPADDING + TITLE_STYLE.getDescent(), TITLE_STYLE.getTextHeight()); public void debugDetails(DebugString debug) {} public void draw(Canvas canvas, Size s, boolean hasFocus, ViewState state, WindowControl[] controls, String title) { final Color borderColor = hasFocus ? Toolkit.getColor(ColorsAndFonts.COLOR_BLACK) : Toolkit .getColor(ColorsAndFonts.COLOR_SECONDARY1); canvas.drawRectangle(0, 0, s.getWidth(), s.getHeight(), borderColor); canvas.drawLine(0, titlebarHeight, s.getWidth(), titlebarHeight, borderColor); canvas.drawText(title, 6, TITLE_STYLE.getLineHeight(), borderColor, Toolkit.getText(ColorsAndFonts.TEXT_TITLE_SMALL)); } // TODO transiency should be flagged elsewhere and dealt with in the draw method. public void drawTransientMarker(Canvas canvas, Size size) {} public int getBottom() { return 7; } public int getLeft() { return 5; } public void getRequiredSize(Size size, String title, WindowControl[] controls) {} public int getRight() { return 5; } public int getTop() { return titlebarHeight + 5; } public void layoutControls(Size size, WindowControl[] controls) { int x = size.getWidth() - 1 - (WindowControl.WIDTH + View.HPADDING) * controls.length; final int y = 2 + View.VPADDING; for (int i = 0; i < controls.length; i++) { controls[i].setSize(controls[i].getRequiredSize(new Size())); controls[i].setLocation(new Location(x, y)); x += controls[i].getSize().getWidth() + View.HPADDING; } } } // Copyright (c) Naked Objects Group Ltd.
[ "taibi@sonar-scheduler.rd.tut.fi" ]
taibi@sonar-scheduler.rd.tut.fi
3bd731965646d62fee9ea1318216c205b5485bbd
1c9589d4e3bc1523ba1e745a2155433e4bd4b85c
/src/com/javarush/test/level34/lesson08/bonus01/Cache.java
fb1e10cdb6acef9fe1ec55088f67cbddcf419d1d
[]
no_license
Adeptius/JavaRushHomeWork
230a7dfd48b063bf7e62d5b50e7fc3f4b529fc0a
ee587724a7d579463d5deb5211b8e2f4bf902fdb
refs/heads/master
2020-05-22T06:42:56.780076
2019-09-12T15:43:25
2019-09-12T15:43:25
65,140,116
0
0
null
null
null
null
UTF-8
Java
false
false
978
java
package com.javarush.test.level34.lesson08.bonus01; import java.lang.reflect.Method; import java.util.Map; import java.util.WeakHashMap; public class Cache<K, V> { private Map<K, V> cache = new WeakHashMap<>(); //TODO add your code here public V getByKey(K key, Class<V> clazz) throws Exception { //TODO add your code here V v = cache.get(key); if (v==null){ v = clazz.getDeclaredConstructor(key.getClass()).newInstance(key); cache.put(key, v); } return v; } public boolean put(V obj) { //TODO add your code here try { Method getKeyMethod = obj.getClass().getMethod("getKey"); getKeyMethod.setAccessible(true); K key = (K)getKeyMethod.invoke(obj); return cache.put(key, obj) != null; } catch (Exception e) { return false; } } public int size() { return cache.size(); } }
[ "adeptius@gmail.com" ]
adeptius@gmail.com
1308c2baf8a383d64f5b7a8fadd2946d573db708
e5b97b5a79ba5cd9fab9f88dd7d725792af58816
/ireport/src/it/businesslogic/ireport/gui/command/FormatCommandAlignCenter.java
c2099ae9aaad1eba3f592e75b60e10262a1a12d4
[]
no_license
boyranger/lmireport
fa2721bb31c85dea27d15d9a210ef47a788123ca
65244e644ca72fcab72d8e9f64c17004d5dbdf9f
refs/heads/master
2021-01-23T08:10:33.679305
2009-10-30T05:59:38
2009-10-30T05:59:38
33,232,678
0
0
null
null
null
null
UTF-8
Java
false
false
2,247
java
/* * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved. * http://www.jaspersoft.com. * * Unless you have purchased a commercial license agreement from JasperSoft, * the following license terms apply: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed WITHOUT ANY WARRANTY; and without the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt * or write to: * * Free Software Foundation, Inc., * 59 Temple Place - Suite 330, * Boston, MA USA 02111-1307 * * * * * FormatCommandAlignCenter.java * * Created on 9 mei 2005, 21:36 * */ package it.businesslogic.ireport.gui.command; import it.businesslogic.ireport.OperationType; import java.awt.Point; public class FormatCommandAlignCenter extends FormatCommand { /** * Creates a new FormatCommandAlignCenter object. */ FormatCommandAlignCenter() { operationType = OperationType.ALIGN_CENTER; } int centerx; /** * DOCUMENT ME! */ public void preparation() { centerx = 10 + jrf.getReport().getWidth() / 2; } /** * DOCUMENT ME! */ public void modify() { int centery = jrf.getReport().getBandYLocation(re.getBand()) + 10 + re.getBand().getHeight() / 2; re.setPosition(new Point(centerx - (re.getWidth() / 2), centery - (re.getHeight() / 2))); } /** * Returns the value of centerx. * @return centerx! */ public int getCenterx() { return centerx; } /** * Sets the value of centerx. * * @param centerx The value to assign centerx. */ public void setCenterx(int centerx) { this.centerx = centerx; } }
[ "maodie007@163.com@b94ed7a6-887a-11de-8f56-7b2e0289298d" ]
maodie007@163.com@b94ed7a6-887a-11de-8f56-7b2e0289298d
4246d302f5abb1173cb9d92195cac3cc47cc467d
e82c1473b49df5114f0332c14781d677f88f363f
/MED-CLOUD/med-service/src/test/java/nta/med/service/integration/bass/BAS0123U00LayZipCodeTest.java
0459577173943332953e96410eaf50d50c4ec8ef
[]
no_license
zhiji6/mih
fa1d2279388976c901dc90762bc0b5c30a2325fc
2714d15853162a492db7ea8b953d5b863c3a8000
refs/heads/master
2023-08-16T18:35:19.836018
2017-12-28T09:33:19
2017-12-28T09:33:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,174
java
package nta.med.service.integration.bass; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import nta.med.common.remoting.rpc.protobuf.Rpc; import nta.med.service.ihis.proto.BassServiceProto; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.vertx.java.core.Handler; import org.vertx.java.core.Vertx; import org.vertx.java.core.eventbus.Message; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:META-INF/spring/spring-master.xml" }) public class BAS0123U00LayZipCodeTest { @Autowired protected Vertx vertx; @Test public void Test() throws InterruptedException { BassServiceProto.BAS0123U00LayZipCodeRequest request =BassServiceProto.BAS0123U00LayZipCodeRequest .newBuilder() .build(); Rpc.RpcMessage rpcMessage = Rpc.RpcMessage .newBuilder() .setId(System.currentTimeMillis()) .setService("patientInsurance ") .setVersion("1.0.0") .setPayloadClass( BassServiceProto.BAS0123U00LayZipCodeRequest.class .getSimpleName()) .setPayloadData(request.toByteString()).build(); final CountDownLatch latch = new CountDownLatch(1); vertx.eventBus() .send(BassServiceProto.BAS0123U00LayZipCodeRequest.class .getSimpleName(), rpcMessage.toByteArray(), new Handler<Message<byte[]>>() { @Override public void handle(Message<byte[]> event) { System.out.println("Success!"); latch.countDown(); } }); latch.await(100, TimeUnit.SECONDS); } }
[ "duc_nt@nittsusystem-vn.com" ]
duc_nt@nittsusystem-vn.com
e99fb40304302fef16b9e8c2a95ad72c8a002cf9
d0ebbd623d1552167c4989768056dcc28078ff85
/abc99/src/main/java/com/fastcode/abc99/domain/extended/authorization/rolepermission/IRolepermissionRepositoryExtended.java
840718951a430c7af2f40e985542612c04c54cba
[]
no_license
fastcoderepos/abc99
5f8383488094555e9001e2a5ae4a60c0f347146e
0f8e2681ee4dd5d35f8b83714c6ed3f3546ef8e5
refs/heads/master
2023-02-15T11:40:23.634524
2021-01-06T11:49:39
2021-01-06T11:49:39
327,296,257
0
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.fastcode.abc99.domain.extended.authorization.rolepermission; import org.springframework.stereotype.Repository; import com.fastcode.abc99.domain.core.authorization.rolepermission.IRolepermissionRepository; @Repository("rolepermissionRepositoryExtended") public interface IRolepermissionRepositoryExtended extends IRolepermissionRepository { //Add your custom code here }
[ "info@nfinityllc.com" ]
info@nfinityllc.com
407cd64867adf64a3180a7a3d534aa35876cbb5e
af846ab7ffc148cd3207f3e65cfb2dde6d92c767
/sparrow-search/sparrow-search-crawl/src/main/java/com/sparrow/collect/task/btmeet/BtmeetTask.java
0c73d06fd53e6a320a10dfd13784b31ebe3ca50f
[ "Apache-2.0" ]
permissive
aniu2002/myself-toolkit
aaf5f71948bb45d331b206d806de85c84bafadcc
aea640b4339ea24d7bfd32311f093560573635d3
refs/heads/master
2022-12-24T20:25:43.702167
2019-03-11T14:42:14
2019-03-11T14:42:14
99,811,298
1
0
Apache-2.0
2022-12-12T21:42:45
2017-08-09T13:26:46
Java
UTF-8
Java
false
false
959
java
package com.sparrow.collect.task.btmeet; import com.sparrow.collect.crawler.data.SiteEntry; import com.sparrow.collect.crawler.selector.AbstractPageSelector; import com.sparrow.collect.task.AbstractTask; import com.sparrow.collect.task.Context; import java.io.File; public class BtmeetTask extends AbstractTask { public void execute(Context ctx) { AbstractPageSelector selector = new BtmeetSelector(); selector.setPageItemSelectExpress(".item-title>h3>a"); selector.setUrlSelectExpress("href"); BtmeetCrawler crawler = new BtmeetCrawler(new File( "d:\\btmeet")); crawler.setSelector(selector); crawler.setSingleThread(false); SiteEntry entry = new SiteEntry(); entry.setTitle("BT搜索"); entry.setUrl("http://www.btwhat.net/search"); entry.setPageStart(1); entry.setPageEnd(6); crawler.exec(entry); crawler.destroy(); } }
[ "yuanzhengchu2002@163.com" ]
yuanzhengchu2002@163.com
ac634fd14e9c8657c8156a67a3b17ce1c4742fe0
e9d1b2db15b3ae752d61ea120185093d57381f73
/mytcuml-src/src/java/components/diagram_uml_sequence_elements/trunk/src/java/main/com/topcoder/gui/diagramviewer/uml/sequenceelements/edgeendings/EmptyArrowEdgeEnding.java
2779a65f5eb34c5e77c13fd2460fdd350467e641
[]
no_license
kinfkong/mytcuml
9c65804d511ad997e0c4ba3004e7b831bf590757
0786c55945510e0004ff886ff01f7d714d7853ab
refs/heads/master
2020-06-04T21:34:05.260363
2014-10-21T02:31:16
2014-10-21T02:31:16
25,495,964
1
0
null
null
null
null
UTF-8
Java
false
false
3,953
java
/* * Copyright (C) 2007 TopCoder Inc., All Rights Reserved. */ package com.topcoder.gui.diagramviewer.uml.sequenceelements.edgeendings; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Polygon; import java.awt.Rectangle; import java.awt.Shape; import java.awt.geom.AffineTransform; import java.util.EnumMap; import com.topcoder.gui.diagramviewer.uml.sequenceelements.Util; /** * <p> * The concrete edge ending with empty arrow used on sequence diagrams. * The painting of the edge ending is implemented. * </p> * * <p> * Thread Safety : The class is mutable and so is not thread safe. * </p> * * @author MiG-29, TCSDEVELOPER * @version 1.1 * @since 1.0 */ public class EmptyArrowEdgeEnding extends ConfiguredEdgeEnding { /** * <p> * The default constructor with the given propertyNameMapping configed. * </p> * * @param propertyNameMapping The predefined <code>Map</code> with information about property * names configuration. The properties are from <code>DiagramElement</code> class. */ public EmptyArrowEdgeEnding(EnumMap<ConfiguredEdgeEndingPropertyType, String> propertyNameMapping) { super(propertyNameMapping); } /** * <p> * Constructs the class and set related class variables by using the arguments. * </p> * * @param angle The rotating angle. * @param endingPoint Coordinates of the end point. * @param propertyNameMapping The predefined <code>Map</code> with information about property * names configuration. The properties are from <code>DiagramElement</code> class. * * @throws IllegalArgumentException if endingPoint argument is null */ public EmptyArrowEdgeEnding(double angle, Point endingPoint, EnumMap<ConfiguredEdgeEndingPropertyType, String> propertyNameMapping) { super(angle, endingPoint, propertyNameMapping); } /** * <p> * The drawing function for the edge ending. It paints the edge ending * differently for different RenderScheme. Refer to the component specification * for the details. * </p> * * @param g The reference to the Graphics instance, which is used for node ending drawing. * * @throws IllegalArgumentException if argument is null */ protected void paintComponent(Graphics g) { Util.checkNull(g, "g"); Graphics2D g2d = (Graphics2D) g; Point endingPoint = getEndingPoint(); double x1 = endingPoint.getX(); double y1 = endingPoint.getY(); AffineTransform tx = AffineTransform.getRotateInstance(getAngle(), x1, y1); Polygon poly1 = new Polygon(); poly1.addPoint((int) x1 - getArrowXLength(), (int) y1 - getArrowYLength()); poly1.addPoint((int) x1, (int) y1); Polygon poly2 = new Polygon(); poly2.addPoint((int) x1, (int) y1); poly2.addPoint((int) x1 - getArrowXLength(), (int) y1 + getArrowYLength()); Shape shape1 = tx.createTransformedShape((Shape) poly1); Shape shape2 = tx.createTransformedShape((Shape) poly2); // back up the color Color oldColor = g2d.getColor(); g2d.setColor(getStrokeColor()); g2d.draw(shape1); g2d.draw(shape2); // restore the color g2d.setColor(oldColor); } /** * <p> * This method returns false always because it is not interested at any swing events. * </p> * * @param x the x-coordinate value * @param y the y-coordinate value * * @return false always */ public boolean contains(int x, int y) { return false; } /** * <p> * Returns the bounding rectangle of the edge ending. * </p> * * @return The bounds of the edge ending and its selection. */ public Rectangle getBounds() { return super.getBounds(); } }
[ "kinfkong@126.com" ]
kinfkong@126.com
37992ac889814e4cf0252253d6f66f185d619dbb
7bb07f40c5a62e300ae4e83bf789e5aa1f1b70f7
/core/tags/1.5.2/src/com/vividsolutions/jump/workbench/ui/plugin/analysis/SpatialJoinPlugIn.java
77d8927e7acc12d985c3076a80492de1147ee684
[]
no_license
abcijkxyz/jump-pilot
a193ebf9cfb3f082a467c0cfbe0858d4e249d420
3b6989a88e5c8e00cd55c3148f00a7bf747574c7
refs/heads/master
2022-12-18T15:22:44.594948
2020-09-23T10:46:11
2020-09-23T10:46:11
297,995,218
0
0
null
2020-09-23T15:27:25
2020-09-23T14:23:54
null
UTF-8
Java
false
false
8,056
java
/* * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI * for visualizing and manipulating spatial features with geometry and attributes. * * Copyright (C) 2003 Vivid Solutions * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * For more information, contact: * * Vivid Solutions * Suite #1A * 2328 Government Street * Victoria BC V8T 5G5 * Canada * * (250)385-6040 * www.vividsolutions.com */ package com.vividsolutions.jump.workbench.ui.plugin.analysis; import java.util.*; import java.awt.event.*; import javax.swing.*; import com.vividsolutions.jump.I18N; import com.vividsolutions.jump.feature.*; import com.vividsolutions.jump.task.*; import com.vividsolutions.jump.workbench.WorkbenchContext; import com.vividsolutions.jump.workbench.model.*; import com.vividsolutions.jump.workbench.plugin.*; import com.vividsolutions.jump.workbench.plugin.util.*; import com.vividsolutions.jump.workbench.ui.*; import com.vividsolutions.jump.workbench.ui.plugin.FeatureInstaller; /** * Queries a layer by a spatial predicate. */ public class SpatialJoinPlugIn extends AbstractPlugIn implements ThreadedPlugIn { private Layer srcLayerA; private Layer srcLayerB; private JTextField paramField; private Collection functionNames; private MultiInputDialog dialog; private String funcNameToRun; private GeometryPredicate functionToRun = null; private boolean exceptionThrown = false; private double[] params = new double[2]; public SpatialJoinPlugIn() { functionNames = GeometryPredicate.getNames(); } private String categoryName = StandardCategoryNames.RESULT; public String getName(){ //exchanged plugin with SIGLE plugin return I18N.get("ui.plugin.analysis.SpatialJoinPlugIn.Spatial-Join"); //return I18N.get("org.openjump.sigle.plugin.SpatialJoinPlugIn.Transfer-Attributes"); } public void setCategoryName(String value) { categoryName = value; } public void initialize(PlugInContext context) throws Exception { FeatureInstaller featureInstaller = new FeatureInstaller(context.getWorkbenchContext()); featureInstaller.addMainMenuItem( this, new String[] {MenuNames.TOOLS, MenuNames.TOOLS_ANALYSIS}, new JMenuItem(this.getName() + "..."), createEnableCheck(context.getWorkbenchContext())); } public static MultiEnableCheck createEnableCheck(WorkbenchContext workbenchContext) { EnableCheckFactory checkFactory = new EnableCheckFactory(workbenchContext); return new MultiEnableCheck() .add(checkFactory.createWindowWithLayerNamePanelMustBeActiveCheck()) .add(checkFactory.createAtLeastNLayersMustExistCheck(2)); } public boolean execute(PlugInContext context) throws Exception { dialog = new MultiInputDialog(context.getWorkbenchFrame(), getName(), true); setDialogValues(dialog, context); GUIUtil.centreOnWindow(dialog); dialog.setVisible(true); if (! dialog.wasOKPressed()) { return false; } getDialogValues(dialog); return true; } public void run(TaskMonitor monitor, PlugInContext context) throws Exception { monitor.allowCancellationRequests(); // input-proofing if (functionToRun == null) return; if (srcLayerA == null) return; if (srcLayerB == null) return; monitor.report( I18N.get("ui.plugin.analysis.SpatialJoinPlugIn.Executing-join") + " " + functionToRun.getName() + "..."); FeatureCollection srcAFC = srcLayerA.getFeatureCollectionWrapper(); FeatureCollection srcBFC = srcLayerB.getFeatureCollectionWrapper(); //[sstein 28.Mar.2008] reversed order of input //(to be able to read from top to down the spatial relations) SpatialJoinExecuter executer = new SpatialJoinExecuter(srcBFC, srcAFC); FeatureCollection resultFC = executer.getResultFC(); executer.execute(monitor, functionToRun, params, resultFC); if (monitor.isCancelRequested()) return; String outputLayerName = I18N.get("ui.plugin.analysis.SpatialJoinPlugIn.Join")+ "-" + funcNameToRun; context.getLayerManager().addCategory(categoryName); context.addLayer(categoryName, outputLayerName, resultFC); if (exceptionThrown) { context.getWorkbenchFrame() .warnUser("Errors found while executing query"); } } private final static String LAYER_A = GenericNames.LAYER_A + " (" + GenericNames.TARGET_LAYER + ")"; private final static String LAYER_B = GenericNames.LAYER_B + " (" + GenericNames.SOURCE_LAYER + ")"; private final static String PREDICATE = GenericNames.RELATION; private final static String PARAM = GenericNames.PARAMETER; private void setDialogValues(MultiInputDialog dialog, PlugInContext context) { //dialog.setSideBarImage(new ImageIcon(getClass().getResource("DiffSegments.png"))); //[sstein 31March2008] replaced sidebar description by better description use in SIGLE plugin /* dialog.setSideBarDescription( I18N.get("ui.plugin.analysis.SpatialJoinPlugIn.Joins-two-layers-on-a-given-spatial-relationship") + " (" + I18N.get("ui.plugin.analysis.SpatialJoinPlugIn.example") +")"); */ dialog.setSideBarDescription( I18N.get("org.openjump.sigle.plugin.SpatialJoinPlugIn.Transfers-the-attributes-of-Layer-B-to-Layer-A-using-a-spatial-criterion") ); //Set initial layer values to the first and second layers in the layer list. //In #initialize we've already checked that the number of layers >= 1. [Jon Aquino] Layer initLayer1 = (srcLayerA == null)? context.getCandidateLayer(0) : srcLayerA; Layer initLayer2 = (srcLayerB == null)? context.getCandidateLayer(1) : srcLayerB; dialog.addLayerComboBox(LAYER_A, initLayer1, context.getLayerManager()); JComboBox functionComboBox = dialog.addComboBox(PREDICATE, funcNameToRun, functionNames, null); functionComboBox.addItemListener(new MethodItemListener()); paramField = dialog.addDoubleField(PARAM, params[0], 10); dialog.addLayerComboBox(LAYER_B, initLayer2, context.getLayerManager()); updateUIForFunction(funcNameToRun); } private void getDialogValues(MultiInputDialog dialog) { srcLayerA = dialog.getLayer(LAYER_A); srcLayerB = dialog.getLayer(LAYER_B); funcNameToRun = dialog.getText(PREDICATE); functionToRun = GeometryPredicate.getPredicate(funcNameToRun); params[0] = dialog.getDouble(PARAM); } private void updateUIForFunction(String funcName) { boolean paramUsed = false; GeometryPredicate func = GeometryPredicate.getPredicate(funcName); if (func != null) { paramUsed = func.getParameterCount() > 0; } paramField.setEnabled(paramUsed); // this has the effect of making the background gray (disabled) paramField.setOpaque(paramUsed); } private class MethodItemListener implements ItemListener { public void itemStateChanged(ItemEvent e) { updateUIForFunction((String) e.getItem()); } } }
[ "edso@d6f7b87f-2e33-0410-8384-f77abc8d64da" ]
edso@d6f7b87f-2e33-0410-8384-f77abc8d64da
35a4954f808d883458ddf0438d700196d7fbcd75
cfc60fc1148916c0a1c9b421543e02f8cdf31549
/src/testcases/CWE760_Predictable_Salt_One_Way_Hash/CWE760_Predictable_Salt_One_Way_Hash__URLConnection_42.java
a907fd6d480a8895707afab09706ded6950ad190
[ "LicenseRef-scancode-public-domain" ]
permissive
zhujinhua/GitFun
c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2
987f72fdccf871ece67f2240eea90e8c1971d183
refs/heads/master
2021-01-18T05:46:03.351267
2012-09-11T16:43:44
2012-09-11T16:43:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,246
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE760_Predictable_Salt_One_Way_Hash__URLConnection_42.java Label Definition File: CWE760_Predictable_Salt_One_Way_Hash.label.xml Template File: sources-sinks-42.tmpl.java */ /* * @description * CWE: 760 Use of one-way hash with a predictable salt * BadSource: URLConnection Read a string from a web server with URLConnection * GoodSource: A hardcoded string * Sinks: * GoodSink: use a sufficiently random salt * BadSink : SHA512 with a predictable salt * Flow Variant: 42 Data flow: data returned from one method to another in the same class * * */ package testcases.CWE760_Predictable_Salt_One_Way_Hash; import testcasesupport.*; import java.security.GeneralSecurityException; import java.security.MessageDigest; import java.security.SecureRandom; import javax.servlet.http.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.net.URL; import java.net.URLConnection; import java.util.logging.Logger; public class CWE760_Predictable_Salt_One_Way_Hash__URLConnection_42 extends AbstractTestCase { private String bad_source() throws Throwable { String data; Logger log_bad = Logger.getLogger("local-logger"); data = ""; /* init data */ URLConnection conn = (new URL("http://www.example.org/")).openConnection(); BufferedReader buffread = null; InputStreamReader instrread = null; try { /* read input from URLConnection */ instrread = new InputStreamReader(conn.getInputStream()); buffread = new BufferedReader(instrread); data = buffread.readLine(); // This will be reading the first "line" of the response body, // which could be very long if there are no newlines in the HTML } catch( IOException ioe ) { log_bad.warning("Error with stream reading"); } finally { /* clean up stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { log_bad.warning("Error closing buffread"); } finally { try { if( instrread != null ) { instrread.close(); } } catch( IOException ioe ) { log_bad.warning("Error closing instrread"); } } } return data; } public void bad() throws Throwable { String data = bad_source(); MessageDigest hash = MessageDigest.getInstance("SHA-512"); hash.update(data.getBytes()); /* FLAW: SHA512 with a predictable salt */ byte[] hashv = hash.digest("hash me".getBytes()); IO.writeLine(IO.toHex(hashv)); } /* goodG2B() - use goodsource and badsink */ private String goodG2B_source() throws Throwable { String data; java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger"); /* FIX: Use a hardcoded string */ data = "foo"; return data; } private void goodG2B() throws Throwable { String data = goodG2B_source(); MessageDigest hash = MessageDigest.getInstance("SHA-512"); hash.update(data.getBytes()); /* FLAW: SHA512 with a predictable salt */ byte[] hashv = hash.digest("hash me".getBytes()); IO.writeLine(IO.toHex(hashv)); } /* goodB2G() - use badsource and goodsink */ private String goodB2G_source() throws Throwable { String data; Logger log_bad = Logger.getLogger("local-logger"); data = ""; /* init data */ URLConnection conn = (new URL("http://www.example.org/")).openConnection(); BufferedReader buffread = null; InputStreamReader instrread = null; try { /* read input from URLConnection */ instrread = new InputStreamReader(conn.getInputStream()); buffread = new BufferedReader(instrread); data = buffread.readLine(); // This will be reading the first "line" of the response body, // which could be very long if there are no newlines in the HTML } catch( IOException ioe ) { log_bad.warning("Error with stream reading"); } finally { /* clean up stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { log_bad.warning("Error closing buffread"); } finally { try { if( instrread != null ) { instrread.close(); } } catch( IOException ioe ) { log_bad.warning("Error closing instrread"); } } } return data; } private void goodB2G() throws Throwable { String data = goodB2G_source(); SecureRandom r = new SecureRandom(); MessageDigest hash = MessageDigest.getInstance("SHA-512"); hash.update(r.getSeed(32)); /* FIX: Use a sufficiently random salt */ byte[] hashv = hash.digest("hash me".getBytes()); IO.writeLine(IO.toHex(hashv)); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* 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); } }
[ "amitf@chackmarx.com" ]
amitf@chackmarx.com
bc7864afdc16d7da0113e21940832f55c4951e11
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/thinkaurelius--titan/1c91e6cd1ad51c838f3214ba899f6855d38b64ad/before/PredicateCondition.java
92ed5912d3bd9ae040dba172ba72e1516d26ea4b
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
3,333
java
package com.thinkaurelius.titan.graphdb.query.condition; import com.google.common.base.Preconditions; import com.thinkaurelius.titan.core.*; import com.thinkaurelius.titan.graphdb.internal.InternalElement; import com.thinkaurelius.titan.graphdb.internal.InternalRelationType; import com.thinkaurelius.titan.graphdb.query.TitanPredicate; import com.thinkaurelius.titan.graphdb.util.ElementHelper; import com.tinkerpop.gremlin.structure.Direction; import org.apache.commons.lang.builder.HashCodeBuilder; import java.util.Iterator; /** * @author Matthias Broecheler (me@matthiasb.com) */ public class PredicateCondition<K, E extends TitanElement> extends Literal<E> { private final K key; private final TitanPredicate predicate; private final Object value; public PredicateCondition(K key, TitanPredicate predicate, Object value) { Preconditions.checkNotNull(key); Preconditions.checkArgument(key instanceof String || key instanceof RelationType); Preconditions.checkNotNull(predicate); this.key = key; this.predicate = predicate; this.value = value; } private boolean satisfiesCondition(Object value) { return predicate.test(value, this.value); } @Override public boolean evaluate(E element) { RelationType type; if (key instanceof String) { type = ((InternalElement) element).tx().getRelationType((String) key); if (type == null) return satisfiesCondition(null); } else { type = (RelationType) key; } Preconditions.checkNotNull(type); if (type.isPropertyKey()) { Iterator<Object> iter = ElementHelper.getValues(element,(PropertyKey)type).iterator(); if (iter.hasNext()) { while (iter.hasNext()) { if (satisfiesCondition(iter.next())) return true; } return false; } return satisfiesCondition(null); } else { assert ((InternalRelationType)type).getMultiplicity().isUnique(Direction.OUT); return satisfiesCondition(((TitanRelation) element).getProperty((EdgeLabel) type)); } } public K getKey() { return key; } public TitanPredicate getPredicate() { return predicate; } public Object getValue() { return value; } @Override public int hashCode() { return new HashCodeBuilder().append(getType()).append(key).append(predicate).append(value).toHashCode(); } @Override public boolean equals(Object other) { if (this == other) return true; if (other == null || !getClass().isInstance(other)) return false; PredicateCondition oth = (PredicateCondition) other; return key.equals(oth.key) && predicate.equals(oth.predicate) && value.equals(oth.value); } @Override public String toString() { return key.toString() + " " + predicate.toString() + " " + String.valueOf(value); } public static <K, E extends TitanElement> PredicateCondition<K, E> of(K key, TitanPredicate titanPredicate, Object condition) { return new PredicateCondition<K, E>(key, titanPredicate, condition); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
e5a23bdc132bf86e0a60bd49f98cf772df7099db
3729763ddb479b21c7f3a5f1e0a9954500850b52
/Sources/com/workday/sources/LocationHierarchyOrganizationAssignmentsResponseDataType.java
b2da37d93b856e928240c2a2e917cda842e2791e
[]
no_license
SANDEEPERUMALLA/workdayscanner
fe0816e9a95de73a598d6e29be5b20aeeca6cb60
8a4c3660cc588402aa49f948afe2168c4faa9df5
refs/heads/master
2020-03-18T22:30:21.218489
2018-05-29T20:24:36
2018-05-29T20:24:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,660
java
package com.workday.sources; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * Returned information from the Location Hierarchy Organization Assignments request. * * <p>Java class for Location_Hierarchy_Organization_Assignments_Response_DataType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="Location_Hierarchy_Organization_Assignments_Response_DataType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Location_Hierarchy_Organization_Assignments" type="{urn:com.workday/bsvc}Location_Hierarchy_Organization_AssignmentsType" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Location_Hierarchy_Organization_Assignments_Response_DataType", propOrder = { "locationHierarchyOrganizationAssignments" }) public class LocationHierarchyOrganizationAssignmentsResponseDataType { @XmlElement(name = "Location_Hierarchy_Organization_Assignments") protected List<LocationHierarchyOrganizationAssignmentsType> locationHierarchyOrganizationAssignments; /** * Gets the value of the locationHierarchyOrganizationAssignments property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the locationHierarchyOrganizationAssignments property. * * <p> * For example, to add a new item, do as follows: * <pre> * getLocationHierarchyOrganizationAssignments().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link LocationHierarchyOrganizationAssignmentsType } * * */ public List<LocationHierarchyOrganizationAssignmentsType> getLocationHierarchyOrganizationAssignments() { if (locationHierarchyOrganizationAssignments == null) { locationHierarchyOrganizationAssignments = new ArrayList<LocationHierarchyOrganizationAssignmentsType>(); } return this.locationHierarchyOrganizationAssignments; } }
[ "p.sandeepkumargupta@gmail.com" ]
p.sandeepkumargupta@gmail.com
6aae4e1c09d7b1f03ffdcf55150d23746144a03d
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/android/support/design/widget/C44945i.java
f4907911548f13cf7af9b70c9c2a34fda03e14c1
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,124
java
package android.support.design.widget; import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.StateListAnimator; import android.content.res.ColorStateList; import android.graphics.PorterDuff.Mode; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.InsetDrawable; import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.RippleDrawable; import android.os.Build.VERSION; import android.support.p057v4.p058a.p059a.C0280a; import android.view.View; import java.util.ArrayList; /* renamed from: android.support.design.widget.i */ final class C44945i extends C41487h { /* renamed from: qL */ private InsetDrawable f17658qL; /* renamed from: android.support.design.widget.i$a */ static class C8347a extends GradientDrawable { C8347a() { } public final boolean isStateful() { return true; } } C44945i(VisibilityAwareImageButton visibilityAwareImageButton, C25312k c25312k) { super(visibilityAwareImageButton, c25312k); } /* Access modifiers changed, original: final */ /* renamed from: a */ public final void mo66212a(ColorStateList colorStateList, Mode mode, int i, int i2) { Drawable layerDrawable; this.f16752qv = C0280a.m467f(mo66219cj()); C0280a.m457a(this.f16752qv, colorStateList); if (mode != null) { C0280a.m460a(this.f16752qv, mode); } if (i2 > 0) { this.f16754qx = mo66211a(i2, colorStateList); layerDrawable = new LayerDrawable(new Drawable[]{this.f16754qx, this.f16752qv}); } else { this.f16754qx = null; layerDrawable = this.f16752qv; } this.f16753qw = new RippleDrawable(ColorStateList.valueOf(i), layerDrawable, null); this.f16755qy = this.f16753qw; this.f16747qD.setBackgroundDrawable(this.f16753qw); } /* Access modifiers changed, original: final */ public final void setRippleColor(int i) { if (this.f16753qw instanceof RippleDrawable) { ((RippleDrawable) this.f16753qw).setColor(ColorStateList.valueOf(i)); } else { super.setRippleColor(i); } } /* Access modifiers changed, original: final */ /* renamed from: o */ public final void mo66225o(float f, float f2) { if (VERSION.SDK_INT != 21) { StateListAnimator stateListAnimator = new StateListAnimator(); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.play(ObjectAnimator.ofFloat(this.f16746qC, "elevation", new float[]{f}).setDuration(0)).with(ObjectAnimator.ofFloat(this.f16746qC, View.TRANSLATION_Z, new float[]{f2}).setDuration(100)); animatorSet.setInterpolator(f16742qr); stateListAnimator.addState(PRESSED_ENABLED_STATE_SET, animatorSet); animatorSet = new AnimatorSet(); animatorSet.play(ObjectAnimator.ofFloat(this.f16746qC, "elevation", new float[]{f}).setDuration(0)).with(ObjectAnimator.ofFloat(this.f16746qC, View.TRANSLATION_Z, new float[]{f2}).setDuration(100)); animatorSet.setInterpolator(f16742qr); stateListAnimator.addState(f16741qB, animatorSet); AnimatorSet animatorSet2 = new AnimatorSet(); ArrayList arrayList = new ArrayList(); arrayList.add(ObjectAnimator.ofFloat(this.f16746qC, "elevation", new float[]{f}).setDuration(0)); if (VERSION.SDK_INT >= 22 && VERSION.SDK_INT <= 24) { arrayList.add(ObjectAnimator.ofFloat(this.f16746qC, View.TRANSLATION_Z, new float[]{this.f16746qC.getTranslationZ()}).setDuration(100)); } arrayList.add(ObjectAnimator.ofFloat(this.f16746qC, View.TRANSLATION_Z, new float[]{0.0f}).setDuration(100)); animatorSet2.playSequentially((Animator[]) arrayList.toArray(new ObjectAnimator[0])); animatorSet2.setInterpolator(f16742qr); stateListAnimator.addState(ENABLED_STATE_SET, animatorSet2); animatorSet = new AnimatorSet(); animatorSet.play(ObjectAnimator.ofFloat(this.f16746qC, "elevation", new float[]{0.0f}).setDuration(0)).with(ObjectAnimator.ofFloat(this.f16746qC, View.TRANSLATION_Z, new float[]{0.0f}).setDuration(0)); animatorSet.setInterpolator(f16742qr); stateListAnimator.addState(EMPTY_STATE_SET, animatorSet); this.f16746qC.setStateListAnimator(stateListAnimator); } else if (this.f16746qC.isEnabled()) { this.f16746qC.setElevation(f); if (this.f16746qC.isFocused() || this.f16746qC.isPressed()) { this.f16746qC.setTranslationZ(f2); } else { this.f16746qC.setTranslationZ(0.0f); } } else { this.f16746qC.setElevation(0.0f); this.f16746qC.setTranslationZ(0.0f); } if (this.f16747qD.mo18192cd()) { mo66216cg(); } } public final float getElevation() { return this.f16746qC.getElevation(); } /* Access modifiers changed, original: final */ /* renamed from: cf */ public final void mo66215cf() { mo66216cg(); } /* Access modifiers changed, original: final */ /* renamed from: e */ public final void mo66223e(Rect rect) { if (this.f16747qD.mo18192cd()) { this.f17658qL = new InsetDrawable(this.f16753qw, rect.left, rect.top, rect.right, rect.bottom); this.f16747qD.setBackgroundDrawable(this.f17658qL); return; } this.f16747qD.setBackgroundDrawable(this.f16753qw); } /* Access modifiers changed, original: final */ /* renamed from: c */ public final void mo66213c(int[] iArr) { } /* Access modifiers changed, original: final */ /* renamed from: ce */ public final void mo66214ce() { } /* Access modifiers changed, original: final */ /* renamed from: ch */ public final boolean mo66217ch() { return false; } /* Access modifiers changed, original: final */ /* renamed from: ci */ public final C31842d mo66218ci() { return new C8345e(); } /* Access modifiers changed, original: final */ /* renamed from: ck */ public final GradientDrawable mo66220ck() { return new C8347a(); } /* Access modifiers changed, original: final */ /* renamed from: d */ public final void mo66222d(Rect rect) { if (this.f16747qD.mo18192cd()) { float radius = this.f16747qD.getRadius(); float elevation = this.f16746qC.getElevation() + this.f16745qA; int ceil = (int) Math.ceil((double) C37100j.m62063d(elevation, radius, false)); int ceil2 = (int) Math.ceil((double) C37100j.m62062c(elevation, radius, false)); rect.set(ceil, ceil2, ceil, ceil2); return; } rect.set(0, 0, 0, 0); } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
7837909f608cfbd1c590ea8139c976f822434726
1bad8b29b661cde256be8a425f4dfa54b434cf1b
/app/src/main/java/com/zhangwan/app/ui/bookstore/comment/WriteCommentActivity.java
684dcc494c4d29d505ea797d9ea26c4ded3fcf17
[]
no_license
EvlinLee/BookProject
78cc99080886356118b8ae551d7d15541a9c3f0d
718dcbf87ac85e4bd0ed826cb9bf25c81a891e2a
refs/heads/master
2020-04-01T13:40:53.900566
2018-06-16T12:31:48
2018-06-16T12:31:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,040
java
package com.zhangwan.app.ui.bookstore.comment; import android.annotation.SuppressLint; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.gxtc.commlibrary.helper.ImageHelper; import com.gxtc.commlibrary.utils.SpUtil; import com.gxtc.commlibrary.utils.ToastUtil; import com.zhangwan.app.R; import com.zhangwan.app.base.BaseTitleActivity; import com.zhangwan.app.bean.WriteCommentBean; import com.zhangwan.app.http.service.BookStoreApiService; import com.zhangwan.app.utils.StringUtils; import butterknife.BindView; import butterknife.OnClick; import rx.Observer; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; //写评论 public class WriteCommentActivity extends BaseTitleActivity implements TextWatcher { @BindView(R.id.et_write_content) EditText etWriteContent; @BindView(R.id.tv_write_num) TextView tvWriteNum; @BindView(R.id.iv_write_pic) ImageView ivWritePic; @BindView(R.id.tv_write_bookname) TextView tvWriteBookname; @BindView(R.id.tv_write_author) TextView tvWriteAuthor; @BindView(R.id.tv_write_sure) TextView tvWriteSure; private int bookId; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_writecomment); } @Override public void initData() { getBaseHeadView().showTitle("写评论").showBackButton(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); bookId = getIntent().getIntExtra("bookId", 0); String bookName = getIntent().getStringExtra("bookName"); String author = getIntent().getStringExtra("author"); String pic = getIntent().getStringExtra("pic"); ImageHelper.getInstance().loadImage(this, pic, ivWritePic); tvWriteBookname.setText(bookName); tvWriteAuthor.setText(author); etWriteContent.addTextChangedListener(this); } @OnClick(R.id.tv_write_sure) public void onViewClicked() { String comment = etWriteContent.getText().toString(); if (StringUtils.isEmpty(comment)) { ToastUtil.showShort(this, "请输入评论内容!"); } else { writeComment(comment); } } @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @SuppressLint("SetTextI18n") @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { if (charSequence.length() <= 500) { tvWriteNum.setText(500 - charSequence.length() + ""); } } @Override public void afterTextChanged(Editable editable) { } // 写评论接口 private void writeComment(String comment) { BookStoreApiService.getInstance() .apiWriteComment(SpUtil.getToken(this), bookId, comment) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<WriteCommentBean>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { } @Override public void onNext(WriteCommentBean writeCommentBean) { if (writeCommentBean.getCode().equals("200")) { ToastUtil.showLong(WriteCommentActivity.this, "评论成功!等待审核!"); finish(); } } }); } }
[ "17301673845@163.com" ]
17301673845@163.com
9f793861c4c8750fb3c458588cd0d29a4742376c
78c145df4f5f2cfa163e7da8ad9a49a1571050e7
/src/main/java/io/jenkins/plugins/analysis/core/filter/RegexpFilter.java
9eee9ca3c5acf690ac1080032ef68594e45ac477
[ "MIT" ]
permissive
013k-m/warnings-ng-plugin
e1f351219867b9e5532e20565a437b321ae4af7c
032c31b0a0518052478a9bd24e1e414777618ad3
refs/heads/master
2020-04-29T00:17:21.620065
2019-03-21T19:56:54
2019-03-21T19:56:54
175,688,056
0
0
MIT
2019-03-14T19:40:30
2019-03-14T19:40:30
null
UTF-8
Java
false
false
2,426
java
package io.jenkins.plugins.analysis.core.filter; import java.io.Serializable; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import org.apache.commons.lang3.StringUtils; import edu.hm.hafner.analysis.Report; import edu.hm.hafner.analysis.Report.IssueFilterBuilder; import edu.hm.hafner.util.Ensure; import org.kohsuke.stapler.QueryParameter; import hudson.model.AbstractDescribableImpl; import hudson.model.Descriptor; import hudson.util.FormValidation; /** * Defines a filter criteria based on a regular expression for {@link Report}. * * @author Ullrich Hafner */ public abstract class RegexpFilter extends AbstractDescribableImpl<RegexpFilter> implements Serializable { private static final long serialVersionUID = 1892735849628260157L; private final String pattern; /** * Creates a new instance of {@link RegexpFilter}. * * @param pattern * the regular expression of the filter */ public RegexpFilter(final String pattern) { super(); this.pattern = pattern; } /** * Returns the regular expression of the filter. * * @return the regular expression of the filter */ public String getPattern() { return pattern; } /** * Applies the filter on the specified builder. * * @param builder * the issue filter builder */ public abstract void apply(IssueFilterBuilder builder); /** Descriptor for a filter. */ public abstract static class RegexpFilterDescriptor extends Descriptor<RegexpFilter> { /** * Performs on-the-fly validation on threshold for high warnings. * * @param pattern * the pattern to check * * @return the validation result */ public FormValidation doCheckPattern(@QueryParameter final String pattern) { try { if (StringUtils.isBlank(pattern)) { return FormValidation.ok(Messages.pattern_blank()); } Pattern compiled = Pattern.compile(pattern); Ensure.that(compiled).isNotNull(); return FormValidation.ok(); } catch (PatternSyntaxException exception) { return FormValidation.error(Messages.pattern_error(exception.getLocalizedMessage())); } } } }
[ "ullrich.hafner@gmail.com" ]
ullrich.hafner@gmail.com
d6cc428f9db2d8bef09b131752efafa3214764f5
564e51f424d881652762ba27a4f1ae0b8247ed9d
/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerTests.java
baaa7058895b395f911cac9012fb7499a5bf791c
[ "Apache-2.0" ]
permissive
sky-dail/spring-boot
e0de91a0c4ffb12b5ed21cf41e6d0b24bb89b7c6
64daec49a271792b40895fb174038ecaa1cf3b6d
refs/heads/master
2020-04-23T08:00:25.964362
2019-09-17T11:26:13
2019-09-17T11:26:13
171,022,995
1
0
Apache-2.0
2019-02-16T16:10:26
2019-02-16T16:10:25
null
UTF-8
Java
false
false
2,732
java
/* * Copyright 2012-2019 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.boot.test.web.client; import org.junit.Test; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.test.context.MergedContextConfiguration; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; /** * Tests for {@link TestRestTemplateContextCustomizer}. * * @author Andy Wilkinson */ public class TestRestTemplateContextCustomizerTests { @Test @SuppressWarnings({ "unchecked", "rawtypes" }) public void whenContextIsNotABeanDefinitionRegistryTestRestTemplateIsRegistered() { new ApplicationContextRunner(TestApplicationContext::new) .withInitializer((context) -> { MergedContextConfiguration configuration = mock( MergedContextConfiguration.class); given(configuration.getTestClass()) .willReturn((Class) TestClass.class); new TestRestTemplateContextCustomizer().customizeContext(context, configuration); }).run((context) -> assertThat(context) .hasSingleBean(TestRestTemplate.class)); } @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) static class TestClass { } private static class TestApplicationContext extends AbstractApplicationContext { private final ConfigurableListableBeanFactory beanFactory = new DefaultListableBeanFactory(); @Override protected void refreshBeanFactory() throws BeansException, IllegalStateException { } @Override protected void closeBeanFactory() { } @Override public ConfigurableListableBeanFactory getBeanFactory() throws IllegalStateException { return this.beanFactory; } } }
[ "awilkinson@pivotal.io" ]
awilkinson@pivotal.io
93e9c5d02ca1af43560200f062b8547ac506ff85
50597bff5504a44a7ab7dd441a5fcfe8cbc4a23d
/ice-20201109/src/main/java/com/aliyun/ice20201109/models/SubmitMattingJobRequest.java
ca2224fd45cc13e5882e87b9e38e21860062c67d
[ "Apache-2.0" ]
permissive
shayv-123/alibabacloud-java-sdk
63fe9c0f6afe094d9dcfc19bf317e7ef8d5303e1
df7a6f7092f75ea3ba62de2c990dfcd986c3f66f
refs/heads/master
2023-05-05T02:22:41.236951
2021-05-11T09:55:17
2021-05-11T09:55:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,033
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.ice20201109.models; import com.aliyun.tea.*; public class SubmitMattingJobRequest extends TeaModel { // 输入文件 @NameInMap("InputFile") public String inputFile; @NameInMap("UserData") public String userData; @NameInMap("Title") public String title; @NameInMap("Description") public String description; // 输出bucket @NameInMap("OutputConfig") public String outputConfig; // 输入文件类型 @NameInMap("InputType") public String inputType; public static SubmitMattingJobRequest build(java.util.Map<String, ?> map) throws Exception { SubmitMattingJobRequest self = new SubmitMattingJobRequest(); return TeaModel.build(map, self); } public SubmitMattingJobRequest setInputFile(String inputFile) { this.inputFile = inputFile; return this; } public String getInputFile() { return this.inputFile; } public SubmitMattingJobRequest setUserData(String userData) { this.userData = userData; return this; } public String getUserData() { return this.userData; } public SubmitMattingJobRequest setTitle(String title) { this.title = title; return this; } public String getTitle() { return this.title; } public SubmitMattingJobRequest setDescription(String description) { this.description = description; return this; } public String getDescription() { return this.description; } public SubmitMattingJobRequest setOutputConfig(String outputConfig) { this.outputConfig = outputConfig; return this; } public String getOutputConfig() { return this.outputConfig; } public SubmitMattingJobRequest setInputType(String inputType) { this.inputType = inputType; return this; } public String getInputType() { return this.inputType; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
470730c8055bdf0f888b8f578550d8ecce3c9943
35ca1144aaa0405079b59c2fcbcd726f2472246d
/src/main/java/us/fok/lenzenslijper/views/geojson/FeatureCollection.java
5cf01ceb6bb58194ae92ccfa32b67feb103d9e5a
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause", "BSD-2-Clause" ]
permissive
fokus-llc/lenzenslijper
a1e152fdb0a808f97496e7b09b609b7101a1e956
861d741a739c976c96b2821d0b5361c8aae99f69
refs/heads/master
2021-01-16T00:22:18.583402
2014-10-28T02:39:16
2014-10-28T02:39:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package us.fok.lenzenslijper.views.geojson; import java.util.List; public class FeatureCollection extends GeoObject { private List<Feature> features; public FeatureCollection() { super(GeoObjectType.FeatureCollection); } public List<Feature> getFeatures() { return features; } public void setFeatures(List<Feature> features) { this.features = features; } }
[ "oss+fokus@teleological.net" ]
oss+fokus@teleological.net
974e105b76262104f2452b55686dc39bce6f3392
305fe6dc70184b3b3397485e77dee46c39336416
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201306/o/IdeaTextFilterSearchParameter.java
8594a7e4449116c932b76277247c314e6cb16be7
[ "Apache-2.0" ]
permissive
wangshuo870606/googleads-java-lib
a6b51f93bed1d56c9ca277218189a0f196a0dbed
dfb2bc36124297833805f08f322b2db8b97fc11f
refs/heads/master
2021-01-12T19:44:15.291058
2014-03-06T05:41:09
2014-03-06T05:41:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,618
java
package com.google.api.ads.adwords.jaxws.v201306.o; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * * A {@link SearchParameter} for {@code KEYWORD} {@link IdeaType}s that * specifies a collection of strings by which the results should be * constrained. This guarantees that each idea in the result will match * at least one of the {@code included} values. * * For this {@link SearchParameter}, excluded items will always take * priority over included ones. * * This can handle a maximum of 200 (included + excluded) elements. * <p>This element is supported by following {@link IdeaType}s: KEYWORD. * <p>This element is supported by following {@link RequestType}s: IDEAS, STATS. * * * <p>Java class for IdeaTextFilterSearchParameter complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="IdeaTextFilterSearchParameter"> * &lt;complexContent> * &lt;extension base="{https://adwords.google.com/api/adwords/o/v201306}SearchParameter"> * &lt;sequence> * &lt;element name="included" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="excluded" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "IdeaTextFilterSearchParameter", propOrder = { "included", "excluded" }) public class IdeaTextFilterSearchParameter extends SearchParameter { protected List<String> included; protected List<String> excluded; /** * Gets the value of the included property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the included property. * * <p> * For example, to add a new item, do as follows: * <pre> * getIncluded().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getIncluded() { if (included == null) { included = new ArrayList<String>(); } return this.included; } /** * Gets the value of the excluded property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the excluded property. * * <p> * For example, to add a new item, do as follows: * <pre> * getExcluded().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getExcluded() { if (excluded == null) { excluded = new ArrayList<String>(); } return this.excluded; } }
[ "jradcliff@google.com" ]
jradcliff@google.com
1761d5fa297a8f46057ffd4dfd7d80c997657b9f
ee0fc989b42d006f6c82b4927f41df9e7dd20b15
/bank1/src/main/java/com/yidiandian/mqlistener/TxmsgConsumer.java
9443644dd6811aa533baca94e734bf954ced6d62
[]
no_license
waitforyouwtt/service-transaction
cd6e4803ae14c8e2265e58708535bc14a2451642
9fe91582a00c6d69a4111dedb0c3d81d3bf6a0fc
refs/heads/master
2022-09-22T14:03:30.150590
2020-06-05T08:24:33
2020-06-05T08:24:34
269,571,620
0
0
null
null
null
null
UTF-8
Java
false
false
1,315
java
package com.yidiandian.mqlistener; import com.alibaba.fastjson.JSONObject; import com.yidiandian.model.AccountChangeEvent; import com.yidiandian.service.AccountInfoService; import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; import org.apache.rocketmq.spring.core.RocketMQListener; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * @Author: luoxian * @Date: 2020/6/5 9:40 * @Email: 15290810931@163.com */ @Component @Slf4j @RocketMQMessageListener(consumerGroup = "consumer_group_txmsg_bank2",topic = "topic_txmsg") public class TxmsgConsumer implements RocketMQListener<String> { @Autowired AccountInfoService accountInfoService; @Override public void onMessage(String message) { log.info("开始消费消息:{}",message); //解析消息 JSONObject jsonObject = JSONObject.parseObject(message); String accountChangeString = jsonObject.getString("accountChange"); //转成AccountChangeEvent AccountChangeEvent accountChangeEvent = JSONObject.parseObject(accountChangeString, AccountChangeEvent.class); //更新本地账户,增加金额 accountInfoService.updateAccountBalance(accountChangeEvent); } }
[ "abcd1234" ]
abcd1234
4b87b53658d9f92f8ace73934b4ac454c7863f15
ec897c1152f53fa1efe994e7842cb73d5bd82d08
/mdgen/src/hamy/mdgen/api/generator/format/aseXML/GSL.java
a1a48158cf77955cd1ca8dd8f52704c877d7fa0c
[ "MIT" ]
permissive
hemantmurthy/mdgen
4b69e5f6805526bd35a532c1c61610dae052ad78
31333e4d7687526103d08b6f6772a1805cd12c7a
refs/heads/master
2020-12-27T22:16:34.251746
2020-06-11T00:21:10
2020-06-11T00:21:10
238,079,485
0
0
null
null
null
null
UTF-8
Java
false
false
3,527
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2020.03.18 at 10:36:34 AM AEDT // package hamy.mdgen.api.generator.format.aseXML; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * Purpose - Network charge record type - "400" - GSL * * <p>Java class for GSL complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="GSL"> * &lt;complexContent> * &lt;extension base="{urn:aseXML:r38}BaseChargeItem"> * &lt;sequence> * &lt;element name="Code"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;maxLength value="10"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/element> * &lt;element name="Description" type="{urn:aseXML:r38}LineDescription"/> * &lt;/sequence> * &lt;attribute name="version" type="{urn:aseXML:r38}r11" default="r11" /> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "GSL", propOrder = { "code", "description" }) public class GSL extends BaseChargeItem { @XmlElement(name = "Code", required = true) protected String code; @XmlElement(name = "Description", required = true) protected String description; @XmlAttribute(name = "version") protected R11 version; /** * Gets the value of the code property. * * @return * possible object is * {@link String } * */ public String getCode() { return code; } /** * Sets the value of the code property. * * @param value * allowed object is * {@link String } * */ public void setCode(String value) { this.code = value; } /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the version property. * * @return * possible object is * {@link R11 } * */ public R11 getVersion() { if (version == null) { return R11 .R_11; } else { return version; } } /** * Sets the value of the version property. * * @param value * allowed object is * {@link R11 } * */ public void setVersion(R11 value) { this.version = value; } }
[ "hemantmurthy@gmail.com" ]
hemantmurthy@gmail.com
f5035fe2eea98ab4c020af3b2b16844f2a85ef71
2b2fcb1902206ad0f207305b9268838504c3749b
/WakfuClientSources/srcx/class_7037_cNc.java
9fe3e5c9c405c5eb4701d1e34b26239373b42e21
[]
no_license
shelsonjava/Synx
4fbcee964631f747efc9296477dee5a22826791a
0cb26d5473ba1f36a3ea1d7163a5b9e6ebcb0b1d
refs/heads/master
2021-01-15T13:51:41.816571
2013-11-17T10:46:22
2013-11-17T10:46:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,237
java
import java.util.Stack; public class cNc implements aTK { private uk W; private Stack X = new Stack(); public void a(cpa paramcpa, uk paramuk, dOc paramdOc) { this.W = paramuk; this.X.push(paramcpa); cpa localcpa = (cpa)this.X.peek(); dOc localdOc = paramdOc; Jg localJg = localdOc.getAppearance(); localJg.setElementMap(localcpa); paramdOc.bb(localJg); localJg.brn(); Cx localCx = new Cx(); localCx.aJ(); localCx.setElementMap(localcpa); localJg.bb(localCx); localCx.brn(); aAR localaAR1 = aAR.checkOut(); localaAR1.setElementMap(localcpa); localaAR1.setFlipVerticaly(true); localaAR1.setPosition(ajb.did); localaAR1.setX(95); localaAR1.setY(118); localaAR1.setWidth(10); localaAR1.setHeight(8); localaAR1.setTexture(this.W.aH("death_0.tga")); localCx.bb(localaAR1); localaAR1.brn(); localaAR1.rV(); aAR localaAR2 = aAR.checkOut(); localaAR2.setElementMap(localcpa); localaAR2.setFlipVerticaly(true); localaAR2.setPosition(ajb.dif); localaAR2.setX(121); localaAR2.setY(118); localaAR2.setWidth(1); localaAR2.setHeight(8); localaAR2.setTexture(this.W.aH("death_0.tga")); localCx.bb(localaAR2); localaAR2.brn(); localaAR2.rV(); aAR localaAR3 = aAR.checkOut(); localaAR3.setElementMap(localcpa); localaAR3.setFlipHorizontaly(true); localaAR3.setFlipVerticaly(true); localaAR3.setPosition(ajb.dih); localaAR3.setX(95); localaAR3.setY(118); localaAR3.setWidth(10); localaAR3.setHeight(8); localaAR3.setTexture(this.W.aH("death_0.tga")); localCx.bb(localaAR3); localaAR3.brn(); localaAR3.rV(); aAR localaAR4 = aAR.checkOut(); localaAR4.setElementMap(localcpa); localaAR4.setFlipVerticaly(true); localaAR4.setPosition(ajb.dhY); localaAR4.setX(108); localaAR4.setY(114); localaAR4.setWidth(10); localaAR4.setHeight(1); localaAR4.setTexture(this.W.aH("death_0.tga")); localCx.bb(localaAR4); localaAR4.brn(); localaAR4.rV(); aAR localaAR5 = aAR.checkOut(); localaAR5.setElementMap(localcpa); localaAR5.setFlipHorizontaly(true); localaAR5.setFlipVerticaly(true); localaAR5.setPosition(ajb.dia); localaAR5.setX(108); localaAR5.setY(114); localaAR5.setWidth(10); localaAR5.setHeight(1); localaAR5.setTexture(this.W.aH("death_0.tga")); localCx.bb(localaAR5); localaAR5.brn(); localaAR5.rV(); aAR localaAR6 = aAR.checkOut(); localaAR6.setElementMap(localcpa); localaAR6.setFlipVerticaly(true); localaAR6.setPosition(ajb.dhR); localaAR6.setX(108); localaAR6.setY(118); localaAR6.setWidth(10); localaAR6.setHeight(8); localaAR6.setTexture(this.W.aH("death_0.tga")); localCx.bb(localaAR6); localaAR6.brn(); localaAR6.rV(); aAR localaAR7 = aAR.checkOut(); localaAR7.setElementMap(localcpa); localaAR7.setFlipVerticaly(true); localaAR7.setPosition(ajb.dhT); localaAR7.setX(95); localaAR7.setY(107); localaAR7.setWidth(1); localaAR7.setHeight(8); localaAR7.setTexture(this.W.aH("death_0.tga")); localCx.bb(localaAR7); localaAR7.brn(); localaAR7.rV(); aAR localaAR8 = aAR.checkOut(); localaAR8.setElementMap(localcpa); localaAR8.setFlipHorizontaly(true); localaAR8.setFlipVerticaly(true); localaAR8.setPosition(ajb.dhV); localaAR8.setX(108); localaAR8.setY(118); localaAR8.setWidth(10); localaAR8.setHeight(8); localaAR8.setTexture(this.W.aH("death_0.tga")); localCx.bb(localaAR8); localaAR8.brn(); localaAR8.rV(); localCx.rV(); aen localaen = aen.checkOut(); localaen.setElementMap(localcpa); localaen.setScaled(true); localJg.bb(localaen); localaen.brn(); aAR localaAR9 = aAR.checkOut(); localaAR9.setElementMap(localcpa); localaAR9.setFlipVerticaly(true); localaAR9.setPosition(ajb.dhZ); localaAR9.setX(99); localaAR9.setY(114); localaAR9.setWidth(1); localaAR9.setHeight(1); localaAR9.setTexture(this.W.aH("death_0.tga")); localaen.bb(localaAR9); localaAR9.brn(); localaAR9.rV(); localaen.rV(); localJg.rV(); } }
[ "music_inme@hotmail.fr" ]
music_inme@hotmail.fr
04a3de677678e98a729f995ce8bf50ced4cddaef
d3572d18f2b122cf618b0e8bc2000cbc496a741b
/AQG-IE/src/plot/generator/SeriesGenerator.java
c7689148a7b27bfe11bc5a6cbb158af60b4bf070
[]
no_license
pjbarrio/AQG-IE
36c20595347f74d1d66c652f6ab56b64f77a34c0
75954fb5931225f698e15be13983a2f51beac40d
refs/heads/master
2021-01-10T06:15:31.171181
2015-12-29T17:16:47
2015-12-29T17:16:47
48,337,847
0
0
null
null
null
null
UTF-8
Java
false
false
5,332
java
package plot.generator; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import execution.trunk.chart.ChartGeneration; import plot.data.Series; import plot.selector.ExecutionSelector; import plot.selector.Selector; import plot.selector.SampleGenerationSelector; import utils.persistence.PersistenceImplementation; import utils.persistence.persistentWriter; public abstract class SeriesGenerator<T extends Selector> { protected static final String USEFUL_TUPLES = "usefulTuples"; protected static final String CURRENT_TIME = "currentTime"; protected static final String PROCESSED_DOCUMENT_POSITION = "processed_document_position"; protected static final String EXECUTED_QUERY_POSITION = "executed_query_position"; protected static final String DATABASE_LIMIT = "E.`limit`"; protected static final String USEFUL_TOTAL_TUPLES = "W.usefulTuples"; protected static final String USEFUL_TOTAL_DOCUMENTS = "W.usefulDocuments"; public static final String TOTAL_DOCUMENTS = "D.size"; public static final String NO_NORMALIZATION = "W.noNormalization"; public static final String QUERY_POSITION = "S.query_submitted_position"; public static final String QUERY_ROUND = "S.query_round"; public static final String QUERY_COUNT = "count(S.*) as NUM"; public static final String MIN_SAM = "MIN_SAM"; public static final String MAX_SAM = "MAX_SAM"; public static final String DOCUMENT_POSITION_IN_SAMPLE = "S.document_position_in_sample"; public static final String DOCUMENT_POSITION = "S.document_position"; public static final String DOCUMENT_IN_QUERY_POSITION = "S.doc_in_query_position"; public static final String QUERY_GENERATED = "S.query_generated_position"; public static final String QUERY_MIN = "min("+DOCUMENT_POSITION_IN_SAMPLE+") as " + MIN_SAM; public static final String QUERY_MAX = "max("+DOCUMENT_POSITION_IN_SAMPLE+") as " + MAX_SAM; private static final int INTERVAL_NUMBERS = 10; public static final double NUMBER_OF_PROCESSED_DOCUMENTS_NORMALIZED = 0.001; public static final double NUMBER_OF_PROCESSED_DOCUMENTS_NUMBER = 5; protected static final double NUMBER_OF_ADDED_DOCUMENTS = 5; protected static final double NUMBER_OF_PROCESSED_DOCUMENTS_BY_QUERY = 0.05; protected static final double NUMBER_OF_ISSUED_QUERIES = 2; protected static final double NUMBER_OF_ROUNDS = 2; protected static final double NUMBER_OF_SAMPLED_DOCUMENTS = 25; protected static final double NUMBER_OF_SAMPLED_DOCUMENTS_UT = 5; protected static final double NUMBER_OF_SECONDS_INTERVAL = 100; protected static final double K_PARAMETER = 5; private List<String> attributes; private List<String> orderBy; private List<String> groupBy; private String where; public Series generateSeries(T selector){ persistentWriter pW = PersistenceImplementation.getWriter(); Series ret = new Series(getName(selector)); List<Integer> selected = selector.getSelected(); for (Integer sel : selected) { List<Hashtable<String, Double>> list = getAnalyzableData(pW,sel, getAttributes(), getOrderBy()); double xNorm = 1.0; if (!getNormalizedXAttribute().equals(NO_NORMALIZATION)){ xNorm = getTotal(pW,getNormalizedXAttribute(), sel); } double yNorm = 1.0; if (!getNormalizedYAttribute().equals(NO_NORMALIZATION)){ yNorm = getTotal(pW,getNormalizedYAttribute(), sel); } ret.addSeries(generateSeries(list,sel,xNorm,yNorm)); } return invokeAverage(ret); } protected String getName(T selector) { return selector.getName(); } protected abstract Series invokeAverage(Series ret); protected abstract double getTotal(persistentWriter pW, String normalizedXAttribute, Integer sel); protected abstract List<Hashtable<String, Double>> getAnalyzableData( persistentWriter pW, Integer sel, List<String> attributes, List<String> orderBy); protected abstract String getNormalizedYAttribute(); protected abstract String getNormalizedXAttribute(); protected List<String> getAttributes(){ if (attributes == null){ attributes = generateAttributes(); } return attributes; } public abstract List<String> generateAttributes(); public List<String> getOrderBy(){ if (orderBy == null){ orderBy = generateOrderBy(); } return orderBy; } public abstract List<String> generateOrderBy(); public List<String> getGroupBy(){ if (groupBy == null){ groupBy = generateGroupBy(); } return groupBy; } protected abstract List<String> generateGroupBy(); public String getWhere(){ if (where == null){ where = generateWhere(); } return where; } protected abstract String generateWhere(); protected abstract Series generateSeries(List<Hashtable<String, Double>> list, Integer execution, double normalizeXValue, double normalizeYValue); public abstract String getTitle(); public abstract String getAxisXTitle(); public abstract String getAxisYTitle(); public String getExtendedTitle(String extension) { return getTitle() + " [" + extension + "]"; } public boolean getPercentX() { return false; } public boolean getPercentY() { return false; } public List<SeriesGenerator<T>> generateByParameterSeries(){ List<SeriesGenerator<T>> ret = new ArrayList<SeriesGenerator<T>>(1); ret.add(this); return ret; } }
[ "pjbarrio@cs.columbia.edu" ]
pjbarrio@cs.columbia.edu
4f649ac276d0331f8dfcf62adab36d76d9370cf0
480d76232ca7293194c69ba57a5039c6507d5bc7
/mcp811 1.6.4/temp/src/minecraft/net/minecraft/src/EntitySilverfish.java
6898e77f0131c1473283f7484bf7857e111e1bf9
[]
no_license
interactivenyc/Minecraft_SRC_MOD
bee868e7adf9c548ddafd8549a55a759cfa237ce
4b311f43fd312521c1df39010b0ae34ed81bc406
refs/heads/master
2016-09-07T18:33:22.494356
2014-01-27T19:10:47
2014-01-27T19:10:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,708
java
package net.minecraft.src; import net.minecraft.src.Block; import net.minecraft.src.BlockSilverfish; import net.minecraft.src.DamageSource; import net.minecraft.src.Entity; import net.minecraft.src.EntityDamageSource; import net.minecraft.src.EntityMob; import net.minecraft.src.EntityPlayer; import net.minecraft.src.EnumCreatureAttribute; import net.minecraft.src.Facing; import net.minecraft.src.MathHelper; import net.minecraft.src.SharedMonsterAttributes; import net.minecraft.src.World; public class EntitySilverfish extends EntityMob { private int field_70843_d; public EntitySilverfish(World p_i1740_1_) { super(p_i1740_1_); this.func_70105_a(0.3F, 0.7F); } protected void func_110147_ax() { super.func_110147_ax(); this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(8.0D); this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.6000000238418579D); this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(1.0D); } protected boolean func_70041_e_() { return false; } protected Entity func_70782_k() { double var1 = 8.0D; return this.field_70170_p.func_72856_b(this, var1); } protected String func_70639_aQ() { return "mob.silverfish.say"; } protected String func_70621_aR() { return "mob.silverfish.hit"; } protected String func_70673_aS() { return "mob.silverfish.kill"; } public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { if(this.func_85032_ar()) { return false; } else { if(this.field_70843_d <= 0 && (p_70097_1_ instanceof EntityDamageSource || p_70097_1_ == DamageSource.field_76376_m)) { this.field_70843_d = 20; } return super.func_70097_a(p_70097_1_, p_70097_2_); } } protected void func_70785_a(Entity p_70785_1_, float p_70785_2_) { if(this.field_70724_aR <= 0 && p_70785_2_ < 1.2F && p_70785_1_.field_70121_D.field_72337_e > this.field_70121_D.field_72338_b && p_70785_1_.field_70121_D.field_72338_b < this.field_70121_D.field_72337_e) { this.field_70724_aR = 20; this.func_70652_k(p_70785_1_); } } protected void func_70036_a(int p_70036_1_, int p_70036_2_, int p_70036_3_, int p_70036_4_) { this.func_85030_a("mob.silverfish.step", 0.15F, 1.0F); } protected int func_70633_aT() { return 0; } public void func_70071_h_() { this.field_70761_aq = this.field_70177_z; super.func_70071_h_(); } protected void func_70626_be() { super.func_70626_be(); if(!this.field_70170_p.field_72995_K) { int var1; int var2; int var3; int var5; if(this.field_70843_d > 0) { --this.field_70843_d; if(this.field_70843_d == 0) { var1 = MathHelper.func_76128_c(this.field_70165_t); var2 = MathHelper.func_76128_c(this.field_70163_u); var3 = MathHelper.func_76128_c(this.field_70161_v); boolean var4 = false; for(var5 = 0; !var4 && var5 <= 5 && var5 >= -5; var5 = var5 <= 0?1 - var5:0 - var5) { for(int var6 = 0; !var4 && var6 <= 10 && var6 >= -10; var6 = var6 <= 0?1 - var6:0 - var6) { for(int var7 = 0; !var4 && var7 <= 10 && var7 >= -10; var7 = var7 <= 0?1 - var7:0 - var7) { int var8 = this.field_70170_p.func_72798_a(var1 + var6, var2 + var5, var3 + var7); if(var8 == Block.field_72006_bl.field_71990_ca) { if(!this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { int var9 = this.field_70170_p.func_72805_g(var1 + var6, var2 + var5, var3 + var7); Block var10 = Block.field_71981_t; if(var9 == 1) { var10 = Block.field_71978_w; } if(var9 == 2) { var10 = Block.field_72007_bm; } this.field_70170_p.func_72832_d(var1 + var6, var2 + var5, var3 + var7, var10.field_71990_ca, 0, 3); } else { this.field_70170_p.func_94578_a(var1 + var6, var2 + var5, var3 + var7, false); } Block.field_72006_bl.func_71898_d(this.field_70170_p, var1 + var6, var2 + var5, var3 + var7, 0); if(this.field_70146_Z.nextBoolean()) { var4 = true; break; } } } } } } } if(this.field_70789_a == null && !this.func_70781_l()) { var1 = MathHelper.func_76128_c(this.field_70165_t); var2 = MathHelper.func_76128_c(this.field_70163_u + 0.5D); var3 = MathHelper.func_76128_c(this.field_70161_v); int var11 = this.field_70146_Z.nextInt(6); var5 = this.field_70170_p.func_72798_a(var1 + Facing.field_71586_b[var11], var2 + Facing.field_71587_c[var11], var3 + Facing.field_71585_d[var11]); if(BlockSilverfish.func_72154_e(var5)) { this.field_70170_p.func_72832_d(var1 + Facing.field_71586_b[var11], var2 + Facing.field_71587_c[var11], var3 + Facing.field_71585_d[var11], Block.field_72006_bl.field_71990_ca, BlockSilverfish.func_72153_f(var5), 3); this.func_70656_aK(); this.func_70106_y(); } else { this.func_70779_j(); } } else if(this.field_70789_a != null && !this.func_70781_l()) { this.field_70789_a = null; } } } public float func_70783_a(int p_70783_1_, int p_70783_2_, int p_70783_3_) { return this.field_70170_p.func_72798_a(p_70783_1_, p_70783_2_ - 1, p_70783_3_) == Block.field_71981_t.field_71990_ca?10.0F:super.func_70783_a(p_70783_1_, p_70783_2_, p_70783_3_); } protected boolean func_70814_o() { return true; } public boolean func_70601_bi() { if(super.func_70601_bi()) { EntityPlayer var1 = this.field_70170_p.func_72890_a(this, 5.0D); return var1 == null; } else { return false; } } public EnumCreatureAttribute func_70668_bt() { return EnumCreatureAttribute.ARTHROPOD; } }
[ "steve@speakaboos.com" ]
steve@speakaboos.com
74facaf8a59c573dc5684ea74dce59a329d68fd1
397c163de064237fa698d6635662d1fbaf8893ea
/lejing-product/lejing-product-service/src/main/java/cn/alphahub/mall/product/controller/web/IndexController.java
fbc75702a3e53b87469db1796fd8b782f94e63f4
[ "MIT" ]
permissive
larry-ct/lejing-mall
02c696fb6c16772eff80ad554f9057479c474f04
e386c68eb777e200e03d996f802b1dd07c5c0c5e
refs/heads/main
2023-03-21T16:24:53.602211
2021-03-14T16:43:30
2021-03-14T16:43:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,536
java
package cn.alphahub.mall.product.controller.web; import cn.alphahub.common.core.domain.BaseResult; import cn.alphahub.mall.product.domain.Category; import cn.alphahub.mall.product.service.CategoryService; import cn.alphahub.mall.product.vo.SecondCategoryVO; import org.redisson.api.RLock; import org.redisson.api.RedissonClient; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.List; import java.util.Map; /** * <b>首页Controller</b> * * @author Weasley J * @version 1.0 * @date 2021/03/09 */ @Controller public class IndexController { @Resource private RedissonClient redissonClient; @Resource private CategoryService categoryService; /** * 进入首页返回所有1级分类 * * @param model 模型 * @return 首页视图 */ @GetMapping({"/", "index", "index.html"}) public String indexPageWithFirstLevelCategories(Model model) { List<Category> categories = categoryService.getFirstLevelCategories(); model.addAttribute("categories", categories); return "index"; } /** * <b>查出三级分类</b> * key-1级分类,value-2级分类List * * @return 一级分类+二级分类列表集合 */ @ResponseBody @GetMapping("/index/catalog.json") public Map<String, List<SecondCategoryVO>> getCatalogJson() { return categoryService.getAllLevelCategories(); } /** * 你好,Weasley J! * * @return 对Weasley J的问候 */ @ResponseBody @GetMapping("/hello") public BaseResult<String> helloWeasleyJ() { BaseResult<String> baseResult; RLock lock = redissonClient.getLock("my:lock"); // 阻塞等待 lock.lock(); try { System.out.println("加锁成功:" + Thread.currentThread().getId() + "-" + Thread.currentThread().getName()); System.out.println("执行业务..."); baseResult = BaseResult.ok("响应成功", "Hello Weasley J!"); } catch (Exception e) { baseResult = BaseResult.fail("响应失败", "Hello Weasley J!"); } finally { System.out.println("释放成功:" + Thread.currentThread().getId() + "-" + Thread.currentThread().getName() + "\n"); lock.unlock(); } return baseResult; } }
[ "1432689025@qq.com" ]
1432689025@qq.com
cb729b0b91b368385248a39a63d1ca4c8b245aff
74acea1b7f2a3a509b9ead48f186c9349bf55cc8
/webapps/www/java/com/enjoyf/webapps/joyme/dto/joymeapp/socialclient/SocialContentActionDTO.java
0dfc855aa63f5a45673e61e128ee8a819f1a82ba
[]
no_license
liu67224657/besl-platform
6cd2bfcc7320a4039e61b114173d5f350345f799
68c126bea36c289526e0cc62b9d5ce6284353d11
refs/heads/master
2022-04-16T02:23:40.178907
2020-04-17T09:00:01
2020-04-17T09:00:01
109,520,110
1
1
null
null
null
null
UTF-8
Java
false
false
436
java
package com.enjoyf.webapps.joyme.dto.joymeapp.socialclient; /** * Created by IntelliJ IDEA. * User: zhimingli * Date: 14-4-18 * Time: 下午1:57 * To change this template use File | Settings | File Templates. */ public class SocialContentActionDTO { private long actionid; public long getActionid() { return actionid; } public void setActionid(long actionid) { this.actionid = actionid; } }
[ "ericliu@staff.joyme.com" ]
ericliu@staff.joyme.com
c8966fa21d546a784bfdc9fffc3283f018ec876e
20d2b878cb84f6b03b7f73ca59694ebd88bf7a02
/src/project/edge/dao/project/ProjectPersonChangeDetailDaoImpl.java
1b72c08bfe9a4b390b9905ed0bf8e1ba7ef78824
[]
no_license
softwareqky/qqq
0ad4ff24672f35db94c173985e16dac2e3cda140
8bc4d970d0c483e8f5fd7f9a5ee171d962971162
refs/heads/master
2023-03-22T10:11:29.760636
2021-03-16T03:26:42
2021-03-16T03:26:42
320,426,415
0
1
null
null
null
null
UTF-8
Java
false
false
2,437
java
package project.edge.dao.project; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Restrictions; import org.hibernate.sql.JoinType; import org.springframework.stereotype.Repository; import org.springframework.util.StringUtils; import garage.origin.dao.HibernateDaoImpl; import garage.origin.domain.filter.DataFilter; import project.edge.domain.entity.ProjectPersonChangeDetail; /** * [t_project_person_change_detail]对应的DAO。 */ @Repository public class ProjectPersonChangeDetailDaoImpl extends HibernateDaoImpl<ProjectPersonChangeDetail, String> implements ProjectPersonChangeDetailDao { @Override protected DetachedCriteria prepareConditions(DetachedCriteria criteria, DataFilter filter) { criteria.createAlias("project", "project", JoinType.LEFT_OUTER_JOIN) .createAlias("person", "person", JoinType.LEFT_OUTER_JOIN) .createAlias("virtualOrg", "virtualOrg", JoinType.LEFT_OUTER_JOIN) .createAlias("projectPersonChange", "projectPersonChange", JoinType.LEFT_OUTER_JOIN) .createAlias("projectRole", "projectRole", JoinType.LEFT_OUTER_JOIN); return super.prepareConditions(criteria, filter); } /** * 获取单条实体。 * * @param id 主键 * @return 实体对象,如果没有找到实体,则返回null */ @Override public ProjectPersonChangeDetail find(String id) { if (StringUtils.isEmpty(id)) { return null; } // 这里将关联的信息全部取出,主要是为了配合新建/修改后重新获取实体信息,然后将这个完整的实体信息显示到一览画面中 ProjectPersonChangeDetail projectPersonDetail = (ProjectPersonChangeDetail) session() .createCriteria(this.type) .createAlias("project", "project", JoinType.LEFT_OUTER_JOIN) .createAlias("person", "person", JoinType.LEFT_OUTER_JOIN) .createAlias("virtualOrg", "virtualOrg", JoinType.LEFT_OUTER_JOIN) .createAlias("projectPersonChange", "projectPersonChange", JoinType.LEFT_OUTER_JOIN) .createAlias("projectRole", "projectRole", JoinType.LEFT_OUTER_JOIN) .add(Restrictions.eq("id", id)).uniqueResult(); return projectPersonDetail; } }
[ "Administrator@PC-20191108LRHM" ]
Administrator@PC-20191108LRHM
4ba37765d31bffe1cbd2394fc547c972d75d6082
dd2fc4f75ddc5989e404b32eb553ae474f25aad9
/qxgame/src/main/java/com/mmorpg/qx/module/skill/model/skillProcess/impl/ExchangeHpSkillProcessor.java
97d556ac0e2d186e97ad35361bcb24f9062f4d41
[]
no_license
orangeevan/qx
792ad4a43e6a190f28920931ac9c769cf84a9588
d67262ab3733151a732151d1e0d7a745683ca15f
refs/heads/master
2023-06-04T03:38:27.332823
2021-06-28T06:23:25
2021-06-28T06:23:25
380,889,825
0
1
null
null
null
null
UTF-8
Java
false
false
3,698
java
package com.mmorpg.qx.module.skill.model.skillProcess.impl; import com.mmorpg.qx.module.object.Reason; import com.mmorpg.qx.module.object.gameobject.AbstractCreature; import com.mmorpg.qx.module.object.gameobject.AbstractTrainerCreature; import com.mmorpg.qx.module.object.gameobject.AbstractVisibleObject; import com.mmorpg.qx.module.object.gameobject.MWNCreature; import com.mmorpg.qx.module.skill.model.Skill; import com.mmorpg.qx.module.skill.model.SkillType; import com.mmorpg.qx.module.skill.model.skillProcess.AbstractSkillProcessor; import com.mmorpg.qx.module.skill.model.skillResult.RecoverSkillResult; import com.mmorpg.qx.module.skill.model.target.Target; import com.mmorpg.qx.module.skill.model.target.TargetManager; import com.mmorpg.qx.module.skill.model.target.TargetType; import com.mmorpg.qx.module.skill.resource.SkillResource; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; /** * @author wang ke * @description:换血技能 * @since 15:49 2020-09-10 */ public class ExchangeHpSkillProcessor extends AbstractSkillProcessor { @Override public SkillType getSkillType() { return SkillType.Exchange_Hp; } @Override public List<RecoverSkillResult> process(Skill skill, int roundIndex) { List<AbstractCreature> denfendersList = skill.getDenfendersList(); if (CollectionUtils.isEmpty(denfendersList)) { return null; } AbstractTrainerCreature master = skill.getSkillCaster().getMaster(); Collection<MWNCreature> mwnCreatures = master.getMWN(true); if (CollectionUtils.isEmpty(mwnCreatures)) { return null; } MWNCreature minHp = mwnCreatures.stream().min(Comparator.comparingInt(MWNCreature::getCurHpPercent)).get(); MWNCreature maxHp = null; if (!CollectionUtils.isEmpty(skill.getDenfendersList())) { AbstractCreature creature = skill.getDenfendersList().get(0); maxHp = (MWNCreature) creature; } else { // ITargetChooser targetChooser = TargetManager.getInstance().getTargetChooser(skill.getResource().getTargetType()); // Target target = targetChooser.chooseTarget(skill.getSkillCaster()); Target target = TargetManager.getInstance().chooseTarget(new ArrayList<>(skill.getResource().getTargets().keySet()), skill.getSkillCaster()); List<Long> targetIds = target.getTargetIds(); if (CollectionUtils.isEmpty(targetIds)) { return null; } AbstractVisibleObject object = skill.getSkillCaster().getWorldMapInstance().findObject(targetIds.get(0)); maxHp = ((MWNCreature) object); } int minPercent = minHp.getCurHpPercent(); int maxPercent = maxHp.getCurHpPercent(); int minPercentHp = minHp.getLifeStats().getMaxHp() * maxPercent; int maxPercentHp = maxHp.getLifeStats().getMaxHp() * minPercent; minHp.getLifeStats().increaseHp(minPercentHp - minHp.getCurrentHp(), Reason.Trainer_Skill_Effect, false, true); maxHp.getLifeStats().reduceHp(maxHp.getCurrentHp() - maxPercentHp, skill.getSkillCaster(), skill.getResource().getSkillId(), 0); RecoverSkillResult result = new RecoverSkillResult(master.getObjectId(), maxHp.getObjectId(), skill, minPercentHp - minHp.getCurrentHp(), 0); List<RecoverSkillResult> results = new ArrayList<>(); results.add(result); return results; } @Override public Object initParam(SkillResource resource) { return null; } }
[ "494926093@qq.com" ]
494926093@qq.com
35231c2f9241a62aa3c493d7c19850dcba2c10df
f081785780eb3c4b72fe2e7d9e0299992a8331ad
/src/me/creatos/voucher/core/wrappers/VoucherMessage.java
6090761e139e14df4d73674c9af1c78f518dc8a1
[]
no_license
Creatos137/voucher
f5e66e840a756a68dc63a1560c809f65b87fb94b
ef9047cccccf5151495d330c0fa520e7b14d2f35
refs/heads/master
2023-03-24T02:15:59.949146
2021-03-11T21:10:53
2021-03-11T21:10:53
346,834,196
0
0
null
null
null
null
UTF-8
Java
false
false
1,781
java
package me.creatos.voucher.core.wrappers; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Player; import me.creatos.voucher.core.Voucher; import me.creatos.voucher.core.enums.MessageType; import me.creatos.voucher.utils.Message; import net.minecraft.server.v1_8_R3.ChatComponentText; import net.minecraft.server.v1_8_R3.PacketPlayOutChat; public class VoucherMessage { private String message; private MessageType type; public VoucherMessage(String message, MessageType type) { this.message = message; this.type = type; } public void send(Player player, Voucher voucher) { String colorMessage = Message.translate(message, voucher, player.getName()); switch (type) { case CHAT: if (voucher.sendChatMessage()) { player.sendMessage(colorMessage); } break; case ACTION_BAR: if (voucher.sendActionbarMessage()) { PacketPlayOutChat packet = new PacketPlayOutChat(new ChatComponentText(colorMessage), (byte) 2); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } break; case BROADCAST: if (voucher.sendBroadcastMessage()) { for (Player p : Bukkit.getOnlinePlayers()) { p.sendMessage(colorMessage); } } break; default: break; } } public void toggle() { switch (type) { case CHAT: type = MessageType.ACTION_BAR; break; case ACTION_BAR: type = MessageType.BROADCAST; break; case BROADCAST: type = MessageType.CHAT; break; default: break; } } public String getMessage() { return message; } public MessageType getType() { return type; } public void setMessage(String message) { this.message = message; } public void setType(MessageType type) { this.type = type; } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org