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
092519a583db5e64e215fd8426d6ea13790ce8e6
2613c9c2bde0cb3230a11bb04dfe863a612fccbc
/org.tolven.onc.component.mirth/web/source/org/tolven/cchit/component/hl7/Hl7MessageProcessor.java
f7686a7347d5e17e3b592d4e2632f68fed7b4fa8
[]
no_license
kedar-s/bugtest
1d38a8f73419cc8f60ff41553321ca9942ba09b0
36e3556973b7320f1f2fcf5ef48af733bcb537c1
refs/heads/main
2023-08-22T09:51:25.918449
2021-10-14T16:09:29
2021-10-14T16:09:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,859
java
package org.tolven.cchit.component.hl7; import java.io.IOException; import java.security.PrivateKey; import java.util.Date; import java.util.List; import javax.ejb.EJB; import javax.servlet.ServletConfig; 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 org.tolven.app.MirthOperationsLocal; import org.tolven.client.TolvenClient; import org.tolven.client.TolvenClientEx; import org.tolven.core.ActivationLocal; import org.tolven.core.TolvenPropertiesLocal; import org.tolven.core.entity.AccountUser; import org.tolven.core.entity.TolvenUser; import org.tolven.mirth.api.ProcessLabResultsLocal; import org.tolven.security.key.UserPrivateKey; import org.tolven.session.TolvenSessionWrapper; import org.tolven.session.TolvenSessionWrapperFactory; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.v25.message.ORU_R01; import ca.uhn.hl7v2.parser.EncodingNotSupportedException; /** * This class receives the messages from HL7 v2.5 * * @author Param added on 7/27/2010 */ @WebServlet(urlPatterns = { "/hl7MessageInput" }, loadOnStartup = 5) public class Hl7MessageProcessor extends HttpServlet { /** * Added default serial version UID */ private static final long serialVersionUID = 1L; @EJB private MirthOperationsLocal mirthOperationsBean; @EJB private TolvenPropertiesLocal propertyBean; @EJB private ActivationLocal activationBean; @EJB private ProcessLabResultsLocal labProcessor; public MirthOperationsLocal getMirthOperationsBean() { return mirthOperationsBean; } public TolvenPropertiesLocal getPropertyBean() { return propertyBean; } public void init(ServletConfig config) throws ServletException { } @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { try { //ORU_R01 oruR01Message = (ORU_R01) Hl7MessageHandler.getMessage(req.getParameter("message")); ORU_R01 oruR01Message = (ORU_R01) Hl7MessageHandler.getMessageFromFilePath(req.getParameter("file")); String keyAlgorithm = propertyBean.getProperty(UserPrivateKey.USER_PRIVATE_KEY_ALGORITHM_PROP); TolvenSessionWrapper sessionWrapper = TolvenSessionWrapperFactory.getInstance(); PrivateKey userPrivateKey = sessionWrapper.getUserPrivateKey(keyAlgorithm); long accountId = Long.parseLong(oruR01Message.getPATIENT_RESULT().getPATIENT().getPID().getPatientAccountNumber().getIDNumber().getValue()); TolvenClient loginClient = new TolvenClientEx(); if(oruR01Message != null){ TolvenUser user = activationBean.loginUser(propertyBean.getProperty("tolven.mirth.user.name"), new Date()); if(user != null){ List<AccountUser> accountUsers = activationBean.findUserAccounts(user); for(AccountUser accountUser: accountUsers) { if (accountUser.getAccount().getId()== accountId){ labProcessor.saveLabResults(oruR01Message, accountUser, new Date(),userPrivateKey); } } } } System.out.println(oruR01Message.getPATIENT_RESULT().getPATIENT().getNK1().getAddress(0).getCity().getValue()); } catch (EncodingNotSupportedException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (HL7Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * Starts a new session for Mirth user * @author Syed * @param loginClient - the TolvenClient object * added on 6/29/2010 */ public TolvenUser getMirthUser(TolvenClient loginClient){ String uid = propertyBean.getProperty("tolven.mirth.user.name"); String password = propertyBean.getProperty("tolven.mirth.user.password"); return loginClient.login(uid, password); } }
[ "kedarsambhus@outlook.com" ]
kedarsambhus@outlook.com
f932a1d8be14ac04e26fc093c88a8541e6e2a845
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a041/A041556Test.java
7c6f7eae51ca9d3e18803862e3bb1c507728fd12
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a041; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A041556Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
8bdebb457628534f659331c8b2af5d25e15a9140
eb4a82e998bc617c57c7cb77bb8f30a79479482a
/evidencijazadataka/src/main/java/evidencijazadataka/support/StanjeDtoToStanje.java
9d046e4b7d5c326b0c878de9a3e07e38d7fac0be
[]
no_license
DraganaHorvatAvramovic/evidencijazadataka
9a8b1ede3ea3796fe12d1b9d6b9e7c8fc90aa2c9
341e2672e4eec29310e4618e27c5868fb1d22c43
refs/heads/master
2023-04-28T05:10:35.060527
2021-05-11T17:45:55
2021-05-11T17:45:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
763
java
package evidencijazadataka.support; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Component; import evidencijazadataka.dto.StanjeDTO; import evidencijazadataka.model.Stanje; import evidencijazadataka.service.StanjeService; @Component public class StanjeDtoToStanje implements Converter<StanjeDTO, Stanje>{ @Autowired private StanjeService stanjeService; @Override public Stanje convert(StanjeDTO source) { Stanje stanje; if(source.getId() == null) { stanje = new Stanje(); } else { stanje = stanjeService.findOne(source.getId()); } if(stanje != null) { stanje.setIme(source.getIme()); } return stanje; } }
[ "you@example.com" ]
you@example.com
3a6684e7c5bedab416ab0665dfbdba340921ca8e
6c3a797e39f6f3eb14f7baecac2ed2d7d53e32e3
/src/test/java/io/github/jhipster/application/web/rest/UserJWTControllerIntTest.java
8b84b3645a52329b74ae0d212952945437fe6f05
[]
no_license
CreativeAshu/jhipster-sample-application
630a6f8ed83815391ab2d353f535b9ca05c1b638
7e80e567d4dfbeb4f3dcf78460e809cb4cda1a57
refs/heads/master
2021-10-09T11:41:32.227437
2018-12-27T08:23:37
2018-12-27T08:23:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,962
java
package io.github.jhipster.application.web.rest; import io.github.jhipster.application.FileUploadDemoApp; import io.github.jhipster.application.domain.User; import io.github.jhipster.application.repository.UserRepository; import io.github.jhipster.application.security.jwt.TokenProvider; import io.github.jhipster.application.web.rest.errors.ExceptionTranslator; import io.github.jhipster.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 = FileUploadDemoApp.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
76fe3abe190992bef960d24d2d1961aec319457d
ef23d9b833a84ad79a9df816bd3fd1321b09851e
/L2J_SunriseProject_Data/dist/game/data/scripts/handlers/bypasshandlers/Link.java
d46bf942de52e97c06a5e98e9d30b609268abba3
[]
no_license
nascimentolh/JBlueHeart-Source
c05c07137a7a4baf5fe8a793375f1700618ef12c
4179e6a6dbd0f74d614d7cc1ab7eb90ff41af218
refs/heads/master
2022-05-28T22:05:06.858469
2020-04-26T15:22:17
2020-04-26T15:22:17
259,045,356
1
0
null
null
null
null
UTF-8
Java
false
false
1,890
java
/* * Copyright (C) 2004-2013 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J DataPack 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, see <http://www.gnu.org/licenses/>. */ package handlers.bypasshandlers; import l2r.gameserver.handler.IBypassHandler; import l2r.gameserver.model.actor.L2Character; import l2r.gameserver.model.actor.L2Npc; import l2r.gameserver.model.actor.instance.L2PcInstance; import l2r.gameserver.network.serverpackets.NpcHtmlMessage; public class Link implements IBypassHandler { private static final String[] COMMANDS = { "Link" }; @Override public boolean useBypass(String command, L2PcInstance activeChar, L2Character target) { if (!target.isNpc()) { return false; } try { String path = command.substring(5).trim(); if (path.indexOf("..") != -1) { return false; } String filename = "data/html/" + path; NpcHtmlMessage html = new NpcHtmlMessage(((L2Npc) target).getObjectId()); html.setFile(activeChar.getHtmlPrefix(), filename); html.replace("%objectId%", String.valueOf(((L2Npc) target).getObjectId())); activeChar.sendPacket(html); return true; } catch (Exception e) { _log.warn("Exception in " + getClass().getSimpleName(), e); } return false; } @Override public String[] getBypassList() { return COMMANDS; } }
[ "luizh.nnh@gmail.com" ]
luizh.nnh@gmail.com
2e996a679abe86468f6b03644623ecf12be55117
3312b12b2106d36694beb7263bd44da70e4bbaae
/athena-ckx/src/main/java/com/athena/ckx/entity/baob/Dfpvfhtzd.java
f22d7bf37b95c5213dccaabd5f83c8003ea08dd3
[]
no_license
liyq1406/athena
bff7110b4c8a16e47203b550979b42707b14f9a5
d83c9ef1c7548a52ab6c269183d5a016444f388e
refs/heads/master
2020-12-14T09:48:43.717312
2017-06-05T06:41:48
2017-06-05T06:41:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,100
java
package com.athena.ckx.entity.baob; import com.athena.component.entity.Domain; import com.toft.core3.support.PageableSupport; public class Dfpvfhtzd extends PageableSupport implements Domain{ private static final long serialVersionUID = 2892190665367165024L; private String usercenter; private String blh; private String tch; private String gongysdm; private String lingjbh; private String psasj; private String blscsj; private String yaohlh; private String cangkbh; private String lingjsl; private String dingdh; private String chengysdm; private String psasj_from; private String psasj_to; private String blscsj_from; private String blscsj_to; private String zhuangt; public String getZhuangt() { return zhuangt; } public void setZhuangt(String zhuangt) { this.zhuangt = zhuangt; } public String getId() { // TODO Auto-generated method stub return null; } public void setId(String arg0) { // TODO Auto-generated method stub } public String getPsasj_from() { return psasj_from; } public void setPsasj_from(String psasj_from) { this.psasj_from = psasj_from; } public String getPsasj_to() { return psasj_to; } public void setPsasj_to(String psasj_to) { this.psasj_to = psasj_to; } public String getBlscsj_from() { return blscsj_from; } public void setBlscsj_from(String blscsj_from) { this.blscsj_from = blscsj_from; } public String getBlscsj_to() { return blscsj_to; } public void setBlscsj_to(String blscsj_to) { this.blscsj_to = blscsj_to; } public String getUsercenter() { return usercenter; } public void setUsercenter(String usercenter) { this.usercenter = usercenter; } public String getBlh() { return blh; } public void setBlh(String blh) { this.blh = blh; } public String getTch() { return tch; } public void setTch(String tch) { this.tch = tch; } public String getGongysdm() { return gongysdm; } public void setGongysdm(String gongysdm) { this.gongysdm = gongysdm; } public String getLingjbh() { return lingjbh; } public void setLingjbh(String lingjbh) { this.lingjbh = lingjbh; } public String getPsasj() { return psasj; } public void setPsasj(String psasj) { this.psasj = psasj; } public String getBlscsj() { return blscsj; } public void setBlscsj(String blscsj) { this.blscsj = blscsj; } public String getYaohlh() { return yaohlh; } public void setYaohlh(String yaohlh) { this.yaohlh = yaohlh; } public String getCangkbh() { return cangkbh; } public void setCangkbh(String cangkbh) { this.cangkbh = cangkbh; } public String getLingjsl() { return lingjsl; } public void setLingjsl(String lingjsl) { this.lingjsl = lingjsl; } public String getDingdh() { return dingdh; } public void setDingdh(String dingdh) { this.dingdh = dingdh; } public String getChengysdm() { return chengysdm; } public void setChengysdm(String chengysdm) { this.chengysdm = chengysdm; } public static long getSerialversionuid() { return serialVersionUID; } }
[ "Administrator@ISS110302000330.isoftstone.com" ]
Administrator@ISS110302000330.isoftstone.com
abdb49a7592be028bbcd3b6252ad8668056c572f
f2fc9daad3bc12a0e7e457df936953bc4534a11d
/18-04-06-BOS_Logistics_management_system/Logistics_bos-parent/Logistics_bos-web/src/main/java/shun/bos/web/action/DecidedzoneAction.java
8a4eb5705f09c4972dea53ba758f4b3d45c089ad
[]
no_license
chenzongshun/Spring-Struts-Hibernate
06d4861f1c3fd1da5c9434aa7e90cd158c22b3f3
df2025dcae634e94efeee2c35ecc428bdd1b2e20
refs/heads/master
2020-03-21T10:24:28.747175
2018-06-24T03:07:17
2018-06-24T03:07:17
138,449,283
0
0
null
null
null
null
GB18030
Java
false
false
3,403
java
package shun.bos.web.action; import java.util.ArrayList; import java.util.List; import javax.swing.text.StyledEditorKit.ForegroundAction; import org.hibernate.criterion.DetachedCriteria; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import shun.bos.domain.BcDecidedzone; import shun.bos.service.IDecidedzoneService; import shun.bos.utils.bosofcrm.Customer; import shun.bos.utils.bosofcrm.ICustomerService; import shun.bos.web.action.base.BaseAction; /** * @author czs * @version 创建时间:2018年4月20日 下午1:06:48 */ @Controller @Scope("prototype") public class DecidedzoneAction extends BaseAction<BcDecidedzone> { @Autowired // 这里注入的是cxf框架的crm代理对象 private ICustomerService customerServiceProxy; private static final long serialVersionUID = 1L; @Autowired private IDecidedzoneService decidedzoneService; /** * 定区添加功能里面有个选择分区。由于可以选择多个分区,所以页面传上来的是一个id数组 */ private String[] subareaId; public void setSubareaId(String[] subareaId) { this.subareaId = subareaId; } /** * 添加定区功能 * @return * @throws Exception */ public String add() throws Exception { decidedzoneService.save(super.model,subareaId); return "list"; } /** * 展示定区列表 * @return * @throws Exception */ public void pageQuery() throws Exception { super.pageBean.setDetachedCriteria(DetachedCriteria.forClass(BcDecidedzone.class)); decidedzoneService.pageQuery(super.pageBean); super.objectToJson(super.pageBean, new String[]{"bcSubareas","pageSize","currentPage","detachedCriteria","bcDecidedzones"}); // super.pageQueryJson(super.pageBean, new String[]{"rows","total"}); } /** * 异步加载没有被定区关联的客户数据,通过crm代理对象 * @throws Exception */ public void findListNotAssociation() throws Exception { List<Customer> customers = customerServiceProxy.findListNotAssociation(); super.objectToJson(customers, null);// 写回给页面 } /** * 异步加载被定区关联的客户数据,通过crm代理对象 * @throws Exception */ public void findListHasAssociation() throws Exception { List<Customer> customers = customerServiceProxy.findListHasAssociation(this.model.getId()); super.objectToJson(customers, null);// 写回给页面 } // 接收的是客户端提交上来的客户id们,这些id都需要关联到定区,定区id已经封装到model对象里面去了 private List<String> customerIds; public void setCustomerIds(List<String> customerIds) { this.customerIds = customerIds; } /** * 定区页面的关联客户的那个window窗口中的业务,通过crm代理对象,把id都关联到定区,定区id已经封装到model对象里面去了 * @throws Exception */ public String assigncustomerstodecidedzone() throws Exception { // 获得页面需要操作的定区id,并清空客户表里面的定区id关联 String decidedzoneId = super.model.getId(); customerServiceProxy.clearAssociation(decidedzoneId); // 获得所有要关联到定区的客户id,并添加到客户表里面的decidedzone_id列 customerServiceProxy.addAssociation(decidedzoneId, customerIds); return "list"; //返回到显示页面 } }
[ "you@example.com" ]
you@example.com
155fa1122303c7378a43944fe0f9394594f5cbb4
1816691706410e60827cbc99cd9e7830d43c55ff
/src/main/java/org/openmuc/josistack/ByteBufferInputStream.java
ab73f0fc4a09bff47a19822cd1b426d39a2e04e1
[]
no_license
mz-automation/openiec61850
4faafa14054151ccb02ff4ca11592319d4e0ef96
febe96dc73f5e918b31fac7ba4aaa545a4deddda
refs/heads/develop
2021-09-12T02:08:57.850384
2018-04-13T15:44:22
2018-04-13T15:44:22
113,065,427
7
6
null
2017-12-04T16:16:43
2017-12-04T16:16:43
null
UTF-8
Java
false
false
1,613
java
/* * Copyright 2011-17 Fraunhofer ISE, energy & meteo Systems GmbH and other contributors * * 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.openmuc.josistack; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; /** * Simple InputStream wrapper around a {@link ByteBuffer} object * * @author Karsten Mueller-Bier */ public final class ByteBufferInputStream extends InputStream { private final ByteBuffer buf; public ByteBufferInputStream(ByteBuffer buf) { this.buf = buf; } @Override public int read() throws IOException { if (buf.hasRemaining() == false) { return -1; } return buf.get() & 0xFF; } @Override public int read(byte[] b, int off, int len) throws IOException { if (buf.hasRemaining() == false) { return -1; } int size = Math.min(len, available()); buf.get(b, off, size); return size; } @Override public int available() throws IOException { return buf.limit() - buf.position(); } }
[ "stefan.feuerhahn@ise.fraunhofer.de" ]
stefan.feuerhahn@ise.fraunhofer.de
c6ab5faad9e17ac79e29f0902613e8ed4da9b94c
f99f6ccd65f344d4c8651f4e4b058ec7f440f60c
/main5/project_shaver/japp_xps_payment_management/src/main/java/com/yhglobal/gongxiao/payment/project/bean/YhglobalCouponWriteoffFlow.java
cbca08b4f210d23584664bac9e03dce01a7433ea
[]
no_license
wilnd/gongxiao
fa60c9d5d57c3cbbb69d39e3848b42850bf22e12
f18bc2f48b4041ab09ee46876fd9f7a0dcb57a52
refs/heads/master
2020-03-28T05:50:50.258483
2018-09-07T09:32:00
2018-09-07T09:32:00
147,799,238
0
1
null
null
null
null
UTF-8
Java
false
false
6,141
java
package com.yhglobal.gongxiao.payment.project.bean; import java.io.Serializable; import java.util.Date; /** * 越海返利流水表 * * @Author: 王帅 */ public class YhglobalCouponWriteoffFlow implements Serializable { /** * 流水id */ private Long flowId; /** * 流水类型 305:越海账户支出 306:越海账户收入 */ private int flowType; /** * 项目id */ private Long projectId; /** * 项目名称 */ private String projectName; /** * 流水发生前的余额 */ private Long amountBeforeTransaction; /** * 交易金额(原金额乘以1000) */ private Long transactionAmount; /** * 流水发生后的余额 */ private Long amountAfterTransaction; /** * 实际交易时间 */ private Date transactionTime; /** * 关联的采购订单id */ private String purchaseOrderId; /** * 订单关联的供应商Id */ private Integer supplierId; /** * 订单关联的供应商名称 */ private String supplierName; /** * 关联的销售订单id */ private String salesOrderId; /** * 订单关联的分销商Id */ private Long distributorId; /** * 订单关联的分销商名称 */ private String distributorName; /** * 交易的其它信息(JSON格式) */ private String extraInfo; /** * 该流水是否已对账 */ private boolean statementCheckingFlag; /** * 该流水对账时间 */ private Date statementCheckingTime; /** * 创建时间 */ private Date createTime; /** * 关联记录表的流水号 */ private String flowNo; /** * 转入方式 */ private String transferPattern; /** * 差额调整方式 */ private String differenceAmountAdjustPattern; private String currencyCode; public String getCurrencyCode() { return currencyCode; } public void setCurrencyCode(String currencyCode) { this.currencyCode = currencyCode; } public Long getFlowId() { return flowId; } public void setFlowId(Long flowId) { this.flowId = flowId; } public int getFlowType() { return flowType; } public void setFlowType(int flowType) { this.flowType = flowType; } public Long getProjectId() { return projectId; } public void setProjectId(Long projectId) { this.projectId = projectId; } public String getProjectName() { return projectName; } public void setProjectName(String projectName) { this.projectName = projectName; } public Long getAmountBeforeTransaction() { return amountBeforeTransaction; } public void setAmountBeforeTransaction(Long amountBeforeTransaction) { this.amountBeforeTransaction = amountBeforeTransaction; } public Long getTransactionAmount() { return transactionAmount; } public void setTransactionAmount(Long transactionAmount) { this.transactionAmount = transactionAmount; } public Long getAmountAfterTransaction() { return amountAfterTransaction; } public void setAmountAfterTransaction(Long amountAfterTransaction) { this.amountAfterTransaction = amountAfterTransaction; } public Date getTransactionTime() { return transactionTime; } public void setTransactionTime(Date transactionTime) { this.transactionTime = transactionTime; } public String getPurchaseOrderId() { return purchaseOrderId; } public void setPurchaseOrderId(String purchaseOrderId) { this.purchaseOrderId = purchaseOrderId; } public Integer getSupplierId() { return supplierId; } public void setSupplierId(Integer supplierId) { this.supplierId = supplierId; } public String getSupplierName() { return supplierName; } public void setSupplierName(String supplierName) { this.supplierName = supplierName; } public String getSalesOrderId() { return salesOrderId; } public void setSalesOrderId(String salesOrderId) { this.salesOrderId = salesOrderId; } public Long getDistributorId() { return distributorId; } public void setDistributorId(Long distributorId) { this.distributorId = distributorId; } public String getDistributorName() { return distributorName; } public void setDistributorName(String distributorName) { this.distributorName = distributorName; } public String getExtraInfo() { return extraInfo; } public void setExtraInfo(String extraInfo) { this.extraInfo = extraInfo; } public boolean isStatementCheckingFlag() { return statementCheckingFlag; } public void setStatementCheckingFlag(boolean statementCheckingFlag) { this.statementCheckingFlag = statementCheckingFlag; } public Date getStatementCheckingTime() { return statementCheckingTime; } public void setStatementCheckingTime(Date statementCheckingTime) { this.statementCheckingTime = statementCheckingTime; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getFlowNo() { return flowNo; } public void setFlowNo(String flowNo) { this.flowNo = flowNo; } public String getTransferPattern() { return transferPattern; } public void setTransferPattern(String transferPattern) { this.transferPattern = transferPattern; } public String getDifferenceAmountAdjustPattern() { return differenceAmountAdjustPattern; } public void setDifferenceAmountAdjustPattern(String differenceAmountAdjustPattern) { this.differenceAmountAdjustPattern = differenceAmountAdjustPattern; } }
[ "287329409@qq.com" ]
287329409@qq.com
8b64f206fc802e5ee85ab0f2d6029e9442ac0472
f58896f88d2d6c35a673c364458aa4909868a5b3
/Java/DistributedJob/xxl-job-executor-sample-frameless/src/main/java/com/xxl/job/executor/sample/frameless/jobhandler/SampleXxlJob.java
d3d955a7c0e527f43ae1df46138716b4f48f00b3
[]
permissive
ZQH123196/basic
6b332db5615056a0dd6b9fdbc27e776cce4cca67
32748827321c93eba6cb3c9c9b660037e3392402
refs/heads/master
2023-07-10T22:25:18.857952
2023-06-25T23:17:35
2023-06-25T23:17:35
224,331,045
0
0
MIT
2021-04-22T19:21:33
2019-11-27T02:54:07
Dart
UTF-8
Java
false
false
8,295
java
package com.xxl.job.executor.sample.frameless.jobhandler; import com.xxl.job.core.context.XxlJobHelper; import com.xxl.job.core.handler.annotation.XxlJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.Arrays; import java.util.concurrent.TimeUnit; /** * XxlJob开发示例(Bean模式) * * 开发步骤: * 1、任务开发:在Spring Bean实例中,开发Job方法; * 2、注解配置:为Job方法添加注解 "@XxlJob(value="自定义jobhandler名称", init = "JobHandler初始化方法", destroy = "JobHandler销毁方法")",注解value值对应的是调度中心新建任务的JobHandler属性的值。 * 3、执行日志:需要通过 "XxlJobHelper.log" 打印执行日志; * 4、任务结果:默认任务结果为 "成功" 状态,不需要主动设置;如有诉求,比如设置任务结果为失败,可以通过 "XxlJobHelper.handleFail/handleSuccess" 自主设置任务结果; * * @author xuxueli 2019-12-11 21:52:51 */ public class SampleXxlJob { private static Logger logger = LoggerFactory.getLogger(SampleXxlJob.class); /** * 1、简单任务示例(Bean模式) */ @XxlJob("demoJobHandler") public void demoJobHandler() throws Exception { XxlJobHelper.log("XXL-JOB, Hello World."); for (int i = 0; i < 5; i++) { XxlJobHelper.log("beat at:" + i); TimeUnit.SECONDS.sleep(2); } // default success } /** * 2、分片广播任务 */ @XxlJob("shardingJobHandler") public void shardingJobHandler() throws Exception { // 分片参数 int shardIndex = XxlJobHelper.getShardIndex(); int shardTotal = XxlJobHelper.getShardTotal(); XxlJobHelper.log("分片参数:当前分片序号 = {}, 总分片数 = {}", shardIndex, shardTotal); // 业务逻辑 for (int i = 0; i < shardTotal; i++) { if (i == shardIndex) { XxlJobHelper.log("第 {} 片, 命中分片开始处理", i); } else { XxlJobHelper.log("第 {} 片, 忽略", i); } } } /** * 3、命令行任务 */ @XxlJob("commandJobHandler") public void commandJobHandler() throws Exception { String command = XxlJobHelper.getJobParam(); int exitValue = -1; BufferedReader bufferedReader = null; try { // command process ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.command(command); processBuilder.redirectErrorStream(true); Process process = processBuilder.start(); //Process process = Runtime.getRuntime().exec(command); BufferedInputStream bufferedInputStream = new BufferedInputStream(process.getInputStream()); bufferedReader = new BufferedReader(new InputStreamReader(bufferedInputStream)); // command log String line; while ((line = bufferedReader.readLine()) != null) { XxlJobHelper.log(line); } // command exit process.waitFor(); exitValue = process.exitValue(); } catch (Exception e) { XxlJobHelper.log(e); } finally { if (bufferedReader != null) { bufferedReader.close(); } } if (exitValue == 0) { // default success } else { XxlJobHelper.handleFail("command exit value("+exitValue+") is failed"); } } /** * 4、跨平台Http任务 * 参数示例: * "url: http://www.baidu.com\n" + * "method: get\n" + * "data: content\n"; */ @XxlJob("httpJobHandler") public void httpJobHandler() throws Exception { // param parse String param = XxlJobHelper.getJobParam(); if (param==null || param.trim().length()==0) { XxlJobHelper.log("param["+ param +"] invalid."); XxlJobHelper.handleFail(); return; } String[] httpParams = param.split("\n"); String url = null; String method = null; String data = null; for (String httpParam: httpParams) { if (httpParam.startsWith("url:")) { url = httpParam.substring(httpParam.indexOf("url:") + 4).trim(); } if (httpParam.startsWith("method:")) { method = httpParam.substring(httpParam.indexOf("method:") + 7).trim().toUpperCase(); } if (httpParam.startsWith("data:")) { data = httpParam.substring(httpParam.indexOf("data:") + 5).trim(); } } // param valid if (url==null || url.trim().length()==0) { XxlJobHelper.log("url["+ url +"] invalid."); XxlJobHelper.handleFail(); return; } if (method==null || !Arrays.asList("GET", "POST").contains(method)) { XxlJobHelper.log("method["+ method +"] invalid."); XxlJobHelper.handleFail(); return; } boolean isPostMethod = method.equals("POST"); // request HttpURLConnection connection = null; BufferedReader bufferedReader = null; try { // connection URL realUrl = new URL(url); connection = (HttpURLConnection) realUrl.openConnection(); // connection setting connection.setRequestMethod(method); connection.setDoOutput(isPostMethod); connection.setDoInput(true); connection.setUseCaches(false); connection.setReadTimeout(5 * 1000); connection.setConnectTimeout(3 * 1000); connection.setRequestProperty("connection", "Keep-Alive"); connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); connection.setRequestProperty("Accept-Charset", "application/json;charset=UTF-8"); // do connection connection.connect(); // data if (isPostMethod && data!=null && data.trim().length()>0) { DataOutputStream dataOutputStream = new DataOutputStream(connection.getOutputStream()); dataOutputStream.write(data.getBytes("UTF-8")); dataOutputStream.flush(); dataOutputStream.close(); } // valid StatusCode int statusCode = connection.getResponseCode(); if (statusCode != 200) { throw new RuntimeException("Http Request StatusCode(" + statusCode + ") Invalid."); } // result bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); StringBuilder result = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { result.append(line); } String responseMsg = result.toString(); XxlJobHelper.log(responseMsg); return; } catch (Exception e) { XxlJobHelper.log(e); XxlJobHelper.handleFail(); return; } finally { try { if (bufferedReader != null) { bufferedReader.close(); } if (connection != null) { connection.disconnect(); } } catch (Exception e2) { XxlJobHelper.log(e2); } } } /** * 5、生命周期任务示例:任务初始化与销毁时,支持自定义相关逻辑; */ @XxlJob(value = "demoJobHandler2", init = "init", destroy = "destroy") public void demoJobHandler2() throws Exception { XxlJobHelper.log("XXL-JOB, Hello World."); } public void init(){ logger.info("init"); } public void destroy(){ logger.info("destory"); } }
[ "zqh123196@gmail.com" ]
zqh123196@gmail.com
c62612571fbfbd9592cb1efe6a8e8a82234ddcfa
a662b5715714d4032585d9616220d067b7bc0a3d
/kie-remote/kie-remote-client/src/main/java/org/kie/remote/client/api/RemoteRuntimeEngineFactory.java
39d2dc2f088c9dafee35bd07beec5885a1fb573b
[ "Apache-2.0" ]
permissive
jsvitak/droolsjbpm-integration
55a3cc6601c4256e0f229dfa4ac19e14a7a01923
769bdcf4d45f97c3c12672fcba525a40de79215b
refs/heads/master
2020-12-11T09:26:12.597708
2015-02-03T13:25:52
2015-02-03T13:25:52
26,958,070
0
0
null
null
null
null
UTF-8
Java
false
false
4,031
java
package org.kie.remote.client.api; import java.util.Properties; import javax.jms.ConnectionFactory; import javax.jms.Queue; import javax.naming.InitialContext; import javax.naming.NamingException; import org.kie.api.runtime.manager.RuntimeEngine; import org.kie.remote.client.api.exception.RemoteCommunicationException; import org.kie.remote.services.ws.command.generated.CommandServiceBasicAuthClient; import org.kie.remote.services.ws.command.generated.CommandWebService; /** * This factory class is the starting point for building and configuring {@link RuntimeEngine} instances * that can interact with the remote API. * </p> * The main use for this class will be to create builder instances (see * {@link #newJmsBuilder()} and {@link #newRestBuilder()}). These builder instances * can then be used to directly configure and create a {@link RuntimeEngine} instance that will * act as a client to the remote (REST or JMS) API. */ public abstract class RemoteRuntimeEngineFactory { /** * Create a new {@link RemoteJmsRuntimeEngineBuilder} instance * to configure and buid a remote API client {@link RuntimeEngine} instance. * @return A {@link RemoteJmsRuntimeEngineBuilder} instance */ public static RemoteJmsRuntimeEngineBuilder newJmsBuilder() { return org.kie.services.client.api.RemoteRuntimeEngineFactory.newJmsBuilder(); } /** * Create a new {@link RemoteRestRuntimeEngineBuilder} instance * to configure and buid a remote API client {@link RuntimeEngine} instance. * @return A {@link RemoteRestRuntimeEngineBuilder} instance */ public static RemoteRestRuntimeEngineBuilder newRestBuilder() { return org.kie.services.client.api.RemoteRuntimeEngineFactory.newRestBuilder(); } /** * Create a new {@link RemoteWebserviceClientBuilder} instance * to configure and buid a remote client for the {@link CommandWebService}. * @return A {@link RemoteWebserviceClientBuilder} instance */ public static RemoteWebserviceClientBuilder<RemoteWebserviceClientBuilder, CommandServiceBasicAuthClient> newCommandWebServiceClientBuilder() { return org.kie.services.client.api.RemoteRuntimeEngineFactory.newCommandWebServiceClientBuilder(); } /** * @return a new (remote client) {@link RuntimeEngine} instance. * @see {@link RemoteRuntimeEngineBuilder#buildRuntimeEngine()} */ abstract public RuntimeEngine newRuntimeEngine(); /** * Retrieves the (remote) {@link InitialContext} from the JBoss AS server instance in order * to be able to retrieve the {@link ConnectionFactory} and {@link Queue} instances to communicate * with the workbench, console or BPMS instance. * * @param jbossServerHostName The hostname of the jboss server instance * @param user A user permitted to retrieve the remote {@link InitialContext} * @param password The password for the user specified * @return a remote {@link InitialContext} instance */ public static InitialContext getRemoteJbossInitialContext(String jbossServerHostName, String user, String password) { Properties initialProps = new Properties(); initialProps.setProperty(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); initialProps.setProperty(InitialContext.PROVIDER_URL, "remote://"+ jbossServerHostName + ":4447"); initialProps.setProperty(InitialContext.SECURITY_PRINCIPAL, user); initialProps.setProperty(InitialContext.SECURITY_CREDENTIALS, password); for (Object keyObj : initialProps.keySet()) { String key = (String) keyObj; System.setProperty(key, (String) initialProps.get(key)); } try { return new InitialContext(initialProps); } catch (NamingException e) { throw new RemoteCommunicationException("Unable to create " + InitialContext.class.getSimpleName(), e); } } }
[ "mrietvel@redhat.com" ]
mrietvel@redhat.com
5a25ba1d44a6cbe6da588ccc985d37304d9c73f0
10c96edfa12e1a7eef1caf3ad1d0e2cdc413ca6f
/src/main/resources/projs/Collection_4.1_parent/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java
5dc95bb1602bb4606995808d5828ff48ff3527a7
[ "Apache-2.0" ]
permissive
Gu-Youngfeng/EfficiencyMiner
c17c574e41feac44cc0f483135d98291139cda5c
48fb567015088f6e48dfb964a4c63f2a316e45d4
refs/heads/master
2020-03-19T10:06:33.362993
2018-08-01T01:17:40
2018-08-01T01:17:40
136,343,802
0
0
Apache-2.0
2018-08-01T01:17:41
2018-06-06T14:51:55
Java
UTF-8
Java
false
false
3,219
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.commons.collections4.functors; import java.io.Serializable; import org.apache.commons.collections4.FunctorException; import org.apache.commons.collections4.Predicate; import org.apache.commons.collections4.Transformer; /** * Predicate implementation that returns the result of a transformer. * * @since 3.0 * @version $Id: TransformerPredicate.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class TransformerPredicate<T> implements Predicate<T>, Serializable { /** Serial version UID */ private static final long serialVersionUID = -2407966402920578741L; /** The transformer to call */ private final Transformer<? super T, Boolean> iTransformer; /** * Factory to create the predicate. * * @param <T> the type that the predicate queries * @param transformer the transformer to decorate * @return the predicate * @throws NullPointerException if the transformer is null */ public static <T> Predicate<T> transformerPredicate(final Transformer<? super T, Boolean> transformer) { if (transformer == null) { throw new NullPointerException("The transformer to call must not be null"); } return new TransformerPredicate<T>(transformer); } /** * Constructor that performs no validation. * Use <code>transformerPredicate</code> if you want that. * * @param transformer the transformer to decorate */ public TransformerPredicate(final Transformer<? super T, Boolean> transformer) { super(); iTransformer = transformer; } /** * Evaluates the predicate returning the result of the decorated transformer. * * @param object the input object * @return true if decorated transformer returns Boolean.TRUE * @throws FunctorException if the transformer returns an invalid type */ public boolean evaluate(final T object) { final Boolean result = iTransformer.transform(object); if (result == null) { throw new FunctorException( "Transformer must return an instanceof Boolean, it was a null object"); } return result.booleanValue(); } /** * Gets the transformer. * * @return the transformer * @since 3.1 */ public Transformer<? super T, Boolean> getTransformer() { return iTransformer; } }
[ "yongfeng_gu@163.com" ]
yongfeng_gu@163.com
c045a6f07f7bdde5c24c46fc73f96531c0ea74b8
7312ff00a32daebcaae32caef6812005318b704a
/src/main/java/org/telegram/api/account/TLAccountPasswordSettings.java
0fc5a9a21c9d8cd302704de0a650c4d3582aca0b
[ "MIT" ]
permissive
onixred/TelegramApi
fa194e83d42bfa4a321636c040bc7ca4fa0619ac
093483533db583eeafb07bfa20aeec897bb91e58
refs/heads/master
2021-04-15T04:38:41.773587
2018-08-12T14:08:03
2018-08-12T14:08:03
126,354,440
7
4
MIT
2018-07-31T01:14:24
2018-03-22T15:16:58
Java
UTF-8
Java
false
false
1,757
java
/* * This is the source code of bot v. 2.0 * It is licensed under GNU GPL v. 3 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Ruben Bermudez, 9/01/15. */ package org.telegram.api.account; import org.telegram.tl.StreamingUtils; import org.telegram.tl.TLContext; import org.telegram.tl.TLObject; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** * Account password settings. * @author Ruben Bermudez * @version 2.0 * @brief TLAccountPasswordSettings * @date 9 /01/15 */ public class TLAccountPasswordSettings extends TLObject { /** * The constant CLASS_ID for this class. */ public static final int CLASS_ID = 0xb7b72ab3; private String email; ///< Recovery email for this account /** * Instantiates a new TL account password settings. */ public TLAccountPasswordSettings() { super(); } @Override public int getClassId() { return CLASS_ID; } /** * Gets email. * * @return the email */ public String getEmail() { return this.email; } /** * Sets email. * * @param email the email */ public void setEmail(String email) { this.email = email; } @Override public void serializeBody(OutputStream stream) throws IOException { StreamingUtils.writeTLString(this.email, stream); } @Override public void deserializeBody(InputStream stream, TLContext context) throws IOException { this.email = StreamingUtils.readTLString(stream); } @Override public String toString() { return "accountPasswordSettings#b7b72ab3"; } }
[ "rberlopez@gmail.com" ]
rberlopez@gmail.com
ca781a8264fd0b1b8f574fe2ed938720ac9ad00c
89050d714d31b72232cdaeed588dc70ebe20f098
/SPS/src/estimate/service/SpcndmatEjb.java
cd5c62f6e379d6b5918e5205c5df92ac63377ed7
[]
no_license
se3mis/SPS_VERSION
8c185823b2e7ded17a8bd1a84a4bd5eaf7874b8d
50f25979a095e94125c57ca2604d41969f873de9
refs/heads/master
2016-09-14T01:55:23.537357
2016-05-06T05:56:38
2016-05-06T05:56:38
58,184,917
0
0
null
null
null
null
UTF-8
Java
false
false
2,049
java
package estimate.service; import java.util.List; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.persistence.PersistenceException; import estimate.ejb.SpcndmatDaoRemote; import estimate.model.MaterialGrid; import estimate.model.Spcndmat; import estimate.model.SpcndmatPK; public class SpcndmatEjb implements SpcndmatEjbI { private Context context; private SpcndmatDaoRemote dao; private String region=null; public SpcndmatEjb(String region) { super(); this.region=region; this.dao=lookupDao(); } private SpcndmatDaoRemote lookupDao() { try { context = new InitialContext(); SpcndmatDaoRemote dao = (SpcndmatDaoRemote) context.lookup("SpcndmatDao/remote"); return dao; } catch (NamingException e){ e.printStackTrace(); throw new RuntimeException(e); } } @Override public void createSpcndmat(Spcndmat spcndmat) { dao.createSpcndmat(spcndmat, region); } @Override public List<Spcndmat> getAll() { return dao.getAll(region); } @Override public void updateSpcndmat(Spcndmat spcndmat) { dao.updateSpcndmat(spcndmat, region); } @Override public void removeSpcndmat(Spcndmat spcndmat) { dao.removeSpcndmat(spcndmat, region); } @Override public void removeAll() { dao.removeAll(region); } @Override public Spcndmat findById(SpcndmatPK id) throws PersistenceException { return dao.findById(id, region); } @Override public List<MaterialGrid> getConductorMaterialGrid(String deptId, long phase, long connectionType, String wiringType, String conductorType, Double conductorLength) throws PersistenceException { return dao.getConductorMaterialGrid(deptId, phase, connectionType, wiringType, conductorType, conductorLength, region); } /** * @param args */ public static void main(String[] args) { SpcndmatEjb ejb=new SpcndmatEjb("region"); System.err.println(ejb); } }
[ "se3mis@ceb.lk" ]
se3mis@ceb.lk
205584ab0aad3d2d0a0f7a44ad284f429b148a40
8d79de231ae0cf73633700424b24c0a5d4434434
/app/src/main/java/com/interdigital/android/samplemapdataapp/cluster/oxon/TrafficQueueClusterManager.java
d952c16055ce744bfa05d68ba2841dcc5a674867
[]
no_license
jeevan95/android-sample-map-data-app
4996e77946aa9d9a0a592ebcff683f171dc51a5b
bfaa98bafdb2235ba6515070a5fc3ff1402d0ab3
refs/heads/master
2020-06-10T23:46:12.529234
2016-11-01T10:50:02
2016-11-01T10:50:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,059
java
/* Copyright 2016 InterDigital Communications, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * You may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. */ package com.interdigital.android.samplemapdataapp.cluster.oxon; import android.content.Context; import com.google.android.gms.maps.GoogleMap; import com.interdigital.android.samplemapdataapp.cluster.BaseClusterManager; public class TrafficQueueClusterManager extends BaseClusterManager<TrafficQueueClusterItem> { public TrafficQueueClusterManager(Context context, GoogleMap googleMap) { super(context, googleMap); } }
[ "dr.paul.thomas@gmail.com" ]
dr.paul.thomas@gmail.com
002ef236866d076c41145aa44f08d3c1b83e724d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_ee44291bd78c27908961bee24a9387d1592c6304/SqoopRunner/5_ee44291bd78c27908961bee24a9387d1592c6304_SqoopRunner_t.java
1eb0e62208cd50b3a5d1130937f3e82e0a8646c4
[]
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,016
java
package loaylitymonitor.cmd; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; import java.util.Scanner; public class SqoopRunner { private static Logger log = LoggerFactory.getLogger(SqoopRunner.class); private static final String exportCmd = "%s/sqoop export --connect '%s' --table %s --export-dir %s --staging-table %s " + "--clear-staging-table --columns %s -m 1 --input-fields-terminated-by '\t'"; public SqoopRunner() { } public void runExport(String exportDir, String tableName, String... columns) throws IOException { StringBuilder columnsStr = new StringBuilder(); for(String s : columns) { columnsStr.append( String.format("%s,", s) ); } String cmd = String.format(exportCmd, "/share/sqoop-1.4.4-SNAPSHOT.bin__hadoop-1.0.0/bin/sqoop", "jdbc:mysql://10.25.9.245:3306/loyalitymonitor?relaxAutoCommit=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF8&user=root&password=root", tableName, exportDir, tableName+"_stg", columnsStr.substring(0, columnsStr.length() - 1)); Runtime rt = Runtime.getRuntime(); Process pr = rt.exec(cmd); logCommandExecution(pr.getErrorStream(), true); logCommandExecution(pr.getErrorStream(), false); if( pr.exitValue() != 0 ) { log.info("To re-run export execute next command {}", cmd); throw new IOException("Sqoop export failed!"); } } private void logCommandExecution(InputStream is, boolean isError) { if( is != null ) { Scanner s = new Scanner(is).useDelimiter("\n"); while(s.hasNext()) { if( isError ) { log.error("SQOOP EXPORT: {}", s.next()); } else { log.info("SQOOP EXPORT: {}", s.next()); } } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4ae100852104697a7901acce894ed267a99e89fa
a867a10da54378eca6543bbd5cc6b6d79b83cd96
/guide_lib/src/main/java/com/jazzy/viewpager/GuideViewPagers.java
e5a2da9b8983c60d2a889b36546961b9382f5ad3
[]
no_license
vanehu/AndroidStudio_CommonLibrary
6486287963c85b19173fe930991b09800488489c
161d0e8f769c64b85dbeb43934ee507423aa47ab
refs/heads/master
2020-05-28T03:09:26.769285
2017-10-26T08:02:22
2017-10-26T08:02:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,703
java
package com.jazzy.viewpager; import android.content.Context; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import java.util.ArrayList; /** * */ public class GuideViewPagers extends LinearLayout implements ViewPager.OnPageChangeListener { private Context context; // 定义ViewPager对象 private JazzyViewPager viewPager; // 定义ViewPager适配器 private ViewPagerAdapter vpAdapter; // 定义一个ArrayList来存放View private ArrayList<View> views; // 引导图片资源 private int[] guidePicIds; // 底部小点的图片 private ImageView[] points; // 记录当前选中位置 private int currentIndex = 0; //Button okBut; TextView loging_bt, tiyan_bt;//登录 /体验 private Animation animationTop;//渐变放大效果 LinearLayout guideActivity_linearLayout;//底部小圆点 public GuideViewPagers(Context context) { super(context); this.context = context; initView(context); } public GuideViewPagers(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; initView(context); } public GuideViewPagers(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); this.context = context; initView(context); } private void initView(Context context) { LayoutInflater inflater = (LayoutInflater) LayoutInflater.from(context); inflater.inflate(R.layout.activity_guide, this); // 实例化ArrayList对象 views = new ArrayList<View>(); // 实例化ViewPager viewPager = (JazzyViewPager) findViewById(R.id.guideActivity_viewpager); loging_bt = (TextView) findViewById(R.id.loging_bt); tiyan_bt = (TextView) findViewById(R.id.tiyan_bt); animationTop = AnimationUtils.loadAnimation(context, R.anim.tutorail_scalate_top);//渐变放大效果 } public void setGuideData(int[] guidePicIds,int[] dot,int viewPagerBg){ viewPager.setBackgroundResource(viewPagerBg); setDefaultGuidPage(guidePicIds);//设置默认引导页 dot1=dot[0]; dot2=dot[1]; initData(); } public void setLogingBtSty(int bg){ loging_bt.setBackgroundResource(bg); } public void setTiYangBtSty(int bg){ tiyan_bt.setBackgroundResource(bg); } public TextView getLogingBt() { return loging_bt; } public TextView getTiyanBt() { return tiyan_bt; } /** * 设置默认引导页 * * @Title: setDefaultGuidPage * @Description: TODO * @return: void */ private void setDefaultGuidPage(int[] guidePicIds) { this.guidePicIds = guidePicIds; } /** * 初始化数据 */ private void initData() { // 定义一个布局并设置参数 LinearLayout.LayoutParams mParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); // 初始化引导图片列表 for (int i = 0; i < guidePicIds.length; i++) { ImageView iv = new ImageView(context); iv.setLayoutParams(mParams); //防止图片不能填满屏幕 iv.setScaleType(ImageView.ScaleType.FIT_XY); //加载图片资源 iv.setBackgroundResource(guidePicIds[i]); views.add(iv); } // 实例化ViewPager适配器 vpAdapter = new ViewPagerAdapter(views, viewPager); // 设置数据 viewPager.setAdapter(vpAdapter); // 设置监听 viewPager.setOnPageChangeListener(this); vpAdapter.notifyDataSetChanged(); viewPager.setTransitionEffect(JazzyViewPager.TransitionEffect.Stack); viewPager.setPageMargin(30); // 初始化底部小点 initPoint(); } int dot1,dot2; /** * 初始化底部小点 */ private void initPoint() { guideActivity_linearLayout = (LinearLayout) findViewById(R.id.guideActivity_linearLayout); /*points = new ImageView[pics.length];*/ points = new ImageView[guidePicIds.length]; ImageView imgView; // 循环取得小点图片 /*for (int i = 0; i < pics.length; i++) {*/ for (int i = 0; i < guidePicIds.length; i++) { imgView = new ImageView(context); // 得到一个LinearLayout下面的每一个子元素 points[i] = imgView; // 默认都设为灰色 points[i].setImageResource(dot1); // 设置位置tag,方便取出与当前位置对应 points[i].setTag(i); LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); layoutParams.leftMargin = 5; layoutParams.rightMargin = 5; points[i].setLayoutParams(layoutParams); guideActivity_linearLayout.addView(imgView); } // 设置当面默认的位置 currentIndex = 0; // 设置为白色,即选中状态 points[currentIndex].setImageResource(dot2); } /** * 滑动状态改变时调用 */ boolean flag = false; @Override public void onPageScrollStateChanged(int arg0) { switch (arg0) { case ViewPager.SCROLL_STATE_DRAGGING: flag = false; break; case ViewPager.SCROLL_STATE_SETTLING: flag = true; break; case ViewPager.SCROLL_STATE_IDLE: if (viewPager.getCurrentItem() == viewPager.getAdapter() .getCount() - 1 && !flag) { //最后一页 } flag = true; break; } } /** * 当前页面滑动时调用 */ @Override public void onPageScrolled(int arg0, float arg1, int arg2) { } /** * 新的页面被选中时调用 */ @Override public void onPageSelected(int arg0) { if (arg0 == viewPager.getAdapter().getCount() - 1) { loging_bt.startAnimation(animationTop); tiyan_bt.startAnimation(animationTop); loging_bt.setVisibility(View.VISIBLE); tiyan_bt.setVisibility(View.VISIBLE); guideActivity_linearLayout.setVisibility(View.GONE); } else { guideActivity_linearLayout.setVisibility(View.VISIBLE); loging_bt.setVisibility(View.GONE); tiyan_bt.setVisibility(View.GONE); loging_bt.clearAnimation(); tiyan_bt.clearAnimation(); } viewPager.setBackgroundResource(guidePicIds[arg0]);//动态设置viewPager的背景图 setCurDot(arg0); } /** * 设置当前的小点的位置 */ private void setCurDot(int positon) { /*if (positon < 0 || positon > pics.length - 1 || currentIndex == positon) {*/ if (positon < 0 || positon > guidePicIds.length - 1 || currentIndex == positon) { return; } points[currentIndex].setImageResource(dot1); points[positon].setImageResource(dot2); currentIndex = positon; } public void setLoging_btContent(String str){ loging_bt.setText(str); } }
[ "387776364@qq.com" ]
387776364@qq.com
9f6312d3b91aef7cd7730a8f9f404765ff7e67d8
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/16/org/jfree/chart/text/TextFragment_getFont_167.java
eff98a99a70d24e8cda005f1d522379e88d696a6
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
483
java
org jfree chart text text item font fit singl line link text line textlin instanc immut text fragment textfrag serializ return font font code code font font getfont font
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
89e37c40017525f93513f7ff5561d5a0f127b978
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/29/29_82fb06a6e16254ff683a6abfd3fda19840da22ad/PMVServlet/29_82fb06a6e16254ff683a6abfd3fda19840da22ad_PMVServlet_t.java
2f3473e3fa1864830c3a4702a4c0863a97917e60
[]
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
5,125
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package servlets; import controller.traffic.PMVController; import controller.traffic.StatsPMVController; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; import java.net.MalformedURLException; import java.sql.SQLException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.inject.Inject; 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 model.traffic.ItineraryStats; import model.traffic.PMV; /** * * @author mael */ @WebServlet(name = "PMVServlet", urlPatterns = {"/PMVServlet"}) public class PMVServlet extends HttpServlet { @Inject private PMVController pmvContr; @Inject private StatsPMVController statsPmvContr; /** * Processes requests for both HTTP * <code>GET</code> and * <code>POST</code> methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { /* TODO output your page here. You may use following sample code. */ out.println("<html>"); out.println("<head>"); out.println("<title>Servlet PMVServlet</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet PMVServlet at " + request.getContextPath() + "</h1>"); try { List<PMV> pmvs = pmvContr.getAll(); String codeJs = new String(); List<ItineraryStats> datas = statsPmvContr.getAll(); int i = 0; for (PMV pmv:pmvs) { if ( pmv.isIndic_temps() && datas.size()!=0 ) { codeJs += "my_marker = new mxn.Marker(new mxn.LatLonPoint(" + pmv.getLatitude() + "," + pmv.getLongitude() + "));"; codeJs += "my_marker.setIcon('images/marker.png');"; codeJs += "my_marker.setInfoDiv('" +datas.get(i).getTime() + " minutes</p>','info');"; codeJs += "mapstraction.addMarker(my_marker);"; i++; } } request.setAttribute("codeJs", codeJs); request.getServletContext().getRequestDispatcher("/map.jsp").forward(request, response); } catch (FileNotFoundException ex) { Logger.getLogger(PMVServlet.class.getName()).log(Level.SEVERE, null, ex); } catch (MalformedURLException ex) { Logger.getLogger(PMVServlet.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(PMVServlet.class.getName()).log(Level.SEVERE, null, ex); } out.println("</body>"); out.println("</html>"); } finally { out.close(); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP * <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP * <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
64aea75c89f4ca627640893eedad94cff7fc1b0d
9b9c3236cc1d970ba92e4a2a49f77efcea3a7ea5
/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q00113_StatusOfTheBeaconTower/Q00113_StatusOfTheBeaconTower.java
aaf15eca97811c4258e5c8444a6e03213f526bdb
[]
no_license
BETAJIb/ikol
73018f8b7c3e1262266b6f7d0a7f6bbdf284621d
f3709ea10be2d155b0bf1dee487f53c723f570cf
refs/heads/master
2021-01-05T10:37:17.831153
2019-12-24T22:23:02
2019-12-24T22:23:02
240,993,482
0
0
null
null
null
null
UTF-8
Java
false
false
2,951
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 3 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, see <http://www.gnu.org/licenses/>. */ package quests.Q00113_StatusOfTheBeaconTower; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.State; /** * Status of the Beacon Tower (113) * @author malyelfik */ public class Q00113_StatusOfTheBeaconTower extends Quest { // NPCs private static final int MOIRA = 31979; private static final int TORRANT = 32016; // Items private static final int FLAME_BOX = 14860; private static final int FIRE_BOX = 8086; public Q00113_StatusOfTheBeaconTower() { super(113); addStartNpc(MOIRA); addTalkId(MOIRA, TORRANT); registerQuestItems(FIRE_BOX, FLAME_BOX); } @Override public String onAdvEvent(String event, Npc npc, PlayerInstance player) { final QuestState qs = getQuestState(player, false); if (qs == null) { return null; } String htmltext = event; switch (event) { case "31979-02.htm": { qs.startQuest(); giveItems(player, FLAME_BOX, 1); break; } case "32016-02.html": { if (hasQuestItems(player, FIRE_BOX)) { giveAdena(player, 21578, true); addExpAndSp(player, 76665, 5333); } else { giveAdena(player, 154800, true); addExpAndSp(player, 619300, 44200); } qs.exitQuest(false, true); break; } default: { htmltext = null; break; } } return htmltext; } @Override public String onTalk(Npc npc, PlayerInstance player) { String htmltext = getNoQuestMsg(player); final QuestState qs = getQuestState(player, true); switch (npc.getId()) { case MOIRA: { switch (qs.getState()) { case State.CREATED: { htmltext = (player.getLevel() >= 80) ? "31979-01.htm" : "31979-00.htm"; break; } case State.STARTED: { htmltext = "31979-03.html"; break; } case State.COMPLETED: { htmltext = getAlreadyCompletedMsg(player); break; } } break; } case TORRANT: { if (qs.isStarted()) { htmltext = "32016-01.html"; } break; } } return htmltext; } }
[ "mobius@cyber-wizard.com" ]
mobius@cyber-wizard.com
1cfbea54e95dd9d4d93b6bbd575bdfeac081bc6c
79e8624ad4959dd214f4e8694930bbb641be0398
/src/main/java/de/sormuras/sors/testmodule/processor/TestModuleProcessor.java
b801cb803c9a3e4e157b4f6129b2f5576f9075b0
[ "Apache-2.0" ]
permissive
sormuras/sors-test-module-processor
496dd828da05b0cd712abbd938c0ee0fc3775a68
e463a242b5c9ae81755ae64a33b0d32973fc4d15
refs/heads/master
2020-03-19T11:30:16.539904
2018-06-16T08:31:11
2018-06-16T08:31:11
136,459,709
0
0
null
null
null
null
UTF-8
Java
false
false
5,419
java
package de.sormuras.sors.testmodule.processor; import de.sormuras.sors.testmodule.TestModule; import de.sormuras.sors.testmodule.TestModuleExtender; import static java.lang.String.format; import static javax.tools.Diagnostic.Kind.ERROR; import static javax.tools.Diagnostic.Kind.NOTE; import static javax.tools.StandardLocation.CLASS_OUTPUT; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.RoundEnvironment; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; import javax.tools.StandardLocation; import java.io.IOException; import java.io.PrintStream; import java.lang.module.ModuleDescriptor; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import java.util.Set; public class TestModuleProcessor extends AbstractProcessor { private static final String OPTION_VERBOSE = "de.sormuras.sors.temopro.verbose"; private int roundCounter = 0; private boolean verbose = Boolean.getBoolean(OPTION_VERBOSE); @Override public Set<String> getSupportedAnnotationTypes() { return Set.of(TestModule.class.getCanonicalName()); } @Override public SourceVersion getSupportedSourceVersion() { return SourceVersion.latest(); } @Override public Set<String> getSupportedOptions() { return Set.of(OPTION_VERBOSE); } @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment round) { note("Processing magic round #%d -> %s", roundCounter, round); note("Living inside %s", getClass().getModule()); if (round.processingOver()) { return true; } processAllElementsAnnotatedWithTestModule(round.getElementsAnnotatedWith(TestModule.class)); roundCounter++; return true; } private void error(Element element, String format, Object... args) { processingEnv.getMessager().printMessage(ERROR, format(format, args), element); } private void note(String format, Object... args) { if (!verbose) { return; } processingEnv.getMessager().printMessage(NOTE, format(format, args)); } private void processAllElementsAnnotatedWithTestModule(Set<? extends Element> elements) { for (Element testModuleAnnotated : elements) { ElementKind kind = testModuleAnnotated.getKind(); if (!kind.equals(ElementKind.PACKAGE)) { error( testModuleAnnotated, "@TestModule expects a package as target, not %s %s", kind, testModuleAnnotated); } note("Processing in enclosing: %s", testModuleAnnotated.getEnclosingElement()); try { processElementAnnotatedWithTestModule((PackageElement) testModuleAnnotated); } catch (Exception e) { error(testModuleAnnotated, "Processing failed: %s", e); } } } private void processElementAnnotatedWithTestModule(PackageElement packageElement) { var filer = processingEnv.getFiler(); var testModule = packageElement.getAnnotation(TestModule.class); var packageName = packageElement.getQualifiedName().toString(); note("Package %s is annotated with: %s", packageName, testModule); var extender = new TestModuleExtender(); if (testModule.compile()) { try { note("Compiling..."); var path = Paths.get(testModule.mainModuleDescriptorBinary(), "module-info.class"); // var moduleClass = filer.createClassFile("module-info.class"); // illegal name... var moduleClass = filer.createResource(CLASS_OUTPUT, "", "module-info.class"); try (var mainStream = Files.newInputStream(path); var testStream = moduleClass.openOutputStream()) { var mainDescriptor = ModuleDescriptor.read(mainStream); var builder = extender.builder(mainDescriptor); extender.copyMainModuleDirectives(mainDescriptor, builder); extender.extend(testModule, builder); var bytes = new ModuleDescriptorCompiler().moduleDescriptorToBinary(builder.build()); testStream.write(bytes); } } catch (Exception e) { error(packageElement, e.toString()); } } else { var testLines = List.of(testModule.value()); if (testLines.isEmpty()) { error(packageElement, "No test module descriptor line?!"); return; } if (testModule.merge()) { note("Merging main and test module descriptors..."); var path = Paths.get(testModule.mainModuleDescriptorSource(), "module-info.java"); try { var mainLines = Files.readAllLines(path); note("Read main module descriptor (%d lines): `%s`", mainLines.size(), path); testLines = extender.mergeSourceLines(mainLines, testLines); } catch (IOException e) { error(packageElement, "Reading main module descriptor from `%s`: %s", path, e); return; } } try { note("Printing...%n %s", testLines); var file = filer.createResource(StandardLocation.SOURCE_OUTPUT, "", "module-info.java"); try (PrintStream stream = new PrintStream(file.openOutputStream(), false, "UTF-8")) { testLines.forEach(stream::println); } } catch (Exception e) { error(packageElement, e.toString()); } } } }
[ "sormuras@gmail.com" ]
sormuras@gmail.com
53d51944dfbd9c14adb147484636420aee746a55
471a1d9598d792c18392ca1485bbb3b29d1165c5
/jadx-MFP/src/main/java/com/google/android/exoplayer2/offline/TrackKey.java
34d9633806b39462790d94a84c7e370aff1c0789
[]
no_license
reed07/MyPreferencePal
84db3a93c114868dd3691217cc175a8675e5544f
365b42fcc5670844187ae61b8cbc02c542aa348e
refs/heads/master
2020-03-10T23:10:43.112303
2019-07-08T00:39:32
2019-07-08T00:39:32
129,635,379
2
0
null
null
null
null
UTF-8
Java
false
false
322
java
package com.google.android.exoplayer2.offline; public final class TrackKey { public final int groupIndex; public final int periodIndex; public final int trackIndex; public TrackKey(int i, int i2, int i3) { this.periodIndex = i; this.groupIndex = i2; this.trackIndex = i3; } }
[ "anon@ymous.email" ]
anon@ymous.email
a3d5262b3959f7c284d28f54a7fe401af3322669
29159bc4c137fe9104d831a5efe346935eeb2db5
/mmj-cloud-third/src/main/java/com/qianmi/open/api/response/BmDirectRechargeGamePayBillResponse.java
ffc17b020462e89ebabebc08af34e15a54762995
[]
no_license
xddpool/mmj-cloud
bfb06d2ef08c9e7b967c63f223fc50b1a56aac1c
de4bcb35db509ce929d516d83de765fdc2afdac5
refs/heads/master
2023-06-27T11:16:38.059125
2020-07-24T03:23:48
2020-07-24T03:23:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
765
java
package com.qianmi.open.api.response; import com.qianmi.open.api.QianmiResponse; import com.qianmi.open.api.domain.elife.OrderDetailInfo; import com.qianmi.open.api.tool.mapping.ApiField; /** * API: bm.elife.directRecharge.game.payBill response. * * @author auto * @since 2.0 */ public class BmDirectRechargeGamePayBillResponse extends QianmiResponse { private static final long serialVersionUID = 1L; /** * 订单详情-用于展示订单详情 */ @ApiField("orderDetailInfo") private OrderDetailInfo orderDetailInfo; public void setOrderDetailInfo(OrderDetailInfo orderDetailInfo) { this.orderDetailInfo = orderDetailInfo; } public OrderDetailInfo getOrderDetailInfo( ) { return this.orderDetailInfo; } }
[ "shenfuding@shenfudingdeMacBook-Pro.local" ]
shenfuding@shenfudingdeMacBook-Pro.local
0d19ca0c3bd68882f990133d75fb9ad0c370c437
04b1803adb6653ecb7cb827c4f4aa616afacf629
/third_party/android_29_sdk/public/sources/android-29/com/android/layoutlib/bridge/remote/server/adapters/RemoteLayoutLogAdapter.java
6878d465b1c337fe869c79ce390f4a2ec6079af0
[ "LGPL-2.0-or-later", "GPL-1.0-or-later", "MIT", "Apache-2.0", "BSD-3-Clause" ]
permissive
Samsung/Castanets
240d9338e097b75b3f669604315b06f7cf129d64
4896f732fc747dfdcfcbac3d442f2d2d42df264a
refs/heads/castanets_76_dev
2023-08-31T09:01:04.744346
2021-07-30T04:56:25
2021-08-11T05:45:21
125,484,161
58
49
BSD-3-Clause
2022-10-16T19:31:26
2018-03-16T08:07:37
null
UTF-8
Java
false
false
2,145
java
/* * Copyright (C) 2017 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.android.layoutlib.bridge.remote.server.adapters; import com.android.ide.common.rendering.api.LayoutLog; import com.android.layout.remote.api.RemoteLayoutLog; import com.android.tools.layoutlib.annotations.NotNull; import java.rmi.RemoteException; public class RemoteLayoutLogAdapter extends LayoutLog { private final RemoteLayoutLog mLog; public RemoteLayoutLogAdapter(@NotNull RemoteLayoutLog log) { mLog = log; } @Override public void warning(String tag, String message, Object data) { try { mLog.warning(tag, message, null); } catch (RemoteException e) { throw new RuntimeException(e); } } @Override public void fidelityWarning(String tag, String message, Throwable throwable, Object viewCookie, Object data) { try { mLog.fidelityWarning(tag, message, throwable, viewCookie, data); } catch (RemoteException e) { throw new RuntimeException(e); } } @Override public void error(String tag, String message, Object data) { try { mLog.error(tag, message, null); } catch (RemoteException e) { throw new RuntimeException(e); } } @Override public void error(String tag, String message, Throwable throwable, Object data) { try { mLog.error(tag, message, throwable, null); } catch (RemoteException e) { throw new RuntimeException(e); } } }
[ "sunny.nam@samsung.com" ]
sunny.nam@samsung.com
c5d6d32969382412747e8899beead30b34de5ca7
1930d97ebfc352f45b8c25ef715af406783aabe2
/src/main/java/com/alipay/api/domain/SignedFileInfo.java
5ea783e7a3e74bd04e9ebf2a0d3e051e5ea4d33b
[ "Apache-2.0" ]
permissive
WQmmm/alipay-sdk-java-all
57974d199ee83518523e8d354dcdec0a9ce40a0c
66af9219e5ca802cff963ab86b99aadc59cc09dd
refs/heads/master
2023-06-28T03:54:17.577332
2021-08-02T10:05:10
2021-08-02T10:05:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,662
java
package com.alipay.api.domain; import java.util.Date; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 已签名文件信息 * * @author auto create * @since 1.0, 2017-08-08 10:42:59 */ public class SignedFileInfo extends AlipayObject { private static final long serialVersionUID = 5218538394577732989L; /** * 文档过期时间戳 */ @ApiField("expired_time") private Date expiredTime; /** * 数据名 */ @ApiField("file_name") private String fileName; /** * 文件类型 pdf //pdf文档 p7 //pkcs7签名文档 */ @ApiField("file_type") private String fileType; /** * 文件读取url地址 */ @ApiField("file_url") private String fileUrl; /** * 文档创建时间戳 */ @ApiField("gmt_time") private Date gmtTime; /** * 签约数据编号,由平台生成 */ @ApiField("inner_data_id") private String innerDataId; /** * 签约数据编号,由外部系统定义,用于数据关联 */ @ApiField("out_data_id") private String outDataId; /** * 文档签名结果 */ @ApiField("signed_data") private String signedData; /** * 资源文件类型 DATA //文件原文 FILE //文件OSS索引 */ @ApiField("source_type") private String sourceType; public Date getExpiredTime() { return this.expiredTime; } public void setExpiredTime(Date expiredTime) { this.expiredTime = expiredTime; } public String getFileName() { return this.fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public String getFileType() { return this.fileType; } public void setFileType(String fileType) { this.fileType = fileType; } public String getFileUrl() { return this.fileUrl; } public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } public Date getGmtTime() { return this.gmtTime; } public void setGmtTime(Date gmtTime) { this.gmtTime = gmtTime; } public String getInnerDataId() { return this.innerDataId; } public void setInnerDataId(String innerDataId) { this.innerDataId = innerDataId; } public String getOutDataId() { return this.outDataId; } public void setOutDataId(String outDataId) { this.outDataId = outDataId; } public String getSignedData() { return this.signedData; } public void setSignedData(String signedData) { this.signedData = signedData; } public String getSourceType() { return this.sourceType; } public void setSourceType(String sourceType) { this.sourceType = sourceType; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
00d6cc6dc6cee9c9a5f27e1d945eda7760520171
1f2693e57a8f6300993aee9caa847d576f009431
/testleo/myfaces-skins2/trinidad-core-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/data/bind/NotBoundValue.java
16302256e40815c1503bf3562ad672490f916af2
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
mr-sobol/myfaces-csi
ad80ed1daadab75d449ef9990a461d9c06d8c731
c142b20012dda9c096e1384a46915171bf504eb8
refs/heads/master
2021-01-10T06:11:13.345702
2009-01-05T09:46:26
2009-01-05T09:46:26
43,557,323
0
0
null
null
null
null
UTF-8
Java
false
false
1,987
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.myfaces.trinidadinternal.ui.data.bind; import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext; import org.apache.myfaces.trinidadinternal.ui.data.BoundValue; /** * BoundValue that returns <code>Boolean.FALSE</code> if the passed * in BoundValue is <code>Boolean.TRUE</code> and returns * <code>Boolean.TRUE</code> otherwise. * <p> * @version $Name: $ ($Revision$) $Date$ * @deprecated This class comes from the old Java 1.2 UIX codebase and should not be used anymore. */ @Deprecated public class NotBoundValue implements BoundValue { /** * Creates a NotBoundValue. A Null parameter are treated as if its * value returns <code>Boolean.FALSE</code>. * <p> * @param value BoundValue to NOT the result of */ public NotBoundValue( BoundValue value ) { if (value == null) value = FixedBoundValue.FALSE_VALUE; _value = value; } public Object getValue( UIXRenderingContext context ) { if (Boolean.TRUE.equals(_value.getValue(context))) { return Boolean.FALSE; } else { return Boolean.TRUE; } } private BoundValue _value; }
[ "lu4242@ea1d4837-9632-0410-a0b9-156113df8070" ]
lu4242@ea1d4837-9632-0410-a0b9-156113df8070
74a96a10f04040afc5f9b661974ae8703ec3b602
b4cbd034fb0a03e9d102974f9f5f4833b361c4d9
/localhost_ps/src/main/java/com/zxwtry/pictureServer/dao/PictureInfoDao.java
55e577708e6f3fbf986135c7f15db97ea0ff59f9
[]
no_license
zxwtry/PictureServer
75b92597dfb3d72905c97107128e3520393de9f5
c405d2fb9f46a0b4e99dcf97026c5f3238393056
refs/heads/master
2021-01-19T21:02:46.530930
2017-08-24T02:56:06
2017-08-24T02:56:06
101,244,330
1
0
null
null
null
null
UTF-8
Java
false
false
293
java
package com.zxwtry.pictureServer.dao; import org.apache.ibatis.annotations.Param; import com.zxwtry.pictureServer.entity.PictureInfo; public interface PictureInfoDao { void insert(PictureInfo pictureInfo); PictureInfo queryByFileName(@Param("fileName")String fileName); }
[ "zxwtry@qq.com" ]
zxwtry@qq.com
a3c1589c99e646bde7a0040395aa40a1bd2678f1
ad53746b0caef28644599666f5ec2a56d2689824
/gwt-cldr-generator/src/main/java/org/gwtproject/i18n/cldr/generator/model/Calendar.java
5bdb048ed7f187a8120f5a6b8f8d79b03ae768ba
[]
no_license
treblereel/gwt-datetime
62ecac3f4bca71eaadfa15b18515fa6872cc55c1
78d56e84cb1ea08d5a867e59ee9afe0a66a714f6
refs/heads/main
2023-06-22T04:40:59.111734
2021-07-23T05:02:07
2021-07-23T05:02:07
388,654,749
1
1
null
null
null
null
UTF-8
Java
false
false
2,671
java
package org.gwtproject.i18n.cldr.generator.model; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import java.util.List; /** * @author Dmitrii Tikhomirov * Created by treblereel 7/10/21 */ public class Calendar { @XmlAttribute private String type; @XmlElementWrapper(name = "dateFormats") @XmlElement(name = "dateFormatLength") private List<DateFormatLength> dateFormats; private Eras eras; private Months months; private MonthPatterns monthPatterns; private CyclicNameSets cyclicNameSets; private Days days; private Quarters quarters; private DayPeriods dayPeriods; private DateTimeFormats dateTimeFormats; private TimeFormats timeFormats; public String getType() { return type; } public void setType(String type) { this.type = type; } public List<DateFormatLength> getDateFormats() { return dateFormats; } public void setDateFormats(List<DateFormatLength> dateFormats) { this.dateFormats = dateFormats; } public Eras getEras() { return eras; } public void setEras(Eras eras) { this.eras = eras; } public Months getMonths() { return months; } public void setMonths(Months months) { this.months = months; } public DateTimeFormats getDateTimeFormats() { return dateTimeFormats; } public void setDateTimeFormats(DateTimeFormats dateTimeFormats) { this.dateTimeFormats = dateTimeFormats; } public Days getDays() { return days; } public void setDays(Days days) { this.days = days; } public Quarters getQuarters() { return quarters; } public void setQuarters(Quarters quarters) { this.quarters = quarters; } public DayPeriods getDayPeriods() { return dayPeriods; } public void setDayPeriods(DayPeriods dayPeriods) { this.dayPeriods = dayPeriods; } public TimeFormats getTimeFormats() { return timeFormats; } public void setTimeFormats(TimeFormats timeFormats) { this.timeFormats = timeFormats; } public MonthPatterns getMonthPatterns() { return monthPatterns; } public void setMonthPatterns(MonthPatterns monthPatterns) { this.monthPatterns = monthPatterns; } public CyclicNameSets getCyclicNameSets() { return cyclicNameSets; } public void setCyclicNameSets(CyclicNameSets cyclicNameSets) { this.cyclicNameSets = cyclicNameSets; } }
[ "chani.liet@gmail.com" ]
chani.liet@gmail.com
78100608480bf94eee6af2bccc3e0577b2cc1b1c
15cf8a940a99b1335250bff9f221cc08d5df9f0f
/src/com/google/android/gms/wallet/a.java
2d88e64dde843763def3e093fe20aebc7cc2a1b6
[]
no_license
alamom/mcoc_mod_11.1
0e5153e0e7d83aa082c5447f991b2f6fa5c01d8b
d48cb0d2b3bc058bddb09c761ae5f443d9f2e93d
refs/heads/master
2021-01-11T17:12:37.894951
2017-01-22T19:55:38
2017-01-22T19:55:38
79,739,761
0
0
null
null
null
null
UTF-8
Java
false
false
3,668
java
package com.google.android.gms.wallet; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.common.internal.safeparcel.a.a; import com.google.android.gms.common.internal.safeparcel.b; public class a implements Parcelable.Creator<Address> { static void a(Address paramAddress, Parcel paramParcel, int paramInt) { paramInt = b.D(paramParcel); b.c(paramParcel, 1, paramAddress.getVersionCode()); b.a(paramParcel, 2, paramAddress.name, false); b.a(paramParcel, 3, paramAddress.adN, false); b.a(paramParcel, 4, paramAddress.adO, false); b.a(paramParcel, 5, paramAddress.adP, false); b.a(paramParcel, 6, paramAddress.uW, false); b.a(paramParcel, 7, paramAddress.ast, false); b.a(paramParcel, 8, paramAddress.asu, false); b.a(paramParcel, 9, paramAddress.adU, false); b.a(paramParcel, 10, paramAddress.adW, false); b.a(paramParcel, 11, paramAddress.adX); b.a(paramParcel, 12, paramAddress.adY, false); b.H(paramParcel, paramInt); } public Address dn(Parcel paramParcel) { int j = com.google.android.gms.common.internal.safeparcel.a.C(paramParcel); int i = 0; String str10 = null; String str9 = null; String str8 = null; String str7 = null; String str6 = null; String str5 = null; String str4 = null; String str3 = null; String str2 = null; boolean bool = false; String str1 = null; while (paramParcel.dataPosition() < j) { int k = com.google.android.gms.common.internal.safeparcel.a.B(paramParcel); switch (com.google.android.gms.common.internal.safeparcel.a.aD(k)) { default: com.google.android.gms.common.internal.safeparcel.a.b(paramParcel, k); break; case 1: i = com.google.android.gms.common.internal.safeparcel.a.g(paramParcel, k); break; case 2: str10 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 3: str9 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 4: str8 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 5: str7 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 6: str6 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 7: str5 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 8: str4 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 9: str3 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 10: str2 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); break; case 11: bool = com.google.android.gms.common.internal.safeparcel.a.c(paramParcel, k); break; case 12: str1 = com.google.android.gms.common.internal.safeparcel.a.o(paramParcel, k); } } if (paramParcel.dataPosition() != j) { throw new a.a("Overread allowed size end=" + j, paramParcel); } return new Address(i, str10, str9, str8, str7, str6, str5, str4, str3, str2, bool, str1); } public Address[] fo(int paramInt) { return new Address[paramInt]; } } /* Location: C:\tools\androidhack\marvel_bitva_chempionov_v11.1.0_mod_lenov.ru\classes.jar!\com\google\android\gms\wallet\a.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "eduard.martini@gmail.com" ]
eduard.martini@gmail.com
798e7840e701729788efafa4b5c52b1f9be3a0b5
c0542546866385891c196b665d65a8bfa810f1a3
/app-decompiled/ClockworkAmbient/src/com/google/android/wearable/ambient/AmbientDetails.java
47aaad3747af33582c1eb6ccec7dede7f5ccf60a
[]
no_license
auxor/android-wear-decompile
6892f3564d316b1f436757b72690864936dd1a82
eb8ad0d8003c5a3b5623918c79334290f143a2a8
refs/heads/master
2016-09-08T02:32:48.433800
2015-10-12T02:17:27
2015-10-12T02:19:32
42,517,868
5
1
null
null
null
null
UTF-8
Java
false
false
625
java
package com.google.android.wearable.ambient; import android.os.Bundle; import com.google.android.clockwork.settings.AmbientConfig; import com.google.android.clockwork.settings.BurnInConfig; final class AmbientDetails { public static Bundle create(BurnInConfig burnInConfig, AmbientConfig ambientConfig) { Bundle bundle = new Bundle(); bundle.putBoolean("com.google.android.wearable.compat.extra.LOWBIT_AMBIENT", ambientConfig.isLowBitEnabled()); bundle.putBoolean("com.google.android.wearable.compat.extra.BURN_IN_PROTECTION", burnInConfig.isProtectionEnabled()); return bundle; } }
[ "itop.my@gmail.com" ]
itop.my@gmail.com
792eacb72a447f475c20c26a1a61f6c340a321e6
4a497bd4160800dcaca6f1ebba97aab853c3ffca
/ch05/item_27/ex27-5.java
d2207f261d99787a42957a695f76a2f9fac7508c
[]
no_license
freebz/Effective-Java-2-E
09e0ed512d719ace3870fccf0d1af3db97e72c17
fc42a121611cc059fe07fe3a7f5dc579ce3ba9a2
refs/heads/master
2020-03-17T09:12:18.971356
2019-08-12T01:59:54
2019-08-12T01:59:54
133,465,611
0
0
null
null
null
null
UTF-8
Java
false
false
983
java
public interface UnaryFunction<T> { T apply(T arg); } // 제네릭 싱글턴 팩터리 패턴 private static UnaryFunction<Object> IDENTITY_FUNCTION = new UnaryFunction<Object>() { public Object apply(Object arg) { return arg; } }; // IDENTITY_FUNCTION은 무상태 객체고 형인자는 비한정 인자이므로(unbounded) // 모든 자료형이 같은 객체를 공유해도 안전하다. @SuppressWarnings("unchecked") public static <T> UnaryFunction<T> identityFunction() { return (UnaryFunction<T>) IDENTITY_FUNCTION; } // 제네릭 싱글턴 사용 예제 public static void main(String[] args) { String[] strings = { "jute", "hemp", "nylon" }; UnaryFunction<String> sameString = identityFunction(); for (String s : strings) System.out.println(sameString.apply(s)); Number[] numbers = { 1, 2.0, 3L }; UnaryFunction<Number> sameNumber = identityFunction(); for (Number n : numbers) System.out.println(sameNumber.apply(n)); }
[ "freebz@hananet.net" ]
freebz@hananet.net
919a0f12e1e3c03f3dd7be92d7741187417b1764
f718bc3bde3dae13971ff100a93fc6add0dfd4d3
/3.JavaMultithreading/src/com/javarush/task/task21/task2102/Solution.java
1930ed49b6f7c88107ab46e9d1ee8f92aa45778a
[]
no_license
lazarevspb/JavaRushTasks
eb8e9176a6b918f0da4886a8c7cc9d43352d76e8
3759ed4877aa3ce017c8a2e4d6e4c4f81b176d5f
refs/heads/master
2023-05-02T22:52:17.153735
2021-05-18T19:14:09
2021-05-18T19:14:09
295,786,986
0
0
null
null
null
null
UTF-8
Java
false
false
1,145
java
package com.javarush.task.task21.task2102; import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer; import java.lang.reflect.Method; import java.lang.reflect.Modifier; /* Сравниваем модификаторы */ public class Solution { public static void main(String[] args) { int classModifiers = Solution.class.getModifiers(); System.out.println(isModifierSet(classModifiers, Modifier.PUBLIC)); //true System.out.println(isModifierSet(classModifiers, Modifier.STATIC)); //false int methodModifiers = getMainMethod().getModifiers(); System.out.println(isModifierSet(methodModifiers, Modifier.STATIC)); //true } public static boolean isModifierSet(int allModifiers, int specificModifier) { if ((allModifiers & specificModifier) == specificModifier) return true; return false; } private static Method getMainMethod() { Method[] methods = Solution.class.getDeclaredMethods(); for (Method method : methods) { if (method.getName().equalsIgnoreCase("main")) return method; } return null; } }
[ "v.lazarev.spb@gmail.com" ]
v.lazarev.spb@gmail.com
a3431f132808e9a9099608bc8061bd139239cdb1
8fba80ff1dc857d111dc55dc77ef841721dee0db
/app/src/main/java/com/baishan/nearshop/presenter/SplashPresenter.java
1429ef43e723beb9abe83ece57fe8c24b1a8512d
[]
no_license
lucky-you/nearshop
edfd85a676174ff1e57a39d1288c34f2be198bd3
2022ac19607ac8d2bb7eada7160cd59c8c42e6aa
refs/heads/master
2020-03-09T15:58:41.433204
2018-07-20T05:43:09
2018-07-20T05:43:09
128,872,729
0
0
null
null
null
null
UTF-8
Java
false
false
2,975
java
package com.baishan.nearshop.presenter; import com.baishan.mylibrary.mvp.BasePresenter; import com.baishan.nearshop.base.AppClient; import com.baishan.nearshop.base.ResultResponse; import com.baishan.nearshop.base.SubscriberCallBack; import com.baishan.nearshop.dao.UserDao; import com.baishan.nearshop.model.Area; import com.baishan.nearshop.model.UserInfo; import com.baishan.nearshop.view.ISplashView; import java.util.List; /** * Created by RayYeung on 2016/10/18. */ public class SplashPresenter extends BasePresenter<ISplashView> { public SplashPresenter(ISplashView mvpView) { super(mvpView); } public void quietLogin(String token) { addSubscription(AppClient.getApiService().quietLogin(token), new SubscriberCallBack<List<UserInfo>>() { @Override protected void onSuccess(List<UserInfo> response) { if (response.size() > 0) { UserDao.login(response.get(0)); }else{ mvpView.onServerError(); } } @Override protected void onError() { super.onError(); mvpView.onServerError(); } @Override protected void onFailure(ResultResponse response) { super.onFailure(response); mvpView.onLoginFailure(response); } }); } public void getUserCurrentArea(String adCode, double longitude, double latitude) { addSubscription(AppClient.getApiService().getUserCurrentArea(adCode, longitude, latitude), new SubscriberCallBack<Area>() { @Override protected void onSuccess(Area response) { if(response!=null){ mvpView.getUserCurrentAreaSuccess(response); }else{ mvpView.getUserCurrentAreaFailure(); } } @Override protected void onFailure(ResultResponse response) { mvpView.getUserCurrentAreaFailure(); } @Override protected void onError() { mvpView.getUserCurrentAreaFailure(); } }); } public void getAreaInfo(int areaId){ addSubscription(AppClient.getApiService().getAreaInfo(areaId), new SubscriberCallBack<List<Area>>() { @Override protected void onSuccess(List<Area> response) { if(response.size()>0){ mvpView.getAreaInfoSuccess(response.get(0)); }else{ mvpView.getAreaInfoFail(areaId); } } @Override protected void onFailure(ResultResponse response) { mvpView.getAreaInfoFail(areaId); } @Override protected void onError() { mvpView.getAreaInfoFail(areaId); } }); } }
[ "1021237228@qq.com" ]
1021237228@qq.com
7c4b2da3baa66d117d450faf6c4a09bdc8daf9ed
5c360fe49ba66785dc24f1093b41257487c845ff
/innovate.core/src/main/java/com/lzy/innovate/dubbo/system/ISysGroupMenuServiceSoa.java
56fad8aa319c3f2e2c439eed269f5a1d63f2ef0c
[]
no_license
lazy-opensource/ssm-admin
c3c3a5ffe5a47f767edd8935ad988b166d5cf5d5
1c40a6516c00101c5051d7fda995dd569750f6a6
refs/heads/master
2020-03-20T19:15:19.362093
2018-06-17T04:30:56
2018-06-17T04:30:56
137,581,156
0
0
null
null
null
null
UTF-8
Java
false
false
293
java
package com.lzy.innovate.dubbo.system; import com.lzy.innovate.dubbo.base.BaseService; import com.lzy.innovate.entity.SysGroupMenu; /** * <p> * 服务类 * </p> * * @author laizy * @since 2017-02-28 */ public interface ISysGroupMenuServiceSoa extends BaseService<SysGroupMenu> { }
[ "1059446341@qq.com" ]
1059446341@qq.com
e58ff14fe30c0c13202eb3afe3693caf62504dc6
0651ef45173a0bd2da3f68af84fea355732df903
/app/src/main/java/com/cretin/collegehelper/model/LocationModel.java
6efa819d9522e1a87aa36ff97136f6c4c59fe5a3
[]
no_license
liumingxin798/CollegeHelper
728a8221a4359c98dd7dc7667d7a721cab11a322
b458c00da583225792f390c173eb711e6b160577
refs/heads/master
2021-01-24T22:36:10.740845
2016-05-31T07:21:25
2016-05-31T07:21:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
845
java
package com.cretin.collegehelper.model; /** * Created by cretin on 4/17/16. */ public class LocationModel { private double longitude; private double latitude; private String location; private String address; public double getLongitude() { return longitude; } public void setLongitude(double longitude) { this.longitude = longitude; } public double getLatitude() { return latitude; } public void setLatitude(double latitude) { this.latitude = latitude; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } }
[ "mxnzp_life@163.com" ]
mxnzp_life@163.com
1cfc58884234747a700081c8e8b75c23c287e2d6
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE369_Divide_by_Zero/CWE369_Divide_by_Zero__float_URLConnection_divide_52a.java
1c9f636553f9b7a561ad7341222588378c9a744e
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
6,504
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE369_Divide_by_Zero__float_URLConnection_divide_52a.java Label Definition File: CWE369_Divide_by_Zero__float.label.xml Template File: sources-sinks-52a.tmpl.java */ /* * @description * CWE: 369 Divide by zero * BadSource: URLConnection Read data from a web server with URLConnection * GoodSource: A hardcoded non-zero number (two) * Sinks: divide * GoodSink: Check for zero before dividing * BadSink : Dividing by a value that may be zero * Flow Variant: 52 Data flow: data passed as an argument from one method to another to another in three different classes in the same package * * */ package testcases.CWE369_Divide_by_Zero; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; import java.security.SecureRandom; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.net.URL; import java.net.URLConnection; import java.util.logging.Level; import java.util.logging.Logger; public class CWE369_Divide_by_Zero__float_URLConnection_divide_52a extends AbstractTestCase { public void bad() throws Throwable { float data; data = -1.0f; /* Initialize data */ /* read input from URLConnection */ { URLConnection conn = (new URL("http://www.example.org/")).openConnection(); BufferedReader buffread = null; InputStreamReader instrread = null; try { instrread = new InputStreamReader(conn.getInputStream(), "UTF-8"); buffread = new BufferedReader(instrread); /* POTENTIAL FLAW: Read data from a web server with URLConnection */ String s_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 if (s_data != null) { try { data = Float.parseFloat(s_data.trim()); } catch(NumberFormatException nfe) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", nfe); } } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* clean up stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( instrread != null ) { instrread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } } } (new CWE369_Divide_by_Zero__float_URLConnection_divide_52b()).bad_sink(data ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { float data; /* FIX: Use a hardcoded number that won't a divide by zero */ data = 2.0f; (new CWE369_Divide_by_Zero__float_URLConnection_divide_52b()).goodG2B_sink(data ); } /* goodB2G() - use badsource and goodsink */ private void goodB2G() throws Throwable { float data; data = -1.0f; /* Initialize data */ /* read input from URLConnection */ { URLConnection conn = (new URL("http://www.example.org/")).openConnection(); BufferedReader buffread = null; InputStreamReader instrread = null; try { instrread = new InputStreamReader(conn.getInputStream(), "UTF-8"); buffread = new BufferedReader(instrread); /* POTENTIAL FLAW: Read data from a web server with URLConnection */ String s_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 if (s_data != null) { try { data = Float.parseFloat(s_data.trim()); } catch(NumberFormatException nfe) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", nfe); } } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* clean up stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( instrread != null ) { instrread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } } } (new CWE369_Divide_by_Zero__float_URLConnection_divide_52b()).goodB2G_sink(data ); } /* 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); } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
2c305724652df756b9688fa607c6ad3f57beef6d
1454d3453f9e27827dbcf6fdb20cdb7df15b0976
/wsweb/Blog1/src/com/ibeifeng/action/EditBlogInfo.java
c00ea8ac778f8df816797cc6fc135abb4d86fdf4
[]
no_license
liaoshanggang/MyGitHub
bf8b081c229e79d20a511480b59eaa561c6207da
def305f66aaede80a75b21153a22a2d8078451eb
refs/heads/master
2021-06-23T18:40:49.431361
2018-07-02T15:55:59
2018-07-02T15:55:59
95,458,230
0
0
null
null
null
null
UTF-8
Java
false
false
1,583
java
package com.ibeifeng.action; import java.util.Map; import com.ibeifeng.po.BlogInfo; import com.ibeifeng.service.BlogInfoService; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; public class EditBlogInfo extends ActionSupport { private String blogtitle; private String idiograph; private BlogInfoService blogInfoService; public BlogInfoService getBlogInfoService() { return blogInfoService; } public void setBlogInfoService(BlogInfoService blogInfoService) { this.blogInfoService = blogInfoService; } public String getBlogtitle() { return blogtitle; } public void setBlogtitle(String blogtitle) { this.blogtitle = blogtitle; } public String getIdiograph() { return idiograph; } public void setIdiograph(String idiograph) { this.idiograph = idiograph; } public String execute() throws Exception { // //获得request // HttpServletRequest request = ServletActionContext.getRequest(); // //获得session // HttpSession session =request.getSession(); // //获得username // String username = (String) session.getAttribute("username"); //ActionContext Map session = ActionContext.getContext().getSession(); String username = (String) session.get("username"); BlogInfo blogInfo = new BlogInfo(); //设置用户名 blogInfo.setUsername(username); //设置博客标题 blogInfo.setBlogtitle(blogtitle); //设置个性签名 blogInfo.setIdiograph(idiograph); //调用业务逻辑组件来完成设置 blogInfoService.setBlogInfo(blogInfo); return this.SUCCESS; } }
[ "787887060@qq.com" ]
787887060@qq.com
94f14caaf40f1ffa6d1aee2111a01c71267722d4
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/neo4j/2019/12/StatementEndEvent.java
c8f07de47dd52b314855dc6e70e3e4c2657cf62b
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
2,282
java
/* * Copyright (c) 2002-2019 "Neo4j," * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * 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, see <http://www.gnu.org/licenses/>. */ package org.neo4j.server.http.cypher.format.api; import org.neo4j.graphdb.ExecutionPlanDescription; import org.neo4j.graphdb.Notification; import org.neo4j.graphdb.QueryExecutionType; import org.neo4j.graphdb.QueryStatistics; /** * An event that marks an end of statement's execution output stream. */ public class StatementEndEvent implements OutputEvent { private final QueryExecutionType queryExecutionType; private final QueryStatistics queryStatistics; private final ExecutionPlanDescription executionPlanDescription; private final Iterable<Notification> notifications; public StatementEndEvent( QueryExecutionType queryExecutionType, QueryStatistics queryStatistics, ExecutionPlanDescription executionPlanDescription, Iterable<Notification> notifications ) { this.queryExecutionType = queryExecutionType; this.queryStatistics = queryStatistics; this.executionPlanDescription = executionPlanDescription; this.notifications = notifications; } @Override public Type getType() { return Type.STATEMENT_END; } public QueryStatistics getQueryStatistics() { return queryStatistics; } public ExecutionPlanDescription getExecutionPlanDescription() { return executionPlanDescription; } public Iterable<Notification> getNotifications() { return notifications; } public QueryExecutionType getQueryExecutionType() { return queryExecutionType; } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
77f3b7a371cf52f9b559e6ad5c67308bcbe12499
f30d49642d0aacbab53177a4617ebbb5f33d8c94
/src/net/frapu/code/visualization/storyboard/Scene.java
aebafefe135c518bbd85eea43ff568f0f3882e7d
[ "Apache-2.0" ]
permissive
frapu78/processeditor
393892ab855ff4dbc83cc320279315a1c2789a8c
2e317a17308f5958d35c2b7cecb3e86d06a1b9c1
refs/heads/master
2023-08-09T23:26:22.035014
2023-07-24T16:06:11
2023-07-24T16:06:11
20,647,096
5
6
null
2015-03-24T16:31:59
2014-06-09T13:18:37
Java
UTF-8
Java
false
false
2,215
java
/** * * Process Editor - Storyboard Package * * (C) 2009 Frank Puhlmann * * http://frapu.net * */ package net.frapu.code.visualization.storyboard; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Shape; import java.awt.geom.Rectangle2D; import net.frapu.code.visualization.Cluster; import net.frapu.code.visualization.ProcessUtils.Orientation; /** * * @author fpu */ public class Scene extends Cluster { public static String PROP_SCENE_SEQUENCE_NUMBER = "sequence_number"; public Scene() { super(); setSize(300,250); setText("Scene"); setProperty(PROP_SCENE_SEQUENCE_NUMBER, TRUE); } @Override protected void paintInternal(Graphics g) { // Draw the scene cutboard Graphics2D g2 = (Graphics2D)g; g2.setStroke(StoryboardUtils.defaultStroke); // Fill background Shape outline = getOutlineShape(); g2.setPaint(getBackground()); g2.fill(outline); // Draw outline g2.setPaint(Color.BLACK); g2.draw(outline); // Fill top final int topHeight = 20; Point p = getTopLeftPos(); Dimension d = getSize(); Shape rect = new Rectangle2D.Double(p.x+5, p.y+5, d.width-105, topHeight); g2.fill(rect); Shape rect2 = new Rectangle2D.Double(p.x+d.width-95, p.y+5, 90, topHeight); g2.fill(rect2); g2.drawLine(p.x, p.y+topHeight+10, p.x+d.width, p.y+topHeight+10); // Draw Sequence number and title g2.setPaint(Color.WHITE); g2.setFont(StoryboardUtils.defaultFont); StoryboardUtils.drawText(g2, p.x+8, p.y+g2.getFont().getBaselineFor('a'), d.width-105, getText(), Orientation.LEFT); StoryboardUtils.drawText(g2, p.x+d.width-8, p.y+g2.getFont().getBaselineFor('a'), d.width-105, "#"+getProperty(PROP_SCENE_SEQUENCE_NUMBER), Orientation.RIGHT); } @Override protected Shape getOutlineShape() { Point p = getTopLeftPos(); Dimension d = getSize(); return new Rectangle2D.Double(p.x, p.y, d.width, d.height); } }
[ "frank@frapu.de" ]
frank@frapu.de
2716bdd13673ef58b7497d05fb6a4eae2b5e6eda
2dfcf60ec3c3b1aeafe545e2c9ef1d263a2e18a6
/main/java/by/stub/handlers/YamlDumpHandler.java
fc2b52d089ced7b61223347a5099a66927772600
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
kaizer/stubby4j
8a9b54469395aea972b8032dae2b6c8502a9fbb5
27fb723a76592c445cfcb7570c3be023d32ac0e8
refs/heads/master
2021-01-17T21:40:10.741176
2013-04-25T23:52:17
2013-04-25T23:52:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,967
java
package by.stub.handlers; import by.stub.database.DataStore; import by.stub.javax.servlet.http.HttpServletResponseWithGetStatus; import by.stub.utils.ConsoleUtils; import by.stub.utils.FileUtils; import by.stub.utils.HandlerUtils; import by.stub.utils.StringUtils; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.AbstractHandler; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; /** * @author: Alexander Zagniotov * Created: 4/24/13 5:45 PM */ public class YamlDumpHandler extends AbstractHandler { private static final String NAME = "admin"; private final DataStore dataStore; public YamlDumpHandler(final DataStore dataStore) { this.dataStore = dataStore; } @Override public void handle(final String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { ConsoleUtils.logIncomingRequest(request, NAME); baseRequest.setHandled(true); final HttpServletResponseWithGetStatus wrapper = new HttpServletResponseWithGetStatus(response); try { //TODO Reply with 204 if no stubs are saved HandlerUtils.setResponseMainHeaders(wrapper); wrapper.setContentType("text/plain"); wrapper.setCharacterEncoding(StringUtils.UTF_8); final OutputStream streamOut = wrapper.getOutputStream(); streamOut.write(FileUtils.asciiFileToUtf8Bytes(dataStore.getDataYaml())); streamOut.flush(); streamOut.close(); } catch (final Exception ex) { HandlerUtils.configureErrorResponse(response, HttpStatus.INTERNAL_SERVER_ERROR_500, ex.toString()); } ConsoleUtils.logOutgoingResponse(request.getRequestURI(), wrapper, NAME); } }
[ "azagniotov@gmail.com" ]
azagniotov@gmail.com
0f2697bf66727d44f3f5d752d4d87ccda8471342
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/neo4j/2016/12/CatchupGoalTrackerTest.java
19d2da37f0dde713c554615ef6747507108b078b
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
6,439
java
/* * Copyright (c) 2002-2016 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.causalclustering.core.consensus.membership; import org.junit.Test; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.neo4j.causalclustering.core.consensus.log.RaftLogCursor; import org.neo4j.causalclustering.core.consensus.log.ReadableRaftLog; import org.neo4j.causalclustering.core.consensus.roles.follower.FollowerState; import org.neo4j.time.Clocks; import org.neo4j.time.FakeClock; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class CatchupGoalTrackerTest { private static final long ROUND_TIMEOUT = 15; private static final long CATCHUP_TIMEOUT = 1_000; @Test public void shouldAchieveGoalIfWithinRoundTimeout() throws Exception { FakeClock clock = Clocks.fakeClock(); StubLog log = new StubLog(); log.setAppendIndex( 10 ); CatchupGoalTracker catchupGoalTracker = new CatchupGoalTracker( log, clock, ROUND_TIMEOUT, CATCHUP_TIMEOUT ); clock.forward( ROUND_TIMEOUT - 5, TimeUnit.MILLISECONDS ); catchupGoalTracker.updateProgress( new FollowerState().onSuccessResponse( 10 ) ); assertTrue( catchupGoalTracker.isGoalAchieved() ); assertTrue( catchupGoalTracker.isFinished() ); } @Test public void shouldNotAchieveGoalIfBeyondRoundTimeout() throws Exception { FakeClock clock = Clocks.fakeClock(); StubLog log = new StubLog(); log.setAppendIndex( 10 ); CatchupGoalTracker catchupGoalTracker = new CatchupGoalTracker( log, clock, ROUND_TIMEOUT, CATCHUP_TIMEOUT ); clock.forward( ROUND_TIMEOUT + 5, TimeUnit.MILLISECONDS ); catchupGoalTracker.updateProgress( new FollowerState().onSuccessResponse( 10 ) ); assertFalse( catchupGoalTracker.isGoalAchieved() ); assertFalse( catchupGoalTracker.isFinished() ); } @Test public void shouldFailToAchieveGoalDueToCatchupTimeoutExpiring() throws Exception { FakeClock clock = Clocks.fakeClock(); StubLog log = new StubLog(); log.setAppendIndex( 10 ); CatchupGoalTracker catchupGoalTracker = new CatchupGoalTracker( log, clock, ROUND_TIMEOUT, CATCHUP_TIMEOUT ); // when clock.forward( CATCHUP_TIMEOUT + 10, TimeUnit.MILLISECONDS ); catchupGoalTracker.updateProgress( new FollowerState().onSuccessResponse( 4 ) ); // then assertFalse( catchupGoalTracker.isGoalAchieved() ); assertTrue( catchupGoalTracker.isFinished() ); } @Test public void shouldFailToAchieveGoalDueToCatchupTimeoutExpiringEvenThoughWeDoEventuallyAchieveTarget() throws Exception { FakeClock clock = Clocks.fakeClock(); StubLog log = new StubLog(); log.setAppendIndex( 10 ); CatchupGoalTracker catchupGoalTracker = new CatchupGoalTracker( log, clock, ROUND_TIMEOUT, CATCHUP_TIMEOUT ); // when clock.forward( CATCHUP_TIMEOUT + 10, TimeUnit.MILLISECONDS ); catchupGoalTracker.updateProgress( new FollowerState().onSuccessResponse( 10 ) ); // then assertFalse( catchupGoalTracker.isGoalAchieved() ); assertTrue( catchupGoalTracker.isFinished() ); } @Test public void shouldFailToAchieveGoalDueToRoundExhaustion() throws Exception { FakeClock clock = Clocks.fakeClock(); StubLog log = new StubLog(); long appendIndex = 10; log.setAppendIndex( appendIndex ); CatchupGoalTracker catchupGoalTracker = new CatchupGoalTracker( log, clock, ROUND_TIMEOUT, CATCHUP_TIMEOUT ); for ( int i = 0; i < CatchupGoalTracker.MAX_ROUNDS; i++ ) { appendIndex += 10; log.setAppendIndex( appendIndex ); clock.forward( ROUND_TIMEOUT + 1, TimeUnit.MILLISECONDS ); catchupGoalTracker.updateProgress( new FollowerState().onSuccessResponse( appendIndex ) ); } // then assertFalse( catchupGoalTracker.isGoalAchieved() ); assertTrue( catchupGoalTracker.isFinished() ); } @Test public void shouldNotFinishIfRoundsNotExhausted() throws Exception { FakeClock clock = Clocks.fakeClock(); StubLog log = new StubLog(); long appendIndex = 10; log.setAppendIndex( appendIndex ); CatchupGoalTracker catchupGoalTracker = new CatchupGoalTracker( log, clock, ROUND_TIMEOUT, CATCHUP_TIMEOUT ); for ( int i = 0; i < CatchupGoalTracker.MAX_ROUNDS - 5; i++ ) { appendIndex += 10; log.setAppendIndex( appendIndex ); clock.forward( ROUND_TIMEOUT + 1, TimeUnit.MILLISECONDS ); catchupGoalTracker.updateProgress( new FollowerState().onSuccessResponse( appendIndex ) ); } // then assertFalse( catchupGoalTracker.isGoalAchieved() ); assertFalse( catchupGoalTracker.isFinished() ); } private class StubLog implements ReadableRaftLog { private long appendIndex; private void setAppendIndex( long index ) { this.appendIndex = index; } @Override public long appendIndex() { return appendIndex; } @Override public long prevIndex() { return 0; } @Override public long readEntryTerm( long logIndex ) throws IOException { return 0; } @Override public RaftLogCursor getEntryCursor( long fromIndex ) throws IOException { return RaftLogCursor.empty(); } } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
898aabe5382d806d0393a96f34a40a6cfbfa1ebd
a26190f2e4f847329ddadb48a95b4d52298e2e94
/app/src/main/java/com/example/osondutochi/mykiddiesquiz/ResultActivity.java
e484c13f714181504b5e4eb1b5a1496ee0b55d19
[]
no_license
tboy44wiz/MyKiddiesQuizApp
aafdbb422a483b460d4342e7e2d00950aabe27d0
ef452d2af40f4cf7720ceb9e503d9de3f33b8a91
refs/heads/master
2020-03-22T03:36:03.076627
2018-07-02T12:46:10
2018-07-02T12:46:10
139,356,613
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package com.example.osondutochi.mykiddiesquiz; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class ResultActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_result); } }
[ "you@example.com" ]
you@example.com
13dd90e2482cf7445f3b06d018428f6979c14396
8cd677717658d22b770d7baa728e00d9acf917c8
/src/main/java/basic/strings/Ex138_155/Task_155.java
bb449252644a61d0edcdc2bf17156f345e71623f
[]
no_license
hakobyan-1997/_ArmWorkBook_
0a252d33f505b7082a4aa1526a4c35ff57ca0220
542679f98df2445e7b36c095f1e3bd6d20b1e54b
refs/heads/master
2020-04-02T13:56:28.640689
2018-10-22T22:09:08
2018-10-22T22:09:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
880
java
package basic.strings.Ex138_155; public class Task_155 { public static void main(String[] args) { int n = 6; String string1 = "cvdecf"; //length = n char c = 'z'; boolean t = false; int count = 0; for( int i = 0; i < n; i++){ if(string1.charAt(i) > c){ t = true; break; } } if(t){ for( int i = 0; i < n; i++){ if(string1.charAt(i) == 'c'){ count ++; } } System.out.println("c paymananshanneri qanaky = "+count); }else{ for( int i = 0; i < n; i++){ if(string1.charAt(i) == 'd'){ count ++; } } System.out.println("d paymananshanneri qanaky = "+count); } } }
[ "araik.armenia@gmail.com" ]
araik.armenia@gmail.com
c30795ae64d8529f6f0c25aeee0e26177755b712
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_f9b85fc2a3113c7bdd751529f4d2fc27cf69a60a/LuaFunctionDefinitionStatementImpl/9_f9b85fc2a3113c7bdd751529f4d2fc27cf69a60a_LuaFunctionDefinitionStatementImpl_t.java
ad86968012f94fc262b41d047a8b4f0ed34da83d
[]
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
5,047
java
/* * Copyright 2010 Jon S Akhtar (Sylvanaar) * * 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.sylvanaar.idea.Lua.lang.psi.impl.statements; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.ResolveState; import com.intellij.psi.scope.PsiScopeProcessor; import com.sylvanaar.idea.Lua.lang.parser.LuaElementTypes; import com.sylvanaar.idea.Lua.lang.psi.expressions.LuaParameter; import com.sylvanaar.idea.Lua.lang.psi.expressions.LuaParameterList; import com.sylvanaar.idea.Lua.lang.psi.expressions.LuaVariable; import com.sylvanaar.idea.Lua.lang.psi.impl.expressions.LuaImpliedSelfParameterImpl; import com.sylvanaar.idea.Lua.lang.psi.statements.LuaBlock; import com.sylvanaar.idea.Lua.lang.psi.statements.LuaFunctionDefinitionStatement; import com.sylvanaar.idea.Lua.lang.psi.visitor.LuaElementVisitor; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** * Created by IntelliJ IDEA. * User: Jon S Akhtar * Date: Jun 10, 2010 * Time: 10:40:55 AM */ public class LuaFunctionDefinitionStatementImpl extends LuaStatementElementImpl implements LuaFunctionDefinitionStatement/*, PsiModifierList */ { private LuaParameterList parameters = null; private LuaVariable identifier = null; private LuaBlock block = null; private boolean definesSelf = false; public LuaFunctionDefinitionStatementImpl(ASTNode node) { super(node); assert getBlock() != null; } public void accept(LuaElementVisitor visitor) { visitor.visitFunctionDef(this); } public void accept(@NotNull PsiElementVisitor visitor) { if (visitor instanceof LuaElementVisitor) { ((LuaElementVisitor) visitor).visitFunctionDef(this); } else { visitor.visitElement(this); } } public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState resolveState, PsiElement lastParent, @NotNull PsiElement place) { if (lastParent != null && lastParent.getParent() == this) { final LuaParameter[] params = getParameters().getParameters(); for (LuaParameter param : params) { if (!processor.execute(param, resolveState)) return false; } LuaParameter self = findChildByClass(LuaImpliedSelfParameterImpl.class); if (self != null) { if (!processor.execute(self, resolveState)) return false; } } // // if (!getBlock().processDeclarations(processor, resolveState, lastParent, place)) // return false; // if (getIdentifier() == null || !getIdentifier().isLocal()) // return true; // if (!processor.execute(getIdentifier(), resolveState)) // return false; return true; } @Nullable @NonNls public String getName() { LuaVariable name = getIdentifier(); return name != null ? name.getText() : "anonymous"; } @Override public PsiElement setName(String s) { return null;//getIdentifier().setName(s); } @Override public LuaVariable getIdentifier() { if (identifier == null) { LuaVariable e = findChildByClass(LuaVariable.class); if (e != null) identifier = e; } return identifier; } @Override public LuaParameterList getParameters() { if (parameters == null) { PsiElement e = findChildByType(LuaElementTypes.PARAMETER_LIST); if (e != null) parameters = (LuaParameterList) e; } return parameters; } public LuaBlock getBlock() { if (block == null) { PsiElement e = findChildByType(LuaElementTypes.BLOCK); if (e != null) block = (LuaBlock) e; } return block; } @Override public String toString() { return "Function Declaration (" + getIdentifier() + ")"; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
a8bea8c007b8cf6b5391b14bf953396bf23b617e
3ab35f8af2058e822e060172c1213567a48f1fa4
/asis_sharel_files/shareL/sources/androidx/core/provider/SelfDestructiveThread.java
3e7e7ec8f21244f2be61b68867df997dde6d5ffd
[]
no_license
Voorivex/ctf
9aaf4e799e0ae47bb7959ffd830bd82f4a7e7b78
a0adad53cbdec169c72cf08c86fa481cd00918b6
refs/heads/master
2021-06-06T03:46:43.844696
2019-11-17T16:25:25
2019-11-17T16:25:25
222,276,972
3
0
null
null
null
null
UTF-8
Java
false
false
6,788
java
package androidx.core.provider; import android.os.Handler; import android.os.Handler.Callback; import android.os.HandlerThread; import android.os.Message; import androidx.annotation.GuardedBy; import androidx.annotation.RestrictTo; import androidx.annotation.RestrictTo.Scope; import androidx.annotation.VisibleForTesting; import java.util.concurrent.Callable; @RestrictTo({Scope.LIBRARY_GROUP_PREFIX}) public class SelfDestructiveThread { private static final int MSG_DESTRUCTION = 0; private static final int MSG_INVOKE_RUNNABLE = 1; private Callback mCallback = new Callback() { public boolean handleMessage(Message message) { int i = message.what; if (i == 0) { SelfDestructiveThread.this.onDestruction(); return true; } else if (i != 1) { return true; } else { SelfDestructiveThread.this.onInvokeRunnable((Runnable) message.obj); return true; } } }; private final int mDestructAfterMillisec; @GuardedBy("mLock") private int mGeneration; @GuardedBy("mLock") private Handler mHandler; private final Object mLock = new Object(); private final int mPriority; @GuardedBy("mLock") private HandlerThread mThread; private final String mThreadName; public interface ReplyCallback<T> { void onReply(T t); } public SelfDestructiveThread(String str, int i, int i2) { this.mThreadName = str; this.mPriority = i; this.mDestructAfterMillisec = i2; this.mGeneration = 0; } @VisibleForTesting public boolean isRunning() { boolean z; synchronized (this.mLock) { z = this.mThread != null; } return z; } @VisibleForTesting public int getGeneration() { int i; synchronized (this.mLock) { i = this.mGeneration; } return i; } private void post(Runnable runnable) { synchronized (this.mLock) { if (this.mThread == null) { this.mThread = new HandlerThread(this.mThreadName, this.mPriority); this.mThread.start(); this.mHandler = new Handler(this.mThread.getLooper(), this.mCallback); this.mGeneration++; } this.mHandler.removeMessages(0); this.mHandler.sendMessage(this.mHandler.obtainMessage(1, runnable)); } } public <T> void postAndReply(final Callable<T> callable, final ReplyCallback<T> replyCallback) { final Handler handler = new Handler(); post(new Runnable() { public void run() { final Object obj; try { obj = callable.call(); } catch (Exception unused) { obj = null; } handler.post(new Runnable() { public void run() { replyCallback.onReply(obj); } }); } }); } /* JADX WARNING: Can't wrap try/catch for region: R(5:9|10|11|12|(4:25|14|15|16)(1:17)) */ /* JADX WARNING: Missing exception handler attribute for start block: B:11:0x003f */ /* JADX WARNING: Removed duplicated region for block: B:17:0x004d */ /* JADX WARNING: Removed duplicated region for block: B:25:0x0045 A[SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. */ public <T> T postAndWait(java.util.concurrent.Callable<T> r13, int r14) throws java.lang.InterruptedException { /* r12 = this; java.util.concurrent.locks.ReentrantLock r7 = new java.util.concurrent.locks.ReentrantLock r7.<init>() java.util.concurrent.locks.Condition r8 = r7.newCondition() java.util.concurrent.atomic.AtomicReference r9 = new java.util.concurrent.atomic.AtomicReference r9.<init>() java.util.concurrent.atomic.AtomicBoolean r10 = new java.util.concurrent.atomic.AtomicBoolean r0 = 1 r10.<init>(r0) androidx.core.provider.SelfDestructiveThread$3 r11 = new androidx.core.provider.SelfDestructiveThread$3 r0 = r11 r1 = r12 r2 = r9 r3 = r13 r4 = r7 r5 = r10 r6 = r8 r0.<init>(r2, r3, r4, r5, r6) r12.post(r11) r7.lock() boolean r13 = r10.get() // Catch:{ all -> 0x005c } if (r13 != 0) goto L_0x0034 java.lang.Object r13 = r9.get() // Catch:{ all -> 0x005c } r7.unlock() return r13 L_0x0034: java.util.concurrent.TimeUnit r13 = java.util.concurrent.TimeUnit.MILLISECONDS // Catch:{ all -> 0x005c } long r0 = (long) r14 // Catch:{ all -> 0x005c } long r13 = r13.toNanos(r0) // Catch:{ all -> 0x005c } L_0x003b: long r13 = r8.awaitNanos(r13) // Catch:{ InterruptedException -> 0x003f } L_0x003f: boolean r0 = r10.get() // Catch:{ all -> 0x005c } if (r0 != 0) goto L_0x004d java.lang.Object r13 = r9.get() // Catch:{ all -> 0x005c } r7.unlock() return r13 L_0x004d: r0 = 0 int r2 = (r13 > r0 ? 1 : (r13 == r0 ? 0 : -1)) if (r2 <= 0) goto L_0x0054 goto L_0x003b L_0x0054: java.lang.InterruptedException r13 = new java.lang.InterruptedException // Catch:{ all -> 0x005c } java.lang.String r14 = "timeout" r13.<init>(r14) // Catch:{ all -> 0x005c } throw r13 // Catch:{ all -> 0x005c } L_0x005c: r13 = move-exception r7.unlock() throw r13 */ throw new UnsupportedOperationException("Method not decompiled: androidx.core.provider.SelfDestructiveThread.postAndWait(java.util.concurrent.Callable, int):java.lang.Object"); } /* access modifiers changed from: 0000 */ public void onInvokeRunnable(Runnable runnable) { runnable.run(); synchronized (this.mLock) { this.mHandler.removeMessages(0); this.mHandler.sendMessageDelayed(this.mHandler.obtainMessage(0), (long) this.mDestructAfterMillisec); } } /* access modifiers changed from: 0000 */ public void onDestruction() { synchronized (this.mLock) { if (!this.mHandler.hasMessages(1)) { this.mThread.quit(); this.mThread = null; this.mHandler = null; } } } }
[ "voorivex@tutanota.com" ]
voorivex@tutanota.com
1a5e99a7749af7c9699f4464bf062a4177caacc7
11dd29da2bad6d56e760a1ca6d03283524d04022
/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/InputDataStagingTask.java
7c329c60c09817d9380a8d7b8d8664a309b58d10
[ "Apache-2.0", "Plexus", "BSD-3-Clause", "LicenseRef-scancode-jdom", "BSD-2-Clause" ]
permissive
apache/airavata
6705d5735f56cc4d749a8f62139348cce80eaa09
ee036e22cf64d4338b90eed36147b8f3f7ee68e5
refs/heads/master
2023-08-31T18:00:30.186951
2023-08-24T16:28:08
2023-08-24T16:28:08
16,338,711
88
170
Apache-2.0
2023-08-12T19:27:33
2014-01-29T08:00:06
Java
UTF-8
Java
false
false
5,509
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.airavata.helix.impl.task.staging; import org.apache.airavata.agents.api.AgentAdaptor; import org.apache.airavata.agents.api.StorageResourceAdaptor; import org.apache.airavata.helix.impl.task.TaskContext; import org.apache.airavata.helix.impl.task.TaskOnFailException; import org.apache.airavata.helix.task.api.TaskHelper; import org.apache.airavata.helix.task.api.annotation.TaskDef; import org.apache.airavata.model.application.io.DataType; import org.apache.airavata.model.application.io.InputDataObjectType; import org.apache.airavata.model.status.ProcessState; import org.apache.airavata.model.task.DataStagingTaskModel; import org.apache.airavata.patform.monitoring.CountMonitor; import org.apache.helix.task.TaskResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URI; import java.net.URISyntaxException; @TaskDef(name = "Input Data Staging Task") public class InputDataStagingTask extends DataStagingTask { private final static Logger logger = LoggerFactory.getLogger(InputDataStagingTask.class); private final static CountMonitor inputDSTaskCounter = new CountMonitor("input_ds_task_counter"); @Override public TaskResult onRun(TaskHelper taskHelper, TaskContext taskContext) { logger.info("Starting Input Data Staging Task " + getTaskId()); inputDSTaskCounter.inc(); saveAndPublishProcessStatus(ProcessState.INPUT_DATA_STAGING); try { // Get and validate data staging task model DataStagingTaskModel dataStagingTaskModel = getDataStagingTaskModel(); // Fetch and validate input data type from data staging task model InputDataObjectType processInput = dataStagingTaskModel.getProcessInput(); if (processInput != null && processInput.getValue() == null) { String message = "expId: " + getExperimentId() + ", processId: " + getProcessId() + ", taskId: " + getTaskId() + ":- Couldn't stage file " + processInput.getName() + " , file name shouldn't be null. "; logger.error(message); if (processInput.isIsRequired()) { message += "File name is null, but this input's isRequired bit is not set"; } else { message += "File name is null"; } logger.error(message); throw new TaskOnFailException(message, true, null); } try { String[] sourceUrls; if (dataStagingTaskModel.getProcessInput().getType() == DataType.URI_COLLECTION) { logger.info("Found a URI collection so splitting by comma for path " + dataStagingTaskModel.getSource()); sourceUrls = dataStagingTaskModel.getSource().split(","); } else { sourceUrls = new String[]{dataStagingTaskModel.getSource()}; } // Fetch and validate storage adaptor StorageResourceAdaptor storageResourceAdaptor = getStorageAdaptor(taskHelper.getAdaptorSupport()); // Fetch and validate compute resource adaptor AgentAdaptor adaptor = getComputeResourceAdaptor(taskHelper.getAdaptorSupport()); for (String url : sourceUrls) { URI sourceURI = new URI(url); URI destinationURI = new URI(dataStagingTaskModel.getDestination()); logger.info("Source file " + sourceURI.getPath() + ", destination uri " + destinationURI.getPath() + " for task " + getTaskId()); transferFileToComputeResource(sourceURI.getPath(), destinationURI.getPath(), adaptor, storageResourceAdaptor); } } catch (URISyntaxException e) { throw new TaskOnFailException("Failed to obtain source URI for input data staging task " + getTaskId(), true, e); } return onSuccess("Input data staging task " + getTaskId() + " successfully completed"); } catch (TaskOnFailException e) { if (e.getError() != null) { logger.error(e.getReason(), e.getError()); } else { logger.error(e.getReason()); } return onFail(e.getReason(), e.isCritical(), e.getError()); } catch (Exception e) { logger.error("Unknown error while executing input data staging task " + getTaskId(), e); return onFail("Unknown error while executing input data staging task " + getTaskId(), false, e); } } @Override public void onCancel(TaskContext taskContext) { } }
[ "dimuthu.upeksha2@gmail.com" ]
dimuthu.upeksha2@gmail.com
a1f04063ea97d2c036a2273a129d2f8791189082
977e4cdedd721264cfeeeb4512aff828c7a69622
/ares.standard/src/main/java/cz/stuchlikova/ares/application/stub/standard/OdpovedOR.java
3cbebbc96a5e948b8c9c0e8749bd3ed33379c409
[]
no_license
PavlaSt/ares.standard
ed5b177ca7ca71173b7fa7490cf939f8c3e050fb
1d3a50fa4397a490cfb4414f7bd94d5dcac1a45e
refs/heads/main
2023-05-08T02:28:09.921215
2021-05-27T10:03:07
2021-05-27T10:03:07
346,669,475
0
0
null
null
null
null
UTF-8
Java
false
false
4,815
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0 // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2021.04.19 at 09:56:20 AM CEST // package cz.stuchlikova.ares.application.stub.standard; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for odpoved_OR complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="odpoved_OR"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="Pomocne_ID" type="{http://www.w3.org/2001/XMLSchema}int"/&gt; * &lt;element name="Error" type="{http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.1}error_ARES" minOccurs="0"/&gt; * &lt;element name="Vysledek_hledani" type="{http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.1}vysledek_hledani"/&gt; * &lt;element name="Pocet_zaznamu" type="{http://www.w3.org/2001/XMLSchema}int"/&gt; * &lt;element name="Vypis_OR" type="{http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.1}vypis_OR" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "odpoved_OR", namespace = "http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.1", propOrder = { "pomocneID", "error", "vysledekHledani", "pocetZaznamu", "vypisOR" }) public class OdpovedOR { @XmlElement(name = "Pomocne_ID") protected int pomocneID; @XmlElement(name = "Error") protected ErrorARES error; @XmlElement(name = "Vysledek_hledani", required = true) protected VysledekHledani vysledekHledani; @XmlElement(name = "Pocet_zaznamu") protected int pocetZaznamu; @XmlElement(name = "Vypis_OR") protected List<VypisOR> vypisOR; /** * Gets the value of the pomocneID property. * */ public int getPomocneID() { return pomocneID; } /** * Sets the value of the pomocneID property. * */ public void setPomocneID(int value) { this.pomocneID = value; } /** * Gets the value of the error property. * * @return * possible object is * {@link ErrorARES } * */ public ErrorARES getError() { return error; } /** * Sets the value of the error property. * * @param value * allowed object is * {@link ErrorARES } * */ public void setError(ErrorARES value) { this.error = value; } /** * Gets the value of the vysledekHledani property. * * @return * possible object is * {@link VysledekHledani } * */ public VysledekHledani getVysledekHledani() { return vysledekHledani; } /** * Sets the value of the vysledekHledani property. * * @param value * allowed object is * {@link VysledekHledani } * */ public void setVysledekHledani(VysledekHledani value) { this.vysledekHledani = value; } /** * Gets the value of the pocetZaznamu property. * */ public int getPocetZaznamu() { return pocetZaznamu; } /** * Sets the value of the pocetZaznamu property. * */ public void setPocetZaznamu(int value) { this.pocetZaznamu = value; } /** * Gets the value of the vypisOR 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 vypisOR property. * * <p> * For example, to add a new item, do as follows: * <pre> * getVypisOR().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link VypisOR } * * */ public List<VypisOR> getVypisOR() { if (vypisOR == null) { vypisOR = new ArrayList<VypisOR>(); } return this.vypisOR; } }
[ "pavla.p.novotna@seznam.cz" ]
pavla.p.novotna@seznam.cz
5481da90ca42095d0237f3ca87bcc72f405ed825
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t1_beam/Nicad_t1_beam2667.java
1a8ffb246661c7acd5f9012dec27772166f2b118
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
446
java
// clone pairs:8822:80% // 13570:beam/sdks/java/io/hadoop-common/src/main/java/org/apache/beam/sdk/io/hadoop/WritableCoder.java public class Nicad_t1_beam2667 { public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof WritableCoder)) { return false; } WritableCoder<?> that = (WritableCoder<?>) other; return Objects.equals(this.type, that.type); } }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
4fa9424b976aad4104543ef915ee3f35ad50a64a
ae9efe033a18c3d4a0915bceda7be2b3b00ae571
/jambeth/jambeth-server-helloworld/src/main/java/com/koch/ambeth/server/helloworld/security/HelloWorldAuthorizationManager.java
b06dedf769628f8d0ce339122c7cd9e4675cc611
[ "Apache-2.0" ]
permissive
Dennis-Koch/ambeth
0902d321ccd15f6dc62ebb5e245e18187b913165
8552b210b8b37d3d8f66bdac2e094bf23c8b5fda
refs/heads/develop
2022-11-10T00:40:00.744551
2017-10-27T05:35:20
2017-10-27T05:35:20
88,013,592
0
4
Apache-2.0
2022-09-22T18:02:18
2017-04-12T05:36:00
Java
UTF-8
Java
false
false
3,017
java
package com.koch.ambeth.server.helloworld.security; /*- * #%L * jambeth-server-helloworld * %% * Copyright (C) 2017 Koch Softwaredevelopment * %% * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. * #L% */ import java.util.regex.Pattern; import com.koch.ambeth.log.ILogger; import com.koch.ambeth.log.LogInstance; import com.koch.ambeth.security.IAuthenticationResult; import com.koch.ambeth.security.IAuthorization; import com.koch.ambeth.security.IAuthorizationManager; import com.koch.ambeth.security.IServicePermission; import com.koch.ambeth.security.PermissionApplyType; import com.koch.ambeth.security.server.AbstractAuthorization; import com.koch.ambeth.server.helloworld.service.IHelloWorldService; import com.koch.ambeth.service.model.ISecurityScope; import com.koch.ambeth.util.collections.HashMap; public class HelloWorldAuthorizationManager implements IAuthorizationManager { @LogInstance private ILogger log; protected final Pattern allowAllPattern = Pattern.compile(".*"); protected final Pattern denyForbiddenMethodPattern = Pattern.compile( IHelloWorldService.class.getName().replaceAll("\\.", "\\\\.") + "\\.forbiddenMethod"); @Override public IAuthorization authorize(String sid, ISecurityScope[] securityScopes, IAuthenticationResult authenticationResult) { // Allow all service methods final Pattern[] allowPatterns = new Pattern[] {allowAllPattern}; final Pattern[] denyPatterns = new Pattern[] {denyForbiddenMethodPattern}; final IServicePermission[] servicePermissions = new IServicePermission[] {new IServicePermission() { @Override public Pattern[] getPatterns() { return allowPatterns; } @Override public PermissionApplyType getApplyType() { return PermissionApplyType.ALLOW; } }, new IServicePermission() { @Override public Pattern[] getPatterns() { return denyPatterns; } @Override public PermissionApplyType getApplyType() { return PermissionApplyType.DENY; } }}; HashMap<ISecurityScope, IServicePermission[]> servicePermissionMap = new HashMap<>(); for (ISecurityScope securityScope : securityScopes) { servicePermissionMap.put(securityScope, servicePermissions); } return new AbstractAuthorization(servicePermissionMap, securityScopes, null, null, null, null, System.currentTimeMillis(), authenticationResult) { @Override public boolean isValid() { return false; } @Override public String getSID() { return null; } }; } }
[ "dennis.koch@bruker.com" ]
dennis.koch@bruker.com
4326f19199ba77da9697057e8f70ac5305a4efb5
1c53d5257ea7be9450919e6b9e0491944a93ba80
/merge-scenarios/netty/ef4ee49800-example-src-main-java-io-netty-example-http-snoop-HttpSnoopClient/left.java
16adf5aef3214b1f6d1c848a3ccd40756d1f5476
[]
no_license
anonyFVer/mastery-material
89062928807a1f859e9e8b9a113b2d2d123dc3f1
db76ee571b84be5db2d245f3b593b29ebfaaf458
refs/heads/master
2023-03-16T13:13:49.798374
2021-02-26T04:19:19
2021-02-26T04:19:19
342,556,129
0
0
null
null
null
null
UTF-8
Java
false
false
2,737
java
package io.netty.example.http.snoop; import io.netty.channel.Channel; import io.netty.channel.ChannelBootstrap; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.channel.socket.nio.NioEventLoop; import io.netty.handler.codec.http.CookieEncoder; import io.netty.handler.codec.http.DefaultHttpRequest; import io.netty.handler.codec.http.HttpHeaders; import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.HttpVersion; import java.net.InetSocketAddress; import java.net.URI; public class HttpSnoopClient { private final URI uri; public HttpSnoopClient(URI uri) { this.uri = uri; } public void run() throws Exception { String scheme = uri.getScheme() == null ? "http" : uri.getScheme(); String host = uri.getHost() == null ? "localhost" : uri.getHost(); int port = uri.getPort(); if (port == -1) { if (scheme.equalsIgnoreCase("http")) { port = 80; } else if (scheme.equalsIgnoreCase("https")) { port = 443; } } if (!scheme.equalsIgnoreCase("http") && !scheme.equalsIgnoreCase("https")) { System.err.println("Only HTTP(S) is supported."); return; } boolean ssl = scheme.equalsIgnoreCase("https"); ChannelBootstrap b = new ChannelBootstrap(); try { b.eventLoop(new NioEventLoop()).channel(new NioSocketChannel()).initializer(new HttpSnoopClientInitializer(ssl)).remoteAddress(new InetSocketAddress(host, port)); Channel ch = b.connect().sync().channel(); HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri.getRawPath()); request.setHeader(HttpHeaders.Names.HOST, host); request.setHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE); request.setHeader(HttpHeaders.Names.ACCEPT_ENCODING, HttpHeaders.Values.GZIP); CookieEncoder httpCookieEncoder = new CookieEncoder(false); httpCookieEncoder.addCookie("my-cookie", "foo"); httpCookieEncoder.addCookie("another-cookie", "bar"); request.setHeader(HttpHeaders.Names.COOKIE, httpCookieEncoder.encode()); ch.write(request); ch.closeFuture().sync(); } finally { b.shutdown(); } } public static void main(String[] args) throws Exception { if (args.length != 1) { System.err.println("Usage: " + HttpSnoopClient.class.getSimpleName() + " <URL>"); return; } URI uri = new URI(args[0]); new HttpSnoopClient(uri).run(); } }
[ "namasikanam@gmail.com" ]
namasikanam@gmail.com
1f3db57ac9006073f776058b70b15388cd9a095a
04f00b16a59397e7a2e0529a07df4c71c96baaaf
/src/csv/util/validator/BaseValidator.java
d2332332d33f000f8be69a72d69c5939510aee1e
[]
no_license
fatihalgan/CSV2
84fed95fb22ff99d26c4f83325990048f88ab2ce
f6dce800ed5dacf8b9f276444bee2ef03a5cd098
refs/heads/master
2020-12-31T04:28:26.961178
2016-04-21T14:55:48
2016-04-21T14:55:48
56,343,667
0
0
null
null
null
null
UTF-8
Java
false
false
2,743
java
package csv.util.validator; import java.util.Locale; import java.util.ResourceBundle; import java.util.regex.Pattern; import javax.faces.context.FacesContext; import csv.util.validator.exception.ValidateException; public class BaseValidator { public static String getMessage(String key){ FacesContext context = FacesContext.getCurrentInstance(); try{ String result = ResourceBundle.getBundle(context.getApplication().getMessageBundle(),context.getViewRoot().getLocale()).getString(key); if(isNullOrBlank(result)) result = ResourceBundle.getBundle(context.getApplication().getMessageBundle(),new Locale("en")).getString(key); return result; }catch(Exception e){ try{ return ResourceBundle.getBundle(context.getApplication().getMessageBundle(),new Locale("en")).getString(key); }catch(Exception e2){ return "Validation message could not be found for the key===="+key; } } } public static boolean isNullOrBlank(String str){ return null==str || "".equals(str.trim()); } public static boolean isNullOrZero(Integer i){ return null==i || 0==i.intValue(); } public static boolean isNullOrZero(Long l){ return null==l || 0==l.intValue(); } public static void checkText(String str) throws ValidateException { checkText(str,0); } public static String checkText(String str,int maxLength) throws ValidateException { if(isNullOrBlank(str)){ throw new ValidateException(getMessage("errorNoReasonValue")); } if(maxLength!=0 && str.length()>maxLength){ throw new ValidateException(getMessage("errorMaxLengthExceeded")); } String result = str.replaceAll("\n", " "); String regex = "[\\w. ,]*";//"[a-zA-Z_0-9]*"; if(!Pattern.matches(regex, result)){ throw new ValidateException(getMessage("errorInvalidCharacter")); } return result; } public static void checkEmailFormat(String email) throws ValidateException{ if(isNullOrBlank(email))return; String regex = "[\\w][\\w.]*[@][\\w][\\w]*[.][\\w][\\w.]*"; if(!Pattern.matches(regex, email)){ throw new ValidateException(getMessage("errorInvalidEmail")); } } public static void validateMsisdn(String prefix,String msisdn) throws ValidateException { if(isNullOrBlank(prefix) || isNullOrBlank(msisdn) || !prefix.matches("[+]*[0-9]*") || !msisdn.matches("[0-9^]{7}")) { throw new ValidateException(getMessage("errorIncorrectMsisdnFormat")); } } public static void validateMsisdn(String msisdn) throws ValidateException{ if((msisdn.startsWith("25882") || msisdn.startsWith("25883")) && msisdn.length() > 7) validateMsisdn(msisdn.substring(0, 5), msisdn.substring(5)); validateMsisdn("25882",msisdn); } }
[ "fatih.algan@gmail.com" ]
fatih.algan@gmail.com
6bb2e54ebb71e4957b15c6bb1aaa23f478be6cf4
b26d0ac0846fc13080dbe3c65380cc7247945754
/src/main/java/imports/aws/CloudfrontDistributionOriginGroupMember.java
c4ad6579ac87310602056b59fde3e8ac1ee0671b
[]
no_license
nvkk-devops/cdktf-java-aws
1431404f53df8de517f814508fedbc5810b7bce5
429019d87fc45ab198af816d8289dfe1290cd251
refs/heads/main
2023-03-23T22:43:36.539365
2021-03-11T05:17:09
2021-03-11T05:17:09
346,586,402
0
0
null
null
null
null
UTF-8
Java
false
false
4,420
java
package imports.aws; @javax.annotation.Generated(value = "jsii-pacmak/1.24.0 (build b722f66)", date = "2021-03-10T09:47:02.125Z") @software.amazon.jsii.Jsii(module = imports.aws.$Module.class, fqn = "aws.CloudfrontDistributionOriginGroupMember") @software.amazon.jsii.Jsii.Proxy(CloudfrontDistributionOriginGroupMember.Jsii$Proxy.class) public interface CloudfrontDistributionOriginGroupMember extends software.amazon.jsii.JsiiSerializable { @org.jetbrains.annotations.NotNull java.lang.String getOriginId(); /** * @return a {@link Builder} of {@link CloudfrontDistributionOriginGroupMember} */ static Builder builder() { return new Builder(); } /** * A builder for {@link CloudfrontDistributionOriginGroupMember} */ public static final class Builder implements software.amazon.jsii.Builder<CloudfrontDistributionOriginGroupMember> { private java.lang.String originId; /** * Sets the value of {@link CloudfrontDistributionOriginGroupMember#getOriginId} * @param originId the value to be set. This parameter is required. * @return {@code this} */ public Builder originId(java.lang.String originId) { this.originId = originId; return this; } /** * Builds the configured instance. * @return a new instance of {@link CloudfrontDistributionOriginGroupMember} * @throws NullPointerException if any required attribute was not provided */ @Override public CloudfrontDistributionOriginGroupMember build() { return new Jsii$Proxy(originId); } } /** * An implementation for {@link CloudfrontDistributionOriginGroupMember} */ @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CloudfrontDistributionOriginGroupMember { private final java.lang.String originId; /** * Constructor that initializes the object based on values retrieved from the JsiiObject. * @param objRef Reference to the JSII managed object. */ protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); this.originId = software.amazon.jsii.Kernel.get(this, "originId", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * Constructor that initializes the object based on literal property values passed by the {@link Builder}. */ protected Jsii$Proxy(final java.lang.String originId) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); this.originId = java.util.Objects.requireNonNull(originId, "originId is required"); } @Override public final java.lang.String getOriginId() { return this.originId; } @Override @software.amazon.jsii.Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); data.set("originId", om.valueToTree(this.getOriginId())); final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("aws.CloudfrontDistributionOriginGroupMember")); struct.set("data", data); final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); obj.set("$jsii.struct", struct); return obj; } @Override public final boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CloudfrontDistributionOriginGroupMember.Jsii$Proxy that = (CloudfrontDistributionOriginGroupMember.Jsii$Proxy) o; return this.originId.equals(that.originId); } @Override public final int hashCode() { int result = this.originId.hashCode(); return result; } } }
[ "venkata.nidumukkala@emirates.com" ]
venkata.nidumukkala@emirates.com
b5844baba741c9da48fa11778158983e64791eaf
fb3f91fb6c18bb93c5d51b58d13e201203833994
/Desarrollo/Otros/facturaelectronica/Desarrollo/Sources/InvoiceElecParent/InvoiceElecUtil/src/main/java/oasis/names/specification/ubl/schema/xsd/commonbasiccomponents_2/OrganizationDepartmentType.java
4f77779d81a1c975757f4301a8354d357d8ae03d
[]
no_license
cgb-extjs-gwt/avgust-extjs-generator
d24241e594078eb8af8e33e99be64e56113a1c0c
30677d1fef4da73e2c72b6c6dfca85d492e1a385
refs/heads/master
2023-07-20T04:39:13.928605
2018-01-16T18:17:23
2018-01-16T18:17:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,261
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: 2018.01.12 at 10:42:45 PM PET // package oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_2; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; import un.unece.uncefact.data.specification.unqualifieddatatypesschemamodule._2.TextType; /** * <p>Java class for OrganizationDepartmentType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="OrganizationDepartmentType"> * &lt;simpleContent> * &lt;extension base="&lt;urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2>TextType"> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OrganizationDepartmentType") public class OrganizationDepartmentType extends TextType { }
[ "raffo8924@gmail.com" ]
raffo8924@gmail.com
c85b163f5386da6720ed056082215d7812dbe364
20eb62855cb3962c2d36fda4377dfd47d82eb777
/IntroClassJava/dataset/median/fcf701e8bed9c75a4cc52a990a577eb0204d7aadf138a4cad08726a847d66e77126f95f06f839ec9224b7e8a887b873fe0d4b6f4311b4e8bd2a36e5028d1feca/000/mutations/67/median_fcf701e8_000.java
6110ae1ae39d05e86a8a7d36131d78a78fd37418
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,562
java
package introclassJava; class IntObj { public int value; public IntObj () { } public IntObj (int i) { value = i; } } class FloatObj { public float value; public FloatObj () { } public FloatObj (float i) { value = i; } } class LongObj { public long value; public LongObj () { } public LongObj (long i) { value = i; } } class DoubleObj { public double value; public DoubleObj () { } public DoubleObj (double i) { value = i; } } class CharObj { public char value; public CharObj () { } public CharObj (char i) { value = i; } } public class median_fcf701e8_000 { public java.util.Scanner scanner; public String output = ""; public static void main (String[]args) throws Exception { median_fcf701e8_000 mainClass = new median_fcf701e8_000 (); String output; if (args.length > 0) { mainClass.scanner = new java.util.Scanner (args[0]); } else { mainClass.scanner = new java.util.Scanner (System.in); } mainClass.exec (); System.out.println (mainClass.output); } public void exec () throws Exception { IntObj a = new IntObj (), b = new IntObj (), c = new IntObj (); output += (String.format ("Please enter three integers separated by spaces > ")); a.value = scanner.nextInt (); b.value = scanner.nextInt (); c.value = scanner.nextInt (); while (a.value < b.value && a.value < c.value) { if (b.value < c.value) { output += (String.format ("%d is the median\n", b.value)); break; } else { output += (String.format ("%d is the median\n", c.value)); break; } } while (b.value < a.value && c.value < c.value) { if (a.value < c.value) { output += (String.format ("%d is the median\n", a.value)); break; } else { output += (String.format ("%d is the median\n", c.value)); break; } } while (c.value < a.value && c.value < b.value) { if (b.value < a.value) { output += (String.format ("%d is the median\n", b.value)); break; } else { output += (String.format ("%d is the median\n", a.value)); break; } } if (true) return;; } }
[ "justinwm@163.com" ]
justinwm@163.com
a9712af5c4493f00c67df1780e8f342989b17262
f7a66a51d12a562e01006415310e47a395a64307
/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pattern/CpcStable.java
fc6a8db99c947613c07cd0f9cfc58cd9c656aec4
[]
no_license
jabogithub/r-causal
4b550701fec57b666eea2db2a610b024ad50ff68
8d2b1783945998aa9d470a90d2d9442465682037
refs/heads/master
2020-07-08T09:37:51.907947
2019-03-14T15:38:02
2019-03-14T15:38:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,949
java
package edu.cmu.tetrad.algcomparison.algorithm.oracle.pattern; import edu.cmu.tetrad.algcomparison.algorithm.Algorithm; import edu.cmu.tetrad.algcomparison.independence.IndependenceWrapper; import edu.cmu.tetrad.algcomparison.utils.HasKnowledge; import edu.cmu.tetrad.algcomparison.utils.TakesIndependenceWrapper; import edu.cmu.tetrad.data.DataModel; import edu.cmu.tetrad.data.DataSet; import edu.cmu.tetrad.data.DataType; import edu.cmu.tetrad.data.IKnowledge; import edu.cmu.tetrad.data.Knowledge2; import edu.cmu.tetrad.graph.EdgeListGraph; import edu.cmu.tetrad.graph.Graph; import edu.cmu.tetrad.search.PcAll; import edu.cmu.tetrad.search.SearchGraphUtils; import edu.cmu.tetrad.util.Parameters; import edu.pitt.dbmi.algo.resampling.GeneralResamplingTest; import edu.pitt.dbmi.algo.resampling.ResamplingEdgeEnsemble; import java.util.List; /** * PC. * * @author jdramsey */ public class CpcStable implements Algorithm, HasKnowledge, TakesIndependenceWrapper { static final long serialVersionUID = 23L; private IndependenceWrapper test; private Algorithm algorithm = null; private IKnowledge knowledge = new Knowledge2(); public CpcStable() { } public CpcStable(IndependenceWrapper test) { this.test = test; } public CpcStable(IndependenceWrapper test, Algorithm algorithm) { this.test = test; this.algorithm = algorithm; } @Override public Graph search(DataModel dataSet, Parameters parameters) { if (parameters.getInt("numberResampling") < 1) { Graph init = null; if (algorithm != null) { // init = algorithm.search(dataSet, parameters); } PcAll search = new PcAll(test.getTest(dataSet, parameters), init); search.setDepth(parameters.getInt("depth")); search.setKnowledge(knowledge); search.setFasType(edu.cmu.tetrad.search.PcAll.FasType.STABLE); search.setConcurrent(edu.cmu.tetrad.search.PcAll.Concurrent.NO); search.setColliderDiscovery(edu.cmu.tetrad.search.PcAll.ColliderDiscovery.CONSERVATIVE); search.setConflictRule(edu.cmu.tetrad.search.PcAll.ConflictRule.PRIORITY); search.setVerbose(parameters.getBoolean("verbose")); return search.search(); } else { CpcStable cpcStable = new CpcStable(test, algorithm); DataSet data = (DataSet) dataSet; GeneralResamplingTest search = new GeneralResamplingTest(data, cpcStable, parameters.getInt("numberResampling")); search.setKnowledge(knowledge); search.setPercentResampleSize(parameters.getDouble("percentResampleSize")); search.setResamplingWithReplacement(parameters.getBoolean("resamplingWithReplacement")); ResamplingEdgeEnsemble edgeEnsemble = ResamplingEdgeEnsemble.Highest; switch (parameters.getInt("resamplingEnsemble", 1)) { case 0: edgeEnsemble = ResamplingEdgeEnsemble.Preserved; break; case 1: edgeEnsemble = ResamplingEdgeEnsemble.Highest; break; case 2: edgeEnsemble = ResamplingEdgeEnsemble.Majority; } search.setEdgeEnsemble(edgeEnsemble); search.setAddOriginalDataset(parameters.getBoolean("addOriginalDataset")); search.setParameters(parameters); search.setVerbose(parameters.getBoolean("verbose")); return search.search(); } } @Override public Graph getComparisonGraph(Graph graph) { return SearchGraphUtils.patternForDag(new EdgeListGraph(graph)); } @Override public String getDescription() { return "CPC-Stable (Conservative \"Peter and Clark\" Stable), Priority Rule, using " + test.getDescription(); } @Override public DataType getDataType() { return test.getDataType(); } @Override public List<String> getParameters() { List<String> parameters = test.getParameters(); parameters.add("depth"); // Resampling parameters.add("numberResampling"); parameters.add("percentResampleSize"); parameters.add("resamplingWithReplacement"); parameters.add("resamplingEnsemble"); parameters.add("addOriginalDataset"); parameters.add("verbose"); return parameters; } @Override public IKnowledge getKnowledge() { return knowledge; } @Override public void setKnowledge(IKnowledge knowledge) { this.knowledge = knowledge; } @Override public void setIndependenceWrapper(IndependenceWrapper independenceWrapper) { this.test = independenceWrapper; } @Override public IndependenceWrapper getIndependenceWrapper() { return test; } }
[ "chirayu.kong@gmail.com" ]
chirayu.kong@gmail.com
ee0bf2675dde8e4e5c93892948c0b6c0fc71ef6e
8c86cdf81703d2543c9527f79a8ca93518e403a1
/src/main/java/ua/helpdesk/entity/converter/UserTypeConverter.java
086be35cc5c33193711ef55c92324b74eb5777cd
[]
no_license
AnGo84/HelpDesk
2ce22bab23118bd7d82f8abcc7d8dfb93e6802ae
16e33130e13e8e48391587c4b7131d2997dad53c
refs/heads/master
2022-09-26T00:48:11.658420
2021-02-23T22:00:45
2021-02-23T22:00:45
138,514,788
1
1
null
2022-09-22T19:37:39
2018-06-24T20:56:34
Java
UTF-8
Java
false
false
662
java
package ua.helpdesk.entity.converter; import ua.helpdesk.entity.UserType; import javax.persistence.AttributeConverter; import javax.persistence.Converter; import java.util.stream.Stream; @Converter public class UserTypeConverter implements AttributeConverter<UserType, Long> { @Override public Long convertToDatabaseColumn(UserType userType) { if (userType == null) { return null; } return userType.getDbIndex(); } @Override public UserType convertToEntityAttribute(Long aLong) { return Stream.of(UserType.values()).filter(el -> el.getDbIndex().equals(aLong)).findFirst().orElse(null); } }
[ "ango1984@gmail.com" ]
ango1984@gmail.com
4e28860a19e6003524c9f4f195c3a7b6fd6de0ec
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Math-1/org.apache.commons.math3.fraction.BigFraction/BBC-F0-opt-60/tests/23/org/apache/commons/math3/fraction/BigFraction_ESTest_scaffolding.java
3ea611003c44832f2d13318d3e98cf9441a2be3b
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
6,161
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Oct 23 11:03:36 GMT 2021 */ package org.apache.commons.math3.fraction; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class BigFraction_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math3.fraction.BigFraction"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { /*No java.lang.System property to set*/ } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(BigFraction_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math3.fraction.BigFractionField", "org.apache.commons.math3.exception.util.ExceptionContextProvider", "org.apache.commons.math3.fraction.BigFraction", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.util.FastMath$ExpIntTable", "org.apache.commons.math3.util.FastMath$lnMant", "org.apache.commons.math3.exception.NotPositiveException", "org.apache.commons.math3.exception.MathIllegalStateException", "org.apache.commons.math3.util.FastMath$ExpFracTable", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.util.MathUtils", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.exception.ZeroException", "org.apache.commons.math3.exception.ConvergenceException", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.FieldElement", "org.apache.commons.math3.exception.util.Localizable", "org.apache.commons.math3.fraction.FractionConversionException", "org.apache.commons.math3.util.ArithmeticUtils", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.Field", "org.apache.commons.math3.exception.NotFiniteNumberException", "org.apache.commons.math3.util.FastMathLiteralArrays", "org.apache.commons.math3.fraction.BigFractionField$LazyHolder" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(BigFraction_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.util.MathUtils", "org.apache.commons.math3.fraction.BigFraction", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.util.FastMathLiteralArrays", "org.apache.commons.math3.util.FastMath$lnMant", "org.apache.commons.math3.util.FastMath$ExpIntTable", "org.apache.commons.math3.util.FastMath$ExpFracTable", "org.apache.commons.math3.fraction.BigFractionField", "org.apache.commons.math3.fraction.BigFractionField$LazyHolder", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.util.ArithmeticUtils", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.exception.ZeroException", "org.apache.commons.math3.exception.MathIllegalStateException", "org.apache.commons.math3.exception.ConvergenceException", "org.apache.commons.math3.fraction.FractionConversionException" ); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
5cd8e77f59a8e428d9b9735b2aed5584d8e670bd
5f6731d38e7b2892860b791473e19f75ff2cba4e
/huffman/AlgAnimApp.java
f9ead8731329693aa645394eb2891e56a29af4ff
[]
no_license
kenzhaoyihui/java_algr
18b1f493a32e810281d1ff8d21c4e52b1711056e
5848a169d5adc1cfd42b5b4b4a72292ec92fea41
refs/heads/master
2020-03-22T17:13:26.249637
2018-07-10T05:36:43
2018-07-10T05:36:43
140,381,836
1
0
null
null
null
null
UTF-8
Java
false
false
1,037
java
/* AlgAnimApp.java */ import java.awt.*; import java.applet.*; import java.io.*; import java.net.*; public class AlgAnimApp extends Applet { static String fn_label = "filename"; static String button_label = "buttonname"; URL homeURL, sourceURL; Button start_button; public void init() { setBackground( Color.white ); String file_name = this.getParameter(fn_label); homeURL = getCodeBase(); try { sourceURL = new URL( homeURL, file_name ); } catch( IOException e ) { System.out.println("URL error " + file_name ); } start_button = new Button(getParameter(button_label)); add(start_button); validate(); } // init() public boolean action(Event e, Object arg) { Object target = e.target; if (target == start_button) { start_button.disable(); new AlgAnimFrame(this, sourceURL); return true; } return false; } // action() } // class AlgAnimApp
[ "yzhao@redhat.com" ]
yzhao@redhat.com
825cf59c5f572dc728fdc018000bd189887bb391
53bfbc906687f17e62af1ebac773d0c892cb0ccd
/app/src/main/java/com/ch/goods/app/http/ResponseData.java
4769fbd849e576edbd145a1b478b1201193dd616
[]
no_license
chenghui-0829/GoodsApp
85aee5815b98e52e1a7ff40fe3ec3ad56d67a7e1
d69c269819a198d2c869c41ac5c4143757e1b149
refs/heads/master
2022-05-28T02:53:44.441784
2020-04-26T12:22:37
2020-04-26T12:22:37
258,800,432
0
0
null
null
null
null
UTF-8
Java
false
false
616
java
package com.ch.goods.app.http; /** * Created by CH on 2018/4/2. */ public class ResponseData { private String Status; private String Description; private String Data; public String getStatus() { return Status; } public void setStatus(String status) { Status = status; } public String getDescription() { return Description; } public void setDescription(String description) { Description = description; } public String getData() { return Data; } public void setData(String data) { Data = data; } }
[ "11" ]
11
08cb6a203fda0deb6319b4abde476a933fcc7e1a
5e3c7a857ba1c063e81a4203b32e7fdc7c3fa479
/src/org/springframework/aop/config/AdvisorEntry.java
84bcd5ea307976b8d2ff7fc73adb2e5fd6fa9621
[]
no_license
vsmysee/spring2.0
34f42220dfa68f78817449bf8b37b91e9a153655
7e2aef9127df31b4c4a05186a219293a29d374d1
refs/heads/main
2023-07-13T05:06:13.526029
2021-08-28T14:38:16
2021-08-28T14:38:16
343,822,474
0
1
null
null
null
null
UTF-8
Java
false
false
1,196
java
/* * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.aop.config; import org.springframework.beans.factory.parsing.ParseState; /** * {@link ParseState} entry representing an advisor. * * @author Mark Fisher * @since 2.0 */ public class AdvisorEntry implements ParseState.Entry { private final String name; /** * Creates a new instance of the {@link org.springframework.aop.config.AdvisorEntry} class. * @param name the bean name of the advisor */ public AdvisorEntry(String name) { this.name = name; } public String toString() { return "Advisor '" + this.name + "'"; } }
[ "vsmysee@gmail.com" ]
vsmysee@gmail.com
01d0cf896b2b5fc00380fb621f8b1a83f4c7bc1d
659e20db34fb48152323f1390b86c2ab7a368000
/util/Util/powerLaw/util/AbstractGenerator.java
6e7b5b3c56dcd5fd903f1bbcf794bdfd0469ad9a
[]
no_license
yongquanf/GdeltMiner
8bd82e6612a79985ba8fe31be78cab1460f8ff40
979c1b79badaa1f9945306fddc54e24efb3f76e1
refs/heads/main
2023-01-02T07:27:48.502836
2020-10-22T14:40:00
2020-10-22T14:40:00
305,691,185
2
0
null
null
null
null
UTF-8
Java
false
false
323
java
package util.Util.powerLaw.util; import java.util.ArrayList; import java.util.List; public abstract class AbstractGenerator<P> implements Generator<P> { @Override public List<P> generate(int n) { List<P> points = new ArrayList<P>(n); for(int i = 0; i < n; i++) points.add(generate()); return points; } }
[ "quanyongf@126.com" ]
quanyongf@126.com
78e2b03ea4d4a9fc99843494ca7eafda7817c1b1
1cf1c4e00c4b7b2972d8c0b32b02a17e363d31b9
/sources/com/google/android/gms/internal/ads/abj.java
57e72f459c0a5fdfa0e73e70a9195b3986de8f4a
[]
no_license
rootmelo92118/analysis
4a66353c77397ea4c0800527afac85e06165fd48
a9cd8bb268f54c03630de8c6bdff86b0e068f216
refs/heads/main
2023-03-16T10:59:50.933761
2021-03-05T05:36:43
2021-03-05T05:36:43
344,705,815
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package com.google.android.gms.internal.ads; import java.util.concurrent.Callable; import java.util.concurrent.Executor; import java.util.concurrent.FutureTask; import javax.annotation.Nullable; @C1598qn final class abj<V> extends FutureTask<V> implements abg<V> { /* renamed from: a */ private final abh f1312a = new abh(); abj(Callable<V> callable) { super(callable); } abj(Runnable runnable, @Nullable V v) { super(runnable, v); } /* renamed from: a */ public final void mo10059a(Runnable runnable, Executor executor) { this.f1312a.mo10074a(runnable, executor); } /* access modifiers changed from: protected */ public final void done() { this.f1312a.mo10073a(); } }
[ "rootmelo92118@gmail.com" ]
rootmelo92118@gmail.com
7d439bcbfdacf1d8aad939c4c4f8967e1a9876e5
40dd2c2ba934bcbc611b366cf57762dcb14c48e3
/RI_Stack/java/test/base/org/dvb/test/DVBTestTest.java
3d0a77fdf6a123a042685adc6f249a6579262b26
[]
no_license
amirna2/OCAP-RI
afe0d924dcf057020111406b1d29aa2b3a796e10
254f0a8ebaf5b4f09f4a7c8f4961e9596c49ccb7
refs/heads/master
2020-03-10T03:22:34.355822
2018-04-11T23:08:49
2018-04-11T23:08:49
129,163,048
0
0
null
null
null
null
UTF-8
Java
false
false
6,485
java
// COPYRIGHT_BEGIN // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER // // Copyright (C) 2008-2013, Cable Television Laboratories, Inc. // // This software is available under multiple licenses: // // (1) BSD 2-clause // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // ·Redistributions of source code must retain the above copyright notice, this list // of conditions and the following disclaimer. // ·Redistributions in binary form must reproduce the above copyright notice, this list of conditions // and the following disclaimer in the documentation and/or other materials provided with the // distribution. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // (2) GPL Version 2 // 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, version 2. 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, see<http:www.gnu.org/licenses/>. // // (3)CableLabs License // If you or the company you represent has a separate agreement with CableLabs // concerning the use of this code, your rights and obligations with respect // to this code shall be as set forth therein. No license is granted hereunder // for any other purpose. // // Please contact CableLabs if you need additional information or // have any questions. // // CableLabs // 858 Coal Creek Cir // Louisville, CO 80027-9750 // 303 661-9100 // COPYRIGHT_END package org.dvb.test; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.cablelabs.test.TestUtils; import java.io.IOException; /** * Tests org.dvb.test.DVBTest * * @author Aaron Kamienski * @author Brent Thompson * @author Arlis Dodson */ public class DVBTestTest extends TestCase { private final String m_id = "TestCaseID"; private final String m_msg = "Canned message"; private final int m_num = 1313; /** * Tests public fields. */ public void testFields() { TestUtils.testNoPublicFields(DVBTest.class); TestUtils.testNoAddedFields(DVBTest.class, fieldNames); TestUtils.testFieldValues(DVBTest.class, fieldNames, fieldValues); } /** * Tests that log(String,String) throws IOException */ public void testLog1() throws Exception { try { DVBTest.log(m_id, m_msg); fail("No Exception thrown by DVBTest.log(String,String)"); } catch (Exception e) { assertTrue("Wrong Exception thrown: " + e.getMessage(), e instanceof IOException); } } /** * Tests that log(String,int) throws IOException */ public void testLog2() throws Exception { try { DVBTest.log(m_id, m_num); fail("No Exception thrown by DVBTest.log(String,int)"); } catch (Exception e) { assertTrue("Wrong Exception thrown: " + e.getMessage(), e instanceof IOException); } } /** * Tests that prompt(String,int,String) throws IOException */ public void testPrompt() throws Exception { try { DVBTest.prompt(m_id, m_num, m_msg); fail("No Exception thrown by DVBTest.prompt(String,int,String)"); } catch (Exception e) { assertTrue("Wrong Exception thrown: " + e.getMessage(), e instanceof IOException); } } /** * Tests that terminate(String,int) throws IOException */ public void testTerminate() throws Exception { int[] termConds = { DVBTest.PASS, DVBTest.FAIL, DVBTest.OPTION_UNSUPPORTED, DVBTest.HUMAN_INTERVENTION, DVBTest.UNRESOLVED, DVBTest.UNTESTED, -999 }; for (int i = 0; i < termConds.length; ++i) { int cond = termConds[i]; try { DVBTest.terminate(m_id, cond); fail("No exception thrown by DVBTest.terminate(String," + cond + ")"); } catch (Exception e) { assertTrue("Wrong Exception thrown: " + e.getMessage(), e instanceof IOException); } } } /** * Names of public static fields. */ private static final String[] fieldNames = { "PASS", "FAIL", "OPTION_UNSUPPORTED", "HUMAN_INTERVENTION", "UNRESOLVED", "UNTESTED" }; /** * Expected values of public static fields. */ private static final int[] fieldValues = { 0, -1, -2, -3, -4, -5 }; public static void main(String[] args) { try { junit.textui.TestRunner.run(suite()); } catch (Exception e) { e.printStackTrace(); } System.exit(0); } public static Test suite() { TestSuite suite = new TestSuite(DVBTestTest.class); return suite; } public DVBTestTest(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } }
[ "amir.nathoo@ubnt.com" ]
amir.nathoo@ubnt.com
bf293434ba2f988fe6ae64e86f73ac7bf0348c47
0a3095b238b3cf906a29dbdbd9d6d360e01748ad
/webtack/jsinterop-generator/src/test/fixtures/java_keyword_names/output/gwt/main/java/com/example/MyDictionary1.java
b9f93cc38e0c2290550237d0fad120b17078b04a
[ "Apache-2.0" ]
permissive
akasha/akasha
ca5e3c63384eff0178bbbeea7dbe79325a85cd94
4f44423952a404d951a899c4c7055bef547069d8
refs/heads/master
2023-08-16T07:04:16.446671
2023-08-14T12:13:19
2023-08-14T12:13:19
245,569,208
24
2
null
null
null
null
UTF-8
Java
false
false
6,821
java
package com.example; import javax.annotation.Generated; import javax.annotation.Nonnull; import jsinterop.annotations.JsNonNull; import jsinterop.annotations.JsOverlay; import jsinterop.annotations.JsPackage; import jsinterop.annotations.JsProperty; import jsinterop.annotations.JsType; import jsinterop.base.Js; import jsinterop.base.JsPropertyMap; @Generated("org.realityforge.webtack") @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) public interface MyDictionary1 { @JsOverlay @Nonnull static Step1 clone(@Nonnull final Object clone) { final MyDictionary1 $myDictionary1 = Js.<MyDictionary1>uncheckedCast( JsPropertyMap.of() ); $myDictionary1.setClone( clone ); return Js.uncheckedCast( $myDictionary1 ); } @JsProperty( name = "clone" ) @JsNonNull Object clone_(); @JsProperty void setClone(@JsNonNull Object clone); @JsProperty( name = "default" ) @JsNonNull Object default_(); @JsProperty void setDefault(@JsNonNull Object default_); @JsProperty( name = "equals" ) @JsNonNull Object equals_(); @JsProperty void setEquals(@JsNonNull Object equals); @JsProperty( name = "finalize" ) @JsNonNull Object finalize_(); @JsProperty void setFinalize(@JsNonNull Object finalize); @JsProperty( name = "getClass" ) @JsNonNull Object getClass_(); @JsProperty void setGetClass(@JsNonNull Object getClass); @JsProperty( name = "hashCode" ) @JsNonNull Object hashCode_(); @JsProperty void setHashCode(@JsNonNull Object hashCode); @JsProperty( name = "is" ) @JsNonNull Object _is(); @JsProperty void setIs(@JsNonNull Object is); @JsProperty( name = "notify" ) @JsNonNull Object notify_(); @JsProperty void setNotify(@JsNonNull Object notify); @JsProperty( name = "notifyAll" ) @JsNonNull Object notifyAll_(); @JsProperty void setNotifyAll(@JsNonNull Object notifyAll); @JsProperty( name = "private" ) @JsNonNull Object private_(); @JsProperty void setPrivate(@JsNonNull Object private_); @JsProperty( name = "protected" ) @JsNonNull Object protected_(); @JsProperty void setProtected(@JsNonNull Object protected_); @JsProperty( name = "public" ) @JsNonNull Object public_(); @JsProperty void setPublic(@JsNonNull Object public_); @JsProperty( name = "toString" ) @JsNonNull Object toString_(); @JsProperty void setToString(@JsNonNull Object toString); @JsProperty( name = "wait" ) @JsNonNull Object wait_(); @JsProperty void setWait(@JsNonNull Object wait); @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step1 { @JsOverlay @Nonnull default Step2 default_(@Nonnull Object default_) { Js.<MyDictionary1>uncheckedCast( this ).setDefault( default_ ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step2 { @JsOverlay @Nonnull default Step3 equals_(@Nonnull Object equals) { Js.<MyDictionary1>uncheckedCast( this ).setEquals( equals ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step3 { @JsOverlay @Nonnull default Step4 finalize_(@Nonnull Object finalize) { Js.<MyDictionary1>uncheckedCast( this ).setFinalize( finalize ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step4 { @JsOverlay @Nonnull default Step5 getClass_(@Nonnull Object getClass) { Js.<MyDictionary1>uncheckedCast( this ).setGetClass( getClass ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step5 { @JsOverlay @Nonnull default Step6 hashCode_(@Nonnull Object hashCode) { Js.<MyDictionary1>uncheckedCast( this ).setHashCode( hashCode ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step6 { @JsOverlay @Nonnull default Step7 is(@Nonnull Object is) { Js.<MyDictionary1>uncheckedCast( this ).setIs( is ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step7 { @JsOverlay @Nonnull default Step8 notify_(@Nonnull Object notify) { Js.<MyDictionary1>uncheckedCast( this ).setNotify( notify ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step8 { @JsOverlay @Nonnull default Step9 notifyAll_(@Nonnull Object notifyAll) { Js.<MyDictionary1>uncheckedCast( this ).setNotifyAll( notifyAll ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step9 { @JsOverlay @Nonnull default Step10 private_(@Nonnull Object private_) { Js.<MyDictionary1>uncheckedCast( this ).setPrivate( private_ ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step10 { @JsOverlay @Nonnull default Step11 protected_(@Nonnull Object protected_) { Js.<MyDictionary1>uncheckedCast( this ).setProtected( protected_ ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step11 { @JsOverlay @Nonnull default Step12 public_(@Nonnull Object public_) { Js.<MyDictionary1>uncheckedCast( this ).setPublic( public_ ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step12 { @JsOverlay @Nonnull default Step13 toString_(@Nonnull Object toString) { Js.<MyDictionary1>uncheckedCast( this ).setToString( toString ); return Js.uncheckedCast( this ); } } @JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" ) interface Step13 { @JsOverlay @Nonnull default MyDictionary1 wait_(@Nonnull Object wait) { Js.<MyDictionary1>uncheckedCast( this ).setWait( wait ); return Js.uncheckedCast( this ); } } }
[ "peter@realityforge.org" ]
peter@realityforge.org
f163f15c9ad0061238a6c547d23e1f891185f01e
7e9cb0b3a29dbd7d241640c0dda30b620dae52b9
/core/src/main/java/com/cts/fasttack/core/dto/CardholderVerificationMethodDto.java
bb2822d4a28a4b311d9873256903436cce68a786
[]
no_license
ilemobayo/FASTTACK
f8705ae0b2f5a41487410016756a1b26b0bc5e22
85487890b9e5597f9b2b9690713ece2a5c1aff9f
refs/heads/master
2020-05-26T15:00:06.553982
2018-11-30T11:32:39
2018-11-30T11:32:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,536
java
package com.cts.fasttack.core.dto; import java.util.Date; import com.cts.fasttack.common.core.dto.IdentifierDto; import com.cts.fasttack.core.dict.OtpMethodPlatform; /** * DTO for {@link com.cts.fasttack.core.data.CardholderVerificationMethod} * * @author a.lipavets */ public class CardholderVerificationMethodDto extends IdentifierDto<Long> { private Date transactionDate; private String requestId; private String tokenRefId; private String correlationId; private String tokenRequestorId; private String cellPhone; private String email; private String bankappName; private String customerService; private String outboundCall; private OtpMethodPlatform otpMethodPlatform; private String cvmIdentifierOtp; private String panInternalId; private String panInternalGUID; private String maskedPan; private String tokenizationPath; private String wpDeviceScore; private String wpAccountScore; private String wpPhonenumberScore; private String wpReasonCodes; private String colorTokenizationStandardVersion; private String deviceType; protected String deviceName; /** getters and setters */ public Date getTransactionDate() { return transactionDate; } public void setTransactionDate(Date transactionDate) { this.transactionDate = transactionDate; } public String getRequestId() { return requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getTokenRefId() { return tokenRefId; } public void setTokenRefId(String tokenRefId) { this.tokenRefId = tokenRefId; } public String getCorrelationId() { return correlationId; } public void setCorrelationId(String correlationId) { this.correlationId = correlationId; } public String getTokenRequestorId() { return tokenRequestorId; } public void setTokenRequestorId(String tokenRequestorId) { this.tokenRequestorId = tokenRequestorId; } public String getCellPhone() { return cellPhone; } public void setCellPhone(String cellPhone) { this.cellPhone = cellPhone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getBankappName() { return bankappName; } public void setBankappName(String bankappName) { this.bankappName = bankappName; } public String getCustomerService() { return customerService; } public void setCustomerService(String customerService) { this.customerService = customerService; } public String getOutboundCall() { return outboundCall; } public void setOutboundCall(String outboundCall) { this.outboundCall = outboundCall; } public OtpMethodPlatform getOtpMethodPlatform() { return otpMethodPlatform; } public void setOtpMethodPlatform(OtpMethodPlatform otpMethodPlatform) { this.otpMethodPlatform = otpMethodPlatform; } public String getCvmIdentifierOtp() { return cvmIdentifierOtp; } public void setCvmIdentifierOtp(String cvmIdentifierOtp) { this.cvmIdentifierOtp = cvmIdentifierOtp; } public String getPanInternalId() { return panInternalId; } public void setPanInternalId(String panInternalId) { this.panInternalId = panInternalId; } public String getPanInternalGUID() { return panInternalGUID; } public void setPanInternalGUID(String panInternalGUID) { this.panInternalGUID = panInternalGUID; } public String getMaskedPan() { return maskedPan; } public void setMaskedPan(String maskedPan) { this.maskedPan = maskedPan; } public String getTokenizationPath() { return tokenizationPath; } public void setTokenizationPath(String tokenizationPath) { this.tokenizationPath = tokenizationPath; } public String getWpDeviceScore() { return wpDeviceScore; } public void setWpDeviceScore(String wpDeviceScore) { this.wpDeviceScore = wpDeviceScore; } public String getWpAccountScore() { return wpAccountScore; } public void setWpAccountScore(String wpAccountScore) { this.wpAccountScore = wpAccountScore; } public String getWpPhonenumberScore() { return wpPhonenumberScore; } public void setWpPhonenumberScore(String wpPhonenumberScore) { this.wpPhonenumberScore = wpPhonenumberScore; } public String getWpReasonCodes() { return wpReasonCodes; } public void setWpReasonCodes(String wpReasonCodes) { this.wpReasonCodes = wpReasonCodes; } public String getColorTokenizationStandardVersion() { return colorTokenizationStandardVersion; } public void setColorTokenizationStandardVersion(String colorTokenizationStandardVersion) { this.colorTokenizationStandardVersion = colorTokenizationStandardVersion; } public String getDeviceType() { return deviceType; } public void setDeviceType(String deviceType) { this.deviceType = deviceType; } public String getDeviceName() { return deviceName; } public void setDeviceName(String deviceName) { this.deviceName = deviceName; } }
[ "a.lazarchuk@cartsys.com.ua" ]
a.lazarchuk@cartsys.com.ua
9e6f28df9c2379c6f9f65b283f29bca62f3d2026
48a88aea6e9774279c8563f1be665a540e02a894
/src/edu/berkeley/nlp/util/OrderedMap.java
5447f60721a45c90da116405cc1ed27fb1b0a269
[]
no_license
josepvalls/parserservices
0994aa0fc56919985474aaebb9fa64581928b5b4
903363685e5cea4bd50d9161d60500800e42b167
refs/heads/master
2021-01-17T08:36:23.455855
2016-01-19T19:49:54
2016-01-19T19:49:54
60,540,533
2
0
null
null
null
null
UTF-8
Java
false
false
4,080
java
package edu.berkeley.nlp.util; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.util.AbstractCollection; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; /** * A container for mapping objects to objects. Keep track of the order of the * objects (as they were inserted into the data structure). No duplicate * elements allowed. */ public class OrderedMap<S, T> { private ArrayList<S> keys = new ArrayList<S>(); private Map<S, T> map = new HashMap<S, T>(); public OrderedMap() { } public OrderedMap(OrderedMap<S, T> map) { for (S key : map.keys()) put(key, map.get(key)); } public void clear() { keys.clear(); map.clear(); } public void log(String title) { LogInfo.track(title, true); for (S key : keys()) LogInfo.logs(key + "\t" + get(key)); LogInfo.end_track(); } public void put(S key) { put(key, null); } public void putAtEnd(S key) { put(key, get(key)); } public void removeAt(int i) { S key = keys.get(i); keys.remove(i); map.remove(key); } public void reput(S key, T val) { // Don't affect order (but insert if key // doesn't exist) if (!map.containsKey(key)) put(key, val); else map.put(key, val); } public void put(S key, T val) { // If key already exists, we replace its value and move it to the end of // the list. if (map.containsKey(key)) keys.remove(key); // Remove last occurrence of key keys.add(key); map.put(key, val); } public int size() { return keys.size(); } public boolean containsKey(S key) { return map.containsKey(key); } public T get(S key) { return map.get(key); } public T get(S key, T defaultVal) { return MapUtils.get(map, key, defaultVal); } public Set<S> keySet() { return map.keySet(); } public List<S> keys() { return keys; } // Values { public ValueCollection values() { return new ValueCollection(); } public class ValueCollection extends AbstractCollection<T> { @Override public Iterator<T> iterator() { return new ValueIterator(); } @Override public int size() { return size(); } @Override public boolean contains(Object o) { throw new UnsupportedOperationException(); } @Override public void clear() { throw new UnsupportedOperationException(); } } private class ValueIterator implements Iterator<T> { public ValueIterator() { next = 0; } @Override public boolean hasNext() { return next < size(); } @Override public T next() { return map.get(keys.get(next++)); } @Override public void remove() { throw new UnsupportedOperationException(); } private int next; } // } /** * Output each entry in the HashMap on a line separated by a tab. */ public void print(PrintWriter out) { for (S key : keys) { print(out, key, map.get(key)); } out.flush(); } public void print(String path) throws IOException { print(new File(path)); } public void printHard(String path) { PrintWriter out = IOUtils.openOutHard(path); print(out); out.close(); } public void print(File path) throws IOException { PrintWriter out = IOUtils.openOut(path); print(out); out.close(); } public String print() { StringWriter sw = new StringWriter(); print(new PrintWriter(sw)); return sw.toString(); } void print(PrintWriter out, S key, T val) { out.println(key + (val == null ? "" : "\t" + val)); } public boolean printEasy(String path) { if (StrUtils.isEmpty(path)) return false; return printEasy(new File(path)); } public boolean printEasy(File path) { if (path == null) return false; try { PrintWriter out = IOUtils.openOut(path); print(out); out.close(); return true; } catch (Exception e) { return false; } } @Override public String toString() { StringBuilder sb = new StringBuilder(); for (S key : keys) { sb.append(key + " " + map.get(key) + "\n"); } return sb.toString(); } }
[ "josepvalls@Valls.local" ]
josepvalls@Valls.local
4d23332cd87f052b514b1addef0898c73e3f1801
bb96ec95bffec89de9b35c3e7e74d3887dc85701
/arcaniumOS-server/src/main/java/org/arcanium/game/content/skill/p2p/fletching/items/bow/StringBow.java
dabdc9ed8ddef91cd7da0da1a7aa93fac59d4870
[]
no_license
Shadowrs/OSRS-PS
fb3fff1fea34942e3a0566b7d5c2b791fbb0ce83
8148d18102135a3ed6f918c29aaaefea8ab4d668
refs/heads/master
2020-05-01T16:25:08.904595
2019-03-21T01:15:50
2019-03-21T01:15:50
177,571,376
0
1
null
2019-03-25T11:15:54
2019-03-25T11:15:54
null
UTF-8
Java
false
false
2,962
java
package org.arcanium.game.content.skill.p2p.fletching.items.bow; import org.arcanium.game.node.item.Item; import org.arcanium.game.world.update.flag.context.Animation; /** * Represents the enum of stringing bows. * @author 'Vexia */ public enum StringBow { SHORT_BOW(new Item(50), new Item(841), 5, 5, new Animation(6678)), LONG_BOW(new Item(48), new Item(839), 10, 10, new Animation(6684)), OAK_SHORTBOW(new Item(54), new Item(843), 20, 16.5, new Animation(6679)), OAK_LONGBOW(new Item(56), new Item(845), 25, 25, new Animation(6685)), WILLOW_SHORTBOW(new Item(60), new Item(849), 35, 33.3, new Animation(6680)), WILLOW_LONGBOW(new Item(58), new Item(847), 40, 41.5, new Animation(6686)), MAPLE_SHORTBOW(new Item(64), new Item(853), 50, 50, new Animation(6681)), MAPLE_LONGBOW(new Item(62), new Item(851), 55, 58.3, new Animation(6687)), YEW_SHORTBOW(new Item(68), new Item(857), 65, 66, new Animation(6682)), YEW_LONGBOW(new Item(66), new Item(855), 70, 75, new Animation(6688)), MAGIC_SHORTBOW(new Item(72), new Item(861), 80, 83.3, new Animation(6683)), MAGIC_LONGBOW(new Item(70), new Item(859), 85, 91.5, new Animation(6689)); /** * Constructs a new {@code StringbowPlugin.java} {@code Object}. * @param item the item. * @param product the product. * @param level the level. * @param experience the experience. */ StringBow(final Item item, final Item product, final int level, final double experience, final Animation animation) { this.item = item; this.product = product; this.level = level; this.experience = experience; this.animation = animation; } /** * The item required. */ private final Item item; /** * The item product. */ private final Item product; /** * The level required. */ private final int level; /** * The experience required. */ private final double experience; /** * The animation of stringing. */ private final Animation animation; /** * Gets the item. * @return The item. */ public Item getItem() { return item; } /** * Gets the product. * @return The product. */ public Item getProduct() { return product; } /** * Gets the level. * @return The level. */ public int getLevel() { return level; } /** * Gets the experience. * @return The experience. */ public double getExperience() { return experience; } /** * Method used to get the animation. * @return the animation. */ public Animation getAnimation() { return animation; } /** * Method used to get the string bow for the item. * @param item the item. * @return the string bow. */ public static StringBow forItem(final int id) { for (StringBow bw : StringBow.values()) { if (bw.getItem().getId() == id) { return bw; } } return null; } }
[ "zeruth09@gmail.com" ]
zeruth09@gmail.com
4f27ebaf4eab5689a4b530110074aa9ea110b9d2
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/protocal/protobuf/qs.java
aa9a1b85aedd94f4728a1190cf5734683a7dfb6c
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
4,053
java
package com.tencent.mm.protocal.protobuf; import com.tencent.matrix.trace.core.AppMethodBeat; import i.a.a.b; import java.util.LinkedList; public final class qs extends esc { public int YRq; public qp YVM; public final int op(int paramInt, Object... paramVarArgs) { AppMethodBeat.i(257819); if (paramInt == 0) { paramVarArgs = (i.a.a.c.a)paramVarArgs[0]; if (this.BaseResponse == null) { paramVarArgs = new b("Not all required fields were included: BaseResponse"); AppMethodBeat.o(257819); throw paramVarArgs; } if (this.BaseResponse != null) { paramVarArgs.qD(1, this.BaseResponse.computeSize()); this.BaseResponse.writeFields(paramVarArgs); } if (this.YVM != null) { paramVarArgs.qD(2, this.YVM.computeSize()); this.YVM.writeFields(paramVarArgs); } paramVarArgs.bS(3, this.YRq); AppMethodBeat.o(257819); return 0; } if (paramInt == 1) { if (this.BaseResponse == null) { break label510; } } label510: for (paramInt = i.a.a.a.qC(1, this.BaseResponse.computeSize()) + 0;; paramInt = 0) { int i = paramInt; if (this.YVM != null) { i = paramInt + i.a.a.a.qC(2, this.YVM.computeSize()); } paramInt = i.a.a.b.b.a.cJ(3, this.YRq); AppMethodBeat.o(257819); return i + paramInt; if (paramInt == 2) { paramVarArgs = new i.a.a.a.a((byte[])paramVarArgs[0], unknownTagHandler); for (paramInt = esc.getNextFieldNumber(paramVarArgs); paramInt > 0; paramInt = esc.getNextFieldNumber(paramVarArgs)) { if (!super.populateBuilderWithField(paramVarArgs, this, paramInt)) { paramVarArgs.kFT(); } } if (this.BaseResponse == null) { paramVarArgs = new b("Not all required fields were included: BaseResponse"); AppMethodBeat.o(257819); throw paramVarArgs; } AppMethodBeat.o(257819); return 0; } if (paramInt == 3) { Object localObject1 = (i.a.a.a.a)paramVarArgs[0]; qs localqs = (qs)paramVarArgs[1]; paramInt = ((Integer)paramVarArgs[2]).intValue(); Object localObject2; switch (paramInt) { default: AppMethodBeat.o(257819); return -1; case 1: paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt); i = paramVarArgs.size(); paramInt = 0; while (paramInt < i) { localObject1 = (byte[])paramVarArgs.get(paramInt); localObject2 = new kd(); if ((localObject1 != null) && (localObject1.length > 0)) { ((kd)localObject2).parseFrom((byte[])localObject1); } localqs.BaseResponse = ((kd)localObject2); paramInt += 1; } AppMethodBeat.o(257819); return 0; case 2: paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt); i = paramVarArgs.size(); paramInt = 0; while (paramInt < i) { localObject1 = (byte[])paramVarArgs.get(paramInt); localObject2 = new qp(); if ((localObject1 != null) && (localObject1.length > 0)) { ((qp)localObject2).parseFrom((byte[])localObject1); } localqs.YVM = ((qp)localObject2); paramInt += 1; } AppMethodBeat.o(257819); return 0; } localqs.YRq = ((i.a.a.a.a)localObject1).ajGk.aar(); AppMethodBeat.o(257819); return 0; } AppMethodBeat.o(257819); return -1; } } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar * Qualified Name: com.tencent.mm.protocal.protobuf.qs * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
637cd1e0b134a07e532391fbd590f1d7200db85d
6b92b4914bf740c3fb0283a0348f460af979dd9d
/modulo_06/esercizi/Persona.java
204236b887a29e6651e4c64c778cde85929ab5f2
[]
no_license
emagrav/ManualeJava8ITA
28f37f2e836c6b34a9e6d44a0294fcfb859b9034
249b0dc6d20355f9f0bb2fd2771739b57a8f65ab
refs/heads/master
2020-08-24T18:45:11.174823
2019-10-22T18:29:44
2019-10-22T18:29:44
216,867,238
0
0
null
null
null
null
UTF-8
Java
false
false
187
java
public class Persona { private String nome; public void setNome(String nome) { this.nome = nome; } public String getNome() { return nome; } }
[ "emagrav@gmail.com" ]
emagrav@gmail.com
16e6089a6fb3dfbfb51b0d57e0fb51d2f7be4fbf
aeccb2f3d1acf3fc18341c94cfb98b4edd6b6ccd
/nettyIM/src/main/java/cn/nuaa/gcc/im/server/handler/MessageRequestHandler.java
11669a225108cd8e96c1c5461a1141f188a6879f
[]
no_license
gcczuis/IMOnNetty
5e13eec172ae7f2c7dd81f0a55efc5a635ced8aa
da47ef2cc6ea5465c6fb367fe91fa328365cd497
refs/heads/master
2022-06-24T04:00:25.951763
2019-05-23T02:05:17
2019-05-23T02:05:17
187,950,760
3
0
null
2022-06-17T02:10:05
2019-05-22T02:47:20
Java
UTF-8
Java
false
false
2,078
java
package cn.nuaa.gcc.im.server.handler; import cn.nuaa.gcc.im.protocol.request.MessageRequestPacket; import cn.nuaa.gcc.im.session.Session; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import cn.nuaa.gcc.im.protocol.response.MessageResponsePacket; import cn.nuaa.gcc.im.util.SessionUtil; @ChannelHandler.Sharable public class MessageRequestHandler extends SimpleChannelInboundHandler<MessageRequestPacket> { public static final MessageRequestHandler INSTANCE = new MessageRequestHandler(); private MessageRequestHandler() { } @Override protected void channelRead0(ChannelHandlerContext ctx, MessageRequestPacket messageRequestPacket) { // 1.拿到消息发送方的会话信息 Session session = SessionUtil.getSession(ctx.channel()); // 2.通过消息发送方的会话信息构造要发送的消息 MessageResponsePacket messageResponsePacket = new MessageResponsePacket(); messageResponsePacket.setFromUserId(session.getUserId()); messageResponsePacket.setFromUserName(session.getUserName()); messageResponsePacket.setMessage(messageRequestPacket.getMessage()); // 3.拿到消息接收方的 channel Channel toUserChannel = SessionUtil.getChannel(messageRequestPacket.getToUserId()); // 4.将消息发送给消息接收方 if (toUserChannel != null && SessionUtil.hasLogin(toUserChannel)) { toUserChannel.writeAndFlush(messageResponsePacket); } else { //接收方不在线 messageResponsePacket.setFromUserId("server"); messageResponsePacket.setFromUserName("server"); messageResponsePacket.setMessage("[" + messageRequestPacket.getToUserId() + "] 不在线,发送失败!"); ctx.channel().writeAndFlush(messageResponsePacket); System.err.println("[" + messageRequestPacket.getToUserId() + "] 不在线,发送失败!"); } } }
[ "gcc950226@outlook.com" ]
gcc950226@outlook.com
b8da261ea68e291c42d12139c3c428b14cefeb4b
a68da7e17f598766692a3d059fe5db6541c0610a
/mobile/Android/kygj/app/src/main/java/link/smartwall/kygj/questionbank/activity/ShowLikesActivity.java
662ff6d7e846d7ecda8089fdb5e1496ff4ffe893
[]
no_license
shinow/smartwall
a6dccf57c206a1926eab866c9991765fe2c4c2ce
352c053dac25dcbd0d939eefb9c4be91a51b6894
refs/heads/master
2021-09-04T17:42:28.256195
2018-01-20T16:46:30
2018-01-20T16:46:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,433
java
package link.smartwall.kygj.questionbank.activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import java.util.ArrayList; import java.util.List; import link.smartwall.controls.view.TitleView; import link.smartwall.kygj.QuestionBankAppplication; import link.smartwall.kygj.R; import link.smartwall.kygj.questionbank.adapter.likes.LikeQuestionAdapter; import link.smartwall.kygj.questionbank.data.LocalDataReader; import link.smartwall.kygj.questionbank.domain.BaseItem; import link.smartwall.kygj.questionbank.domain.Subject; import link.smartwall.kygj.questionbank.domain.UserInfo; public class ShowLikesActivity extends AppCompatActivity { private RecyclerView mRecyclerView; private List<BaseItem> itemList = new ArrayList<>(); private LikeQuestionAdapter mAdapter; private TitleView titleView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_show_likes); mRecyclerView = (RecyclerView) this.findViewById(R.id.recycle_view); titleView = (TitleView) this.findViewById(R.id.question_bank_titleview); this.titleView.getLeftBackTextTv().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ShowLikesActivity.this.finish(); } }); initSubjects(); } /* * 初始化科目 */ private void initSubjects() { UserInfo userInfo = QuestionBankAppplication.getInstance().getUserInfo(); List<Subject> subjects = LocalDataReader.readLikedSubjects(); itemList.clear(); if (subjects != null) { itemList.addAll(subjects); } setData(); } private void setData() { LinearLayoutManager lm = new LinearLayoutManager(this); mRecyclerView.setLayoutManager(lm); mAdapter = new LikeQuestionAdapter(this, itemList); mRecyclerView.setAdapter(mAdapter); // //滚动监听 // mAdapter.setOnScrollListener(new SubjectChapterAdapter.OnScrollListener() { // @Override // public void scrollTo(int pos) { // mRecyclerView.scrollToPosition(pos); // } // }); } }
[ "lexloo@126.com" ]
lexloo@126.com
1b1fd9eacca036117147d2d84d7d43443ddf80f1
dbbdf5ccb411fa3ef2dca6cea741c0e9b4bbde15
/AndroidClient/example/gen/com/pricecompare/BuildConfig.java
027047a95ea4aa12b8f6206fe7e9500a2f215417
[]
no_license
Seraphim-lyx/PriceCompare
b0fc487b9b70e825d77e5e3647c216c7b006d67d
bd4fba0047b8f9ef2b8670b0e689061f7e75986e
refs/heads/master
2021-07-14T05:57:36.675218
2017-10-16T03:04:24
2017-10-16T03:04:24
107,062,946
0
0
null
null
null
null
UTF-8
Java
false
false
158
java
/** Automatically generated file. DO NOT MODIFY */ package com.pricecompare; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "563150079@qq.com" ]
563150079@qq.com
e481304836908588bbf4eac465a4586f0adf0846
7356aee3f05c1d84fffb3cd4d892a6d38691cb68
/modules/balana-core/src/main/java/org/wso2/balana/cond/FloorFunction.java
a9469d72b7aa8143f9b46bec5770ee21665d5203
[ "Apache-2.0" ]
permissive
wso2/balana
e124263153d9d28ab17126a3b92dd1e0bab3f7ad
094af10191a92c9eb5825faeaa156dbdcf4b915e
refs/heads/master
2023-08-29T12:48:41.279329
2022-07-28T16:30:54
2022-07-28T16:30:54
17,205,250
116
115
Apache-2.0
2022-07-28T16:27:38
2014-02-26T09:17:19
Java
UTF-8
Java
false
false
4,478
java
/* * @(#)FloorFunction.java * * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistribution of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * * You acknowledge that this software is not designed or intended for use in * the design, construction, operation or maintenance of any nuclear facility. */ package org.wso2.balana.cond; import org.wso2.balana.ctx.EvaluationCtx; import org.wso2.balana.attr.AttributeValue; import org.wso2.balana.attr.DoubleAttribute; import java.util.HashSet; import java.util.List; import java.util.Set; /** * A class that implements the floor function. It takes one double operand, chooses the largest * integer less than or equal to that value, and returns that integer (as a double). If the operand * is indeterminate, an indeterminate result is returned. * * @since 1.0 * @author Steve Hanna * @author Seth Proctor */ public class FloorFunction extends FunctionBase { /** * Standard identifier for the floor function. */ public static final String NAME_FLOOR = FUNCTION_NS + "floor"; /** * Creates a new <code>FloorFunction</code> object. * * @param functionName the standard XACML name of the function to be handled by this object, * including the full namespace * * @throws IllegalArgumentException if the function is unknown */ public FloorFunction(String functionName) { super(NAME_FLOOR, 0, DoubleAttribute.identifier, false, 1, DoubleAttribute.identifier, false); if (!functionName.equals(NAME_FLOOR)) throw new IllegalArgumentException("unknown floor function: " + functionName); } /** * Returns a <code>Set</code> containing all the function identifiers supported by this class. * * @return a <code>Set</code> of <code>String</code>s */ public static Set getSupportedIdentifiers() { Set set = new HashSet(); set.add(NAME_FLOOR); return set; } /** * Evaluate the function, using the specified parameters. * * @param inputs a <code>List</code> of <code>Evaluatable</code> objects representing the * arguments passed to the function * @param context an <code>EvaluationCtx</code> so that the <code>Evaluatable</code> objects can * be evaluated * @return an <code>EvaluationResult</code> representing the function's result */ public EvaluationResult evaluate(List inputs, EvaluationCtx context) { // Evaluate the arguments AttributeValue[] argValues = new AttributeValue[inputs.size()]; EvaluationResult result = evalArgs(inputs, context, argValues); if (result != null) return result; // Now that we have real values, perform the floor operation double arg = ((DoubleAttribute) argValues[0]).getValue(); return new EvaluationResult(new DoubleAttribute(Math.floor(arg))); } }
[ "chamathg@gmail.com" ]
chamathg@gmail.com
239ede795f9265c1dd1fecb040cc142a4ae46ca5
fe49bebdae362679d8ea913d97e7a031e5849a97
/bqerpejb/src/power/ejb/hr/ca/TimeKeeperExamineFacadeNewRemote.java
2198bf44e6542e4113cc7f71ee17d5e2214cac86
[]
no_license
loveyeah/BQMIS
1f87fad2c032e2ace7e452f13e6fe03d8d09ce0d
a3f44db24be0fcaa3cf560f9d985a6ed2df0b46b
refs/heads/master
2020-04-11T05:21:26.632644
2018-03-08T02:13:18
2018-03-08T02:13:18
124,322,652
0
2
null
null
null
null
UTF-8
Java
false
false
2,173
java
/** * Copyright ustcsoft.com * All right reserved. */ package power.ejb.hr.ca; import java.text.ParseException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.zip.DataFormatException; import javax.ejb.Remote; import power.ear.comm.DataChangeException; import power.ear.comm.ejb.PageObject; /** * 考勤员审核接口 * * @author zhouxu */ @Remote public interface TimeKeeperExamineFacadeNewRemote { /** * 考勤员审核查询 * * @param examineDate * @param examineDept * @param enterpriseCode * @return 动态表头的store * @throws ParseException * @throws DataChangeException * @throws Exception */ public TimeKeeperExamineForm getExamineInfo(Long empId,String examineDate, String examineDept, String enterpriseCode, Properties p,String flag,String ... entryIds) throws ParseException, DataChangeException, Exception; /** * 通过上级审核部门取得考勤部门 * * @param pid * @param enterpriseCode * @return */ public PageObject getDeptsByTopDeptid(String enterpriseCode, Long loginEmp); /** * 查询职工考勤记录 * * @param empId * @param enterpriseCode * @param strStartDate * @param strEndDate * @return * @throws ParseException * @throws Exception */ public TimeKeeperExamineStandardTime getEmpAttendance(String empId, String enterpriseCode, String strStartDate, String strEndDate, String checkFlag, List<Map<String, Object>> workOrRestList, String attendanceDeptId, String deptId) throws ParseException, Exception; /** * 撤销前回审核 * * @param attendanceDeptId * @param checkYear * @param checkMonth * @throws DataChangeException * @throws DataFormatException */ public void cancelLastCheck(ArrayList<Map<String, Object>> arrlist, String enterpriseCode, String workerCode) throws DataChangeException, DataFormatException; }
[ "yexinhua@rtdata.cn" ]
yexinhua@rtdata.cn
6d80183ba7ecf035a6a4a1a8ec778e6d0f83b55f
ed2fa0fc455cb4a56669b34639bb95b25c6b7f83
/二进制中1个数/src/Test.java
e3da6addedc6ca70ba877157ff8a83513de09059
[]
no_license
w7436/wen-Java
5bcc2b09faa478196218e46ff64cd23ba64da441
6fc9f2a336c512a0d9be70c69950ad5610b3b152
refs/heads/master
2022-11-27T07:51:28.158473
2020-09-11T03:49:41
2020-09-11T03:49:41
210,778,808
0
0
null
2022-11-16T08:36:03
2019-09-25T07:08:33
JavaScript
UTF-8
Java
false
false
511
java
import java.util.Scanner; /** * @ClassName Test * @Description TODO * @Author DELL * @Data 2019/10/15 17:59 * @Version 1.0 **/ public class Test { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("请输入数字:"); int a=sc.nextInt(); int i=0; int count=0; for (i=0;i<32;i++){ if (((a>>i)&1)==1){ count++; } } System.out.println(count); } }
[ "3239741254@qq.com" ]
3239741254@qq.com
128c779e602ae2ee6b2c4c63954978cdb39bb813
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project61/src/main/java/org/gradle/test/performance61_3/Production61_216.java
9544e7f41a57496c99a4a801c1aa422cc4966cc2
[]
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
305
java
package org.gradle.test.performance61_3; public class Production61_216 extends org.gradle.test.performance15_3.Production15_216 { private final String property; public Production61_216() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
f69ee4fa6f51db23a2cb15a2810523194d45f919
7cf7d9729dae85781d9ceee4494c241e50cd3a5b
/WLPoker/src/com/wlzndjk/poker/dialog/TemplateCustomDialog.java
21d8ab2e21a4d35cb23a090200fcd81641ca70a3
[]
no_license
heshicaihao/DIY_Poker
e80e58d57943a117ca65fe8a02826e942a312195
70a100b2a0ef37b4dcf09d2a23f3335f6dad0df8
refs/heads/master
2021-04-29T08:53:48.774419
2018-01-09T01:59:45
2018-01-09T01:59:45
77,670,538
0
0
null
null
null
null
UTF-8
Java
false
false
2,580
java
package com.wlzndjk.poker.dialog; import java.util.Timer; import java.util.TimerTask; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Display; import android.view.WindowManager; import android.widget.ProgressBar; import android.widget.TextView; import com.wlzndjk.poker.R; @SuppressLint("HandlerLeak") public class TemplateCustomDialog extends AlertDialog { public Context context; public TemplateCustomDialog(Context context) { super(context); this.context = context; } private TextView tv_loading; private ProgressBar progressBar; private Timer timer; private int count = 1; @SuppressWarnings("deprecation") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dialog_upload_progress); tv_loading = (TextView) findViewById(R.id.tv_loading); progressBar = (ProgressBar) findViewById(R.id.pb); progressBar.setProgress(25); // 设置Dialog显示的宽度, Display d = getWindow().getWindowManager().getDefaultDisplay(); WindowManager.LayoutParams lp = getWindow().getAttributes(); // 这里设置为屏幕宽度的百分之八十 lp.width = (int) (d.getWidth() * 0.8); getWindow().setAttributes(lp); timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { handler.sendEmptyMessage(0); } }, 300, 300); setOnDismissListener(new OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { if (timer != null) { timer.cancel(); } } }); } Handler handler = new Handler() { @Override public void handleMessage(Message msg) { count++; if (count > 3) { count = 1; } String textpre = context.getString(R.string.loading_template); String text = null; switch (count) { case 1: text = textpre + context.getString(R.string.one_spot); tv_loading.setText(text); break; case 2: text = textpre + context.getString(R.string.two_spot); tv_loading.setText(text); break; case 3: text = textpre + context.getString(R.string.three_spot); tv_loading.setText(text); break; } } }; public void setProgress(int progress) { progressBar.setProgress(progress); if (progress == 100) { this.dismiss(); } } }
[ "heshicaihao@163.com" ]
heshicaihao@163.com
c3dc5ee42d54f6c8668327f4c6372fded86d23e4
f29f8f1fc8a23ef96e4c359afb82eeb5622756bf
/src/main/java/io/github/nucleuspowered/nucleus/modules/message/commands/HelpOpCommand.java
bf2a1f18c5878c4a0b61e0433dd7b99c1a3fbc3f
[ "MIT", "Apache-2.0" ]
permissive
IdrisDose/Nucleus
ccf4684d48b70176a978dcb87ab332c073107e63
bf1e5260b0832f7fe7cb9d8e7966d254250ccaea
refs/heads/sponge-api/5
2021-01-13T03:37:47.058799
2016-12-22T17:00:01
2016-12-22T17:32:32
77,278,336
0
0
MIT
2018-10-18T06:12:56
2016-12-24T10:35:34
Java
UTF-8
Java
false
false
3,080
java
/* * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file * at the root of this project for more details. */ package io.github.nucleuspowered.nucleus.modules.message.commands; import com.google.inject.Inject; import io.github.nucleuspowered.nucleus.ChatUtil; import io.github.nucleuspowered.nucleus.internal.annotations.Permissions; import io.github.nucleuspowered.nucleus.internal.annotations.RegisterCommand; import io.github.nucleuspowered.nucleus.internal.annotations.RunAsync; import io.github.nucleuspowered.nucleus.internal.permissions.PermissionInformation; import io.github.nucleuspowered.nucleus.internal.permissions.SuggestedLevel; import io.github.nucleuspowered.nucleus.modules.message.config.MessageConfigAdapter; import io.github.nucleuspowered.nucleus.modules.message.events.InternalNucleusHelpOpEvent; import org.spongepowered.api.Sponge; import org.spongepowered.api.command.CommandResult; import org.spongepowered.api.command.args.CommandContext; import org.spongepowered.api.command.args.CommandElement; import org.spongepowered.api.command.args.GenericArguments; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.channel.MessageChannel; import java.util.HashMap; import java.util.Map; @RunAsync @Permissions(suggestedLevel = SuggestedLevel.USER) @RegisterCommand({"helpop"}) public class HelpOpCommand extends io.github.nucleuspowered.nucleus.internal.command.AbstractCommand<Player> { private final String messageKey = "message"; @Inject private MessageConfigAdapter mca; @Inject private ChatUtil chatUtil; @Override public CommandElement[] getArguments() { return new CommandElement[] {GenericArguments.remainingJoinedStrings(Text.of(messageKey))}; } @Override public Map<String, PermissionInformation> permissionSuffixesToRegister() { Map<String, PermissionInformation> m = new HashMap<>(); m.put("receive", new PermissionInformation(plugin.getMessageProvider().getMessageWithFormat("permission.helpop.receive"), SuggestedLevel.MOD)); return m; } @Override public CommandResult executeCommand(Player src, CommandContext args) throws Exception { String message = args.<String>getOne(messageKey).get(); // Message is about to be sent. Send the event out. If canceled, then // that's that. if (Sponge.getEventManager().post(new InternalNucleusHelpOpEvent(src, message))) { src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("message.cancel")); return CommandResult.empty(); } Text prefix = chatUtil.getMessageFromTemplate(mca.getNodeOrDefault().getHelpOpPrefix(), src, false); MessageChannel.permission(permissions.getPermissionWithSuffix("receive")).send(src, prefix.concat(Text.of(message))); src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("command.helpop.success")); return CommandResult.success(); } }
[ "git@drnaylor.co.uk" ]
git@drnaylor.co.uk
4a1ed4fdba23931b7435a1eb615396239c20720b
1c5e8605c1a4821bc2a759da670add762d0a94a2
/src/dahua/fdc/finance/IDepConPayPlanSplitItem.java
318d5d939f2ed1a161f31ea81465f601c076b0cf
[]
no_license
shxr/NJG
8195cfebfbda1e000c30081399c5fbafc61bb7be
1b60a4a7458da48991de4c2d04407c26ccf2f277
refs/heads/master
2020-12-24T06:51:18.392426
2016-04-25T03:09:27
2016-04-25T03:09:27
19,804,797
0
3
null
null
null
null
UTF-8
Java
false
false
573
java
package com.kingdee.eas.fdc.finance; import com.kingdee.bos.BOSException; //import com.kingdee.bos.metadata.*; import com.kingdee.bos.framework.*; import com.kingdee.bos.util.*; import com.kingdee.bos.Context; import com.kingdee.bos.util.*; import com.kingdee.bos.Context; import com.kingdee.bos.BOSException; import com.kingdee.eas.framework.CoreBaseInfo; import com.kingdee.bos.framework.*; import com.kingdee.eas.framework.CoreBaseCollection; import com.kingdee.eas.framework.ICoreBase; public interface IDepConPayPlanSplitItem extends ICoreBase { }
[ "shxr_code@126.com" ]
shxr_code@126.com
8af91ce49534d037a36e03d90a18553fe2ff303a
ef8c8fb8b0feec228bdbe0a92820e6013aaf085a
/src/main/java/com/mawujun/http/IPUtils.java
31b3c92ac921cbd669c93acd42869494226f4c8d
[]
no_license
mawujun1234/leon-tools-bak
f51436aba08b4f17347e01a9831a2177f5af41bb
e26e57e26dce42a504f6f994ef832dbcd7bdae5d
refs/heads/main
2023-05-07T12:58:57.902824
2021-05-31T12:48:43
2021-05-31T12:48:43
372,504,466
0
0
null
null
null
null
UTF-8
Java
false
false
5,967
java
package com.mawujun.http; import java.net.Inet4Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * IP地址 * @author mawujun * */ public class IPUtils { private static Logger logger = LoggerFactory.getLogger(IPUtils.class); /** * 获取IP地址 * * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址 * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址 */ public static String getRequestIpAddr(HttpServletRequest request) { String ip = null; try { ip = request.getHeader("x-forwarded-for"); if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_CLIENT_IP"); } if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); } if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } } catch (Exception e) { logger.error("IPUtils ERROR ", e); } // //使用代理,则获取第一个IP地址 // if(StringUtils.isEmpty(ip) && ip.length() > 15) { // if(ip.indexOf(",") > 0) { // ip = ip.substring(0, ip.indexOf(",")); // } // } return ip; } public static String[] getLocalIpAddres(boolean onlyone,boolean real) { try { List<String> ipes=new ArrayList<String>(); Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces(); while (allNetInterfaces.hasMoreElements()) { NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement(); // 去除回环接口,子接口,未运行和接口 if (netInterface.isLoopback() || netInterface.isVirtual() || !netInterface.isUp()) { continue; } // //相当于是只获取指定网卡的ip地址 // if (!netInterface.getDisplayName().contains("Intel") // && !netInterface.getDisplayName().contains("Realtek")) { // continue; // } //System.out.println("DisplayName:"+netInterface.getDisplayName()); //System.out.println("name:"+netInterface.getName()); if (netInterface.getName().contains("docker") || netInterface.getName().contains("lo") ||netInterface.getDisplayName().contains("VirtualBox") //排除VirtualBox虚拟机 ) { continue; } Enumeration<InetAddress> addresses = netInterface.getInetAddresses(); while (addresses.hasMoreElements()) { InetAddress ip = addresses.nextElement(); if (ip != null) { // ipv4 if (ip instanceof Inet4Address) { System.out.println("ipv4 = " + ip.getHostAddress()); ipes.add(ip.getHostAddress()); if(onlyone) { return ipes.toArray(new String[ipes.size()]); } // } } } //break; } if(ipes!=null && ipes.size()>0) { return ipes.toArray(new String[ipes.size()]); } else { return null; } } catch (SocketException e) { logger.error("获取真实的ip地址失败", e); //System.err.println("Error when getting host ip address" + e.getMessage()); } return null; } /** * 获取所有真实的ip地址,因为一台机器会即连wifi,也同时连又有线 * @return */ public static String[] getLocalIpAddres() { return getLocalIpAddres(false,true); } /** * 获取本机的ip地址,读取到了WiFi或者有线地址其中之一立即return。 * @param request * @return,如果没有获取导返回null */ public static String getLocalIpAddr() { String[] ipes= getLocalIpAddres(true,true); if(ipes!=null && ipes.length>0) { return ipes[0]; } else { return null; } // try { //// InetAddress addr = InetAddress.getLocalHost(); //// System.out.println("Local HostAddress:"+addr.getHostAddress()); //// String hostname = addr.getHostName(); //// System.out.println("Local host name: "+hostname); // // // 遍历所有的网络接口 // Enumeration allNetInterfaces = NetworkInterface.getNetworkInterfaces(); // InetAddress ip = null; // String ipAddr=null; // while (allNetInterfaces.hasMoreElements()) { // NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement(); // String name = netInterface.getName(); // //System.out.println(netInterface.getName()); // //过滤掉docker和lo // if (name.contains("docker") || name.contains("lo")) { // continue; // } // // // Enumeration addresses = netInterface.getInetAddresses(); // while (addresses.hasMoreElements()) { // ip = (InetAddress) addresses.nextElement(); // // 排除loopback类型地址 // if(ip.isLoopbackAddress()) { // continue; // } // if (ip != null && ip instanceof Inet4Address) { // System.out.println("本机的IP = " + ip.getHostAddress()); // ipAddr=ip.getHostAddress(); // } // } // } // return ipAddr; // } catch (SocketException e) { // logger.error("IPUtils ERROR ", e); // } catch (UnknownHostException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // return null; } }
[ "mawujun1234@163.com" ]
mawujun1234@163.com
9aa38d9407b2d5174a4938ed16a32e693ea568f7
31b73e558d4d771f5d21c7fb9e2c4aa4f21d8de1
/pippo-demo/pippo-demo-spring/src/main/java/ro/pippo/demo/spring/SpringDemo.java
93bbe7f8a027a962909d8e1589da615fc58de284
[ "Apache-2.0" ]
permissive
chrisandflora/pippo
9e4550df9c71ed2e5c191406224a03216036153b
40bde42c67e888481ecca9b30bccfcb49bbd089c
refs/heads/master
2021-01-16T00:30:57.130832
2015-05-11T15:09:12
2015-05-11T15:09:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,091
java
/* * Copyright (C) 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ro.pippo.demo.spring; import ro.pippo.core.Pippo; import ro.pippo.spring.SpringControllerInjector; /** * This demo shows how to use Spring Framework to declare a bean and how to use * <code>{@link SpringControllerInjector}</code> to inject that bean in a Controller. * * @author Decebal Suiu */ public class SpringDemo { public static void main(String[] args) { Pippo pippo = new Pippo(new SpringApplication()); pippo.start(); } }
[ "decebal.suiu@gmail.com" ]
decebal.suiu@gmail.com
cfb6bfae433258d08f94f2ae89ccb412a47180bc
447520f40e82a060368a0802a391697bc00be96f
/apks/malware/app46/source/com/inmobi/rendering/mraid/a.java
5e433f0b8f394ca79808fa527aa3bc899bd0091a
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
7,075
java
package com.inmobi.rendering.mraid; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; import android.provider.CalendarContract.Events; import com.inmobi.commons.core.utilities.Logger; import com.inmobi.commons.core.utilities.Logger.InternalLogLevel; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Locale; import org.json.JSONArray; import org.json.JSONException; public class a { private static final SimpleDateFormat[] a = { new SimpleDateFormat("yyyy-MM-dd'T'hh:mmZ", Locale.US), new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.US), new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz", Locale.US), new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US), new SimpleDateFormat("yyyy-MM-dd", Locale.US), new SimpleDateFormat("yyyy-MM", Locale.US), new SimpleDateFormat("yyyyMMddHHmmssZ", Locale.US), new SimpleDateFormat("yyyyMMddHHmm", Locale.US), new SimpleDateFormat("yyyyMMdd", Locale.US), new SimpleDateFormat("yyyyMM", Locale.US), new SimpleDateFormat("yyyy", Locale.US) }; private static String b = a.class.getSimpleName(); public a() {} @TargetApi(14) public static int a(Context paramContext) { int j = 0; paramContext = paramContext.getContentResolver().query(CalendarContract.Events.CONTENT_URI, new String[] { "_id", "title" }, null, null, null); int i = j; String str2; if (paramContext != null) { i = j; if (paramContext.moveToLast()) { i = paramContext.getColumnIndex("title"); j = paramContext.getColumnIndex("_id"); String str1 = paramContext.getString(i); str2 = paramContext.getString(j); if (str1 == null) { break label100; } } } label100: for (i = Integer.parseInt(str2);; i = 0) { paramContext.close(); return i; } } @SuppressLint({"SimpleDateFormat"}) public static String a(String paramString) { Object localObject2 = null; int j = 0; Object localObject1 = localObject2; Object localObject3; int k; int i; if (paramString != null) { localObject1 = localObject2; if (!"".equals(paramString)) { localObject3 = a; k = localObject3.length; i = 0; if (i >= k) { break label168; } localObject1 = localObject3[i]; } } for (;;) { try { localObject1 = ((SimpleDateFormat)localObject1).parse(paramString); paramString = (String)localObject1; localObject1 = localObject2; if (paramString != null) { localObject3 = new DateFormat[3]; localObject3[0] = new SimpleDateFormat("yyyyMMdd'T'HHmmssZ"); localObject3[1] = new SimpleDateFormat("yyyyMMdd'T'HHmm"); localObject3[2] = new SimpleDateFormat("yyyyMMdd"); k = localObject3.length; i = j; localObject1 = localObject2; if (i < k) { localObject1 = localObject3[i]; } } } catch (ParseException localParseException) { try { localObject1 = ((DateFormat)localObject1).format(Long.valueOf(paramString.getTime())); return localObject1; } catch (IllegalArgumentException localIllegalArgumentException) { i += 1; } localParseException = localParseException; i += 1; } continue; label168: paramString = null; } } public static String a(JSONArray paramJSONArray) { if ((paramJSONArray != null) && (paramJSONArray.length() != 0)) { Object localObject1 = new StringBuilder(); int i = 0; for (;;) { if (i < paramJSONArray.length()) { try { Object localObject2 = paramJSONArray.get(i); ((StringBuilder)localObject1).append(localObject2 + ","); i += 1; } catch (JSONException paramJSONArray) { Logger.a(Logger.InternalLogLevel.INTERNAL, b, "Could not parse day object " + paramJSONArray.toString()); paramJSONArray = null; } } } do { return paramJSONArray; localObject1 = ((StringBuilder)localObject1).toString(); i = ((String)localObject1).length(); if (i == 0) { return null; } paramJSONArray = (JSONArray)localObject1; } while (((String)localObject1).charAt(i - 1) != ','); return ((String)localObject1).substring(0, i - 1); } return null; } public static String a(JSONArray paramJSONArray, int paramInt1, int paramInt2) { Object localObject; int i; if ((paramJSONArray != null) && (paramJSONArray.length() != 0)) { localObject = new StringBuilder(); i = 0; } for (;;) { if (i < paramJSONArray.length()) { try { int j = paramJSONArray.getInt(i); if ((j < paramInt1) || (j > paramInt2) || (j == 0)) { Logger.a(Logger.InternalLogLevel.INTERNAL, b, "Value not in range"); } else { ((StringBuilder)localObject).append(j).append(","); } } catch (JSONException paramJSONArray) { Logger.a(Logger.InternalLogLevel.INTERNAL, b, "Could not parse day " + paramJSONArray.getMessage()); paramJSONArray = null; } } do { return paramJSONArray; localObject = ((StringBuilder)localObject).toString(); paramInt1 = ((String)localObject).length(); if (paramInt1 == 0) { return null; } paramJSONArray = (JSONArray)localObject; } while (((String)localObject).charAt(paramInt1 - 1) != ','); return ((String)localObject).substring(0, paramInt1 - 1); return null; i += 1; } } public static GregorianCalendar b(String paramString) { SimpleDateFormat[] arrayOfSimpleDateFormat = a; int j = arrayOfSimpleDateFormat.length; int i = 0; while (i < j) { SimpleDateFormat localSimpleDateFormat = arrayOfSimpleDateFormat[i]; try { Object localObject = localSimpleDateFormat.parse(paramString); GregorianCalendar localGregorianCalendar = new GregorianCalendar(); localGregorianCalendar.setTime((Date)localObject); Logger.a(Logger.InternalLogLevel.INTERNAL, b, "Date format: " + localSimpleDateFormat.toPattern()); localObject = (GregorianCalendar)localGregorianCalendar; return localObject; } catch (ParseException localParseException) { Logger.a(Logger.InternalLogLevel.INTERNAL, b, "Skipping format: " + localSimpleDateFormat.toPattern()); i += 1; } } return null; } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
baf65f835c83bd22f70f0d26eaf1710276f7adc2
07f2fa83cafb993cc107825223dc8279969950dd
/game_logic_server/src/main/java/com/xgame/logic/server/game/shop/message/ResBuyItemMessage.java
3c60057fa1efa9473e4b671586b58c92f8e82225
[]
no_license
hw233/x2-slg-java
3f12a8ed700e88b81057bccc7431237fae2c0ff9
03dcdab55e94ee4450625404f6409b1361794cbf
refs/heads/master
2020-04-27T15:42:10.982703
2018-09-27T08:35:27
2018-09-27T08:35:27
174,456,389
0
1
null
null
null
null
UTF-8
Java
false
false
1,392
java
package com.xgame.logic.server.game.shop.message; import com.xgame.logic.server.game.shop.bean.ItemBuyBean; import com.xgame.msglib.ResMessage; import com.xgame.msglib.able.Communicationable; import com.xgame.msglib.annotation.MsgField; /** * @author ProtocolEditor * Shop-ResBuyItem - 返回商城购买信息 */ public class ResBuyItemMessage extends ResMessage { //模块号+消息号 public static final int ID=120102; //模块号 public static final int FUNCTION_ID=120; //消息号 public static final int MSG_ID=102; /**商品购买信息*/ @MsgField(Id = 1) public ItemBuyBean shopBuyItem; @Override public int getId() { return ID; } @Override public String getQueue() { return "s2s"; } @Override public String getServer() { return null; } @Override public boolean isSync() { return false; } @Override public CommandEnum getCommandEnum() { return Communicationable.CommandEnum.PLAYERMSG; } @Override public HandlerEnum getHandlerEnum() { return Communicationable.HandlerEnum.SC; } @Override public String toString(){ StringBuffer buf = new StringBuffer("["); buf.append("shopBuyItem:" + shopBuyItem +","); if(buf.charAt(buf.length()-1)==',') buf.deleteCharAt(buf.length()-1); buf.append("},"); if(buf.charAt(buf.length()-1)==',') buf.deleteCharAt(buf.length()-1); buf.append("]"); return buf.toString(); } }
[ "ityuany@126.com" ]
ityuany@126.com
e44a4b2be9038694b347acfba35ddf3d8f26cafc
e5c57aa286c1dab9d97f013f076f5c6347873d09
/src/main/java/com/kk/autocode/encode/builder/AutoCodeBuilderInf.java
79ca348365055e0916b0ae2276775474a911ff0c
[]
no_license
kkzfl22/auto-code
39bb8d61b2c254a0c5fe6a38c5e9c456005bac1a
b9ecf58ad0cb397555ce7845478f38d3662276cf
refs/heads/master
2022-07-13T12:40:49.719117
2020-10-21T12:16:32
2020-10-21T12:16:32
243,685,503
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
package com.kk.autocode.encode.builder; import com.kk.autocode.encode.bean.CreateParamBean; /** * 生成代码的接口信息 * 源文件名:AutoCodeBuilderInf.java * 文件版本:1.0.0 * 创建作者:liujun * 创建日期:2016年10月12日 * 修改作者:liujun * 修改日期:2016年10月12日 * 文件描述:TODO * 版权所有:Copyright 2016 zjhz, Inc. All Rights Reserved. */ public interface AutoCodeBuilderInf { /** * 用来生成代码的操作 * 方法描述 * @param param * @创建日期 2016年10月12日 */ public void createCode(CreateParamBean param); }
[ "546064298@qq.com" ]
546064298@qq.com
86df222469a4b4951a328fc9e4537a7eb9f3479f
cce0f2bb8ba2e0dd34c49c347a76a09d791a85c0
/src/test/java/org/xenei/span/IntSpanImplTest.java
8a5015428de420139e7fa45fa941d03cc244d903
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
Claudenw/span
da6cf77417e8955c933c9c884883eee8c4c4d75f
0355e5c53ee4fcc6fbd89fe48fa523f64d26127d
refs/heads/master
2022-10-22T20:45:40.290750
2022-10-21T17:01:02
2022-10-21T17:01:02
192,810,279
0
0
Apache-2.0
2022-10-21T17:01:04
2019-06-19T22:04:01
Java
UTF-8
Java
false
false
2,652
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.xenei.span; import org.junit.Assert; import org.junit.Test; public class IntSpanImplTest { private IntSpan span; @Test public void testLengthIO0() { span = IntSpan.fromLength(0, 9); Assert.assertEquals(9, span.getLength()); Assert.assertEquals(0, span.getOffset()); Assert.assertEquals(8, span.getEnd()); } @Test public void testLengthIO1() { span = IntSpan.fromLength(1, 9); Assert.assertEquals(9, span.getLength()); Assert.assertEquals(1, span.getOffset()); Assert.assertEquals(9, span.getEnd()); } @Test public void testFromEndIO0() { span = IntSpan.fromEnd(0, 8); Assert.assertEquals(9, span.getLength()); Assert.assertEquals(0, span.getOffset()); Assert.assertEquals(8, span.getEnd()); } @Test public void testFromEndIO1() { span = IntSpan.fromEnd(1, 9); Assert.assertEquals(9, span.getLength()); Assert.assertEquals(1, span.getOffset()); Assert.assertEquals(9, span.getEnd()); } @Test public void testSpanOverlaps() { span = IntSpan.fromLength(1, 9); Assert.assertTrue(span.overlaps(IntSpan.fromLength(2, 3))); Assert.assertTrue(span.overlaps(IntSpan.fromLength(0, 3))); Assert.assertTrue(span.overlaps(IntSpan.fromLength(8, 3))); Assert.assertFalse(span.overlaps(IntSpan.fromLength(10, 2))); Assert.assertFalse(span.overlaps(IntSpan.fromLength(-2, 1))); } @Test public void testContains() { span = IntSpan.fromLength(1, 9); Assert.assertTrue(span.contains(2)); Assert.assertTrue(span.contains(1)); Assert.assertTrue(span.contains(9)); Assert.assertFalse(span.contains(0)); Assert.assertFalse(span.contains(10)); } }
[ "claude@xenei.com" ]
claude@xenei.com
cc28e3cf423653fedb865fceed3076e6cd4fc015
ea75f9296cb2a7cb5a65171a181a7e0982b15519
/src/main/java/com/ykh/pojo/Conferencerole.java
5e23cafb8a6d956a2e454a31eecd47da4c839c55
[]
no_license
toddpan/yhk_cms
90b194103086d67ad9a4ca4d1279515a25a445bc
b9c82051e810101dd66d8a45ce12282b9eba50e6
refs/heads/master
2021-01-16T17:42:57.915432
2015-09-22T14:35:27
2015-09-22T14:35:27
41,914,213
0
0
null
2015-09-13T12:28:25
2015-09-04T12:20:04
Java
UTF-8
Java
false
false
2,472
java
package com.ykh.pojo; import javax.xml.bind.annotation.XmlRootElement; /** * ClassName:Conferencerole * <p> * ClassDesc:会议中角色对象,在产品定义的时候确定。 * * @author dongyu.zhang * @version 1.0 * @since Ver 1.0 * @Date 2009 Apr 16, 2009 1:37:39 PM */ @XmlRootElement public class Conferencerole implements java.io.Serializable { // Fields /** * */ private static final long serialVersionUID = 1L; private Integer roleid; // private Product product; private String rolename; //private Integer maxuser; // private Set<Conferenceprivilege> conferenceprivileges = new HashSet<Conferenceprivilege>(0); //private Integer productid; // Constructors /** default constructor */ public Conferencerole() { } /** full constructor */ // public Conferencerole(Product product, String rolename, Integer maxuser, Set<Conferenceprivilege> conferenceprivileges) { // this.product = product; // this.rolename = rolename; // this.maxuser = maxuser; // this.conferenceprivileges = conferenceprivileges; // } public Conferencerole(String rolename) { this.rolename = rolename; } // Property accessors public int hashCode() { int result = 179; result = 37 * result + (roleid == null ? System.identityHashCode(this) : roleid.hashCode()); return result; } public Integer getRoleid() { return this.roleid; } public void setRoleid(Integer roleid) { this.roleid = roleid; } // @XmlElement(name="product") // public Product getProduct() { // return this.product; // } // // public void setProduct(Product product) { // this.product = product; // } public String getRolename() { return this.rolename; } public void setRolename(String rolename) { this.rolename = rolename; } // @XmlElement(name="conferenceprivilege") // public Set<Conferenceprivilege> getConferenceprivileges() { // return this.conferenceprivileges; // } // // public void setConferenceprivileges(Set<Conferenceprivilege> conferenceprivileges) { // this.conferenceprivileges = conferenceprivileges; // } /** * maxuser * * @return the maxuser */ // public Integer getMaxuser() { // return maxuser; // } // // /** // * maxuser // * // * @param maxuser the maxuser to set // */ // // public void setMaxuser(Integer maxuser) { // this.maxuser = maxuser; // } // public Integer getProductid() { // return productid; // } // // public void setProductid(Integer productid) { // this.productid = productid; // } }
[ "ant_shake_tree@163.com" ]
ant_shake_tree@163.com
6c02cdcb7e7f36765e205f4ead0e59ad9cd3008b
42bfbfaaae1f0dbfc8172bab078b80e65c9bb109
/java-project/src51/servlet/board/BoardAddServlet.java
b4b242dc8c464bfc13845c225911c66387fc1427
[]
no_license
leech5151/bitcamp
972e9e1358f19d6433fc9aa4b8f7258e76a7afc6
479419f6ff5448f3ccf1c33873ac3acc92da5927
refs/heads/master
2021-09-06T04:19:19.493102
2018-02-02T08:57:22
2018-02-02T08:57:22
104,423,463
0
0
null
null
null
null
UTF-8
Java
false
false
1,626
java
package java100.app.servlet.board; import java.io.IOException; import java.io.PrintWriter; 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 java100.app.dao.BoardDao; import java100.app.domain.Board; import java100.app.listener.ContextLoaderListener; //urlPatterns 속성 //- 클라이언트가 "/board/"로 시작하는 URL을 요청할 때 이 서블릿을 실행하라고 표시한다. //- /board/로 시작하는 요청이 들어오면 서블릿 컨테이너는 이 서블릿 객체를 실행한다. // @SuppressWarnings("serial") @WebServlet("/board/add") public class BoardAddServlet extends HttpServlet { public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { BoardDao boardDao = ContextLoaderListener.iocContainer.getBean(BoardDao.class); response.setContentType("text/plain;charset=UTF-8"); PrintWriter out = response.getWriter(); out.println("[게시물 등록]"); try { Board board = new Board(); board.setTitle(request.getParameter("title")); board.setContent(request.getParameter("content")); boardDao.insert(board); out.println("저장하였습니다."); } catch (Exception e) { e.printStackTrace(); // for developer out.println(e.getMessage()); // for user } } }
[ "Bit@Bitcamp" ]
Bit@Bitcamp
9aa5ee9e2de8c19d7aecf1060075a3ba1e0c2423
b6c9fe939af272678dff7e3bfd6a13bba2eb7113
/Thread/TestPriority.java
169c256cdd5546b28626255f3e2a3d623000d953
[]
no_license
FGHsg/PractiseOfJava
b18492cc3e7fea5f81289a97f0d058d08a3f4d49
08d763d0229015abd103a659abe0b157b456e693
refs/heads/master
2020-04-24T03:42:11.559596
2016-08-31T05:34:02
2016-08-31T05:34:02
67,006,379
1
0
null
null
null
null
UTF-8
Java
false
false
478
java
public class TestPriority { public static void main(String[] args) { Thread t1 = new Thread(new T1()); Thread t2 = new Thread(new T2()); t1.setPriority(Thread.NORM_PRIORITY + 3); t1.start(); t2.start(); } } class T1 implements Runnable { public void run() { for(int i=0; i<1000; i++) { System.out.println("T1: " + i); } } } class T2 implements Runnable { public void run() { for(int i=0; i<1000; i++) { System.out.println("------T2: " + i); } } }
[ "you@example.com" ]
you@example.com
4eb74f2b78150af6a77e8ef5e049dd021983e6b2
ffe540312c00fffda732f0c256917036c50f6029
/rdap-webapp/src/main/java/org/restfulwhois/rdap/core/ip/queryparam/NetworkQueryParam.java
c869135af6ae1e2deab8bc972ba06216760c5601
[ "BSD-2-Clause" ]
permissive
luciferxcv/rdap
8a71d4f67238a78294e7d0804c56df0a6ee110e9
dcc3f937640d3e516283f00cc85cc7a933e2f837
refs/heads/master
2020-12-28T23:45:31.009746
2014-12-06T10:37:56
2014-12-06T10:37:56
28,322,602
0
0
null
2015-01-07T06:58:36
2014-12-22T03:08:37
Java
UTF-8
Java
false
false
4,768
java
/* Copyright (c) 2012 - 2015, Internet Corporation for Assigned Names and * Numbers (ICANN) and China Internet Network Information Center (CNNIC) * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * **Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * **Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * **Neither the name of the ICANN, CNNIC nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ICANN OR CNNIC BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.restfulwhois.rdap.core.ip.queryparam; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.builder.ToStringBuilder; import org.restfulwhois.rdap.core.common.support.QueryParam; import org.restfulwhois.rdap.core.common.support.QueryUri; import org.restfulwhois.rdap.core.common.util.IpUtil; import org.restfulwhois.rdap.core.common.util.IpUtil.IpVersion; import org.restfulwhois.rdap.core.common.util.NetworkInBytes; import org.restfulwhois.rdap.core.ip.validator.NetworkQueryValidator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * base query parameter bean. * * @author jiashuo * @author weijunkai * */ public class NetworkQueryParam extends QueryParam { /** * LOGGER. */ private static final Logger LOGGER = LoggerFactory .getLogger(NetworkQueryParam.class); /** * networkInBytes. */ private NetworkInBytes networkInBytes; /** * constructor. * * @param request * request. * @param cidr * cidr. */ public NetworkQueryParam(HttpServletRequest request, String cidr) { super(request); super.setOriginalQ(cidr); super.setQ(cidr); } /** * constructor. * * @param cidr * q. */ public NetworkQueryParam(String cidr) { super(cidr); super.setOriginalQ(cidr); } /** * generateQueryParam * * @param cidr * cidr. * @return QueryParam. */ public static NetworkQueryParam generateQueryParam(String cidr) { NetworkQueryParam queryParam = new NetworkQueryParam(cidr); try { queryParam.fillParam(); } catch (Exception e) { LOGGER.error("parseIpQueryParam error:{}", e); return null; } return queryParam; } @Override protected void initValidators() { super.addValidator(new NetworkQueryValidator()); } @Override public void fillParam() throws Exception { this.parseFromNetworkStr(getQ()); } @Override public void convertParam() throws Exception { } /** * parseFromNetworkStr. * * @param networkStr * networkStr. */ private void parseFromNetworkStr(String networkStr) { IpVersion ipVersion = IpUtil.getIpVersionOfNetwork(networkStr); networkInBytes = IpUtil.parseNetwork(networkStr, ipVersion); } /** * get networkInBytes. * * @return networkInBytes. */ public NetworkInBytes getNetworkInBytes() { return networkInBytes; } /** * set networkInBytes. * * @param networkInBytes * networkInBytes. */ public void setNetworkInBytes(NetworkInBytes networkInBytes) { this.networkInBytes = networkInBytes; } @Override public String toString() { return new ToStringBuilder(this).append(getQ()).toString(); } @Override public QueryUri getQueryUri() { return QueryUri.IP; } }
[ "jiashuo@cnnic.cn" ]
jiashuo@cnnic.cn
2f3f136ffe916dae075b42f1e11f03121403c9a4
183732491ccf0693b044163c3eb9a0e657fcce94
/phloc-commons/src/main/java/com/phloc/commons/xml/serialize/IDOMReaderSettings.java
8cecf281cbcb6e6c9417de64cd9755466a7e4232
[]
no_license
phlocbg/phloc-commons
9b0d6699af33d67ee832c14e0594c97cef44c05d
6f86abe9c4bb9f9f94fe53fc5ba149356f88a154
refs/heads/master
2023-04-23T22:25:52.355734
2023-03-31T18:09:10
2023-03-31T18:09:10
41,243,446
0
0
null
2022-07-01T22:17:52
2015-08-23T09:19:38
Java
UTF-8
Java
false
false
3,507
java
/** * Copyright (C) 2006-2015 phloc systems * http://www.phloc.com * office[at]phloc[dot]com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.phloc.commons.xml.serialize; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.validation.Schema; /** * Read-only interface for DOM reader settings. * * @author Philip Helger */ public interface IDOMReaderSettings extends IBaseXMLReaderSettings { /** * @return <code>true</code> if the parser should be namespace aware, * <code>false</code> if not. */ boolean isNamespaceAware (); /** * @return <code>true</code> if the parser should be validating, * <code>false</code> if not. */ boolean isValidating (); /** * @return <code>true</code> if the parser should be element content * whitespace ignoring, <code>false</code> if not. */ boolean isIgnoringElementContentWhitespace (); /** * @return <code>true</code> if the parser should expand entity references, * <code>false</code> if not. */ boolean isExpandEntityReferences (); /** * @return <code>true</code> if the parser should ignore comments, * <code>false</code> if not. */ boolean isIgnoringComments (); /** * @return <code>true</code> if the parser should read CDATA as text, * <code>false</code> if not. */ boolean isCoalescing (); /** * @return A special XML schema to be used or <code>null</code> if none should * be used. */ @Nullable Schema getSchema (); /** * @return <code>true</code> if the parser should be XInclude aware, * <code>false</code> if not. */ boolean isXIncludeAware (); /** * @return <code>true</code> if a new XML parser is explicitly required for * this instance. */ boolean isRequiresNewXMLParserExplicitly (); /** * Check if the current settings require a separate * {@link javax.xml.parsers.DocumentBuilderFactory} or if a pooled default * object can be used. * * @return <code>true</code> if a separate * {@link javax.xml.parsers.DocumentBuilderFactory} is required, * <code>false</code> if not. */ boolean requiresNewXMLParser (); /** * Apply settings of this object onto the specified * {@link DocumentBuilderFactory} object. * * @param aDBF * The {@link DocumentBuilderFactory} to apply the settings onto. May * not be <code>null</code>. */ void applyToDocumentBuilderFactory (@Nonnull final DocumentBuilderFactory aDBF); /** * Apply settings of this object onto the specified {@link DocumentBuilder} * object. * * @param aDB * The {@link DocumentBuilder} to apply the settings onto. May not be * <code>null</code>. */ void applyToDocumentBuilder (@Nonnull final DocumentBuilder aDB); }
[ "bg@phloc.com" ]
bg@phloc.com
0beec858deea047194fe466226d5dc31cf73c5c9
4227b18d9731f8b791710845bb54f53818e53897
/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/TraceFeignObjectWrapper.java
e4dc0022aba36144fe380c73dac6c1bdd8ea161e
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
rageshmenon-ghub/spring-cloud-sleuth
b9403c056d182ad41807921871ded41ca9b934d7
be6165e69ca9d5d42efc95e5be9a8560fd709a18
refs/heads/master
2020-12-25T03:31:35.556638
2016-06-17T08:23:47
2016-06-17T08:23:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,739
java
package org.springframework.cloud.sleuth.instrument.web.client.feign; import org.springframework.beans.factory.BeanFactory; import org.springframework.cloud.sleuth.Tracer; import org.springframework.cloud.sleuth.instrument.web.HttpTraceKeysInjector; import feign.Client; import feign.Retryer; import feign.codec.Decoder; import feign.codec.ErrorDecoder; /** * Class that wraps Feign related classes into their Trace representative * * @author Marcin Grzejszczak * @since 1.0.1 */ final class TraceFeignObjectWrapper { private final BeanFactory beanFactory; private Tracer tracer; private HttpTraceKeysInjector keysInjector; TraceFeignObjectWrapper(BeanFactory beanFactory) { this.beanFactory = beanFactory; } Object wrap(Object bean) { if (bean instanceof Decoder && !(bean instanceof TraceFeignDecoder)) { return new TraceFeignDecoder(getTracer(), (Decoder) bean); } else if (bean instanceof Retryer && !(bean instanceof TraceFeignRetryer)) { return new TraceFeignRetryer(getTracer(), (Retryer) bean); } else if (bean instanceof Client && !(bean instanceof TraceFeignClient)) { return new TraceFeignClient(getTracer(), (Client) bean, getHttpTraceKeysInjector()); } else if (bean instanceof ErrorDecoder && !(bean instanceof TraceFeignErrorDecoder)) { return new TraceFeignErrorDecoder(getTracer(), (ErrorDecoder) bean); } return bean; } private Tracer getTracer() { if (this.tracer == null) { this.tracer = this.beanFactory.getBean(Tracer.class); } return this.tracer; } private HttpTraceKeysInjector getHttpTraceKeysInjector() { if (this.keysInjector == null) { this.keysInjector = this.beanFactory.getBean(HttpTraceKeysInjector.class); } return this.keysInjector; } }
[ "marcin@grzejszczak.pl" ]
marcin@grzejszczak.pl
7ab23456f38d82be86983f6892602b50241568aa
9f9a74f31c52b303c3daa9585bb757e71df7b4ba
/wise-web-console/src/main/java/com/wise/common/response/BootstrapTableResponse.java
cf55de525059d1f524847c37060f6c9d9853c294
[ "Apache-2.0" ]
permissive
zhechu/wise
7ae6cd4a24a2c2ab04b30f32016eebf5f884f12c
f0aa4a87c61b96ff1b31e6a5aa1a6003c7dce868
refs/heads/master
2020-12-30T16:16:24.426346
2017-05-11T12:47:02
2017-05-11T12:47:15
89,262,483
0
0
null
null
null
null
UTF-8
Java
false
false
715
java
package com.wise.common.response; import java.util.List; /** * bootstrap table 表格插件的响应对象 * @author lingyuwang * */ public class BootstrapTableResponse { /** * 数据列表 */ private List<?> rows; /** * 数据总条数 */ private long total; public BootstrapTableResponse() { super(); } public BootstrapTableResponse(List<?> rows, long total) { super(); this.rows = rows; this.total = total; } public List<?> getRows() { return rows; } public void setRows(List<?> rows) { this.rows = rows; } public long getTotal() { return total; } public void setTotal(long total) { this.total = total; } }
[ "ling-yu-wang@qq.com" ]
ling-yu-wang@qq.com
a326c5722839dae0559bebb9c2675870051d3203
bc07a4c05ca7fc730ab67d9f5f96ad2c8f0b4bc7
/utilcode/src/test/java/com/blankj/utilcode/util/TestUtils.java
bdf03f19d084f12f4375dcf2ab4d31429d2a734c
[ "Apache-2.0" ]
permissive
zxh965321/AndroidUtilCode
211bbe5eb5407a372b4a0783067c9cc8c465f4e8
3ce0e9c149e58febefdd38a130ddec3485e512f7
refs/heads/master
2021-04-27T03:30:40.977607
2018-02-24T06:09:26
2018-02-24T06:09:26
122,715,370
1
0
Apache-2.0
2018-02-24T07:27:19
2018-02-24T07:27:19
null
UTF-8
Java
false
false
643
java
package com.blankj.utilcode.util; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; /** * <pre> * author: Blankj * blog : http://blankj.com * time : 2016/08/21 * desc : 单元测试工具类 * </pre> */ @RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE) public class TestUtils { public static void init() { Utils.init(RuntimeEnvironment.application); } @Test public void test() throws Exception { } }
[ "625783482@qq.com" ]
625783482@qq.com
f0e82aa2623c97db5a24cbc89e4c0a5a7d45491e
55d9d68dfdce2d17bb65957dd11ae8ab09f4204f
/app/src/test/java/com/nilhcem/droidconde/data/database/DbMapperTest.java
8a5bc36478b9be6f18101d33d892fb74214ccc95
[ "Apache-2.0" ]
permissive
marekdef/droidconde-2016
8bad4241f760d48d320480498981e5cc3d012b29
8719590c537af27e99b2bad5ae4571933cf85d1b
refs/heads/master
2021-01-18T07:44:53.119332
2016-06-19T09:49:17
2016-06-19T09:49:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,025
java
package com.nilhcem.droidconde.data.database; import android.os.Build; import com.nilhcem.droidconde.BuildConfig; import com.nilhcem.droidconde.core.moshi.LocalDateTimeAdapter; import com.nilhcem.droidconde.data.app.AppMapper; import com.nilhcem.droidconde.data.app.model.Room; import com.nilhcem.droidconde.data.app.model.Session; import com.nilhcem.droidconde.data.app.model.Speaker; import com.squareup.moshi.Moshi; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricGradleTestRunner; import org.robolectric.annotation.Config; import org.threeten.bp.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import static com.google.common.truth.Truth.assertThat; import static java.util.Collections.singletonList; import static org.mockito.Mockito.when; @RunWith(RobolectricGradleTestRunner.class) @Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP) public class DbMapperTest { private DbMapper dbMapper; private final Moshi moshi = new Moshi.Builder().build(); private final AppMapper appMapper = new AppMapper(); private final LocalDateTime now = LocalDateTime.now(); @Mock LocalDateTimeAdapter adapter; @Before public void setup() { MockitoAnnotations.initMocks(this); dbMapper = new DbMapper(moshi, appMapper, adapter); } @Test public void should_convert_db_sessions_to_app_sessions() { // Given when(adapter.fromText("now")).thenReturn(now); com.nilhcem.droidconde.data.database.model.Session session = new com.nilhcem.droidconde.data.database.model.Session(2, "now", 10, 3, "[1]", "title", "description"); List<com.nilhcem.droidconde.data.database.model.Session> sessions = singletonList(session); Map<Integer, Speaker> speakersMap = new HashMap<>(); Speaker speaker = new Speaker(1, "name", null, null, null, null, null, null); speakersMap.put(1, speaker); // When List<Session> result = dbMapper.toAppSessions(sessions, speakersMap); // Then assertThat(result).hasSize(1); assertThat(result.get(0).getId()).isEqualTo(2); assertThat(result.get(0).getFromTime()).isEqualTo(now); assertThat(result.get(0).getTitle()).isEqualTo("title"); assertThat(result.get(0).getDescription()).isEqualTo("description"); assertThat(result.get(0).getSpeakers().get(0)).isEqualTo(speaker); } @Test public void should_convert_app_session_to_db_session() { // Given List<Speaker> speakers = singletonList(new Speaker(7, null, null, null, null, null, null, null)); Session session = new Session(11, Room.NONE.label, speakers, "title", "description", now, now.plusMinutes(45)); // When com.nilhcem.droidconde.data.database.model.Session result = dbMapper.fromAppSession(session); // Then assertThat(result.id).isEqualTo(11); assertThat(result.roomId).isEqualTo(Room.NONE.id); assertThat(result.speakersIds).isEqualTo("[7]"); assertThat(result.title).isEqualTo("title"); assertThat(result.description).isEqualTo("description"); } @Test public void should_convert_app_speaker_to_db_speaker() { // Given Speaker speaker = new Speaker(10, "name", "title", "bio", "website", "twitter", "github", "photo"); // When com.nilhcem.droidconde.data.database.model.Speaker result = dbMapper.fromAppSpeaker(speaker); // Then assertThat(result.id).isEqualTo(10); assertThat(result.name).isEqualTo("name"); assertThat(result.title).isEqualTo("title"); assertThat(result.bio).isEqualTo("bio"); assertThat(result.website).isEqualTo("website"); assertThat(result.twitter).isEqualTo("twitter"); assertThat(result.github).isEqualTo("github"); assertThat(result.photo).isEqualTo("photo"); } @Test public void should_convert_db_speakers_to_app_speakers() { // Given com.nilhcem.droidconde.data.database.model.Speaker speaker = new com.nilhcem.droidconde.data.database.model.Speaker(58, "nilh", "dev", "bio", "nilhcem.com", "Nilhcem", "nilhcem", "photo"); // When List<Speaker> result = dbMapper.toAppSpeakers(singletonList(speaker)); // Then assertThat(result).hasSize(1); assertThat(result.get(0).getId()).isEqualTo(58); assertThat(result.get(0).getName()).isEqualTo("nilh"); assertThat(result.get(0).getTitle()).isEqualTo("dev"); assertThat(result.get(0).getBio()).isEqualTo("bio"); assertThat(result.get(0).getWebsite()).isEqualTo("nilhcem.com"); assertThat(result.get(0).getTwitter()).isEqualTo("Nilhcem"); assertThat(result.get(0).getGithub()).isEqualTo("nilhcem"); assertThat(result.get(0).getPhoto()).isEqualTo("photo"); } }
[ "nilhcem@gmail.com" ]
nilhcem@gmail.com
661ae286e0a639a7314734ad56e5b7b61e445f72
4ae217d2a2d4e0a993490f2b58fc31cf343b8d72
/src/java/com/hzih/gap/dao/DeleteStatusDao.java
b6a57fa1f339e1637f6377dff95818a374cd75d6
[]
no_license
huanghengmin/gap
16afc9f7d9a48230eacaf24f4296929940a4cdd6
e6e52947001723afe44785175b6467e28c88a4d2
refs/heads/master
2021-01-01T05:45:18.292140
2016-04-16T02:17:16
2016-04-16T02:17:16
56,360,908
0
1
null
null
null
null
UTF-8
Java
false
false
421
java
package com.hzih.gap.dao; import cn.collin.commons.dao.BaseDao; import cn.collin.commons.domain.PageResult; import com.hzih.gap.domain.DeleteStatus; public interface DeleteStatusDao extends BaseDao{ public PageResult listByPage(int pageIndex, int limit) throws Exception; public DeleteStatus findByAppName(String appName) throws Exception; public void deleteByAppName(String appName) throws Exception; }
[ "465805947@QQ.com" ]
465805947@QQ.com
70f582fe46fd93995bf0cb1299781ff093d0d166
173a7e3c1d4b34193aaee905beceee6e34450e35
/kmzyc-supplier/kmzyc-supplier-web/src/main/java/com/kmzyc/supplier/common/ProductSkuDraftComparator.java
687884842ff00c2d7c07ed52a9ca523ddf88acb9
[]
no_license
jjmnbv/km_dev
d4fc9ee59476248941a2bc99a42d57fe13ca1614
f05f4a61326957decc2fc0b8e06e7b106efc96d4
refs/heads/master
2020-03-31T20:03:47.655507
2017-05-26T10:01:56
2017-05-26T10:01:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,960
java
package com.kmzyc.supplier.common; import com.pltfm.app.fobject.AttributeValue; import com.pltfm.app.vobject.ProductSkuDraft; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.io.Serializable; import java.util.Comparator; import java.util.List; /** * 功能:产品草稿sku规格列表排序, * <p>查询结果的目录中的sku属性需事先按照category_attr_id排序</p> * * @author Zhoujiwei * @since 2015/11/2 11:22 */ public class ProductSkuDraftComparator implements Comparator<ProductSkuDraft>, Serializable { private static final long serialVersionUID = -1776747606091441600L; public int compare(ProductSkuDraft o1, ProductSkuDraft o2) { if (o1 == null && o2 == null) { return 0; } else if (o2 == null) { return 1; } else if (o1 == null) { return -1; } //目录的sku属性集合事先按照category_attr_id排序 List<AttributeValue> valueList1 = o1.getAttributeValues(); List<AttributeValue> valueList2 = o2.getAttributeValues(); boolean flag1 = CollectionUtils.isEmpty(valueList1); boolean flag2 = CollectionUtils.isEmpty(valueList2); if (flag1 && flag2) { return 0; }else if (flag2) { return 1; } else if(flag1) { return -1; } int length = valueList1.size(); if (length != valueList2.size()) { return 0; } for (int i = 0; i < length; i++) { AttributeValue attributeValue1 = valueList1.get(i); AttributeValue attributeValue2 = valueList2.get(i); //当sku值相同,循环下一次 if (attributeValue1.getValue().equals(attributeValue2.getValue())) { continue; } String order1 = StringUtils.EMPTY; String order2 = StringUtils.EMPTY; //若是新增的sku规格,categoryAttrValueId为下标,从1开始计数,再其前加字母A,用来排序 if(Boolean.parseBoolean(attributeValue1.getIsNewAttr())) { order1 = "A"; } if(Boolean.parseBoolean(attributeValue2.getIsNewAttr())) { order2 = "A"; } if (attributeValue1.getCategoryAttrValueId() != null) { order1 += attributeValue1.getCategoryAttrValueId().toString(); } if (attributeValue2.getCategoryAttrValueId() != null) { order2 += attributeValue2.getCategoryAttrValueId().toString(); } int index = order1.compareTo(order2); //如果相同,则比较下一个目录sku属性,不同则返回 if (index != 0) { return index; } } return 0; } }
[ "luoxinyu@km.com" ]
luoxinyu@km.com
534269c37662d50082b307264fd6d487c187669a
1f3c00468850bc6e7794cb70efd8dd1c73eda1b5
/SmartTrafficAndroid/src/com/example/smarttraffic/news/Ydld.java
b6ddc57063efaefca0da7a539a99e45bb8d0236e
[]
no_license
litcas/PRJ
2861f3eabe163465fb640b5259d0b946a3d3778a
2cceb861502d8b7b0f54e4b99c50469b3c97b63a
refs/heads/master
2021-06-27T19:32:47.168612
2017-09-17T05:44:31
2017-09-17T05:44:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
800
java
package com.example.smarttraffic.news; public class Ydld { private String localKind; private String roadName; private String desc; private String rsEnd; private String rsStart; public String getLocalKind() { return localKind; } public void setLocalKind(String localKind) { this.localKind = localKind; } public String getRoadName() { return roadName; } public void setRoadName(String roadName) { this.roadName = roadName; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getRsEnd() { return rsEnd; } public void setRsEnd(String rsEnd) { this.rsEnd = rsEnd; } public String getRsStart() { return rsStart; } public void setRsStart(String rsStart) { this.rsStart = rsStart; } }
[ "393054246@qq.com" ]
393054246@qq.com
6b4d85dffc36e127a8e6611777277ee018785f79
6d9f43cfe25f91a0aba12454e193eaf8b80e6ab9
/fishing_app/app/src/main/java/multi/android/fishing_app/OnBoard.java
bfd36f2a49528c2573d26cf69eeb6eda91172dd8
[]
no_license
sonic247897/multicampus-android
5f35a9571f17bbc06a26ada415146142eb6987db
914cc401091682c77e65e9281f715d7c9873b816
refs/heads/master
2021-04-23T12:42:55.482707
2020-06-02T05:31:23
2020-06-02T05:31:23
249,926,079
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package multi.android.fishing_app; public class OnBoard { String zone; String point; String depth; String material; String tide_time; String target; String latitude; String longitude; }
[ "sonic247897@gmail.com" ]
sonic247897@gmail.com
59ae45f3a998da534d691af7ecddd53ba0d20fd2
1ecae42ff90c437ce67b217b66856fee393e013f
/.JETEmitters/src/org/talend/designer/codegen/translators/file/input/TFileInputMSPositionalEndJava.java
f73d8071af94263ebc41bc0885f5c83d7ca4a2aa
[]
no_license
dariofabbri/etl
e66233c970ab95a191816afe8c2ef64a8819562a
cb700ac6375ad57e5b78b8ab82958e4a3f9a09a7
refs/heads/master
2021-01-19T07:41:08.260696
2013-02-09T11:57:12
2013-02-09T11:57:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,234
java
package org.talend.designer.codegen.translators.file.input; import org.talend.core.model.process.INode; import org.talend.core.model.process.IConnection; import org.talend.designer.codegen.config.CodeGeneratorArgument; import java.util.List; public class TFileInputMSPositionalEndJava { protected static String nl; public static synchronized TFileInputMSPositionalEndJava create(String lineSeparator) { nl = lineSeparator; TFileInputMSPositionalEndJava result = new TFileInputMSPositionalEndJava(); nl = null; return result; } public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = "\t\tnb_line_"; protected final String TEXT_2 = "++;" + NL + "\t\t" + NL + "\t\tif(limit_"; protected final String TEXT_3 = " != -1 && nb_line_"; protected final String TEXT_4 = " >= limit_"; protected final String TEXT_5 = "){" + NL + "\t\t\tbreak;" + NL + "\t\t}" + NL + "\t}" + NL + "\treader_"; protected final String TEXT_6 = ".close();" + NL + "\treader_"; protected final String TEXT_7 = " = null;" + NL + "\tglobalMap.put(\""; protected final String TEXT_8 = "_NB_LINE\", nb_line_"; protected final String TEXT_9 = ");" + NL + "\tglobalMap.put(\""; protected final String TEXT_10 = "_NB_LINE_REJECTED\", nb_line_rejected_"; protected final String TEXT_11 = ");" + NL + "\tglobalMap.put(\""; protected final String TEXT_12 = "_NB_LINE_UNKOWN_HEADER_TYPES\", nb_line_unknownHeader_"; protected final String TEXT_13 = ");" + NL + "\tglobalMap.put(\""; protected final String TEXT_14 = "_NB_LINE_PARSE_ERRORS\", nb_line_parseError_"; protected final String TEXT_15 = ");"; protected final String TEXT_16 = NL; public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; INode node = (INode)codeGenArgument.getArgument(); String cid = node.getUniqueName(); List< ? extends IConnection> conns = node.getOutgoingSortedConnections(); if (conns!=null && conns.size()>0) { //1 stringBuffer.append(TEXT_1); stringBuffer.append(cid); stringBuffer.append(TEXT_2); stringBuffer.append(cid ); stringBuffer.append(TEXT_3); stringBuffer.append(cid ); stringBuffer.append(TEXT_4); stringBuffer.append(cid ); stringBuffer.append(TEXT_5); stringBuffer.append(cid ); stringBuffer.append(TEXT_6); stringBuffer.append(cid ); stringBuffer.append(TEXT_7); stringBuffer.append(cid); stringBuffer.append(TEXT_8); stringBuffer.append(cid); stringBuffer.append(TEXT_9); stringBuffer.append(cid); stringBuffer.append(TEXT_10); stringBuffer.append(cid); stringBuffer.append(TEXT_11); stringBuffer.append(cid); stringBuffer.append(TEXT_12); stringBuffer.append(cid); stringBuffer.append(TEXT_13); stringBuffer.append(cid); stringBuffer.append(TEXT_14); stringBuffer.append(cid); stringBuffer.append(TEXT_15); } //1 stringBuffer.append(TEXT_16); return stringBuffer.toString(); } }
[ "danilo.brunamonti@gmail.com" ]
danilo.brunamonti@gmail.com
8ccb8a01dd76b5afb24d0c18993e7e50e3457bab
5d886e65dc224924f9d5ef4e8ec2af612529ab93
/sources/com/android/systemui/p007qs/logging/QSLogger$logPanelExpanded$2.java
b77291916dd2413df76fd125435a76a5bc31894f
[]
no_license
itz63c/SystemUIGoogle
99a7e4452a8ff88529d9304504b33954116af9ac
f318b6027fab5deb6a92e255ea9b26f16e35a16b
refs/heads/master
2022-05-27T16:12:36.178648
2020-04-30T04:21:56
2020-04-30T04:21:56
260,112,526
3
1
null
null
null
null
UTF-8
Java
false
false
902
java
package com.android.systemui.p007qs.logging; import com.android.systemui.log.LogMessage; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Lambda; /* renamed from: com.android.systemui.qs.logging.QSLogger$logPanelExpanded$2 */ /* compiled from: QSLogger.kt */ final class QSLogger$logPanelExpanded$2 extends Lambda implements Function1<LogMessage, String> { public static final QSLogger$logPanelExpanded$2 INSTANCE = new QSLogger$logPanelExpanded$2(); QSLogger$logPanelExpanded$2() { super(1); } public final String invoke(LogMessage logMessage) { Intrinsics.checkParameterIsNotNull(logMessage, "$receiver"); StringBuilder sb = new StringBuilder(); sb.append(logMessage.getStr1()); sb.append(" expanded="); sb.append(logMessage.getBool1()); return sb.toString(); } }
[ "itz63c@statixos.com" ]
itz63c@statixos.com