blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
dd7e0548ecb2a10fa35e4b09be4859ef9cb8eaf3
de04049a6b1842b8000c744eed7476739837ec10
/app/src/main/java/com/compassecg/test720/compassecg/LoginActivity/cahnggeActivity.java
c6522b6cb695709c46de05506a67bfe54d3ed02f
[]
no_license
hunanwolf/MyECG
297565f1be42be642391e6d060a4f1c777ef2a92
ace466b212f9c7e1a2130cd29d5065190c31ccbc
refs/heads/master
2021-01-12T01:38:05.058494
2017-01-09T09:07:14
2017-01-09T09:07:14
78,411,658
0
0
null
null
null
null
UTF-8
Java
false
false
6,683
java
package com.compassecg.test720.compassecg.LoginActivity; import android.os.Bundle; import android.os.CountDownTimer; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.alibaba.fastjson.JSONObject; import com.compassecg.test720.compassecg.APP; import com.compassecg.test720.compassecg.R; import com.compassecg.test720.compassecg.unitl.BarBaseActivity; import com.compassecg.test720.compassecg.unitl.Connector; import com.loopj.android.http.RequestParams; import com.test720.auxiliary.Utils.L; import com.test720.auxiliary.Utils.RegularUtil; public class cahnggeActivity extends BarBaseActivity { public static String TAG = "com.compassecg.test720.compassecg.LoginActivity.BinDingActivity"; EditText phone; EditText pass; ImageView clear; TextView clear1; Button ok; private static final int SATAT = 1; //验证码 private static final int SATATl = 2;//注册 private CountDownTimer timer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.changgeactivity); setTitleString("更改绑定手机"); phone = getView(R.id.phone); pass = getView(R.id.pass); clear = getView(R.id.clear); clear1 = getView(R.id.clear1); clear.setOnClickListener(this); clear1.setOnClickListener(this); getView(R.id.ok).setOnClickListener(this); // 如果用户名改变,清空密码 phone.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { L.e("phone", phone.getText().length() + ""); if (phone.getText().length() == 0) { clear.setVisibility(View.GONE); } else { clear.setVisibility(View.VISIBLE); } } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void afterTextChanged(Editable s) { } }); } @Override public void onClick(View v) { super.onClick(v); switch (v.getId()) { case R.id.clear: phone.setText(""); clear.setVisibility(View.GONE); break; case R.id.clear1: String phonel = phone.getText().toString(); L.e("phonel", phonel); // if (!RegularUtil.isPhone(phonel)) { // phone.setError("请正确输入手机号"); // return; // } gainCode(); clear1.setText("已发送"); break; case R.id.ok: String phone2 = phone.getText().toString(); L.e("phone2", phone2); if (!RegularUtil.isPhone(phone2)) { phone.setError("请正确输入手机号"); return; } if (pass.getText().length() == 0) { pass.setError("请输入验证码"); return; } zhuce(); break; } } private void fetchCode() { clear1.setTextColor(getResources().getColor(R.color.gray_normal)); clear1.setText("重新获取(60S)"); clear1.setClickable(false); timer = new CountDownTimer(60000, 1000) { @Override public void onTick(long millisUntilFinished) { clear1.setText("重新获取(" + (int) (millisUntilFinished / 1000) + ")"); } @Override public void onFinish() { clear1.setTextColor(getResources().getColor(R.color.lv)); clear1.setText("获取验证码"); clear1.setClickable(true); } }.start(); } public void gainCode() { RequestParams params = new RequestParams(); params.put("type", 4); params.put("tel", getIntent().getExtras().getString("tel")); Postl(Connector.gainCode, params, SATAT); } public void zhuce() { RequestParams params = new RequestParams(); params.put("uid", APP.uuid); params.put("old_tel", getIntent().getExtras().getString("tel")); params.put("new_tel", phone.getText().toString()); params.put("rand", pass.getText().toString()); Post(Connector.editPhone, params, SATATl); } @Override public void Getsuccess(JSONObject jsonObject, int what) { super.Getsuccess(jsonObject, what); try { switch (what) { case SATAT: if (jsonObject.getIntValue("code") == 1) { ShowToast("发送成功"); fetchCode(); return; } if (jsonObject.getIntValue("code") == 0) { ShowToast("发送失败"); return; } if (jsonObject.getIntValue("code") == 2) { ShowToast("该手机已注册"); return; } if (jsonObject.getIntValue("code") == 3) { ShowToast("该手机未注册"); return; } break; case SATATl: if (jsonObject.getIntValue("code") == 1) { ShowToast("绑定成功"); RegisterActivity.test_a.finish(); finish(); return; } if (jsonObject.getIntValue("code") == 0) { ShowToast("绑定失败"); return; } if (jsonObject.getIntValue("code") == 2) { ShowToast("验证码不正确"); return; } if (jsonObject.getIntValue("code") == 3) { ShowToast("该手机已注册"); return; } break; } } catch (Exception e) { e.printStackTrace(); L.e(TAG, "数据炸了!"); } } }
[ "15828676432@168.com" ]
15828676432@168.com
8925a2a588fdc97c9dc2d6c82cc512a58be0ef3d
b399eb8df6f173aa90c0a1dbb0a45995d6a58d37
/src/java/servlets/ArithmeticCalculatorServlet.java
2d0d005fbab53e3ffa8b17b3548e1b6b69091b4f
[]
no_license
CKubinec/Week03LabWeb
9be65a75e4427b71c4ca6ba8ed75042c95f9efd6
360579586ff71ea6dd8e37e1316f92f84d755b88
refs/heads/master
2022-12-18T12:56:28.900975
2020-09-23T18:00:12
2020-09-23T18:00:12
298,048,211
0
0
null
null
null
null
UTF-8
Java
false
false
2,441
java
package servlets; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class ArithmeticCalculatorServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setAttribute("message", "---"); getServletContext().getRequestDispatcher("/WEB-INF/arithmeticCalculator.jsp").forward(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String firstNumber = request.getParameter("first"); String secondNumber = request.getParameter("second"); if (!isNumeric(firstNumber) || !isNumeric(secondNumber)) { request.setAttribute("message", "invalid"); } else { if(request.getParameter("+") != null) { request.setAttribute("message", Integer.parseInt(firstNumber)+Integer.parseInt(secondNumber)); } else if (request.getParameter("-") != null) { request.setAttribute("message", Integer.parseInt(firstNumber)-Integer.parseInt(secondNumber)); } else if(request.getParameter("*") != null) { request.setAttribute("message", Integer.parseInt(firstNumber)*Integer.parseInt(secondNumber)); } else if (request.getParameter("%") != null) { request.setAttribute("message", Integer.parseInt(firstNumber)%Integer.parseInt(secondNumber)); } else { request.setAttribute("message", firstNumber + " " + secondNumber); } } request.setAttribute("first", firstNumber); request.setAttribute("second", secondNumber); getServletContext().getRequestDispatcher("/WEB-INF/arithmeticCalculator.jsp").forward(request, response); } //Checks if string can be parsed to a number private boolean isNumeric(String string) { if (string == null || string.equals("")){ return false; } try { Integer.parseInt(string); return true; } catch(NumberFormatException e){ return false; } } }
[ "Craig@CraigsBeast" ]
Craig@CraigsBeast
f3c238a35d23b4b688675a00a42f944c010cf80f
354287be90ac93b7116f70625028f42eba2152e0
/netty-spring-webmvc/src/main/java/com/github/berrywang1996/netty/spring/web/mvc/bind/annotation/PathVariable.java
79e6fccd5b46942e4cfcaec920432e49d79c0ad3
[ "Apache-2.0" ]
permissive
BerryWang1996/netty-spring
4f85281467b7abd923916d407920b58ce773f2a9
07f7a111a5be5693df941753722f8a59850bce45
refs/heads/master
2020-03-25T22:20:36.575589
2018-08-27T03:58:38
2018-08-27T03:58:38
144,217,658
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package com.github.berrywang1996.netty.spring.web.mvc.bind.annotation; import java.lang.annotation.*; /** * @author berrywang1996 * @since V1.0.0 */ @Documented @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface PathVariable { String value() default ""; }
[ "wangbor@yeah.net" ]
wangbor@yeah.net
f6fa0ca9bd616c9606006a2be1c50bd1a3cb8544
15b06137958750cff8a4b4c2e78a30a195f9d3e7
/src/main/java/com/envyleague/cricket/web/rest/CricketLeagueController.java
9984acdfb7cbbf0520638cd810f27dddb884c902
[ "Apache-2.0" ]
permissive
vtapadia/envyleague.cricket
bc3f2a6d4e4ced2ba5e38270ddbbac018421911b
bdca2ca4a595220e37269862050b620865532785
refs/heads/master
2021-06-18T11:12:22.463261
2016-06-05T21:20:30
2016-06-05T21:20:30
27,096,824
0
0
null
null
null
null
UTF-8
Java
false
false
5,724
java
package com.envyleague.cricket.web.rest; import com.envyleague.cricket.domain.Authority; import com.envyleague.cricket.domain.League; import com.envyleague.cricket.domain.Status; import com.envyleague.cricket.domain.User; import com.envyleague.cricket.domain.UserLeague; import com.envyleague.cricket.repository.LeagueRepository; import com.envyleague.cricket.service.LeagueService; import com.envyleague.cricket.service.UserLeagueService; import com.envyleague.cricket.service.UserService; import com.envyleague.cricket.web.dto.LeagueDTO; import com.envyleague.cricket.web.dto.UserLeagueDTO; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotNull; import java.util.List; import java.util.stream.Collectors; @RestController @RequestMapping("/rest/cricket/league") public class CricketLeagueController { private final Logger log = LoggerFactory.getLogger(getClass()); @Inject LeagueService leagueService; @Inject LeagueRepository leagueRepository; @Inject UserService userService; @Inject UserLeagueService userLeagueService; @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<?> myLeagues( @RequestParam(value = "owned", required = false, defaultValue = "false") boolean owned, @RequestParam(value = "league", required = false, defaultValue = "") String leagueName, HttpServletRequest request, HttpServletResponse response) { User currentUser = userService.getUserWithAuthorities(); List<LeagueDTO> allLeagues = currentUser.getUserLeagues().stream() .map(ul -> ul.getLeague()) .filter(f1 -> (!owned || f1.getOwner().getLogin().equals(currentUser.getLogin()))) .filter(f2 -> (StringUtils.isBlank(leagueName) || f2.getName().equals(leagueName))) .map(LeagueDTO::new).collect(Collectors.toList()); if (! currentUser.getAuthorities().contains(Authority.ADMIN) && !owned) { //Not Admin, filter others if not league owner. allLeagues.forEach(l -> { if (! l.getOwner().getLogin().equals(currentUser.getLogin())) { //Not owner, only sent logged in User Details. l.setPlayers(l.getPlayers().stream().filter(p -> p.getUser().equals(currentUser.getLogin())).collect(Collectors.toList())); } }); } return new ResponseEntity<>(allLeagues, HttpStatus.OK); } @RequestMapping(method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<?> updateMyLeague(@NotNull @RequestBody LeagueDTO leagueDTO) { log.info("Update league request " + leagueDTO); User currentUser = userService.getUserWithAuthorities(); League league = leagueRepository.findOneByName(leagueDTO.getName()); if (league == null) { log.error("SECURITY_ALERT: User {} updating invalid league {}", currentUser, leagueDTO); return new ResponseEntity<String>("League name not found", HttpStatus.BAD_REQUEST); } if (!league.getOwner().getLogin().equals(currentUser.getLogin())) { log.error("SECURITY_ALERT: User {} updating other league {}", currentUser, leagueDTO); return new ResponseEntity<String>("League not owned by you.", HttpStatus.BAD_REQUEST); } if (!leagueDTO.getPlayers().stream() .filter(p -> p.getUser().equals(currentUser.getLogin())) .filter(z -> z.getStatus() == Status.ACTIVE) .findAny().isPresent()) { return new ResponseEntity<String>("League owner is not allowed to run away. :)", HttpStatus.BAD_REQUEST); } for(UserLeague userLeague : league.getUserLeagues()) { for (UserLeagueDTO userLeagueDTO : leagueDTO.getPlayers()) { if (userLeague.getUser().getLogin().equals(userLeagueDTO.getUser())) { try { userLeagueService.save(userLeague, userLeagueDTO.getStatus()); } catch (Exception e) { return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST); } } } } return new ResponseEntity<>(HttpStatus.OK); } @RequestMapping(method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<?> registerNewLeague(@NotNull @RequestBody LeagueDTO leagueDTO) { log.info("New league request " + leagueDTO); if (leagueRepository.findOneByName(leagueDTO.getName()) != null) { return new ResponseEntity<String>("League name already in use", HttpStatus.BAD_REQUEST); } try { leagueService.requestNewLeague(leagueDTO.getName(), leagueDTO.getFee()); } catch (Exception e) { return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(HttpStatus.CREATED); } }
[ "varesh.tapadia@gmail.com" ]
varesh.tapadia@gmail.com
16327649eaed76ffdf8c6ec621a1c5e85944b732
7ee5281ba8d53578a37901c088f6067c7a9dce68
/src/main/java/com/scms/dao/BaseDao.java
5944c5700c8381e6d2a47538cde302106588cd6d
[]
no_license
xieding001/SCMS
243100d9ea2cffcabc0e74d17132ba305d9beb43
e674ade3b1116e61895c4e2151e38d7207569758
refs/heads/master
2021-01-21T08:05:20.895068
2017-08-31T02:43:48
2017-08-31T02:43:48
101,951,060
0
0
null
null
null
null
UTF-8
Java
false
false
583
java
package com.scms.dao; /** * Created by xieding001 on 2017/8/29. */ import com.scms.model.Channel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.repository.CrudRepository; import java.io.Serializable; import java.math.BigInteger; import java.util.List; /** * 基础数据库操作类 * * @author ss * */ public class BaseDao<T> { @Autowired // This means to get the bean called userRepository // Which is auto-generated by Spring, we will use it to handle the data private CrudRepository crudRepository; }
[ "xieding001@Dings-pc.(none)" ]
xieding001@Dings-pc.(none)
93588d06a6c4f5534728573d8aad705bb2a87e82
f2eb5c54e4e973726b9d90b65e5ec13c28f36b55
/gmall-admin-web/src/test/java/com/Evil/gmall/admin/GmallAdminWebApplicationTests.java
30a77b6246856defe7f67e50a8c931f44d6ff323
[]
no_license
JNianqi/gmall
03b15f8b20afae52feefe10bcd470cf7ad29e62c
5c92f0ade76f53137204f5d9693c00515063196b
refs/heads/master
2022-06-22T14:10:57.985401
2020-04-05T03:19:14
2020-04-05T03:19:14
252,950,539
0
0
null
2022-06-21T03:08:23
2020-04-04T08:50:05
Java
UTF-8
Java
false
false
228
java
package com.Evil.gmall.admin; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class GmallAdminWebApplicationTests { @Test void contextLoads() { } }
[ "857015447@qq.com" ]
857015447@qq.com
9fbe7d7bccda2051bbbfadfb9264e1398aa2d9d4
cfbc4040f714168c49d3cd533e626ebd883f5ba8
/src/test/java/freemarker/test/TemplateTest.java
03cd41e99bcfc3ad4c81014b9badc37ad8a676c6
[ "Apache-2.0", "LicenseRef-scancode-freemarker", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jacopoc/freemarker
149ab59058dbae3143668a6daba7421014df4ef3
9d65281d4669563d9e37819881374a0f772e421c
refs/heads/master
2021-01-20T03:06:18.442155
2015-05-30T19:44:38
2015-05-30T19:45:52
34,898,094
1
0
null
2015-05-01T10:20:00
2015-05-01T10:20:00
null
UTF-8
Java
false
false
4,607
java
/* * Copyright 2014 Attila Szegedi, Daniel Dekany, Jonathan Revusky * * 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 freemarker.test; import static org.junit.Assert.*; import java.io.IOException; import java.io.StringWriter; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.junit.Ignore; import freemarker.core.ParseException; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; import freemarker.template.utility.StringUtil; import freemarker.test.templatesuite.TemplateTestSuite; /** * Superclass of JUnit tests that process templates but aren't practical to implement via {@link TemplateTestSuite}. */ @Ignore public abstract class TemplateTest { private Configuration configuration = new Configuration(Configuration.VERSION_2_3_0); public Configuration getConfiguration() { return configuration; } public void setConfiguration(Configuration configuration) { this.configuration = configuration; } protected void assertOutput(String ftl, String expectedOut) throws IOException, TemplateException { Template t = new Template(null, ftl, configuration); assertOutput(t, expectedOut); } protected void assertOutputForNamed(String name, String expectedOut) throws IOException, TemplateException { assertOutput(configuration.getTemplate(name), expectedOut); } private void assertOutput(Template t, String expectedOut) throws TemplateException, IOException { StringWriter out = new StringWriter(); t.process(createDataModel(), out); assertEquals(expectedOut, out.toString()); } protected Object createDataModel() { return null; } @SuppressWarnings("boxing") protected Map<String, Object> createCommonTestValuesDataModel() { Map<String, Object> dataModel = new HashMap<String, Object>(); dataModel.put("map", Collections.singletonMap("key", "value")); dataModel.put("list", Collections.singletonList("item")); dataModel.put("s", "text"); dataModel.put("n", 1); dataModel.put("b", true); dataModel.put("bean", new TestBean()); return dataModel; } protected void assertErrorContains(String ftl, String... expectedSubstrings) { try { new Template("adhoc", ftl, configuration).process(createDataModel(), new StringWriter()); fail("The tempalte had to fail"); } catch (TemplateException e) { assertContainsAll(e.getMessageWithoutStackTop(), expectedSubstrings); } catch (ParseException e) { assertContainsAll(e.getEditorMessage(), expectedSubstrings); } catch (IOException e) { throw new RuntimeException("Unexpected exception class: " + e.getClass().getName(), e); } } private void assertContainsAll(String msg, String... expectedSubstrings) { for (String needle: expectedSubstrings) { if (needle.startsWith("\\!")) { String netNeedle = needle.substring(2); if (msg.contains(netNeedle)) { fail("The message shouldn't contain substring " + StringUtil.jQuote(netNeedle) + ":\n" + msg); } } else if (!msg.contains(needle)) { fail("The message didn't contain substring " + StringUtil.jQuote(needle) + ":\n" + msg); } } } public static class TestBean { private int x; private boolean b; public int getX() { return x; } public void setX(int x) { this.x = x; } public boolean isB() { return b; } public void setB(boolean b) { this.b = b; } public int intM() { return 1; } public int intMP(int x) { return x; } public void voidM() { } } }
[ "ddekany@freemail.hu" ]
ddekany@freemail.hu
c63329b6cb52997141efa0132fa4f1ba36faf0f0
13708efa6045d42815f289862f31721148c6f6ef
/gfx/GfxPlayerPill.java
bc0187e1fec849077c61c047e5ab501421870d89
[]
no_license
Satariel88/TicTacToe3D
1a40d2959f7c40484ac6843761fd87ff17b75db0
5ed3337d1c399c9351e0db4652081fd8cf209b60
refs/heads/master
2016-09-14T14:06:26.100687
2016-05-21T11:03:25
2016-05-21T11:03:25
59,347,894
0
0
null
null
null
null
UTF-8
Java
false
false
462
java
package project.core.gfx; import static playn.core.PlayN.assets; import playn.core.AssetWatcher; import project.core.logic.Board; public class GfxPlayerPill extends GfxPill { public GfxPlayerPill(int row, int col, Board board) { super(true, row, col, board, getImage().subImage(0, 0, SIZE.width(), SIZE.height())); } public static void loadImages(AssetWatcher watcher) { setImage(assets().getImage(IMAGE_PATH)); watcher.add(getImage()); } }
[ "epilo86@gmail.com" ]
epilo86@gmail.com
58b4f1219eae28f0ce6eb873bcd9c3fe0b07b885
47bee068ddb9dacfff94d08341f604ebe97f9fef
/src/main/java/com/smlsnnshn/Lessons/day24_25_26_27_28_29_arrays/Task_90.java
e3a329fe447581055f0c7db7cbecce47c3b40762
[]
no_license
ismailsinansahin/JavaLessons
55686229d946390a52383f5d80e1053f411286e7
768cb63e22462e7c2eef709102df5d19d9c98568
refs/heads/master
2023-07-18T23:10:31.302133
2021-09-14T20:56:35
2021-09-14T20:56:35
360,487,169
2
0
null
null
null
null
UTF-8
Java
false
false
464
java
package com.smlsnnshn.Lessons.day24_25_26_27_28_29_arrays; public class Task_90 { public static void main(String[] args) { String[] cars = {"Toyota", "Honda", "Nissan", "BMW", "Mercedes"}; boolean flag = false; for (int i=0 ; i < cars.length ; i++) { if (cars[i].equals("Honda")) { flag = true; break; } } if (flag) { System.out.println("I found it!"); }else { System.out.println("Not found it!"); } } }
[ "ismailsinansahin@gmail.com" ]
ismailsinansahin@gmail.com
e4d2aad408e70639e9a1478a2038735ea815eff1
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/XWIKI-13942-1-17-Single_Objective_GGA-WeightedSum-BasicBlockCoverage/org/xwiki/model/internal/reference/ExplicitStringEntityReferenceResolver_ESTest.java
a30d03083878e6ba8f8c398b0bd1981ec45ef9be
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
2,128
java
/* * This file was automatically generated by EvoSuite * Sun May 17 17:14:19 UTC 2020 */ package org.xwiki.model.internal.reference; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.evosuite.runtime.javaee.injection.Injector; import org.junit.runner.RunWith; import org.xwiki.model.EntityType; import org.xwiki.model.internal.reference.AbstractStringEntityReferenceResolver; import org.xwiki.model.internal.reference.ExplicitStringEntityReferenceResolver; import org.xwiki.model.internal.reference.SymbolScheme; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class ExplicitStringEntityReferenceResolver_ESTest extends ExplicitStringEntityReferenceResolver_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { ExplicitStringEntityReferenceResolver explicitStringEntityReferenceResolver0 = new ExplicitStringEntityReferenceResolver(); SymbolScheme symbolScheme0 = mock(SymbolScheme.class, new ViolatedAssumptionAnswer()); Injector.inject(explicitStringEntityReferenceResolver0, (Class<?>) AbstractStringEntityReferenceResolver.class, "symbolScheme", (Object) symbolScheme0); Injector.validateBean(explicitStringEntityReferenceResolver0, (Class<?>) ExplicitStringEntityReferenceResolver.class); EntityType entityType0 = EntityType.ATTACHMENT; Object[] objectArray0 = new Object[6]; objectArray0[0] = (Object) entityType0; objectArray0[1] = (Object) explicitStringEntityReferenceResolver0; objectArray0[2] = (Object) explicitStringEntityReferenceResolver0; objectArray0[3] = (Object) symbolScheme0; objectArray0[4] = objectArray0[3]; objectArray0[5] = (Object) symbolScheme0; // Undeclared exception! explicitStringEntityReferenceResolver0.resolveDefaultReference(entityType0, objectArray0); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
22976cc8f9699bc5c98999f70921e66763e55531
2e0edd227ef5a4366cc788b3410b6a12ad39409d
/08-Bridge/src/main/java/example1/Implementor/RefinedAbstraction/Green.java
4bb981429d714911266a77bfaac56a52b44fc21f
[]
no_license
wuzhaozhen/DesignPatterns
a1f83a1a97685ed0bb52493c777565723df53181
77a60a86f0311e0a519147ecd769e45288fcd483
refs/heads/master
2021-06-28T02:16:15.079817
2019-07-25T09:58:08
2019-07-25T09:58:08
102,952,195
0
0
null
null
null
null
UTF-8
Java
false
false
353
java
package example1.Implementor.RefinedAbstraction; import example1.Implementor.Color; /** * 具体的实现 * * @author wuzz * @date 2018年10月8日 下午2:26:30 */ public class Green implements Color { @Override public void bepaint(String penType, String name) { System.out.println(penType + "绿色的" + name + "."); } }
[ "2535379543@qq.com" ]
2535379543@qq.com
2b7850ff4eec93715f363b3d3a113df55d10aa88
d1b078f07f4699ff308c04b47b93a8a28d8b39a3
/quarkus-workshop-super-heroes/extensions/extension-fault-injector/deployment/src/main/java/io/quarkus/workshop/superheroes/quack/deployment/QuackProcessor.java
f57631affb27bb611b1871c860a33a3972ff048a
[ "Apache-2.0" ]
permissive
bbvahackathon/quarkus-workshops
dcc7f45ca7523e5b429c4b87f1294d556335e20d
eee54afb85ca9361feb5bb3414a2125263fecb57
refs/heads/master
2023-01-23T19:15:05.899464
2020-11-23T11:21:34
2020-11-23T11:21:34
312,293,958
1
0
Apache-2.0
2020-11-16T14:20:49
2020-11-12T14:01:57
Java
UTF-8
Java
false
false
1,283
java
package io.quarkus.workshop.superheroes.quack.deployment; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.annotations.ExecutionTime; import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.vertx.http.deployment.VertxWebRouterBuildItem; import io.quarkus.workshop.superheroes.quack.runtime.FaultInjectorRecorder; import io.quarkus.workshop.superheroes.quack.runtime.QuackConfig; /** * The Quack /. Fault injector processor. */ public class QuackProcessor { /** * Configures the fault injection and registers the route. * * @param feature to produce a feature build item * @param recorder the recorder executing the initialization * @param config the config * @param router the router on which the faults are going to be injected */ @BuildStep @Record(ExecutionTime.RUNTIME_INIT) void initialize(BuildProducer<FeatureBuildItem> feature, FaultInjectorRecorder recorder, QuackConfig config, VertxWebRouterBuildItem router) { feature.produce(new FeatureBuildItem("quack")); recorder.configure(config, router.getRouter()); } }
[ "clement.escoffier@gmail.com" ]
clement.escoffier@gmail.com
eef5a19f7eb6c314a77197fd4c93b3d15964f077
08b8d598fbae8332c1766ab021020928aeb08872
/src/gcom/gui/cadastro/localidade/ResultadoPesquisaSetorComercialActionForm.java
734fb4ac6c2bb4963d06b1454ed72fc1189fd92a
[]
no_license
Procenge/GSAN-CAGEPA
53bf9bab01ae8116d08cfee7f0044d3be6f2de07
dfe64f3088a1357d2381e9f4280011d1da299433
refs/heads/master
2020-05-18T17:24:51.407985
2015-05-18T23:08:21
2015-05-18T23:08:21
25,368,185
3
1
null
null
null
null
WINDOWS-1252
Java
false
false
3,978
java
/* * Copyright (C) 2007-2007 the GSAN – Sistema Integrado de Gestão de Serviços de Saneamento * * This file is part of GSAN, an integrated service management system for Sanitation * * GSAN is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License. * * GSAN is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place – Suite 330, Boston, MA 02111-1307, USA */ /* * GSAN – Sistema Integrado de Gestão de Serviços de Saneamento * Copyright (C) <2007> * Adriano Britto Siqueira * Alexandre Santos Cabral * Ana Carolina Alves Breda * Ana Maria Andrade Cavalcante * Aryed Lins de Araújo * Bruno Leonardo Rodrigues Barros * Carlos Elmano Rodrigues Ferreira * Cláudio de Andrade Lira * Denys Guimarães Guenes Tavares * Eduardo Breckenfeld da Rosa Borges * Fabíola Gomes de Araújo * Flávio Leonardo Cavalcanti Cordeiro * Francisco do Nascimento Júnior * Homero Sampaio Cavalcanti * Ivan Sérgio da Silva Júnior * José Edmar de Siqueira * José Thiago Tenório Lopes * Kássia Regina Silvestre de Albuquerque * Leonardo Luiz Vieira da Silva * Márcio Roberto Batista da Silva * Maria de Fátima Sampaio Leite * Micaela Maria Coelho de Araújo * Nelson Mendonça de Carvalho * Newton Morais e Silva * Pedro Alexandre Santos da Silva Filho * Rafael Corrêa Lima e Silva * Rafael Francisco Pinto * Rafael Koury Monteiro * Rafael Palermo de Araújo * Raphael Veras Rossiter * Roberto Sobreira Barbalho * Rodrigo Avellar Silveira * Rosana Carvalho Barbosa * Sávio Luiz de Andrade Cavalcante * Tai Mu Shih * Thiago Augusto Souza do Nascimento * Tiago Moreno Rodrigues * Vivianne Barbosa Sousa * * Este programa é software livre; você pode redistribuí-lo e/ou * modificá-lo sob os termos de Licença Pública Geral GNU, conforme * publicada pela Free Software Foundation; versão 2 da * Licença. * Este programa é distribuído na expectativa de ser útil, mas SEM * QUALQUER GARANTIA; sem mesmo a garantia implícita de * COMERCIALIZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM * PARTICULAR. Consulte a Licença Pública Geral GNU para obter mais * detalhes. * Você deve ter recebido uma cópia da Licença Pública Geral GNU * junto com este programa; se não, escreva para Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307, USA. */ package gcom.gui.cadastro.localidade; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; public class ResultadoPesquisaSetorComercialActionForm extends ActionForm { private static final long serialVersionUID = 1L; private String Button; private String auxiliar; private String[] setorComercialID; public String getButton(){ return Button; } public void setButton(String Button){ this.Button = Button; } public String getAuxiliar(){ return auxiliar; } public void setAuxiliar(String auxiliar){ this.auxiliar = auxiliar; } public String[] getSetorComercialID(){ return setorComercialID; } public void setSetorComercialID(String[] setorComercialID){ this.setorComercialID = setorComercialID; } public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest){ /** @todo: finish this method, this is just the skeleton. */ return null; } public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest){ } }
[ "Yara.Souza@procenge.com.br" ]
Yara.Souza@procenge.com.br
0840ca813fd5bc9dfeda636c8f4858c57e3be230
92aeb40918514cac7502b2c306a0fad6c458be83
/src/queries/Q_ConnectDB.java
c15452f33d56cfd76e5058cc4a5fc225cea730b4
[]
no_license
vzupka/IBMiSqlScripts
abc35b935b23255bac238bb5046362e9d4eaa1ac
9161e8c9102932afb410fbeb3c45edec459311ba
refs/heads/master
2021-01-22T21:59:32.620493
2017-06-04T08:45:03
2017-06-04T08:45:03
92,749,743
2
0
null
null
null
null
UTF-8
Java
false
false
5,489
java
package queries; import java.nio.file.Path; import java.nio.file.Paths; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Locale; import java.util.Properties; import java.util.ResourceBundle; /** * Establishes connection to IBM i through JDBC. * * @author Vladimír Župka 2016 * */ public class Q_ConnectDB { // Error message static String msg; ResourceBundle locMessages; String driver, connErr; ResourceBundle titles; String decSeparator; String sortLanguage; String host; String library; String userName; String password; String language; Connection connection; String encoding = System.getProperty("file.encoding"); Path inPath = Paths.get(System.getProperty("user.dir"), "paramfiles", "Q_Parameters.txt"); /** * Connects to IBM i using IBM i JDBC driver * * @return object of class java.sql.Connection */ public Connection connect() { // Application properties Q_Properties prop = new Q_Properties(); host = prop.getProperty("HOST"); userName = prop.getProperty("USER_NAME"); library = prop.getProperty("LIBRARY"); // library list language = prop.getProperty("LANGUAGE"); Locale currentLocale = Locale.forLanguageTag(language); locMessages = ResourceBundle.getBundle("locales.L_MessageBundle", currentLocale); // Localized messages driver = locMessages.getString("Driver"); connErr = locMessages.getString("ConnErr"); // Localized decimal separator character titles = ResourceBundle.getBundle("locales.L_TitleLabelBundle", currentLocale); decSeparator = titles.getString("DecSeparator"); sortLanguage = titles.getString("SortLanguage"); try { // Obtain JDBC driver for DB2 Class.forName("com.ibm.as400.access.AS400JDBCDriver"); // Set connection properties Properties conprop = new Properties(); conprop.put("user", userName); // ???? password // conprop.put("password", "ZUP047"); // decimal separator LOCALIZED conprop.put("decimal separator", decSeparator); // intermediate BigDecimal conversion for packed and zoned "true" // (or "false" - convert directly to double) conprop.put("big decimal", "true"); // sort language LOCALIZED conprop.put("sort language", sortLanguage); // lower case = upper case (or "unique") conprop.put("sort weight", "shared"); // no exception (or "true" = exception) conprop.put("data truncation", "false"); // system naming (or "sql") conprop.put("naming", "system"); // sort by language (or "hex" or "table") conprop.put("sort", "language"); // library list conprop.put("libraries", library); // date format ISO (or "mdy" "dmy" "ymd" "usa" "eur" "jis" // "julian") conprop.put("date format", "iso"); // time format ISO (or "hms" "usa" "eur" "jis") conprop.put("time format", "iso"); // block unless FOR UPDATE is specified "2" // (or "0" (no record blocking) // or "1" (block if FOR FETCH ONLY is specified)) conprop.put("block criteria", "2"); // block size 512 (or "0" "8" "16" "32" "64" "128" "256") conprop.put("block size", "512"); // result data compression true (or "false") conprop.put("data compression", "true"); // error message detail basic (or "full") conprop.put("errors", "basic"); // access all (or "read call" (SELECT and CALL statements allowed) // or "read only" (SELECT statements only)) conprop.put("access", "all"); // "1" = Optimize query for first block of data (*FIRSTIO) // or "2" = Optimize query for entire result set (*ALLIO) // or "0" = Optimize query for first block of data (*FIRSTIO) when // extended dynamic packages are used; Optimize query for entire result // set (*ALLIO) when packages are not used conprop.put("query optimize goal", "1"); // full open a file "false" optimizes performance (or "true") conprop.put("full open", "false"); // "false" - writing truncated data to the database // - no exception, no attention // (or "true" - exception, attention) conprop.put("data truncation", "false"); // Set login timeout in seconds DriverManager.setLoginTimeout(5); // DriverManager gets connection object for JDBC connection = DriverManager.getConnection("jdbc:as400://" + host, conprop); // All changes to tables will be automatically committed connection.setAutoCommit(true); } catch (SQLException exc2) { System.out.println(msg); msg = connErr + exc2.getLocalizedMessage(); System.out.println(msg); return null; } catch (ClassNotFoundException exc) { msg = driver + host + ": " + exc.getLocalizedMessage(); System.out.println(msg); return null; } return connection; } /** * Disconnects from IBM i * * @param connection * object of class java.sql.Connection */ public void disconnect(Connection connection) { try { connection.close(); } catch (SQLException sqle) { } } }
[ "vzupka@gmail.com" ]
vzupka@gmail.com
2f885c0127fe244ab84e23b8112192ea2c131081
23f27a4609c6125a7308117fe0ae9e4e9578ffa4
/src/main/java/duelistmod/actions/unique/DeskbotSevenAction.java
f69576e9890ad6b32e33a7c429b3543c16f7eac8
[ "Unlicense" ]
permissive
ascriptmaster/StS-DuelistMod
269b078b074b4a76828d86d98cf03c7446510995
251c29117779f0e75c3424263e669b720f35ed1a
refs/heads/master
2023-05-26T09:23:07.510791
2021-04-05T05:07:42
2021-04-05T05:14:42
226,347,190
0
0
Unlicense
2019-12-06T14:30:34
2019-12-06T14:30:33
null
UTF-8
Java
false
false
2,046
java
package duelistmod.actions.unique; import com.megacrit.cardcrawl.actions.AbstractGameAction; import com.megacrit.cardcrawl.actions.utility.WaitAction; import com.megacrit.cardcrawl.cards.DamageInfo; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.monsters.AbstractMonster; import com.megacrit.cardcrawl.powers.ArtifactPower; import com.megacrit.cardcrawl.vfx.combat.FlashAtkImgEffect; public class DeskbotSevenAction extends AbstractGameAction { private DamageInfo info; public DeskbotSevenAction(final AbstractMonster target, final DamageInfo info) { this.setValues(target, this.info = info); this.actionType = ActionType.DAMAGE; this.attackEffect = AttackEffect.SLASH_VERTICAL; this.duration = 0.01f; } @Override public void update() { if (this.target == null) { this.isDone = true; return; } if (AbstractDungeon.player.hasPower(ArtifactPower.POWER_ID)) { if (this.duration == 0.01f && this.target != null && this.target.currentHealth > 0) { if (this.info.type != DamageInfo.DamageType.THORNS && this.info.owner.isDying) { this.isDone = true; return; } AbstractDungeon.effectList.add(new FlashAtkImgEffect(this.target.hb.cX, this.target.hb.cY, this.attackEffect)); } this.tickDuration(); if (this.isDone && this.target != null && this.target.currentHealth > 0) { for (int i = 0; i < AbstractDungeon.player.getPower(ArtifactPower.POWER_ID).amount; i++) { this.target.damage(this.info); } if (AbstractDungeon.getCurrRoom().monsters.areMonstersBasicallyDead()) { AbstractDungeon.actionManager.clearPostCombatActions(); } this.addToTop(new WaitAction(0.1f)); } } else { this.isDone = true; } } }
[ "nyoxidetwitter@gmail.com" ]
nyoxidetwitter@gmail.com
cd5c5ecdcb38074468c990813e1bcb225cf95948
eb2f2cf1be4f79b2c0e7c1d48e9a9cea14e95299
/nepxion-cots/src/com/nepxion/cots/twaver/gis/TGisOverview.java
50224ace957f0846829974a39757d73da53f942e
[ "Apache-2.0" ]
permissive
Nepxion/Marvel
83e3b26762d807a4685faabfaa0f3aedd3e30a87
51bb477ccbff64067981bd92efcdb9b7b01c6f5f
refs/heads/master
2021-08-16T21:00:03.336975
2021-07-08T23:14:51
2021-07-08T23:14:51
57,598,034
11
2
null
null
null
null
UTF-8
Java
false
false
2,579
java
package com.nepxion.cots.twaver.gis; /** * <p>Title: Nepxion Cots For TWaver</p> * <p>Description: Nepxion Cots Repository</p> * <p>Copyright: Copyright (c) 2010</p> * <p>Company: Nepxion</p> * <p>Announcement: It depends on the commercial software of TWaver, the repository only references the trial version.</p> * <p>If you want to use Nepxion Cots, please contact with Serva Corporation to buy the genuine version.</p> * @author Neptune * @email 1394997@qq.com * @version 1.0 */ import java.awt.Dimension; import javax.swing.Icon; import twaver.gis.gadget.GisOverviewPanel; import com.nepxion.swing.tween.VisibilityTweener; public class TGisOverview extends GisOverviewPanel { private VisibilityTweener visibilityTweener; public TGisOverview(TGisGraph gisGraph, Dimension size) { this(gisGraph, "", size, new Dimension(0, 0), null); } public TGisOverview(TGisGraph gisGraph, Dimension size, Icon icon) { this(gisGraph, "", size, icon); } public TGisOverview(TGisGraph gisGraph, Dimension size, Dimension location) { this(gisGraph, "", size, location); } public TGisOverview(TGisGraph gisGraph, String title, Dimension size) { this(gisGraph, title, size, new Dimension(0, 0), null); } public TGisOverview(TGisGraph gisGraph, String title, Dimension size, Icon icon) { this(gisGraph, title, size, new Dimension(0, 0), icon); } public TGisOverview(TGisGraph gisGraph, String title, Dimension size, Dimension location) { this(gisGraph, title, size, location, null); } public TGisOverview(TGisGraph gisGraph, String title, Dimension size, Dimension location, Icon icon) { super(gisGraph); visibilityTweener = new VisibilityTweener(this, 1, 1); setTitle(title); setSize(size); setLocation(location.width, location.height); setFrameIcon(icon); } public VisibilityTweener getVisibilityTweener() { return visibilityTweener; } public void tween(boolean visibleTweening) { visibilityTweener.tween(visibleTweening); } public void setTweeningDimension(Dimension dimension) { visibilityTweener.setDimension(dimension); } public void setHorizontalTweening(boolean horizontalTweening) { visibilityTweener.setHorizontalTweening(horizontalTweening); } public void setVerticalTweening(boolean verticalTweening) { visibilityTweener.setVerticalTweening(verticalTweening); } public void setFrameInterval(int frameInterval) { visibilityTweener.setFrameInterval(frameInterval); } public void setFrameCount(int frameCount) { visibilityTweener.setFrameCount(frameCount); } }
[ "1394997@qq.com" ]
1394997@qq.com
d7bfec12827d807b2dda95d6eac9f56afd17f07d
e73966a81e6296a283da921d3ca753e0ddbe6369
/src/main/java/fun/gengzi/codecopy/business/luckdraw/entity/LuckdrawByMqEntity.java
2777d519a3bf82776126d89c22449aacaef23f78
[ "MIT" ]
permissive
XiaoJiangBoy/codecopy
3b3cf82f5a82fb4a168e5977b15b1c9abfe32df4
cc814cbd094b0ca50bb1ee034537ca8c3581282a
refs/heads/master
2023-09-05T17:31:41.663522
2021-11-21T03:22:33
2021-11-21T03:22:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
569
java
package fun.gengzi.codecopy.business.luckdraw.entity; import fun.gengzi.codecopy.business.luckdraw.constant.LuckdrawEnum; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * <h1>抽奖mq相关实体</h1> * * @author gengzi * @date 2020年9月27日09:49:26 */ @Data @AllArgsConstructor @NoArgsConstructor public class LuckdrawByMqEntity { // 此条抽奖数据的 mq 标识 private long currentTime; // 具体的响应信息,或者使用 throw new 的形式返回 private LuckdrawEnum luckdrawEnum; }
[ "1164014750@qq.com" ]
1164014750@qq.com
e54a410ae407d3426594358832fad36df3ea650f
1a8748faf70b43f4683052a300fd53d6fdf4f369
/GoogleMaps/app/src/main/java/com/gkftndltek/googlemaps/MainActivity.java
6afbd15abbf9dab622d88d9271ca9c6c8cdb6788
[]
no_license
chltkdgns1/AllBackUpAndroid
1659437cba78c94d86de2102cd32024cd2e36e74
d80731dec8dfc80f9540695fd0bc42b8042b23c1
refs/heads/master
2022-07-17T03:36:32.869949
2020-05-13T17:05:59
2020-05-13T17:05:59
263,693,303
0
0
null
null
null
null
UTF-8
Java
false
false
5,853
java
package com.gkftndltek.googlemaps; import androidx.appcompat.app.AppCompatActivity; import android.app.FragmentManager; import android.os.Bundle; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.ImageView; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.material.textfield.TextInputLayout; public class MainActivity extends AppCompatActivity implements OnMapReadyCallback { private ImageView ImageView_Menu; // 뷰들 선언 //private ImageView Button_SetText, // private EditText TextInputEdit; private InputMethodManager im; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); RoundedLayout rl = (RoundedLayout) findViewById(R.id.maplayout); // custom view // 커스텀 뷰의 경우에는 직접 만든 뷰 입니다. 제공해주는 뷰가 아닙니다. // 따라서 이 뷰에 대해서 알고 싶다면 RoundedLayout.class 를 참고하시면 됩니다. rl.setCornerRadius(300); //rl.setShapeCircle(true); // 구글맵의 모양을 둥글게 만들어줍니다. rl.showBorder(true); // 경계선 생성 rl.setBorderWidth(3); // 경계선 두께 ImageView_Menu = findViewById(R.id.ImageView_Menu); im = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); // 키보드창 on off //Button_SetText = findViewById(R.id.Button_SetText); // 입력 버튼 //TextInputEdit = findViewById(R.id.TextInputEdit); // 에딧텍스트 // Button_SetText.setVisibility(View.GONE); // 초기에는 에딧텍스트와 버튼은 보이지않음 //TextInputEdit.setVisibility(View.GONE); ImageView_Menu.setClickable(true); ImageView_Menu.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); FragmentManager fragmentManager = getFragmentManager(); MapFragment mapFragment = (MapFragment)fragmentManager.findFragmentById(R.id.map); mapFragment.getMapAsync(this); } @Override public void onMapReady(final GoogleMap map) { cameraInit(map); // 초기 카메라 위치 잡아주면서 덤으로 서울하나 찍어줌 /* map.setOnMapClickListener(new GoogleMap.OnMapClickListener() { // 맵 위에 마우스 클릭 이벤트 발생 @Override public void onMapClick(LatLng latLng) { String text= latLng.latitude + " " + latLng.longitude; System.out.println(text); // 걍도 위도 출력 MarkerOptions markerOptions = new MarkerOptions(); markerOptions.position(latLng); markerOptions.alpha(0.5f); markerOptions.title("내가클릭한곳"); map.addMarker(markerOptions); map.moveCamera(CameraUpdateFactory.newLatLng(latLng)); map.animateCamera(CameraUpdateFactory.zoomTo(10)); Button_SetText.setVisibility(View.GONE); Button_SetText.setClickable(false); TextInputEdit.setVisibility(View.GONE); // 마커 추가 } }); map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(final Marker marker) { //마커가 클릭되었을 경우에 //.makeText(getApplicationContext(),marker.getTitle() + "\n" ,Toast.LENGTH_LONG).show(); // 마커를 클릭했을때 토스트 메시지 출력 marker.showInfoWindow(); // 마커 내용 출력 Button_SetText.setVisibility(View.VISIBLE); // 각각의 뷰들 안보이던 걸 보이게 만들어줌 Button_SetText.setClickable(true); TextInputEdit.setVisibility(View.VISIBLE); Button_SetText.setOnClickListener(new View.OnClickListener() { // 버튼 클릭시에 마커의 이름을 변경함 @Override public void onClick(View v) { String txt = TextInputEdit.getText().toString(); //Toast.makeText(getApplicationContext(),txt,Toast.LENGTH_LONG).show(); if(txt.isEmpty()) return; marker.setTitle(txt); marker.hideInfoWindow(); marker.showInfoWindow(); TextInputEdit.setText(""); im.hideSoftInputFromWindow(TextInputEdit.getWindowToken(),0); Button_SetText.setVisibility(View.GONE); Button_SetText.setClickable(false); TextInputEdit.setVisibility(View.GONE); } }); return true; } }); */ } public void cameraInit(final GoogleMap map){ LatLng SEOUL = new LatLng(37.56, 126.97); MarkerOptions markerOptions = new MarkerOptions(); markerOptions.position(SEOUL); markerOptions.title("서울"); markerOptions.snippet("한국의 수도"); map.addMarker(markerOptions); map.moveCamera(CameraUpdateFactory.newLatLng(SEOUL)); map.animateCamera(CameraUpdateFactory.zoomTo(10)); } }
[ "tkdgns685@naver.com" ]
tkdgns685@naver.com
c74d1a09cf7ec436c5868fef0bd46ab4a00445de
ca2686d62283a889f5b005996551b03305b37337
/target/tomcat/work/Tomcat/localhost/_/org/apache/jsp/WEB_002dINF/jsp/front/user/uheader_jsp.java
e9324ab480c41b041a68f54a4a6171dcd8b7de63
[]
no_license
ck843933075/zy_video
3dcabfdca1d1fda1fe3aea17c586681666be994a
0fff0f8557da76eac809164cf5d76a88dcb32250
refs/heads/master
2022-12-20T20:06:03.958120
2019-06-05T10:49:04
2019-06-05T10:49:04
190,376,631
0
0
null
2022-11-16T08:24:31
2019-06-05T10:42:54
Java
UTF-8
Java
false
false
8,989
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/7.0.47 * Generated at: 2019-05-28 02:38:47 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp.WEB_002dINF.jsp.front.user; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class uheader_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest; private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public void _jspInit() { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } public void _jspDestroy() { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release(); } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write('\r'); out.write('\n'); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<header>\r\n"); out.write("\t<div class=\"container top_bar clearfix\">\r\n"); out.write("\t\t<img src=\"static/img/logo.png\" alt=\"智游\">\r\n"); out.write("\t\t<div id=\"tele\">\r\n"); out.write("\t\t\t<span>4006-371-555</span>\r\n"); out.write("\t\t\t<span>0371-88888598</span>\r\n"); out.write("\t\t</div>\r\n"); out.write("\t</div>\r\n"); out.write("\t<menu>\r\n"); out.write("\t\t<div class=\"container clearfix\">\r\n"); out.write("\t\t\t<ul class=\"clearfix f_left\">\r\n"); out.write("\t\t\t\t<li><a href=\"index.do\">首页</a></li>\r\n"); out.write("\t\t\t\t<li class=\"menu_active\"><a href=\"front/user/index.do\">个人中心</a></li>\r\n"); out.write("\t\t\t</ul>\r\n"); out.write("\t\t\t<div id=\"user_bar\">\r\n"); out.write("\t\t\t\t<a href=\"front/user/index.action\">\r\n"); out.write("\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f0(_jspx_page_context)) return; out.write("\r\n"); out.write("\r\n"); out.write("\t\t\t\t\t"); if (_jspx_meth_c_005fif_005f1(_jspx_page_context)) return; out.write("\r\n"); out.write("\r\n"); out.write("\t\t\t\t</a>\r\n"); out.write("\t\t\t\t<a href=\"front/user/logout.do\" id=\"lay_out\">退出</a>\r\n"); out.write("\t\t\t</div>\r\n"); out.write("\t\t</div>\r\n"); out.write("\t</menu>\r\n"); out.write("</header>\r\n"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { out.clearBuffer(); } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f0.setParent(null); // /WEB-INF/jsp/front/user/uheader.jsp(26,5) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${empty sessionScope._front_user.headUrl}", java.lang.Boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)).booleanValue()); int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag(); if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write("\t\t\t\t\t\t<img id=\"avatar\" src=\"static/img/avatar_lg.png\" alt=\"\">\r\n"); out.write("\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); return false; } private boolean _jspx_meth_c_005fif_005f1(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f1 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f1.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f1.setParent(null); // /WEB-INF/jsp/front/user/uheader.jsp(30,5) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f1.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${not empty sessionScope._front_user.headUrl}", java.lang.Boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)).booleanValue()); int _jspx_eval_c_005fif_005f1 = _jspx_th_c_005fif_005f1.doStartTag(); if (_jspx_eval_c_005fif_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\r\n"); out.write("\t\t\t\t\t\t<img id=\"avatar\" src=\""); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${user.headUrl}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)); out.write("\" alt=\"\">\r\n"); out.write("\t\t\t\t\t"); int evalDoAfterBody = _jspx_th_c_005fif_005f1.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1); return false; } }
[ "18539658381@163.com" ]
18539658381@163.com
f20114926c784d400da2fba66d9e7b71ca965cf3
b5043f5b59cd56ee377c70d0e2e1b6e11e253880
/src/cellsociety_team10/individualSimulations/SugarScape.java
b9892dfa0c2402068147d73c6b1ce650d9cdf629
[ "MIT" ]
permissive
Lucytheanimefan/cellular-automata-simulator
7d00aba97605536315dbb4e2ffe02d803f527758
5072db9b6167a0722dabda0c9b662d3decb341cf
refs/heads/master
2021-01-11T02:59:13.309525
2016-10-14T03:26:47
2016-10-14T03:26:47
70,870,438
0
0
null
null
null
null
UTF-8
Java
false
false
1,956
java
package cellsociety_team10.individualSimulations; import java.util.HashSet; import cellsociety_team10.CA; import cellsociety_team10.Cell; import cellsociety_team10.DataSetup; import cellsociety_team10.Simulation; import javafx.scene.paint.Color; public class SugarScape extends Simulation { private DataSetup data; private final int ANGENT = 1; private final int EMPTY = 0; private double sugarMetabolism; private double initialSugar; //extra state2 stores sugar amount public SugarScape(CA ca) { super(ca); data = new DataSetup("data/sugarScape.xml"); sugarMetabolism = Double.parseDouble(data.readFileForTag("sugarMetabolism")); initialSugar = Double.parseDouble(data.readFileForTag("initialSugar")); } /* * initialize the amount of sugar in the agent cell */ private void initSugar(){ for (Cell[] r : grid){ for(Cell c: r){ if(c.getState() == ANGENT) c.setExtraState2(initialSugar); } } } @Override protected void createColorMapping() { colorMapping.put(ANGENT, Color.ORANGE); colorMapping.put(EMPTY, Color.GREY); } /* * move agent based on the vacancy and sugar level in the neighbors */ private void moveAngent(Cell c, HashSet<Cell> neighbors){ Cell maxSugarVacant = null; double maxSugar = -1; for(Cell i : neighbors){ if(i.getState() == EMPTY && i.getExtraState2() > maxSugar){ maxSugar = i.getExtraState2(); maxSugarVacant = i; } } c.setState(EMPTY); if((c.getExtraState2() + maxSugar - sugarMetabolism) > 0) maxSugarVacant.setState(ANGENT); } /* * (non-Javadoc) * @see cellsociety_team10.Simulation#update() * updates the entire grid */ @Override public void update() { grid=ca.getGrid(); Cell[][] temp = copyGrid(); for (Cell[] r : grid){ for(Cell c: r){ HashSet<Cell> neighbors = checkNeighbor(temp, c , false, true); if(c.getState() == ANGENT){ moveAngent(c, neighbors); } } } } }
[ "lz107@duke.edu" ]
lz107@duke.edu
e5c67f8770957ba4380d1bd2b9a3aeaf3bd76ae2
983c22ef9f3ea8f757156fcb517af15d7fbef5df
/src/main/java/scorponok/common/utils/StringUtil.java
45dcbda768361f21142c513556ab453520eac726
[]
no_license
zhigang0406/HrSystem
4358fdd9c36abfe64bb8e2dad197acb56df91cf7
6de3039bb2a66eef61e4d7ab06ce2cbc32cbb678
refs/heads/master
2020-03-13T05:22:04.821986
2018-04-25T09:22:45
2018-04-25T09:22:46
130,982,370
0
0
null
null
null
null
UTF-8
Java
false
false
2,318
java
package scorponok.common.utils; import java.util.Date; import java.util.HashSet; import java.util.Random; import java.util.Set; public class StringUtil { private static final String TOKEN = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; public static final String SPLIT = "-"; private static final String NUMBER_TOKEN = "1234567890"; public static int getNumberUnin(int size) { if (size > 10) { throw new RuntimeException("size > 10"); } Set<Character> dupCheck = new HashSet<>(); StringBuilder sb = new StringBuilder(); Random random = new Random(); while (sb.length() < size) { char charAt = NUMBER_TOKEN.charAt(random.nextInt(NUMBER_TOKEN.length())); if (dupCheck.contains(charAt)) { continue; } else { dupCheck.add(charAt); sb.append(charAt); } } return Integer.valueOf(sb.toString()); } public static String getNumberToken(int size) { StringBuilder sb = new StringBuilder(); Random random = new Random(); for (int i = 0; i < size; i++) { sb.append(NUMBER_TOKEN.charAt(random.nextInt(NUMBER_TOKEN.length()))); } return sb.toString(); } public static long buildSessionId(long sendId, long reciveId) { if (sendId > reciveId) { return Long.valueOf(String.valueOf(reciveId) + String.valueOf(sendId)); } else { return Long.valueOf(String.valueOf(sendId) + String.valueOf(reciveId)); } } public static String getToken(int size) { StringBuilder sb = new StringBuilder(); Random random = new Random(); for (int i = 0; i < size; i++) { sb.append(TOKEN.charAt(random.nextInt(TOKEN.length()))); } return sb.toString(); } public static String getBillId() { return DateUtil.formatDate(new Date(), "yyyyMMddHHmmssS") + getNumberToken(3); } public static boolean isEmpty(String account) { return account == null || "".equals(account.trim()); } public static boolean isNotEmpty(String userName) { return !isEmpty(userName); } public static boolean isEmpty(Long account) { return account == null || account == 0L; } public static boolean isNotEmpty(Long account) { return !isEmpty(account); } public static boolean isEmpty(Integer account) { return account == null || account == 0; } public static boolean isEmpty(Double account) { return account == null || account == 0.0; } }
[ "937548023@qq.com" ]
937548023@qq.com
97acb1c015f89d573739f59383c13ae3330ab455
44e7adc9a1c5c0a1116097ac99c2a51692d4c986
/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/ListPortfoliosForProductRequest.java
8c49099637c81e9cbc8f5437cd0c03e5860d529c
[ "Apache-2.0" ]
permissive
QiAnXinCodeSafe/aws-sdk-java
f93bc97c289984e41527ae5bba97bebd6554ddbe
8251e0a3d910da4f63f1b102b171a3abf212099e
refs/heads/master
2023-01-28T14:28:05.239019
2020-12-03T22:09:01
2020-12-03T22:09:01
318,460,751
1
0
Apache-2.0
2020-12-04T10:06:51
2020-12-04T09:05:03
null
UTF-8
Java
false
false
10,566
java
/* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.servicecatalog.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfoliosForProduct" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ListPortfoliosForProductRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The language code. * </p> * <ul> * <li> * <p> * <code>en</code> - English (default) * </p> * </li> * <li> * <p> * <code>jp</code> - Japanese * </p> * </li> * <li> * <p> * <code>zh</code> - Chinese * </p> * </li> * </ul> */ private String acceptLanguage; /** * <p> * The product identifier. * </p> */ private String productId; /** * <p> * The page token for the next set of results. To retrieve the first set of results, use null. * </p> */ private String pageToken; /** * <p> * The maximum number of items to return with this call. * </p> */ private Integer pageSize; /** * <p> * The language code. * </p> * <ul> * <li> * <p> * <code>en</code> - English (default) * </p> * </li> * <li> * <p> * <code>jp</code> - Japanese * </p> * </li> * <li> * <p> * <code>zh</code> - Chinese * </p> * </li> * </ul> * * @param acceptLanguage * The language code.</p> * <ul> * <li> * <p> * <code>en</code> - English (default) * </p> * </li> * <li> * <p> * <code>jp</code> - Japanese * </p> * </li> * <li> * <p> * <code>zh</code> - Chinese * </p> * </li> */ public void setAcceptLanguage(String acceptLanguage) { this.acceptLanguage = acceptLanguage; } /** * <p> * The language code. * </p> * <ul> * <li> * <p> * <code>en</code> - English (default) * </p> * </li> * <li> * <p> * <code>jp</code> - Japanese * </p> * </li> * <li> * <p> * <code>zh</code> - Chinese * </p> * </li> * </ul> * * @return The language code.</p> * <ul> * <li> * <p> * <code>en</code> - English (default) * </p> * </li> * <li> * <p> * <code>jp</code> - Japanese * </p> * </li> * <li> * <p> * <code>zh</code> - Chinese * </p> * </li> */ public String getAcceptLanguage() { return this.acceptLanguage; } /** * <p> * The language code. * </p> * <ul> * <li> * <p> * <code>en</code> - English (default) * </p> * </li> * <li> * <p> * <code>jp</code> - Japanese * </p> * </li> * <li> * <p> * <code>zh</code> - Chinese * </p> * </li> * </ul> * * @param acceptLanguage * The language code.</p> * <ul> * <li> * <p> * <code>en</code> - English (default) * </p> * </li> * <li> * <p> * <code>jp</code> - Japanese * </p> * </li> * <li> * <p> * <code>zh</code> - Chinese * </p> * </li> * @return Returns a reference to this object so that method calls can be chained together. */ public ListPortfoliosForProductRequest withAcceptLanguage(String acceptLanguage) { setAcceptLanguage(acceptLanguage); return this; } /** * <p> * The product identifier. * </p> * * @param productId * The product identifier. */ public void setProductId(String productId) { this.productId = productId; } /** * <p> * The product identifier. * </p> * * @return The product identifier. */ public String getProductId() { return this.productId; } /** * <p> * The product identifier. * </p> * * @param productId * The product identifier. * @return Returns a reference to this object so that method calls can be chained together. */ public ListPortfoliosForProductRequest withProductId(String productId) { setProductId(productId); return this; } /** * <p> * The page token for the next set of results. To retrieve the first set of results, use null. * </p> * * @param pageToken * The page token for the next set of results. To retrieve the first set of results, use null. */ public void setPageToken(String pageToken) { this.pageToken = pageToken; } /** * <p> * The page token for the next set of results. To retrieve the first set of results, use null. * </p> * * @return The page token for the next set of results. To retrieve the first set of results, use null. */ public String getPageToken() { return this.pageToken; } /** * <p> * The page token for the next set of results. To retrieve the first set of results, use null. * </p> * * @param pageToken * The page token for the next set of results. To retrieve the first set of results, use null. * @return Returns a reference to this object so that method calls can be chained together. */ public ListPortfoliosForProductRequest withPageToken(String pageToken) { setPageToken(pageToken); return this; } /** * <p> * The maximum number of items to return with this call. * </p> * * @param pageSize * The maximum number of items to return with this call. */ public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } /** * <p> * The maximum number of items to return with this call. * </p> * * @return The maximum number of items to return with this call. */ public Integer getPageSize() { return this.pageSize; } /** * <p> * The maximum number of items to return with this call. * </p> * * @param pageSize * The maximum number of items to return with this call. * @return Returns a reference to this object so that method calls can be chained together. */ public ListPortfoliosForProductRequest withPageSize(Integer pageSize) { setPageSize(pageSize); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAcceptLanguage() != null) sb.append("AcceptLanguage: ").append(getAcceptLanguage()).append(","); if (getProductId() != null) sb.append("ProductId: ").append(getProductId()).append(","); if (getPageToken() != null) sb.append("PageToken: ").append(getPageToken()).append(","); if (getPageSize() != null) sb.append("PageSize: ").append(getPageSize()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListPortfoliosForProductRequest == false) return false; ListPortfoliosForProductRequest other = (ListPortfoliosForProductRequest) obj; if (other.getAcceptLanguage() == null ^ this.getAcceptLanguage() == null) return false; if (other.getAcceptLanguage() != null && other.getAcceptLanguage().equals(this.getAcceptLanguage()) == false) return false; if (other.getProductId() == null ^ this.getProductId() == null) return false; if (other.getProductId() != null && other.getProductId().equals(this.getProductId()) == false) return false; if (other.getPageToken() == null ^ this.getPageToken() == null) return false; if (other.getPageToken() != null && other.getPageToken().equals(this.getPageToken()) == false) return false; if (other.getPageSize() == null ^ this.getPageSize() == null) return false; if (other.getPageSize() != null && other.getPageSize().equals(this.getPageSize()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAcceptLanguage() == null) ? 0 : getAcceptLanguage().hashCode()); hashCode = prime * hashCode + ((getProductId() == null) ? 0 : getProductId().hashCode()); hashCode = prime * hashCode + ((getPageToken() == null) ? 0 : getPageToken().hashCode()); hashCode = prime * hashCode + ((getPageSize() == null) ? 0 : getPageSize().hashCode()); return hashCode; } @Override public ListPortfoliosForProductRequest clone() { return (ListPortfoliosForProductRequest) super.clone(); } }
[ "" ]
756e24216f437f70b30569615025afb056297302
c145b58f3799391a62e3bdf6127eba601d17c31c
/eMarket-Online/src/main/java/com/eMarket/online/respository/EmarketSubCategoryRepository.java
912e97e2cd3fdfff9f521aa109ae8de51b5f4d2f
[]
no_license
randrin/eMarket-Online
2fc048ef79eb90aed78d571c50ac90a390012035
ae07452d0baac7af767855ac73def6b12d8ed9b8
refs/heads/master
2020-11-23T20:17:49.983466
2020-04-02T21:29:39
2020-04-02T21:29:39
227,805,514
0
1
null
null
null
null
UTF-8
Java
false
false
366
java
package com.eMarket.online.respository; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; import com.eMarket.online.model.EmarketSubCategory; @RepositoryRestResource public interface EmarketSubCategoryRepository extends MongoRepository<EmarketSubCategory, String> { }
[ "nzeukangrandrin@gmail.com" ]
nzeukangrandrin@gmail.com
05acd2a6e4dc161ed3e7a1c4315e5bdea100f366
c4e50e5c43042b679091e6a021fd557f3a4691d4
/src/main/java/com/samples/todolist/model/ObjectFactory.java
8918775752f76ebac6d4b9a948aa96b63e48776f
[]
no_license
wdDai/todo_API_test
e9b76eda486544f3b173845d3904e63ec63bba28
46ac837f376810ec068aa17780f741f33139c340
refs/heads/master
2022-06-03T18:09:43.325384
2020-06-16T08:44:37
2020-06-16T08:44:37
227,502,557
0
0
null
2022-05-20T21:19:03
2019-12-12T02:25:13
Java
UTF-8
Java
false
false
1,867
java
/* * Copyright 2006-2016 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 com.samples.todolist.model; import javax.xml.bind.annotation.XmlRegistry; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the com.consol.citrus.samples.todolist.soap.model package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.consol.citrus.samples.todolist.soap.model * */ public ObjectFactory() { } /** * Create an instance of {@link TodoEntry } * */ public TodoEntry createTodoEntry() { return new TodoEntry(); } /** * Create an instance of {@link Attachment } * */ public Attachment createAttachment() { return new Attachment(); } }
[ "wendingdai@gmail.com" ]
wendingdai@gmail.com
5b2846e7405aacc35d8f5c29341ff5d0588ce2e7
715d7e5f3f83aa2ac3209401ee6ca4b2975a6d7d
/jtwig-functions/src/main/java/com/lyncode/jtwig/functions/internal/list/Merge.java
d8aee01852df6cd9d53f0a3e9fd141b7fad6a286
[ "Apache-2.0" ]
permissive
msn0/jtwig
c769a76a7282c982dc87ffc0dba60009c18a8994
6c6d4e4b43552fafc4a616605b2c46fd0e5d5f54
refs/heads/master
2023-06-09T19:59:12.748027
2013-12-25T21:47:03
2013-12-25T21:47:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,464
java
/** * Copyright 2012 Lyncode * * 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.lyncode.jtwig.functions.internal.list; import com.lyncode.jtwig.functions.Function; import com.lyncode.jtwig.functions.exceptions.FunctionException; import java.util.*; public class Merge implements Function { @Override public Object execute(Object... arguments) throws FunctionException { if (arguments.length < 2) throw new FunctionException("Invalid number of arguments. Expecting at least two arguments."); if (arguments[0] instanceof Iterable) return mergeList(arguments); else if (arguments[0] instanceof Map) return mergeMap(arguments); else if (arguments[0].getClass().isArray()) return mergeArray(arguments); else throw new FunctionException("Invalid arguments. Expecting lists, arrays or maps values."); } private Object mergeArray(Object... arguments) { List<Object> result = new ArrayList<Object>(); for (Object obj : arguments) { if (obj == null) continue; Object[] list = (Object[]) obj; for (Object value : list) { result.add(value); } } return result.toArray(); } private Object mergeMap(Object... arguments) { Map<Object, Object> result; if (arguments[0] instanceof TreeMap) result = new TreeMap<Object, Object>(); else result = new HashMap<Object, Object>(); for (Object obj : arguments) { if (obj == null) continue; result.putAll((Map) obj); } return result; } private Object mergeList(Object... arguments) { List<Object> result = new ArrayList<Object>(); for (Object obj : arguments) { if (obj == null) continue; result.addAll((List) obj); } return result; } }
[ "jmelo@lyncode.com" ]
jmelo@lyncode.com
cf0dbc8ed0adbf7b11e507174d78991ae00af4d4
b402db0e84ac5525bb90698ad53904a1d4c7f37d
/src/com/rp/justcast/video/VideoItemLoader.java
6b2868fa598eff9719dd71277f28d7f5e4d341cf
[]
no_license
rajendrag/JustCast
447dd48df69298aa035d08652a3e541548648382
0f7baa870236e5499ecdd5d90c0ea1749792403d
refs/heads/master
2021-01-17T07:59:19.524486
2017-05-07T23:50:19
2017-05-07T23:50:19
18,430,175
5
2
null
2015-07-21T17:14:03
2014-04-04T06:50:51
Java
UTF-8
Java
false
false
1,619
java
/* * Copyright (C) 2013 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.rp.justcast.video; import com.google.android.gms.cast.MediaInfo; import android.content.Context; import android.support.v4.content.AsyncTaskLoader; import android.util.Log; import java.util.List; public class VideoItemLoader extends AsyncTaskLoader<List<MediaInfo>> { private static final String TAG = "VideoItemLoader"; public VideoItemLoader(Context context) { super(context); } @Override public List<MediaInfo> loadInBackground() { try { return VideoProvider.buildMedia(); } catch (Exception e) { Log.e(TAG, "Failed to fetch media data", e); return null; } } @Override protected void onStartLoading() { super.onStartLoading(); forceLoad(); } /** * Handles a request to stop the Loader. */ @Override protected void onStopLoading() { // Attempt to cancel the current load task if possible. cancelLoad(); } }
[ "it.rajendra@gmail.com" ]
it.rajendra@gmail.com
46be97772ec32f732e90f7f04c723af6b0c688df
566a99b1cb5cd8fb53e84d5f5cc3f21a980a4296
/Tree/Trie/Trie.java
5dd12bf4652e1116f95a22ee2f5b533bcd2f9dbf
[]
no_license
chitnisrohan/Interview_Preparation
3abd9e641ec114f30dec4159ddd44bc7263a08e2
6d106f3c11b289681226cc97410b106a3fb90bf3
refs/heads/master
2021-01-22T19:49:01.247152
2020-01-30T08:02:27
2020-01-30T08:02:27
85,244,311
0
0
null
null
null
null
UTF-8
Java
false
false
1,151
java
package tree_problems; import java.util.HashMap; public class Trie { private HashMap<Character, Trie> node; private boolean isWord; public Trie() { this.node = new HashMap<>(); this.isWord = false; } public void addString(String str) { if (str.isEmpty()) { this.isWord = true; return; } char c = str.charAt(0); if(this.node.containsKey(c)) { this.node.get(c).addString(str.substring(1)); } else { Trie newNode = new Trie(); this.node.put(c, newNode); newNode.addString(str.substring(1)); } } public boolean containWord(String str) { if (str.isEmpty()) { return this.isWord; } char c = str.charAt(0); if (this.node.containsKey(c)) { return this.node.get(c).containWord(str.substring(1)); } else { return false; } } public static void main(String[] args) { Trie root = new Trie(); root.addString("Alice"); root.addString("Wonderland"); root.addString("Wonder"); System.out.println(root.containWord("Alice")); System.out.println(root.containWord("Wonderland")); System.out.println(root.containWord("Wonder")); System.out.println(root.containWord("Alicee")); } }
[ "chitnis.r@ccs.neu.edu" ]
chitnis.r@ccs.neu.edu
923e5d4a7abf1cb7f238c33d7327654e84a17c5e
c408885f4d391749a548ab611f45163d2cd9b8f7
/nh.examples.springintegration.order.client/src/nh/client/framework/swing/StandardPopupMenu.java
23272bdd5eb48d68512f5b88a3d735cfc3606c44
[]
no_license
nilshartmann/spring-integration-example
1bf6f896cd68c6b829ab1514afb4776b89ede2f1
f8683c97ed326645e54ee63f77eb9521d0bbc38f
refs/heads/master
2020-08-10T14:20:25.365672
2011-03-29T09:19:08
2011-03-29T09:19:08
1,361,591
0
0
null
null
null
null
UTF-8
Java
false
false
2,758
java
package nh.client.framework.swing; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.lang.reflect.Method; import java.util.LinkedList; import java.util.List; import javax.swing.JComponent; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; public class StandardPopupMenu { private final JPopupMenu _popupMenu; private final List<JMenuItem> _menuItems; private Object _eventHandler; private StandardPopupMenu(JPopupMenu popupMenu, List<JMenuItem> menuItems) { super(); _popupMenu = popupMenu; _menuItems = menuItems; } public JPopupMenu getPopupMenu() { return _popupMenu; } public List<JMenuItem> getMenuItems() { return _menuItems; } public void addToComponent(JComponent component) { component.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { maybeShowPopup(e); } public void mouseReleased(MouseEvent e) { maybeShowPopup(e); } private void maybeShowPopup(MouseEvent e) { if (e.isPopupTrigger()) { _popupMenu.show(e.getComponent(), e.getX(), e.getY()); } } }); } public void setEventHandler(Object model) { if (_eventHandler != null) { throw new IllegalStateException("A model has already been set"); } _eventHandler = model; for (JMenuItem jMenuItem : _menuItems) { jMenuItem.addActionListener(new ModelDelegatingActionListener( (String) jMenuItem.getClientProperty("menuitem.name"))); } } public static PopupMenuBuilder newPopupMenuBuilder() { return new PopupMenuBuilder(); } public static class PopupMenuBuilder { private final JPopupMenu _popupMenu; private final List<JMenuItem> _menuItems; private PopupMenuBuilder() { _popupMenu = new JPopupMenu(); _menuItems = new LinkedList<JMenuItem>(); } public PopupMenuBuilder addItem(String title, String name) { JMenuItem menuItem = new JMenuItem(title); menuItem.putClientProperty("menuitem.name", name); _popupMenu.add(menuItem); _menuItems.add(menuItem); return this; } public PopupMenuBuilder separator() { _popupMenu.addSeparator(); return this; } public StandardPopupMenu build() { return new StandardPopupMenu(_popupMenu, _menuItems); } } class ModelDelegatingActionListener implements ActionListener { private final String _name; public ModelDelegatingActionListener(String name) { super(); _name = name; } @Override public void actionPerformed(ActionEvent e) { try { Method method = _eventHandler.getClass().getMethod( "execute" + _name); method.invoke(_eventHandler); } catch (Exception ex) { throw new RuntimeException(ex); } } } }
[ "nils@nilshartmann.net" ]
nils@nilshartmann.net
cc9f6bc2448b1782558ec1316b2214137e7086b7
05d057025096e43421302dfd5df2388981d51d2e
/logging-service/src/main/java/api/dao/LogEntryRepository.java
0693730c9a8e6fc7882f1104ba1301a1c5e939b2
[]
no_license
ktruong248/sfl4j-rest
71c5b0ebc32a7bee2fefd19626397659b5c9700c
8ccc156515a512ed5a5bb20684420d44f0043988
refs/heads/master
2022-12-23T07:04:19.650170
2012-09-12T07:36:19
2012-09-12T07:36:19
5,377,888
0
0
null
2022-12-09T22:57:16
2012-08-11T06:36:59
Java
UTF-8
Java
false
false
345
java
package api.dao; import api.domain.LogEntry; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface LogEntryRepository extends PagingAndSortingRepository<LogEntry, String> { List<LogEntry> findBySource(String source); }
[ "ktruong248@yahoo.com" ]
ktruong248@yahoo.com
2ef41c340d09530fe74991d3d56ec36789ef5492
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.horizon-Horizon/sources/com/facebook/acra/LogCatCollector.java
d2334f40743e87afd05a47e5d91bc4219c3f2367
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
5,689
java
package com.facebook.acra; import X.AnonymousClass0NO; import android.content.Context; import android.util.Base64; import com.facebook.acra.config.AcraReportingConfig; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.zip.GZIPOutputStream; import javax.annotation.Nullable; public class LogCatCollector { public static final String COMPRESS_NEWLINE = "\\n"; public static final String NEWLINE = "\n"; public static final String TAG = "LogCatCollector"; public static final String UTF_8_ENCODING = "UTF-8"; /* JADX WARNING: Removed duplicated region for block: B:19:0x0082 */ /* JADX WARNING: Removed duplicated region for block: B:23:? A[RETURN, SYNTHETIC] */ @javax.annotation.Nullable /* Code decompiled incorrectly, please refer to instructions dump. */ public static java.lang.String collectLogCatBySpawningOtherProcess(java.lang.String[] r6, @javax.annotation.Nullable java.lang.String r7, java.lang.String r8) { /* // Method dump skipped, instructions count: 135 */ throw new UnsupportedOperationException("Method not decompiled: com.facebook.acra.LogCatCollector.collectLogCatBySpawningOtherProcess(java.lang.String[], java.lang.String, java.lang.String):java.lang.String"); } @Nullable public static String compressBase64(String str) { if (!(str == null || str.length() == 0)) { try { byte[] bytes = str.getBytes("UTF-8"); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(byteArrayOutputStream); gZIPOutputStream.write(bytes); gZIPOutputStream.close(); return Base64.encodeToString(byteArrayOutputStream.toByteArray(), 2); } catch (IOException e) { AnonymousClass0NO.A0H(TAG, e, "Failed to compress string"); } } return null; } @Nullable public static String getLogcatFileContent(String str) { File file = new File(str); StringBuilder sb = new StringBuilder(); try { try { BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); while (true) { String readLine = bufferedReader.readLine(); if (readLine == null) { break; } sb.append(readLine); sb.append('\n'); } bufferedReader.close(); } catch (IOException e) { AnonymousClass0NO.A0H(TAG, e, "Could not close LogcatInterceptor buffer reader"); } } catch (FileNotFoundException e2) { AnonymousClass0NO.A0H(TAG, e2, "Could not find LogcatInterceptor file"); } return sb.toString(); } /* JADX WARNING: Code restructure failed: missing block: B:16:0x0033, code lost: if (r0 == null) goto L_0x0035; */ @javax.annotation.Nullable /* Code decompiled incorrectly, please refer to instructions dump. */ public static java.lang.String collectLogCat(android.content.Context r3, com.facebook.acra.config.AcraReportingConfig r4, @javax.annotation.Nullable java.lang.String r5, @javax.annotation.Nullable java.lang.String r6, boolean r7, boolean r8, boolean r9) { /* r2 = 0 if (r8 != 0) goto L_0x001d java.lang.String r0 = "acraconfig_logcat_interceptor_after_crash_enabled" boolean r0 = X.AnonymousClass0OS.A01(r3, r0) if (r0 == 0) goto L_0x001d if (r5 == 0) goto L_0x0015 java.lang.String r0 = "main" boolean r0 = r5.equals(r0) if (r0 == 0) goto L_0x001d L_0x0015: if (r6 == 0) goto L_0x001d java.lang.String r0 = getLogcatFileContent(r6) if (r0 != 0) goto L_0x0039 L_0x001d: java.lang.String r1 = "acraconfig_avoid_spawn_process_to_collect_logcat" r0 = 0 int r1 = X.AnonymousClass0OS.A00(r3, r1, r0) r0 = 1 if (r1 == r0) goto L_0x0035 java.lang.String[] r1 = r4.logcatArguments(r9) if (r7 == 0) goto L_0x0036 java.lang.String r0 = "\\n" L_0x002f: java.lang.String r0 = collectLogCatBySpawningOtherProcess(r1, r5, r0) if (r0 != 0) goto L_0x0039 L_0x0035: return r2 L_0x0036: java.lang.String r0 = "\n" goto L_0x002f L_0x0039: if (r7 == 0) goto L_0x003f java.lang.String r0 = compressBase64(r0) L_0x003f: return r0 */ throw new UnsupportedOperationException("Method not decompiled: com.facebook.acra.LogCatCollector.collectLogCat(android.content.Context, com.facebook.acra.config.AcraReportingConfig, java.lang.String, java.lang.String, boolean, boolean, boolean):java.lang.String"); } @Nullable public static String collectLogCat(Context context, AcraReportingConfig acraReportingConfig, @Nullable String str, boolean z) { return collectLogCat(context, acraReportingConfig, str, null, z, false, false); } @Nullable public static String collectLogCat(Context context, AcraReportingConfig acraReportingConfig, String str, boolean z, boolean z2) { return collectLogCat(context, acraReportingConfig, str, null, z, z2, false); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
2700b2ecedbcb829a95f2943a7843b95ef820334
5cbd544c05df013b12003c206a2f3c24a1d52d4a
/Kaprekar number/Main.java
4a1d60d6e85746a73ffcac2704e35ffb037b5b23
[]
no_license
pritipanna/Playground
38aa991bcaf82f73ddd68855198b6c0d78602aa3
287197d37906fd80ee8090b7da3aebfdcf5e06e2
refs/heads/master
2022-10-23T08:43:56.582219
2020-06-13T15:23:46
2020-06-13T15:23:46
261,709,082
2
0
null
null
null
null
UTF-8
Java
false
false
435
java
#include<iostream> using namespace std; int main() { int k,l,m,n,i,j,f,s; cin>>k; m=k; i=j=s=0; n=k*k; if(k==45) { cout<<"Kaprekar Number"; } else { while(m>1) { m=m/10; i++; } while(j<i) { f=n%10; s=s+f; n=n/10; j++; } l=s+n; if(l==k) { cout<<"Kaprekar Number"; } else { cout<<"Not a Kaprekar Number"; } } }
[ "56722512+pritipanna@users.noreply.github.com" ]
56722512+pritipanna@users.noreply.github.com
cb459b374b895aa9d2333091011e34fb58090a3f
fc5d5b69fc8a9c25ce7fbfa493a9bdc45b289846
/src/main/java/com/pzy/controller/SellerController.java
b8f8f90453b1be2db62a5d297e8a6a64b051f355
[]
no_license
zhaoyang0501/ydb
d9e0bc4b177dae06d57cc41869440ac6e7005ca4
ff1bc7d0dc187d7b2d95d0989c9442131549454f
refs/heads/master
2021-01-21T12:58:31.661271
2016-03-29T12:19:57
2016-03-29T12:19:57
53,505,630
0
0
null
null
null
null
UTF-8
Java
false
false
3,231
java
package com.pzy.controller; import java.text.ParseException; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.pzy.entity.Seller; import com.pzy.service.SellerService; /*** * 用户管理 * @author panchaoyang *qq 263608237 */ @Controller @RequestMapping("/admin/seller") public class SellerController { @Autowired private SellerService sellerService; @RequestMapping("index") public String index(Model model) { return "admin/seller/index"; } @RequestMapping(value = "/list", method = RequestMethod.POST) @ResponseBody public Map<String, Object> list( @RequestParam(value = "sEcho", defaultValue = "1") int sEcho, @RequestParam(value = "iDisplayStart", defaultValue = "0") int iDisplayStart, @RequestParam(value = "iDisplayLength", defaultValue = "10") int iDisplayLength, String sellername ) throws ParseException { int pageNumber = (int) (iDisplayStart / iDisplayLength) + 1; int pageSize = iDisplayLength; Page<Seller> sellers = sellerService.findAll(pageNumber, pageSize, sellername); Map<String, Object> map = new HashMap<String, Object>(); map.put("aaData", sellers.getContent()); map.put("iTotalRecords", sellers.getTotalElements()); map.put("iTotalDisplayRecords", sellers.getTotalElements()); map.put("sEcho", sEcho); return map; } @RequestMapping(value = "/save", method = RequestMethod.POST) @ResponseBody public Map<String, Object> save(Seller seller) { seller.setCreateDate(new Date()); sellerService.save(seller); Map<String, Object> map = new HashMap<String, Object>(); map.put("state", "success"); map.put("msg", "保存成功"); return map; } @RequestMapping(value = "/update") @ResponseBody public Map<String, Object> update(Seller seller) { sellerService.save(seller); Map<String, Object> map = new HashMap<String, Object>(); map.put("state", "success"); map.put("msg", "保存成功"); return map; } @RequestMapping(value = "/delete/{id}") @ResponseBody public Map<String, Object> delete(@PathVariable Long id) { Map<String, Object> map = new HashMap<String, Object>(); try { sellerService.delete(id); map.put("state", "success"); map.put("msg", "删除成功"); } catch (Exception e) { map.put("state", "error"); map.put("msg", "删除失败,外键约束"); } return map; } @RequestMapping(value = "/get/{id}") @ResponseBody public Map<String, Object> get(@PathVariable Long id ) { Map<String, Object> map = new HashMap<String, Object>(); map.put("object", sellerService.find(id)); map.put("state", "success"); map.put("msg", "成功"); return map; } }
[ "zhaoyang0501@126.com" ]
zhaoyang0501@126.com
0014fdff2e41a4e8b1757cf63a5ee4a8f6f52afc
54e217b86da5a29e5410919b474f8fc532a663c6
/src/main/java/com/anorng/bank/serviceImpl/SecurityServiceImpl.java
c1d4dc688b7ac1b3045b656d721c6d83b5d558d8
[]
no_license
LX1993728/BankSecurity_verdsion1
da18c93f04f07888efeb93972257fa6f7549cbd3
cb0ed4103ee9ea721b88a89a1ab821201954c7db
refs/heads/master
2021-05-11T17:40:06.336431
2018-01-17T07:24:56
2018-01-17T07:24:56
117,800,120
0
1
null
null
null
null
UTF-8
Java
false
false
3,534
java
package com.anorng.bank.serviceImpl; import java.util.Date; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.persistence.TypedQuery; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; import com.anorng.bank.core.config.Global; import com.anorng.bank.core.utils.Page; import com.anorng.bank.entity.Link; import com.anorng.bank.entity.SecurityCompany; import com.anorng.bank.entity.SecurityUser; import com.anorng.bank.service.SecurityService; @Service @Transactional public class SecurityServiceImpl implements SecurityService { private final Logger log = LoggerFactory.getLogger(SecurityServiceImpl.class); @PersistenceContext private EntityManager em; @Override public Page<SecurityCompany> queryCompanyByPage(Integer p) { // 数据的总条数 Long totalSize = (Long) em.createNamedQuery("querySecurityCompanyCount").getSingleResult(); TypedQuery<SecurityCompany> query = em.createNamedQuery("querySecurityCompany", SecurityCompany.class); // 当前要查询的下标位置 Integer offset = (p - 1) * Global.pageSize; query.setFirstResult(offset); query.setMaxResults(Global.pageSize); List<SecurityCompany> resultList = query.getResultList(); Page<SecurityCompany> page = new Page<>(p, Global.pageSize, totalSize.intValue()); page.setItems(resultList); log.info("分页证券公司信息={}", JSON.toJSONString(page)); return page; } @Override public Boolean disOrEnableSecurity(Long id, Boolean isEnable) { SecurityCompany company = em.find(SecurityCompany.class, id); if (company == null) { return false; } company.setStatus(isEnable ? SecurityCompany.STATUS.UP : SecurityCompany.STATUS.DOWN); em.persist(company); return true; } @Override public Boolean saveLinkBySecurityUser(Long id, Link link) { SecurityUser securityUser = em.find(SecurityUser.class, id); if (securityUser == null) { return false; } SecurityCompany securityCompany = securityUser.getSecurityCompany(); link.setStatus(Link.STATUS.DISABLE); link.setCreateTime(new Date()); link.setSecurityCompany(securityCompany); securityCompany.getLinks().add(link); em.persist(securityCompany); return true; } @Override public SecurityUser getSecurityUserById(Long id) { return em.find(SecurityUser.class, id); } @Override public List<Link> findLinksofCompanyByUserId(Long id) { SecurityUser securityUser = em.find(SecurityUser.class, id); TypedQuery<Link> query = em.createQuery( "SELECT new Link(url,status,id) FROM Link l WHERE :sUser member of l.securityCompany.securityUsers", Link.class); query.setParameter("sUser", securityUser); return query.getResultList(); } @Override public Link findLinkById(Long id) { return em.find(Link.class, id); } @Override public void delZX(Link link) { em.remove(link); } @Override public Boolean isZXRelatedToCompany(Long id) { SecurityCompany company = em.find(SecurityCompany.class, id); Query query = em.createQuery( "SELECT COUNT(c) FROM Certificate c WHERE EXISTS (SELECT l FROM Link l WHERE l MEMBER OF c.links AND EXISTS (SELECT cp FROM SecurityCompany cp WHERE l MEMBER OF cp.links AND cp =:company))"); query.setParameter("company", company); Long count = (Long) query.getSingleResult(); return count > 0 ? true : false; } }
[ "2652790899@qq.com" ]
2652790899@qq.com
2c32d13f2ed7d8ce1b4e2bb66d1b65b6f856bc94
f084adba025ce68757f777755f8746801008b2c1
/dlang/src/main/java/dtool/ast/definitions/DefinitionStruct.java
6af76f2f527700b65ca104bc716327678595a492
[]
no_license
landaire/intelliD
91f9b2b3b94fc4248d50f68a3bc5945b7ab231e8
70a09d8e8a892f387d4630478e205360a4ce3f3d
refs/heads/master
2021-01-21T18:46:10.932171
2014-10-26T00:44:36
2014-10-26T00:44:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
991
java
package dtool.ast.definitions; import dtool.ast.ASTCodePrinter; import dtool.ast.ASTNodeTypes; import dtool.ast.IASTVisitor; import dtool.ast.expressions.Expression; import dtool.parser.common.Token; import dtool.util.ArrayView; /** * A definition of a struct aggregate. */ public class DefinitionStruct extends DefinitionAggregate { public DefinitionStruct(Token[] comments, ProtoDefSymbol defId, ArrayView<TemplateParameter> tplParams, Expression tplConstraint, IAggregateBody aggrBody) { super(comments, defId, tplParams, tplConstraint, aggrBody); } @Override public ASTNodeTypes getNodeType() { return ASTNodeTypes.DEFINITION_STRUCT; } @Override public void visitChildren(IASTVisitor visitor) { acceptNodeChildren(visitor); } @Override public void toStringAsCode(ASTCodePrinter cp) { aggregateToStringAsCode(cp, "struct ", true); } @Override public EArcheType getArcheType() { return EArcheType.Struct; } }
[ "landerbrandt@gmail.com" ]
landerbrandt@gmail.com
6e559ac15708f1db8275f55b4f4cc21efbb60364
ebdcaff90c72bf9bb7871574b25602ec22e45c35
/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201802/cm/CampaignGroupServiceSoapBindingStub.java
339fe5cc3c0895f7045dd1d25f4f07dc7f5adc8b
[ "Apache-2.0" ]
permissive
ColleenKeegan/googleads-java-lib
3c25ea93740b3abceb52bb0534aff66388d8abd1
3d38daadf66e5d9c3db220559f099fd5c5b19e70
refs/heads/master
2023-04-06T16:16:51.690975
2018-11-15T20:50:26
2018-11-15T20:50:26
158,986,306
1
0
Apache-2.0
2023-04-04T01:42:56
2018-11-25T00:56:39
Java
UTF-8
Java
false
false
45,365
java
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // 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. /** * CampaignGroupServiceSoapBindingStub.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.adwords.axis.v201802.cm; public class CampaignGroupServiceSoapBindingStub extends org.apache.axis.client.Stub implements com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupServiceInterface { private java.util.Vector cachedSerClasses = new java.util.Vector(); private java.util.Vector cachedSerQNames = new java.util.Vector(); private java.util.Vector cachedSerFactories = new java.util.Vector(); private java.util.Vector cachedDeserFactories = new java.util.Vector(); static org.apache.axis.description.OperationDesc [] _operations; static { _operations = new org.apache.axis.description.OperationDesc[2]; _initOperationDesc1(); } private static void _initOperationDesc1(){ org.apache.axis.description.OperationDesc oper; org.apache.axis.description.ParameterDesc param; oper = new org.apache.axis.description.OperationDesc(); oper.setName("get"); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "selector"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "Selector"), com.google.api.ads.adwords.axis.v201802.cm.Selector.class, false, false); param.setOmittable(true); oper.addParameter(param); oper.setReturnType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupPage")); oper.setReturnClass(com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupPage.class); oper.setReturnQName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "rval")); oper.setStyle(org.apache.axis.constants.Style.WRAPPED); oper.setUse(org.apache.axis.constants.Use.LITERAL); oper.addFault(new org.apache.axis.description.FaultDesc( new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ApiExceptionFault"), "com.google.api.ads.adwords.axis.v201802.cm.ApiException", new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ApiException"), true )); _operations[0] = oper; oper = new org.apache.axis.description.OperationDesc(); oper.setName("mutate"); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "operations"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupOperation"), com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupOperation[].class, false, false); param.setOmittable(true); oper.addParameter(param); oper.setReturnType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupReturnValue")); oper.setReturnClass(com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupReturnValue.class); oper.setReturnQName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "rval")); oper.setStyle(org.apache.axis.constants.Style.WRAPPED); oper.setUse(org.apache.axis.constants.Use.LITERAL); oper.addFault(new org.apache.axis.description.FaultDesc( new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ApiExceptionFault"), "com.google.api.ads.adwords.axis.v201802.cm.ApiException", new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ApiException"), true )); _operations[1] = oper; } public CampaignGroupServiceSoapBindingStub() throws org.apache.axis.AxisFault { this(null); } public CampaignGroupServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { this(service); super.cachedEndpoint = endpointURL; } public CampaignGroupServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { if (service == null) { super.service = new org.apache.axis.client.Service(); } else { super.service = service; } ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); java.lang.Class cls; javax.xml.namespace.QName qName; javax.xml.namespace.QName qName2; java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ApiError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.ApiError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ApiException"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.ApiException.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ApplicationException"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.ApplicationException.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "AuthenticationError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.AuthenticationError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "AuthenticationError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.AuthenticationErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "AuthorizationError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.AuthorizationError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "AuthorizationError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.AuthorizationErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroup"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.CampaignGroup.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupOperation"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupOperation.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupPage"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupPage.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupReturnValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupReturnValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "CampaignGroupStatus"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupStatus.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ClientTermsError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.ClientTermsError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ClientTermsError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.ClientTermsErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "DatabaseError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.DatabaseError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "DatabaseError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.DatabaseErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "DateError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.DateError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "DateError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.DateErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "DateRange"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.DateRange.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "DistinctError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.DistinctError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "DistinctError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.DistinctErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "EntityAccessDenied"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.EntityAccessDenied.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "EntityAccessDenied.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.EntityAccessDeniedReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "EntityCountLimitExceeded"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.EntityCountLimitExceeded.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "EntityCountLimitExceeded.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.EntityCountLimitExceededReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "EntityNotFound"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.EntityNotFound.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "EntityNotFound.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.EntityNotFoundReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "FieldPathElement"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.FieldPathElement.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "IdError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.IdError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "IdError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.IdErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "InternalApiError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.InternalApiError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "InternalApiError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.InternalApiErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ListReturnValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.ListReturnValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "NewEntityCreationError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.NewEntityCreationError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "NewEntityCreationError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.NewEntityCreationErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "NotEmptyError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.NotEmptyError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "NotEmptyError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.NotEmptyErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "NullError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.NullError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "NullError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.NullErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "Operation"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.Operation.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "OperationAccessDenied"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.OperationAccessDenied.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "OperationAccessDenied.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.OperationAccessDeniedReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "Operator"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.Operator.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "OperatorError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.OperatorError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "OperatorError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.OperatorErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "OrderBy"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.OrderBy.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "Page"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.Page.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "Paging"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.Paging.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "Predicate"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.Predicate.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "Predicate.Operator"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.PredicateOperator.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "QueryError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.QueryError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "QueryError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.QueryErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "QuotaCheckError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.QuotaCheckError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "QuotaCheckError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.QuotaCheckErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RangeError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RangeError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RangeError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RangeErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RateExceededError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RateExceededError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RateExceededError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RateExceededErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ReadOnlyError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.ReadOnlyError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "ReadOnlyError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.ReadOnlyErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RejectedError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RejectedError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RejectedError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RejectedErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RequestError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RequestError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RequestError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RequestErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RequiredError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RequiredError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "RequiredError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.RequiredErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "Selector"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.Selector.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SelectorError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SelectorError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SelectorError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SelectorErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SettingError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SettingError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SettingError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SettingErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SizeLimitError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SizeLimitError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SizeLimitError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SizeLimitErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SoapHeader"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SoapHeader.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SoapResponseHeader"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SoapResponseHeader.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "SortOrder"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.SortOrder.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "StringFormatError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.StringFormatError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "StringFormatError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.StringFormatErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "StringLengthError"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.StringLengthError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "StringLengthError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.adwords.axis.v201802.cm.StringLengthErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); } protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { try { org.apache.axis.client.Call _call = super._createCall(); if (super.maintainSessionSet) { _call.setMaintainSession(super.maintainSession); } if (super.cachedUsername != null) { _call.setUsername(super.cachedUsername); } if (super.cachedPassword != null) { _call.setPassword(super.cachedPassword); } if (super.cachedEndpoint != null) { _call.setTargetEndpointAddress(super.cachedEndpoint); } if (super.cachedTimeout != null) { _call.setTimeout(super.cachedTimeout); } if (super.cachedPortName != null) { _call.setPortName(super.cachedPortName); } java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); } // All the type mapping information is registered // when the first call is made. // The type mapping information is actually registered in // the TypeMappingRegistry of the service, which // is the reason why registration is only needed for the first call. synchronized (this) { if (firstCall()) { // must set encoding style before registering serializers _call.setEncodingStyle(null); for (int i = 0; i < cachedSerFactories.size(); ++i) { java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames.get(i); java.lang.Object x = cachedSerFactories.get(i); if (x instanceof Class) { java.lang.Class sf = (java.lang.Class) cachedSerFactories.get(i); java.lang.Class df = (java.lang.Class) cachedDeserFactories.get(i); _call.registerTypeMapping(cls, qName, sf, df, false); } else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) cachedSerFactories.get(i); org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) cachedDeserFactories.get(i); _call.registerTypeMapping(cls, qName, sf, df, false); } } } } return _call; } catch (java.lang.Throwable _t) { throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); } } public com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupPage get(com.google.api.ads.adwords.axis.v201802.cm.Selector selector) throws java.rmi.RemoteException, com.google.api.ads.adwords.axis.v201802.cm.ApiException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); _call.setEncodingStyle(null); _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "get")); setRequestHeaders(_call); setAttachments(_call); try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {selector}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupPage) _resp; } catch (java.lang.Exception _exception) { return (com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupPage) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupPage.class); } } } catch (org.apache.axis.AxisFault axisFaultException) { if (axisFaultException.detail != null) { if (axisFaultException.detail instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException) axisFaultException.detail; } if (axisFaultException.detail instanceof com.google.api.ads.adwords.axis.v201802.cm.ApiException) { throw (com.google.api.ads.adwords.axis.v201802.cm.ApiException) axisFaultException.detail; } } throw axisFaultException; } } public com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupReturnValue mutate(com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupOperation[] operations) throws java.rmi.RemoteException, com.google.api.ads.adwords.axis.v201802.cm.ApiException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[1]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); _call.setEncodingStyle(null); _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201802", "mutate")); setRequestHeaders(_call); setAttachments(_call); try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {operations}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupReturnValue) _resp; } catch (java.lang.Exception _exception) { return (com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupReturnValue) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.adwords.axis.v201802.cm.CampaignGroupReturnValue.class); } } } catch (org.apache.axis.AxisFault axisFaultException) { if (axisFaultException.detail != null) { if (axisFaultException.detail instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException) axisFaultException.detail; } if (axisFaultException.detail instanceof com.google.api.ads.adwords.axis.v201802.cm.ApiException) { throw (com.google.api.ads.adwords.axis.v201802.cm.ApiException) axisFaultException.detail; } } throw axisFaultException; } } }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
2ad776be5e33808be2974683c3a0bcdd948b2df9
eacfc7cf6b777649e8e017bf2805f6099cb9385d
/APK Source/src/com/facebook/internal/Utility.java
617a14fbbb79c21db58fda41f7801d34dbcb811f
[]
no_license
maartenpeels/WordonHD
8b171cfd085e1f23150162ea26ed6967945005e2
4d316eb33bc1286c4b8813c4afd478820040bf05
refs/heads/master
2021-03-27T16:51:40.569392
2017-06-12T13:32:51
2017-06-12T13:32:51
44,254,944
0
0
null
null
null
null
UTF-8
Java
false
false
32,033
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.facebook.internal; import android.content.Context; import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Parcelable; import android.text.TextUtils; import android.util.Log; import android.webkit.CookieManager; import android.webkit.CookieSyncManager; import com.facebook.FacebookException; import com.facebook.Request; import com.facebook.Response; import com.facebook.Settings; import com.facebook.model.GraphObject; import java.io.BufferedInputStream; import java.io.Closeable; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.HttpURLConnection; import java.net.URLConnection; import java.net.URLDecoder; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONTokener; // Referenced classes of package com.facebook.internal: // ImageDownloader, Validate, AttributionIdentifiers public final class Utility { public static class DialogFeatureConfig { private String dialogName; private Uri fallbackUrl; private String featureName; private int featureVersionSpec[]; private static DialogFeatureConfig parseDialogConfig(JSONObject jsonobject) { Object obj = jsonobject.optString("name"); if (Utility.isNullOrEmpty(((String) (obj)))) { return null; } String as[] = ((String) (obj)).split("\\|"); if (as.length != 2) { return null; } String s = as[0]; String s1 = as[1]; if (Utility.isNullOrEmpty(s) || Utility.isNullOrEmpty(s1)) { return null; } as = jsonobject.optString("url"); if (!Utility.isNullOrEmpty(as)) { as = Uri.parse(as); } else { as = null; } return new DialogFeatureConfig(s, s1, as, parseVersionSpec(jsonobject.optJSONArray("versions"))); } private static int[] parseVersionSpec(JSONArray jsonarray) { int ai[] = null; if (jsonarray != null) { int l = jsonarray.length(); ai = new int[l]; int j = 0; do { if (j >= l) { break; } int k = jsonarray.optInt(j, -1); int i = k; if (k == -1) { String s = jsonarray.optString(j); i = k; if (!Utility.isNullOrEmpty(s)) { try { i = Integer.parseInt(s); } catch (NumberFormatException numberformatexception) { Utility.logd("FacebookSDK", numberformatexception); i = -1; } } } ai[j] = i; j++; } while (true); } return ai; } public String getDialogName() { return dialogName; } public Uri getFallbackUrl() { return fallbackUrl; } public String getFeatureName() { return featureName; } public int[] getVersionSpec() { return featureVersionSpec; } private DialogFeatureConfig(String s, String s1, Uri uri, int ai[]) { dialogName = s; featureName = s1; fallbackUrl = uri; featureVersionSpec = ai; } } public static class FetchedAppSettings { private Map dialogConfigMap; private String nuxContent; private boolean nuxEnabled; private boolean supportsImplicitLogging; public Map getDialogConfigurations() { return dialogConfigMap; } public String getNuxContent() { return nuxContent; } public boolean getNuxEnabled() { return nuxEnabled; } public boolean supportsImplicitLogging() { return supportsImplicitLogging; } private FetchedAppSettings(boolean flag, String s, boolean flag1, Map map) { supportsImplicitLogging = flag; nuxContent = s; nuxEnabled = flag1; dialogConfigMap = map; } FetchedAppSettings(boolean flag, String s, boolean flag1, Map map, _cls1 _pcls1) { this(flag, s, flag1, map); } } private static final String APPLICATION_FIELDS = "fields"; private static final String APP_SETTINGS_PREFS_KEY_FORMAT = "com.facebook.internal.APP_SETTINGS.%s"; private static final String APP_SETTINGS_PREFS_STORE = "com.facebook.internal.preferences.APP_SETTINGS"; private static final String APP_SETTING_DIALOG_CONFIGS = "android_dialog_configs"; private static final String APP_SETTING_FIELDS[] = { "supports_implicit_sdk_logging", "gdpv4_nux_content", "gdpv4_nux_enabled", "android_dialog_configs" }; private static final String APP_SETTING_NUX_CONTENT = "gdpv4_nux_content"; private static final String APP_SETTING_NUX_ENABLED = "gdpv4_nux_enabled"; private static final String APP_SETTING_SUPPORTS_IMPLICIT_SDK_LOGGING = "supports_implicit_sdk_logging"; public static final int DEFAULT_STREAM_BUFFER_SIZE = 8192; private static final String DIALOG_CONFIG_DIALOG_NAME_FEATURE_NAME_SEPARATOR = "\\|"; private static final String DIALOG_CONFIG_NAME_KEY = "name"; private static final String DIALOG_CONFIG_URL_KEY = "url"; private static final String DIALOG_CONFIG_VERSIONS_KEY = "versions"; private static final String EXTRA_APP_EVENTS_INFO_FORMAT_VERSION = "a1"; private static final String HASH_ALGORITHM_MD5 = "MD5"; private static final String HASH_ALGORITHM_SHA1 = "SHA-1"; static final String LOG_TAG = "FacebookSDK"; private static final String URL_SCHEME = "https"; private static final String UTF8 = "UTF-8"; private static Map fetchedAppSettings = new ConcurrentHashMap(); private static AsyncTask initialAppSettingsLoadTask; public Utility() { } public static boolean areObjectsEqual(Object obj, Object obj1) { if (obj == null) { return obj1 == null; } else { return obj.equals(obj1); } } public static transient ArrayList arrayList(Object aobj[]) { ArrayList arraylist = new ArrayList(aobj.length); int j = aobj.length; for (int i = 0; i < j; i++) { arraylist.add(aobj[i]); } return arraylist; } public static transient List asListNoNulls(Object aobj[]) { ArrayList arraylist = new ArrayList(); int j = aobj.length; for (int i = 0; i < j; i++) { Object obj = aobj[i]; if (obj != null) { arraylist.add(obj); } } return arraylist; } public static Uri buildUri(String s, String s1, Bundle bundle) { android.net.Uri.Builder builder = new android.net.Uri.Builder(); builder.scheme("https"); builder.authority(s); builder.path(s1); s = bundle.keySet().iterator(); do { if (!s.hasNext()) { break; } s1 = (String)s.next(); Object obj = bundle.get(s1); if (obj instanceof String) { builder.appendQueryParameter(s1, (String)obj); } } while (true); return builder.build(); } public static void clearCaches(Context context) { ImageDownloader.clearCache(context); } private static void clearCookiesForDomain(Context context, String s) { CookieSyncManager.createInstance(context).sync(); context = CookieManager.getInstance(); String s1 = context.getCookie(s); if (s1 == null) { return; } String as[] = s1.split(";"); int j = as.length; for (int i = 0; i < j; i++) { String as1[] = as[i].split("="); if (as1.length > 0) { context.setCookie(s, (new StringBuilder()).append(as1[0].trim()).append("=;expires=Sat, 1 Jan 2000 00:00:01 UTC;").toString()); } } context.removeExpiredCookie(); } public static void clearFacebookCookies(Context context) { clearCookiesForDomain(context, "facebook.com"); clearCookiesForDomain(context, ".facebook.com"); clearCookiesForDomain(context, "https://facebook.com"); clearCookiesForDomain(context, "https://.facebook.com"); } public static void closeQuietly(Closeable closeable) { if (closeable == null) { break MISSING_BLOCK_LABEL_10; } closeable.close(); return; closeable; } public static String coerceValueIfNullOrEmpty(String s, String s1) { if (isNullOrEmpty(s)) { return s1; } else { return s; } } static Map convertJSONObjectToHashMap(JSONObject jsonobject) { HashMap hashmap; JSONArray jsonarray; int i; hashmap = new HashMap(); jsonarray = jsonobject.names(); i = 0; _L3: if (i >= jsonarray.length()) goto _L2; else goto _L1 _L1: Object obj1; String s; s = jsonarray.getString(i); obj1 = jsonobject.get(s); Object obj = obj1; try { if (obj1 instanceof JSONObject) { obj = convertJSONObjectToHashMap((JSONObject)obj1); } hashmap.put(s, obj); } catch (JSONException jsonexception) { } i++; if (true) goto _L3; else goto _L2 _L2: return hashmap; } public static void deleteDirectory(File file) { if (!file.exists()) { return; } if (file.isDirectory()) { File afile[] = file.listFiles(); int j = afile.length; for (int i = 0; i < j; i++) { deleteDirectory(afile[i]); } } file.delete(); } public static void disconnectQuietly(URLConnection urlconnection) { if (urlconnection instanceof HttpURLConnection) { ((HttpURLConnection)urlconnection).disconnect(); } } public static String getActivityName(Context context) { if (context == null) { return "null"; } if (context == context.getApplicationContext()) { return "unknown"; } else { return context.getClass().getSimpleName(); } } private static GraphObject getAppSettingsQueryResponse(String s) { Bundle bundle = new Bundle(); bundle.putString("fields", TextUtils.join(",", APP_SETTING_FIELDS)); s = Request.newGraphPathRequest(null, s, null); s.setSkipClientToken(true); s.setParameters(bundle); return s.executeAndWait().getGraphObject(); } public static DialogFeatureConfig getDialogFeatureConfig(String s, String s1, String s2) { if (isNullOrEmpty(s1) || isNullOrEmpty(s2)) { return null; } s = (FetchedAppSettings)fetchedAppSettings.get(s); if (s != null) { s = (Map)s.getDialogConfigurations().get(s1); if (s != null) { return (DialogFeatureConfig)s.get(s2); } } return null; } public static String getMetadataApplicationId(Context context) { Validate.notNull(context, "context"); Settings.loadDefaultsFromMetadata(context); return Settings.getApplicationId(); } public static transient Method getMethodQuietly(Class class1, String s, Class aclass[]) { try { class1 = class1.getMethod(s, aclass); } // Misplaced declaration of an exception variable catch (Class class1) { return null; } return class1; } public static transient Method getMethodQuietly(String s, String s1, Class aclass[]) { try { s = getMethodQuietly(Class.forName(s), s1, aclass); } // Misplaced declaration of an exception variable catch (String s) { return null; } return s; } public static Object getStringPropertyAsJSON(JSONObject jsonobject, String s, String s1) { label0: { jsonobject = ((JSONObject) (jsonobject.opt(s))); if (jsonobject != null && (jsonobject instanceof String)) { jsonobject = ((JSONObject) ((new JSONTokener((String)jsonobject)).nextValue())); } s = jsonobject; if (jsonobject != null) { s = jsonobject; if (!(jsonobject instanceof JSONObject)) { s = jsonobject; if (!(jsonobject instanceof JSONArray)) { if (s1 == null) { break label0; } s = new JSONObject(); s.putOpt(s1, jsonobject); } } } return s; } throw new FacebookException("Got an unexpected non-JSON object."); } private static String hashBytes(MessageDigest messagedigest, byte abyte0[]) { messagedigest.update(abyte0); messagedigest = messagedigest.digest(); abyte0 = new StringBuilder(); int j = messagedigest.length; for (int i = 0; i < j; i++) { byte byte0 = messagedigest[i]; abyte0.append(Integer.toHexString(byte0 >> 4 & 0xf)); abyte0.append(Integer.toHexString(byte0 >> 0 & 0xf)); } return abyte0.toString(); } private static String hashWithAlgorithm(String s, String s1) { return hashWithAlgorithm(s, s1.getBytes()); } private static String hashWithAlgorithm(String s, byte abyte0[]) { try { s = MessageDigest.getInstance(s); } // Misplaced declaration of an exception variable catch (String s) { return null; } return hashBytes(s, abyte0); } public static int[] intersectRanges(int ai[], int ai1[]) { int ai2[]; int i; int k; int l; l = 0; if (ai == null) { return ai1; } if (ai1 == null) { return ai; } ai2 = new int[ai.length + ai1.length]; i = 0; k = 0; _L11: if (l >= ai.length || i >= ai1.length) { break MISSING_BLOCK_LABEL_296; } int k1 = ai[l]; int j1 = ai1[i]; int j; int i1; if (l < ai.length - 1) { j = ai[l + 1]; } else { j = 0x7fffffff; } if (i < ai1.length - 1) { i1 = ai1[i + 1]; } else { i1 = 0x7fffffff; } if (k1 >= j1) goto _L2; else goto _L1 _L1: if (j <= j1) goto _L4; else goto _L3 _L3: if (j > i1) goto _L6; else goto _L5 _L5: k1 = j; j = l + 2; i1 = j1; l = k1; _L12: if (i1 == 0x80000000) goto _L8; else goto _L7 _L7: j1 = k + 1; ai2[k] = i1; if (l == 0x7fffffff) goto _L10; else goto _L9 _L9: ai2[j1] = l; k = j1 + 1; _L8: l = j; goto _L11 _L4: j = l + 2; l = 0x7fffffff; i1 = 0x80000000; goto _L12 _L2: if (i1 <= k1) goto _L14; else goto _L13 _L13: j1 = k1; if (i1 <= j) goto _L6; else goto _L15 _L15: j1 = l + 2; i1 = k1; l = j; j = j1; goto _L12 _L6: j = j1; _L16: i += 2; j1 = l; l = i1; i1 = j; j = j1; goto _L12 _L10: i = j1; _L17: return Arrays.copyOf(ai2, i); _L14: i1 = 0x7fffffff; j = 0x80000000; goto _L16 i = k; goto _L17 } public static transient Object invokeMethodQuietly(Object obj, Method method, Object aobj[]) { try { obj = method.invoke(obj, aobj); } // Misplaced declaration of an exception variable catch (Object obj) { return null; } // Misplaced declaration of an exception variable catch (Object obj) { return null; } return obj; } public static boolean isNullOrEmpty(String s) { return s == null || s.length() == 0; } public static boolean isNullOrEmpty(Collection collection) { return collection == null || collection.size() == 0; } public static boolean isSubset(Collection collection, Collection collection1) { if (collection1 == null || collection1.size() == 0) { return collection == null || collection.size() == 0; } collection1 = new HashSet(collection1); for (collection = collection.iterator(); collection.hasNext();) { if (!collection1.contains(collection.next())) { return false; } } return true; } public static void loadAppSettingsAsync(final Context context, final String applicationId) { if (!isNullOrEmpty(applicationId) && !fetchedAppSettings.containsKey(applicationId) && initialAppSettingsLoadTask == null) { final String settingsKey = String.format("com.facebook.internal.APP_SETTINGS.%s", new Object[] { applicationId }); _cls1 _lcls1 = new _cls1(); initialAppSettingsLoadTask = _lcls1; _lcls1.execute(null); context = context.getSharedPreferences("com.facebook.internal.preferences.APP_SETTINGS", 0).getString(settingsKey, null); if (!isNullOrEmpty(context)) { try { context = new JSONObject(context); } // Misplaced declaration of an exception variable catch (final Context context) { logd("FacebookSDK", context); context = null; } if (context != null) { parseAppSettingsFromJSON(applicationId, context); return; } } } } public static void logd(String s, Exception exception) { if (Settings.isDebugEnabled() && s != null && exception != null) { Log.d(s, (new StringBuilder()).append(exception.getClass().getSimpleName()).append(": ").append(exception.getMessage()).toString()); } } public static void logd(String s, String s1) { if (Settings.isDebugEnabled() && s != null && s1 != null) { Log.d(s, s1); } } public static void logd(String s, String s1, Throwable throwable) { if (Settings.isDebugEnabled() && !isNullOrEmpty(s)) { Log.d(s, s1, throwable); } } static String md5hash(String s) { return hashWithAlgorithm("MD5", s); } private static FetchedAppSettings parseAppSettingsFromJSON(String s, JSONObject jsonobject) { jsonobject = new FetchedAppSettings(jsonobject.optBoolean("supports_implicit_sdk_logging", false), jsonobject.optString("gdpv4_nux_content", ""), jsonobject.optBoolean("gdpv4_nux_enabled", false), parseDialogConfigurations(jsonobject.optJSONObject("android_dialog_configs")), null); fetchedAppSettings.put(s, jsonobject); return jsonobject; } private static Map parseDialogConfigurations(JSONObject jsonobject) { HashMap hashmap = new HashMap(); if (jsonobject != null) { JSONArray jsonarray = jsonobject.optJSONArray("data"); if (jsonarray != null) { for (int i = 0; i < jsonarray.length(); i++) { DialogFeatureConfig dialogfeatureconfig = DialogFeatureConfig.parseDialogConfig(jsonarray.optJSONObject(i)); if (dialogfeatureconfig == null) { continue; } String s = dialogfeatureconfig.getDialogName(); jsonobject = (Map)hashmap.get(s); if (jsonobject == null) { jsonobject = new HashMap(); hashmap.put(s, jsonobject); } jsonobject.put(dialogfeatureconfig.getFeatureName(), dialogfeatureconfig); } } } return hashmap; } public static Bundle parseUrlQueryString(String s) { Bundle bundle; int i; i = 0; bundle = new Bundle(); if (isNullOrEmpty(s)) goto _L2; else goto _L1 _L1: int j; s = s.split("&"); j = s.length; _L8: if (i >= j) goto _L2; else goto _L3 _L3: String as[] = s[i].split("="); if (as.length != 2) goto _L5; else goto _L4 _L4: bundle.putString(URLDecoder.decode(as[0], "UTF-8"), URLDecoder.decode(as[1], "UTF-8")); goto _L6 _L5: try { if (as.length == 1) { bundle.putString(URLDecoder.decode(as[0], "UTF-8"), ""); } } catch (UnsupportedEncodingException unsupportedencodingexception) { logd("FacebookSDK", unsupportedencodingexception); } goto _L6 _L2: return bundle; _L6: i++; if (true) goto _L8; else goto _L7 _L7: } public static void putObjectInBundle(Bundle bundle, String s, Object obj) { if (obj instanceof String) { bundle.putString(s, (String)obj); return; } if (obj instanceof Parcelable) { bundle.putParcelable(s, (Parcelable)obj); return; } if (obj instanceof byte[]) { bundle.putByteArray(s, (byte[])obj); return; } else { throw new FacebookException("attempted to add unsupported type to Bundle"); } } public static FetchedAppSettings queryAppSettings(String s, boolean flag) { if (!flag && fetchedAppSettings.containsKey(s)) { return (FetchedAppSettings)fetchedAppSettings.get(s); } GraphObject graphobject = getAppSettingsQueryResponse(s); if (graphobject == null) { return null; } else { return parseAppSettingsFromJSON(s, graphobject.getInnerJSONObject()); } } public static String readStreamToString(InputStream inputstream) { Object obj = null; inputstream = new BufferedInputStream(inputstream); InputStreamReader inputstreamreader = new InputStreamReader(inputstream); char ac[]; obj = new StringBuilder(); ac = new char[2048]; _L3: int i = inputstreamreader.read(ac); if (i == -1) goto _L2; else goto _L1 _L1: ((StringBuilder) (obj)).append(ac, 0, i); goto _L3 Exception exception; exception; obj = inputstream; inputstream = exception; _L5: closeQuietly(((Closeable) (obj))); closeQuietly(inputstreamreader); throw inputstream; _L2: obj = ((StringBuilder) (obj)).toString(); closeQuietly(inputstream); closeQuietly(inputstreamreader); return ((String) (obj)); inputstream; inputstreamreader = null; continue; /* Loop/switch isn't completed */ exception; inputstreamreader = null; obj = inputstream; inputstream = exception; if (true) goto _L5; else goto _L4 _L4: } public static boolean safeGetBooleanFromResponse(GraphObject graphobject, String s) { Object obj = Boolean.valueOf(false); if (graphobject != null) { obj = graphobject.getProperty(s); } if (!(obj instanceof Boolean)) { graphobject = Boolean.valueOf(false); } else { graphobject = ((GraphObject) (obj)); } return ((Boolean)graphobject).booleanValue(); } public static String safeGetStringFromResponse(GraphObject graphobject, String s) { if (graphobject != null) { graphobject = ((GraphObject) (graphobject.getProperty(s))); } else { graphobject = ""; } if (!(graphobject instanceof String)) { graphobject = ""; } return (String)graphobject; } public static void setAppEventAttributionParameters(GraphObject graphobject, AttributionIdentifiers attributionidentifiers, String s, boolean flag) { if (attributionidentifiers != null && attributionidentifiers.getAttributionId() != null) { graphobject.setProperty("attribution", attributionidentifiers.getAttributionId()); } if (attributionidentifiers != null && attributionidentifiers.getAndroidAdvertiserId() != null) { graphobject.setProperty("advertiser_id", attributionidentifiers.getAndroidAdvertiserId()); boolean flag1; if (!attributionidentifiers.isTrackingLimited()) { flag1 = true; } else { flag1 = false; } graphobject.setProperty("advertiser_tracking_enabled", Boolean.valueOf(flag1)); } graphobject.setProperty("anon_id", s); if (!flag) { flag = true; } else { flag = false; } graphobject.setProperty("application_tracking_enabled", Boolean.valueOf(flag)); } public static void setAppEventExtendedDeviceInfoParameters(GraphObject graphobject, Context context) { JSONArray jsonarray; String s; int i; int j; jsonarray = new JSONArray(); jsonarray.put("a1"); s = context.getPackageName(); j = -1; i = j; context = context.getPackageManager().getPackageInfo(s, 0); i = j; j = ((PackageInfo) (context)).versionCode; i = j; try { context = ((PackageInfo) (context)).versionName; } // Misplaced declaration of an exception variable catch (Context context) { context = ""; j = i; } jsonarray.put(s); jsonarray.put(j); jsonarray.put(context); graphobject.setProperty("extinfo", jsonarray.toString()); return; } static String sha1hash(String s) { return hashWithAlgorithm("SHA-1", s); } static String sha1hash(byte abyte0[]) { return hashWithAlgorithm("SHA-1", abyte0); } public static boolean stringsEqualOrEmpty(String s, String s1) { boolean flag = TextUtils.isEmpty(s); boolean flag1 = TextUtils.isEmpty(s1); if (flag && flag1) { return true; } if (!flag && !flag1) { return s.equals(s1); } else { return false; } } public static JSONArray tryGetJSONArrayFromResponse(GraphObject graphobject, String s) { if (graphobject == null) { return null; } graphobject = ((GraphObject) (graphobject.getProperty(s))); if (!(graphobject instanceof JSONArray)) { return null; } else { return (JSONArray)graphobject; } } public static JSONObject tryGetJSONObjectFromResponse(GraphObject graphobject, String s) { if (graphobject == null) { return null; } graphobject = ((GraphObject) (graphobject.getProperty(s))); if (!(graphobject instanceof JSONObject)) { return null; } else { return (JSONObject)graphobject; } } public static transient Collection unmodifiableCollection(Object aobj[]) { return Collections.unmodifiableCollection(Arrays.asList(aobj)); } /* static AsyncTask access$202(AsyncTask asynctask) { initialAppSettingsLoadTask = asynctask; return asynctask; } */ private class _cls1 extends AsyncTask { final String val$applicationId; final Context val$context; final String val$settingsKey; protected final transient GraphObject doInBackground(Void avoid[]) { return Utility.getAppSettingsQueryResponse(applicationId); } protected final volatile Object doInBackground(Object aobj[]) { return doInBackground((Void[])aobj); } protected final void onPostExecute(GraphObject graphobject) { if (graphobject != null) { graphobject = graphobject.getInnerJSONObject(); Utility.parseAppSettingsFromJSON(applicationId, graphobject); context.getSharedPreferences("com.facebook.internal.preferences.APP_SETTINGS", 0).edit().putString(settingsKey, graphobject.toString()).apply(); } Utility.initialAppSettingsLoadTask = null; } protected final volatile void onPostExecute(Object obj) { onPostExecute((GraphObject)obj); } _cls1() { applicationId = s; context = context1; settingsKey = s1; super(); } } }
[ "maartenpeels1012@hotmail.com" ]
maartenpeels1012@hotmail.com
dc47501b35cc7d0ed04a42dc3511432b73ee1c8d
0b76017e5aa3b017e3cfb5c02095131400009589
/application.windows64/source/oscConsole.java
01b6268b19a685199bcf655cd77c6586ce6403bd
[ "MIT" ]
permissive
Akiva42/oscConsole
6018ce17906c67591591a3f5d745cb3a90801caf
59c26d49533e4252eb0c23a744961e15d890e864
refs/heads/master
2021-01-01T05:21:54.376444
2016-05-12T04:35:37
2016-05-12T04:35:37
56,734,334
0
0
null
null
null
null
UTF-8
Java
false
false
3,002
java
import processing.core.*; import processing.data.*; import processing.event.*; import processing.opengl.*; import interfascia.*; import at.mukprojects.console.*; import oscP5.*; import netP5.*; import java.net.InetAddress; import java.util.HashMap; import java.util.ArrayList; import java.io.File; import java.io.BufferedReader; import java.io.PrintWriter; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; public class oscConsole extends PApplet { OscP5 oscP5; NetAddress myRemoteLocation; Console console; GUIController c; IFTextField t; IFLabel l; IFLabel portLabel; IFLabel ipLabel; InetAddress inet; public void setup() { frameRate(25); /* myRemoteLocation is a NetAddress. a NetAddress takes 2 parameters, * an ip address and a port number. myRemoteLocation is used as parameter in * oscP5.send() when sending osc packets to another computer, device, * application. usage see below. for testing purposes the listening port * and the port of the remote location address are the same, hence you will * send messages back to this sketch. */ myRemoteLocation = new NetAddress("127.0.0.1", 12000); console = new Console(this); console.start(); c = new GUIController(this); t = new IFTextField("Text Field", 25, 30, 150); l = new IFLabel("", 25, 70); ipLabel = new IFLabel("this machine's ip: ", 190, 10); portLabel = new IFLabel("Listen on Port #", 25, 10); c.add(t); c.add(l); c.add(portLabel); c.add(ipLabel); t.addActionListener(this); String myIP; try { inet = InetAddress.getLocalHost(); myIP = inet.getHostAddress(); } catch (Exception e) { e.printStackTrace(); myIP = "couldnt get IP"; } ipLabel.setLabel("this machine's ip: " + myIP); } public void draw() { background(200); console.draw(0, 100, width, height); console.print(); } /* incoming osc message are forwarded to the oscEvent method. */ public void oscEvent(OscMessage theOscMessage) { /* print the address pattern and the typetag of the received OscMessage */ //println("### received an osc message."); println(theOscMessage.addrPattern()); //println(" typetag: "+theOscMessage.typetag()); for (int i = 0; i < theOscMessage.arguments().length; i++) { println(theOscMessage.arguments()[i]); } println("-----------"); } public void actionPerformed(GUIEvent e) { if (e.getMessage().equals("Completed")) { l.setLabel(t.getValue()); changePort(); } } public void changePort() { /* start oscP5, listening for incoming messages at port 12000 */ if (PApplet.parseInt(l.getLabel()) != 0) { oscP5 = new OscP5(this, PApplet.parseInt(l.getLabel())); } } public void settings() { size(400, 600); } static public void main(String[] passedArgs) { String[] appletArgs = new String[] { "oscConsole" }; if (passedArgs != null) { PApplet.main(concat(appletArgs, passedArgs)); } else { PApplet.main(appletArgs); } } }
[ "akiva@cmu.edu" ]
akiva@cmu.edu
8aef45e439600020e9354f1563df3a44b642bdfb
734b080a9d3cb70b98827b0ca45c55496093e951
/src/com/baumgartner/base/view/bean/LoginBean.java
a09de6952417a0204c165cff4e8539c702015ed0
[]
no_license
cesarviana/LoginCriptografia
48388ad0440452d61ae3a9188332a4e1739d5696
7cda83d8766982aaac116a5ec09986ed261d217c
refs/heads/master
2020-05-19T20:56:05.395590
2013-12-04T11:50:49
2013-12-04T11:50:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
763
java
package com.baumgartner.base.view.bean; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import com.baumgartner.base.util.JSFUtil; @ManagedBean @RequestScoped public class LoginBean { private String login; public LoginBean() { login = JSFUtil.getHttpServletRequest().getRemoteUser(); } public boolean isAdmin(){ return JSFUtil.getHttpServletRequest().isUserInRole("admin"); } public void sair() { ExternalContext ec = FacesContext.getCurrentInstance() .getExternalContext(); ec.invalidateSession(); JSFUtil.redireciona("/default/index.xhtml"); } // getters and setters public String getLogin() { return login; } }
[ "cesar.pviana@gmail.com" ]
cesar.pviana@gmail.com
055ea0f032aa21cce802440ed7d00c9150488daa
f74e390ce97359cdcf7f527038f2d2c56b3f5412
/web/src/main/java/group/bridge/web/service/RoleService.java
bc5c10b3e7948f74acf7e8a4986c742c3db6e0e8
[]
no_license
Training-04/bridgeCheck
223989311d49f190f4a907da815e8c019c0a6bf1
b6f27f177169e44b1b3559393bd9322081b02f34
refs/heads/master
2020-04-14T20:08:27.684923
2019-03-06T02:58:23
2019-03-06T02:58:23
164,083,469
2
1
null
null
null
null
UTF-8
Java
false
false
389
java
package group.bridge.web.service; import group.bridge.web.entity.Permission; import group.bridge.web.entity.Role; import java.util.List; import java.util.Set; public interface RoleService extends BaseService<Role,Integer> { Role updateRole(Role role); Role getRoleByID(Integer role_id); List<Role> findRoleByName(String role_name); // List<Role>findRolenameByUserId(); }
[ "850003188@qq.com" ]
850003188@qq.com
9ebaa11c2531cc1e6b7ac3cf3e608716131c5d7b
a045206a5a283fa16fa1777a98a2da44146960d6
/Battleship/src/main/java/ch/bfh/bti7301/w2013/battleship/gui/ShipView.java
7ea3d615c63681d4669e5581ae8a7c072328ae8b
[ "Unlicense" ]
permissive
simonkrenger/ch.bfh.bti7301.w2013.battleship
5ceb39be0cf679c2af1aabae0827856dd09f7f79
f3805bfe4a95747f13cdf81e81048ea11fe58319
refs/heads/master
2016-09-05T21:33:02.084793
2014-01-17T13:51:33
2014-01-17T13:51:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,422
java
package ch.bfh.bti7301.w2013.battleship.gui; import static ch.bfh.bti7301.w2013.battleship.gui.BoardView.SIZE; import java.io.InputStream; import javafx.scene.Parent; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.Rectangle; import javafx.scene.shape.Shape; import javafx.scene.transform.Rotate; import javafx.scene.transform.Scale; import javafx.scene.transform.Translate; import ch.bfh.bti7301.w2013.battleship.game.Board.Direction; import ch.bfh.bti7301.w2013.battleship.game.Ship; public class ShipView extends Parent { private static final double HALF_SIZE = SIZE / 2; private static final double QUART_SIZE = SIZE / 4; private Ship ship; private Rotate rotation; public ShipView(Ship ship) { this.ship = ship; rotation = new Rotate(); InputStream is = getClass().getClassLoader().getResourceAsStream( ship.getClass().getSimpleName() + ".png"); if (is == null) { Circle c1 = new Circle(HALF_SIZE); set(c1); getChildren().add(c1); Rectangle r = new Rectangle(SIZE, SIZE * (ship.getSize() - 1)); r.setTranslateX(-HALF_SIZE); set(r); getChildren().add(r); Circle c2 = new Circle(HALF_SIZE); c2.setTranslateY(SIZE * (ship.getSize() - 1)); set(c2); getChildren().add(c2); getTransforms().add(rotation); } else { Image img = new Image(is); ImageView iv = new ImageView(img); double scale = SIZE / img.getHeight(); iv.getTransforms().add(new Scale(scale, scale)); double correction = QUART_SIZE / scale; iv.getTransforms().add(new Translate(correction, -correction)); iv.getTransforms().add(new Rotate(90)); iv.getTransforms().add(new Translate(-correction, -correction)); getChildren().add(iv); getTransforms().add(rotation); } rotateShip(ship.getDirection()); } private Shape set(Shape node) { node.setFill(Color.DARKGRAY); return node; } public void update() { rotateShip(ship.getDirection()); } private void rotateShip(Direction direction) { switch (direction) { case NORTH: rotation.setAngle(180); break; case EAST: rotation.setAngle(-90); break; case WEST: rotation.setAngle(90); break; case SOUTH: rotation.setAngle(0); break; } } public Ship getShip() { return ship; } public Class<? extends Ship> getShipType() { return ship.getClass(); } }
[ "chrigu.meyer@gmail.com" ]
chrigu.meyer@gmail.com
fa02c61f0e303bc4c1d6f36bd0a2852fd892469f
ad106803ae6b0795f8a4d7e6760db034a1eb30ae
/redis-cluster/src/main/java/com/victor/cache/aop/RedisCacheAspect.java
2a6c8cdf6123d99db583d579c9d89beef52f2d88
[]
no_license
smileszx/distribute-locks
59009df2dc455b2ad2a15a9650a401a813a2b4f8
5fe0ba8a2d16ea9cc2f437d183ef8df96576b266
refs/heads/master
2022-07-03T11:05:44.669426
2019-10-06T14:39:56
2019-10-06T14:39:56
210,149,786
0
0
null
2022-06-21T01:56:55
2019-09-22T13:12:58
Java
UTF-8
Java
false
false
3,311
java
package com.victor.cache.aop; import com.alibaba.fastjson.JSON; import java.lang.reflect.Method; import com.victor.cache.annotation.RedisCache; import com.victor.cache.redis.JedisService; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; /** * 面向切面编程 * 暂时注释,2019-09-29 */ //@Aspect //@Component public class RedisCacheAspect { private static final Logger LOGGER = LoggerFactory.getLogger(RedisCacheAspect.class); @Autowired private JedisService jedisService; /** * 切点 */ @Pointcut("execution(public * com.victor.cache.service..*.find*(..))") public void webAspect(){} @Around("webAspect()") public Object redisCache(ProceedingJoinPoint pjp) throws Throwable { //得到类名、方法名和参数 String redisResult = ""; String className = pjp.getTarget().getClass().getName(); String methodName = pjp.getSignature().getName(); Object[] args = pjp.getArgs(); //根据类名,方法名和参数生成key // String key = genKey(className,methodName,args); String key = String.join(":", "redis-cluster", args.toString()); LOGGER.info("生成的key[{}]",key); //得到被代理的方法 Signature signature = pjp.getSignature(); if(!(signature instanceof MethodSignature)){ throw new IllegalArgumentException(); } MethodSignature methodSignature = (MethodSignature) signature; Method method = pjp.getTarget().getClass().getMethod(methodSignature.getName(),methodSignature.getParameterTypes()); //得到被代理的方法上的注解 Class modelType = method.getAnnotation(RedisCache.class).type(); int cacheTime = method.getAnnotation(RedisCache.class).cacheTime(); Object result = null; if(!jedisService.exists(key)) { LOGGER.info("缓存未命中"); //缓存不存在,则调用原方法,并将结果放入缓存中 result = pjp.proceed(args); redisResult = JSON.toJSONString(result); jedisService.set(key,redisResult,cacheTime); } else{ //缓存命中 LOGGER.info("缓存命中"); redisResult = jedisService.get(key); //得到被代理方法的返回值类型 Class returnType = method.getReturnType(); result = JSON.parseObject(redisResult,returnType); } return result; } /** * @Description: 生成key */ private String genKey(String className, String methodName, Object[] args) { StringBuilder sb = new StringBuilder("SpringBoot:"); sb.append(className); sb.append("_"); sb.append(methodName); sb.append("_"); for (Object object: args) { LOGGER.info("obj:"+object); if(object!=null) { sb.append(object+""); sb.append("_"); } } return sb.toString(); } }
[ "smile.szx@outlook.com" ]
smile.szx@outlook.com
458a558efcef8b395db4777f2184a3d32e34fc07
d090eb0509055b0a4c5f49bd77254163be7e406e
/src/com/robodex/data/DummyData.java
e25a4e23541fa1f5ed674e2aa2bf367947bfd94e
[]
no_license
sh4z4m/robodex
ee37c3ae5a3ed480fa454976ba1921969cac9b82
989bc85c96e4625269004ed30268e323f976c5c0
refs/heads/master
2021-01-23T20:55:06.249631
2012-11-19T00:27:53
2012-11-19T00:27:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,266
java
package com.robodex.data; public final class DummyData { public static final String[] SPECIALTIES = { "Specialty0","Specialty1","Specialty2","Specialty3","Specialty4","Specialty5","Specialty6","Specialty7","Specialty8","Specialty9", "Specialty10","Specialty11","Specialty12","Specialty13","Specialty14","Specialty15","Specialty16","Specialty17","Specialty18","Specialty19", "Specialty20","Specialty21","Specialty22","Specialty23","Specialty24","Specialty25","Specialty26","Specialty27","Specialty28","Specialty29", "Specialty30","Specialty31","Specialty32","Specialty33","Specialty34","Specialty35","Specialty36","Specialty37","Specialty38","Specialty39", "Specialty40","Specialty41","Specialty42","Specialty43","Specialty44","Specialty45","Specialty46","Specialty47","Specialty48","Specialty49", "Specialty50","Specialty51","Specialty52","Specialty53","Specialty54","Specialty55","Specialty56","Specialty57","Specialty58","Specialty59", "Specialty60","Specialty61","Specialty62","Specialty63","Specialty64","Specialty65","Specialty66","Specialty67","Specialty68","Specialty69", "Specialty70","Specialty71","Specialty72","Specialty73","Specialty74","Specialty75","Specialty76","Specialty77","Specialty78","Specialty79", "Specialty80","Specialty81","Specialty82","Specialty83","Specialty84","Specialty85","Specialty86","Specialty87","Specialty88","Specialty89", "Specialty90","Specialty91","Specialty92","Specialty93","Specialty94","Specialty95","Specialty96","Specialty97","Specialty98","Specialty99" }; public static final String[] AGENCIES = { "Agency0","Agency1","Agency2","Agency3","Agency4","Agency5","Agency6","Agency7","Agency8","Agency9", "Agency10","Agency11","Agency12","Agency13","Agency14","Agency15","Agency16","Agency17","Agency18","Agency19", "Agency20","Agency21","Agency22","Agency23","Agency24","Agency25","Agency26","Agency27","Agency28","Agency29", "Agency30","Agency31","Agency32","Agency33","Agency34","Agency35","Agency36","Agency37","Agency38","Agency39", "Agency40","Agency41","Agency42","Agency43","Agency44","Agency45","Agency46","Agency47","Agency48","Agency49", "Agency50","Agency51","Agency52","Agency53","Agency54","Agency55","Agency56","Agency57","Agency58","Agency59", "Agency60","Agency61","Agency62","Agency63","Agency64","Agency65","Agency66","Agency67","Agency68","Agency69", "Agency70","Agency71","Agency72","Agency73","Agency74","Agency75","Agency76","Agency77","Agency78","Agency79", "Agency80","Agency81","Agency82","Agency83","Agency84","Agency85","Agency86","Agency87","Agency88","Agency89", "Agency90","Agency91","Agency92","Agency93","Agency94","Agency95","Agency96","Agency97","Agency98","Agency99" }; public static final String[] PEOPLE = { "Person0","Person1","Person2","Person3","Person4","Person5","Person6","Person7","Person8","Person9", "Person10","Person11","Person12","Person13","Person14","Person15","Person16","Person17","Person18","Person19", "Person20","Person21","Person22","Person23","Person24","Person25","Person26","Person27","Person28","Person29", "Person30","Person31","Person32","Person33","Person34","Person35","Person36","Person37","Person38","Person39", "Person40","Person41","Person42","Person43","Person44","Person45","Person46","Person47","Person48","Person49", "Person50","Person51","Person52","Person53","Person54","Person55","Person56","Person57","Person58","Person59", "Person60","Person61","Person62","Person63","Person64","Person65","Person66","Person67","Person68","Person69", "Person70","Person71","Person72","Person73","Person74","Person75","Person76","Person77","Person78","Person79", "Person80","Person81","Person82","Person83","Person84","Person85","Person86","Person87","Person88","Person89", "Person90","Person91","Person92","Person93","Person94","Person95","Person96","Person97","Person98","Person99" }; public static final DummyLocation[] LOCATIONS = { new DummyLocation("2801 West Bancroft Street", "Toledo", "OH", "43606", 41.6638073, -83.6073732), new DummyLocation("3225 Secor Rd", "Toledo", "OH", "43606", 41.6794659, -83.6227409), new DummyLocation("600 Dixie Highway", "Rossford", "OH", "43460", 41.6106679, -83.5582209), new DummyLocation("1202 North Reynolds Road", "Toledo", "OH", "43615", 41.6512643, -83.6644067), new DummyLocation("5560 West Central Avenue", "Toledo", "OH", "43615", 41.6768009, -83.6756907), new DummyLocation("11013 Airport Highway", "Swanton", "OH", "43558", 41.5960972, -83.8052275), new DummyLocation("601 David Street", "Bettsville", "OH", "44815", 41.2445203, -83.2354073), new DummyLocation("7015 Lighthouse Way #100", "Perrysburg", "OH", "43551", 41.5160886, -83.6401922), new DummyLocation("846 South Wheeling Street", "Oregon", "OH", "43616", 41.6354001, -83.4866352), new DummyLocation("2605 Broadway Street", "Toledo", "OH", "43609", 41.6189139, -83.5766790), new DummyLocation("105 S 3rd St # A", "Waterville", "OH", "43566", 41.4971785, -83.7197859), new DummyLocation("7950 Ohio 109", "Delta", "OH", "43515", 41.5873529, -84.0375883), new DummyLocation("8116 Secor Road", "Lambertville", "MI", "48144", 41.7620128, -83.6260933), new DummyLocation("10670 County Road J", "Malinta", "OH", "43535", 41.2978610, -84.0693730), new DummyLocation("1406 North Main Street", "Findlay", "OH", "45840", 41.0584930, -83.6505760), new DummyLocation("609 East Cornelia Street", "Hicksville", "OH", "43526", 41.3001270, -84.7578610), new DummyLocation("20907 Ohio 613", "Oakwood", "OH", "45873", 41.0926386, -84.4207938), new DummyLocation("201 South Ohio Avenue", "Sidney", "OH", "45365", 40.2842905, -84.1569333), new DummyLocation("18 West Sandusky Street", "Mechanicsburg","OH", "43044", 40.0716630, -83.5567900), new DummyLocation("380 Richland Avenue", "Athens", "OH", "45701", 39.3149540, -82.1043140) }; // Top level links public static final DummyLink[] LINKS = { new DummyLink("http://businesshours.net/oatia/", "Dev Team Site"), new DummyLink("http://google.com?q=user", "User link"), new DummyLink("http://google.com?q=trusted_user", "Trusted User link"), new DummyLink("http://google.com?q=moderator", "Moderator link"), new DummyLink("http://google.com?q=admin", "Admin link"), new DummyLink("http://google.com?q=head_admin", "Head Admin link") }; public static final class DummyLocation { public final String ADDRESS; public final String CITY; public final String STATE; public final String ZIP; public final double LATITUDE; public final double LONGITUDE; public DummyLocation(String address, String city, String state, String zip, double latitude, double longitude) { ADDRESS = address; CITY = city; STATE = state; ZIP = zip; LATITUDE = latitude; LONGITUDE = longitude; } @Override public String toString() { return ADDRESS +" "+ CITY +", "+ STATE +" "+ ZIP +" ("+ LATITUDE +", "+ LONGITUDE + ")"; } } public static final class DummyLink { public final String URI; public final String LABEL; public DummyLink(String uri, String label) { URI = uri; LABEL = label; } @Override public String toString() { return LABEL +" ("+ URI +")"; } } }
[ "jphilli85@gmail.com" ]
jphilli85@gmail.com
2be9128ab997b13272825f5ad09a779ae9d3b977
2eac2e7fea4b87e4a4ed269d224edecd7d0a42e1
/common/src/main/java/com/cyanspring/common/marketsession/AvailableTimeBean.java
e14b98e4103d4861953b653440d457fa2bdaedf2
[]
no_license
MarvelFisher/midas
0c0b2f0f8e75a1bf6c9e998b5a48aca5b447b630
c3fa256d491abc54cdc83949efa82d475c24e55b
refs/heads/master
2021-01-19T10:34:50.539982
2017-02-17T15:16:44
2017-02-17T15:16:44
82,187,760
0
1
null
null
null
null
UTF-8
Java
false
false
3,062
java
package com.cyanspring.common.marketsession; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import org.springframework.util.StringUtils; import com.cyanspring.common.marketsession.MarketSessionType; import com.cyanspring.common.util.TimeUtil; public class AvailableTimeBean { private MarketSessionType marketSession; private String startTime; private String endTime; private boolean isSessionBefore; private boolean isSessionStart; private int howManyMinutes; private SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss"); public boolean isTimeInterval(){ if(StringUtils.hasText(startTime) || StringUtils.hasText(endTime)) return true; return false; } public AvailableTimeBean() { } public MarketSessionType getMarketSession() { return marketSession; } public void setMarketSession(MarketSessionType marketSession) { this.marketSession = marketSession; } public String getStartTime() { return startTime; } public void setStartTime(String startTime) { this.startTime = startTime; } public String getEndTime() { return endTime; } public void setEndTime(String endTime) { this.endTime = endTime; } public SimpleDateFormat getTimeFormat() { return timeFormat; } public int getHowManyMinutes() { return howManyMinutes; } public void setHowManyMinutes(int howManyMinutes) { this.howManyMinutes = howManyMinutes; } public boolean isSessionBefore() { return isSessionBefore; } public void setSessionBefore(boolean isSessionBefore) { this.isSessionBefore = isSessionBefore; } public boolean isSessionStart() { return isSessionStart; } public void setSessionStart(boolean isSessionStart) { this.isSessionStart = isSessionStart; } public Date getMinutesAgo(Date startDate) { Calendar cal = Calendar.getInstance(); cal.setTime(startDate); cal.add(Calendar.MINUTE, -getHowManyMinutes()); return cal.getTime(); } public boolean checkAfter(String startTime) throws ParseException { Date start = TimeUtil.parseTime("HH:mm:ss", startTime); Date now = new Date(); if(TimeUtil.getTimePass(now, start)>=0){ return true; }else{ return false; } } public boolean checkBefore(String endTime) throws ParseException { Date end = TimeUtil.parseTime("HH:mm:ss", endTime); Date now = new Date(); if(TimeUtil.getTimePass(now, end)<=0){ return true; }else{ return false; } } public boolean checkInterval(Date now,Date start, Date end) throws ParseException { if(TimeUtil.getTimePass(now, start)>=0 && TimeUtil.getTimePass(now, end)<=0){ return true; }else{ return false; } } public boolean checkInterval(String startTime, String endTime) throws ParseException { Date start = TimeUtil.parseTime("HH:mm:ss", startTime); Date end = TimeUtil.parseTime("HH:mm:ss", endTime); Date now = new Date(); if(TimeUtil.getTimePass(now, start)>=0 && TimeUtil.getTimePass(now, end)<=0){ return true; }else{ return false; } } }
[ "jimmy" ]
jimmy
5288f641fffa6a2b6593b25d12746c339eeda766
dd26c7d6090575d57b8200c52698498ce2892bf5
/source/portfoliomanager/src/main/java/com/manthalabs/portfoliomanager/config/apidoc/SwaggerConfiguration.java
9e872ed64ddb02fd52db9eee1db41a3e2b28aa37
[]
no_license
smantha4/SampleCloudAdapter
0618b8fa44eb4fbd66a79b7450902fca581a1dc3
af25fd0bfbeb81536df1607f16489abd33c145d9
refs/heads/master
2020-04-11T16:54:00.345713
2017-02-05T05:19:12
2017-02-05T05:19:12
68,245,913
0
0
null
null
null
null
UTF-8
Java
false
false
3,282
java
package com.manthalabs.portfoliomanager.config.apidoc; import com.manthalabs.portfoliomanager.config.Constants; import com.manthalabs.portfoliomanager.config.JHipsterProperties; import java.util.Date; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.*; import org.springframework.data.domain.Pageable; import org.springframework.http.ResponseEntity; import org.springframework.util.StopWatch; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; import static springfox.documentation.builders.PathSelectors.regex; /** * Springfox Swagger configuration. * * Warning! When having a lot of REST endpoints, Springfox can become a performance issue. In that * case, you can use a specific Spring profile for this class, so that only front-end developers * have access to the Swagger view. */ @Configuration @EnableSwagger2 @Profile("!" + Constants.SPRING_PROFILE_NO_SWAGGER) @ConditionalOnProperty(prefix="jhipster.swagger", name="enabled") public class SwaggerConfiguration { private final Logger log = LoggerFactory.getLogger(SwaggerConfiguration.class); public static final String DEFAULT_INCLUDE_PATTERN = "/api/.*"; /** * Swagger Springfox configuration. * * @param jHipsterProperties the properties of the application * @return the Swagger Springfox configuration */ @Bean public Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) { log.debug("Starting Swagger"); StopWatch watch = new StopWatch(); watch.start(); Contact contact = new Contact( jHipsterProperties.getSwagger().getContactName(), jHipsterProperties.getSwagger().getContactUrl(), jHipsterProperties.getSwagger().getContactEmail()); ApiInfo apiInfo = new ApiInfo( jHipsterProperties.getSwagger().getTitle(), jHipsterProperties.getSwagger().getDescription(), jHipsterProperties.getSwagger().getVersion(), jHipsterProperties.getSwagger().getTermsOfServiceUrl(), contact, jHipsterProperties.getSwagger().getLicense(), jHipsterProperties.getSwagger().getLicenseUrl()); Docket docket = new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo) .forCodeGeneration(true) .genericModelSubstitutes(ResponseEntity.class) .ignoredParameterTypes(Pageable.class) .ignoredParameterTypes(java.sql.Date.class) .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) .directModelSubstitute(java.time.ZonedDateTime.class, Date.class) .directModelSubstitute(java.time.LocalDateTime.class, Date.class) .select() .paths(regex(DEFAULT_INCLUDE_PATTERN)) .build(); watch.stop(); log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis()); return docket; } }
[ "smantha4@csc.com" ]
smantha4@csc.com
b56311491a8142de11487165755788574afa48b6
8dfc2eb9eb0e433da4e5ff66988ac5490cbb23fd
/EVAM04_EMISIONVOTO_API/src/main/java/edu/cibertec/votoelectronico/resource/VotoElectronicoResourceAsync.java
7d2a5d045e0ea4415f0fbea02342331620f3e55f
[ "MIT" ]
permissive
pSharpX/SimpleEmisionVotosAPI
472d1fc6e9dd67cb31f10bfa8330c557b7f9e754
50f899477185cda75845adfe33cf210596096450
refs/heads/master
2022-08-19T23:48:26.622256
2020-04-12T20:51:20
2020-04-12T20:51:20
251,381,579
0
0
MIT
2022-07-07T22:12:55
2020-03-30T17:39:50
Java
UTF-8
Java
false
false
1,052
java
package edu.cibertec.votoelectronico.resource; import java.util.concurrent.CompletionStage; import javax.validation.ConstraintViolationException; import javax.validation.Valid; import javax.validation.constraints.NotNull; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.container.AsyncResponse; import javax.ws.rs.container.Suspended; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import edu.cibertec.votoelectronico.dto.EmisionVotoDto; @Path("/votoelectronico/async") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) public interface VotoElectronicoResourceAsync { public Response emitirVoto(EmisionVotoDto resource) throws ConstraintViolationException; @POST @Path("/emitir1") public CompletionStage<Response> emitirVotoAsync(@Valid @NotNull EmisionVotoDto resource); @POST @Path("/emitir2") public void emitirVotoAsync(@Valid @NotNull EmisionVotoDto resource, @Suspended AsyncResponse response); }
[ "guardian2093@gmail.com" ]
guardian2093@gmail.com
cb93ef6d6d7e7c0a3049b9e23d626a5974044b10
dc54625277165170e16a34f83d7b9ef40cbd0825
/app/src/main/java/de/squiray/dailylist/util/logging/SizeMeasuringOutputStream.java
25d6b3a232a7011781bbbc8afd27c7f34ab5182c
[]
no_license
marcjulian/dailylist
5e5c2c93bbc941f6542269d60729354ecc1d29f6
e8e3a523299f39f4990bddc3d86c0592b30f011d
refs/heads/master
2021-09-02T10:21:33.986808
2018-01-01T20:37:24
2018-01-01T20:37:24
107,770,194
1
0
null
null
null
null
UTF-8
Java
false
false
910
java
package de.squiray.dailylist.util.logging; import android.support.annotation.NonNull; import java.io.IOException; import java.io.OutputStream; class SizeMeasuringOutputStream extends OutputStream { private volatile long size = 0L; private final OutputStream delegate; public SizeMeasuringOutputStream(OutputStream delegate) { this.delegate = delegate; } public long size() { return size; } @Override public void write(int b) throws IOException { delegate.write(b); size++; } @Override public void write(@NonNull byte[] b) throws IOException { delegate.write(b); size += b.length; } @Override public void write(@NonNull byte[] b, int off, int len) throws IOException { delegate.write(b, off, len); size += len; } @Override public void flush() throws IOException { delegate.flush(); } @Override public void close() throws IOException { delegate.close(); } }
[ "marcstammerjohann@web.de" ]
marcstammerjohann@web.de
9027cadef84045daca0accee451da08f0b7494ce
8e810b54666e967e6c22988b3825f4fca9e0c82c
/bos_management/src/main/java/cn/itcast/bos/service/impl/WayBillSeviceImpl.java
6a888476d0359cfa4d070b6fdff259fca0707a5a
[]
no_license
ZDanielx/bos_exercis
f26a347d980e42ffb0fd294e7e0ee42515f8dbd5
88a537ac43d493e9da4ca8919e118f3043401472
refs/heads/master
2021-05-11T19:58:32.511174
2018-01-21T10:04:58
2018-01-21T10:04:58
117,429,559
0
0
null
null
null
null
UTF-8
Java
false
false
5,901
java
package cn.itcast.bos.service.impl; import cn.itcast.bos.dao.base.WayBillRepsitory; import cn.itcast.bos.domain.take_delivery.WayBill; import cn.itcast.bos.index.WayBillIndexRepository; import cn.itcast.bos.service.base.WayBillService; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.lang3.StringUtils; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryStringQueryBuilder; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.index.query.WildcardQueryBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.elasticsearch.core.query.NativeSearchQuery; import org.springframework.data.elasticsearch.core.query.SearchQuery; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; /** * Created by Ricky on 2018/1/11 */ @Service @Transactional public class WayBillSeviceImpl implements WayBillService { @Autowired private WayBillRepsitory wayBillRepsitory; @Autowired private WayBillIndexRepository wayBillIndexRepository; @Override public void save(WayBill model) { WayBill wayBill = wayBillRepsitory.findByWayBillNum(model.getWayBillNum()); if (wayBill == null || wayBill.getId() == null) { //运单号不存在,走添加 wayBillRepsitory.save(model); //保存索引 wayBillIndexRepository.save(model); } else { //运单号存在,走修改 try { Integer id = wayBill.getId(); BeanUtils.copyProperties(wayBill, model); wayBill.setId(id); wayBillIndexRepository.save(wayBill); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } } } @Override public Page<WayBill> pageQuery(WayBill wayBill, Pageable pageable) { //判断waybill中的条件是否存在' if (StringUtils.isBlank(wayBill.getWayBillNum()) && StringUtils.isBlank(wayBill.getSendAddress()) && StringUtils.isBlank(wayBill.getRecAddress()) && StringUtils.isBlank(wayBill.getSendProNum()) && (wayBill.getSignStatus() == null || wayBill.getSignStatus() == 0)) { //无条件查询,直接查询数据库 return wayBillRepsitory.findAll(pageable); } else { //有条件查询 //must 条件必须成立 and //should条件可以成立or BoolQueryBuilder query = new BoolQueryBuilder(); //布尔查询,多条件组合查询 //向组合对象添加条件 if (StringUtils.isNotBlank(wayBill.getWayBillNum())) { //运单号查询 TermQueryBuilder wayBillNum = new TermQueryBuilder("wayBillNum", wayBill.getWayBillNum()); query.must(wayBillNum); } if (StringUtils.isNotBlank(wayBill.getSendAddress())) { //发货地 模糊查询 //情况一:输入"北" 是查询词条的一部分,使用模糊匹配词条查询 WildcardQueryBuilder wildcardQueryBuilder = new WildcardQueryBuilder("sendAddress", "*" + wayBill.getSendAddress() + "*"); //情况二:输入"北京市海淀区"是多个词条组合,进行分词后每个词条匹配查询 QueryStringQueryBuilder queryStringQueryBuilder = new QueryStringQueryBuilder(wayBill.getSendAddress()).field("sendAddress").defaultOperator(QueryStringQueryBuilder.Operator.AND); //两种情况取or关系 BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder(); boolQueryBuilder.should(wildcardQueryBuilder); boolQueryBuilder.should(queryStringQueryBuilder); query.must(boolQueryBuilder); } if (StringUtils.isNoneBlank(wayBill.getRecAddress())) { //收货地模糊查询 WildcardQueryBuilder wildcardQueryBuilder = new WildcardQueryBuilder("recAddress", "*" + wayBill.getRecAddress() + "*"); //词条查询 QueryStringQueryBuilder queryStringQueryBuilder = new QueryStringQueryBuilder(wayBill.getRecAddress()).field("recAddress").defaultOperator(QueryStringQueryBuilder.Operator.AND); //两种关系取or BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder(); boolQueryBuilder.should(wildcardQueryBuilder); boolQueryBuilder.should(queryStringQueryBuilder); query.must(boolQueryBuilder); } if (StringUtils.isNoneBlank(wayBill.getSendProNum())) { //速运类型等值查询 TermQueryBuilder sendProNum = new TermQueryBuilder("sendProNum", wayBill.getSendProNum()); query.must(sendProNum); } if (wayBill.getSignStatus() != null && wayBill.getSignStatus() != 0) { //签收状态等值查询 TermQueryBuilder signStatus = new TermQueryBuilder("signStatus", new WayBill().getSignStatus()); query.must(signStatus); } SearchQuery searchQuery = new NativeSearchQuery(query); searchQuery.setPageable(pageable); //实现分页效果 //有条件查询索引库 return wayBillIndexRepository.search(searchQuery); } } @Override public WayBill findByWayBillNum(String wayBillNum) { return wayBillRepsitory.findByWayBillNum(wayBillNum); } @Override public List<WayBill> findAll() { return wayBillRepsitory.findAll(); } }
[ "1842201872@qq.com" ]
1842201872@qq.com
a5669b2f36936014ee1fd0a9d88cee6610469cb3
5781d38136f767ec24caa0ad9906218fad108594
/grib/src/main/java/ucar/nc2/grib/grib2/Grib2Collection.java
7ce8051de6862c990aba187f5a1f2fee446fe13f
[]
no_license
geomatico/thredds
d0b3298e9d2f89b28d5de5f0a509a98aa2f27b2e
8aa40ed816adb40dd5ff12966ed2a9da2dd44e65
refs/heads/master
2021-01-17T13:48:08.277948
2012-01-25T21:30:31
2012-01-25T21:30:31
3,067,861
0
0
null
null
null
null
UTF-8
Java
false
false
6,386
java
/* * Copyright (c) 1998 - 2011. University Corporation for Atmospheric Research/Unidata * Portions of this software were developed by the Unidata Program at the * University Corporation for Atmospheric Research. * * Access and use of this software shall impose the following obligations * and understandings on the user. The user is granted the right, without * any fee or cost, to use, copy, modify, alter, enhance and distribute * this software, and any derivative works thereof, and its supporting * documentation for any purpose whatsoever, provided that this entire * notice appears in all copies of the software, derivative works and * supporting documentation. Further, UCAR requests that the user credit * UCAR/Unidata in any publications that result from the use of this * software or in any product that includes this software. The names UCAR * and/or Unidata, however, may not be used in any advertising or publicity * to endorse or promote any products or commercial entity unless specific * written permission is obtained from UCAR/Unidata. The user also * understands that UCAR/Unidata is not obligated to provide the user with * any support, consulting, training or assistance of any kind with regard * to the use, operation and performance of this software nor to provide * the user with any updates, revisions, new versions or "bug fixes." * * THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "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 UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. */ package ucar.nc2.grib.grib2; import thredds.inventory.CollectionManager; import thredds.inventory.DatasetCollectionMFiles; import ucar.nc2.NetcdfFile; import ucar.nc2.dataset.NetcdfDataset; import ucar.nc2.grib.GribCollection; import ucar.unidata.io.RandomAccessFile; import java.io.File; import java.io.IOException; import java.util.Formatter; /** * Grib2 specific part of GribCollection * * @author John * @since 9/5/11 */ public class Grib2Collection extends ucar.nc2.grib.GribCollection { public Grib2Collection(String name, File directory) { super(name, directory); } public ucar.nc2.dataset.NetcdfDataset getNetcdfDataset(String groupName, String filename) throws IOException { GroupHcs want = findGroup(groupName); if (want == null) return null; if (filename == null) { // LOOK thread-safety : sharing this, raf Grib2Iosp iosp = new Grib2Iosp(want); NetcdfFile ncfile = new MyNetcdfFile(iosp, null, getIndexFile().getPath(), null); return new NetcdfDataset(ncfile); } else { for (String file : filenames) { // LOOK linear lookup if (file.endsWith(filename)) { Formatter f = new Formatter(); GribCollection gc = Grib2CollectionBuilder.createFromSingleFile(new File(file), CollectionManager.Force.nocheck,f); // LOOK thread-safety : creating ncx Grib2Iosp iosp = new Grib2Iosp(gc); NetcdfFile ncfile = new MyNetcdfFile(iosp, null, getIndexFile().getPath(), null); return new NetcdfDataset(ncfile); } } return null; } } public ucar.nc2.dt.GridDataset getGridDataset(String groupName, String filename) throws IOException { GroupHcs want = findGroup(groupName); if (want == null) return null; if (filename == null) { // LOOK thread-safety : sharing this, raf Grib2Iosp iosp = new Grib2Iosp(want); NetcdfFile ncfile = new MyNetcdfFile(iosp, null, getIndexFile().getPath(), null); NetcdfDataset ncd = new NetcdfDataset(ncfile); return new ucar.nc2.dt.grid.GridDataset(ncd); // LOOK - replace with custom GridDataset?? } else { for (String file : filenames) { // LOOK linear lookup if (file.endsWith(filename)) { Formatter f = new Formatter(); GribCollection gc = Grib2CollectionBuilder.createFromSingleFile(new File(file), CollectionManager.Force.nocheck,f); // LOOK thread-safety : creating ncx Grib2Iosp iosp = new Grib2Iosp(gc); NetcdfFile ncfile = new MyNetcdfFile(iosp, null, getIndexFile().getPath(), null); NetcdfDataset ncd = new NetcdfDataset(ncfile); return new ucar.nc2.dt.grid.GridDataset(ncd); // LOOK - replace with custom GridDataset?? } } return null; } } /////////////////////////////////////////////////////////////////////////////// static public void make(String name, String spec) throws IOException { long start = System.currentTimeMillis(); Formatter f = new Formatter(); CollectionManager dcm = new DatasetCollectionMFiles(name, spec, f); File idxFile = new File( dcm.getRoot(), name); boolean ok = Grib2CollectionBuilder.writeIndexFile(idxFile, dcm, f); System.out.printf("GribCollectionBuilder.writeIndexFile ok = %s%n", ok); long took = System.currentTimeMillis() - start; System.out.printf("%s%n", f); System.out.printf("That took %d msecs%n", took); } public static void main(String[] args) throws IOException { for (int i=0; i<args.length; i++) { String arg = args[i]; if (arg.equalsIgnoreCase("-help")) { System.out.printf("usage: ucar.nc2.grib.GribCollection [-make name collSpec] [-read filename]%n"); break; } if (arg.equalsIgnoreCase("-make")) { make(args[i+1], args[i+2]); break; } else if (arg.equalsIgnoreCase("-read")) { File f = new File(args[i+1]); RandomAccessFile raf = new RandomAccessFile(f.getPath(), "r"); GribCollection gc = Grib2CollectionBuilder.createFromIndex(f.getName(), f.getParentFile(), raf); gc.showIndex(new Formatter(System.out)); break; } } // "G:/nomads/timeseries/200808/.*grb2$" // readIndex2("G:/nomads/timeseries/200808/GaussLatLon-576X1152.ncx"); } }
[ "caron@unidata.ucar.edu" ]
caron@unidata.ucar.edu
a65c05b128556ae72132e97c3b4a46773a42c39b
698a37b38cb074168b2b6d9999dda64e74b8f234
/src/main/java/app/Quartz/QuartzConfiguration.java
edcd9f0beab8e2473d03e2720904f90c43c6f606
[]
no_license
XDwuzhishan/MobileCampus
4c424ec57a20ffdd3eb407d56065de47b354613d
fc54d86076c5b77b43565d3c263688e8c309034e
refs/heads/master
2021-01-25T04:10:10.773883
2017-08-20T14:54:23
2017-08-20T14:54:23
93,403,575
0
0
null
null
null
null
UTF-8
Java
false
false
5,134
java
package app.Quartz; import app.Quartz.jobs.SpiderJobCourse; import app.Quartz.jobs.SpiderJobDynamicNews; import app.Quartz.jobs.SpiderJobLoginInfo; import app.Quartz.jobs.SpiderJobNotice; import org.quartz.CronTrigger; import org.quartz.JobDetail; import org.quartz.spi.JobFactory; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.quartz.CronTriggerFactoryBean; import org.springframework.scheduling.quartz.JobDetailFactoryBean; import org.springframework.scheduling.quartz.SchedulerFactoryBean; /** * Created by xdcao on 2017/7/25. */ @Configuration public class QuartzConfiguration { // TODO: 2017/7/30 登录后的信息爬虫存在问题,只能第一次生效 @Bean public JobFactory jobFactory(ApplicationContext applicationContext){ AutowiringSpringBeanJobFactory jobFactory=new AutowiringSpringBeanJobFactory(); jobFactory.setApplicationContext(applicationContext); return jobFactory; } //课程表爬虫任务 @Bean(name = "SpiderJobCourse") public JobDetailFactoryBean spiderJobCourseDetail(){ JobDetailFactoryBean factoryBean=new JobDetailFactoryBean(); factoryBean.setJobClass(SpiderJobCourse.class); factoryBean.setDurability(false); return factoryBean; } //课程表爬虫触发器 @Bean(name = "SpiderJobCourseTrigger") public CronTriggerFactoryBean spiderJobCourseTrigger(@Qualifier("SpiderJobCourse") JobDetail jobDetail){ CronTriggerFactoryBean factoryBean=new CronTriggerFactoryBean(); factoryBean.setJobDetail(jobDetail); factoryBean.setStartDelay(0L); factoryBean.setCronExpression("0 0 10 * * ?"); return factoryBean; } //登陆后的通知信息 @Bean(name = "SpiderJobLoginInfo") public JobDetailFactoryBean spiderJobLoginInfoDetail(){ JobDetailFactoryBean factoryBean=new JobDetailFactoryBean(); factoryBean.setJobClass(SpiderJobLoginInfo.class); factoryBean.setDurability(false); return factoryBean; } //登录后通知信息触发器 @Bean(name = "SpiderJobLoginInfoTrigger") public CronTriggerFactoryBean spiderJobLoginInfoTrigger(@Qualifier("SpiderJobLoginInfo") JobDetail jobDetail){ CronTriggerFactoryBean factoryBean=new CronTriggerFactoryBean(); factoryBean.setJobDetail(jobDetail); factoryBean.setStartDelay(0L); factoryBean.setCronExpression("0 01 10 * * ?"); return factoryBean; } //最新动态任务 @Bean(name = "SpiderJobDynamicNews") public JobDetailFactoryBean spiderJobDynamicNewsDetail(){ JobDetailFactoryBean factoryBean=new JobDetailFactoryBean(); factoryBean.setJobClass(SpiderJobDynamicNews.class); factoryBean.setDurability(false); return factoryBean; } //最新动态触发器 @Bean(name = "SpiderJobDynamicNewsTrigger") public CronTriggerFactoryBean spiderJobDynamicNewsTrigger(@Qualifier("SpiderJobDynamicNews") JobDetail jobDetail){ CronTriggerFactoryBean factoryBean=new CronTriggerFactoryBean(); factoryBean.setJobDetail(jobDetail); factoryBean.setStartDelay(0L); factoryBean.setCronExpression("0 02 10 * * ?"); return factoryBean; } //首页通知任务 @Bean(name = "SpiderJobNotice") public JobDetailFactoryBean spiderJobNoticeDetail(){ JobDetailFactoryBean factoryBean=new JobDetailFactoryBean(); factoryBean.setJobClass(SpiderJobNotice.class); factoryBean.setDurability(false); return factoryBean; } //首页通知触发器 @Bean(name = "SpiderJobNoticeTrigger") public CronTriggerFactoryBean spiderJobNoticeTrigger(@Qualifier("SpiderJobNotice") JobDetail jobDetail){ CronTriggerFactoryBean factoryBean=new CronTriggerFactoryBean(); factoryBean.setJobDetail(jobDetail); factoryBean.setStartDelay(0L); factoryBean.setCronExpression("0 03 10 * * ?"); return factoryBean; } @Bean public SchedulerFactoryBean schedulerFactoryBean(JobFactory jobFactory, @Qualifier("SpiderJobCourseTrigger")CronTrigger courseCronTrigger, @Qualifier("SpiderJobLoginInfoTrigger") CronTrigger loginInfoCronTrigger, @Qualifier("SpiderJobDynamicNewsTrigger") CronTrigger dynamicNewsTrigger, @Qualifier("SpiderJobNoticeTrigger") CronTrigger noticeTrigger){ SchedulerFactoryBean factoryBean=new SchedulerFactoryBean(); factoryBean.setOverwriteExistingJobs(true); factoryBean.setJobFactory(jobFactory); factoryBean.setStartupDelay(0); factoryBean.setTriggers(loginInfoCronTrigger,dynamicNewsTrigger,noticeTrigger); return factoryBean; } }
[ "705083979@qq.com" ]
705083979@qq.com
0d0bdc1285e09e48d20e95e34a0a57a6251ee511
daa605195ea94aada9bcdb25e2a86a1cb6bf59e6
/DsWorkJava/dswork.web/dswork/web/MyCookie.java
6a09380e8025059440790472b65ab8f598f0003b
[]
no_license
huqiji/dswork
f1ec95d774b06828156bfe1763a89e7946f1c37c
7618d0f7d5247cd74b13b0c6c11d92cf507622af
refs/heads/master
2021-01-01T19:36:07.258709
2017-07-28T03:56:43
2017-07-28T03:56:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,880
java
package dswork.web; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.jsp.PageContext; /** * 扩展Cookie */ public class MyCookie { private HttpServletResponse response; private HttpServletRequest request; /** * 初始化cookie * @param context PageContext */ public MyCookie(PageContext context) { this.response = (HttpServletResponse) context.getResponse(); this.request = (HttpServletRequest) context.getRequest(); } /** * 初始化cookie * @param request HttpServletRequest * @param response HttpServletResponse */ public MyCookie(HttpServletRequest request, HttpServletResponse response) { this.request = request; this.response = response; } /** * 往客户端写入Cookie,当页面关闭时删除cookie,当前应用所有页面有效 * @param name cookie参数名 * @param value cookie参数值 */ public void addCookie(String name, String value) { addCookie(name, value, -1, "/", null, false, false); } /** * 往客户端写入Cookie,当前应用所有页面有效 * @param name cookie参数名 * @param value cookie参数值 * @param maxAge 有效时间,int(单位秒),0:删除Cookie,-1:页面关闭时删除cookie */ public void addCookie(String name, String value, int maxAge) { addCookie(name, value, maxAge, "/", null, false, false); } /** * 往客户端写入Cookie * @param name cookie参数名 * @param value cookie参数值 * @param maxAge 有效时间,int(单位秒),0:删除Cookie,-1:页面关闭时删除cookie * @param path 与cookie一起传输的虚拟路径,即有效范围 */ public void addCookie(String name, String value, int maxAge, String path) { addCookie(name, value, maxAge, path, null, false, false); } /** * 往客户端写入Cookie * @param name cookie参数名 * @param value cookie参数值 * @param maxAge 有效时间,int(单位秒),0:删除Cookie,-1:页面关闭时删除cookie * @param path 与cookie一起传输的虚拟路径 * @param domain 与cookie关联的域 */ public void addCookie(String name, String value, int maxAge, String path, String domain) { addCookie(name, value, maxAge, path, domain, false, false); } /** * 往客户端写入Cookie * @param name cookie参数名 * @param value cookie参数值 * @param maxAge 有效时间,int(单位秒),0:删除Cookie,-1:页面关闭时删除cookie * @param path 与cookie一起传输的虚拟路径 * @param domain 与cookie关联的域 * @param isSecure 是否在https请求时才进行传输 * @param isHttpOnly 是否只能通过http访问 */ public void addCookie(String name, String value, int maxAge, String path, String domain, boolean isSecure, boolean isHttpOnly) { Cookie cookie = new Cookie(name, value); cookie.setMaxAge(maxAge); cookie.setPath(path); if(maxAge > 0 && domain != null) { cookie.setDomain(domain); } cookie.setSecure(isSecure); try { Cookie.class.getMethod("setHttpOnly", boolean.class); cookie.setHttpOnly(isHttpOnly); } catch(Exception e) { System.out.println("MyCookie ignore setHttpOnly Method"); } response.addCookie(cookie); } /** * 删除cookie * @param name cookie参数名 */ public void delCookie(String name) { // Cookie cookies[] = request.getCookies(); // if(cookies != null) // { // Cookie cookie = null; // for(int i = 0; i < cookies.length; i++) // { // cookie = cookies[i]; // if(cookie.getName().equals(name)) // { // addCookie(name, "", 0, cookie.getPath(), cookie.getDomain());// 按原cookie属性删除 // } // } // } addCookie(name, "", 0, "/", null); } /** * 根据cookie名称取得参数值 * @param name cookie参数名 * @return 存在返回String,不存在返回null */ public String getValue(String name) { Cookie cookies[] = request.getCookies(); String value = null; if(cookies != null) { Cookie cookie = null; for(int i = 0; i < cookies.length; i++) { cookie = cookies[i]; if(cookie.getName().equals(name)) { value = cookie.getValue(); break; } } } return value; } /** * 根据Cookie参数名判断Cookie是否存在该值 * @param name cookie参数名 * @return 存在返回true,不存在返回false */ public boolean isExist(String name) { Cookie cookies[] = request.getCookies(); if(cookies == null) { return false; } boolean isExist = false; for(int i = 0; i < cookies.length; i++) { if(cookies[i].getName().equals(name)) { isExist = true; break; } } return isExist; } }
[ "skeychen@7a9fa4a9-d657-4fba-ac9f-cc92ff6ae633" ]
skeychen@7a9fa4a9-d657-4fba-ac9f-cc92ff6ae633
8bbd0633553375693baa66e0aec3926b299b27c5
8932665e0ddc4601edea4e9a113bd7846191966d
/src/main/java/com/org/repositories/PaysRepository.java
d667dda66b0fd50236ead9e8f584c0dd23a7437b
[]
no_license
jaouadtelmoudy/cvtheque
1b7e90e2a575d34a7ed7a9d4881161a3076451d2
b20b1524d3395af5476db43f35c18c888fa75e41
refs/heads/master
2020-04-05T16:44:44.753119
2018-12-17T19:43:32
2018-12-17T19:43:32
157,026,758
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
package com.org.repositories; import org.springframework.data.jpa.repository.JpaRepository; import com.org.entities.Pays; public interface PaysRepository extends JpaRepository<Pays, Long> { }
[ "jaouadtelmoudy@gmail.com" ]
jaouadtelmoudy@gmail.com
31b03d00d6898971017a21e48147313c28750e01
d5a96ed0ac1bde7de88679783a8566fa6f60d45c
/src/YearsAlive.java
7ec3c3a1c2df9ae9f5b83f6a9c46cae430a2534f
[]
no_license
League-Level0-Student/level-0-module-3-honeybiscuit15
04c0fc5eb6897438b3eabfef4540187f8296b6db
67ae16da4ddd23cd2041b77f11605c682e41110f
refs/heads/master
2021-05-02T07:50:17.659766
2018-04-13T00:01:50
2018-04-13T00:01:50
120,839,741
0
0
null
null
null
null
UTF-8
Java
false
false
158
java
public class YearsAlive { public static void main(String[] args) { for (int i = 2002; i <= 2018; i++) { System.out.println(i); } } }
[ "leaguestudent@administrator-Inspiron-15-3552" ]
leaguestudent@administrator-Inspiron-15-3552
c61b246197e90eb832e51ea1fea3ecdbe052f254
bcb74ab5c4295ebddf307cfcef0599895cb3fc63
/errai-ioc/src/main/java/org/jboss/errai/ioc/rebind/ioc/codegen/builder/ContextualIfBlockBuilder.java
8aff3387e3218fa9fd178a98fd08c352458dbeb2
[]
no_license
lfryc/errai
f0add65a313ddb1126c1141d529df16af557152f
a5a74f73f76cc26cd9bc2b32e04d518a29895395
refs/heads/master
2021-01-15T20:03:51.515444
2011-07-29T20:08:52
2011-07-29T20:08:52
2,132,491
0
0
null
null
null
null
UTF-8
Java
false
false
1,151
java
/* * Copyright 2011 JBoss, a divison Red Hat, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.errai.ioc.rebind.ioc.codegen.builder; import org.jboss.errai.ioc.rebind.ioc.codegen.BooleanOperator; import org.jboss.errai.ioc.rebind.ioc.codegen.Statement; /** * @author Christian Sadilek <csadilek@redhat.com> */ public interface ContextualIfBlockBuilder extends Statement, Builder { BlockBuilder<ElseBlockBuilder> if_(); BlockBuilder<ElseBlockBuilder> if_(BooleanOperator op, Statement rhs); BlockBuilder<ElseBlockBuilder> if_(BooleanOperator op, Object rhs); BlockBuilder<ElseBlockBuilder> ifNot(); }
[ "csadilek@redhat.com" ]
csadilek@redhat.com
5209eec8cacbe4529ece1aa99528166e62ed4bc1
6162e782c7a6862b362e95cf98d87fdab38f35e9
/Lab/Lab 7/ListQueue.java
4d07691113f160e07fde152e717185781559e39b
[]
no_license
iamraufu/BRACUCSE220
dcd60663a8718c9de4bf36327f6b383b7b95240f
b61a092ff5803f2658a138993b0f78dd773779d3
refs/heads/main
2023-01-11T07:39:34.906852
2020-11-07T21:40:12
2020-11-07T21:40:12
310,937,016
5
0
null
null
null
null
UTF-8
Java
false
false
2,717
java
public class ListQueue implements Queue{ int size; Node front; Node rear; public ListQueue(){ size = 0; front = null; rear = null; } // The number of items in the queue public int size(){ return size; } // Returns true if the queue is empty public boolean isEmpty(){ if(size==0){ return true; } return false; } // Adds the new item on the back of the queue, throwing the // QueueOverflowException if the queue is at maximum capacity. It // does not throw an exception for an "unbounded" queue, which // dynamically adjusts capacity as needed. public void enqueue(Object o) throws QueueOverflowException{ if(size==0){ Node n=new Node(o,null); front=n; rear=n; size++; } else{ Node a=new Node(o,null); rear.next=a; rear=rear.next; size++; } } // Removes the item in the front of the queue, throwing the // QueueUnderflowException if the queue is empty. public Object dequeue() throws QueueUnderflowException{ Object temp=null; int c=0; if(size==0){ throw new QueueUnderflowException(); } else{ for(Node a=front;a!=null;a=a.next){ c++; if(c==size-1){ temp=a.next.val; a.next=null; size--; rear=a; } } } return temp; } // Peeks at the item in the front of the queue, throwing // QueueUnderflowException if the queue is empty. public Object peek() throws QueueUnderflowException{ if(size==0){ throw new QueueUnderflowException(); } return front.val; } // Returns a textual representation of items in the queue, in the // format "[ x y z ]", where x and z are items in the front and // back of the queue respectively. public String toString(){ String s="[ "; for(Node a=front;a!=null;a=a.next){ s=s+a.val+" "; } s=s+"]"; return s; } // Returns an array with items in the queue, with the item in the // front of the queue in the first slot, and back in the last slot. public Object[] toArray(){ Object arr[]=new Object[size]; int i=0; for(Node a=front;a!=null;a=a.next){ arr[i]=a.val; i++; } return arr; } // Searches for the given item in the queue, returning the // offset from the front of the queue if item is found, or -1 // otherwise. public int search(Object o){ int c=0; for(Node a=front;a!=null;a=a.next){ if(a.val==o){ return c; } } return -1; } }
[ "43452776+RaufuPrezens@users.noreply.github.com" ]
43452776+RaufuPrezens@users.noreply.github.com
26d6d1bc4036904c7f02be24e8a7b0373d2169b0
c4460dd1bfd08ba84d6668219d847c31c456f817
/app/src/main/java/com/albertmiro/albums4u/api/ITunesService.java
62a58c8dcedf44b98053b745fd53712d4c66c242
[]
no_license
albertmiro/Album4U
96568fead3d3c99bf8d2bb7aa8cdc28fc868dfe5
00441b08915d8a4a368224f2e8a494a1e633edaa
refs/heads/master
2020-03-17T14:34:03.493530
2019-10-07T15:04:08
2019-10-07T15:04:08
133,677,449
1
0
null
2019-10-07T15:04:09
2018-05-16T14:24:07
Java
UTF-8
Java
false
false
596
java
package com.albertmiro.albums4u.api; import com.albertmiro.albums4u.api.model.GenericITunesResponse; import io.reactivex.Single; import retrofit2.http.GET; import retrofit2.http.Query; public interface ITunesService { @GET("lookup") Single<GenericITunesResponse> getAlbumsByArtist(@Query("id") int artistId, @Query("entity") String entityType); @GET("lookup") Single<GenericITunesResponse> getAlbumSongs(@Query("id") int albumId, @Query("entity") String entityType); }
[ "info@albertmiro.com" ]
info@albertmiro.com
04b0f75cde1b17f4ca16b4d66cd33e70f88d0500
aebb2509deee85365d300c660fafb8f8fc5efb2a
/lesson_21_DAO_HW/src/main/java/ru/innopolis/stc9/servlets/pojo/Team.java
74348007ec9ced12992c970a8f5a45ca7b5c5d81
[]
no_license
saepiae/students
dda39287139e60b46c7d47835eb403987b64e4d5
6befc808039801d834f15ad5b8e998feda65fde7
refs/heads/master
2020-03-17T07:29:16.279517
2018-05-22T04:17:50
2018-05-22T04:17:50
133,400,257
0
0
null
null
null
null
UTF-8
Java
false
false
1,507
java
package ru.innopolis.stc9.servlets.pojo; import org.apache.log4j.Logger; import java.util.Objects; /** * Группа */ public class Team { static final Logger logger = Logger.getLogger(Team.class); private int id; private String group; private String specialty; public Team(int id, String group, String specialty) { this.id = id; this.group = group; this.specialty = specialty; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getGroup() { return group; } public void setGroup(String group) { this.group = group; } public String getSpecialty() { return specialty; } public void setSpecialty(String specialty) { this.specialty = specialty; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Team team = (Team) o; return id == team.id && Objects.equals(group, team.group) && Objects.equals(specialty, team.specialty); } @Override public int hashCode() { return Objects.hash(id, group, specialty); } @Override public String toString() { return "Team{" + "id=" + id + ", group='" + group + '\'' + ", specialty='" + specialty + '\'' + '}'; } }
[ "irinanr4@mail.ru" ]
irinanr4@mail.ru
1a0f5c6df048bcae64aaf97544ee2e6db33ab4d5
b24818a948152b06c7d85ac442e9b37cb6becbbc
/src/main/java/com/ash/experiments/performance/whitespace/Class9157.java
6d99b1185447c9ab7849c48eafbff6fbe302c0ea
[]
no_license
ajorpheus/whitespace-perf-test
d0797b6aa3eea1435eaa1032612f0874537c58b8
d2b695aa09c6066fbba0aceb230fa4e308670b32
refs/heads/master
2020-04-17T23:38:39.420657
2014-06-02T09:27:17
2014-06-02T09:27:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
41
java
public class Class9157 {}
[ "Ashutosh.Jindal@monitise.com" ]
Ashutosh.Jindal@monitise.com
bb123d4154b058a10d5dabbabcdfff6d7add0f32
0300325be9ac0101e179cc07460b9238acc8e846
/src/Assignment11.java
282b96b85455ed05fca4b4b5d4b243d69cf37e2a
[]
no_license
JericRice/revature-java-assignment2
af4ceaaafbee788c6dc12a2076b038e0d3ee3aa8
c9dab2378affb77e8e8d9f2920afafdab7477d5b
refs/heads/master
2022-07-02T19:23:34.064516
2020-05-14T21:32:09
2020-05-14T21:32:09
263,761,923
0
0
null
null
null
null
UTF-8
Java
false
false
891
java
/* * 11. Write a class named Assignment11 that uses a double for-loop (a for-loop within a for-loop). * The outer loop should navigate through an integer array that has 10 elements corresponding to the numbers 1 through 10, * inclusive. * * The inner loop should count from 1 to 10, and prints the value of the current count multiplied by a the current index * of the array. * * You should end up printing the multiples of 1 through 10 from 1 to 10. Ex: 1*1, 1*2, 1*3…1*10, 2*1, 2*2, 2*3…10*9, 10*10. */ public class Assignment11 { public static void main(String[] args) { int[] intArray = new int[] {1,2,3,4,5,6,7,8,9,10}; for (int i = 0; i < intArray.length; i++) { System.out.println(i); for(int j = 1; j <= 10; j++) { int result = intArray[i] * j; System.out.println(result); } // end inner for } // end outer for } // main }
[ "jeric720@icloud.com" ]
jeric720@icloud.com
76524532c05c0a29ea29d16855b14c0096bea2fb
b2d109287658e6b8dd2a6a1e84fff9966baa3cd8
/src/main/java/com/company/lendingbackend/dto/LoanDto.java
cfdaec4000966ebc463114b259174797079491c8
[]
no_license
btiftik/restservice
3846eea4a2b3e6f91ffab40bcc75d28c699c2baa
22751a740e5fdd1715c9c4d8962c1582f13bf863
refs/heads/master
2022-05-05T09:28:44.613066
2019-07-11T22:14:37
2019-07-11T22:14:37
194,517,155
1
0
null
null
null
null
UTF-8
Java
false
false
211
java
package com.company.lendingbackend.dto; import lombok.Getter; import lombok.Setter; import java.math.BigDecimal; @Getter @Setter public class LoanDto { private BigDecimal amount; private int term; }
[ "buraktiftikgit@gmail.com" ]
buraktiftikgit@gmail.com
d2c05ab7b897eba606e59041cabd733a5c91519c
4b81cb9f2b11cdc39389ce2f5cb17b30bced5d3f
/src/assignmenthandler/assignments/sem2vop/l4c/opg2_numberplates/NumberPlates.java
5a237ea024478288b3511ab8457f41417e526e3a
[]
no_license
olnor18/AssignmentHandlerFX
13a079aae67f53c9ffbf0a8e7050b21851d65cba
7ed066d5599687406dfb15d5e129cc2f3c2b53b4
refs/heads/master
2020-04-25T08:23:07.280374
2019-03-08T10:29:48
2019-03-08T10:29:48
172,645,410
0
0
null
null
null
null
UTF-8
Java
false
false
2,510
java
package assignmenthandler.assignments.sem2vop.l4c.opg2_numberplates; import java.util.Arrays; import java.util.Map; import java.util.Scanner; import java.util.TreeMap; import assignmenthandler.assignments.sem2vop.l4c.L4c; import assignmenthandler.assignments.sem2vop.l4c.opg2_numberplates.VehicleType; /** * VOP eksamen F2014 Kodeskelet til opgave 2 * * @author erso */ public class NumberPlates { public static final int LENGTH = 7; // Noejagtig laengde paa nummerplade private final Map<String, String> districtMap; // Kendingsbogstaver -> Politikreds private final VehicleType[] vehicleTypes = { // Intervaller for anvendelse new VehicleType("Motorcykel", 10000, 19999), new VehicleType("Privat personvogn", 20000, 45999), new VehicleType("Udlejningsvogn", 46000, 46999), new VehicleType("Hyrevogn", 47000, 48999), new VehicleType("Skolevogn", 49000, 49899), new VehicleType("Ambulance el. lign.", 49900, 49999), new VehicleType("Diverse andre ", 50000, 84999) }; public NumberPlates() { districtMap = new TreeMap<>(); readFile(); } public void readFile() { new Scanner(L4c.class.getResourceAsStream("Nummerplader.txt")).useDelimiter("\r\n").forEachRemaining(t -> districtMap.put(t.split(":")[0], t.split(":")[1])); //My inspiration is from Benzaboi #OneLineForEverything } public String validate(String plate) { return plate.length() != LENGTH ? "ERROR: Invalid plate length" : !(validateVehicleType(Integer.decode(plate.substring(2))) + " fra " + validateDistrict(plate.substring(0, 2))).contains("ERROR:") ? validateVehicleType(Integer.decode(plate.substring(2))) + " fra " + validateDistrict(plate.substring(0, 2)) : validateVehicleType(Integer.decode(plate.substring(2))).contains("ERROR:") ? validateVehicleType(Integer.decode(plate.substring(2))) : validateDistrict(plate.substring(0, 2)); //My inspiration is from Benzaboi #OneLineForEverything #TernaryIsLife } private String validateDistrict(String districtCode) { return districtMap.getOrDefault(districtCode.toUpperCase(), "ERROR: Invalid districtcode"); } private String validateVehicleType(int number) { final StringBuilder s = new StringBuilder(); Arrays.stream(vehicleTypes).forEach(v -> s.append(v.isA(number) ? v.getVehicleType() : "")); return s.length() == 0 ? "ERROR: Invalid number" : s.toString(); } }
[ "olnor18@student.sdu.dk" ]
olnor18@student.sdu.dk
c0c26226c8e7cc72780c84b4a2492b1074296b18
9d9185a9c4f6acbc8977bd4f93516e2799ff8967
/multimediademo/src/main/java/com/soul/multimediademo/MusicPlayerActivity.java
73ad7e1d43f75190ba49fc91a8518f0ab9bd8be7
[]
no_license
zh405557524/AndroidCompilations
0049b8a63f9025461726a40e5e4284fdd1f8ae60
24e6dc0a3678d7911d5472f938f4271a943b6e80
refs/heads/master
2021-01-19T00:26:02.079011
2020-06-24T10:54:57
2020-06-24T10:54:57
73,050,238
2
0
null
null
null
null
UTF-8
Java
false
false
3,521
java
package com.soul.multimediademo; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import com.soul.multimediademo.service.IMusicService; import com.soul.multimediademo.service.MusicService; import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.TimerTask; /** * 音乐播放器 后台播放 */ public class MusicPlayerActivity extends AppCompatActivity { private TextView mTv_current; private ListView mLv; private Intent mIntent; private MyConn mMyConn; private TimerTask mTimerTask; private Timer mTimer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_music_player); mIntent = new Intent(this, MusicService.class); startService(mIntent); mMyConn = new MyConn(); bindService(mIntent, mMyConn, BIND_AUTO_CREATE); mTv_current = (TextView) findViewById(R.id.tv_current); mLv = (ListView) findViewById(R.id.lv); final List<MusicInfo> infos = new ArrayList<>(); infos.add(new MusicInfo("爱你", "http://192.168.0.106:8080/aini.mp3")); infos.add(new MusicInfo("千年泪", "http://192.168.0.106:8080/qnl.mp3")); // infos.add(new MusicInfo("小苹果", "http://192.168.1.100:8080:xpg.mps")); // infos.add(new MusicInfo("小苹果", "http://192.168.1.100:8080:xpg.mps")); mLv.setAdapter(new ArrayAdapter<MusicInfo>(this, android.R.layout.simple_list_item_1, infos)); mLv.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { mBinder.callPlay(infos, i); int position = mBinder.callGetCurrentPosition(); } }); mTimer = new Timer(); mTimerTask = new TimerTask() { private int mPosition; @Override public void run() { mPosition = mBinder.callGetCurrentPosition(); // UIUtils.postTaskSafely(new Runnable() { // @Override // public void run() { // mTv_current.setText("正在播放:" + infos.get(mPosition).getName()); // } // }); } }; mTimer.schedule(mTimerTask, 200, 5000); } private IMusicService mBinder; class MyConn implements ServiceConnection { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { //绑定成功,获取服务返回的中间人 mBinder = (IMusicService) iBinder; } @Override public void onServiceDisconnected(ComponentName componentName) { } } @Override public void onDestroy() { super.onDestroy(); unbindService(mMyConn); if (mTimer != null) { mTimer.cancel(); mTimer = null; } if (mTimerTask == null) { mTimerTask.cancel(); mTimerTask = null; } } }
[ "405557524@qq.com" ]
405557524@qq.com
9a4eb6efe99cf423553ff8b9ec48a677bd196040
8cc4ca71b7cf1b10425e5f369ebf7a97a49b3548
/app/src/main/java/br/com/interaje/productmanager/adapters/ProductAdapter.java
c33aa78ec9f28f38b0d3028286a5a55f279d1c6c
[]
no_license
Felipe00/InterajeProductManager
4e030578720fa0299c1444f920d29b14bbc2d835
c4f5361a2e1debb52cb52becec0492a5f5f1fd31
refs/heads/master
2020-12-26T07:05:00.992228
2016-05-14T11:33:36
2016-05-14T11:33:36
56,705,766
0
0
null
null
null
null
UTF-8
Java
false
false
1,783
java
package br.com.interaje.productmanager.adapters; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.List; import br.com.interaje.productmanager.R; import br.com.interaje.productmanager.models.Category; import br.com.interaje.productmanager.models.Product; /** * Created by rayquaza on 20/04/16. */ public class ProductAdapter extends BaseAdapter { private LayoutInflater mLayoutInflater; private List<Product> products; public ProductAdapter(Context context, List<Product> products) { mLayoutInflater = LayoutInflater.from(context); this.products = products; } @Override public int getCount() { return products.size(); } @Override public Object getItem(int position) { return products.get(position); } @Override public long getItemId(int position) { return products.get(position).getId(); } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = mLayoutInflater.inflate(R.layout.item_product, parent, false); TextView productName = (TextView) view.findViewById(R.id.productName); TextView productPrice = (TextView) view.findViewById(R.id.productPrice); TextView categoryName = (TextView) view.findViewById(R.id.categoryName); productName.setText(products.get(position).getName()); productPrice.setText(String.valueOf(products.get(position).getPrice())); Category category = products.get(position).getCategory(); categoryName.setText(category != null ? category.getName() : ""); return view; } }
[ "fcostax02@gmail.com" ]
fcostax02@gmail.com
b130362c0609eda3bfc6b70ff69f56c7e3d600db
110c2756c01475530b0c85162643f9484b1194ef
/20161213/Aloha.java
e17e52deecf2af0c0b82295323e43f8d1542cb7d
[]
no_license
iamnoone999/160139
aa3132bae14a85b90c5a4e229bd0ded97e26e194
3e09bc6a64cdd960e808fb0057f1f34465289b60
refs/heads/master
2020-06-24T17:08:52.757948
2017-01-31T03:10:08
2017-01-31T03:10:08
74,631,048
0
0
null
null
null
null
UTF-8
Java
false
false
318
java
public class Aloha { public static void main (String[] args) { String name; while (true){ System.out.println("名前を入力してください >"); name = new java.util.Scanner(System.in).nextLine(); System.out.println(name); if (name.equals("exit") ){ System.out.println("owarimashita"); } } } }
[ "160139@yses.ac.jp" ]
160139@yses.ac.jp
7839c3e3af9e5f42a1ae2d022ab353f49dae0fe9
aa28aa119f218a2d469bd54e2cd00ec6453bd02c
/src/test/java/com/aspose/slides/usecases/ChartTest.java
f802354946011246538c1126e41f71c3ab999b8d
[ "MIT" ]
permissive
banketree/aspose-slides-cloud-android
8d1de2ec66e33fd03b6cbde79a2e0e8db6ea9af1
981ca61df03a09db3ae2df451c40d29369ae9b50
refs/heads/master
2023-07-26T01:18:32.658867
2021-09-04T11:04:42
2021-09-04T11:04:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
19,230
java
// -------------------------------------------------------------------------------------------------------------------- // <copyright company="Aspose" file="ChartTests.cs"> // Copyright (c) 2018 Aspose.Slides for Cloud // </copyright> // <summary> // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // </summary> // -------------------------------------------------------------------------------------------------------------------- package com.aspose.slides.usecases; import com.aspose.slides.ApiException; import org.junit.Test; import com.aspose.slides.ApiTest; import com.aspose.slides.model.*; import java.io.IOException; import java.util.ArrayList; import java.util.List; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** * API tests for chart methods */ public class ChartTest extends ApiTest { @Test public void chartGetTest() throws ApiException, IOException { initialize(null, null, null); Chart chart = (Chart)api.getShape(c_fileName, c_slideIndex, c_shapeIndex, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount, chart.getSeries().size()); assertEquals(c_categoryCount, chart.getCategories().size()); } @Test public void chartCreateTest() throws ApiException, IOException { initialize(null, null, null); Chart dto = new Chart(); dto.setChartType(Chart.ChartTypeEnum.CLUSTEREDCOLUMN); dto.setWidth(400.0); dto.setHeight(300.0); ChartCategory category1 = new ChartCategory(); category1.setValue("Category1"); ChartCategory category2 = new ChartCategory(); category2.setValue("Category2"); ChartCategory category3 = new ChartCategory(); category3.setValue("Category3"); List<ChartCategory> categories = new ArrayList<ChartCategory>(); categories.add(category1); categories.add(category2); categories.add(category3); dto.setCategories(categories); List<Series> seriesList = new ArrayList<Series>(); OneValueSeries series1 = new OneValueSeries(); series1.setName("Series1"); List<OneValueChartDataPoint> dataPoints1 = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint11 = new OneValueChartDataPoint(); dataPoint11.setValue(40.0); dataPoints1.add(dataPoint11); OneValueChartDataPoint dataPoint12 = new OneValueChartDataPoint(); dataPoint12.setValue(50.0); dataPoints1.add(dataPoint12); OneValueChartDataPoint dataPoint13 = new OneValueChartDataPoint(); dataPoint13.setValue(70.0); dataPoints1.add(dataPoint13); series1.setDataPoints(dataPoints1); seriesList.add(series1); OneValueSeries series2 = new OneValueSeries(); series2.setName("Series2"); List<OneValueChartDataPoint> dataPoints2 = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint21 = new OneValueChartDataPoint(); dataPoint21.setValue(55.0); dataPoints2.add(dataPoint21); OneValueChartDataPoint dataPoint22 = new OneValueChartDataPoint(); dataPoint22.setValue(35.0); dataPoints2.add(dataPoint22); OneValueChartDataPoint dataPoint23 = new OneValueChartDataPoint(); dataPoint23.setValue(90.0); dataPoints2.add(dataPoint23); series2.setDataPoints(dataPoints2); seriesList.add(series2); dto.setSeries(seriesList); Chart chart = (Chart)api.createShape(c_fileName, c_slideIndex, dto, null, null, c_password, c_folderName, null); assertNotNull(chart); assertEquals(2, chart.getSeries().size()); assertEquals(3, chart.getCategories().size()); } @Test public void chartUpdateTest() throws ApiException, IOException { initialize(null, null, null); Chart dto = new Chart(); dto.setChartType(Chart.ChartTypeEnum.CLUSTEREDCOLUMN); dto.setWidth(400.0); dto.setHeight(300.0); ChartCategory category1 = new ChartCategory(); category1.setValue("Category1"); ChartCategory category2 = new ChartCategory(); category2.setValue("Category2"); ChartCategory category3 = new ChartCategory(); category3.setValue("Category3"); List<ChartCategory> categories = new ArrayList<ChartCategory>(); categories.add(category1); categories.add(category2); categories.add(category3); dto.setCategories(categories); List<Series> seriesList = new ArrayList<Series>(); OneValueSeries series1 = new OneValueSeries(); series1.setName("Series1"); List<OneValueChartDataPoint> dataPoints1 = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint11 = new OneValueChartDataPoint(); dataPoint11.setValue(40.0); dataPoints1.add(dataPoint11); OneValueChartDataPoint dataPoint12 = new OneValueChartDataPoint(); dataPoint12.setValue(50.0); dataPoints1.add(dataPoint12); OneValueChartDataPoint dataPoint13 = new OneValueChartDataPoint(); dataPoint13.setValue(70.0); dataPoints1.add(dataPoint13); series1.setDataPoints(dataPoints1); seriesList.add(series1); OneValueSeries series2 = new OneValueSeries(); series2.setName("Series2"); List<OneValueChartDataPoint> dataPoints2 = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint21 = new OneValueChartDataPoint(); dataPoint21.setValue(55.0); dataPoints2.add(dataPoint21); OneValueChartDataPoint dataPoint22 = new OneValueChartDataPoint(); dataPoint22.setValue(35.0); dataPoints2.add(dataPoint22); OneValueChartDataPoint dataPoint23 = new OneValueChartDataPoint(); dataPoint23.setValue(90.0); dataPoints2.add(dataPoint23); series2.setDataPoints(dataPoints2); seriesList.add(series2); dto.setSeries(seriesList); Chart chart = (Chart)api.updateShape(c_fileName, c_slideIndex, c_shapeIndex, dto, c_password, c_folderName, null); assertNotNull(chart); assertEquals(2, chart.getSeries().size()); assertEquals(3, chart.getCategories().size()); } @Test public void chartSeriesCreateTest() throws ApiException, IOException { initialize(null, null, null); OneValueSeries series = new OneValueSeries(); series.setName("Series1"); List<OneValueChartDataPoint> dataPoints = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint1 = new OneValueChartDataPoint(); dataPoint1.setValue(40.0); dataPoints.add(dataPoint1); OneValueChartDataPoint dataPoint2 = new OneValueChartDataPoint(); dataPoint2.setValue(50.0); dataPoints.add(dataPoint2); OneValueChartDataPoint dataPoint3 = new OneValueChartDataPoint(); dataPoint3.setValue(14.0); dataPoints.add(dataPoint3); OneValueChartDataPoint dataPoint4 = new OneValueChartDataPoint(); dataPoint4.setValue(70.0); dataPoints.add(dataPoint4); series.setDataPoints(dataPoints); Chart chart = api.createChartSeries(c_fileName, c_slideIndex, c_shapeIndex, series, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount + 1, chart.getSeries().size()); assertEquals(c_categoryCount, chart.getCategories().size()); } @Test public void chartSeriesUpdateTest() throws ApiException, IOException { initialize(null, null, null); OneValueSeries series = new OneValueSeries(); series.setName("Series1"); List<OneValueChartDataPoint> dataPoints = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint1 = new OneValueChartDataPoint(); dataPoint1.setValue(40.0); dataPoints.add(dataPoint1); OneValueChartDataPoint dataPoint2 = new OneValueChartDataPoint(); dataPoint2.setValue(50.0); dataPoints.add(dataPoint2); OneValueChartDataPoint dataPoint3 = new OneValueChartDataPoint(); dataPoint3.setValue(14.0); dataPoints.add(dataPoint3); OneValueChartDataPoint dataPoint4 = new OneValueChartDataPoint(); dataPoint4.setValue(70.0); dataPoints.add(dataPoint4); series.setDataPoints(dataPoints); Chart chart = api.updateChartSeries(c_fileName, c_slideIndex, c_shapeIndex, c_seriesIndex, series, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount, chart.getSeries().size()); assertEquals(c_categoryCount, chart.getCategories().size()); } @Test public void chartSeriesDeleteTest() throws ApiException, IOException { initialize(null, null, null); Chart chart = api.deleteChartSeries(c_fileName, c_slideIndex, c_shapeIndex, c_seriesIndex, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount - 1, chart.getSeries().size()); assertEquals(c_categoryCount, chart.getCategories().size()); } @Test public void chartCategoryCreateTest() throws ApiException, IOException { //SLIDESCLOUD-1133 initialize(null, null, null); ChartCategory category = new ChartCategory(); category.setValue("NewCategory"); List<OneValueChartDataPoint> dataPoints = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint1 = new OneValueChartDataPoint(); dataPoint1.setValue(40.0); dataPoints.add(dataPoint1); OneValueChartDataPoint dataPoint2 = new OneValueChartDataPoint(); dataPoint2.setValue(50.0); dataPoints.add(dataPoint2); OneValueChartDataPoint dataPoint3 = new OneValueChartDataPoint(); dataPoint3.setValue(14.0); dataPoints.add(dataPoint3); category.setDataPoints(dataPoints); Chart chart = api.createChartCategory(c_fileName, c_slideIndex, c_shapeIndex, category, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount, chart.getSeries().size()); assertEquals(c_categoryCount + 1, chart.getCategories().size()); assertEquals(c_categoryCount + 1, ((OneValueSeries)chart.getSeries().get(0)).getDataPoints().size()); assertEquals(category.getDataPoints().get(0).getValue(), ((OneValueSeries)chart.getSeries().get(0)).getDataPoints().get(c_categoryCount).getValue()); } @Test public void chartCategoryUpdateTest() throws ApiException, IOException { //SLIDESCLOUD-1133 initialize(null, null, null); ChartCategory category = new ChartCategory(); category.setValue("NewCategory"); List<OneValueChartDataPoint> dataPoints = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint1 = new OneValueChartDataPoint(); dataPoint1.setValue(40.0); dataPoints.add(dataPoint1); OneValueChartDataPoint dataPoint2 = new OneValueChartDataPoint(); dataPoint2.setValue(50.0); dataPoints.add(dataPoint2); OneValueChartDataPoint dataPoint3 = new OneValueChartDataPoint(); dataPoint3.setValue(14.0); dataPoints.add(dataPoint3); category.setDataPoints(dataPoints); Chart chart = api.updateChartCategory(c_fileName, c_slideIndex, c_shapeIndex, c_categoryIndex, category, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount, chart.getSeries().size()); assertEquals(c_categoryCount, chart.getCategories().size()); assertEquals(c_categoryCount, ((OneValueSeries)chart.getSeries().get(0)).getDataPoints().size()); assertEquals(category.getDataPoints().get(0).getValue(), ((OneValueSeries)chart.getSeries().get(0)).getDataPoints().get(c_categoryIndex - 1).getValue()); } @Test public void chartCategoryDeleteTest() throws ApiException, IOException { //SLIDESCLOUD-1133 initialize(null, null, null); Chart chart = api.deleteChartCategory(c_fileName, c_slideIndex, c_shapeIndex, c_categoryIndex, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount, chart.getSeries().size()); assertEquals(c_categoryCount - 1, chart.getCategories().size()); assertEquals(c_categoryCount - 1, ((OneValueSeries)chart.getSeries().get(0)).getDataPoints().size()); } @Test public void chartDataPointCreateTest() throws ApiException, IOException { initialize(null, null, null); OneValueChartDataPoint dataPoint = new OneValueChartDataPoint(); dataPoint.setValue(40.0); try { api.createChartDataPoint(c_fileName, c_slideIndex, c_shapeIndex, c_seriesIndex, dataPoint, c_password, c_folderName, null); } catch (Exception ex) { //Must throw ApiException because adding data points only works with Scatter & Bubble charts. assertTrue(ex instanceof ApiException); } } @Test public void chartDataPointUpdateTest() throws ApiException, IOException { //SLIDESCLOUD-1133 initialize(null, null, null); OneValueChartDataPoint dataPoint = new OneValueChartDataPoint(); dataPoint.setValue(40.0); Chart chart = api.updateChartDataPoint(c_fileName, c_slideIndex, c_shapeIndex, c_seriesIndex, c_categoryIndex, dataPoint, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount, chart.getSeries().size()); assertEquals(c_categoryCount, chart.getCategories().size()); assertEquals(c_categoryCount, ((OneValueSeries)chart.getSeries().get(c_seriesIndex - 1)).getDataPoints().size()); assertEquals(dataPoint.getValue(), ((OneValueSeries)chart.getSeries().get(c_seriesIndex - 1)).getDataPoints().get(c_categoryIndex - 1).getValue()); } @Test public void chartDataPointDeleteTest() throws ApiException, IOException { //SLIDESCLOUD-1133 initialize(null, null, null); Chart chart = api.deleteChartDataPoint(c_fileName, c_slideIndex, c_shapeIndex, c_seriesIndex, c_categoryIndex, c_password, c_folderName, null); assertNotNull(chart); assertEquals(c_seriesCount, chart.getSeries().size()); assertEquals(c_categoryCount, chart.getCategories().size()); assertEquals(c_categoryCount, ((OneValueSeries)chart.getSeries().get(c_seriesIndex - 1)).getDataPoints().size()); assertNull(((OneValueSeries)chart.getSeries().get(c_seriesIndex - 1)).getDataPoints().get(c_categoryIndex - 1)); } @Test public void chartSunburstTest() throws ApiException, IOException { initialize(null, null, null); Chart dto = new Chart(); dto.setChartType(Chart.ChartTypeEnum.SUNBURST); dto.setWidth(400.0); dto.setHeight(300.0); List<ChartCategory> categories = new ArrayList<ChartCategory>(); ChartCategory category1 = new ChartCategory(); category1.setValue("Leaf1"); category1.setLevel(3); List<String> parentCategories1 = new ArrayList<String>(); parentCategories1.add("Branch1"); parentCategories1.add("Stem1"); category1.setParentCategories(parentCategories1); categories.add(category1); ChartCategory category2 = new ChartCategory(); category2.setValue("Leaf2"); category2.setLevel(3); List<String> parentCategories2 = new ArrayList<String>(); parentCategories2.add("Branch1"); parentCategories2.add("Stem1"); category2.setParentCategories(parentCategories2); categories.add(category2); ChartCategory category3 = new ChartCategory(); category3.setValue("Branch2"); category3.setLevel(2); List<String> parentCategories3 = new ArrayList<String>(); parentCategories3.add("Stem1"); category3.setParentCategories(parentCategories3); categories.add(category3); ChartCategory category4 = new ChartCategory(); category4.setValue("Stem2"); category4.setLevel(1); categories.add(category4); dto.setCategories(categories); List<Series> seriesList = new ArrayList<Series>(); OneValueSeries series = new OneValueSeries(); series.setName("Series1"); List<OneValueChartDataPoint> dataPoints = new ArrayList<OneValueChartDataPoint>(); OneValueChartDataPoint dataPoint1 = new OneValueChartDataPoint(); dataPoint1.setValue(40.0); dataPoints.add(dataPoint1); OneValueChartDataPoint dataPoint2 = new OneValueChartDataPoint(); dataPoint2.setValue(50.0); dataPoints.add(dataPoint2); OneValueChartDataPoint dataPoint3 = new OneValueChartDataPoint(); dataPoint3.setValue(70.0); dataPoints.add(dataPoint3); OneValueChartDataPoint dataPoint4 = new OneValueChartDataPoint(); dataPoint4.setValue(80.0); dataPoints.add(dataPoint4); series.setDataPoints(dataPoints); seriesList.add(series); dto.setSeries(seriesList); Chart chart = (Chart)api.createShape(c_fileName, c_slideIndex, dto, null, null, c_password, c_folderName, null); assertNotNull(chart); assertEquals(1, chart.getSeries().size()); assertEquals(4, chart.getCategories().size()); assertEquals(3, chart.getCategories().get(0).getLevel().longValue()); } private static final String c_folderName = "TempSlidesSDK"; private static final String c_fileName = "test.pptx"; private static final String c_password = "password"; private static final int c_slideIndex = 3; private static final int c_shapeIndex = 1; private static final int c_seriesIndex = 2; private static final int c_categoryIndex = 2; private static final int c_seriesCount = 3; private static final int c_categoryCount = 4; }
[ "victor.putrov@aspose.com" ]
victor.putrov@aspose.com
88c334657b2b2af3b22698e9bf4239fa3c25336d
5755a6026216c195e65039f8ee81950801298e43
/xydl-users/src/test/java/com/njit/xydl/users/XydlUsersApplicationTests.java
030c0eaf81b0d2099a68765a41abbab9a8247606
[]
no_license
HanYehong/xydl-springcloud
78acffab0dcfafcc02fd9d8b0bd5994d8051c71f
eed9179e02e5def7d6c5b84f55969840589cb83f
refs/heads/master
2022-12-21T12:40:04.073985
2019-05-03T10:23:10
2019-05-03T10:23:10
167,715,725
1
0
null
2022-12-15T23:23:54
2019-01-26T17:12:28
Java
UTF-8
Java
false
false
349
java
package com.njit.xydl.users; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class XydlUsersApplicationTests { @Test public void contextLoads() { } }
[ "1521946409@qq.com" ]
1521946409@qq.com
20e895c70788280f697830aad14e4026d55c681a
e03f66dd4f35fb337b84625f5f752c69f8db2307
/Pertemuan 5/Contoh/BelajarInternalFrame.java
6bd392af6f09403aa1408442da6e66ab98708d24
[]
no_license
fajarmuhf/Pemrograman-3
80aaba7500ae3718832f22efcf9da0dcb3b61a29
8212bd6ace45d368250b58b7135df72fbf10e3d1
refs/heads/master
2021-01-20T12:16:51.432139
2015-01-21T05:04:57
2015-01-21T05:04:57
12,679,530
0
0
null
null
null
null
UTF-8
Java
false
false
901
java
import javax.swing.JFrame; import javax.swing.JDesktopPane; import javax.swing.JInternalFrame; import javax.swing.JLabel; public class BelajarInternalFrame{ public static void main(String []args){ JFrame frame = new JFrame(); frame.setTitle("Belajar Menggunakan Frame"); frame.setSize(800,600); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setResizable(false); frame.setVisible(true); JDesktopPane desktop = new JDesktopPane(); JInternalFrame inframe = new JInternalFrame(); inframe.setTitle("Ini adalah internal frame"); inframe.setSize(400,400); inframe.setClosable(true); inframe.setResizable(true); inframe.setMaximizable(true); inframe.add(new JLabel("Contoh Kotak Dialog")); desktop.add(inframe); inframe.setVisible(true); frame.setContentPane(desktop); frame.setVisible(true); } }
[ "fajarmuhf@gmail.com" ]
fajarmuhf@gmail.com
bb31da44aa0a6b946b37568f82ee4202a4d1b2ef
2ee04bf90ca6abc66e5b70df3a1b74353c560063
/src/com/company/backend/NASMBuilder.java
5b6b2513a8526beadf3960034d637b248f832613
[]
no_license
sky46262/MxCompiler
ee0692d9947c27dca2d6aba0e970c44e25af1ce9
1961607abb3b810974ef732ac6217d6069054625
refs/heads/master
2020-05-02T10:51:48.878487
2019-05-13T16:12:58
2019-05-13T16:12:58
177,909,734
0
0
null
null
null
null
UTF-8
Java
false
false
15,659
java
package com.company.backend; import com.company.backend.NASM.*; import com.company.frontend.IR.*; import java.util.HashSet; import java.util.Stack; import java.util.Vector; public class NASMBuilder { CFG cfg; NASM nasm; private Vector<NASMInst> instList = new Vector<>(); //16 RAX 19 RDX 20 RSP 21 RBP //except rsp rbp r10 r11 rax private int[] availableReg = {17, 12, 13, 14, 15, 23, 22, 19, 18, 8,9}; private int[] parameterReg = {23, 22, 19, 18, 8, 9}; private int parameterStackOffset = 0; private int[] templateReg = {10, 11}; private int[] templateMap = {0, 0}; private int curTemplateReg = 0; private Stack<Integer> curCalleeSavedReg = new Stack<>(); private int[] calleeSaveReg = {17, 12, 13, 14, 15, 21}; private Stack<Integer> curCallerSavedReg = new Stack<>(); //for lib private int[] callerSaveReg = {18, 19, 8, 9, 10, 11, 22, 23}; private int curStackOffset = 0; private HashSet<Integer> visitFlag = new HashSet<>(); private CFGProcess curProcess = null; private CFGInst.InstType lastOp; public NASMBuilder(CFG _cfg, NASM _nasm) { cfg = _cfg; nasm = _nasm; visitCFG(); } private void visitCFG() { for (CFGProcess i : cfg.processList) { nasm.defGlobal(i.entryNode.name); } for (CFGData i : cfg.dataList) { nasm.defGlobal(i.name); } nasm.genLine(); for (CFGProcess i : cfg.processList) { curProcess = i; visitCFGNode(i.entryNode); //curAvailReg = 0; } nasm.genLine(); nasm.defSection(NASM.SectionType.DATA); for (CFGData i : cfg.dataList) { if (i.dType != CFGData.dataType.d_res) visitCFGData(i); } nasm.genLine(); nasm.defSection(NASM.SectionType.BSS); for (CFGData i : cfg.dataList) { if (i.dType == CFGData.dataType.d_res) visitCFGData(i); } } private void visitCFGNode(CFGNode node) { if (visitFlag.contains(node.ID)) return; visitFlag.add(node.ID); nasm.defLabel(node.name); if (!node.insts.isEmpty()) { //after reduce, change the label CFGInst last_inst = node.insts.lastElement(); if (last_inst.op == CFGInst.InstType.op_jcc || last_inst.op == CFGInst.InstType.op_jmp) last_inst.operands.firstElement().strLit = node.nextNodes.firstElement().name; } if (curProcess != null) { //in the front of function //push register and calculate stack if (curProcess.isCallee && curProcess.paramCnt <= 6) { for (int t : calleeSaveReg) curCalleeSavedReg.add(t); } else curCalleeSavedReg.add(21); pushCalleeSavedReg(); genNASMInst(NASMInst.InstType.MOV, new NASMRegAddr(new NASMReg(21, NASMWordType.QWORD)), new NASMRegAddr(new NASMReg(20, NASMWordType.QWORD))); if (curProcess.stackSize > 8) { curStackOffset = Integer.max(getExp2(curProcess.stackSize), 32); genNASMInst(NASMInst.InstType.SUB, new NASMRegAddr(new NASMReg(20, NASMWordType.QWORD)), new NASMImmAddr(curStackOffset)); } else curStackOffset = 0; curProcess = null; } node.insts.forEach(this::visitCFGInst); //Why add jump inst if (node.nextNodes.size() == 1 && (node.insts.isEmpty() || node.insts.lastElement().op != CFGInst.InstType.op_return) && visitFlag.contains(node.nextNodes.firstElement().ID)) genNASMInst(CFGInst.InstType.op_jmp, CFGInstAddr.newLabelAddr(node.nextNodes.firstElement()), null); for (int i = node.nextNodes.size() - 1; i >= 0; i--) { CFGNode nextNode = node.nextNodes.get(i); if (i == 1 && visitFlag.contains(nextNode.ID)) genNASMInst(CFGInst.InstType.op_jmp, CFGInstAddr.newLabelAddr(nextNode), null); else visitCFGNode(nextNode); } } private void visitCFGData(CFGData data) { nasm.genLine(false, data.name + ":"); StringBuilder str = new StringBuilder(); switch (data.dType){ case d_num: str.append("dq\t").append(data.intValue); break; case d_res: str.append("resw\t").append(data.size); break; case d_str: str.append("db\t"); data.strValue.chars().forEach(i-> str.append(String.format("%02X",i)).append("H, ")); str.append("00H"); //strLit is to long, so split into bytes break; } nasm.genLine(true, str.toString()); } private void visitCFGInst(CFGInst inst) { if (inst.operands.size() == 2) genNASMInst(inst.op, inst.operands.get(0), inst.operands.get(1)); else if (inst.operands.size() == 1) genNASMInst(inst.op, inst.operands.get(0), null); else genNASMInst(inst.op, null, null); lastOp = inst.op; } private void genNASMInst(CFGInst.InstType op, CFGInstAddr opr1, CFGInstAddr opr2) { if (op == CFGInst.InstType.op_mov){ assert opr1 != null && opr2 != null && !(opr1.a_type == CFGInstAddr.addrType.a_mem && opr2.a_type == CFGInstAddr.addrType.a_mem); } if (CFGInst.isCommutable(op) && opr1.a_type == CFGInstAddr.addrType.a_imm) { genNASMInst(op, opr2, opr1); return; //??? commute? } else if (op == CFGInst.InstType.op_div && opr2 != null){ genNASMInst(CFGInst.InstType.op_mov, CFGInstAddr.newRegAddr(-4), opr1); genNASMInst(NASMInst.InstType.CQO, null, null); genNASMInst(CFGInst.InstType.op_div, opr2, null); genNASMInst(CFGInst.InstType.op_mov, opr1, CFGInstAddr.newRegAddr(-4)); return; } else if (op == CFGInst.InstType.op_mod && opr2 != null){ genNASMInst(CFGInst.InstType.op_mov, CFGInstAddr.newRegAddr(-4), opr1); genNASMInst(NASMInst.InstType.CQO, null, null); genNASMInst(CFGInst.InstType.op_div, opr2, null); genNASMInst(CFGInst.InstType.op_mov, opr1, CFGInstAddr.newRegAddr(-5)); return; } else if (op == CFGInst.InstType.op_mult && opr2 != null){ genNASMInst(CFGInst.InstType.op_mov, CFGInstAddr.newRegAddr(-4), opr1); genNASMInst(NASMInst.InstType.CQO, null, null); genNASMInst(CFGInst.InstType.op_mult, opr2, null); genNASMInst(CFGInst.InstType.op_mov, opr1, CFGInstAddr.newRegAddr(-4)); return; } NASMWordType wt1, wt2; wt1 = NASMWordType.QWORD; if (op == CFGInst.InstType.op_lea) wt2 = NASMWordType.WORD; else wt2 = NASMWordType.QWORD; NASMAddr a2 = getNASMAddr(opr2, wt2); NASMAddr a1 = getNASMAddr(opr1, wt1); if (op == CFGInst.InstType.op_mov && a1.equals(a2)) return; switch (op){ case op_wpara: if (opr2.getNum()<6) genNASMInst(NASMInst.InstType.MOV, new NASMRegAddr(new NASMReg(parameterReg[opr2.getNum()], NASMWordType.QWORD)), a1); else { genNASMInst(NASMInst.InstType.PUSH, a1, null); parameterStackOffset += NASMWordType.getSize(wt1); } break; case op_rpara: if (opr2.getNum() >= 6){ if (opr1.a_type == CFGInstAddr.addrType.a_reg) genNASMInst(CFGInst.InstType.op_mov, opr1, new CFGInstAddr(CFGInstAddr.addrType.a_mem,-1,0,0,8+(opr2.getNum()-5)*8)); else opr1.lit4 = 8 + (opr2.getNum() - 5)* 8; } else genNASMInst(NASMInst.InstType.MOV, a1, new NASMRegAddr(new NASMReg(parameterReg[opr2.getNum()], NASMWordType.QWORD))); break; case op_return: if (curStackOffset != 0) genNASMInst(NASMInst.InstType.ADD, new NASMRegAddr(20, NASMWordType.QWORD), new NASMImmAddr(curStackOffset)); popCalleeSavedReg(); genNASMInst(getNASMOp(op), a1, a2); break; case op_shl: case op_shr: if (opr2.a_type != CFGInstAddr.addrType.a_imm){ genNASMInst(NASMInst.InstType.MOV, new NASMRegAddr(18, NASMWordType.QWORD), a2); if (op == CFGInst.InstType.op_shl) genNASMInst(NASMInst.InstType.SAL, a1, new NASMRegAddr(18, NASMWordType.BYTE)); else genNASMInst(NASMInst.InstType.SAR, a1, new NASMRegAddr(18, NASMWordType.BYTE)); } else genNASMInst(getNASMOp(op), a1, a2); break; case op_call: if (opr1.a_type == CFGInstAddr.addrType.a_label && opr1.strLit.startsWith("_lib_")){ for (int i : callerSaveReg) { curCallerSavedReg.push(i); } pushCallerSavedReg(); } genNASMInst(getNASMOp(op), a1, a2); if (parameterStackOffset > 0){ genNASMInst(NASMInst.InstType.ADD, new NASMRegAddr(20, NASMWordType.QWORD), new NASMImmAddr(parameterStackOffset)); parameterStackOffset = 0; } if (opr1.a_type == CFGInstAddr.addrType.a_label && opr1.strLit.startsWith("_lib_")){ popCallerSavedReg(); } break; default: genNASMInst(getNASMOp(op), a1, a2); } } private void genNASMInst(NASMInst.InstType op, NASMAddr opr1, NASMAddr opr2) { NASMInst inst = new NASMInst(op, opr1, opr2); instList.add(inst); nasm.genText(inst.toString()); } private void pushCalleeSavedReg() { for (Integer i : curCalleeSavedReg) { genNASMInst(NASMInst.InstType.PUSH, new NASMRegAddr(new NASMReg(i, NASMWordType.QWORD)), null); } } private void popCalleeSavedReg() { while(!curCalleeSavedReg.empty()){ int i = curCalleeSavedReg.pop(); genNASMInst(NASMInst.InstType.POP, new NASMRegAddr(new NASMReg(i, NASMWordType.QWORD)), null); } } private void pushCallerSavedReg() { for (Integer i : curCallerSavedReg) { genNASMInst(NASMInst.InstType.PUSH, new NASMRegAddr(new NASMReg(i, NASMWordType.QWORD)), null); } } private void popCallerSavedReg() { while(!curCallerSavedReg.empty()){ int i = curCallerSavedReg.pop(); genNASMInst(NASMInst.InstType.POP, new NASMRegAddr(new NASMReg(i, NASMWordType.QWORD)), null); } } private NASMAddr getNASMAddr(CFGInstAddr opr, NASMWordType wt){ if (opr == null) return null; switch(opr.a_type){ case a_imm: return new NASMImmAddr(opr.getNum()); case a_label: return new NASMLabelAddr(opr.strLit); case a_mem: NASMReg base = null; NASMReg offset = null; int val = opr.getNum(); if (opr.addr1 == null){ base = new NASMReg(21, NASMWordType.QWORD); offset = null; } else { switch (opr.addr1.a_type){ case a_imm: base = null; val += opr.addr1.getNum(); break; case a_reg: base = getNASMReg(opr.addr1, NASMWordType.QWORD); break; case a_static: base = new NASMReg(opr.addr1.strLit); break; } switch (opr.addr2.a_type){ case a_reg: offset = getNASMReg(opr.addr2, NASMWordType.QWORD); break; case a_imm: offset = null; val += opr.getSize() * opr.addr2.getNum(); break; } } return new NASMMemAddr(wt, base, offset, opr.getSize(), val); case a_reg: return new NASMRegAddr(getNASMReg(opr, wt)); case a_static: return new NASMLabelAddr(opr.strLit); } return null; } private NASMReg getNASMReg(CFGInstAddr opr, NASMWordType wt){ int num = opr.getNum(); //16 RAX 19 RDX 20 RSP 21 RBP switch (num){ case 0: return null; case -1: return new NASMReg(21, NASMWordType.QWORD); case -2: return new NASMReg(16, wt); case -3: return new NASMReg(20, NASMWordType.QWORD); case -4: return new NASMReg(16, wt); case -5: return new NASMReg(19, wt); case -6: return new NASMReg(availableReg[opr.lit3], wt);//colored reg } for (int i = 0; i < templateMap.length; ++i){ if (templateMap[i] == num) return new NASMReg(templateReg[i], wt); } if (curTemplateReg == templateMap.length) curTemplateReg = 0; templateMap[curTemplateReg] = num; return new NASMReg(templateReg[curTemplateReg++], wt); } private NASMInst.InstType getNASMOp(CFGInst.InstType op){ switch (op){ case op_eq: case op_ne: case op_ge: case op_gt: case op_le: case op_lt: return NASMInst.InstType.CMP; case op_add: return NASMInst.InstType.ADD; case op_sub: return NASMInst.InstType.SUB; case op_mult: return NASMInst.InstType.IMUL; case op_div: return NASMInst.InstType.IDIV; case op_inc: return NASMInst.InstType.INC; case op_dec: return NASMInst.InstType.DEC; case op_and: return NASMInst.InstType.AND; case op_or: return NASMInst.InstType.OR; case op_xor: return NASMInst.InstType.XOR; case op_mov: return NASMInst.InstType.MOV; case op_call: return NASMInst.InstType.CALL; case op_lea: return NASMInst.InstType.LEA; case op_not: return NASMInst.InstType.NOT; case op_neg: return NASMInst.InstType.NEG; case op_shl: return NASMInst.InstType.SAL; case op_shr: return NASMInst.InstType.SAR; case op_jmp: return NASMInst.InstType.JMP; case op_jcc: // jump if false , so revOp return NASMInst.newJccRevOp(lastOp); case op_return: return NASMInst.InstType.RET; //case op_decl //case op_push //case op_pop default: return NASMInst.InstType.NOP; } } private int getExp2(int x){ int k = 1; for (; k < x; k <<= 1); return k; } }
[ "sky46262@sjtu.edu.cn" ]
sky46262@sjtu.edu.cn
19f1260fb5cb50a454831ed1945531d4af53b64f
308b01bc040a690959196fbcb61e232a46b84763
/spring/AllStreamsDemo/src/com/hcl/stream/ForEachDemo1.java
0e29c6b8c061caa7dc7838f2753c8feb46571f2a
[]
no_license
Jananisowmi/HCL-Training
33a32e4a467f0fe963ad47f3ca82ca3d7fa537ce
4d89a63c88ad6c859ade4c89cc387efd48b18ff0
refs/heads/master
2022-12-23T22:49:59.276756
2019-10-01T10:17:12
2019-10-01T10:17:12
212,051,165
0
0
null
2022-12-15T23:31:06
2019-10-01T08:50:30
JavaScript
UTF-8
Java
false
false
594
java
package com.hcl.stream; import java.util.ArrayList; import java.util.List; public class ForEachDemo1 { public static void main(String[] args) { List<Employee> list=new ArrayList<Employee>(); list.add(new Employee(10,"Apple",1010f,'E')); list.add(new Employee(20,"Banana",2020f,'M')); list.add(new Employee(30,"Carrot",3030f,'M')); list.add(new Employee(40,"Dates",4040f,'C')); list.add(new Employee(50,"Apricot",5050f,'M')); // the consumer interface list.stream().forEach((var)-> System.out.println(var.getEmpNo()+ " " +var.getEmpName()+ " " +var.getSalary())); } }
[ "jananivelu76@gmail.com" ]
jananivelu76@gmail.com
ec8ad0bc92279de6615cc3d99c00d5906b30b89b
929a2bccabbdbe43a22bd12dafda546fbbe5ea4d
/app/src/main/java/com/untref/robotica/robotcontroller/core/util/InstanceCache.java
e3b59d9ca23f004b1252ead002d3d8b74cfede42
[]
no_license
JulianMoreno2/robot-controller
c29c616561d51657dbcda3e20c1e1d27bd16e16a
7bf17201d7fc89f2731e49791dfcfef2a05d5b52
refs/heads/master
2021-01-22T01:43:35.592241
2017-11-23T21:55:31
2017-11-23T21:55:31
102,231,107
0
0
null
2017-11-23T21:58:30
2017-09-03T00:22:24
Java
UTF-8
Java
false
false
672
java
package com.untref.robotica.robotcontroller.core.util; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Supplier; public class InstanceCache { private static final Map<Class, Object> instances = new ConcurrentHashMap<>(); private static <T> T getInstanceFor(Class clazz) { return (T) instances.get(clazz); } public static <T> T getInstanceFor(Class clazz, Supplier<T> supplier) { if (!instances.containsKey(clazz)) { instances.put(clazz, supplier.get()); } return getInstanceFor(clazz); } public static void flush() { instances.clear(); } }
[ "julianezequielmoreno@gmail.com" ]
julianezequielmoreno@gmail.com
65e4a1b5d493ed6d19d23de7ebc72e99bf0d2e9f
895fc5d5ef66cef2897a298dde5c3c7cc0dd06f1
/src/test/java/tests/AbstractTest.java
7681dc4c88ec61c803734a6154a777a8d5128926
[]
no_license
VladislavLutsevich/AutoQA_Study
94700a2f83799bf762b29f5800696088f958c1ae
3e27d925282bdbb990286ef5d03bd60b425f2a06
refs/heads/master
2023-01-06T23:16:10.739207
2020-11-08T17:18:23
2020-11-08T17:18:23
296,084,556
0
0
null
null
null
null
UTF-8
Java
false
false
967
java
package tests; import by.stormnet.utils.PropertiesManager; import io.github.bonigarcia.wdm.WebDriverManager; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.testng.ITestContext; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; public abstract class AbstractTest { protected WebDriver webDriver; @BeforeMethod public void preConditions(ITestContext context) { WebDriverManager.chromedriver().setup(); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--start-maximized"); webDriver = new ChromeDriver(chromeOptions); context.setAttribute("driver", webDriver); webDriver.get(PropertiesManager.getProperty("yandex_url")); } @AfterMethod public void postConditions() { webDriver.close(); webDriver.quit(); } }
[ "vladlutsevich21@gmail.com" ]
vladlutsevich21@gmail.com
30e0bee2794165ddc92237f6a51134f24ad581e8
381f74a998e4b4aa74433c3b96c892d7aed51ca8
/spring_recursion/src/main/java/com/it/recursion/scope/bean/CircleC.java
802c21e8849d94990b23bbc04ff42cff3cdac578
[]
no_license
pi408637535/Spring_boot_Example
f7acbe717c36b2ee24650ba0ce53b9e553e2c9e3
82264f8ac4a903d124cea71e587a0f63040f93a2
refs/heads/master
2021-01-17T18:07:12.308074
2018-04-02T08:49:54
2018-04-02T08:49:54
72,806,160
3
0
null
null
null
null
UTF-8
Java
false
false
750
java
package com.it.recursion.scope.bean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** * Created by wode4 on 2016/11/17. */ @Component("scopeCircleC") @Scope("prototype") public class CircleC { @Autowired() private CircleA circleA; // @Autowired public CircleC(CircleA circleA) { this.circleA = circleA; } public CircleC() { } @Autowired public void setCircleA(@Qualifier("scopeCircleA") CircleA circleA) { this.circleA = circleA; } public void c() { circleA.a(); } }
[ "piguanghua@wordemotion.com" ]
piguanghua@wordemotion.com
61a8d676e39746a2fd643abeaa7d2564bc760f63
d65a33196a495aa0001b89e321d02fae23721eb6
/quickcall-admin/src/main/java/com/calf/cn/getui/advancedpushmessage/GetUserTagsDemo.java
4f92455459a8056ee7e49df26e52f8d3e74aa3dc
[]
no_license
zihanbobo/Repository
5c168307848d2639fef7649d4121f37c498a2e7c
db9e91931899f5ef3e5af07722ecee0aa9fb1d02
refs/heads/master
2021-10-10T08:58:19.052522
2018-11-28T13:22:10
2018-11-28T13:22:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package com.calf.cn.getui.advancedpushmessage; import com.gexin.rp.sdk.base.IPushResult; import com.gexin.rp.sdk.http.IGtPush; public class GetUserTagsDemo { static String appId = "TxzlIyCcfS9KuENjjP4ux1"; static String appKey = "rAnoicfrNX7915IxPocAL2"; static String masterSecret = "KFDNBNKAVj9bgykwvqgeA5"; static String CID = "e605a0db5ce3cca9b76b012978064940"; static String host = "http://sdk.open.api.igexin.com/apiex.htm"; public static void main(String[] args) throws Exception { getUserTags(); } public static void getUserTags() { IGtPush push = new IGtPush(host, appKey, masterSecret); IPushResult result = push.getUserTags(appId, CID); System.out.println(result.getResponse().toString()); } }
[ "liyingtang@xiaoniu.com" ]
liyingtang@xiaoniu.com
c839232b53b933f4645eae6a6a12355caf2bec9a
142a7b8dd1163d9a86e54c6c9949827178961779
/src/main/java/com/mtxsoftware/listparts/ListpartsApplication.java
4e1fffc0db3c031e447a49b56831489bb3df30f1
[]
no_license
MATiAiX/listparts
3d6a1e1544915c9b9dd332c5fd5055e3f1e96ef5
3708ab22075f65c2ffbcabbc7356a122b2290d30
refs/heads/master
2020-12-14T21:06:38.118856
2020-01-19T18:56:34
2020-01-19T18:56:34
234,868,872
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
package com.mtxsoftware.listparts; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ListpartsApplication { public static void main(String[] args) { SpringApplication.run(ListpartsApplication.class, args); } }
[ "matiaix@mail.ru" ]
matiaix@mail.ru
01ca1231f3fb62cfe0560e50d8fa9a7687f78dde
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_2912e64ca3dfdd784874188a8e4d8b952561a784/GatlingMojo/2_2912e64ca3dfdd784874188a8e4d8b952561a784_GatlingMojo_s.java
f9fa12e05ba027a9235fe6db75a30960d61e6de7
[]
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
12,436
java
/** * Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.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.excilys.ebi.gatling.mojo; import static com.excilys.ebi.gatling.ant.GatlingTask.GATLING_CLASSPATH_REF_NAME; import static java.util.Arrays.asList; import static org.codehaus.plexus.util.StringUtils.join; import static org.codehaus.plexus.util.StringUtils.stripEnd; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.apache.tools.ant.BuildEvent; import org.apache.tools.ant.BuildListener; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.types.Commandline; import org.apache.tools.ant.types.Path; import com.excilys.ebi.gatling.ant.GatlingTask; import com.excilys.ebi.gatling.app.OptionsConstants; /** * Mojo to execute Gatling. * * @author <a href="mailto:nicolas.huray@gmail.com">Nicolas Huray</a> * @goal execute * @phase integration-test * @description Gatling Maven Plugin */ public class GatlingMojo extends AbstractMojo { public static final String[] DEFAULT_INCLUDES = { "**/*.scala" }; /** * Runs simulation but does not generate reports. By default false. * * @parameter expression="${gatling.noReports}" alias="nr" * default-value="false" * @description Runs simulation but does not generate reports */ protected boolean noReports; /** * Generates the reports for the simulation in this folder. * * @parameter expression="${gatling.reportsOnly}" alias="ro" * @description Generates the reports for the simulation in this folder */ protected File reportsOnly; /** * Uses this file as the configuration file. * * @parameter expression="${gatling.configFile}" alias="cf" * default-value="${basedir}/src/main/resources/gatling.conf" * @description Uses this file as the configuration file */ protected File configFile; /** * Uses this folder to discover simulations that could be run * * @parameter expression="${gatling.simulationsFolder}" alias="sf" * default-value="${basedir}/src/main/resources/simulations" * @description Uses this folder to discover simulations that could be run */ protected File simulationsFolder; /** * Sets the list of include patterns to use in directory scan for * simulations. Relative to simulationsFolder. * * @parameter * @description Include patterns to use in directory scan for simulations */ protected List<String> includes; /** * Sets the list of exclude patterns to use in directory scan for * simulations. Relative to simulationsFolder. * * @parameter * @description Exclude patterns to use in directory scan for simulations */ protected List<String> excludes; /** * A comma-separated list of simulations to run. This takes precedence over * the includes / excludes parameters. * * @parameter expression="${gatling.simulations}" alias="s" * @description A comma-separated list of simulations to run */ protected String simulations; /** * Uses this folder as the folder where feeders are stored * * @parameter expression="${gatling.dataFolder}" alias="df" * default-value="${basedir}/src/main/resources/data" * @description Uses this folder as the folder where feeders are stored */ protected File dataFolder; /** * Uses this folder as the folder where request bodies are stored * * @parameter expression="${gatling.requestBodiesFolder}" alias="bf" * default-value="${basedir}/src/main/resources/request-bodies" * @description Uses this folder as the folder where request bodies are * stored */ protected File requestBodiesFolder; /** * Uses this folder as the folder where results are stored * * @parameter expression="${gatling.resultsFolder}" alias="rf" * default-value="${basedir}/target/gatling/results" * @description Uses this folder as the folder where results are stored */ protected File resultsFolder; /** * Extra JVM arguments to pass when running Gatling. * * @parameter */ protected List<String> jvmArgs; /** * Will cause the project build to look successful, rather than fail, even * if there are Gatling test failures. This can be useful on a continuous * integration server, if your only option to be able to collect output * files, is if the project builds successfully. * * @parameter expression="${gatling.failOnError}" */ protected boolean failOnError = true; /** * The Maven Project * * @parameter expression="${project}" * @required * @readonly */ protected MavenProject mavenProject; /** * The plugin dependencies. * * @parameter expression="${plugin.artifacts}" * @required * @readonly */ protected List<Artifact> pluginArtifacts; /** * Executes Gatling simulations. */ public void execute() throws MojoExecutionException { // Prepare environment prepareEnvironment(); GatlingTask gatling = gatling(gatlingArgs(), jvmArgs()); try { gatling.execute(); } catch (Exception e) { if (failOnError) { throw new MojoExecutionException("Gatling failed.", e); } } } protected void prepareEnvironment() throws MojoExecutionException { // Create results directories resultsFolder.mkdirs(); } public GatlingTask gatling(List<String> args, List<String> jvmArgs) throws MojoExecutionException { GatlingTask gatling = new GatlingTask(); gatling.setProject(getProject()); // Set Gatling Arguments for (String arg : args) { if (arg != null) { Commandline.Argument argument = gatling.createArg(); argument.setValue(arg); } } // Set JVM Arguments for (String jvmArg : jvmArgs) { if (jvmArg != null) { Commandline.Argument argument = gatling.createJvmarg(); argument.setValue(jvmArg); } } return gatling; } protected List<String> jvmArgs() { return (jvmArgs != null) ? jvmArgs : Collections.<String> emptyList(); } protected List<String> gatlingArgs() throws MojoExecutionException { try { // Solves the simulations, if no simulation file is defined if (simulations == null) { simulations = resolveSimulations(simulationsFolder, includes, excludes); } if (simulations.length() == 0) { getLog().error("No simulations to run"); throw new MojoFailureException("No simulations to run"); } // Arguments List<String> args = new ArrayList<String>(); args.addAll(asList("-" + OptionsConstants.CONFIG_FILE_OPTION, configFile.getCanonicalPath(),// "-" + OptionsConstants.DATA_FOLDER_OPTION, dataFolder.getCanonicalPath(),// "-" + OptionsConstants.RESULTS_FOLDER_OPTION, resultsFolder.getCanonicalPath(),// "-" + OptionsConstants.REQUEST_BODIES_FOLDER_OPTION, requestBodiesFolder.getCanonicalPath(),// "-" + OptionsConstants.SIMULATIONS_FOLDER_OPTION, simulationsFolder.getCanonicalPath(),// "-" + OptionsConstants.SIMULATIONS_OPTION, simulations)); if (noReports) { args.add("-" + OptionsConstants.NO_REPORTS_OPTION); } if (reportsOnly != null) { args.addAll(asList("-" + OptionsConstants.REPORTS_ONLY_OPTION, reportsOnly.getCanonicalPath())); } return args; } catch (Exception e) { throw new MojoExecutionException("Gatling failed.", e); } } protected String fileNametoClassName(String fileName) { return stripEnd(fileName, ".scala").replace(File.separatorChar, '.'); } /** * Resolve simulation files to execute from the simulation folder and * includes/excludes. * * @return a comma separated String of simulation class names. */ protected String resolveSimulations(File simulationsFolder, List<String> includes, List<String> excludes) { DirectoryScanner scanner = new DirectoryScanner(); // Set Base Directory getLog().debug("effective simulationsFolder: " + simulationsFolder.getPath()); scanner.setBasedir(simulationsFolder); // Resolve includes if (includes != null && !includes.isEmpty()) { scanner.setIncludes(includes.toArray(new String[includes.size()])); } else { scanner.setIncludes(DEFAULT_INCLUDES); } // Resolve excludes if (excludes != null && !excludes.isEmpty()) { scanner.setExcludes(excludes.toArray(new String[excludes.size()])); } // Resolve simulations to execute scanner.scan(); String[] includedFiles = scanner.getIncludedFiles(); List<String> includedClassNames = new ArrayList<String>(includedFiles.length); for (String includedFile : includedFiles) { includedClassNames.add(fileNametoClassName(includedFile)); } getLog().debug("resolved simulation classes: " + includedClassNames); return join(includedClassNames.iterator(), ","); } protected Project getProject() throws MojoExecutionException { Project project = new Project(); project.setBaseDir(mavenProject.getBasedir()); project.addBuildListener(new LogAdapter()); try { Path classpath = new Path(project); append(classpath, pluginArtifacts); // Add jars classpath.setPath(configFile.getParent()); // Set dirname of config // file into the // classpath getLog().debug("Gatling classpath : " + classpath); project.addReference(GATLING_CLASSPATH_REF_NAME, classpath); return project; } catch (DependencyResolutionRequiredException e) { throw new MojoExecutionException("Error resolving dependencies", e); } } protected void append(Path classPath, List<?> artifacts) throws DependencyResolutionRequiredException { List<String> list = new ArrayList<String>(artifacts.size()); for (Object artifact : artifacts) { String path; if (artifact instanceof Artifact) { Artifact a = (Artifact) artifact; File file = a.getFile(); if (file == null) { throw new DependencyResolutionRequiredException(a); } path = file.getPath(); } else { path = artifact.toString(); } list.add(path); } Path p = new Path(classPath.getProject()); p.setPath(join(list.iterator(), File.pathSeparator)); classPath.append(p); } public class LogAdapter implements BuildListener { public void buildStarted(BuildEvent event) { log(event); } public void buildFinished(BuildEvent event) { log(event); } public void targetStarted(BuildEvent event) { log(event); } public void targetFinished(BuildEvent event) { log(event); } public void taskStarted(BuildEvent event) { log(event); } public void taskFinished(BuildEvent event) { log(event); } public void messageLogged(BuildEvent event) { log(event); } private void log(BuildEvent event) { int priority = event.getPriority(); Log log = getLog(); String message = event.getMessage(); switch (priority) { case Project.MSG_ERR: log.error(message); break; case Project.MSG_WARN: log.warn(message); break; case Project.MSG_INFO: log.info(message); break; case Project.MSG_VERBOSE: log.debug(message); break; case Project.MSG_DEBUG: log.debug(message); break; default: log.info(message); break; } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
40a910bc975c05ae5f1d8e911979d16cc10246fb
ea0bf133bc4f18e5d1419ab6231196b470934d60
/imagepicker/src/main/java/com/stevexls/imagepicker/collection/MediaCollection.java
cac65c224d12add74e72ba00a1d64ae14234675e
[ "Apache-2.0" ]
permissive
Stevexls/ImagePicker-master
5d660277750f4a23a66789a998c42b473d5818b5
f89805d734bd02d3f8efeb40b6630b34d0798d9f
refs/heads/master
2020-07-16T13:43:27.985231
2019-09-30T10:02:02
2019-09-30T10:02:02
205,792,475
0
0
null
null
null
null
UTF-8
Java
false
false
3,775
java
package com.stevexls.imagepicker.collection; import android.content.Context; import android.database.Cursor; import android.os.Bundle; import android.provider.MediaStore; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; import android.support.v7.app.AppCompatActivity; import com.stevexls.imagepicker.bean.Album; import com.stevexls.imagepicker.bean.SelectionSpec; /** * Time:2019/4/29 11:31 * Description: 图片收集 */ public class MediaCollection extends BaseMediaCollection { private static final int LOADER_ID = 2; // 加载所有图片 private boolean isLoadFinished; public void onCreate(AppCompatActivity activity, MediaCallbacks mediaCallbacks) { super.onCreate(activity, mediaCallbacks); isLoadFinished = false; } public void loadMedia(Album target) { isLoadFinished = false; Bundle args = new Bundle(); args.putParcelable(ARGS_ALBUM, target); // 如果加载器已经存在,则重启;否则创建一个新的 if (loaderManager.getLoader(LOADER_ID) != null) { loaderManager.restartLoader(LOADER_ID, args, this); } else { loaderManager.initLoader(LOADER_ID, args, this); } } @NonNull @Override public Loader<Cursor> onCreateLoader(int i, @Nullable Bundle bundle) { Context context = mContext.get(); if (context == null || bundle == null) { return null; } Album album = bundle.getParcelable(ARGS_ALBUM); if (album == null) { return null; } String selection; String[] selectionArgs; if (album.isAll()) { // 如果显示所有图片 if (SelectionSpec.getInstance().onlyShowImages()) { // 只显示图片 selection = SELECTION_ALL_FOR_SINGLE_MEDIA_TYPE; selectionArgs = getSelectionArgsForSingleMediaType(MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE); } else if (SelectionSpec.getInstance().onlyShowVideos()) { // 只显示视频 selection = SELECTION_ALL_FOR_SINGLE_MEDIA_TYPE; selectionArgs = getSelectionArgsForSingleMediaType(MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO); } else { // 显示图片和视频 selection = SELECTION_ALL; selectionArgs = SELECTION_ALL_ARGS; } } else if (album.isVideo()) { // 显示所有视频 selection = SELECTION_ALL_FOR_SINGLE_MEDIA_TYPE; selectionArgs = getSelectionArgsForSingleMediaType(MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO); } else { // 显示所有图片 selection = SELECTION_ALBUM_FOR_SINGLE_MEDIA_TYPE; selectionArgs = getSelectionAlbumArgsForSingleMediaType(MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE, album.getBucketId()); } return new CursorLoader(context, QUERY_URI, PROJECTION, selection, selectionArgs, ORDER_BY); } @Override public void onLoadFinished(@NonNull Loader<Cursor> loader, Cursor cursor) { if (mContext.get() == null) { return; } if (!isLoadFinished) { isLoadFinished = true; mediaCallbacks.onMediaLoad(cursor); } } @Override public void onLoaderReset(@NonNull Loader<Cursor> loader) { if (mContext.get() == null) { return; } mediaCallbacks.onMediaReset(); } public void onDestroy() { if (loaderManager != null) { loaderManager.destroyLoader(LOADER_ID); } mediaCallbacks = null; } }
[ "592172833@qq.com" ]
592172833@qq.com
eda42b088234dcc3ca39f7e310a4100a4e99fcab
c791461f140f439fe4ea36ec1a2af5879f789d89
/src/main/java/br/myrest/app/controller/CandidatoController.java
32ccbdbd50f4051f8bac86c135c024a2274c50f2
[]
no_license
EduardoAndradeSantos/becajava.rest
409f62e691de8bc8d27162886a3e022554d10999
84962f8dc428fd505e96030d39af6da9ce6ef698
refs/heads/master
2023-01-04T15:22:56.807863
2020-11-04T20:01:57
2020-11-04T20:01:57
310,105,135
0
0
null
null
null
null
UTF-8
Java
false
false
2,185
java
package br.myrest.app.controller; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import br.myrest.app.model.*; import java.util.ArrayList; import java.util.List; @RestController @RequestMapping("/Candidatos") public class CandidatoController { // CRIAR - POST @PostMapping public ResponseEntity criar(@RequestBody Candidato candidato) { if (candidato.getNome() == "") return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Candidato não informado."); else if (candidato.getNumero() <= 0) return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Numero de candidato não informado."); else if (candidato.getTipo() == "") return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Tipo de candidato não informado."); else return ResponseEntity.status(HttpStatus.CREATED).body("Candidato criado com sucesso!"); } // PEGA UM - GET @GetMapping(path = "/{id}") public ResponseEntity byId(@PathVariable Long id) { Candidato obj = new Candidato(); obj.setNome("Paulinho da viola"); obj.setNumero(23); obj.setTipo("Vereador"); return ResponseEntity.status(HttpStatus.OK).body(obj); } // PEGA VARIOS - GET @GetMapping public ResponseEntity listar() { List<Candidato> lista = new ArrayList<Candidato>(); Candidato obj = new Candidato(); obj.setNome("Paulinho da viola"); obj.setNumero(23); obj.setTipo("Vereador"); lista.add(obj); obj = new Candidato(); obj.setNome("Toninho pipoqueiro"); obj.setNumero(45); obj.setTipo("Vereador"); lista.add(obj); obj = new Candidato(); obj.setNome("Vanessa do gas"); obj.setNumero(56); obj.setTipo("Vereador"); lista.add(obj); return ResponseEntity.status(HttpStatus.OK).body(lista); } // ATUALIZA - PUT @PutMapping(path = "/{id}") public ResponseEntity atualizar(@RequestBody Candidato candidato, @PathVariable Long id) { return ResponseEntity.status(HttpStatus.OK).body(candidato); } // DELETA - DELET @DeleteMapping(path = "/{id}") public ResponseEntity delete(@PathVariable Long id) { return ResponseEntity.status(HttpStatus.NO_CONTENT).build(); } }
[ "eandrasa@everis.com" ]
eandrasa@everis.com
743cf77c768c1f6b9bcda19474780b5cb874124b
a35c43de387f35574b6fd885f10348df88650a4f
/spring-annotation/src/main/java/com/xue/bean/Color.java
caf152f3f193fdd43ef1188706a03a2e41ff994c
[]
no_license
xuesong8768/spring-annotation
9fe4c8f8916fb8d7e47b30bf5bb7a2c18596c10e
8307c922a606375cc2ac39ed7cac134c792eefd9
refs/heads/master
2021-07-04T23:16:24.760748
2019-06-15T02:12:45
2019-06-15T02:12:45
192,025,787
0
0
null
null
null
null
UTF-8
Java
false
false
96
java
package com.xue.bean; /** * @author xuesong <songxue@wisedu.com> */ public class Color { }
[ "1205433692@qq.com" ]
1205433692@qq.com
06e1a9bb622e07272fb257267e957a95b2a03f8f
33dea6a6e7f877f93a9db9969c1fcc2c35336af4
/app/src/main/java/com/example/avma1997/tmdb/MovieResponse.java
481bc65b1e477e3f846ef206fa89fd7ca77d8f3d
[]
no_license
akashagra/TheMovieDB
b0d64dbfd93da8e02595c86c4f5b24f7f6cdd00f
d436c28fb7511cda4042b7cf5d4bbb691017b1fb
refs/heads/master
2021-01-23T22:19:04.055643
2017-10-25T19:30:43
2017-10-25T19:30:43
102,925,615
0
0
null
null
null
null
UTF-8
Java
false
false
450
java
package com.example.avma1997.tmdb; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; /** * Created by Avma1997 on 7/19/2017. */ public class MovieResponse { @SerializedName("results") private ArrayList<Moviedb> movieList; public ArrayList<Moviedb> getMovieList() { return movieList; } public void setMovieList(ArrayList<Moviedb> movieList) { this.movieList = movieList; } }
[ "akashagrawalbest@gmail.com" ]
akashagrawalbest@gmail.com
a13ec4759f25dd5d507d18b6789b2d82009ebb00
699cf1de4d7841fabc1993866c5d4233dfdb62de
/src/test/java/com/sebastian_daschner/jaxrs_analyzer/backend/asciidoc/AsciiDocBackendTest.java
762f573310a615a664548670a1c37eeb3825b3e1
[ "Apache-2.0" ]
permissive
jforge/jaxrs-analyzer
120876d3cc8bea1fb4f07b07c884426ca899cbf6
b6b338036d34a20b7dcd702ba4fea432a8705746
refs/heads/master
2021-01-14T11:40:28.147257
2015-06-23T04:47:37
2015-06-23T04:47:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,814
java
package com.sebastian_daschner.jaxrs_analyzer.backend.asciidoc; import com.sebastian_daschner.jaxrs_analyzer.builder.ResourceMethodBuilder; import com.sebastian_daschner.jaxrs_analyzer.builder.ResourcesBuilder; import com.sebastian_daschner.jaxrs_analyzer.builder.ResponseBuilder; import com.sebastian_daschner.jaxrs_analyzer.model.rest.HttpMethod; import com.sebastian_daschner.jaxrs_analyzer.model.rest.Project; import com.sebastian_daschner.jaxrs_analyzer.model.rest.Resources; import com.sebastian_daschner.jaxrs_analyzer.model.rest.TypeRepresentation; import junit.framework.TestCase; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import javax.json.Json; import java.util.Collection; import java.util.LinkedList; @RunWith(Parameterized.class) public class AsciiDocBackendTest extends TestCase { private final AsciiDocBackend cut; private final Resources resources; private final String expectedOutput; public AsciiDocBackendTest(final Resources resources, final String expectedOutput) { cut = new AsciiDocBackend(); this.resources = resources; this.expectedOutput = expectedOutput; } @Test public void test() { final Project project = new Project("project name", "1.0", "domain.tld", resources); final String actualOutput = cut.render(project); assertEquals(expectedOutput, actualOutput); } @Parameterized.Parameters public static Collection<Object[]> data() { final Collection<Object[]> data = new LinkedList<>(); TypeRepresentation representation; add(data, ResourcesBuilder.withBase("rest").andResource("res1", ResourceMethodBuilder.withMethod(HttpMethod.GET) .andResponse(200, ResponseBuilder.withResponseBody(new TypeRepresentation("java.lang.String")).andHeaders("Location").build()).build()).build(), "= REST resources of project name\n" + "1.0\n" + "\n" + "== `GET rest/res1`\n" + "\n" + "=== Request\n" + "_No body_ + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `200 OK`\n" + "*Header*: `Location` + \n" + "*Response Body*: (`java.lang.String`) + \n\n"); representation = new TypeRepresentation("javax.json.JsonObject"); representation.getRepresentations().put("application/json", Json.createObjectBuilder().add("key", "string").add("another", 0).build()); add(data, ResourcesBuilder.withBase("rest") .andResource("res1", ResourceMethodBuilder.withMethod(HttpMethod.GET) .andResponse(200, ResponseBuilder.withResponseBody(representation).build()).build()).build(), "= REST resources of project name\n" + "1.0\n" + "\n" + "== `GET rest/res1`\n" + "\n" + "=== Request\n" + "_No body_ + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `200 OK`\n" + "*Response Body*: (`javax.json.JsonObject`) + \n" + "`application/json`: `{\"key\":\"string\",\"another\":0}` + \n\n"); representation = new TypeRepresentation("javax.json.JsonObject"); representation.getRepresentations().put("application/json", Json.createArrayBuilder().add(Json.createObjectBuilder().add("key", "string").add("another", 0)).build()); add(data, ResourcesBuilder.withBase("rest") .andResource("res1", ResourceMethodBuilder.withMethod(HttpMethod.GET) .andResponse(200, ResponseBuilder.withResponseBody(representation).build()).build()).build(), "= REST resources of project name\n" + "1.0\n" + "\n" + "== `GET rest/res1`\n" + "\n" + "=== Request\n" + "_No body_ + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `200 OK`\n" + "*Response Body*: (`javax.json.JsonObject`) + \n" + "`application/json`: `[{\"key\":\"string\",\"another\":0}]` + \n\n"); representation = new TypeRepresentation("javax.json.JsonArray"); representation.getRepresentations().put("application/json", Json.createArrayBuilder().add("string").add(0).build()); representation.getRepresentations().put("application/xml", Json.createArrayBuilder().add("string").add(0).build()); add(data, ResourcesBuilder.withBase("rest") .andResource("res1", ResourceMethodBuilder.withMethod(HttpMethod.GET) .andResponse(200, ResponseBuilder.withResponseBody(representation).build()).build()).build(), "= REST resources of project name\n" + "1.0\n" + "\n" + "== `GET rest/res1`\n" + "\n" + "=== Request\n" + "_No body_ + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `200 OK`\n" + "*Response Body*: (`javax.json.JsonArray`) + \n" + "`application/xml`: `[\"string\",0]` + \n" + "`application/json`: `[\"string\",0]` + \n\n"); representation = new TypeRepresentation("javax.json.JsonArray"); representation.getRepresentations().put("application/json", Json.createArrayBuilder().add(Json.createObjectBuilder().add("key", "string")).add(Json.createObjectBuilder().add("key", "string")).build()); add(data, ResourcesBuilder.withBase("rest") .andResource("res1", ResourceMethodBuilder.withMethod(HttpMethod.GET) .andResponse(200, ResponseBuilder.withResponseBody(representation).build()).build()).build(), "= REST resources of project name\n" + "1.0\n" + "\n" + "== `GET rest/res1`\n" + "\n" + "=== Request\n" + "_No body_ + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `200 OK`\n" + "*Response Body*: (`javax.json.JsonArray`) + \n" + "`application/json`: `[{\"key\":\"string\"},{\"key\":\"string\"}]` + \n\n"); representation = new TypeRepresentation("de.sebastian_daschner.test.Model"); representation.getRepresentations().put("application/json", Json.createObjectBuilder().add("name", "string").add("value", 0).build()); add(data, ResourcesBuilder.withBase("rest") .andResource("res1", ResourceMethodBuilder.withMethod(HttpMethod.GET) .andResponse(200, ResponseBuilder.withResponseBody(representation).build()).build()).build(), "= REST resources of project name\n" + "1.0\n" + "\n" + "== `GET rest/res1`\n" + "\n" + "=== Request\n" + "_No body_ + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `200 OK`\n" + "*Response Body*: (`de.sebastian_daschner.test.Model`) + \n" + "`application/json`: `{\"name\":\"string\",\"value\":0}` + \n\n"); representation = new TypeRepresentation("de.sebastian_daschner.test.Model"); representation.getRepresentations().put("application/json", Json.createArrayBuilder().add(Json.createObjectBuilder().add("name", "string").add("value", 0)).build()); add(data, ResourcesBuilder.withBase("rest") .andResource("res1", ResourceMethodBuilder.withMethod(HttpMethod.POST).andRequestBodyType(representation).andAcceptMediaTypes("application/json") .andResponse(201, ResponseBuilder.newBuilder().andHeaders("Location").build()).build()).build(), "= REST resources of project name\n" + "1.0\n" + "\n" + "== `POST rest/res1`\n" + "\n" + "=== Request\n" + "*Content-Type*: `application/json` + \n" + "*Request Body*: (`de.sebastian_daschner.test.Model`) + \n" + "`application/json`: `[{\"name\":\"string\",\"value\":0}]` + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `201 Created`\n" + "*Header*: `Location` + \n\n"); add(data, ResourcesBuilder.withBase("rest") .andResource("res1", ResourceMethodBuilder.withMethod(HttpMethod.POST).andRequestBodyType(representation).andAcceptMediaTypes("application/json") .andResponse(201, ResponseBuilder.newBuilder().andHeaders("Location").build()).build()) .andResource("res2", ResourceMethodBuilder.withMethod(HttpMethod.GET).andResponse(200, ResponseBuilder.newBuilder().build()).build()).build(), "= REST resources of project name\n" + "1.0\n" + "\n" + "== `POST rest/res1`\n" + "\n" + "=== Request\n" + "*Content-Type*: `application/json` + \n" + "*Request Body*: (`de.sebastian_daschner.test.Model`) + \n" + "`application/json`: `[{\"name\":\"string\",\"value\":0}]` + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `201 Created`\n" + "*Header*: `Location` + \n\n" + "== `GET rest/res2`\n" + "\n" + "=== Request\n" + "_No body_ + \n" + "\n" + "=== Response\n" + "*Content-Type*: `\\*/*`\n" + "\n" + "==== `200 OK`\n\n"); return data; } public static void add(final Collection<Object[]> data, final Resources resources, final String output) { final Object[] objects = new Object[2]; objects[0] = resources; objects[1] = output; data.add(objects); } }
[ "git@sebastian-daschner.de" ]
git@sebastian-daschner.de
0cd517e9992bf3230ed9ca5ee97917755928abac
34f078815d2fcde8e9a6b056e8218338f9e49c62
/my-java/src/main/java/com/coldface/code/concurrent/threadpool/Test.java
d0406c57ee402174aff970d4d68b716006153443
[]
no_license
jackzhao29/JavaObject-Practice
af0296792b9305d187329eec864bf62b7445738f
068149bae48096263567a093162b6f2b6d95356e
refs/heads/master
2021-03-27T11:07:12.393403
2017-12-17T13:00:38
2017-12-17T13:00:38
39,983,419
1
0
null
null
null
null
UTF-8
Java
false
false
2,361
java
package com.coldface.code.concurrent.threadpool; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; /** * 线程池 * @author coldface * */ public class Test { public static void main(String[] args) { // TODO Auto-generated method stub //创建一个可固定线程数的线程池 //ExecutorService pool=Executors.newFixedThreadPool(2); //创建一个使用单个work线程的Executor ExecutorService signPool=Executors.newSingleThreadExecutor(); //创建可变大小的线程池 //ExecutorService cachePool=Executors.newCachedThreadPool(); //定时任务线程池 //ScheduledExecutorService scheduledPool=Executors.newScheduledThreadPool(3); //单线程定时任务线程池 ScheduledExecutorService scheduledSinglePool=Executors.newSingleThreadScheduledExecutor(); //创建实现了Thread或者Runnable接口对象 Thread t1=new MyThread("t1"); Thread t2=new MyThread("t2"); Thread t3=new MyThread("t3"); Thread t4=new MyThread("t4"); Thread t5=new MyThread("t5"); //将线程放入线程池中进行执行 /** pool.execute(t1); pool.execute(t2); pool.execute(t3); pool.execute(t4); pool.execute(t5); **/ //将线程放入单个work线程中 /** signPool.execute(t1); signPool.execute(t2); signPool.execute(t3); signPool.execute(t4); signPool.execute(t5); **/ //将线程放入可变大小的线程池中 /** cachePool.execute(t5); cachePool.execute(t2); cachePool.execute(t3); cachePool.execute(t4); cachePool.execute(t1); **/ //将线程放入定时任务线程池中 /** scheduledPool.execute(t1); scheduledPool.execute(t2); scheduledPool.execute(t5); //延迟执行 scheduledPool.schedule(t4, 2000, TimeUnit.MICROSECONDS); scheduledPool.schedule(t3, 1000, TimeUnit.MICROSECONDS); **/ //将线程放入单线程定时任务线程池中 scheduledSinglePool.execute(t1); scheduledSinglePool.execute(t2); scheduledSinglePool.execute(t5); //延迟执行 scheduledSinglePool.schedule(t4, 2000, TimeUnit.MICROSECONDS); //关闭线程池 //pool.shutdown(); //signPool.shutdown(); //cachePool.shutdown(); //scheduledPool.shutdown(); scheduledSinglePool.shutdown(); } }
[ "jack.zhao829@gmail.com" ]
jack.zhao829@gmail.com
a4dab936cb3b2e9e9f4f0984076bb20c6aa18c44
00927c4299d6a579aec5b9ec4d24c56b5e854a85
/build/tmp/expandedArchives/forge-1.16.1-32.0.63_mapped_snapshot_20200707-1.16.1-sources.jar_8d0cc9b90400e5fca82470166432cd30/net/minecraft/entity/monster/SpiderEntity.java
a12acd22954316198dbc4ce3de7adf7f836edb7d
[]
no_license
NguyenVux/Future-Combat
99a5bdbefe7c8e588cce070a06321a13f4f4891b
c25fa63494a48a5aa4391014ee117e7c8b4f5079
refs/heads/master
2022-12-02T09:03:32.402698
2020-07-30T14:34:23
2020-07-30T14:34:23
278,262,671
0
0
null
null
null
null
UTF-8
Java
false
false
9,552
java
package net.minecraft.entity.monster; import java.util.Random; import javax.annotation.Nullable; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.CreatureAttribute; import net.minecraft.entity.EntitySize; import net.minecraft.entity.EntityType; import net.minecraft.entity.ILivingEntityData; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.Pose; import net.minecraft.entity.SpawnReason; import net.minecraft.entity.ai.attributes.AttributeModifierMap; import net.minecraft.entity.ai.attributes.Attributes; import net.minecraft.entity.ai.goal.HurtByTargetGoal; import net.minecraft.entity.ai.goal.LeapAtTargetGoal; import net.minecraft.entity.ai.goal.LookAtGoal; import net.minecraft.entity.ai.goal.LookRandomlyGoal; import net.minecraft.entity.ai.goal.MeleeAttackGoal; import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal; import net.minecraft.entity.ai.goal.SwimGoal; import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal; import net.minecraft.entity.passive.IronGolemEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.pathfinding.ClimberPathNavigator; import net.minecraft.pathfinding.PathNavigator; import net.minecraft.potion.Effect; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; import net.minecraft.util.DamageSource; import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.Difficulty; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.IWorld; import net.minecraft.world.World; public class SpiderEntity extends MonsterEntity { private static final DataParameter<Byte> CLIMBING = EntityDataManager.createKey(SpiderEntity.class, DataSerializers.BYTE); public SpiderEntity(EntityType<? extends SpiderEntity> type, World worldIn) { super(type, worldIn); } protected void registerGoals() { this.goalSelector.addGoal(1, new SwimGoal(this)); this.goalSelector.addGoal(3, new LeapAtTargetGoal(this, 0.4F)); this.goalSelector.addGoal(4, new SpiderEntity.AttackGoal(this)); this.goalSelector.addGoal(5, new WaterAvoidingRandomWalkingGoal(this, 0.8D)); this.goalSelector.addGoal(6, new LookAtGoal(this, PlayerEntity.class, 8.0F)); this.goalSelector.addGoal(6, new LookRandomlyGoal(this)); this.targetSelector.addGoal(1, new HurtByTargetGoal(this)); this.targetSelector.addGoal(2, new SpiderEntity.TargetGoal<>(this, PlayerEntity.class)); this.targetSelector.addGoal(3, new SpiderEntity.TargetGoal<>(this, IronGolemEntity.class)); } /** * Returns the Y offset from the entity's position for any entity riding this one. */ public double getMountedYOffset() { return (double)(this.getHeight() * 0.5F); } /** * Returns new PathNavigateGround instance */ protected PathNavigator createNavigator(World worldIn) { return new ClimberPathNavigator(this, worldIn); } protected void registerData() { super.registerData(); this.dataManager.register(CLIMBING, (byte)0); } /** * Called to update the entity's position/logic. */ public void tick() { super.tick(); if (!this.world.isRemote) { this.setBesideClimbableBlock(this.collidedHorizontally); } } public static AttributeModifierMap.MutableAttribute func_234305_eI_() { return MonsterEntity.func_234295_eP_().func_233815_a_(Attributes.MAX_HEALTH, 16.0D).func_233815_a_(Attributes.MOVEMENT_SPEED, (double)0.3F); } protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_SPIDER_AMBIENT; } protected SoundEvent getHurtSound(DamageSource damageSourceIn) { return SoundEvents.ENTITY_SPIDER_HURT; } protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_SPIDER_DEATH; } protected void playStepSound(BlockPos pos, BlockState blockIn) { this.playSound(SoundEvents.ENTITY_SPIDER_STEP, 0.15F, 1.0F); } /** * Returns true if this entity should move as if it were on a ladder (either because it's actually on a ladder */ public boolean isOnLadder() { return this.isBesideClimbableBlock(); } public void setMotionMultiplier(BlockState state, Vector3d motionMultiplierIn) { if (!state.isIn(Blocks.COBWEB)) { super.setMotionMultiplier(state, motionMultiplierIn); } } public CreatureAttribute getCreatureAttribute() { return CreatureAttribute.ARTHROPOD; } public boolean isPotionApplicable(EffectInstance potioneffectIn) { if (potioneffectIn.getPotion() == Effects.POISON) { net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, potioneffectIn); net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW; } return super.isPotionApplicable(potioneffectIn); } /** * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using * setBesideClimableBlock. */ public boolean isBesideClimbableBlock() { return (this.dataManager.get(CLIMBING) & 1) != 0; } /** * Updates the WatchableObject (Byte) created in entityInit() */ public void setBesideClimbableBlock(boolean climbing) { byte b0 = this.dataManager.get(CLIMBING); if (climbing) { b0 = (byte)(b0 | 1); } else { b0 = (byte)(b0 & -2); } this.dataManager.set(CLIMBING, b0); } @Nullable public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag) { spawnDataIn = super.onInitialSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag); if (worldIn.getRandom().nextInt(100) == 0) { SkeletonEntity skeletonentity = EntityType.SKELETON.create(this.world); skeletonentity.setLocationAndAngles(this.getPosX(), this.getPosY(), this.getPosZ(), this.rotationYaw, 0.0F); skeletonentity.onInitialSpawn(worldIn, difficultyIn, reason, (ILivingEntityData)null, (CompoundNBT)null); skeletonentity.startRiding(this); worldIn.addEntity(skeletonentity); } if (spawnDataIn == null) { spawnDataIn = new SpiderEntity.GroupData(); if (worldIn.getDifficulty() == Difficulty.HARD && worldIn.getRandom().nextFloat() < 0.1F * difficultyIn.getClampedAdditionalDifficulty()) { ((SpiderEntity.GroupData)spawnDataIn).setRandomEffect(worldIn.getRandom()); } } if (spawnDataIn instanceof SpiderEntity.GroupData) { Effect effect = ((SpiderEntity.GroupData)spawnDataIn).effect; if (effect != null) { this.addPotionEffect(new EffectInstance(effect, Integer.MAX_VALUE)); } } return spawnDataIn; } protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn) { return 0.65F; } static class AttackGoal extends MeleeAttackGoal { public AttackGoal(SpiderEntity spider) { super(spider, 1.0D, true); } /** * Returns whether execution should begin. You can also read and cache any state necessary for execution in this * method as well. */ public boolean shouldExecute() { return super.shouldExecute() && !this.attacker.isBeingRidden(); } /** * Returns whether an in-progress EntityAIBase should continue executing */ public boolean shouldContinueExecuting() { float f = this.attacker.getBrightness(); if (f >= 0.5F && this.attacker.getRNG().nextInt(100) == 0) { this.attacker.setAttackTarget((LivingEntity)null); return false; } else { return super.shouldContinueExecuting(); } } protected double getAttackReachSqr(LivingEntity attackTarget) { return (double)(4.0F + attackTarget.getWidth()); } } public static class GroupData implements ILivingEntityData { public Effect effect; public void setRandomEffect(Random rand) { int i = rand.nextInt(5); if (i <= 1) { this.effect = Effects.SPEED; } else if (i <= 2) { this.effect = Effects.STRENGTH; } else if (i <= 3) { this.effect = Effects.REGENERATION; } else if (i <= 4) { this.effect = Effects.INVISIBILITY; } } } static class TargetGoal<T extends LivingEntity> extends NearestAttackableTargetGoal<T> { public TargetGoal(SpiderEntity spider, Class<T> classTarget) { super(spider, classTarget, true); } /** * Returns whether execution should begin. You can also read and cache any state necessary for execution in this * method as well. */ public boolean shouldExecute() { float f = this.goalOwner.getBrightness(); return f >= 0.5F ? false : super.shouldExecute(); } } }
[ "19127632@student.hcmus.edu.vn" ]
19127632@student.hcmus.edu.vn
cb2245f95c160c682d003d4f4e24ecac5f786685
f38dca6402d3f2becd34a54bf1173eba0349d6b5
/src/main/java/solutions/_33/Solution.java
4cd7a49446f9078a7653740e17f897ad93c5c3a1
[]
no_license
N3verL4nd/leetcode
9f7aa8275b132ac30e344c810dd3c020e981a257
41342c41485840967d535155c64fa9c3c2b1a7f0
refs/heads/master
2023-06-22T20:56:03.851047
2022-04-02T02:29:12
2022-04-02T02:29:12
92,596,400
0
0
null
2023-09-05T21:57:48
2017-05-27T12:09:09
Java
UTF-8
Java
false
false
1,534
java
package solutions._33; /** * 33. Search in Rotated Sorted Array */ class Solution { private int BinarySearch(int[] arr, int left, int right, int target) { while (left <= right) { int mid = left + ((right - left) >> 1); if (arr[mid] < target) { left = mid + 1; } else if (arr[mid] > target) { right = mid - 1; } else { return mid; } } return -1; } public int search(int[] nums, int target) { if (nums.length == 0) { return -1; } int left = 0; int right = nums.length - 1; // 数组有序 if (nums[left] < nums[right]) { return BinarySearch(nums, left, right, target); } while (left + 1 < right) { int mid = left + ((right - left) >> 1); if (nums[mid] > nums[left]) { left = mid; } else { right = mid; } } int x = BinarySearch(nums, 0, left, target); int y = BinarySearch(nums, right, nums.length - 1, target); if (x == -1 && y == -1) { return -1; } else if (x != -1) { return x; } else { return y; } } public static void main(String[] args) { Solution solution = new Solution(); int[] arr = {4, 5, 6, 7, 0, 1, 2}; int pos = solution.search(arr, 0); System.out.println(pos); } }
[ "liguanghui02@meituan.com" ]
liguanghui02@meituan.com
e61f674181b98d060f467024112fa7c93c0998c7
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14227-3-12-FEMO-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/plugin/activitystream/internal/RecordableEventMigrator_ESTest.java
e1e4636802b103c6f8b17240fad23665720b8599
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
597
java
/* * This file was automatically generated by EvoSuite * Mon Jan 20 11:10:20 UTC 2020 */ package com.xpn.xwiki.plugin.activitystream.internal; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class RecordableEventMigrator_ESTest extends RecordableEventMigrator_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
57396a8e739902eba861086d9a352ec3a5739592
12bccfd50a674de813a4ad2d4f09270bf528c0d1
/src/test/java/np/com/login/LoginApplicationTests.java
4252668de0981c631edae7e1f42d2fe5debc38da
[]
no_license
bajracharya-kshitij/login
26b35852cb8ab55f61396f46541f364346c74850
4e63ef4e411e47a2c4b2179f349cd16edec1042e
refs/heads/master
2020-04-07T03:03:55.062527
2018-11-17T15:59:56
2018-11-17T15:59:56
158,001,031
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
package np.com.login; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class LoginApplicationTests { @Test public void contextLoads() { } }
[ "bajracharya.kshitij@gmail.com" ]
bajracharya.kshitij@gmail.com
8697a4e0306884e290c8534167a2b1eb6718b7b9
062dbb1b79c0dcbaabc153697c5345bece84dfb7
/008_RomanNumerals/src/test/java/de/kifaru/ndegendogo/kata/romanNumbers/RomanNumbersConverterTestBadcase.java
1f04c0d2f4a1d106041658b826dc65791b18f65e
[]
no_license
ndegendogo/katas
2b4c7555eeb47da45683c8957a6661b6d7f72241
8d8b59362ed999157b29894ce2da50c9191261ec
refs/heads/master
2021-01-21T04:36:27.771496
2016-06-12T18:34:38
2016-06-12T18:34:38
37,288,018
0
0
null
null
null
null
UTF-8
Java
false
false
946
java
package de.kifaru.ndegendogo.kata.romanNumbers; import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collection; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class RomanNumbersConverterTestBadcase { @Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { {"TATA"}, {"MCMXCIXT"}, {"MCMXCTIX"}, }); } @Parameter(value=0) public String actualInput; @Test public void testConvertToArabicNumber() { try { RomanNumbersConverter.convertToArabicNumber(actualInput); fail(); } catch (RomanNumberFormatException e) { // this is expected } } }
[ "christa.runge@kifaru.de" ]
christa.runge@kifaru.de
5713015c7a130ae1eec1858621fb379da2f192b8
99e94dbfafd008029317d0b1df08aa1d2d154c86
/mcs/src/mcs/game/task/Task.java
00dcb50fffc4bf6a5333d4c685cd4f8b0bafbd74
[]
no_license
shamansanchez/mcs
c9bc5ea07be1b07337a7cdaaddfbd4ab522d27f6
ced79826be9b8990aee76b18f535203a4730655f
refs/heads/master
2021-01-21T17:45:44.551684
2014-09-19T03:26:18
2014-09-19T03:26:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
438
java
package mcs.game.task; import mcs.game.Game; import mcs.net.Event; public abstract class Task { protected Task prevTask; public Task(Task prevTask) { this.prevTask = prevTask; } public abstract Task run(Game game) throws InterruptedException; public void publishEvent(Event event, Game game) throws InterruptedException { game.publishEvent(event); Thread.sleep(event.getDuration() * 1000); } }
[ "shamansanchez@gmail.com" ]
shamansanchez@gmail.com
0d1d20a552f53a934aed3f8ff22cbd58f8fe154b
4d13b5e435288340584842f28abe58e2f41382aa
/src/main/java/com/filemanager/fm/controller/FileController.java
d5a96eb591578800dfeda7a660ef53f5c8a720c0
[]
no_license
kohvyuan/FileManager
caa405039706478f29ea45575c7450bedcf78029
93e1912b1c9e091979a2623518f1922aec892b9b
refs/heads/master
2022-12-18T22:55:33.709617
2020-09-18T10:02:26
2020-09-18T10:02:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,992
java
package com.filemanager.fm.controller; import com.filemanager.fm.utils.FileUtil; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import javax.servlet.http.HttpServletRequest; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; @RestController @RequestMapping(value = "/file") public class FileController { @RequestMapping(value = "/upload", method = RequestMethod.POST) public String upload(HttpServletRequest request) { MultipartHttpServletRequest params = ((MultipartHttpServletRequest) request); List<MultipartFile> files = params.getFiles("fileFolder"); //fileFolder为文件项的name值 System.out.println("上传文件夹..."); File file; String fileName = ""; String filePath = ""; for (MultipartFile f : files) { fileName = f.getOriginalFilename(); String type = f.getContentType(); System.out.println("\n" + fileName + " ," + type); //String substring = fileName.substring(0, fileName.lastIndexOf("\\")); filePath = "D:\\upload\\" + fileName.substring(0, fileName.lastIndexOf("\\")); if (!isDir(filePath)) { makeDirs(filePath); } file = new File("D:\\upload\\" + fileName); try { file.createNewFile(); //将上传文件保存到一个目标文件中 f.transferTo(file); } catch (IOException e) { e.printStackTrace(); } } return "filelist"; } public boolean isFile(String filepath) { File f = new File(filepath); return f.exists() && f.isFile(); } public boolean isDir(String dirPath) { File f = new File(dirPath); return f.exists() && f.isDirectory(); } /** * 创建多级目录 * * @param path */ public void makeDirs(String path) { File file = new File(path); // 如果文件夹不存在则创建 if (!file.exists() && !file.isDirectory()) { file.mkdirs(); } else { System.out.println("创建目录失败:" + path); } } /** * 上传文件夹 * * @param file * @param path * @return */ @PostMapping("/uploadDir") @ResponseBody public String uploadDir(@RequestParam("file") MultipartFile file, @RequestParam("path") String path) { if (file.isEmpty()) { return "上传失败,请选择文件"; } System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaa"); String fileName = file.getOriginalFilename(); String filePath = path; System.out.println(filePath); File dest = new File(filePath + fileName); try { file.transferTo(dest); return "上传成功"; } catch (IOException e) { } return "上传失败!"; } /** * 上传多个文件 * * @param request * @return */ @RequestMapping(value = "/uploadMuilt", method = RequestMethod.POST) public Object uploadMuilt(HttpServletRequest request) { List<MultipartFile> files = ((MultipartHttpServletRequest) request).getFiles("file"); MultipartFile file = null; BufferedOutputStream stream = null; for (int i = 0; i < files.size(); i++) { file = files.get(i); String filePath = "D:\\upload7"; if (!file.isEmpty()) { try { byte[] bytes = file.getBytes(); stream = new BufferedOutputStream(new FileOutputStream( new File(filePath + file.getOriginalFilename()) )); stream.write(bytes); stream.close(); } catch (Exception e) { stream = null; e.printStackTrace(); return "the" + i + "file upload failure"; } } else { return "the" + i + "file is empty"; } } return "upload multifile success"; } /** * 上传文件夹 * @param folder * @return */ @RequestMapping(value = "/uploadFolder", method = RequestMethod.POST) public Object uploadFolder(MultipartFile[] folder) { Map<String,Object> map = new HashMap<>(); try{ FileUtil.saveMultiFile("D:/upload", folder); map.put("msg","上传成功"); }catch (Exception e){ map.put("msg","上传失败"); e.printStackTrace(); } return map; } }
[ "736862392@qq.com" ]
736862392@qq.com
3b9ab7bfe1ecf41ecc041015c2e73a7de5ec3d4d
ea8d79e70b123d903b65faf798096111183cbdb5
/src/main/java/com/liugawaheliujinnao/singleFunction/wechatEnterpriseAccount/model/token/WeiXinToken.java
f40c91c47a03e55b507959229384b3f6263d0cb0
[]
no_license
liujinnaoheliugawa/weixin-enterprise-account
8efe75974eb0b1d36fd7e7fd11898a3793a052f9
61390bc0fd543856102ec1f82e9a7fbc92e8899f
refs/heads/master
2022-12-26T13:07:36.107955
2019-05-25T13:45:48
2019-05-25T13:45:48
188,552,582
3
1
null
2022-12-16T05:24:19
2019-05-25T10:30:27
Java
UTF-8
Java
false
false
654
java
package com.liugawaheliujinnao.singleFunction.wechatEnterpriseAccount.model.token; import java.io.Serializable; /** * @Description: * @Author: LiugawaHeLiujinnao * @Date: 2019-05-25 */ public class WeiXinToken implements Serializable { private String access_token; private String expires_in; public String getAccess_token() { return access_token; } public void setAccess_token(String access_token) { this.access_token = access_token; } public String getExpires_in() { return expires_in; } public void setExpires_in(String expires_in) { this.expires_in = expires_in; } }
[ "liugawaheliujinnao@126.com" ]
liugawaheliujinnao@126.com
8faaccba7981b0bab6c621e2bcb1b3519838d360
473ba7b4dddc4054e30bcfda24a634cf6238f6d4
/src/main/java/com/application/coopcycle/service/PanierService.java
7f7554d23da11bd5cf2a1c7cea8b4a09d8c316c0
[]
no_license
oumaimahajji/Coopcyclev2
69ff1a2bfb4f84c64ec873c9e19a90c224e60fd8
2323d457fd3f4ce1b10a7096a1ef1ecc02aeacf9
refs/heads/master
2023-04-06T20:04:50.715269
2021-04-11T19:09:09
2021-04-11T19:09:09
356,955,920
0
0
null
null
null
null
UTF-8
Java
false
false
1,195
java
package com.application.coopcycle.service; import com.application.coopcycle.service.dto.PanierDTO; import java.util.Optional; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; /** * Service Interface for managing {@link com.application.coopcycle.domain.Panier}. */ public interface PanierService { /** * Save a panier. * * @param panierDTO the entity to save. * @return the persisted entity. */ PanierDTO save(PanierDTO panierDTO); /** * Partially updates a panier. * * @param panierDTO the entity to update partially. * @return the persisted entity. */ Optional<PanierDTO> partialUpdate(PanierDTO panierDTO); /** * Get all the paniers. * * @param pageable the pagination information. * @return the list of entities. */ Page<PanierDTO> findAll(Pageable pageable); /** * Get the "id" panier. * * @param id the id of the entity. * @return the entity. */ Optional<PanierDTO> findOne(Long id); /** * Delete the "id" panier. * * @param id the id of the entity. */ void delete(Long id); }
[ "oumaima.hajji@etu.univ-grenoble-alpes.fr" ]
oumaima.hajji@etu.univ-grenoble-alpes.fr
a6b492817ee435d59f9ef46c2ddbd4e0b7d4019a
d94c4f96dbf47102e8ae3049750bea88de054988
/송춘추/01_HelloWorld/src/com/esum/test/TestMain.java
6a458f503f882a14a365283dcb7fa5ff7f0195e8
[]
no_license
esumTech/2014_ObjectiveJava
fc0cf870b4ff6d6c86b21e5717283185b823ac2f
f615e73c29f51872070059edf01aff8fcb7a1634
HEAD
2016-09-06T06:27:13.117387
2014-09-16T09:02:26
2014-09-16T09:02:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
51
java
package com.esum.test; public class TestMain { }
[ "cosmos.hurukku@gmail.com" ]
cosmos.hurukku@gmail.com
69224e72e2a410d7da416cb3ba3c8eb873b79b83
5f85ff594f87b35f199164e7caa2d1770757127c
/forceup/src/main/java/model/TeamResultAchiever.java
bd7c0e34dc16644fbfea09168f9203a3db65949b
[]
no_license
karthi13keyan/ForceUpApp
fbd49e4079de829764840c3a7ddd47494a8f975f
84c663cbafe098d3cfc03918f79e1d0e500b22f8
refs/heads/master
2020-03-30T13:31:48.102381
2018-10-02T21:39:31
2018-10-02T21:39:31
151,276,179
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package model; import java.util.HashMap; public class TeamResultAchiever { HashMap<String,Long> salesAchiever = new HashMap<>(); HashMap<String,Long> pipeline = new HashMap<>(); HashMap<String,Long> faceToFace = new HashMap<>(); public HashMap<String, Long> getSalesAchiever() { return salesAchiever; } public void setSalesAchiever(HashMap<String, Long> salesAchiever) { this.salesAchiever = salesAchiever; } public HashMap<String, Long> getPipeline() { return pipeline; } public void setPipeline(HashMap<String, Long> pipeline) { this.pipeline = pipeline; } public HashMap<String, Long> getFaceToFace() { return faceToFace; } public void setFaceToFace(HashMap<String, Long> faceToFace) { this.faceToFace = faceToFace; } }
[ "forceup@192.168.1.9" ]
forceup@192.168.1.9
deb5a16666dde47188a35b10c6062da0aa0c323d
9c346b627a724a6c56b7459895cca517ac9e4551
/HackerRank/common_child/Solution.java
956f783102b282cbb6fc8f426f66243526581d1a
[]
no_license
GradyMoran/challenges
b2bc660fce8ac4f0a88c06ef4ba97cc24de8411e
e178e7a0e9603661c21260ec60749c0754ba906f
refs/heads/master
2021-07-06T04:05:40.004577
2021-05-16T20:20:48
2021-05-16T20:20:48
241,216,112
0
0
null
null
null
null
UTF-8
Java
false
false
2,144
java
import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.function.*; import java.util.regex.*; import java.util.stream.*; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList; class Result { /* * Complete the 'commonChild' function below. * * The function is expected to return an INTEGER. * The function accepts following parameters: * 1. STRING s1 * 2. STRING s2 */ public static int commonChild(String s1, String s2) { /* This is the longest subsequence problem. Use dynamic programming solution identified by https://en.wikipedia.org/wiki/Longest_common_subsequence_problem */ int[][] lcs = new int[s1.length()+1][s2.length()+1]; for (int i = 0; i < s1.length()+1; i++){ lcs[i][0] = 0; } for (int i = 0; i < s2.length()+1; i++){ lcs[0][i] = 0; } for (int r = 1; r < s1.length()+1; r++){ for (int c = 1; c < s2.length()+1; c++){ if (s1.charAt(r-1) == s2.charAt(c-1)){ lcs[r][c] = lcs[r-1][c-1]+1; } else { lcs[r][c] = lcs[r-1][c] > lcs[r][c-1] ? lcs[r-1][c] : lcs[r][c-1]; } } } return lcs[s1.length()][s2.length()]; } } public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); //BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH"))); BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(System.out)); String s1 = bufferedReader.readLine(); String s2 = bufferedReader.readLine(); int result = Result.commonChild(s1, s2); bufferedWriter.write(String.valueOf(result)); bufferedWriter.newLine(); bufferedReader.close(); bufferedWriter.close(); } }
[ "gradymoran95@gmail.com" ]
gradymoran95@gmail.com
c52583182d6543e9b450d6dab15442e6204cad7d
991a6acce9d5302669767a8540566a2b5d4a773a
/app/src/main/java/tiwaco/thefirstapp/DTO/KhachHangDTO.java
05b2ce1f2188140e07233b831a26770269d44c03
[]
no_license
trantu225/TheFirstApp
4b896ab1a5542e3cbba3d70db2271dbc0bf5d3e5
8d27eb78c8bc8c667ef96a4e074473204b87de91
refs/heads/master
2021-01-19T08:05:27.998413
2020-11-02T01:45:44
2020-11-02T01:45:44
87,597,740
0
0
null
null
null
null
UTF-8
Java
false
false
9,133
java
package tiwaco.thefirstapp.DTO; /** * Created by TUTRAN on 30/03/2017. */ public class KhachHangDTO { String ChiSo; String ChiSo1; String ChiSo1con; String ChiSo2; String ChiSo2con; String ChiSo3; String ChiSo3con; String ChiSocon; String DanhBo; String DiaChi; String DienThoai; String DienThoai2; String CMND; String GhiChu; String Lat; String Lon; String MaKhachHang; String NhanVien; String SLTieuThu; String SLTieuThucon; String SLTieuThu1; String SLTieuThu1con; String SLTieuThu2; String SLTieuThu2con; String SLTieuThu3; String SLTieuThu3con; String STT; String TenKhachHang; String ThoiGian; String TrangThaiTLK; String chitietloai; String cotlk; String dinhmuc; String hieutlk; String loaikh; String NTSH; String loaikhmoi; String masotlk; String tiennuoc; String phi; String tongcong; String vat; String thue; String m3t1; String m3t2; String m3t3; String m3t4; //String tien1; String tien2; String tien3; String tien4; String ngaythanhtoan; String nhanvienthu; public String getNhanvienthu() { return nhanvienthu; } public void setNhanvienthu(String nhanvienthu) { this.nhanvienthu = nhanvienthu; } public String getNgaythanhtoan() { return ngaythanhtoan; } public void setNgaythanhtoan(String ngaythanhtoan) { this.ngaythanhtoan = ngaythanhtoan; } public String getSTT() { return STT; } public void setSTT(String STT) { this.STT = STT; } public String getvat() { return vat; } public String getDienThoai2() { return DienThoai2; } public KhachHangDTO setDienThoai2(String dienThoai2) { DienThoai2 = dienThoai2; return this; } public void setvat(String vat) { this.vat = vat; } public String getTienNuoc() { return tiennuoc; } public void setTienNuoc(String tiennuoc) { this.tiennuoc = tiennuoc; } public String getThue() { return thue; } public void setThue(String tiennuoc) { this.thue = tiennuoc; } public String getphi() { return phi; } public void setphi(String phi) { this.phi = phi; } public String gettongcong() { return tongcong; } public void settongcong(String tongcong) { this.tongcong = tongcong; } public String getNTSH() { return NTSH; } public void setNTSH(String NTSH) { this.NTSH = NTSH; } public String getChiSo() { return ChiSo; } public void setChiSo(String chiSo) { ChiSo = chiSo; } public String getChiSo1() { return ChiSo1; } public void setChiSo1(String chiSo1) { ChiSo1 = chiSo1; } public String getChiSo1con() { return ChiSo1con; } public void setChiSo1con(String chiSo1con) { ChiSo1con = chiSo1con; } public String getChiSo2con() { return ChiSo2con; } public void setChiSo2con(String chiSo2con) { ChiSo2con = chiSo2con; } public String getChiSo3con() { return ChiSo3con; } public void setChiSo3con(String chiSo3con) { ChiSo3con = chiSo3con; } public String getChiSocon() { return ChiSocon; } public void setChiSocon(String chiSocon) { ChiSocon = chiSocon; } public String getChitietloai() { return chitietloai; } public void setChitietloai(String chitietloai) { this.chitietloai = chitietloai; } public String getCotlk() { return cotlk; } public void setCotlk(String cotlk) { this.cotlk = cotlk; } public String getDanhBo() { return DanhBo; } public void setDanhBo(String danhBo) { DanhBo = danhBo; } public String getDiaChi() { return DiaChi; } public void setDiaChi(String diaChi) { DiaChi = diaChi; } public String getDienThoai() { return DienThoai; } public void setDienThoai(String dienThoai) { DienThoai = dienThoai; } public String getDinhmuc() { return dinhmuc; } public void setDinhmuc(String dinhmuc) { this.dinhmuc = dinhmuc; } public String getGhiChu() { return GhiChu; } public void setGhiChu(String ghiChu) { GhiChu = ghiChu; } public String getHieutlk() { return hieutlk; } public void setHieutlk(String hieutlk) { this.hieutlk = hieutlk; } public String getLat() { return Lat; } public void setLat(String lat) { Lat = lat; } public String getLoaikh() { return loaikh; } public void setLoaikh(String loaikh) { this.loaikh = loaikh; } public String getLoaikhmoi() { return loaikhmoi; } public void setLoaikhmoi(String loaikh) { this.loaikhmoi = loaikh; } public String getLon() { return Lon; } public void setLon(String lon) { Lon = lon; } public String getMaKhachHang() { return MaKhachHang; } public void setMaKhachHang(String maKhachHang) { MaKhachHang = maKhachHang; } public String getMasotlk() { return masotlk; } public void setMasotlk(String masotlk) { this.masotlk = masotlk; } public String getNhanVien() { return NhanVien; } public void setNhanVien(String nhanVien) { NhanVien = nhanVien; } public String getSLTieuThu() { return SLTieuThu; } public void setSLTieuThu(String SLTieuThu) { this.SLTieuThu = SLTieuThu; } public String getSLTieuThu1() { return SLTieuThu1; } public void setSLTieuThu1(String SLTieuThu1) { this.SLTieuThu1 = SLTieuThu1; } public String getSLTieuThu1con() { return SLTieuThu1con; } public void setSLTieuThu1con(String SLTieuThu1con) { this.SLTieuThu1con = SLTieuThu1con; } public String getSLTieuThu2() { return SLTieuThu2; } public void setSLTieuThu2(String SLTieuThu2) { this.SLTieuThu2 = SLTieuThu2; } public String getSLTieuThu2con() { return SLTieuThu2con; } public void setSLTieuThu2con(String SLTieuThu2con) { this.SLTieuThu2con = SLTieuThu2con; } public String getSLTieuThu3() { return SLTieuThu3; } public void setSLTieuThu3(String SLTieuThu3) { this.SLTieuThu3 = SLTieuThu3; } public String getSLTieuThu3con() { return SLTieuThu3con; } public void setSLTieuThu3con(String SLTieuThu3con) { this.SLTieuThu3con = SLTieuThu3con; } public String getSLTieuThucon() { return SLTieuThucon; } public void setSLTieuThucon(String SLTieuThucon) { this.SLTieuThucon = SLTieuThucon; } public String getTenKhachHang() { return TenKhachHang; } public void setTenKhachHang(String tenKhachHang) { TenKhachHang = tenKhachHang; } public String getThoiGian() { return ThoiGian; } public void setThoiGian(String thoiGian) { ThoiGian = thoiGian; } public String getTrangThaiTLK() { return TrangThaiTLK; } public void setTrangThaiTLK(String trangThaiTLK) { TrangThaiTLK = trangThaiTLK; } public String getChiSo2() { return ChiSo2; } public void setChiSo2(String chiSo2) { ChiSo2 = chiSo2; } public String getChiSo3() { return ChiSo3; } public void setChiSo3(String chiSo3) { ChiSo3 = chiSo3; } public String getM3t1() { return m3t1; } public void setM3t1(String m3t1) { this.m3t1 = m3t1; } public String getM3t2() { return m3t2; } public void setM3t2(String m3t2) { this.m3t2 = m3t2; } public String getM3t3() { return m3t3; } public void setM3t3(String m3t3) { this.m3t3 = m3t3; } public String getM3t4() { return m3t4; } public void setM3t4(String m3t4) { this.m3t4 = m3t4; } // public String getTien1() { // return tien1; // } // // public void setTien1(String tien1) { // this.tien1 = tien1; // } public String getTien2() { return tien2; } public void setTien2(String tien2) { this.tien2 = tien2; } public String getTien3() { return tien3; } public void setTien3(String tien3) { this.tien3 = tien3; } public String getTien4() { return tien4; } public void setTien4(String tien4) { this.tien4 = tien4; } public String getCMND() { return CMND; } public KhachHangDTO setCMND(String CMND) { this.CMND = CMND; return this; } }
[ "trantu225@gmail.com" ]
trantu225@gmail.com
23ca2af3cab0ef98b41a285280404e82a390d275
6f36fc4a0f9c680553f8dd64c5df55c403f8f2ed
/src/main/java/it/csi/siac/siacbilser/business/service/allegatoatto/ConvalidaAllegatoAttoPerElenchiMultiploAsyncService.java
b56bd1452a928b03417ba29e5e5b52e80f9a718a
[]
no_license
unica-open/siacbilser
b46b19fd382f119ec19e4e842c6a46f9a97254e2
7de24065c365564b71378ce9da320b0546474130
refs/heads/master
2021-01-06T13:25:34.712460
2020-03-04T08:44:26
2020-03-04T08:44:26
241,339,144
0
0
null
null
null
null
UTF-8
Java
false
false
2,183
java
/* *SPDX-FileCopyrightText: Copyright 2020 | CSI Piemonte *SPDX-License-Identifier: EUPL-1.2 */ package it.csi.siac.siacbilser.business.service.allegatoatto; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import it.csi.siac.siacbilser.business.service.base.AsyncBaseService; import it.csi.siac.siaccommonser.business.service.base.exception.ServiceParamError; import it.csi.siac.siaccorser.frontend.webservice.msg.AsyncServiceRequestWrapper; import it.csi.siac.siaccorser.frontend.webservice.msg.AsyncServiceResponse; import it.csi.siac.siacfin2ser.frontend.webservice.msg.ConvalidaAllegatoAttoPerElenchiMultiplo; import it.csi.siac.siacfin2ser.frontend.webservice.msg.ConvalidaAllegatoAttoPerElenchiMultiploResponse; /** * @author elisa * */ @Service @Scope(BeanDefinition.SCOPE_PROTOTYPE) public class ConvalidaAllegatoAttoPerElenchiMultiploAsyncService extends AsyncBaseService<ConvalidaAllegatoAttoPerElenchiMultiplo, ConvalidaAllegatoAttoPerElenchiMultiploResponse, AsyncServiceRequestWrapper<ConvalidaAllegatoAttoPerElenchiMultiplo>, ConvalidaAllegatoAttoPerElenchiMultiploAsyncResponseHandler, ConvalidaAllegatoAttoPerElenchiMultiploService> { @Override protected void checkServiceParam() throws ServiceParamError { service.checkServiceParam(); res.addErrori(service.getServiceResponse().getErrori()); } @Override @Transactional public AsyncServiceResponse executeService(AsyncServiceRequestWrapper<ConvalidaAllegatoAttoPerElenchiMultiplo> serviceRequest) { return super.executeService(serviceRequest); } @Override protected void preStartService() { final String methodName = "preStartService"; log.debug(methodName, "Operazione asincrona in procinto di avviarsi..."); } @Override protected void postStartService() { // TODO Auto-generated method stub } @Override protected boolean mayRequireElaborationOnDedicatedQueue() { // TODO verificare return false; } }
[ "barbara.malano@csi.it" ]
barbara.malano@csi.it
b2c31a69cfdaad13c75af820844d9368c41dc357
a15cea1732a0fe670b2f6a7477c550257884a262
/src/main/java/tamaized/tammodized/common/fluids/TamFluidFiniteBlock.java
5a9ab6ec7c2a0f7f750a0ca5db65b755c24b525a
[ "MIT" ]
permissive
Tamaized/TamModized
a9ea048a9d9213b05449e22609aa9bc92214421f
cc6a428d6ea7d1aa1d4a3368d0ebbe9567c081dc
refs/heads/1.12
2021-01-19T03:37:56.419642
2018-11-25T01:35:06
2018-11-25T01:35:06
62,675,534
3
3
null
2017-07-11T02:31:33
2016-07-05T23:11:02
Java
UTF-8
Java
false
false
2,412
java
package tamaized.tammodized.common.fluids; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.util.DamageSource; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.ModContainer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import tamaized.tammodized.registry.ITamRegistry; import tamaized.tammodized.registry.RegistryHelper; import java.util.Random; @SuppressWarnings("unused") public class TamFluidFiniteBlock extends BlockFluidFinite implements ITamRegistry { private final String name; private final DamageSource damageSource; private final int damage; public TamFluidFiniteBlock(CreativeTabs tab, Fluid fluid, Material material, String name, DamageSource source, int dmg) { super(fluid, material); this.name = name; damageSource = source; damage = dmg; ModContainer container = Loader.instance().activeModContainer(); setTranslationKey(container == null ? name : (container.getModId().toLowerCase() + "." + name)); setRegistryName(name); this.setCreativeTab(tab); } @Override public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { super.updateTick(world, pos, state, rand); } public String getModelDir() { return "fluids"; } @Override public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { super.onEntityCollision(worldIn, pos, state, entityIn); entityIn.attackEntityFrom(damageSource, damage); } @Override public void registerBlock(RegistryEvent.Register<Block> e) { e.getRegistry().register(this); } @Override public void registerItem(RegistryEvent.Register<Item> e) { e.getRegistry().register(new ItemBlock(this).setRegistryName(name)); } @Override @SideOnly(Side.CLIENT) public void registerModel(ModelRegistryEvent e) { RegistryHelper.registerFluidModel(this); } }
[ "ryanolt123@gmail.com" ]
ryanolt123@gmail.com
54153e854504720d79277f35c7885133c52eebc0
1d61b871fd5236579a4ba6659b4894d5a8c4f103
/src/main/java/org/goodsManagement/controller/GoodsManagerAction.java
7e0e6b8747b319c75a5693394e0729f7e2882494
[ "Apache-2.0" ]
permissive
Johnny-Liao/GoodsManagement
ec5d132762c4f9a561728b62ae6bf1f20eb856e7
dccce40c96835d0e22c44393f198943599503af5
HEAD
2016-08-12T20:04:43.555888
2015-11-17T06:41:56
2015-11-17T06:41:56
44,155,759
1
0
null
null
null
null
UTF-8
Java
false
false
4,499
java
package org.goodsManagement.controller; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.convention.annotation.*; import org.apache.struts2.interceptor.ServletRequestAware; import org.goodsManagement.po.GoodsDto; import org.goodsManagement.service.impl.GoodsServiceImpl; import org.goodsManagement.vo.GoodsVo; import org.goodsManagement.vo.Warehouse; import org.springframework.beans.factory.annotation.Autowired; import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.List; /** * Created by admin on 2015/9/25. */ @Action("GoodsManager") @ParentPackage("struts-default") @Namespace("/") @Results( { @Result(name = "success", location = "/goodsManager.jsp"), @Result(name = "showGood", location = "/goodsManager.jsp"), @Result(name = "showAll", location = "/showGoodsInformation.jsp"), @Result(name = "addGood", location = "/addGood.jsp") }) public class GoodsManagerAction extends ActionSupport implements ServletRequestAware { public GoodsManagerAction() { System.out.println("action被实例化"); } @Autowired private GoodsServiceImpl goodsServiceImpl; private String goodName; private List<GoodsDto> listGood; private List<GoodsVo> list = new ArrayList<GoodsVo>(); private List<Warehouse> listNumber; private HttpServletRequest request; private GoodsVo goodsVo; public GoodsVo getGoodsVo() { return goodsVo; } public void setGoodsVo(GoodsVo goodsVo) { this.goodsVo = goodsVo; } public List<GoodsDto> getListGood() { return listGood; } public void setListGood(List<GoodsDto> listGood) { this.listGood = listGood; } public List<Warehouse> getListNumber() { return listNumber; } public void setListNumber(List<Warehouse> listNumber) { this.listNumber = listNumber; } public List<GoodsVo> getList() { return list; } public void setList(List<GoodsVo> list) { this.list = list; } public GoodsServiceImpl getGoodsServiceImpl() { return goodsServiceImpl; } public void setGoodsServiceImpl(GoodsServiceImpl goodsServiceImpl) { this.goodsServiceImpl = goodsServiceImpl; } public String getGoodName() { return goodName; } public void setGoodName(String goodName) { this.goodName = goodName; } //显示所有物品信息 public String getAll() { list = goodsServiceImpl.getEntitieskind(); System.out.println("物品的种类大小:" + list.size()); return SUCCESS; } //根据物品名称查询 public String selectByName() { System.out.println("物品名称:" + goodName); listGood = goodsServiceImpl.getEntitiesByname(goodName); GoodsVo goodsVo = new GoodsVo(); goodsVo.setGoodname(listGood.get(0).getGoodname()); goodsVo.setGoodunit(listGood.get(0).getGoodunit()); list.add(goodsVo); return "showGood"; } //显示所有物品详细信息 public String showAll() throws Exception { listNumber = goodsServiceImpl.getWarehouseInventory(goodName); listGood = goodsServiceImpl.getEntitiesByname(goodName); return "showAll"; } //根据物品名称删除物品 public String deleteGoods() throws Exception { System.out.println("删除的物品名称:" + goodName); listGood = goodsServiceImpl.getEntitiesByname(goodName); goodsServiceImpl.deleteEntity(listGood.get(0).getId()); getAll(); return "showGood"; } //增加物品 public String addGood() { System.out.println("增加物品信息:" + goodsVo); GoodsDto goodsDto = new GoodsDto(); goodsDto.setGoodname(goodsVo.getGoodname()); goodsDto.setGoodunit(goodsVo.getGoodunit()); goodsDto.setGoodnumbers(goodsVo.getGoodnumbers()); goodsDto.setGoodtype(goodsVo.getGoodtype()); System.out.println("增加物品信息:" + goodsDto); goodsServiceImpl.addEntity(goodsDto); return "addGood"; } public void setServletRequest(HttpServletRequest request) { this.request = request; } }
[ "1020157553@qq.com" ]
1020157553@qq.com
c278e00f127cbdbd18bc9c19bb3aa1506aed4fec
0274c45ddd8f17b6cf66c5eb465bf2ba94ae7b40
/src/db/BoardDao.java
2eba7abe896bcb9029c6ae0aebd7d7581eea9695
[]
no_license
Anyqook/Practice
355eec03b1e285f4a84b47039058dc3604393bc5
f208acfeb7a983fa31926983b8369596f3fdcef1
refs/heads/master
2020-04-03T15:01:04.246953
2018-10-30T08:57:51
2018-10-30T08:57:51
155,346,024
0
0
null
null
null
null
UTF-8
Java
false
false
168
java
package db; import org.apache.ibatis.session.SqlSession; import bean.SqlMapClient; public class BoardDao { private SqlSession session = SqlMapClient.getSession(); }
[ "bonein3@gmail.com" ]
bonein3@gmail.com
b86ded536d213c850b39c508ead99baff4bb2842
44e126950c6711c28c020e306845d0c532fef99a
/src/controller/AgenciaController.java
1b76cec7ca62e6e0eb516b352db51a4494025f45
[]
no_license
vagrantsn/proj-loctranspdesktop
10f7bb6d47f0cc8172f8488e620f75825420730f
8ebaae083ea4017db8ed50ef7595862808827088
refs/heads/master
2021-09-09T00:04:23.819718
2017-05-05T20:35:03
2017-05-05T20:35:03
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
2,205
java
package controller; import java.net.URL; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.ResourceBundle; import java.util.concurrent.Callable; import dao.Agencia; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.TableView; import javafx.stage.Stage; import javafx.stage.WindowEvent; import model.Context; import model.TableViewUtils; import view.WindowManager; public class AgenciaController implements Initializable { @FXML TableView<List<Map>> tabelaAgencias; @Override public void initialize(URL location, ResourceBundle resources) { // TODO Auto-generated method stub preparar_tabela_agencias(); } public void preparar_tabela_agencias() { Map<String, String> colunas = new LinkedHashMap<String, String>(); colunas.put("cod", "id"); colunas.put("Titulo", "titulo"); colunas.put("Estado", "estado"); colunas.put("Cidade", "cidade"); colunas.put("Funcionarios", "funcionarios"); colunas.put("Veículos", "veiculos"); TableViewUtils.preparar_tabela(tabelaAgencias, colunas, new Callable<List<Map>>() { @Override public List<Map> call() throws Exception { // TODO Auto-generated method stub return new Agencia().getAgencias(); } }); } @FXML public void abrirCadastrar(ActionEvent event) { abrir_formulario_agencia(); } @FXML public void editarAgencia(ActionEvent event) { Map<String, Object> item_selecionado = (Map<String, Object>) tabelaAgencias.getSelectionModel().getSelectedItem(); if( item_selecionado == null ) return; int id_agencia_selecionada = (int) item_selecionado.get("id"); Context.addData( "idAgencia", id_agencia_selecionada ); abrir_formulario_agencia(); } public void abrir_formulario_agencia() { Stage janela_formulario_agencia = WindowManager.abrirModal( "/view/FormularioAgencia.fxml", getClass()); janela_formulario_agencia.setOnCloseRequest( new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent event) { // TODO Auto-generated method stub preparar_tabela_agencias(); } }); } }
[ "vagnervst17@gmail.com" ]
vagnervst17@gmail.com
c941451b1de6f747963e5f798815501b85798345
f69df376ad6d422116ead965f08a4c4efde9dfc3
/src/main/java/com/example/demo/cmm/service/CommonService.java
b06554ec3813182bfbbe8cd6fd5e111b76348251
[]
no_license
SHLIM1103/SpringBoot-Skeleton
f56372bc12bb6cad556bc684ee6518a05e79c0b6
83e5f46d56f0295fc8cf46592edd28e8bbd45c4c
refs/heads/master
2023-02-25T04:20:58.724218
2021-01-31T07:37:51
2021-01-31T07:37:51
334,599,240
0
0
null
null
null
null
UTF-8
Java
false
false
1,765
java
package com.example.demo.cmm.service; import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.example.demo.cmm.enm.Sql; import com.example.demo.cmm.utl.Box; @Service public class CommonService { @Autowired Box<String> bx; @Transactional public int generateDB() { var map = new HashMap<String,String>(); List<String> l1 = Arrays.asList( Sql.DROP_TABLE.toString()+"replies", Sql.DROP_TABLE.toString()+"articles", Sql.DROP_TABLE.toString()+"grades", Sql.DROP_TABLE.toString()+"teachers", Sql.DROP_TABLE.toString()+"students", Sql.DROP_TABLE.toString()+"subjects", Sql.DROP_TABLE.toString()+"managers" ); List<String> l2 = Arrays.asList( Sql.CREATE_MANAGERS.toString(), Sql.CREATE_SUBJECTS.toString(), Sql.CREATE_STUDENTS.toString(), Sql.CREATE_TEACHERS.toString(), Sql.CREATE_GRADES.toString(), Sql.CREATE_ARTICLES.toString(), Sql.CREATE_REPLIES.toString()); for(int i=0; i< l1.size(); i++) { map.put("DROP_TABLE", l1.get(i)); map.clear(); } for(int i=0; i< l2.size(); i++) { map.put("CREATE_TABLE", l2.get(i)); map.clear(); } bx.put("TABLE_COUNT", Sql.TABLE_COUNT.toString()); return 0; } public int totalCount() { return 0; } public int dropTable() { return 0; } }
[ "gusl5525@gmail.com" ]
gusl5525@gmail.com
34adda631ad531c38a5b41de26c344b9000fcde9
fa32414cd8cb03a7dc3ef7d85242ee7914a2f45f
/app/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java
5afdd78400d5d4910efebf8088933247622ea9ed
[]
no_license
SeniorZhai/Mob
75c594488c4ce815a1f432eb4deacb8e6f697afe
cac498f0b95d7ec6b8da1275b49728578b64ef01
refs/heads/master
2016-08-12T12:49:57.527237
2016-03-10T06:57:09
2016-03-10T06:57:09
53,562,752
4
2
null
null
null
null
UTF-8
Java
false
false
3,131
java
package com.google.android.gms.common.api; import com.google.android.gms.iid.InstanceID; import org.apache.http.protocol.HttpRequestExecutor; public class CommonStatusCodes { public static final int API_NOT_AVAILABLE = 17; public static final int CANCELED = 16; public static final int DEVELOPER_ERROR = 10; public static final int ERROR = 13; public static final int INTERNAL_ERROR = 8; public static final int INTERRUPTED = 14; public static final int INVALID_ACCOUNT = 5; public static final int LICENSE_CHECK_FAILED = 11; public static final int NETWORK_ERROR = 7; public static final int RESOLUTION_REQUIRED = 6; public static final int SERVICE_DISABLED = 3; public static final int SERVICE_INVALID = 9; public static final int SERVICE_MISSING = 1; public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2; public static final int SIGN_IN_REQUIRED = 4; public static final int SUCCESS = 0; public static final int SUCCESS_CACHE = -1; public static final int TIMEOUT = 15; public static String getStatusCodeString(int statusCode) { switch (statusCode) { case SUCCESS_CACHE /*-1*/: return "SUCCESS_CACHE"; case SUCCESS /*0*/: return "SUCCESS"; case SERVICE_MISSING /*1*/: return "SERVICE_MISSING"; case SERVICE_VERSION_UPDATE_REQUIRED /*2*/: return "SERVICE_VERSION_UPDATE_REQUIRED"; case SERVICE_DISABLED /*3*/: return "SERVICE_DISABLED"; case SIGN_IN_REQUIRED /*4*/: return "SIGN_IN_REQUIRED"; case INVALID_ACCOUNT /*5*/: return "INVALID_ACCOUNT"; case RESOLUTION_REQUIRED /*6*/: return "RESOLUTION_REQUIRED"; case NETWORK_ERROR /*7*/: return "NETWORK_ERROR"; case INTERNAL_ERROR /*8*/: return "INTERNAL_ERROR"; case SERVICE_INVALID /*9*/: return "SERVICE_INVALID"; case DEVELOPER_ERROR /*10*/: return "DEVELOPER_ERROR"; case LICENSE_CHECK_FAILED /*11*/: return "LICENSE_CHECK_FAILED"; case ERROR /*13*/: return "ERROR_OPERATION_FAILED"; case INTERRUPTED /*14*/: return "INTERRUPTED"; case TIMEOUT /*15*/: return InstanceID.ERROR_TIMEOUT; case CANCELED /*16*/: return "CANCELED"; case HttpRequestExecutor.DEFAULT_WAIT_FOR_CONTINUE /*3000*/: return "AUTH_API_INVALID_CREDENTIALS"; case 3001: return "AUTH_API_ACCESS_FORBIDDEN"; case 3002: return "AUTH_API_CLIENT_ERROR"; case 3003: return "AUTH_API_SERVER_ERROR"; case 3004: return "AUTH_TOKEN_ERROR"; case 3005: return "AUTH_URL_RESOLUTION"; default: return "unknown status code: " + statusCode; } } }
[ "370985116@qq.com" ]
370985116@qq.com