blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
689M
⌀ | 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 131
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 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34302e39ae45e60242b255a1fdcbdf5de1b2711f | 34df67753934d8951604bf13260d5edb0df970cb | /src/com/btten/hcb/Service/core/Geohash.java | ffa0270cbc2b54390de2308a581f747c15f2852f | [] | no_license | piaoyao424/hcb_native | 66e62c77680b824359a3d565e770ce14d0ad86b1 | ce01554df3d8335a3749c0579c59599825599b89 | refs/heads/master | 2016-09-05T16:29:36.126400 | 2014-05-22T08:54:06 | 2014-05-22T08:54:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,907 | java | package com.btten.hcb.service.core;
import java.util.BitSet;
import java.util.HashMap;
public class Geohash {
private static int numbits = 6 * 5;
final static char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
final static HashMap<Character, Integer> lookup = new HashMap<Character, Integer>();
static {
int i = 0;
for (char c : digits)
lookup.put(c, i++);
}
public static void main(String[] args) {
double[] latlon = new Geohash().decode("dj248j248j24");
System.out.println(latlon[0] + " " + latlon[1]);
Geohash e = new Geohash();
String s = e.encode(30, -90.0);
System.out.println(s);
latlon = e.decode(s);
System.out.println(latlon[0] + ", " + latlon[1]);
}
public double[] decode(String geohash) {
StringBuilder buffer = new StringBuilder();
for (char c : geohash.toCharArray()) {
int i = lookup.get(c) + 32;
buffer.append( Integer.toString(i, 2).substring(1) );
}
BitSet lonset = new BitSet();
BitSet latset = new BitSet();
//even bits
int j =0;
for (int i=0; i< numbits*2;i+=2) {
boolean isSet = false;
if ( i < buffer.length() )
isSet = buffer.charAt(i) == '1';
lonset.set(j++, isSet);
}
//odd bits
j=0;
for (int i=1; i< numbits*2;i+=2) {
boolean isSet = false;
if ( i < buffer.length() )
isSet = buffer.charAt(i) == '1';
latset.set(j++, isSet);
}
double lon = decode(lonset, -180, 180);
double lat = decode(latset, -90, 90);
return new double[] {lat, lon};
}
private double decode(BitSet bs, double floor, double ceiling) {
double mid = 0;
for (int i=0; i<bs.length(); i++) {
mid = (floor + ceiling) / 2;
if (bs.get(i))
floor = mid;
else
ceiling = mid;
}
return mid;
}
public String encode(double lat, double lon) {
BitSet latbits = getBits(lat, -90, 90);
BitSet lonbits = getBits(lon, -180, 180);
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < numbits; i++) {
buffer.append( (lonbits.get(i))?'1':'0');
buffer.append( (latbits.get(i))?'1':'0');
}
return base32(Long.parseLong(buffer.toString(), 2));
}
private BitSet getBits(double lat, double floor, double ceiling) {
BitSet buffer = new BitSet(numbits);
for (int i = 0; i < numbits; i++) {
double mid = (floor + ceiling) / 2;
if (lat >= mid) {
buffer.set(i);
floor = mid;
} else {
ceiling = mid;
}
}
return buffer;
}
public static String base32(long i) {
char[] buf = new char[65];
int charPos = 64;
boolean negative = (i < 0);
if (!negative)
i = -i;
while (i <= -32) {
buf[charPos--] = digits[(int) (-(i % 32))];
i /= 32;
}
buf[charPos] = digits[(int) (-i)];
if (negative)
buf[--charPos] = '-';
return new String(buf, charPos, (65 - charPos));
}
}
| [
"[email protected]"
] | |
5aabe74b7c60459f8109fe2d0dbb9e5cb1082aed | fbfe00e90919b2639a8808b4700fd8541b972872 | /src-tests/br/unb/cic/poo/mh/TestGuardas.java | 63a589ff9cc62b2f2486df97a3519bdf7681c11d | [] | no_license | rchehab/mini-haskell | 0782d278666aad086067bfea429e5a5190536a15 | 4a2a2ca7459f3084da6f8d635678793dc5703168 | refs/heads/master | 2020-06-16T12:23:56.461810 | 2016-12-16T23:50:47 | 2016-12-16T23:50:47 | 75,102,746 | 0 | 1 | null | 2016-11-30T19:02:54 | 2016-11-29T16:57:15 | Java | UTF-8 | Java | false | false | 1,594 | java | package br.unb.cic.poo.mh;
import org.junit.Test;
import br.unb.poo.mh.*;
import java.util.Vector;
import org.junit.Assert;
import org.junit.Before;
public class TestGuardas {
Guarda ng;
@Before
public void SetUp() {
ng = new Guarda(new ExpressaoOr(new ValorBooleano(false), new ValorBooleano(true)), new ValorInteiro(1));
}
@Test
public void testBasico() {
Assert.assertEquals(ng.tipo(Tipo.Indefinido), Tipo.Inteiro);
Assert.assertEquals(ng.avaliar(), new ValorInteiro(1));
}
@Test
public void testComplexo() {
ValorInteiro v1 = new ValorInteiro(1);
ValorInteiro v10 = new ValorInteiro(10);
Guarda a = new Guarda(new ValorBooleano(false), new ValorInteiro(1));
Guarda b = new Guarda(new ExpressaoLessThan(new Multiplicacao(v1, v10), new ExpressaoSoma(v1, v10)), new ValorBooleano(true));
Guarda c = new Guarda(new ValorBooleano(true), new ExpressaoOr(new ValorBooleano(true), new ValorBooleano(false)));
Vector<Guarda> gua = new Vector<Guarda>();
gua.add(a);
gua.add(b);
gua.add(ng);
gua.add(c);
Guardas g = new Guardas(gua);
Assert.assertEquals(g.tipo(Tipo.Indefinido), Tipo.Error);
Assert.assertEquals(g.avaliar(), new ValorBooleano(true));
PrettyPrinter pp = new PrettyPrinter();
g.aceitar(pp);
System.out.println(pp.getStr() + "\n");
TamanhoDasExpressoes te = new TamanhoDasExpressoes();
g.aceitar(te);
System.out.println(te.getTamanho() + "\n");
NotacaoPolonesaReversa npr = new NotacaoPolonesaReversa();
g.aceitar(npr);
System.out.println(npr.getStr() + "\n");
}
}
| [
"[email protected]"
] | |
b5266e849c4157221150ef949f01c72945a611bd | acb7d33ece64e71c3782312ff702d801be0f56c3 | /src/main/java/com/wyait/manage/pojo/NoteUser.java | 4b1547e8c88a6ec025fbd41e04fbe3722704b432 | [] | no_license | ygj9915/wyait-manage | 18550106cfef732d7e964d51fa27f01d1b29e660 | 9bf77ffe058bec5d5099bc068baf43918fbac067 | refs/heads/master | 2020-03-28T05:00:16.967984 | 2018-09-17T02:56:43 | 2018-09-17T02:56:43 | 147,750,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,520 | java | package com.wyait.manage.pojo;
import java.io.Serializable;
import java.util.Date;
/**
* @author yeguojian
* date:2018/06/17 01:03
*/
public class NoteUser implements Serializable {
/** 串行版本ID*/
private static final long serialVersionUID = -5748612010413863826L;
/** id主键 */
private Integer id;
/** 模板标题 */
private String smsTitle;
/** 用户主键id */
private Integer userId;
/** 短信内容 */
private String smsTemplate;
/** 添加时间 */
private Date insertTime;
/** 更新时间 */
private Date updateTime;
public String getSmsTitle() {
return smsTitle;
}
public void setSmsTitle(String smsTitle) {
this.smsTitle = smsTitle;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getSmsTemplate() {
return smsTemplate;
}
public void setSmsTemplate(String smsTemplate) {
this.smsTemplate = smsTemplate;
}
public Date getInsertTime() {
return insertTime;
}
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
} | [
"[email protected]"
] | |
1379b46616b0bedf40445412dfbfe063322d9af9 | 74b18cbdaf98cea2282d2d976f2783d97a0ed8cd | /src/main/java/com/example/demo/controller/DriverController.java | 4d89f33c49f383546456b5210cf4103321d35fe9 | [] | no_license | tuyenvu14/ManageTransport | dbc724dc7cafabf0f0b97abd617c6a676f43b6d7 | 30955deb8fd46fcb4475aca25bed0327c7349d68 | refs/heads/master | 2023-01-12T19:37:51.377888 | 2020-11-13T08:39:22 | 2020-11-13T08:39:22 | 312,517,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,816 | java | package com.example.demo.controller;
import com.example.demo.model.CarDto;
import com.example.demo.model.DriverDto;
import com.example.demo.service.car.CarService;
import com.example.demo.service.driver.DriverService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Controller
@RestController
@RequestMapping("api/v1/")
public class DriverController {
private static final Logger logger = LoggerFactory.getLogger(CarController.class);
@Autowired
private DriverService driverService;
@PostMapping(value = "drivers", produces = "application/json")
public ResponseEntity<?> createDriver(@RequestBody DriverDto driverDto){
logger.info("created new driver : {}", driverDto);
try{
DriverDto createdDriverDto = driverService.createDriver(driverDto);
logger.info("create successfully");
return new ResponseEntity<>(createdDriverDto, HttpStatus.OK);
}catch (NullPointerException e){
logger.error("error : {}", e);
return new ResponseEntity<>(HttpStatus.SEE_OTHER.getReasonPhrase(), HttpStatus.SEE_OTHER);
}
}
@PutMapping(value = "drivers", produces = "application/json")
public ResponseEntity<?> updateDriver( @RequestBody DriverDto dto){
logger.info("update driver = {}", dto);
DriverDto updatedDriverDto = driverService.updateDriver(dto);
if (updatedDriverDto != null){
logger.info("update successfully");
return new ResponseEntity<>(updatedDriverDto, HttpStatus.OK);
}
else{
logger.error("update error");
return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE.getReasonPhrase(),HttpStatus.NOT_ACCEPTABLE);
}
}
@DeleteMapping(value = "/drivers/{id}", produces = "application/json")
public ResponseEntity<?> delete(@PathVariable int id){
logger.info("delete driver with id = {}",id);
DriverDto deletedDriverDto = driverService.deleteDriver(id);
if(deletedDriverDto != null){
logger.info("delete successfully");
return new ResponseEntity<>(deletedDriverDto,HttpStatus.OK);
}
else {
logger.error("delete failed");
return new ResponseEntity<>(HttpStatus.NOT_FOUND.getReasonPhrase(), HttpStatus.NOT_FOUND);
}
}
@GetMapping(value = "/drivers/{id}", produces = "application/json")
public ResponseEntity<?> findById(@PathVariable int id){
logger.info("get driver by id : {}",id);
DriverDto driverDto = driverService.findDriver(id);
if(driverDto != null){
logger.info("get driver by id successfully");
return new ResponseEntity<>(driverDto, HttpStatus.OK);
}
else {
logger.error("get driver by id failed");
return new ResponseEntity<>(HttpStatus.NOT_FOUND.getReasonPhrase(), HttpStatus.NOT_FOUND);
}
}
@GetMapping(value = "/drivers", produces = "application/json")
public ResponseEntity<?> findAll(){
logger.info("get all driver" );
List<DriverDto> listDriverDto = driverService.findAllDriver();
if(listDriverDto.size() != 0){
logger.info("get all driver successfully");
return new ResponseEntity<>(listDriverDto, HttpStatus.OK);
}
else {
logger.error("get driver by failed");
return new ResponseEntity<>(HttpStatus.NOT_FOUND.getReasonPhrase(), HttpStatus.NOT_FOUND);
}
}
}
| [
"[email protected]"
] | |
d11658b316f4ac9712ca7b97b021551e1bdb5911 | 8a7470325e22d78f6c9bb81297bd445a3438607b | /java/ui/UserIOConsoleImpl.java | 43e40e2fc810420419ffeefe6b7e59288492038f | [] | no_license | retnuh101/GuildProjects | 6ef9289673592488506723057336dfb8d93e11c3 | ee7de22c7ab0a82891af4e99eb6d9b87a0e18178 | refs/heads/master | 2022-12-04T23:53:58.636643 | 2020-08-16T16:46:30 | 2020-08-16T16:46:30 | 256,286,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,228 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ui;
import java.util.Scanner;
/**
*
* @author hschuler2992
*/
public class UserIOConsoleImpl implements UserIO{
Scanner scanner = new Scanner(System.in);
@Override
public void print(String message) {
System.out.println(message);
}
@Override
public double readDouble(String prompt) {
double result;
print(prompt);
result = scanner.nextDouble();
scanner.nextLine();
return result;
}
@Override
public double readDouble(String prompt, double min, double max) {
double result = 0.0;
boolean badInput = true;
while (badInput) {
result = readDouble(prompt);
if (result >= min && result <= max) {
badInput = false;
} else {
System.out.println("Input needs to be >= " + min + " and <= " + max);
}
}
return result;
}
@Override
public float readFloat(String prompt) {
float result;
print(prompt);
result = scanner.nextFloat();
scanner.nextLine();
return result;
}
@Override
public float readFloat(String prompt, float min, float max) {
float result = 0;
boolean badInput = true;
while (badInput) {
result = readFloat(prompt);
if (result >= min && result <= max) {
badInput = false;
} else {
System.out.println("Input needs to be >= " + min + " and <= " + max);
}
}
return result;
}
@Override
public int readInt(String prompt) {
int result;
print(prompt);
result = scanner.nextInt();
scanner.nextLine();
return result;
}
@Override
public int readInt(String prompt, int min, int max) {
int result = 0;
boolean badInput = true;
while (badInput) {
result = readInt(prompt);
if (result >= min && result <= max) {
badInput = false;
} else {
System.out.println("Input need to be >= " + min + " and <= " + max);
}
}
return result;
}
@Override
public long readLong(String prompt) {
long result;
print(prompt);
result = scanner.nextLong();
scanner.nextLine();
return result;
}
@Override
public long readLong(String prompt, long min, long max) {
long result = 0;
boolean badInput = true;
while (badInput) {
result = readLong(prompt);
if (result >= min && result <= max) {
badInput = false;
} else {
System.out.println("Input need to be >= " + min + " and <= " + max);
}
}
return result;}
@Override
public String readString(String prompt) {
String result = "";
print(prompt);
result = scanner.nextLine();
return result;
}
}
| [
"[email protected]"
] | |
6ad389aa52ccc0e5e347dc82bf3fd1bf9de5bc4c | e8d1f8cde300251198d6f939cfe2cd82be0d0083 | /Plugins_ykfs/src/main/java/com/ykfs/plugins/generate/GenerateSetterWithFinal.java | 28d00cec3fc34117924555d337b55e46d48a891a | [] | no_license | ykfs/IDEA_Plugins | 50c1e7ac1bb58b20c24045f117b2044f4f052121 | 59f989e9307b852dd28857f8aba12ca4d3bc86de | refs/heads/master | 2021-01-19T02:35:35.320133 | 2016-07-15T02:34:22 | 2016-07-15T02:34:22 | 54,606,770 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | package main.java.com.ykfs.plugins.generate;
import com.intellij.codeInsight.CodeInsightActionHandler;
import com.intellij.codeInsight.generation.actions.BaseGenerateAction;
import main.java.com.ykfs.plugins.generate.handler.GenerateSetterWithFinalHandler;
/**
* Created by ykf on 2016/3/10.
*/
public class GenerateSetterWithFinal extends BaseGenerateAction {
public GenerateSetterWithFinal() {
super(new GenerateSetterWithFinalHandler());
}
}
| [
"[email protected]"
] | |
10f62de48adfac55f3b218b94e309d0eed614530 | a9e3c5c346415706291b7807c4711e75f82691e7 | /wear/src/main/java/com/shubhamk/datacollectionwear/MessageService.java | f66b6b6e0f3e4e00d94bd9a3cefd4a73dcee6275 | [] | no_license | shubham-kumar1410/DataCollectionWear | 8450f1625f950c5c5fb78a0e5eb6e72b5e426ba2 | d043dfddb987e04f6b633a5d4a599e70d177f13e | refs/heads/master | 2020-05-18T08:50:28.540798 | 2019-04-30T17:57:37 | 2019-04-30T17:57:37 | 184,307,416 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 856 | java | package com.shubhamk.datacollectionwear;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;
import com.google.android.gms.wearable.MessageEvent;
import com.google.android.gms.wearable.WearableListenerService;
public class MessageService extends WearableListenerService {
@Override
public void onMessageReceived(MessageEvent messageEvent) {
if (messageEvent.getPath().equals("/my_path")) {
final String message = new String(messageEvent.getData());
Intent messageIntent = new Intent();
messageIntent.setAction(Intent.ACTION_SEND);
messageIntent.putExtra("message", message);
LocalBroadcastManager.getInstance(this).sendBroadcast(messageIntent);
}
else {
super.onMessageReceived(messageEvent);
}
}
}
| [
"[email protected]"
] | |
df9ead8438dc1b33ed6c396f23d84bb64410cdeb | c4672821f2aff60b9d1ab99ba378e266687b1b84 | /webService/src/main/java/com/by/WebSecurityConfig.java | cc399cb788c7826a5ee3a35114f24486ee367b27 | [] | no_license | dingjing0518/CCHCrm | e761d2f8b55ad25e7a8984cb11f380c561bcdce4 | 3c18a9bdea98e5e90a35f739d6454106b45f56a1 | refs/heads/master | 2021-01-02T00:59:40.292835 | 2017-08-01T02:02:27 | 2017-08-01T02:02:27 | 98,948,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package com.by;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.authorizeRequests().antMatchers("/cache/**").hasIpAddress("127.0.0.1");
}
}
| [
"[email protected]"
] | |
6e98f10cb841e70312966664b3e4624b860373dd | f2e821cccdf69587cc611642f327fe65582fd9d9 | /src/main/java/com/soar/servlet/user/UserServlet.java | 454467df56321bf9f26fbf852cf08ab9007d3aba | [] | no_license | Soar-Xie/smbms-web | d186ac276013e88ed738f68cca51b9963368408d | 6ba6259088e0fd38f5c65e34de484379b78602d2 | refs/heads/master | 2023-03-27T22:28:05.809127 | 2021-04-02T02:34:00 | 2021-04-02T02:34:00 | 353,883,184 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,341 | java | package com.soar.servlet.user;
import com.alibaba.fastjson.JSONArray;
import com.mysql.cj.util.StringUtils;
import com.soar.pojo.User;
import com.soar.service.user.UserService;
import com.soar.service.user.UserServiceImpl;
import com.soar.util.Constants;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
public class UserServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String method = req.getParameter("method");
if (method.equals("savepwd") && method != null) {
this.updatePwd(req, resp);
} else if (method.equals("pwdmodify") && method != null) {
this.pmwdModify(req, resp);
}
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req, resp);
}
//修改密码
public void updatePwd(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//从session拿id
Object o = req.getSession().getAttribute(Constants.USER_SESSION);
String newpassword = req.getParameter("newpassword");
boolean flag = false;
if (o != null && !StringUtils.isNullOrEmpty(newpassword)) {
UserService userService = new UserServiceImpl();
flag = userService.updatePwd(((User) o).getId(), newpassword);
if (flag) {
req.setAttribute("message", "修改成功,请退出,用新密码登录");
//密码修改成功,移除session
req.getSession().removeAttribute(Constants.USER_SESSION);
} else {
//密码修改失败
req.setAttribute("message", "密码修改成功,请退出,用新密码登录");
}
} else {
req.setAttribute("message", "新密码有问题");
}
req.getRequestDispatcher("pwdmodify.jsp").forward(req, resp);
}
//验证旧密码
public void pmwdModify(HttpServletRequest req, HttpServletResponse resp) throws IOException {
Object o = req.getSession().getAttribute(Constants.USER_SESSION);
String oldpassword = req.getParameter("oldpassword");
Map<String, String> resultMap = new HashMap<String, String>();
if (o == null) { //session过期,用户为空
resultMap.put("result", "sessionerror");
} else if (StringUtils.isNullOrEmpty(oldpassword)) { //旧密码输入为空
resultMap.put("result", "error");
} else {
String userPassword = ((User) o).getUserPassword();
if (userPassword.equals(oldpassword)) {
resultMap.put("result", "true");
} else {
resultMap.put("result", "false");
}
}
resp.setContentType("application/json");
PrintWriter outPrintWriter = resp.getWriter();
outPrintWriter.write(JSONArray.toJSONString(resultMap));
outPrintWriter.flush();
outPrintWriter.close();
}
}
| [
"[email protected]"
] | |
a439a2541e1d4413e3936f345b1c769c4db8a41c | 2eb82c84e0622bb1bf2ccceaba2c400619cc837c | /src/main/java/org/handmade/miniproject/common/dto/ListResponseDTO.java | 661bd69251951e71cb3f01bf25b50e78f87385bd | [] | no_license | stxz00/miniproject | 70493b08c6c368dc8e8facae0b088264b28f8af7 | b3143b328766964e59d62a8424ff600eb0aa00e3 | refs/heads/main | 2023-06-24T11:49:38.658271 | 2021-07-27T15:18:11 | 2021-07-27T15:18:11 | 384,084,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 482 | java | package org.handmade.miniproject.common.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ListResponseDTO<D> { //공용이니 제네릭으로 어느 DTO 가 오든 사용 가능
private ListRequestDTO listRequestDTO;
private List<D> dtoList;
private PageMaker pageMaker;
private int page,start,end;
}
| [
"[email protected]"
] | |
1bee756843e4581a16b5c6d0bedb860538c95a4c | eb3861ca9cb4dc0be9dc6f225e75ad79c2628091 | /android_testing/src/main/java/ides/link/androidtesting/notes/data/Note.java | d0fce57522ec47b488918e7ce6cec5b795d481f8 | [
"Apache-2.0"
] | permissive | eman-1111/GoogleCodelabs | 64a8fc603878e75efffa1741cd8d3fec83a4c7c1 | fe85fe6500371dba1b718092e0c0d8444d0a915a | refs/heads/master | 2021-09-14T15:16:48.904286 | 2018-05-15T14:05:23 | 2018-05-15T14:05:23 | 106,164,037 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,382 | java | /*
* Copyright 2015, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ides.link.androidtesting.notes.data;
import com.google.common.base.Objects;
import android.support.annotation.Nullable;
import java.util.UUID;
/**
* Immutable model class for a Note.
*/
public final class Note {
private final String mId;
@Nullable
private final String mTitle;
@Nullable
private final String mDescription;
@Nullable
private final String mImageUrl;
public Note(@Nullable String title, @Nullable String description) {
this(title, description, null);
}
public Note(@Nullable String title, @Nullable String description, @Nullable String imageUrl) {
mId = UUID.randomUUID().toString();
mTitle = title;
mDescription = description;
mImageUrl = imageUrl;
}
public String getId() {
return mId;
}
@Nullable
public String getTitle() {
return mTitle;
}
@Nullable
public String getDescription() {
return mDescription;
}
@Nullable
public String getImageUrl() {
return mImageUrl;
}
public boolean isEmpty() {
return (mTitle == null || "".equals(mTitle)) &&
(mDescription == null || "".equals(mDescription));
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Note note = (Note) o;
return Objects.equal(mId, note.mId) &&
Objects.equal(mTitle, note.mTitle) &&
Objects.equal(mDescription, note.mDescription) &&
Objects.equal(mImageUrl, note.mImageUrl);
}
@Override
public int hashCode() {
return Objects.hashCode(mId, mTitle, mDescription, mImageUrl);
}
}
| [
"[email protected]"
] | |
8fffd35e7bd97fe1280641f468dde8035f833e42 | 03212037291835fd1cd6b5e6a346e3ea2e4060da | /2_algorithmization/src/by/epam/module02/onedimensional_array/Task8.java | a3a40cfcce96b538c5bab6ea254ff27add1c2ed4 | [] | no_license | CyrilKrylov/IntroductionToJava | 139d5585866e74184dfb1f5239fc54300deffc62 | 0f26c3b5b264da0c1d4542acb7c33128031d925d | refs/heads/master | 2022-11-13T20:02:31.883865 | 2020-07-01T05:26:51 | 2020-07-01T05:26:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,073 | java | package by.epam.module02.onedimensional_array;
/*Дана последовательность целых чисел a1,a2,...,an . Образовать новую последовательность, выбросив из
исходной те члены, которые равны min(a1,a2,...,an)*/
public class Task8 {
public static int[] getNewSequence(int[] a) {
int min = a[0];
int count = 1;
for (int i = 1; i < a.length; i++) {
if (min > a[i]) {
min = a[i];
count = 1;
} else if (min == a[i]) {
count++;
}
}
return fillNewSequence(a, count, min);
}
private static int[] fillNewSequence(int[] a, int size, int minValue) {
int[] outValues = new int[a.length - size];
int j = 0;
for (int i = 0; i < a.length; i++) {
if (a[i] != minValue) {
outValues[j] = a[i];
j++;
}
}
return outValues;
}
}
| [
"[email protected]"
] | |
19d82a29def6ec6d2b164cb9c70c300f3ba79084 | 43e59cb5333ab4a395c1a5136fff455b7742d7da | /ipl-dashboard/src/test/java/io/sandeshn/ipldashboard/IplDashboardApplicationTests.java | 5f6fe7a63f3e1981813bc61dfab80d740e841dd5 | [] | no_license | sandesh201/IPL-dashboard | e030da7a4f418bf71e9aeccdffd034c690904870 | 00dda05828fac60c53d0338ce0a9f87a94382adc | refs/heads/main | 2023-05-28T16:30:06.729413 | 2021-06-09T06:05:54 | 2021-06-09T06:05:54 | 374,981,481 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package io.sandeshn.ipldashboard;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class IplDashboardApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
5adbc87b8d6d6365d7ab9bfb19d88ab8811d6c2a | f1d53bd1f9379a92e85a53332d4f6dc1489c33fc | /src/com/company/Circle.java | 728da2fc3ecdfa6ffbfd96044f0fd8d3d1f29210 | [] | no_license | LukPrasek/SelfLearningInterface | 68a7ba2e777845d890a584d65c8290fec018bbea | 2d8fa8581f862b4e687fa4f5661d12ab8779e8b1 | refs/heads/master | 2021-08-29T17:06:27.384415 | 2017-12-14T11:25:41 | 2017-12-14T11:25:41 | 114,242,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package com.company;
public class Circle implements Figure {
public Circle (int r) {
this.r=r;
}
private int r;
@Override
public double getPerimeter() {
return 2*Math.PI*r;
}
@Override
public double getArea() {
return Math.PI*Math.pow(r,2);
}
@Override
public String getType() {
return "Circle";
}
}
| [
"[email protected]"
] | |
8e4b0fa10eca572d2c4e303f85cb7069e67dd348 | 38dd6f7f36fb0bdc92050d611f5d1b5d86e91f50 | /src/main/java/com/foxwho/demo/adapter/MyWebSecurityConfig.java | b165d7c9e5393d1f76b8cd0bcdbc19d5d89caa67 | [] | no_license | foxiswho/java-spring-boot2-security-jwt-demo | f7aa15782ae319db51b35cf95abec3ce80931371 | 8a2e0534b4e34550e77fb33f623fd76df56559d6 | refs/heads/master | 2020-04-08T18:44:53.447310 | 2018-11-30T09:19:59 | 2018-11-30T09:19:59 | 159,623,097 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,717 | java | package com.foxwho.demo.adapter;
import com.foxwho.demo.filter.MyJWTAuthenticationFilter;
import com.foxwho.demo.filter.JWTAuthenticationFilter;
import com.foxwho.demo.handler.Http401AuthenticationEntryPoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
/**
* SpringSecurity的配置
* 通过SpringSecurity的配置,将JWTLoginFilter,JWTAuthenticationFilter组合在一起
*/
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(securedEnabled = true)
public class MyWebSecurityConfig extends WebSecurityConfigurerAdapter {
/**
* 需要放行的URL
*/
private static final String[] AUTH_WHITELIST = {
// -- register login url
"/auth/register",
"/auth/login",
// -- swagger ui
"/swagger-resources",
"/swagger-resources/**",
"/configuration/ui",
"/configuration/security",
"/swagger-ui.html",
"/other/**"
};
@Autowired
@Qualifier("userDetailsServiceImpl")
private UserDetailsService userDetailsService;
/**
* 登录的时候,使用自定义身份验证组件
*
* @param auth
* @throws Exception
*/
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
// 使用自定义身份验证组件
auth.authenticationProvider(new MyAuthenticationProvider(userDetailsService));
}
/***
* 设置 HTTP 验证规则
* @param http
* @throws Exception
*/
@Override
protected void configure(HttpSecurity http) throws Exception {
//跨域
http.cors().and().csrf().disable()
// 不需要session
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests()
//需要放行的URL
.antMatchers(AUTH_WHITELIST).permitAll()
.anyRequest().authenticated() // 所有请求需要身份认证
.and()
.exceptionHandling()
.authenticationEntryPoint(
new Http401AuthenticationEntryPoint("Basic xxxx"))
.and()
// .exceptionHandling().accessDeniedHandler(customAccessDeniedHandler) // 自定义访问失败处理器
// .and()
.addFilter(new JWTAuthenticationFilter(authenticationManager()))
.addFilter(new MyJWTAuthenticationFilter(authenticationManager()))
// 默认注销行为为logout,可以通过下面的方式来修改
.logout()
.logoutUrl("/logout")
// 设置注销成功后跳转页面,默认是跳转到登录页面;
.logoutSuccessUrl("/login")
// .logoutSuccessHandler(customLogoutSuccessHandler)
//其他都放行
.permitAll();
}
}
| [
"[email protected]"
] | |
798e6a65d5565d0cf08f2614b10f113b7985b81a | fa313cab0af7d7a67de588c9a9f67158933e9567 | /src/main/java/kg/attractor/onlineshop/config/brand/BrandService.java | f03e578056fed9f400fcd0469fcc63cc56967d6d | [] | no_license | semma19989/month9-onlineshop | 0471bc873aa472f245f3806ee7308ad89afe08e9 | d56efaf21d8fdab12d5fc4099a8cbb4fa62a9495 | refs/heads/master | 2022-06-16T16:23:59.191098 | 2020-05-11T11:55:01 | 2020-05-11T11:55:01 | 259,747,769 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 961 | java | package kg.attractor.onlineshop.config.brand;
import kg.attractor.onlineshop.exception.ResourceNotFoundException;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@AllArgsConstructor
public class BrandService {
private final BrandRepository brandRepository;
public Page<BrandDTO> getBrands(Pageable pageable) {
return brandRepository.findAll(pageable)
.map(BrandDTO::from);
}
public BrandDTO getBrand(int id) {
Brand place = brandRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("brand", id));
return BrandDTO.from(place);
}
public List<Brand> findAll() {
return brandRepository.findAll();
}
public List<Brand> getByName(String name) {
return brandRepository.getByName(name);
}
}
| [
"semm1998"
] | semm1998 |
1897951866a5cc444219ea601071de9d559f7848 | fc9b8584cfbb638332535af83e341252d46174fd | /app/src/main/java/br/com/danielsantana/weathershow/model/Item.java | 4e94ba178b88087ca2dec2e66fa1eb92eefbfa6b | [] | no_license | danielqejo/WeatherShow | f07b6bdd1eb13d50944147d88a0a54a4354dfba9 | 46746045869ad703dc6e48e6d785656a135e5393 | refs/heads/master | 2021-01-12T17:14:45.674785 | 2016-10-21T03:12:12 | 2016-10-21T03:12:12 | 71,525,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 632 | java | package br.com.danielsantana.weathershow.model;
public class Item {
private Long latitude;
private Long longitude;
private Condition condition;
public Long getLatitude() {
return latitude;
}
public void setLatitude(Long latitude) {
this.latitude = latitude;
}
public Long getLongitude() {
return longitude;
}
public void setLongitude(Long longitude) {
this.longitude = longitude;
}
public Condition getCondition() {
return condition;
}
public void setCondition(Condition condition) {
this.condition = condition;
}
}
| [
"[email protected]"
] | |
349167a35821631b7a6700a90eabd12320ba2518 | 646bdbeaecb855eac953cf183b50fdf305a1ab4a | /src/main/java/net/gltd/gtms/jaxb/GtxAction.java | 42095d7f2c6fd30eb4e8cbb2f65a2d11ef87eea6 | [] | no_license | Globility/xmpp-extensions-gtx | d469956556f2d6a1132d87ce5ff620754479d635 | aa1ba572f1359a56fa00193049a62420bd3cc43b | refs/heads/master | 2020-06-02T23:56:53.934358 | 2015-09-10T16:23:01 | 2015-09-10T16:23:01 | 37,861,551 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package net.gltd.gtms.jaxb;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "gtx-action", namespace = "http://gltd.net/protocol/gtx")
@XmlType(propOrder = { "system", "action" })
@XmlAccessorType(XmlAccessType.FIELD)
public class GtxAction {
@XmlElement(name = "system", namespace = "http://gltd.net/protocol/gtx")
private String system;
@XmlElement(name = "action", namespace = "http://gltd.net/protocol/gtx")
private Action action;
public String getSystem() {
return this.system;
}
public void setSystem(String system) {
this.system = system;
}
public Action getAction() {
return this.action;
}
public void setAction(Action action) {
this.action = action;
}
}
| [
"[email protected]"
] | |
db0faf2fb373497243aadbc86e1a67b569188922 | b8a3722927230fec536bf9e3b1c65331e1aa8c7c | /src/main/java/com/harry/tomcat/ex01/Request.java | 6854137debfff9e8e32e8e7553fad12008f9141a | [] | no_license | buffon/TomcatShoot | 7a9535bf4694e73629402a7874d3304cb547d490 | fc1451c61686aca2e665e13182c140cd5b4869da | refs/heads/master | 2016-09-06T05:35:01.930234 | 2015-01-12T04:24:20 | 2015-01-12T04:24:20 | 27,675,082 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,044 | java | package com.harry.tomcat.ex01;
import java.io.InputStream;
import java.io.IOException;
public class Request {
private InputStream input;
private String uri;
public Request(InputStream input) {
this.input = input;
}
public void parse() {
// Read a set of characters from the socket
StringBuffer request = new StringBuffer(2048);
int i;
byte[] buffer = new byte[2048];
try {
i = input.read(buffer);
}
catch (IOException e) {
e.printStackTrace();
i = -1;
}
for (int j=0; j<i; j++) {
request.append((char) buffer[j]);
}
System.out.print(request.toString());
uri = parseUri(request.toString());
}
private String parseUri(String requestString) {
int index1, index2;
index1 = requestString.indexOf(' ');
if (index1 != -1) {
index2 = requestString.indexOf(' ', index1 + 1);
if (index2 > index1)
return requestString.substring(index1 + 1, index2);
}
return null;
}
public String getUri() {
return uri;
}
} | [
"[email protected]"
] | |
d19e8ce4978a575df031f15ed093e8a960c6da77 | 75950d61f2e7517f3fe4c32f0109b203d41466bf | /tests/tags/ci-1.8/test-timer-implementation/src/main/java/org/fabric3/tests/timer/TransactionalTimedComponent.java | 03964e167da7acbe226715187f9e0768b39b3716 | [
"Apache-2.0"
] | permissive | codehaus/fabric3 | 3677d558dca066fb58845db5b0ad73d951acf880 | 491ff9ddaff6cb47cbb4452e4ddbf715314cd340 | refs/heads/master | 2023-07-20T00:34:33.992727 | 2012-10-31T16:32:19 | 2012-10-31T16:32:19 | 36,338,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,528 | java | /*
* Fabric3
* Copyright (c) 2009 Metaform Systems
*
* Fabric3 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version, with the
* following exception:
*
* Linking this software statically or dynamically with other
* modules is making a combined work based on this software.
* Thus, the terms and conditions of the GNU General Public
* License cover the whole combination.
*
* As a special exception, the copyright holders of this software
* give you permission to link this software with independent
* modules to produce an executable, regardless of the license
* terms of these independent modules, and to copy and distribute
* the resulting executable under terms of your choice, provided
* that you also meet, for each linked independent module, the
* terms and conditions of the license of that module. An
* independent module is a module which is not derived from or
* based on this software. If you modify this software, you may
* extend this exception to your version of the software, but
* you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* Fabric3 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 Fabric3.
* If not, see <http://www.gnu.org/licenses/>.
*/
package org.fabric3.tests.timer;
import javax.transaction.Status;
import javax.transaction.SystemException;
import javax.transaction.TransactionManager;
import org.oasisopen.sca.ServiceRuntimeException;
import org.oasisopen.sca.annotation.Reference;
import org.fabric3.api.annotation.Resource;
/**
* @version $Rev$ $Date$
*/
public class TransactionalTimedComponent implements Runnable {
@Reference
protected LatchService latchService;
@Resource
protected TransactionManager tm;
public void run() {
try {
if (Status.STATUS_ACTIVE != tm.getStatus()) {
throw new ServiceRuntimeException("Transaction must be active");
}
} catch (SystemException e) {
throw new ServiceRuntimeException("Transaction must be active");
}
latchService.countDown();
}
} | [
"jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf"
] | jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf |
1872c9dd8416f05e47c4b209f56978127b89a1c9 | c0b37a664fde6a57ae61c4af635e6dea28d7905e | /Helpful dev stuff/AeriesMobilePortal_v1.2.0_apkpure.com_source_from_JADX/kotlin/collections/IndexingIterable.java | 606bc9948f36cd905eda5dd31cf8f06e7ed3c40a | [] | no_license | joshkmartinez/Grades | a21ce8ede1371b9a7af11c4011e965f603c43291 | 53760e47f808780d06c4fbc2f74028a2db8e2942 | refs/heads/master | 2023-01-30T13:23:07.129566 | 2020-12-07T18:20:46 | 2020-12-07T18:20:46 | 131,549,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,702 | java | package kotlin.collections;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMappedMarker;
import org.jetbrains.annotations.NotNull;
@Metadata(bv = {1, 0, 2}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u001c\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010(\n\u0002\b\u0003\b\u0000\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u00030\u0002B\u0019\u0012\u0012\u0010\u0004\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00060\u0005¢\u0006\u0002\u0010\u0007J\u0015\u0010\b\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00030\u0006H\u0002R\u001a\u0010\u0004\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00060\u0005X\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlin/collections/IndexingIterable;", "T", "", "Lkotlin/collections/IndexedValue;", "iteratorFactory", "Lkotlin/Function0;", "", "(Lkotlin/jvm/functions/Function0;)V", "iterator", "kotlin-stdlib"}, k = 1, mv = {1, 1, 10})
/* compiled from: Iterables.kt */
public final class IndexingIterable<T> implements Iterable<IndexedValue<? extends T>>, KMappedMarker {
private final Function0<Iterator<T>> iteratorFactory;
public IndexingIterable(@NotNull Function0<? extends Iterator<? extends T>> function0) {
Intrinsics.checkParameterIsNotNull(function0, "iteratorFactory");
this.iteratorFactory = function0;
}
@NotNull
public Iterator<IndexedValue<T>> iterator() {
return new IndexingIterator((Iterator) this.iteratorFactory.invoke());
}
}
| [
"[email protected]"
] | |
544415fb3c2c45c85b509d99b15fd327c8bb4d12 | 2f37d16052830c8b7d066bd04e667af01aae3474 | /GET_2018_ALL/src/com/metacube/nestedinteger/ImplementNestedList.java | 73aa4eca499a53b0d22dc3c0f4f6b6ecda6b3e15 | [] | no_license | meta-rahul-sharma/GET2018 | 35ce304ed71707f52eaf06effc621925009c8c3d | ace64ec33e6366337f8fc3975af2ddb75b544174 | refs/heads/master | 2020-03-22T23:23:51.476387 | 2019-04-02T06:44:17 | 2019-04-02T06:44:17 | 140,807,785 | 0 | 0 | null | 2019-04-02T06:44:18 | 2018-07-13T06:41:14 | Java | WINDOWS-1252 | Java | false | false | 3,700 | java | package com.metacube.nestedinteger;
import java.util.List;
/**
* Implementation of NestedList and its function definition
*
* @author Rahul Sharma Creation Date: 6/8/2018
*/
public class ImplementNestedList implements NestedList {
/**
* To get the total sum of the nested list and return the sum
*/
@SuppressWarnings("rawtypes")
@Override
public int sum(Object object) throws NestedListException {
int sum = 0;
// base condition of the recursion
if (object instanceof Integer) {
sum = (Integer) object;
} else if (object instanceof List) {
// Iterate if object is list
for (Object iterator : (List) object) {
sum += sum(iterator);
}
} else {
throw new NestedListException("Wrong object Type");
}
return sum;
}
/**
* To return largest value in the nested list
*/
@SuppressWarnings("rawtypes")
@Override
public int largestValue(Object object) throws NestedListException {
int largestValue = 0;
boolean flag = false;
// base condition of the recursion
if (object instanceof Integer) {
largestValue = (Integer) object;
} else if (object instanceof List) {
// Iterate if object is list
for (Object iterator : (List) object) {
if (!flag) {
largestValue = largestValue(iterator);
flag = true;
}
largestValue = Math.max(largestValue, largestValue(iterator));
}
} else {
throw new NestedListException("Wrong object Type");
}
return largestValue;
}
/**
* Return true if given value by user exist in the nested list else returns
* false
*/
@SuppressWarnings("rawtypes")
@Override
public boolean search(Object object, int value) throws NestedListException {
boolean search = false;
// base condition of the recursion
if (object instanceof Integer) {
if ((Integer) object == value)
search = true;
} else if (object instanceof List) {
// Iterate if object is list
for (Object iterator : (List) object) {
if (!search && search(iterator, value)) {
search = true;
}
}
} else {
throw new NestedListException("Wrong object Type");
}
return search;
}
/**
* To extract an integer value from a specified position in the nested list.
* The position will be specified by a string formed using two characters
* ‘H’ (Head) and ‘T’ (Tail). Head represents the first value in the nested
* list, whereas the Tail formed by removing the head of the nested list
* @param object
* @param string
* @return traced value
* @throws NestedListException
*/
@SuppressWarnings("unchecked")
public int getValue(Object object, String string)
throws NestedListException {
int value = 0;
//base condition of getValue Method
if (string.length() == 0) {
if (object instanceof Integer) {
value = (Integer) object;
} else {
throw new NestedListException("Get Value String is Wrong");
}
} else if (object instanceof List) {
int stringPosition = 0;
int objectPosition = 0;
int stringLength = string.length();
int objectLength = ((List<Object>) object).size();
//check until we get Head in string
while (stringPosition < stringLength
&& objectPosition < objectLength
&& string.charAt(stringPosition) == 'T') {
stringPosition++;
objectPosition++;
}
//if string traced contain head then move for either list or integer recursively
if (stringPosition < stringLength && objectPosition < objectLength
&& string.charAt(stringPosition) == 'H') {
value = getValue(((List<Object>) object).get(objectPosition),
string.substring(stringPosition + 1, stringLength));
}
} else {
throw new NestedListException("Get Value String is Wrong");
}
return value;
}
}
| [
"[email protected]"
] | |
2d8ed3bd8b80381a3603705d5a2d9f2bf4a6a049 | ab1ad7b73a55cdc2a3b7864793be78382db59fa1 | /src/easy/No459.java | 3bbe381179c4da5515ce95ca60b96e38e23a3094 | [] | no_license | LZR29/LeetCode | 91f4c7c54d3d219e92c0c08b835ab621c7629e7f | e116471e6fa732765111d53de10159cf46c79fc7 | refs/heads/master | 2021-07-06T09:45:00.363291 | 2020-08-09T15:38:16 | 2020-08-09T15:38:16 | 160,787,233 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 682 | java | package easy;
import java.util.ArrayList;
import java.util.List;
/**
* @author linzerong
* @create 2019-08-09 18:25
*/
public class No459 {
public boolean repeatedSubstringPattern(String s) {
int len = s.length();
for (int i = 1; i < len; i++) {
if(len % i != 0){
continue;
}
String cur = s.substring(0, i);
int k = len / i;
StringBuilder sb = new StringBuilder(len);
for (int j = 0; j < k; j++) {
sb.append(cur);
}
if(sb.toString().equals(s)){
return true;
}
}
return false;
}
}
| [
"[email protected]"
] | |
5228b74097ae5af9d254fcdfcfd07821afb2137e | 64ad13bcd0b5aa5ff8546cb5d3c4903cabf53773 | /src/main/java/com/example/exemploSpring/repositorios/RepositorioUsuario.java | dbf0fcb8b3961e16bc73d359f9675adad407b003 | [] | no_license | Iafratetk/spring | 92910e7d5a7ed0828162e9790b91f16fbe2b968e | e92282452977823a99bfc1dac6515174bd0280b8 | refs/heads/master | 2020-06-18T09:26:42.856910 | 2019-07-10T22:20:43 | 2019-07-10T22:20:43 | 196,252,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | package com.example.exemploSpring.repositorios;
import org.springframework.data.jpa.repository.JpaRepository;
import com.example.exemploSpring.modelos.Usuario;
public interface RepositorioUsuario extends JpaRepository<Usuario, Long> {
Usuario findByEmail(String email);
}
| [
"lucas@DESKTOP-DTRAPNS"
] | lucas@DESKTOP-DTRAPNS |
a074f433af8accff3b3308d4611b64b66aafa610 | 64bdcf3199532e5e006f7ee7712975b384402e52 | /Blog/src/style/dx/java/util/DateUtils.java | 366a9e0f426ed6afd29841aa2de92f92dd843182 | [
"MIT"
] | permissive | xlui/Servlet-Jsp-Blog | 64ac90de75179dab429c024afd6ed13d5e26eb1c | 55f2f4f50c59bc1f7d6fdb747e0089b89bcdbe48 | refs/heads/master | 2021-09-18T23:59:56.274182 | 2018-05-26T08:02:04 | 2018-05-26T08:02:04 | 110,789,449 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | package style.dx.java.util;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateUtils {
private static final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
/**
* 将 Date 对象转换为格式化的 String
* @param date: 将被转换的 Date 对象
* @return `stringFormatDate`
*/
public static String getString(Date date) {
return format.format(date);
}
/**
* 将格式化的 Format 对象转换成 Date 对象
* @param date 格式化的 String 对象
* @return Date 对象
* @throws ParseException String 格式不符合要求
*/
public static Date getDate(String date) throws ParseException {
return format.parse(date);
}
}
| [
"[email protected]"
] | |
3631aa5d1e64a81837b578ee1c6c01faba12a29e | eb7deb6fc59054bab1aab380c958a1673e5d290c | /src/main/java/seng302/controllers/spellingtutor/SpellingTutorPopUpController.java | f6d53d4ad8ab9447dc31012333522f20dd6b5dd0 | [
"MIT"
] | permissive | South-Paw/Xinity | d8696b4068b3a6a9897c63bc5ff5476445e6a6dc | 14a40e08156024470e9bc6e3af4b7e1959ad01b7 | refs/heads/master | 2020-07-12T10:18:32.938048 | 2017-01-19T06:08:09 | 2017-01-19T06:08:09 | 73,911,047 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,953 | java | package seng302.controllers.spellingtutor;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TextField;
import org.controlsfx.control.CheckComboBox;
import seng302.command.Command;
import seng302.command.tutor.ChordSpellingTutor;
import seng302.controllers.commontutor.TutorPopUpController;
import seng302.util.enumerator.ChordQuality;
import java.util.ArrayList;
import java.util.List;
/**
* Controller class for the spelling tutor pop up.
*/
public class SpellingTutorPopUpController extends TutorPopUpController {
private static SpellingTutorPopUpController spellingTutorPopUpController;
@FXML private TextField numberOfQuestionsField;
@FXML private CheckComboBox chordConstraintDropDown;
@FXML private CheckBox noEnharmonicsCheckBox;
@FXML private CheckBox randomNotesCheckBox;
/**
* Constructor for class.
*/
public SpellingTutorPopUpController() {
spellingTutorPopUpController = this;
}
/**
* Used to get the instance of the Tutor Pop Up Controller.
*
* @return The Tutor Pop Up Controller.
*/
public static SpellingTutorPopUpController getInstance() {
return spellingTutorPopUpController;
}
/**
* Initialise function for when this scene is loaded.
*/
@SuppressWarnings("Unused")
public void initialize() {
// Adds all the chord types to the drop down and checks them all
ObservableList<String> constraints = FXCollections.observableArrayList();
for (ChordQuality quality: ChordQuality.values()) {
String qualityString = quality.getChordQualities().get(0);
if (!qualityString.equalsIgnoreCase("unknown")) {
constraints.addAll(qualityString);
}
}
chordConstraintDropDown.getItems().addAll(constraints);
for (Integer index = 0; index < constraints.size(); index++) {
chordConstraintDropDown.getCheckModel().checkIndices(index);
}
}
/**
* Handles the start test button being pressed.
*/
protected void startTestButtonHandler() {
List<String> arguments = new ArrayList<>();
List<String> constraintList = chordConstraintDropDown.getCheckModel().getCheckedItems();
arguments.add("x" + numberOfQuestionsField.getText());
for (String constraint: constraintList) {
arguments.add(constraint);
}
if (noEnharmonicsCheckBox.isSelected()) {
arguments.add("noEnharmonic");
}
if (randomNotesCheckBox.isSelected()) {
arguments.add("randomNotes");
}
Command spellingTutor = new ChordSpellingTutor(arguments);
Boolean validTestValue = isNumberOfTestsValid(numberOfQuestionsField);
startTestThroughDsl(spellingTutor, validTestValue);
}
}
| [
"[email protected]"
] | |
988418ee81017ac076d702eb3885ab35572af663 | 9b1af25ed9915d4339c8372b36b703f74cf85b86 | /yxs/src/main/java/yxs/DP/singleton/Singleton5.java | 781661de1ca62243a3d51d92a8e0d10c89546226 | [] | no_license | TinkerYxs/Yxs | f08c736199bc2d7ffec48604cedea4c7c6d39504 | a6d18181071de1d3a2352663dfb2b0dd0043f111 | refs/heads/master | 2021-05-23T18:47:22.265200 | 2020-09-17T01:09:21 | 2020-09-17T01:09:21 | 253,422,958 | 2 | 0 | null | 2020-10-14T00:14:48 | 2020-04-06T07:15:52 | Java | GB18030 | Java | false | false | 869 | java | /**
* All rights Reserved, Designed By YuanXiaoShuai
* @Title: Singleton5.java
* @Package yxs.DP.singleton
* @Description: TODO(用一句话描述该文件做什么)
* @author: 元晓帅
* @date: 2020年8月31日 下午4:45:20
* @version
* @Copyright: 2020 yxs. All rights reserved.
*/
package yxs.DP.singleton;
/**
* @ClassName: Singleton5
* @Description:TODO(这里用一句话描述这个类的作用)
* @author: 元晓帅
* @date: 2020年8月31日 下午4:45:20
*
* @Copyright: 2020 yxs. All rights reserved.
*/
// 登记 静态内部类
public class Singleton5 {
private static class SingletonHolder {
private static final Singleton5 INSTANCE = new Singleton5();
}
private Singleton5() {
}
public static final Singleton5 getInstance() {
return SingletonHolder.INSTANCE;
}
}
| [
"[email protected]"
] | |
ab8f52d550257f5226a40e2da17bd03eba24e02b | caf5ab8817d9fcf85483e4ae233ce18e218ca03e | /app/src/main/java/me/fmy/galaxy_a7/models/Constants.java | f139c74447c7c55df010cda2dc91318c03f0ea62 | [] | no_license | famepram/galaxyA7 | e85b3b07675164ad9bf40ea30604895269a27e70 | 5c3b153db4d371b98eadbae22c9d9d2bac61a741 | refs/heads/master | 2021-07-15T00:15:30.497832 | 2017-10-19T04:09:28 | 2017-10-19T04:09:28 | 107,496,954 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package me.fmy.galaxy_a7.models;
/**
* Created by Femmy on 7/24/2016.
*/
public class Constants {
public int DATABASE_VERSION = 1;
public String DATABASE_NAME = "galaxyA7";
public String TABLE_USER = "user";
}
| [
"[email protected]"
] | |
518072156f7e2709008a067ca4a67ae4dcff64e9 | 978b8276b13eca35ea0773259eb350e5d2baeca5 | /reactor-core-micrometer/src/main/java/reactor/core/observability/micrometer/TimedScheduler.java | 862d4b012b03fbf5b439624637f65753b3a68b8f | [
"Apache-2.0"
] | permissive | reactor/reactor-core | 2ceddf1d7c9f834ed9bc000c778ec7509a53d18a | 5553aa80137482ec26acb960f4d4f42b8a44da94 | refs/heads/main | 2023-08-31T02:58:34.058865 | 2023-08-17T11:11:46 | 2023-08-17T11:12:34 | 45,903,621 | 4,873 | 1,221 | Apache-2.0 | 2023-09-12T14:36:17 | 2015-11-10T10:06:40 | Java | UTF-8 | Java | false | false | 6,442 | java | /*
* Copyright (c) 2022 VMware 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.
* You may obtain a copy of the License at
*
* https://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 reactor.core.observability.micrometer;
import java.util.concurrent.TimeUnit;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.LongTaskTimer;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.Tags;
import io.micrometer.core.instrument.Timer;
import reactor.core.Disposable;
import reactor.core.observability.micrometer.TimedSchedulerMeterDocumentation.SubmittedTags;
import reactor.core.scheduler.Scheduler;
import static reactor.core.observability.micrometer.TimedSchedulerMeterDocumentation.*;
/**
* An instrumented {@link Scheduler} wrapping an original {@link Scheduler}
* and gathering metrics around submitted tasks.
* <p>
* See {@link TimedSchedulerMeterDocumentation} for the various metrics and tags associated with this class.
*
* @author Simon Baslé
*/
final class TimedScheduler implements Scheduler {
final Scheduler delegate;
final MeterRegistry registry;
final Counter submittedDirect;
final Counter submittedDelayed;
final Counter submittedPeriodicInitial;
final Counter submittedPeriodicIteration;
final LongTaskTimer pendingTasks;
final LongTaskTimer activeTasks;
final Timer completedTasks;
TimedScheduler(Scheduler delegate, MeterRegistry registry, String metricPrefix, Iterable<Tag> tagsList) {
this.delegate = delegate;
this.registry = registry;
if (metricPrefix.endsWith(".")) {
metricPrefix = metricPrefix.substring(0, metricPrefix.length() - 1);
}
Tags tags = Tags.of(tagsList);
String submittedName = TASKS_SUBMITTED.getName(metricPrefix);
this.submittedDirect = registry.counter(submittedName, tags.and(SubmittedTags.SUBMISSION.asString(), SubmittedTags.SUBMISSION_DIRECT));
this.submittedDelayed = registry.counter(submittedName, tags.and(SubmittedTags.SUBMISSION.asString(), SubmittedTags.SUBMISSION_DELAYED));
this.submittedPeriodicInitial = registry.counter(submittedName, tags.and(SubmittedTags.SUBMISSION.asString(), SubmittedTags.SUBMISSION_PERIODIC_INITIAL));
this.submittedPeriodicIteration = registry.counter(submittedName, tags.and(SubmittedTags.SUBMISSION.asString(), SubmittedTags.SUBMISSION_PERIODIC_ITERATION));
this.pendingTasks = LongTaskTimer.builder(TASKS_PENDING.getName(metricPrefix))
.tags(tags).register(registry);
this.activeTasks = LongTaskTimer.builder(TASKS_ACTIVE.getName(metricPrefix))
.tags(tags).register(registry);
this.completedTasks = registry.timer(TASKS_COMPLETED.getName(metricPrefix), tags);
}
Runnable wrap(Runnable task) {
return new TimedRunnable(registry, this, task);
}
Runnable wrapPeriodic(Runnable task) {
return new TimedRunnable(registry, this, task, true);
}
@Override
public Disposable schedule(Runnable task) {
this.submittedDirect.increment();
return delegate.schedule(wrap(task));
}
@Override
public Disposable schedule(Runnable task, long delay, TimeUnit unit) {
this.submittedDelayed.increment();
return delegate.schedule(wrap(task), delay, unit);
}
@Override
public Disposable schedulePeriodically(Runnable task, long initialDelay, long period, TimeUnit unit) {
this.submittedPeriodicInitial.increment();
return delegate.schedulePeriodically(wrapPeriodic(task), initialDelay, period, unit);
}
@Override
public Worker createWorker() {
return new TimedWorker(this, delegate.createWorker());
}
@Override
public boolean isDisposed() {
return delegate.isDisposed();
}
@Override
public long now(TimeUnit unit) {
return delegate.now(unit);
}
@Override
public void dispose() {
delegate.dispose();
}
@Override
public void start() {
delegate.start();
}
static final class TimedWorker implements Worker {
final TimedScheduler parent;
final Worker delegate;
TimedWorker(TimedScheduler parent, Worker delegate) {
this.parent = parent;
this.delegate = delegate;
}
@Override
public void dispose() {
delegate.dispose();
}
@Override
public boolean isDisposed() {
return delegate.isDisposed();
}
@Override
public Disposable schedule(Runnable task) {
parent.submittedDirect.increment();
return delegate.schedule(parent.wrap(task));
}
@Override
public Disposable schedule(Runnable task, long delay, TimeUnit unit) {
parent.submittedDelayed.increment();
return delegate.schedule(parent.wrap(task), delay, unit);
}
@Override
public Disposable schedulePeriodically(Runnable task, long initialDelay, long period, TimeUnit unit) {
parent.submittedPeriodicInitial.increment();
return delegate.schedulePeriodically(parent.wrapPeriodic(task), initialDelay, period, unit);
}
}
static final class TimedRunnable implements Runnable {
final MeterRegistry registry;
final TimedScheduler parent;
final Runnable task;
final LongTaskTimer.Sample pendingSample;
boolean isRerun;
TimedRunnable(MeterRegistry registry, TimedScheduler parent, Runnable task) {
this(registry, parent, task, false);
}
TimedRunnable(MeterRegistry registry, TimedScheduler parent, Runnable task, boolean periodic) {
this.registry = registry;
this.parent = parent;
this.task = task;
if (periodic) {
this.pendingSample = null;
}
else {
this.pendingSample = parent.pendingTasks.start();
}
this.isRerun = false; //will be ignored if not periodic
}
@Override
public void run() {
if (this.pendingSample != null) {
//NOT periodic
this.pendingSample.stop();
}
else {
if (!isRerun) {
this.isRerun = true;
}
else {
parent.submittedPeriodicIteration.increment();
}
}
Runnable completionTrackingTask = parent.completedTasks.wrap(this.task);
this.parent.activeTasks.record(completionTrackingTask);
}
}
}
| [
"[email protected]"
] | |
d8f7816422b0be825ea29cc378302e0a7c3acc24 | 208ba847cec642cdf7b77cff26bdc4f30a97e795 | /aj/ab/src/main/java/org.wp.ab/ui/media/MediaImageLoader.java | 8727e4b96edab6b071224a41e67331ae5876c739 | [] | no_license | kageiit/perf-android-large | ec7c291de9cde2f813ed6573f706a8593be7ac88 | 2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8 | refs/heads/master | 2021-01-12T14:00:19.468063 | 2016-09-27T13:10:42 | 2016-09-27T13:10:42 | 69,685,305 | 0 | 0 | null | 2016-09-30T16:59:49 | 2016-09-30T16:59:48 | null | UTF-8 | Java | false | false | 1,558 | java | package org.wp.ab.ui.media;
import android.content.Context;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import org.wp.ab.WordPress;
import org.wp.ab.models.Blog;
import org.wp.ab.util.AppLog;
import org.wp.ab.util.VolleyUtils;
/**
* provides the ImageLoader and backing RequestQueue for media image requests - necessary because
* images in protected blogs need to be authenticated, which requires a separate RequestQueue
*/
class MediaImageLoader {
private MediaImageLoader() {
throw new AssertionError();
}
static ImageLoader getInstance() {
return getInstance(WordPress.getCurrentBlog());
}
static ImageLoader getInstance(Blog blog) {
if (blog != null && VolleyUtils.isCustomHTTPClientStackNeeded(blog)) {
// use ImageLoader with authenticating request queue for protected blogs
AppLog.d(AppLog.T.MEDIA, "using custom imageLoader");
Context context = WordPress.getContext();
RequestQueue authRequestQueue = Volley.newRequestQueue(context, VolleyUtils.getHTTPClientStack(context, blog));
ImageLoader imageLoader = new ImageLoader(authRequestQueue, WordPress.getBitmapCache());
imageLoader.setBatchedResponseDelay(0);
return imageLoader;
} else {
// use default ImageLoader for all others
AppLog.d(AppLog.T.MEDIA, "using default imageLoader");
return WordPress.imageLoader;
}
}
}
| [
"[email protected]"
] | |
f7f550c14252aa6d42444550c3a6fd4c6e314d37 | 1198c20822d604870b6982d1038b1b0ef34fe85e | /src/sistemacadastro/visao/TelainternaDesenvolvedores.java | 3f213bd80a6bdf5db36af12a96bb20875af45d54 | [] | no_license | lucasorso/sistemacadastro | f788d3cdb3ef8ae8cbaa34bb0804b1ef4b454860 | fff631efa0859cc302ee080066b30f0ebb712970 | refs/heads/master | 2021-01-17T16:32:41.259426 | 2016-07-01T23:24:04 | 2016-07-01T23:24:04 | 56,357,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,755 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sistemacadastro.visao;
/**
*
* @author gregori
*/
public class TelainternaDesenvolvedores extends javax.swing.JInternalFrame {
/**
* Creates new form TelainternaDesenvolvedores
*/
public TelainternaDesenvolvedores() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
setClosable(true);
setTitle("Desenvolvedores");
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Create By"));
jLabel1.setText("Gregori Gomes de Oliveira");
jLabel2.setText("Lucas Ricardo Orso");
jLabel3.setText("Yuri Oliveira Abel");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addContainerGap(199, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
// End of variables declaration//GEN-END:variables
}
| [
"gregori@gregori-oliveira"
] | gregori@gregori-oliveira |
4d711675ccfa51150d69bb9deb32aaf39398861a | 9eb0a9eb31cfddb0934afe5530d67e2555a6532d | /src/com/qianhe/service/ClassifyService.java | 1849051575f42863b15829d91bf681d26fd84640 | [] | no_license | noeditornocodenosql/qzh | 474436f7fb07a4e3cae9ce7b6d1b6c9a8feb8f3e | e257c76c29ca2e24e8eb6269df3c4e75da832a3b | refs/heads/master | 2020-03-15T19:37:12.414132 | 2018-07-28T15:09:27 | 2018-07-28T15:09:27 | 132,313,133 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 376 | java | package com.qianhe.service;
import java.util.List;
import com.qianhe.model.Classify;
public interface ClassifyService {
public Classify findClassifyById(Integer id);
public List<Classify> findAllClassify(Integer type);
public void saveClassify(Classify classify);
public void updateClassify(Classify classify);
public void deleteClassify(Integer id);
}
| [
"[email protected]"
] | |
33c65a92a67080ef551ab950f2f41e11e3a3b2f5 | 742e79d3c308ae83aa6e776bfc5462e09e996558 | /Automobile Stock Managment Console Applicaton/Controller/BaseInterface/StockAndOrderHistoryViewer.java | d9ab922692ddec76d97fd4f0a7a96b9c2240d133 | [] | no_license | arun1810/Zoho-Incubation-Codes | 2dc646df7f8d4df2fe595251873092c7b2fc54a3 | 14d5fa31356e3b710d67479790aa495013047603 | refs/heads/main | 2023-07-07T07:42:13.713247 | 2021-08-11T09:00:05 | 2021-08-11T09:00:05 | 387,793,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 918 | java | package Controller.BaseInterface;
import java.util.List;
import CustomExceptions.DataNotFoundException;
import POJO.OrderHistory;
import POJO.Stock;
import Utilities.SortUtil;
import Utilities.SortUtil.SortOrder;
public interface StockAndOrderHistoryViewer {
public List<OrderHistory> getAllOrderHistory();
public List<OrderHistory> sortOrderHistoryByTotalPrice(SortOrder order);
public List<OrderHistory> filterOrderHistoryByStockID(String filter);
public OrderHistory getOrderHistorybyID(String orderHistoryID) throws DataNotFoundException;
public List<Stock> getAllStock();
public Stock getStockByID(String stockID) throws DataNotFoundException;
public List<Stock> sortStockbyPrice(SortUtil.SortOrder sortOrder);
public List<Stock> sortStockbyCount(SortUtil.SortOrder sortOrder);
public List<Stock> filterStockByName(String filter);
public void clearAllFilter();
}
| [
"[email protected]"
] | |
c4a450fd65b924fa352c06d6ab7cbd6a225b52db | ce67b727842fab338c594cebf5b943352e42bb17 | /jdbc/src/main/java/com/jdbc/StudentDao/StudentDaoImpl.java | d45e856509a614e0a2a6b62f4d6e87ccc7103a7e | [] | no_license | Smart110/mytest | c70d39b517236a4037e832f71da1781933470676 | a1a1a6a2ff09ceed4b1d7ec423e6f0e44e0b72c7 | refs/heads/master | 2021-05-06T22:38:24.196632 | 2017-12-03T13:07:40 | 2017-12-03T13:07:40 | 112,921,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,656 | java | package com.jdbc.StudentDao;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import com.jdbc.jdbc.Student;
@Repository
public class StudentDaoImpl implements StudentDao {
@Autowired
private JdbcTemplate jdbcTemplate;
//增加
@Override
public int add(Student student) {
return jdbcTemplate.update("insert into student(name, age) values(?, ?)",
student.getName(),student.getAge());
}
@Override
public int update(Student student) {
return jdbcTemplate.update("UPDATE student SET name=? ,age=? WHERE id=?",
student.getName(),student.getAge(),student.getId());
}
@Override
public int delete(int id) {
return jdbcTemplate.update("DELETE from TABLE account where id=?",id);
}
@Override
public Student findStudentById(int id) {
List<Student> list = jdbcTemplate.query("select * from student where id = ?", new Object[]{id}, new BeanPropertyRowMapper(Student.class));
if(list!=null && list.size()>0){
Student student = list.get(0);
return student;
}else{
return null;
}
}
@Override
public List<Student> findStudentList() {
List<Student> list = jdbcTemplate.query("select * from student", new Object[]{}, new BeanPropertyRowMapper(Student.class));
if(list!=null && list.size()>0){
return list;
}else{
return null;
}
}
}
| [
"[email protected]"
] | |
f4c8d539e125e7439b1f9a53e5419c49342663be | 702ed60e5ac14d344644e36feff57060110f780d | /src/Main.java | 62e7c3c4b880393f5f413dc9a420982e1e7f79dc | [] | no_license | Zearpex/SEW3 | b0056bbdd9f65105a774917f0fca738e2c961ddc | 25ae9fdb7bfd88f9045232139b05fb729bc76924 | refs/heads/master | 2021-03-24T12:29:55.757349 | 2017-09-25T09:40:31 | 2017-09-25T09:40:31 | 104,727,375 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 187 | java | /**
* Created by 5063 on 25.09.2017.
*/
public class Main {
public static void main(String[] args){
System.out.println("Hello from the htl");
return "haha";
}
}
| [
"[email protected]"
] | |
4827ed4c8d41880214545d0bbf40963dca765090 | 92e6dd0c32cd36a082eeac923ea89fe04de5ac38 | /ticketService/src/main/java/com/demo/ticketManagement/dto/ItenaryResponseDto.java | 320927b96085e076cb54ceeede8229b6564d5cc1 | [] | no_license | grandhe10/trainTicketBooking | b002af235110f9dd8e0de7b8ffbe09ad3a3d42f8 | fc004422ac3808105077cbce95a7de2226fb2a01 | refs/heads/master | 2022-11-09T17:53:40.109439 | 2020-06-25T03:46:43 | 2020-06-25T03:46:43 | 274,067,375 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,168 | java | package com.demo.ticketManagement.dto;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;
public class ItenaryResponseDto {
/**
* Generates class with trainNumber,departureTime,departureDate,
* arrivalTime,arrivalDate,fromLocation,toLocation,passengerDtoList,
* userName,password
*/
private Long trainNumber;
private LocalTime departureTime;
private LocalDate departureDate;
private LocalTime arrivalTime;
private LocalDate arrivalDate;
private String fromLocation;
private String toLocation;
List<PassengerDto> passengerDtoList;
private String userName;
private String emailId;
public Long getTrainNumber() {
return trainNumber;
}
public void setTrainNumber(Long trainNumber) {
this.trainNumber = trainNumber;
}
public LocalTime getDepartureTime() {
return departureTime;
}
public void setDepartureTime(LocalTime departureTime) {
this.departureTime = departureTime;
}
public LocalDate getDepartureDate() {
return departureDate;
}
public void setDepartureDate(LocalDate departureDate) {
this.departureDate = departureDate;
}
public LocalTime getArrivalTime() {
return arrivalTime;
}
public void setArrivalTime(LocalTime arrivalTime) {
this.arrivalTime = arrivalTime;
}
public LocalDate getArrivalDate() {
return arrivalDate;
}
public void setArrivalDate(LocalDate arrivalDate) {
this.arrivalDate = arrivalDate;
}
public String getFromLocation() {
return fromLocation;
}
public void setFromLocation(String fromLocation) {
this.fromLocation = fromLocation;
}
public String getToLocation() {
return toLocation;
}
public void setToLocation(String toLocation) {
this.toLocation = toLocation;
}
public List<PassengerDto> getPassengerDtoList() {
return passengerDtoList;
}
public void setPassengerDtoList(List<PassengerDto> passengerDtoList) {
this.passengerDtoList = passengerDtoList;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getEmailId() {
return emailId;
}
public void setEmailId(String emailId) {
this.emailId = emailId;
}
}
| [
"[email protected]"
] | |
f47dc6a7fc4994d9367cb78cfd0505bc2743a115 | 7b0521dfb4ec76ee1632b614f32ee532f4626ea2 | /src/main/java/alcoholmod/Mathioks/Final/Summons/Entity/SummonEnderShinobiEntity.java | 913f4dffc4e757466bc5501f6418c6bcdc683156 | [] | no_license | M9wo/NarutoUnderworld | 6c5be180ab3a00b4664fd74f6305e7a1b50fe9fc | 948065d8d43b0020443c0020775991b91f01dd50 | refs/heads/master | 2023-06-29T09:27:24.629868 | 2021-07-27T03:18:08 | 2021-07-27T03:18:08 | 389,832,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,621 | java | package alcoholmod.Mathioks.Final.Summons.Entity;
import alcoholmod.Mathioks.AlcoholMod;
import alcoholmod.Mathioks.ExtendedPlayer;
import alcoholmod.Mathioks.ExtraFunctions.SyncChakraExperienceMessage;
import alcoholmod.Mathioks.PacketDispatcher;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAIFollowOwner;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
public class SummonEnderShinobiEntity extends EntityTameable {
public int deathTicks;
private static boolean[] carriableBlocks = new boolean[256];
private int teleportDelay;
private int stareTimer;
private Entity lastEntityToAttack;
private boolean isAggressive;
public SummonEnderShinobiEntity(World par1World) {
super(par1World);
this.tasks.addTask(4, (EntityAIBase)new EntityAIAttackOnCollide((EntityCreature)this, 1.0D, true));
this.tasks.addTask(5, (EntityAIBase)new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(7, (EntityAIBase)new EntityAIWander((EntityCreature)this, 1.0D));
this.tasks.addTask(8, (EntityAIBase)new EntityAIWatchClosest((EntityLiving)this, EntityPlayer.class, 8.0F));
this.tasks.addTask(9, (EntityAIBase)new EntityAILookIdle((EntityLiving)this));
this.targetTasks.addTask(1, (EntityAIBase)new EntityAIOwnerHurtByTarget(this));
this.targetTasks.addTask(2, (EntityAIBase)new EntityAIOwnerHurtTarget(this));
this.targetTasks.addTask(3, (EntityAIBase)new EntityAIHurtByTarget((EntityCreature)this, true));
this.tasks.addTask(10, (EntityAIBase)new EntityAISwimming((EntityLiving)this));
setSize(0.6F, 2.9F);
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D);
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.4D);
}
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(18, new Byte((byte)0));
}
public void onLivingUpdate() {
if (isWet())
attackEntityFrom(DamageSource.drown, 1.0F);
if (this.lastEntityToAttack != this.entityToAttack) {
IAttributeInstance iattributeinstance = getEntityAttribute(SharedMonsterAttributes.movementSpeed);
if (this.entityToAttack != null);
}
this.lastEntityToAttack = this.entityToAttack;
for (int k = 0; k < 2; k++)
this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * this.width, this.posY + this.rand.nextDouble() * this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
if (this.worldObj.isDaytime() && !this.worldObj.isRemote) {
float f = getBrightness(1.0F);
if (f > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
this.entityToAttack = null;
setScreaming(false);
this.isAggressive = false;
teleportRandomly();
}
}
if (isWet() || isBurning()) {
this.entityToAttack = null;
setScreaming(false);
this.isAggressive = false;
teleportRandomly();
}
if (isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0)
setScreaming(false);
this.isJumping = false;
if (this.entityToAttack != null)
faceEntity(this.entityToAttack, 100.0F, 100.0F);
if (!this.worldObj.isRemote && isEntityAlive())
if (this.entityToAttack != null) {
if (this.entityToAttack.getDistanceSqToEntity((Entity)this) < 16.0D)
teleportRandomly();
if (this.entityToAttack != null) {
this.teleportDelay = 0;
} else if (this.entityToAttack.getDistanceSqToEntity((Entity)this) > 256.0D && this.teleportDelay++ >= 30 && teleportToEntity(this.entityToAttack)) {
this.teleportDelay = 0;
}
} else {
setScreaming(false);
this.teleportDelay = 0;
}
super.onLivingUpdate();
}
public void onKillEntity(EntityLivingBase p_70074_1_) {
super.onKillEntity(p_70074_1_);
if (getOwner() != null && getOwner() instanceof EntityPlayer && !(p_70074_1_ instanceof net.minecraft.entity.passive.EntityAnimal) && !(p_70074_1_ instanceof net.minecraft.entity.passive.EntityWaterMob)) {
EntityPlayer owner = (EntityPlayer)getOwner();
ExtendedPlayer props = ExtendedPlayer.get(owner);
props.setChakraExperience(props.getChakraExperience() + 1);
PacketDispatcher.sendTo((IMessage)new SyncChakraExperienceMessage(owner), (EntityPlayerMP)owner);
}
}
protected void dropRareDrop(int p_70600_1_) {
entityDropItem(new ItemStack(AlcoholMod.SummonEnderShinobi, 1, 1), 0.0F);
}
protected boolean teleportRandomly() {
double d0 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D;
double d1 = this.posY + (this.rand.nextInt(64) - 32);
double d2 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D;
return teleportTo(d0, d1, d2);
}
public boolean isScreaming() {
return (this.dataWatcher.getWatchableObjectByte(18) > 0);
}
public void setScreaming(boolean p_70819_1_) {
this.dataWatcher.updateObject(18, Byte.valueOf((byte)(p_70819_1_ ? 1 : 0)));
}
protected boolean teleportToEntity(Entity p_70816_1_) {
Vec3 vec3 = Vec3.createVectorHelper(this.posX - p_70816_1_.posX, this.boundingBox.minY + (this.height / 2.0F) - p_70816_1_.posY + p_70816_1_.getEyeHeight(), this.posZ - p_70816_1_.posZ);
vec3 = vec3.normalize();
double d0 = 16.0D;
double d1 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.xCoord * d0;
double d2 = this.posY + (this.rand.nextInt(16) - 8) - vec3.yCoord * d0;
double d3 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.zCoord * d0;
return teleportTo(d1, d2, d3);
}
protected boolean teleportTo(double p_70825_1_, double p_70825_3_, double p_70825_5_) {
EnderTeleportEvent event = new EnderTeleportEvent((EntityLivingBase)this, p_70825_1_, p_70825_3_, p_70825_5_, 0.0F);
if (MinecraftForge.EVENT_BUS.post((Event)event))
return false;
double d3 = this.posX;
double d4 = this.posY;
double d5 = this.posZ;
this.posX = event.targetX;
this.posY = event.targetY;
this.posZ = event.targetZ;
boolean flag = false;
int i = MathHelper.floor_double(this.posX);
int j = MathHelper.floor_double(this.posY);
int k = MathHelper.floor_double(this.posZ);
if (this.worldObj.blockExists(i, j, k)) {
boolean flag1 = false;
while (!flag1 && j > 0) {
Block block = this.worldObj.getBlock(i, j - 1, k);
if (block.getMaterial().blocksMovement()) {
flag1 = true;
continue;
}
this.posY--;
j--;
}
if (flag1) {
setPosition(this.posX, this.posY, this.posZ);
if (this.worldObj.getCollidingBoundingBoxes((Entity)this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox))
flag = true;
}
}
if (!flag) {
setPosition(d3, d4, d5);
return false;
}
short short1 = 128;
for (int l = 0; l < short1; l++) {
double d6 = l / (short1 - 1.0D);
float f = (this.rand.nextFloat() - 0.5F) * 0.2F;
float f1 = (this.rand.nextFloat() - 0.5F) * 0.2F;
float f2 = (this.rand.nextFloat() - 0.5F) * 0.2F;
double d7 = d3 + (this.posX - d3) * d6 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D;
double d8 = d4 + (this.posY - d4) * d6 + this.rand.nextDouble() * this.height;
double d9 = d5 + (this.posZ - d5) * d6 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D;
this.worldObj.spawnParticle("portal", d7, d8, d9, f, f1, f2);
}
this.worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F);
playSound("mob.endermen.portal", 1.0F, 1.0F);
return true;
}
protected String getLivingSound() {
return isScreaming() ? "mob.endermen.scream" : "mob.endermen.idle";
}
protected String getHurtSound() {
return "mob.endermen.hit";
}
protected String getDeathSound() {
return "mob.endermen.death";
}
public boolean attackEntityAsMob(Entity par1Entity) {
int i = 7;
return (getOwner() != null) ? par1Entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)getOwner()), i) : par1Entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), i);
}
protected boolean isAIEnabled() {
return true;
}
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
if (isEntityInvulnerable())
return false;
setScreaming(true);
if (p_70097_1_ instanceof net.minecraft.util.EntityDamageSource && p_70097_1_.getEntity() instanceof EntityPlayer)
this.isAggressive = true;
if (p_70097_1_ instanceof net.minecraft.util.EntityDamageSourceIndirect) {
this.isAggressive = false;
for (int i = 0; i < 64; i++) {
if (teleportRandomly())
return true;
}
return super.attackEntityFrom(p_70097_1_, p_70097_2_);
}
return super.attackEntityFrom(p_70097_1_, p_70097_2_);
}
public void onUpdate() {
EntityPlayer entityPlayer = (EntityPlayer)getOwner();
if (this.ticksExisted >= 6000 && !this.worldObj.isRemote) {
if (getOwner() != null) {
Random rand = new Random();
int randomNumber = rand.nextInt(3);
if (randomNumber == 1)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : My time is up, see yah"));
if (randomNumber == 2)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : I gotta bro, *Fistbump*"));
if (randomNumber == 3)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : My time is over, don't worry, I'll beam myself up!"));
if (randomNumber == 0)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : Listen up " + getOwner().getCommandSenderName() + " My time is up, good luck and see ya later!"));
}
setDead();
}
if (getOwner() != null) {
if (getAttackTarget() != null && (this.ticksExisted == 500 || this.ticksExisted == 1500 || this.ticksExisted == 2500 || this.ticksExisted == 3500 || this.ticksExisted == 4500 || this.ticksExisted == 5500)) {
Random rand = new Random();
int randomNumber = rand.nextInt(3);
if (randomNumber == 0)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : DIE " + getAttackTarget().getCommandSenderName() + "!!"));
if (randomNumber == 1)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : I'll haunt your dreams " + getAttackTarget().getCommandSenderName() + "!!"));
if (randomNumber == 2)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : Come here " + getAttackTarget().getCommandSenderName() + "!!"));
if (randomNumber == 3)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : heh heh, " + getAttackTarget().getCommandSenderName() + ", Let's finish this HAHAHA!"));
}
if (this.ticksExisted == 20 && !this.worldObj.isRemote) {
Random rand = new Random();
int randomNumber = rand.nextInt(3);
if (randomNumber == 1)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : Why did you summon me " + getOwner().getCommandSenderName()));
if (randomNumber == 2)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : What will we do this time friend?"));
if (randomNumber == 3)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : Need some a hand bro?"));
if (randomNumber == 0) {
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : Different time, different place."));
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("But you still need Slendobis help!"));
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("It's good to see ya buddy!"));
}
}
}
super.onUpdate();
}
public void setAttackTarget(EntityLivingBase p_70624_1_) {
super.setAttackTarget(p_70624_1_);
if (p_70624_1_ == null) {
setAngry(false);
} else if (!isTamed()) {
setAngry(true);
}
}
public void setAngry(boolean p_70916_1_) {
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
if (p_70916_1_) {
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 0x2)));
} else {
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & 0xFFFFFFFD)));
}
}
public EnumCreatureAttribute getCreatureAttribute() {
return EnumCreatureAttribute.UNDEAD;
}
protected boolean canDespawn() {
return false;
}
public EntityAgeable createChild(EntityAgeable entityageable) {
return null;
}
protected void onDeathUpdate() {
this.deathTicks++;
if (getOwner() != null && !this.worldObj.isRemote) {
EntityPlayer entityPlayer = (EntityPlayer)getOwner();
Random rand = new Random();
int randomNumber = rand.nextInt(3);
if (randomNumber == 1)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : aaargh DAMNIT! I'll leave it to you " + getOwner().getCommandSenderName()));
if (randomNumber == 2)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : AAaaAAaaAAARGH"));
if (randomNumber == 3)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : I'm down for the count bro, good luck!"));
if (randomNumber == 0)
entityPlayer.addChatComponentMessage((IChatComponent)new ChatComponentText("Slendobi : I gave it all I got, but this is it, see you later friend!"));
}
if (this.deathTicks >= 0 && this.deathTicks <= 1) {
double d2 = this.rand.nextGaussian() * 0.02D;
double d0 = this.rand.nextGaussian() * 0.02D;
double d1 = this.rand.nextGaussian() * 0.02D;
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
this.worldObj.spawnParticle("explode", this.posX + (this.rand.nextFloat() * this.width * 2.0F) - this.width, this.posY + 1.0D + (this.rand.nextFloat() * this.height), this.posZ + (this.rand.nextFloat() * this.width * 2.0F) - this.width, d2, d0, d1);
}
if (this.deathTicks == 1 && !this.worldObj.isRemote)
setDead();
}
public boolean canAttackClass(Class par1Class) {
return true;
}
protected boolean isValidLightLevel() {
int i = MathHelper.floor_double(this.posX);
int j = MathHelper.floor_double(this.boundingBox.minY);
int k = MathHelper.floor_double(this.posZ);
if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32))
return false;
int l = this.worldObj.getBlockLightValue(i, j, k);
if (this.worldObj.isThundering()) {
int i1 = this.worldObj.skylightSubtracted;
this.worldObj.skylightSubtracted = 10;
l = this.worldObj.getBlockLightValue(i, j, k);
this.worldObj.skylightSubtracted = i1;
}
return (l <= this.rand.nextInt(8));
}
public boolean getCanSpawnHere() {
return (this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && isValidLightLevel() && super.getCanSpawnHere());
}
}
| [
"[email protected]"
] | |
8bf53e6fd538ea09d25c4736299bbce83e2df18e | ceabd99652df1e87ce56840b3a514190aa002d0a | /src/main/java/net/billforward/model/usage/UsageState.java | 47f8ea74e34d55925b9919affe4aed0d28827898 | [] | no_license | billforward/bf-java | d777666582c6b28f11af4f33753c37c92a966183 | 522fde77e47e79bdac41d76ee6725021fca5210b | refs/heads/master | 2021-01-21T04:54:08.394332 | 2016-04-06T11:23:13 | 2016-04-06T11:23:13 | 23,771,428 | 0 | 0 | null | 2015-02-06T15:46:30 | 2014-09-07T21:24:41 | Java | UTF-8 | Java | false | false | 84 | java | package net.billforward.model.usage;
public enum UsageState {
Active,
Historic
}
| [
"[email protected]"
] | |
c5b6761d01b0bf9dd5246a3605cf9ef7dc97f7bd | 35ad16e06f076d84ec8980d1605703988793bc6d | /src/refactor/adapter/xml/DOMBuilder.java | a4c1416f5a46f300f85d65cc136c4c74c2c8ded1 | [] | no_license | janipeng/refactor_adapter_pattern | 0869b50b38ebb255e6f9b008a829f8832b7f6503 | 63b43ea3336b9e906feaacdacd275d9af2439465 | refs/heads/master | 2021-08-20T08:33:35.842376 | 2017-11-28T15:58:50 | 2017-11-28T15:58:50 | 112,191,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,022 | java | package refactor.adapter.xml;
import org.apache.xerces.dom.DocumentImpl;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Document;
import java.io.IOException;
import java.io.StringWriter;
public class DOMBuilder extends AbstractBuilder {
private Document doc;
public DOMBuilder(String rootName) {
init(rootName);
}
public Document getDocument() {
return doc;
}
protected void init(String rootName) {
doc = new DocumentImpl();
root = new ElementAdapter(doc.createElement(rootName), doc);
doc.appendChild(root.getElement());
commonInit();
}
public String toString() {
OutputFormat format = new OutputFormat(doc);
StringWriter stringOut = new StringWriter();
XMLSerializer serial = new XMLSerializer(stringOut, format);
try {
serial.asDOMSerializer();
serial.serialize(doc.getDocumentElement());
} catch (IOException ioe) {
ioe.printStackTrace();
return ioe.getMessage();
}
return stringOut.toString();
}
}
| [
"[email protected]"
] | |
9ad6058f9dadc9002dd2d25fe6465169565922a4 | 3d5717774fc11f14861f7545046dffcfe85afde1 | /app/src/main/java/com/example/processcommunicate/skin/SkinManager.java | cb225a0f2053664fccad05224e5cb650a3ba58aa | [] | no_license | whoami-I/process | 9c5bc10c7b2000ff44034504e2a59f2967e07f9b | b3dafd3f430bb3bee5c1cd1c70152170bed57328 | refs/heads/master | 2020-05-20T13:34:13.795863 | 2019-06-06T10:14:00 | 2019-06-06T10:14:00 | 185,601,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,495 | java | package com.example.processcommunicate.skin;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.text.TextUtils;
import android.view.LayoutInflater;
import com.example.processcommunicate.skin.config.SkinPreUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class SkinManager {
private static SkinManager skinManager = new SkinManager();
private Context context;
private Map<Activity, List<SkinView>> map = new HashMap<>();
private SkinResource mSkinResource;
private SkinManager() {
}
public void init(Context context) {
this.context = context.getApplicationContext();
//如果存在已经换肤的情况,那么就要先初始化mSkinResource变量
String skinPath = getSkinPath();
if (!TextUtils.isEmpty(skinPath)) {
mSkinResource = new SkinResource(context, skinPath);
}
}
public static SkinManager getInstance() {
return skinManager;
}
public void loadSkin(String path) {
if (TextUtils.isEmpty(path)) {
throw new RuntimeException("Skin path can not be null");
}
if (mSkinResource == null) {
mSkinResource = new SkinResource(context, path);
} else {
String resourcePath = mSkinResource.getResourcePath();
if (!path.equals(resourcePath)) {
mSkinResource = new SkinResource(context, path);
}
}
Set<Activity> activities =
map.keySet();
for (Activity activity : activities) {
List<SkinView> skinViews = map.get(activity);
for (SkinView skinView : skinViews) {
skinView.skin();
}
}
//保存换肤路径
saveSkinPath(path);
}
public void restoreDefaultSkin() {
String skinPath = getSkinPath();
if (TextUtils.isEmpty(skinPath)) return;
skinPath = context.getPackageResourcePath();
mSkinResource = new SkinResource(context, skinPath);
Set<Activity> activities =
map.keySet();
for (Activity activity : activities) {
List<SkinView> skinViews = map.get(activity);
for (SkinView skinView : skinViews) {
skinView.skin();
}
}
//清除皮肤
clearSkinPath();
}
public void saveSkinPath(String path) {
SkinPreUtils.getInstance(context).saveSkinPath(path);
}
public void clearSkinPath() {
SkinPreUtils.getInstance(context).clearSkinPath();
}
public String getSkinPath() {
return SkinPreUtils.getInstance(context).getSkinPath();
}
private void checkNotNull(String path) {
}
public SkinResource getSkinResource() {
return mSkinResource;
}
public void register(Activity activity, SkinView skinView) {
List<SkinView> skinViews = map.get(activity);
if (skinViews == null) {
skinViews = new ArrayList<>();
}
skinViews.add(skinView);
map.put(activity, skinViews);
}
public void unRegister(Activity activity) {
map.remove(activity);
}
public void checkSkin(SkinView skinView) {
String skinPath = getSkinPath();
if (!TextUtils.isEmpty(skinPath)) {
skinView.skin();
}
}
}
| [
"[email protected]"
] | |
ca71776cb434fd2cca3ea3957cb0523733e07d86 | c0463b289fecb907c2554daab819ef4b4fac8546 | /app/src/androidTest/java/com/androidexample/ExampleInstrumentedTest.java | 0fd0d55a9d840f6ee95d722c8fdbf61edbafb39f | [] | no_license | haticenurokur/androidExample | d7547910d3348e1a6d7a7852c3a3e44b0b24aedb | 4d37d6e488f3e382dd61222db754e0107e0e3652 | refs/heads/master | 2020-06-04T16:39:26.788377 | 2019-06-15T21:55:37 | 2019-06-15T21:55:37 | 192,107,413 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 720 | java | package com.androidexample;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.androidexample", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
2b45bc1331d14eec1a60295727fa8a3f54199d9a | 538010f74485a8611d1368efc5ef442b2b3f3b16 | /코드업/코드업 1085.java | 599e3e3c8d0dc7f0fb9dd8cfc5327c7989240b94 | [] | no_license | dddoseung/1Day1Commit | d52a25fc22afeb6383c4046ccf95ccc42a56ef7f | 30e2170af287945cdea8624b89595daff08eb0bc | refs/heads/main | 2023-03-03T14:21:29.643162 | 2021-02-19T12:52:23 | 2021-02-19T12:52:23 | 311,055,573 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 486 | java | import java.util.*;
import java.text.DecimalFormat;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
double num=1;
while(sc.hasNext()){
num*=sc.nextInt();
}
num=num/(8*Math.pow(2,10)*Math.pow(2,10));
//DecimalFormat form=new DecimalFormat("0.0"); 소수점 첫째자리까지
System.out.format("%.1f MB",num);
}
}
| [
"[email protected]"
] | |
6f1b1935fcf53f36b03d6a3c9dfe6741716164f7 | e967caefefe73e4348b6da0bf97bdfcd1a95f18d | /src/belajarDesignPattern/BuilderPattern/Meal.java | 2eb8917f28d611e356f79c10e90f8d20e197c423 | [] | no_license | riskiabidin/DesignPattern | 9c0d711a70161403e0da8a423442c43dbabde188 | 8fe172abdb58751d5771d56415ae7b5295f4e5a4 | refs/heads/master | 2022-09-30T11:30:32.351249 | 2020-06-04T04:47:25 | 2020-06-04T04:47:25 | 268,009,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 580 | java | package belajarDesignPattern.BuilderPattern;
import java.util.ArrayList;
import java.util.List;
public class Meal {
private List<Item> items=new ArrayList<Item>();
public void add(Item item) {
items.add(item);
}
public float getCost() {
float cost=0.0f;
for(Item item:items) {
cost+=item.price();
}
return cost;
}
public void showItems() {
for(Item item:items) {
System.out.println("item:"+item.name());
System.out.println("Packing:"+item.packing().pack());
System.out.println("Price:"+item.price());
System.out.println("-----------");
}
}
}
| [
"[email protected]"
] | |
7e2d995d465725c088bfe5cd028e4e72eb106211 | e38d327138aa3ce48280fc60e2c5761f52654774 | /app/src/main/java/com/vic/lab4/MainActivity.java | cc1c1b2a40643711546a4c72a79ef1fac8fc190f | [] | no_license | bpan2/MAP524_Lab4 | aac347693bd175a0d2bcf74248612703f3c880bf | 303c4de7f8f01cb5b3d8c1d02640a5449f779a8e | refs/heads/master | 2020-05-18T17:11:24.736638 | 2015-04-09T05:00:50 | 2015-04-09T05:00:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,592 | java | package com.vic.lab4;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends ActionBarActivity {
boolean swap = false;
FragmentOne fragOne = null;
FragmentTwo fragTwo = null;
Button btn;
FragmentManager fm = getFragmentManager();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
fragOne = new FragmentOne();
fragTwo = new FragmentTwo();
FragmentTransaction ft = fm.beginTransaction();
ft.add(R.id.fragView, fragOne, "Fragment1");
ft.addToBackStack("f1");
ft.add(R.id.fragView, fragTwo, "Fragment2");
ft.addToBackStack("f2");
ft.commit();
btn = (Button) findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
swap = swap == false ? true : false;
if(fragOne != null){
fragOne.updateImageView(swap);
}
if(fragTwo != null){
fragTwo.updateImageView(swap);
}
}
});
}
}
| [
"[email protected]"
] | |
83597c61bfea49e42342f96e38cb4b6b742282a6 | 238a8b90fdb315b3f3ccafa00fb3d498c4b2b36e | /app/src/main/java/com/waoss/ciby/EmergencyActivity.java | 1859ef3c6a014b7ea0e6df28f0cf4e17582fb700 | [] | no_license | rohan23chhabra/ciby | 2fec384ba0f20ea41a42a6415676eaf479433274 | 0310478bad1da427e5eeacc6cb8104a8f4acc577 | refs/heads/master | 2022-04-20T23:08:56.866057 | 2020-04-01T10:05:16 | 2020-04-01T10:05:16 | 251,101,084 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 943 | java | package com.waoss.ciby;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.google.android.gms.maps.model.LatLng;
import java.util.Objects;
public class EmergencyActivity extends AppCompatActivity {
LatLng location;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_emergency);
}
public void hospitalOnClick(View view) {
startZonalListViewActivity("hospital");
}
public void policeStationOnClick(View view) {
startZonalListViewActivity("police");
}
private void startZonalListViewActivity(String type) {
final Intent intent = new Intent(this, ZonalListViewActivity.class);
intent.putExtra("emergency-type", type);
startActivity(intent);
}
}
| [
"[email protected]"
] | |
52202305cc4658e186476e3bc18efd4bb1b315ba | 2f3bb917adcc081c8ef2f7370787ef83431183c5 | /src/main/java/com/igomall/entity/Admin.java | ec350fd4624a739963dfd827d06ba947f95ae53e | [] | no_license | heyewei/shopec-b2b2c | bc7aad32fc632ab20c3ed1f6a875e533d482dfa3 | a03fd48250aad4315a6ff687b6d01c7e12d0f93e | refs/heads/master | 2023-02-24T13:12:37.985421 | 2021-01-27T07:24:25 | 2021-01-27T07:24:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,090 | java | package com.igomall.entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
import com.baomidou.mybatisplus.annotation.TableField;
/**
* Entity - 管理员
*
*/
@Entity
public class Admin extends User {
private static final long serialVersionUID = -4000007477538426L;
/**
* 用户名
*/
@NotEmpty(groups = Save.class)
private String username;
/**
* 密码
*/
@NotEmpty(groups = Save.class)
@TableField(exist = false)
private String password;
/**
* 加密密码
*/
private String encodedPassword;
/**
* E-mail
*/
@NotEmpty
private String email;
/**
* 手机
*/
@NotEmpty
private String mobile;
/**
* 姓名
*/
private String name;
/**
* 部门
*/
private String department;
/**
* 角色
*/
@TableField(exist=false)
private Set<Role> roles = new HashSet<>();
/**
* 获取用户名
*
* @return 用户名
*/
public String getUsername() {
return username;
}
/**
* 设置用户名
*
* @param username
* 用户名
*/
public void setUsername(String username) {
this.username = username;
}
/**
* 获取密码
*
* @return 密码
*/
public String getPassword() {
return password;
}
/**
* 设置密码
*
* @param password
* 密码
*/
public void setPassword(String password) {
this.password = password;
if (password != null) {
setEncodedPassword(DigestUtils.md5Hex(password));
}
}
/**
* 获取加密密码
*
* @return 加密密码
*/
public String getEncodedPassword() {
return encodedPassword;
}
/**
* 设置加密密码
*
* @param encodedPassword
* 加密密码
*/
public void setEncodedPassword(String encodedPassword) {
this.encodedPassword = encodedPassword;
}
/**
* 获取E-mail
*
* @return E-mail
*/
public String getEmail() {
return email;
}
/**
* 设置E-mail
*
* @param email
* E-mail
*/
public void setEmail(String email) {
this.email = email;
}
/**
* 获取手机
*
* @return 手机
*/
public String getMobile() {
return mobile;
}
/**
* 设置手机
*
* @param mobile
* 手机
*/
public void setMobile(String mobile) {
this.mobile = mobile;
}
/**
* 获取姓名
*
* @return 姓名
*/
public String getName() {
return name;
}
/**
* 设置姓名
*
* @param name
* 姓名
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取部门
*
* @return 部门
*/
public String getDepartment() {
return department;
}
/**
* 设置部门
*
* @param department
* 部门
*/
public void setDepartment(String department) {
this.department = department;
}
/**
* 获取角色
*
* @return 角色
*/
public Set<Role> getRoles() {
return roles;
}
/**
* 设置角色
*
* @param roles
* 角色
*/
public void setRoles(Set<Role> roles) {
this.roles = roles;
}
@Override
@Transient
public String getDisplayName() {
return getUsername();
}
@Override
@Transient
public Object getPrincipal() {
return getUsername();
}
@Override
@Transient
public Object getCredentials() {
return getPassword();
}
@Override
@Transient
public boolean isValidCredentials(Object credentials) {
return credentials != null && StringUtils.equals(DigestUtils.md5Hex(credentials instanceof char[] ? String.valueOf((char[]) credentials) : String.valueOf(credentials)), getEncodedPassword());
}
/**
* 持久化前处理
*/
@PrePersist
public void prePersist() {
setUsername(StringUtils.lowerCase(getUsername()));
setEmail(StringUtils.lowerCase(getEmail()));
}
/**
* 更新前处理
*/
@PreUpdate
public void preUpdate() {
setEmail(StringUtils.lowerCase(getEmail()));
}
} | [
"[email protected]"
] | |
015b983b437386525b95c6295a6c5ebb8c783f32 | 98930b5356abef64642a55435219a1aa15097997 | /app/src/main/java/enrique/pichangatpa/SettingsActivity.java | da26d50f39a20ca358218db5b631e96eb5d8ab51 | [] | no_license | enriquesoto/CapstoneProjectTPAndroidPinPong | 2d736110f91f2f763059a015158ef52e22eddb98 | aa2a8ed2b7ffcc8c9b27ebd81f07938b00090c87 | refs/heads/master | 2021-01-18T21:31:51.402068 | 2014-09-08T21:07:45 | 2014-09-08T21:07:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package enrique.pichangatpa;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
import enrique.pichangatpa.R;
public class SettingsActivity extends ActionBarActivity {
private Spinner mSpinnerCountry;
private Spinner mSpinnerOpponent;
private Button mbttnSubmit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_settings);
mSpinnerCountry = (Spinner) findViewById(R.id.mSpinnerCountry);
mSpinnerOpponent = (Spinner) findViewById(R.id.mSpinnerOpponent);
mbttnSubmit = (Button) findViewById(R.id.btnSubmit);
/*Toast.makeText(SettingsActivity.this,
"OnClickListener : " +
"\nSpinner 1 : " + String.valueOf(mSpinnerCountry.getSelectedItem()),
Toast.LENGTH_SHORT
).show();*/
mbttnSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent returnIntent = new Intent();
int selectedCountryIndex = mSpinnerCountry.getSelectedItemPosition();
int selectedOpponentIndex = mSpinnerOpponent.getSelectedItemPosition();
returnIntent.putExtra("mCountryTeam",selectedCountryIndex);
returnIntent.putExtra("mOpponentTeam",selectedOpponentIndex);
setResult(RESULT_OK,returnIntent);
finish();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.settings, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
25ec05c1aa35f8e9e057a27e849f5f21c3c97838 | ab3a1a82fda5166daf4062b6d19e27ce31dc4548 | /src/main/java/thread/DangerousThread.java | 76523aa62346a7d93f863a791b07f53b74ac1ddf | [] | no_license | rafadelnero/javachallengers | 8d532abbf44629e91335c03428a762f174a34cf5 | a271fa8386fed7b6080a770eb3c7628d3d721a16 | refs/heads/master | 2022-12-25T05:52:26.644435 | 2022-12-17T16:28:55 | 2022-12-17T16:28:55 | 202,078,407 | 70 | 15 | null | 2022-12-17T16:21:49 | 2019-08-13T06:23:46 | Java | UTF-8 | Java | false | false | 439 | java | package thread;
public class DangerousThread {
public static void main(String... doYourBest) throws InterruptedException {
Thread heisenberg = new Heisenberg();
heisenberg.start();
heisenberg.join();
heisenberg.start();
heisenberg.join();
}
static class Heisenberg extends Thread {
public void run() {
System.out.println("I am the danger!");
}
}
}
| [
"[email protected]"
] | |
a9c253fc5e056c904726cf6ff48e94ae004463f3 | 2702ff64b7bbe69279c54f505712ce7bcc65022e | /src/Exercicio3b/Funcionario.java | b0cd1c4cb2baf07625246dac0fdce553883250f1 | [] | no_license | matheushenrycb/DispositivosMoveis | 0cab9c86bb2d2c03fe33aaacb8db81a745ce5e20 | e1f0850431c26bcaaf5dd5ffb0f9f1c9c2e95f8c | refs/heads/master | 2021-04-27T21:15:22.417381 | 2018-02-22T17:22:47 | 2018-02-22T17:22:47 | 122,396,974 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,408 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Exercicio3b;
/**
*
* @author Matheus HEnry
*/
public class Funcionario extends Principal {
int matricula;
double salario1;
double salario2;
public Funcionario(int matricula,double salario1, double salario2) {
this.matricula= matricula;
this.salario1 = salario1;
this.salario2= salario2;
}
public int getMatricula() {
return matricula;
}
public void setMatricula(int matricula) {
this.matricula = matricula;
}
public double getSalario1() {
return salario1*0.40;
}
public void setSalario1(double salario1) {
this.salario1 = salario1;
}
public double getSalario2() {
return salario2*0.60;
}
public void setSalario2(double salario2) {
this.salario2 = salario2;
}
public void getparcelaUm() {
System.out.println("-------------------------------------------------");
System.out.println("Primeira parcela do Salario: " + this.getSalario1());
}
public void getparcelaDois() {
System.out.println("Segunda parcela do Salario: " + this.getSalario2());
}
}
| [
"Matheus HEnry@MatheusHEnry-PC"
] | Matheus HEnry@MatheusHEnry-PC |
30fc3f233913496fdfb64075afb15f0dfc231c2a | 9971d019c5a4ecd0892cb9e035c5f5d77af25f92 | /src/ru/job4j/array/AlgoArray.java | eff7d09c59f35f46c0a3084cbfce94289e65d2cc | [] | no_license | Zhaava/job4j_elementary | ce5460a97e10e49d82ab93fa033fc8e4d9492bbd | 18c26c033806f30a61eabb7720b518dfcb25b5e2 | refs/heads/master | 2023-05-28T04:23:18.138892 | 2021-06-22T11:33:56 | 2021-06-22T11:33:56 | 298,788,560 | 0 | 0 | null | 2020-09-26T10:17:24 | 2020-09-26T10:17:23 | null | UTF-8 | Java | false | false | 879 | java | package ru.job4j.array;
public class AlgoArray {
public static void main(String[] args) {
int[] array = new int[] {5, 3, 2, 1, 4};
int temp = array[0]; /* переменная для временного хранения значение ячейки с индексом 0. */
array[0] = array[3]; /* записываем в ячейку с индексом 0 значение ячейки с индексом 3. */
array[3] = temp; /* записываем в ячейку с индексом 3 значение временной переменной. */
temp = array[1];
array[1] = array[2];
array[2] = temp;
temp = array[3];
array[3] = array[4];
array[4] = temp;
for (int index = 0; index < array.length; index++) {
System.out.println(array[index]);
}
}
}
| [
"[email protected]"
] | |
c668c74a6fd1de0aea98781e0b31fb88f90d81bd | b2bac83818f1e3a97d33988423a8b737627b3be9 | /hibernate/src/extend/teacher.java | 9d44e1b60b506bb9741132d10471861e3edad2a2 | [] | no_license | pupilBin/learn | 8177fe0cfa060955c3ff88ac63a57f2cfc14e1ad | 132fb53adc3d4f0501e86a8cd466221c9e06876c | refs/heads/master | 2020-12-07T07:43:28.630882 | 2017-07-14T14:49:28 | 2017-07-14T14:49:28 | 53,180,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 259 | java | package extend;
/**
* Created by pupil on 2016/6/20.
*/
public class teacher extends person {
private int salary;
public int getSalary() {
return salary;
}
public void setSalary(int salary) {
this.salary = salary;
}
}
| [
"[email protected]"
] | |
44ef7989ee1bcfde2644ed5c17ea58021a0eae0c | 8a539448c904b8bc07e8881ca820e5baa9cc0ae0 | /src/main/java/com/virtru/saas/framework/sqs/AwsSqsProvider.java | 8979d4af170a54f551398fc06d9e9abd3f3c022b | [] | no_license | mkhader12/saasgateway2 | db7df5b1ed463baf114f7c7f47a54a13d500382c | 2787b2d511920e6ebed775f251c16b7086d236a0 | refs/heads/master | 2020-03-11T20:00:31.355535 | 2018-04-19T14:17:37 | 2018-04-19T14:17:37 | 130,224,353 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,560 | java | package com.virtru.saas.framework.sqs;
import com.amazon.sqs.javamessaging.AmazonSQSMessagingClientWrapper;
import com.amazon.sqs.javamessaging.ProviderConfiguration;
import com.amazon.sqs.javamessaging.SQSConnection;
import com.amazon.sqs.javamessaging.SQSConnectionFactory;
import com.amazonaws.services.sqs.AmazonSQSClientBuilder;
import com.amazonaws.services.sqs.model.CreateQueueRequest;
import com.amazonaws.services.sqs.model.CreateQueueResult;
import com.amazonaws.services.sqs.model.DeleteMessageRequest;
import com.amazonaws.services.sqs.model.GetQueueUrlResult;
import com.amazonaws.services.sqs.model.ReceiveMessageRequest;
import com.amazonaws.services.sqs.model.ReceiveMessageResult;
import com.amazonaws.services.sqs.model.SendMessageRequest;
import com.amazonaws.services.sqs.model.SendMessageResult;
import javax.jms.JMSException;
public class AwsSqsProvider implements QueueProvider {
private static AmazonSQSMessagingClientWrapper client;
public AwsSqsProvider(int numberOfMessagesToPrefetch) throws JMSException {
// Create a new connection factory with all defaults (credentials and region) set automatically
SQSConnectionFactory connectionFactory = new SQSConnectionFactory(
new ProviderConfiguration().withNumberOfMessagesToPrefetch(numberOfMessagesToPrefetch),
AmazonSQSClientBuilder.defaultClient()
);
// Create the connection.
SQSConnection connection = connectionFactory.createConnection();
// Get the wrapped client
client = connection.getWrappedAmazonSQSClient();
}
@Override
public void deleteMessage(DeleteMessageRequest deleteMessageRequest) throws JMSException {
client.deleteMessage(deleteMessageRequest);
}
@Override
public SendMessageResult sendMessage(SendMessageRequest sendMessageRequest) throws JMSException {
return client.sendMessage(sendMessageRequest);
}
@Override
public boolean queueExists(String queueName) throws JMSException {
return client.queueExists(queueName);
}
@Override
public GetQueueUrlResult getQueueUrl(String queueName) throws JMSException {
return client.getQueueUrl(queueName);
}
@Override
public CreateQueueResult createQueue(CreateQueueRequest createQueueRequest) {
return null;
}
@Override
public ReceiveMessageResult receiveMessage(ReceiveMessageRequest receiveMessageRequest) throws JMSException {
return client.receiveMessage(receiveMessageRequest);
}
}
| [
"[email protected]"
] | |
8826e1d19c5ef5c98a00f51843c985220a9d830e | f428f600c682396db98127c7ea647b865a57b041 | /app/src/androidTest/java/com/example/spinnervolition/ExampleInstrumentedTest.java | d824d90d1e7c56ed95fcc0c94489bb94a3bd0075 | [] | no_license | AscEmon/SpinnerVolition | 1190dd65e93d44955a74933ede996ab51d042014 | 79a1939e284d601623abd590811ef2e9803a7079 | refs/heads/master | 2023-02-26T09:08:53.432873 | 2021-01-21T17:06:25 | 2021-01-21T17:06:25 | 328,210,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package com.example.spinnervolition;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.spinnervolition", appContext.getPackageName());
}
} | [
"[email protected]"
] | |
1a471528315a6ab26d50a9e9e6f3f304eedb7ba7 | 77836d266eb9eb1c8ff4d9009bcacf7d518800ae | /src/main/java/com/battcn/service/system/OrderService.java | cbc6b5b783aa71cda24a6f0cd9babd281076156a | [] | no_license | Lida52jiao/hkjgj | 6a5e2fd064194978a0e56da7009a8ef897c5e567 | 1ea4ee57f6d8a20ce56e82e3aeefc64ae330b5f4 | refs/heads/master | 2022-12-20T10:51:40.252902 | 2019-12-04T07:20:11 | 2019-12-04T07:20:11 | 225,811,746 | 0 | 0 | null | 2022-12-16T06:23:38 | 2019-12-04T08:01:27 | Java | UTF-8 | Java | false | false | 172 | java | package com.battcn.service.system;
import com.battcn.entity.Orders;
import com.battcn.service.BaseService;
public interface OrderService extends BaseService<Orders> {
}
| [
"[email protected]"
] | |
aa536d21f8b0700a34e14eaf79d1ae78efa3f47a | afff6a780dbebb9a47abde1f9ae751fba1e15a7f | /Assignment 2/Assignment2/src/WQUPC/WQUPCTest.java | 97fa96e65600240809c87a10867eb0aa899c89d8 | [] | no_license | yashkhopkar/Program-Structures-And-Algorithms | 082f9afa60e4e3106c680583e6e0484dd505eec1 | 3935cb5aca1c5172711a538f891fa33fa762a98f | refs/heads/master | 2020-03-22T12:20:49.440242 | 2018-09-29T22:49:08 | 2018-09-29T22:49:08 | 140,034,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,161 | java | package WQUPC;
import static org.junit.Assert.*;
import org.junit.Test;
public class WQUPCTest {
/**
*/
@Test
public void testFind0() {
WQUPC h = new WQUPC(10);
assertEquals(0, h.find(0));
}
/**
*/
@Test
public void testFind1() {
WQUPC h = new WQUPC(10);
h.union(0,1);
assertEquals(0, h.find(0));
assertEquals(0, h.find(1));
}
/**
*/
@Test
public void testFind2() {
WQUPC h = new WQUPC(10);
h.union(0,1);
assertEquals(0, h.find(0));
assertEquals(0, h.find(1));
h.union(2,1);
assertEquals(0, h.find(0));
assertEquals(0, h.find(1));
assertEquals(0, h.find(2));
}
/**
*/
@Test
public void testFind3() {
WQUPC h = new WQUPC(10);
h.union(0,1);
h.union(0,2);
h.union(3,4);
h.union(3,5);
assertEquals(0, h.find(0));
assertEquals(0, h.find(1));
assertEquals(0, h.find(2));
assertEquals(3, h.find(3));
assertEquals(3, h.find(4));
assertEquals(3, h.find(5));
h.union(0,3);
assertEquals(0, h.find(0));
assertEquals(0, h.find(1));
assertEquals(0, h.find(2));
assertEquals(0, h.find(3));
assertEquals(0, h.find(4));
assertEquals(0, h.find(5));
}
/**
*/
@Test
public void testFind4() {
WQUPC h = new WQUPC(10);
h.union(0,1);
h.union(1,2);
h.union(3,4);
h.union(3,5);
assertEquals(0, h.find(0));
assertEquals(0, h.find(1));
assertEquals(0, h.find(2));
assertEquals(3, h.find(3));
assertEquals(3, h.find(4));
assertEquals(3, h.find(5));
h.union(0,3);
assertEquals(0, h.find(0));
assertEquals(0, h.find(1));
assertEquals(0, h.find(2));
assertEquals(0, h.find(3));
assertEquals(0, h.find(4));
assertEquals(0, h.find(5));
}
/**
*/
@Test
public void testConnected01() {
WQUPC h = new WQUPC(10);
assertFalse(h.connected(0,1));
}
}
| [
"[email protected]"
] | |
80d827cba9c12e300c15eb85cd7eab04c88c3369 | 7859fb2a0d2d8b324b3b78ace92803cd0eba3f5b | /src/main/java/ar/edu/um/programacion2/config/WebConfigurer.java | 5f0c34af8654ed6e3e252f5899a94e3ab5eeaffc | [] | no_license | francomanuel/programacion2-tp | a9fc1c73e56c904398d95951f6b336f5e054edfd | ce30a3763a3a8f85c839e2626b62ec3b975df314 | refs/heads/master | 2022-12-09T07:58:57.167364 | 2020-09-01T22:44:41 | 2020-09-01T22:44:41 | 292,095,741 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,478 | java | package ar.edu.um.programacion2.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.github.jhipster.config.h2.H2ConfigurationHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.server.*;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles;
import org.springframework.http.MediaType;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import javax.servlet.*;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;
import java.util.*;
import static java.net.URLDecoder.decode;
/**
* Configuration of web application with Servlet 3.0 APIs.
*/
@Configuration
public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {
private final Logger log = LoggerFactory.getLogger(WebConfigurer.class);
private final Environment env;
private final JHipsterProperties jHipsterProperties;
public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) {
this.env = env;
this.jHipsterProperties = jHipsterProperties;
}
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
if (env.getActiveProfiles().length != 0) {
log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles());
}
if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
initH2Console(servletContext);
}
log.info("Web application fully configured");
}
/**
* Customize the Servlet engine: Mime types, the document root, the cache.
*/
@Override
public void customize(WebServerFactory server) {
setMimeMappings(server);
// When running in an IDE or with ./mvnw spring-boot:run, set location of the static web assets.
setLocationForStaticAssets(server);
}
private void setMimeMappings(WebServerFactory server) {
if (server instanceof ConfigurableServletWebServerFactory) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
// IE issue, see https://github.com/jhipster/generator-jhipster/pull/711
mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase());
// CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64
mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase());
ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server;
servletWebServer.setMimeMappings(mappings);
}
}
private void setLocationForStaticAssets(WebServerFactory server) {
if (server instanceof ConfigurableServletWebServerFactory) {
ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server;
File root;
String prefixPath = resolvePathPrefix();
root = new File(prefixPath + "target/classes/static/");
if (root.exists() && root.isDirectory()) {
servletWebServer.setDocumentRoot(root);
}
}
}
/**
* Resolve path prefix to static resources.
*/
private String resolvePathPrefix() {
String fullExecutablePath;
try {
fullExecutablePath = decode(this.getClass().getResource("").getPath(), StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
/* try without decoding if this ever happens */
fullExecutablePath = this.getClass().getResource("").getPath();
}
String rootPath = Paths.get(".").toUri().normalize().getPath();
String extractedPath = fullExecutablePath.replace(rootPath, "");
int extractionEndIndex = extractedPath.indexOf("target/");
if (extractionEndIndex <= 0) {
return "";
}
return extractedPath.substring(0, extractionEndIndex);
}
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = jHipsterProperties.getCors();
if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
log.debug("Registering CORS filter");
source.registerCorsConfiguration("/api/**", config);
source.registerCorsConfiguration("/management/**", config);
source.registerCorsConfiguration("/v2/api-docs", config);
}
return new CorsFilter(source);
}
/**
* Initializes H2 console.
*/
private void initH2Console(ServletContext servletContext) {
log.debug("Initialize H2 console");
H2ConfigurationHelper.initH2Console(servletContext);
}
}
| [
"[email protected]"
] | |
549449b633129229cbef79e6cf0bc7cb78473322 | c40b235589793ea971d44a75efad4a60ed318a6a | /src/vista/iconos/icon.java | 1956d832b54e52a3578364cc390ceb1277d30ce1 | [] | no_license | miguelarriba/DBCase | 8604c5240b2e063454058c50d204594515c752a7 | a6a756dc03fb231515169a73ec171794141830c6 | refs/heads/master | 2020-04-07T00:17:21.063137 | 2019-10-07T16:04:05 | 2019-10-07T16:04:05 | 157,897,503 | 0 | 1 | null | 2020-02-06T14:52:11 | 2018-11-16T17:02:49 | Java | UTF-8 | Java | false | false | 1,093 | java | package vista.iconos;
import javax.swing.Icon;
public abstract class icon implements Icon{
private int size;
private boolean pintarMas;
private boolean selected;
private final int DEFAULTSIZE = 60;
private final int MINISIZE = 30;
private final int PERSPECTIVESIZE = 50;
protected double offset = .1;
public icon() {
super();
pintarMas = true;
size = DEFAULTSIZE;
}
public icon(String tipo) {
super();
switch(tipo) {
case "mini": size = MINISIZE;pintarMas = false;break;
case "perspective": size = PERSPECTIVESIZE;pintarMas = false;break;
default: size = DEFAULTSIZE;pintarMas = true;
}
}
public icon(String string, boolean selected) {
this(string);
this.selected = selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
protected boolean isSelected() {
return selected;
}
protected boolean pintarMas() {
return pintarMas;
}
@Override
public int getIconWidth() {
return size;
}
@Override
public int getIconHeight() {
return size == PERSPECTIVESIZE ? size :size/2;
}
}
| [
"[email protected]"
] | |
9343679e9ed666afa0edb26e60c4647c55089fc1 | 5217d79af2ca6232edec96a2d8ffe371935e93df | /chorus-selftest/src/test/features/org/chorusbdd/chorus/selftest/processhandler/nonjava/TestNonJavaProcesses.java | 7dc8a552b50c6575fd3e5ba4b43eaef1d14a4ed8 | [
"MIT"
] | permissive | deepakcdo/Chorus | f263c201a9220ef760826f8f55fe53e36b57491c | c22362a71db7afc22b75cbc9e443ae39018b0995 | refs/heads/master | 2021-01-17T06:06:25.342740 | 2014-07-09T20:41:00 | 2014-07-09T20:41:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,591 | java | /**
* Copyright (C) 2000-2013 The Software Conservancy and Original Authors.
* All rights reserved.
*
* 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.
*
* Nothing in this notice shall be deemed to grant any rights to trademarks,
* copyrights, patents, trade secrets or any other intellectual property of the
* licensor or any contributor except as expressly stated herein. No patent
* license is granted separate from the Software, for code that you delete from
* the Software, or for combinations of the Software with other software or
* hardware.
*/
package org.chorusbdd.chorus.selftest.processhandler.nonjava;
import org.chorusbdd.chorus.selftest.AbstractInterpreterTest;
import org.chorusbdd.chorus.selftest.DefaultTestProperties;
/**
* Created with IntelliJ IDEA.
* User: nick
* Date: 25/06/12
* Time: 22:14
*/
public class TestNonJavaProcesses extends AbstractInterpreterTest {
final String featurePath = "src/test/features/org/chorusbdd/chorus/selftest/processhandler/nonjava/startnonjava.feature";
final int expectedExitCode = 0; //success
protected int getExpectedExitCode() {
return expectedExitCode;
}
protected String getFeaturePath() {
return featurePath;
}
/**
* A test can override this method to modify the sys properties being used from the default set
*/
protected void doUpdateTestProperties(DefaultTestProperties sysProps) {
sysProps.setProperty("chorusExecutionListener", PropertyWritingExecutionListener.class.getName());
}
}
| [
"[email protected]"
] | |
1bb38a0be60dec6c396cc2c545d4d436c470a988 | 427ed6dd94a24adaf90cd4d333d5ae0aefc71cad | /analyse/src/main/java/de/ami/team1/analyse/services/UserService.java | 07549b62ebe416539df6d67a94f6836e9504de60 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | permissive | ixLikro/master-ami-java-contact-tracing-services | d9b98efb17d13fa8d269efe9929ef1b0aa77ff0e | 2bc647125b1533c2ff582e05bb6c79f5e513ea2a | refs/heads/master | 2023-03-20T10:04:39.378931 | 2021-03-17T23:14:35 | 2021-03-17T23:14:35 | 348,425,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package de.ami.team1.analyse.services;
import de.ami.team1.analyse.crud.CrudService;
import de.ami.team1.analyse.entities.User;
import javax.enterprise.context.RequestScoped;
@RequestScoped
public class UserService extends CrudService<User> {
@Override
protected Class<User> getEntityClass() {
return User.class;
}
}
| [
"[email protected]"
] | |
f21842427f6622d9325dfa4fc0cb42cb72f8a132 | 5bb4a4b0364ec05ffb422d8b2e76374e81c8c979 | /sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/DeliveryWithResourceIdentity.java | bd825a8f530c728e05ea687e320bc3b426367d54 | [
"MIT",
"LicenseRef-scancode-generic-cla",
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-or-later",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | FabianMeiswinkel/azure-sdk-for-java | bd14579af2f7bc63e5c27c319e2653db990056f1 | 41d99a9945a527b6d3cc7e1366e1d9696941dbe3 | refs/heads/main | 2023-08-04T20:38:27.012783 | 2020-07-15T21:56:57 | 2020-07-15T21:56:57 | 251,590,939 | 3 | 1 | MIT | 2023-09-02T00:50:23 | 2020-03-31T12:05:12 | Java | UTF-8 | Java | false | false | 2,465 | java | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.eventgrid.v2020_04_01_preview;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Information about the delivery for an event subscription with resource
* identity.
*/
public class DeliveryWithResourceIdentity {
/**
* The identity to use when delivering events.
*/
@JsonProperty(value = "identity")
private EventSubscriptionIdentity identity;
/**
* Information about the destination where events have to be delivered for
* the event subscription.
* Uses Azure Event Grid's identity to acquire the authentication tokens
* being used during delivery / dead-lettering.
*/
@JsonProperty(value = "destination")
private EventSubscriptionDestination destination;
/**
* Get the identity to use when delivering events.
*
* @return the identity value
*/
public EventSubscriptionIdentity identity() {
return this.identity;
}
/**
* Set the identity to use when delivering events.
*
* @param identity the identity value to set
* @return the DeliveryWithResourceIdentity object itself.
*/
public DeliveryWithResourceIdentity withIdentity(EventSubscriptionIdentity identity) {
this.identity = identity;
return this;
}
/**
* Get information about the destination where events have to be delivered for the event subscription.
Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering.
*
* @return the destination value
*/
public EventSubscriptionDestination destination() {
return this.destination;
}
/**
* Set information about the destination where events have to be delivered for the event subscription.
Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering.
*
* @param destination the destination value to set
* @return the DeliveryWithResourceIdentity object itself.
*/
public DeliveryWithResourceIdentity withDestination(EventSubscriptionDestination destination) {
this.destination = destination;
return this;
}
}
| [
"[email protected]"
] | |
b81d3ba01486620cb5a1d2d2080c9709ff5d4ed8 | e15c58da1d0ded24b9defab70d3a23dfe6149729 | /api/src/test/java/com/naverlabs/chatbot/service/web/ChatbotResourceTest.java | 4c284bb1ec461ac7abd0478505ab4f7aeb1bdfc3 | [] | no_license | stunstunstun/chatbot | cdcb23ed62a1a882dabe22fc92e346f0db55809b | 4719c2aae0c932c24bd19acaa3fe20848c987eb3 | refs/heads/master | 2021-01-19T19:52:18.849504 | 2017-08-30T04:54:32 | 2017-08-30T04:54:32 | 101,212,645 | 2 | 0 | null | 2017-08-26T07:20:51 | 2017-08-23T18:29:41 | Java | UTF-8 | Java | false | false | 1,313 | java | package com.naverlabs.chatbot.service.web;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.naverlabs.chatbot.domain.Chatbot;
import com.naverlabs.chatbot.v1.web.ChatbotResource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.json.JacksonTester;
import org.springframework.core.io.ClassPathResource;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author minhyeok
*/
@RunWith(SpringRunner.class)
@Transactional
@SpringBootTest
public class ChatbotResourceTest {
private JacksonTester<ChatbotResource> jacksonTester;
private ChatbotResource resource;
@Before
public void setup() throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
JacksonTester.initFields(this, objectMapper);
resource = jacksonTester.readObject(new ClassPathResource("chatbot_resource.json"));
}
@Test
public void entityIsMutable() {
Chatbot entity = resource.getEntity();
assertThat(entity).isEqualTo(resource.getEntity());
}
}
| [
"[email protected]"
] | |
6f2a92d2e369af7c61cd6aa163db185947d3c160 | a2e5315745c6e5252c8bc76e21f2c0c0ffb6c41b | /Spring/Spring-Day2/src/main/java/com/taggy/spring/beanpostprocessor/Loan.java | a1b403136556764b726662e3cfd340070eb7abfb | [] | no_license | TheMaheshBiradar/spring-web-apps | 6f140a7ca05b65134bbfadace33b6f8b9751741b | 42c882c65ec9ff63fb51de1a2d68ad2521309d63 | refs/heads/master | 2023-07-25T19:51:36.626345 | 2023-07-12T23:02:21 | 2023-07-12T23:02:21 | 38,208,574 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.taggy.spring.beanpostprocessor;
public class Loan {
private String loanType;
public void setLoanType(String loanType) {
this.loanType = loanType;
}
public String getLoanType() {
return loanType;
}
@Override
public String toString() {
return "Loan [loanType=" + loanType + "]";
}
}
| [
"[email protected]"
] | |
bfd9d2a3da506b0ffae7c3fa04e25eb21c95a98c | 23a9b9e2d6f3d4dd496911862e2f2b144282a3bc | /src/test/java/cn/cuit/exam/service/impl/MajorServiceImplTest.java | 654558390597c025657e2117d0b28ff2b78d5985 | [] | no_license | adventure-111/exam2.0 | fdb9de1bc105d9bfb9a58bd7c53320816b7e0c00 | b0940f4d923b2c5eac646bb8e4108b99cc7f5bbd | refs/heads/main | 2023-06-01T14:23:59.126672 | 2021-06-21T19:39:03 | 2021-06-21T19:39:03 | 368,561,766 | 0 | 2 | null | 2021-06-16T16:51:24 | 2021-05-18T14:32:00 | Java | UTF-8 | Java | false | false | 401 | java | package cn.cuit.exam.service.impl;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class MajorServiceImplTest {
@Autowired
private MajorServiceImpl service;
@Test
void test1() {
System.out.println(service.getMshortByMno("0702"));
}
}
| [
"[email protected]"
] | |
de445e280c0675d722df1f9034837d9f735f6940 | 31f609157ae46137cf96ce49e217ce7ae0008b1e | /bin/ext-accelerator/acceleratorfacades/src/de/hybris/platform/acceleratorfacades/product/converters/populator/ProductVolumePricesPopulator.java | 2e23837875a7f09f87a60c6aaacc089ae98b0ac0 | [] | no_license | natakolesnikova/hybrisCustomization | 91d56e964f96373781f91f4e2e7ca417297e1aad | b6f18503d406b65924c21eb6a414eb70d16d878c | refs/heads/master | 2020-05-23T07:16:39.311703 | 2019-05-15T15:08:38 | 2019-05-15T15:08:38 | 186,672,599 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,052 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.acceleratorfacades.product.converters.populator;
import de.hybris.platform.commercefacades.product.PriceDataFactory;
import de.hybris.platform.commercefacades.product.converters.populator.AbstractProductPopulator;
import de.hybris.platform.commercefacades.product.data.PriceData;
import de.hybris.platform.commercefacades.product.data.PriceDataType;
import de.hybris.platform.commercefacades.product.data.ProductData;
import de.hybris.platform.commerceservices.util.AbstractComparator;
import de.hybris.platform.core.model.product.ProductModel;
import de.hybris.platform.europe1.jalo.PriceRow;
import de.hybris.platform.jalo.order.price.PriceInformation;
import de.hybris.platform.product.PriceService;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Required;
/**
* Populator for product volume prices.
*/
public class ProductVolumePricesPopulator<SOURCE extends ProductModel, TARGET extends ProductData> extends
AbstractProductPopulator<SOURCE, TARGET>
{
private PriceService priceService;
private PriceDataFactory priceDataFactory;
protected PriceService getPriceService()
{
return priceService;
}
@Required
public void setPriceService(final PriceService priceService)
{
this.priceService = priceService;
}
protected PriceDataFactory getPriceDataFactory()
{
return priceDataFactory;
}
@Required
public void setPriceDataFactory(final PriceDataFactory priceDataFactory)
{
this.priceDataFactory = priceDataFactory;
}
@Override
public void populate(final SOURCE productModel, final TARGET productData) throws ConversionException
{
if (productData != null)
{
final List<PriceInformation> pricesInfos = getPriceService().getPriceInformationsForProduct(productModel);
if (pricesInfos == null || pricesInfos.size() < 2)
{
productData.setVolumePrices(Collections.<PriceData> emptyList());
}
else
{
final List<PriceData> volPrices = createPrices(productModel, pricesInfos);
// Sort the list into quantity order
Collections.sort(volPrices, VolumePriceComparator.INSTANCE);
// Set the max quantities
for (int i = 0; i < volPrices.size() - 1; i++)
{
volPrices.get(i).setMaxQuantity(Long.valueOf(volPrices.get(i + 1).getMinQuantity().longValue() - 1));
}
productData.setVolumePrices(volPrices);
}
}
}
protected List<PriceData> createPrices(final SOURCE productModel, final List<PriceInformation> pricesInfos) {
final List<PriceData> volPrices = new ArrayList<PriceData>();
final PriceDataType priceType = getPriceType(productModel);//not necessary
for (final PriceInformation priceInfo : pricesInfos)
{
final Long minQuantity = getMinQuantity(priceInfo);
if (minQuantity != null)
{
final PriceData volPrice = createPriceData(priceType, priceInfo);
if (volPrice != null)
{
volPrice.setMinQuantity(minQuantity);
volPrices.add(volPrice);
}
}
}
return volPrices;
}
protected PriceDataType getPriceType(final ProductModel productModel)
{
if (CollectionUtils.isEmpty(productModel.getVariants()))
{
return PriceDataType.BUY;
}
else
{
return PriceDataType.FROM;
}
}
protected Long getMinQuantity(final PriceInformation priceInfo)
{
final Map qualifiers = priceInfo.getQualifiers();
final Object minQtdObj = qualifiers.get(PriceRow.MINQTD);
if (minQtdObj instanceof Long)
{
return (Long) minQtdObj;
}
return null;
}
protected PriceData createPriceData(final PriceDataType priceType, final PriceInformation priceInfo)
{
return getPriceDataFactory().create(priceType, BigDecimal.valueOf(priceInfo.getPriceValue().getValue()),
priceInfo.getPriceValue().getCurrencyIso());
}
public static class VolumePriceComparator extends AbstractComparator<PriceData>
{
public static final VolumePriceComparator INSTANCE = new VolumePriceComparator();
@Override
protected int compareInstances(final PriceData price1, final PriceData price2)
{
if (price1 == null || price1.getMinQuantity() == null)
{
return BEFORE;
}
if (price2 == null || price2.getMinQuantity() == null)
{
return AFTER;
}
return compareValues(price1.getMinQuantity().longValue(), price2.getMinQuantity().longValue());
}
}
}
| [
"[email protected]"
] | |
bce0d5b27163a37dc3548a23b3802ca2711fff67 | 754ee75fa5b434ce646eee6c8e3381c8d5371d53 | /src/main/java/commons/AbstractTest.java | 7be942dce3c89f12a0ccc09eac357d8ca75a0c88 | [] | no_license | mylinh12/GITHUB_JENKIN_BLUEOCEAN_MAVEN_CUCUMBER_05_LINHOM | cd7afa2e9d18ae4ca48224fb50582e90d131e065 | 5758e02926a7fd1e6b77ff447bdc215c77b2b065 | refs/heads/master | 2020-04-21T22:30:56.766498 | 2019-02-09T21:23:59 | 2019-02-09T21:23:59 | 169,913,670 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,601 | java | package commons;
import java.util.Random;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.Reporter;
public class AbstractTest {
WebDriver driver;
// Khoi tao log
protected final Log log;
// Vi moi file TCs deu ke thu AbstractTest, nen contructor cua AbstractTest la noi de bat dau viec ghi log.
public AbstractTest() {
log = LogFactory.getLog(getClass());
}
protected void closeBrowser(WebDriver driver) {
try {
// delete all cookies
driver.manage().deleteAllCookies();
// Detect OS (Windows/ Linux/ MAC)
String osName = System.getProperty("os.name").toLowerCase();
String cmd = "";
driver.quit();
if (driver.toString().toLowerCase().contains("chrome")) {
// Kill process
if (osName.toLowerCase().contains("mac")) {
cmd = "pkill chromedriver";
} else {
cmd = "taskkill /F /FI \"IMAGENAME eq chromedriver*\"";
}
Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
}
if (driver.toString().toLowerCase().contains("internetexplorer")) {
cmd = "taskkill /F /FI \"IMAGENAME eq IEDriverServer*\"";
Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
}
// log.info("---------- QUIT BROWSER SUCCESS ----------");
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public int randomNumber() {
Random rand = new Random();
int number = rand.nextInt(999999) + 1;
return number;
}
public String randomEmail() {
Random rand = new Random();
String email = rand.nextInt(999999) + "@gmail.com";
return email;
}
private boolean checkPassed(boolean condition) {
boolean pass = true;
try {
if (condition == true)
log.info("===PASSED===");
else
log.info("===FAILED===");
Assert.assertTrue(condition);
} catch (Throwable e) {
pass = false;
log.info("=== Throw error message: " + e.getMessage() + " ===\n");
// Se add ket qua error vao TestNG report cho minh.
VertificationFailures.getFailures().addFailureForTest(Reporter.getCurrentTestResult(), e);
// Con cai nay la dung de add status (true/false) to ReportNG report cho minh.
// Khi ko co dong nay, thi tat ca cac loai reports se bao Pass het (la bi sai nha), khi co dong nay vao thi report bao chinh xac hon (co fail xuat hien)
Reporter.getCurrentTestResult().setThrowable(e);
}
return pass;
}
public boolean verifyTrue(boolean condition) {
return checkPassed(condition);
}
private boolean checkFailed(boolean condition) {
boolean pass = true;
try {
if (condition == true)
log.info("===PASSEDd===");
else
log.info("===FAILED===");
Assert.assertFalse(condition);
} catch (Throwable e) {
pass = false;
log.info("=== Throw error message: " + e.getMessage() + " ===\n");
Reporter.getCurrentTestResult().setThrowable(e);
}
return pass;
}
public boolean verifyFail(boolean condition) {
return checkFailed(condition);
}
private boolean checkEquals(Object actual, Object expected) {
boolean pass = true;
try {
Assert.assertEquals(actual, expected);
} catch (Throwable e) {
pass = false;
log.info("=== Throw error message: " + e.getMessage() + " ===\n");
Reporter.getCurrentTestResult().setThrowable(e);
}
return pass;
}
public boolean verifyEquals(Object actual, Object expected) {
return checkEquals(actual, expected);
}
}
| [
"[email protected]"
] | |
42c6a21555e70c3cbf318faf519c9e1f67ee672d | eaf1803c0ceeb0c1dd2467884fbf330c5c85f6cb | /src/com/vova_cons/Physics/Point.java | 404dfd4b82d90ee8e024fedc0dba567bdeb3213b | [] | no_license | anbu93/SpaceBattleGame | 16f4b6ceb7764cbd9b50067fce1ee2a0506a730e | 4783de0cfd9e2bcfc45d560501738892e271d36d | refs/heads/master | 2021-01-10T14:31:00.866304 | 2016-02-13T06:45:20 | 2016-02-13T06:45:20 | 51,239,759 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package com.vova_cons.Physics;
public interface Point extends Cloneable {
static Point create(double x, double y){
return new PointImpl(x, y);
}
static Point create(String str){
String[] values = str.split(" ");
double x = Double.parseDouble(values[0]);
double y = Double.parseDouble(values[1]);
return create(x, y);
}
static Point getInvertYPoint(Point point, double height){
return new InvertY(point, height);
}
double getX();
double getY();
Point offset(Point point);
Point clone();
boolean equals(Point point);
Point offset(double x, double y);
}
| [
"[email protected]"
] | |
47a0a7495a5337f4dbae7b2333d6096000e1eb1f | 0d4f05c9909695a166e97b8958680945ea5c1266 | /src/minecraft/io/netty/handler/codec/Headers.java | c5c5910f84782abf540ad43f4d6719a5bda82610 | [] | no_license | MertDundar1/ETB-0.6 | 31f3f42f51064ffd7facaa95cf9b50d0c2d71995 | 145d008fed353545157cd0e73daae8bc8d7f50b9 | refs/heads/master | 2022-01-15T08:42:12.762634 | 2019-05-15T23:37:33 | 2019-05-15T23:37:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,890 | java | package io.netty.handler.codec;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
public abstract interface Headers<K, V, T extends Headers<K, V, T>>
extends Iterable<Map.Entry<K, V>>
{
public abstract V get(K paramK);
public abstract V get(K paramK, V paramV);
public abstract V getAndRemove(K paramK);
public abstract V getAndRemove(K paramK, V paramV);
public abstract List<V> getAll(K paramK);
public abstract List<V> getAllAndRemove(K paramK);
public abstract Boolean getBoolean(K paramK);
public abstract boolean getBoolean(K paramK, boolean paramBoolean);
public abstract Byte getByte(K paramK);
public abstract byte getByte(K paramK, byte paramByte);
public abstract Character getChar(K paramK);
public abstract char getChar(K paramK, char paramChar);
public abstract Short getShort(K paramK);
public abstract short getShort(K paramK, short paramShort);
public abstract Integer getInt(K paramK);
public abstract int getInt(K paramK, int paramInt);
public abstract Long getLong(K paramK);
public abstract long getLong(K paramK, long paramLong);
public abstract Float getFloat(K paramK);
public abstract float getFloat(K paramK, float paramFloat);
public abstract Double getDouble(K paramK);
public abstract double getDouble(K paramK, double paramDouble);
public abstract Long getTimeMillis(K paramK);
public abstract long getTimeMillis(K paramK, long paramLong);
public abstract Boolean getBooleanAndRemove(K paramK);
public abstract boolean getBooleanAndRemove(K paramK, boolean paramBoolean);
public abstract Byte getByteAndRemove(K paramK);
public abstract byte getByteAndRemove(K paramK, byte paramByte);
public abstract Character getCharAndRemove(K paramK);
public abstract char getCharAndRemove(K paramK, char paramChar);
public abstract Short getShortAndRemove(K paramK);
public abstract short getShortAndRemove(K paramK, short paramShort);
public abstract Integer getIntAndRemove(K paramK);
public abstract int getIntAndRemove(K paramK, int paramInt);
public abstract Long getLongAndRemove(K paramK);
public abstract long getLongAndRemove(K paramK, long paramLong);
public abstract Float getFloatAndRemove(K paramK);
public abstract float getFloatAndRemove(K paramK, float paramFloat);
public abstract Double getDoubleAndRemove(K paramK);
public abstract double getDoubleAndRemove(K paramK, double paramDouble);
public abstract Long getTimeMillisAndRemove(K paramK);
public abstract long getTimeMillisAndRemove(K paramK, long paramLong);
public abstract boolean contains(K paramK);
public abstract boolean contains(K paramK, V paramV);
public abstract boolean containsObject(K paramK, Object paramObject);
public abstract boolean containsBoolean(K paramK, boolean paramBoolean);
public abstract boolean containsByte(K paramK, byte paramByte);
public abstract boolean containsChar(K paramK, char paramChar);
public abstract boolean containsShort(K paramK, short paramShort);
public abstract boolean containsInt(K paramK, int paramInt);
public abstract boolean containsLong(K paramK, long paramLong);
public abstract boolean containsFloat(K paramK, float paramFloat);
public abstract boolean containsDouble(K paramK, double paramDouble);
public abstract boolean containsTimeMillis(K paramK, long paramLong);
public abstract int size();
public abstract boolean isEmpty();
public abstract Set<K> names();
public abstract T add(K paramK, V paramV);
public abstract T add(K paramK, Iterable<? extends V> paramIterable);
public abstract T add(K paramK, V... paramVarArgs);
public abstract T addObject(K paramK, Object paramObject);
public abstract T addObject(K paramK, Iterable<?> paramIterable);
public abstract T addObject(K paramK, Object... paramVarArgs);
public abstract T addBoolean(K paramK, boolean paramBoolean);
public abstract T addByte(K paramK, byte paramByte);
public abstract T addChar(K paramK, char paramChar);
public abstract T addShort(K paramK, short paramShort);
public abstract T addInt(K paramK, int paramInt);
public abstract T addLong(K paramK, long paramLong);
public abstract T addFloat(K paramK, float paramFloat);
public abstract T addDouble(K paramK, double paramDouble);
public abstract T addTimeMillis(K paramK, long paramLong);
public abstract T add(Headers<? extends K, ? extends V, ?> paramHeaders);
public abstract T set(K paramK, V paramV);
public abstract T set(K paramK, Iterable<? extends V> paramIterable);
public abstract T set(K paramK, V... paramVarArgs);
public abstract T setObject(K paramK, Object paramObject);
public abstract T setObject(K paramK, Iterable<?> paramIterable);
public abstract T setObject(K paramK, Object... paramVarArgs);
public abstract T setBoolean(K paramK, boolean paramBoolean);
public abstract T setByte(K paramK, byte paramByte);
public abstract T setChar(K paramK, char paramChar);
public abstract T setShort(K paramK, short paramShort);
public abstract T setInt(K paramK, int paramInt);
public abstract T setLong(K paramK, long paramLong);
public abstract T setFloat(K paramK, float paramFloat);
public abstract T setDouble(K paramK, double paramDouble);
public abstract T setTimeMillis(K paramK, long paramLong);
public abstract T set(Headers<? extends K, ? extends V, ?> paramHeaders);
public abstract T setAll(Headers<? extends K, ? extends V, ?> paramHeaders);
public abstract boolean remove(K paramK);
public abstract T clear();
public abstract Iterator<Map.Entry<K, V>> iterator();
}
| [
"[email protected]"
] | |
4541468c18a7cb93f55e2af0564f80bb4e2845e7 | 226dcda557ea73e65b08af537ce86bc3e387fd9b | /src/view/View.java | 837e5a76c2e73537dd864fe62bff34cd62196646 | [] | no_license | pierremalaga/ProyectoInventario | 3e120dc24ec2c928dba249b53901b8d016950482 | 9e8320e6d96ef5381907303af084447e40866a6f | refs/heads/master | 2021-01-10T06:18:00.543038 | 2015-11-07T14:23:02 | 2015-11-07T14:23:02 | 45,921,420 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 49 | java |
package view;
public class View {
}
| [
"[email protected]"
] | |
faf73d1f418ac9c956a2ab4d21168f63cfd65dd3 | b87b45b3d1dd19311528a7803692df780e6f6a25 | /app/src/main/java/com/itla/testappdb/entity/Career.java | 1f81cbf977573194dbb1818c6bf78a08e0e0171a | [] | no_license | darkdaven/school | 769d51965332006668e985be22ef250a8c6122f2 | 842633dc52c5df0082d5bd61e959e57d2afcebbc | refs/heads/master | 2020-08-03T23:18:22.761904 | 2019-10-27T00:31:52 | 2019-10-27T00:31:52 | 211,917,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,770 | java | package com.itla.testappdb.entity;
import android.content.ContentValues;
import android.database.Cursor;
import androidx.annotation.NonNull;
public class Career {
private Integer id;
private String name;
private Integer subjects;
private Integer credits;
public Career() {
}
public Career(Integer id) {
this.id = id;
}
public Career(String name) {
this.name = name;
}
public Career(final Cursor cursor) {
this.setId(cursor.getInt(cursor.getColumnIndex("career_id")));
this.setName(cursor.getString(cursor.getColumnIndex("career_name")));
if (cursor.getColumnIndex("career_subjects") != -1)
this.setSubjects(cursor.getInt(cursor.getColumnIndex("career_subjects")));
if (cursor.getColumnIndex("career_credits") != -1)
this.setCredits(cursor.getInt(cursor.getColumnIndex("career_credits")));
}
public ContentValues contentValues() {
final ContentValues contentValues = new ContentValues();
contentValues.put("name", this.getName());
return contentValues;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getSubjects() {
return subjects;
}
public void setSubjects(Integer subjects) {
this.subjects = subjects;
}
public Integer getCredits() {
return credits;
}
public void setCredits(Integer credits) {
this.credits = credits;
}
@NonNull
@Override
public String toString() {
return this.getName();
}
}
| [
"[email protected]"
] | |
310592a9d25fd3349ff0ceba5befd60988f9c51c | 1da2285d1dad13204cb2ef0ba10f08fd76e050ed | /src/main/java/jm/security/example/service/UserServiceImpl.java | 9138394bbf6d228baee8dcf84a0b6d55398e3700 | [] | no_license | MukhachevMaksim/spring-security | 06f797dba5abdff3170764eebb8dffdae01be45f | b519e2e265c4cade0e714cd40b4f0277473fb6eb | refs/heads/master | 2023-03-01T08:56:01.047467 | 2021-01-27T16:18:22 | 2021-01-27T16:18:22 | 333,488,139 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,379 | java | package jm.security.example.service;
import jm.security.example.dao.RoleDao;
import jm.security.example.dao.UserDao;
import jm.security.example.model.Role;
import jm.security.example.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserDao userDao;
@Autowired
private RoleDao roleDao;
@Override
public User getUserByName(String name) {
return userDao.getUserByName(name);
}
@Override
public User getUserById(Long id) {
return userDao.getUserById(id);
}
@Override
@Transactional
public void add(User user) {
Set<Role> roles = new HashSet<Role>();
roles.add(roleDao.getRoleById(1L));
user.setRoles(roles);
userDao.add(user);
}
@Override
@Transactional
public void removeUserById(Long id) {
userDao.removeUserById(id);
}
@Override
@Transactional
public List<User> listUsers() {
return userDao.listUsers();
}
@Override
@Transactional
public void update(Long id, User user) {
userDao.update(id, user);
}
}
| [
"[email protected]"
] | |
cddd675b99d82bc53a490fba3ca1ed0b8d1dbf41 | 9b5f2e99feeed748f0aa7ad30cf71088ede9b722 | /src/main/java/hu/sztaki/phytree/io/FastaWriter.java | a6bd215c441c868e51613e8a5cee01767be98938 | [
"Apache-2.0"
] | permissive | wsgan001/PhyTreeSearch | 408dc2b6096671b6df64b7119a3f7518b54bdddc | 577e0a60db101ccee16705a28ca9177078fa4982 | refs/heads/master | 2021-05-10T13:50:39.382768 | 2016-02-03T08:54:46 | 2016-02-03T08:54:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,591 | java | package hu.sztaki.phytree.io;
import hu.sztaki.phytree.FastaItem;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
public class FastaWriter {
private OutputStream output;
public FastaWriter(OutputStream os) {
output = os;
}
public void closeOS() throws IOException {
output.flush();
output.close();
}
public void writeFastaItem(FastaItem fastaItem) throws IOException {
output.write(fastaItem.getHeaderRow().getBytes(Charset.forName("UTF-8")));
output.write("\n".getBytes(Charset.forName("UTF-8")));
for (String sequenceRow : fastaItem.getSequenceRows()) {
output.write(sequenceRow.getBytes(Charset.forName("UTF-8")));
output.write("\n".getBytes(Charset.forName("UTF-8")));
}
}
public void writeFastaItemWithMatch(FastaItem fastaItem, boolean matched) throws IOException {
output.write(fastaItem.getHeaderRow().getBytes(Charset.forName("UTF-8")));
if (matched) {
output.write("|1".getBytes(Charset.forName("UTF-8")));
} else {
output.write("|0".getBytes(Charset.forName("UTF-8")));
}
output.write("\n".getBytes(Charset.forName("UTF-8")));
for (String sequenceRow : fastaItem.getSequenceRows()) {
output.write(sequenceRow.getBytes(Charset.forName("UTF-8")));
output.write("\n".getBytes(Charset.forName("UTF-8")));
}
}
public void writeFastaList(List<FastaItem> fastaList) throws IOException {
for (FastaItem fastaItem : fastaList) {
writeFastaItem(fastaItem);
}
}
public void writeFastaListWithPatternMatchResult(List<FastaItem> fastaList, boolean matched) throws IOException {
for (FastaItem fastaItem : fastaList) {
writeFastaItemWithMatch(fastaItem, matched);
}
}
// fasta items containing the pattern will be printed first, in alphabetical order(by AC num),
// then the rest (also in AC-alphabetical order)
public void writeOrderedFastaList(List<FastaItem> fastaList, String pattern) throws IOException {
List<FastaItem> contains = new ArrayList<FastaItem>();
List<FastaItem> notContains = new ArrayList<FastaItem>();
for (FastaItem it: fastaList) {
if (it.getSequenceString().contains(pattern)) {
contains.add(it);
} else {
notContains.add(it);
}
}
java.util.Collections.sort(contains);
java.util.Collections.sort(notContains);
writeFastaListWithPatternMatchResult(contains, true);
writeFastaListWithPatternMatchResult(notContains, false);
}
}
| [
"[email protected]"
] | |
061ca15842b0288a8cac0ea10f21d86f1e363cd9 | 1c8c51b70de24925d3b169083c0a1f66bb676142 | /src/main/java/data/代数/负数.java | b0517fd55c7d561f459954ebc51111e5dda3c74e | [] | no_license | xugeiyangguang/kownledgeGraph | 867b733c19b7ac3ca034468843a4cad59755ea2c | e1f0d5d048449440bade905bd6265bbd8557e866 | refs/heads/master | 2022-12-09T19:15:59.060402 | 2020-04-01T11:32:53 | 2020-04-01T11:32:53 | 222,592,654 | 0 | 0 | null | 2022-12-06T00:43:16 | 2019-11-19T02:40:27 | Java | UTF-8 | Java | false | false | 61 | java | package data.代数;
public class 负数 extends 实数 {
}
| [
"[email protected]"
] | |
c76c5c5a015d86ea26e832996dcdc137f1038fec | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project399/src/test/java/org/gradle/test/performance/largejavamultiproject/project399/p1995/Test39914.java | 47dc943da5fa0e3c82f7f33c314a51bba2558052 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,113 | java | package org.gradle.test.performance.largejavamultiproject.project399.p1995;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test39914 {
Production39914 objectUnderTest = new Production39914();
@Test
public void testProperty0() {
String value = "value";
objectUnderTest.setProperty0(value);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() {
String value = "value";
objectUnderTest.setProperty1(value);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() {
String value = "value";
objectUnderTest.setProperty2(value);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() {
String value = "value";
objectUnderTest.setProperty3(value);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() {
String value = "value";
objectUnderTest.setProperty4(value);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() {
String value = "value";
objectUnderTest.setProperty5(value);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() {
String value = "value";
objectUnderTest.setProperty6(value);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() {
String value = "value";
objectUnderTest.setProperty7(value);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() {
String value = "value";
objectUnderTest.setProperty8(value);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() {
String value = "value";
objectUnderTest.setProperty9(value);
assertEquals(value, objectUnderTest.getProperty9());
}
} | [
"[email protected]"
] | |
d4b5c1036411a20f4f9939dabda53093b7c578f9 | f4707f2466a4397a315a659520a98ba59137d460 | /src/ch/jmildner/bridge/Drawing.java | c6f0f396b74cd9a2623ab656ed3ffc349ad4563e | [] | no_license | java-akademie/java_designpatterns | 5f7de12b0c829472a352516d8869bd64435f7b50 | b08349d6dc3bfb9bac6da17ebb7693a58a10de68 | refs/heads/master | 2020-03-25T07:18:15.585758 | 2018-08-09T08:35:04 | 2018-08-09T08:35:04 | 143,553,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package ch.jmildner.bridge;
public abstract class Drawing
{
abstract public void drawCircle(double x, double y, double r);
abstract public void drawLine(double x1, double y1, double x2,
double y2);
}
| [
"[email protected]"
] | |
b1c02fe82f66d922df7b365744f3f7bdc34a3887 | f3e9144e2cee84e08c79ae0f952f78bf627db5e5 | /runner-api/src/main/java/com/ckx/runner/RunnerApiApplication.java | 86264709bec46b2cd2e63f4f0eecdb5bafff3eb9 | [] | no_license | toeygueoo/runner | 31bb773514fb5175dfde516d25c98f349a3482f4 | 69a42add0fe65c9148c9d89677f99f23ef316e9b | refs/heads/master | 2023-04-17T23:02:21.700318 | 2021-04-16T12:56:15 | 2021-04-16T12:56:15 | 363,603,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package com.ckx.runner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RunnerApiApplication {
public static void main(String[] args) {
SpringApplication.run(RunnerApiApplication.class,args);
}
}
| [
"[email protected]"
] | |
3c41725ddf872070d87687a2bb5050dbf136bc23 | d28374709c32819fd0aafca36f379ead5256edd1 | /src/net/whn/loki/common/MachineUpdate.java | 84ff40075582f9690fa6a705040724a65f2e4e8a | [] | no_license | champy/Loki | 93f2ffc146e838b2440b4969d9d74e041bf1a959 | 11784c54028daf363060f6e40287a1643d5857ef | refs/heads/master | 2021-01-10T18:38:19.713662 | 2013-02-22T23:53:38 | 2013-02-22T23:53:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,227 | java | /**
*Project: Loki Render - A distributed job queue manager.
*Version 0.6.2b
*Copyright (C) 2013 Daniel Petersen
*Created on Sep 28, 2009
*/
/**
*This program is free software: you can redistribute it and/or modify
*it under the terms of the GNU General Public License as published by
*the Free Software Foundation, either version 3 of the License, or
*(at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.whn.loki.common;
import java.io.Serializable;
import java.text.DecimalFormat;
/**
*
* @author daniel
*/
public class MachineUpdate implements Serializable {
public MachineUpdate(double lAvg, long tMemory, long fMemory, long fSwap) {
loadAvg = lAvg;
totalMemory = tMemory;
freeMemory = fMemory;
freeSwap = fSwap;
usedMemory = generateMemUsage();
}
public String getMemUsageStr() {
return usedMemory;
}
public long getFreeSwap() {
return freeSwap;
}
public double getLoadAvg() {
return loadAvg;
}
public long getFreeMemory() {
return freeMemory;
}
/*PRIVATE*/
private static final long bytesPerGB = 1073741824;
private static DecimalFormat gb = new DecimalFormat("#0.00");
private final double loadAvg;
private final long totalMemory;
private final long freeMemory;
private final long freeSwap;
private final String usedMemory;
private String generateMemUsage() {
double total = (double) totalMemory / (double) bytesPerGB;
String tmpUsed;
if (totalMemory == freeMemory) {
tmpUsed = "?";
} else {
double used = (double) (totalMemory - freeMemory) / (double) bytesPerGB;
tmpUsed = gb.format(used);
}
String tmpTotal = gb.format(total);
return tmpUsed + "/" + tmpTotal;
}
}
| [
"samuraidanieru@9f4f354f-a68d-4dce-aede-ed6e1f314cf8"
] | samuraidanieru@9f4f354f-a68d-4dce-aede-ed6e1f314cf8 |
d76a7e51a78d35f02083d5c09369abffcecce222 | f1f392854275c425726bc2f308c51251df6c567a | /src/server/events/MapleSnowball.java | d6bd9cb850481c4f1170a5581b3940c516015095 | [] | no_license | s884812/TWMS_118 | e7cac6603facf2187ea21d5c77bae10dd89bd392 | f30028cd9211042078a6c537dcf60955ec42c56a | refs/heads/master | 2020-03-25T11:58:36.479591 | 2018-10-05T10:49:25 | 2018-10-05T10:49:25 | 143,756,012 | 3 | 7 | null | null | null | null | UTF-8 | Java | false | false | 8,745 | java | package server.events;
import client.MapleCharacter;
import client.MapleDisease;
import java.util.concurrent.ScheduledFuture;
import server.Timer.EventTimer;
import server.life.MobSkillFactory;
import server.maps.MapleMap;
import tools.packet.MaplePacketCreator;
public class MapleSnowball extends MapleEvent {
private MapleSnowballs[] balls = new MapleSnowballs[2];
public MapleSnowball(final int channel, final MapleEventType type) {
super(channel,type);
}
@Override
public void finished(MapleCharacter chr) { //do nothing.
}
@Override
public void unreset() {
super.unreset();
for (int i = 0; i < 2; i++) {
getSnowBall(i).resetSchedule();
resetSnowBall(i);
}
}
@Override
public void reset() {
super.reset();
makeSnowBall(0);
makeSnowBall(1);
}
@Override
public void startEvent() {
for (int i = 0; i < 2; i++) {
MapleSnowballs ball = getSnowBall(i);
ball.broadcast(getMap(0), 0); //gogogo
ball.setInvis(false);
ball.broadcast(getMap(0), 5); //idk xd
getMap(0).broadcastMessage(MaplePacketCreator.enterSnowBall());
}
}
public void resetSnowBall(int teamz) {
balls[teamz] = null;
}
public void makeSnowBall(int teamz) {
resetSnowBall(teamz);
balls[teamz] = new MapleSnowballs(teamz);
}
public MapleSnowballs getSnowBall(int teamz) {
return balls[teamz];
}
public static class MapleSnowballs {
private int position = 0;
private final int team;
private int startPoint = 0;
private boolean invis = true;
private boolean hittable = true;
private int snowmanhp = 7500;
private ScheduledFuture<?> snowmanSchedule = null;
public MapleSnowballs(int team_) {
this.team = team_;
}
public void resetSchedule() {
if (snowmanSchedule != null) {
snowmanSchedule.cancel(false);
snowmanSchedule = null;
}
}
public int getTeam() {
return team;
}
public int getPosition() {
return position;
}
public void setPositionX(int pos) {
this.position = pos;
}
public void setStartPoint(MapleMap map) {
this.startPoint++;
broadcast(map, startPoint);
}
public boolean isInvis() {
return invis;
}
public void setInvis(boolean i) {
this.invis = i;
}
public boolean isHittable() {
return hittable && !invis;
}
public void setHittable(boolean b) {
this.hittable = b;
}
public int getSnowmanHP() {
return snowmanhp;
}
public void setSnowmanHP(int shp) {
this.snowmanhp = shp;
}
public void broadcast(MapleMap map, int message) {
for (MapleCharacter chr : map.getCharactersThreadsafe()) {
chr.getClient().getSession().write(MaplePacketCreator.snowballMessage(team, message));
}
}
public int getLeftX() {
return position * 3 + 175;
}
public int getRightX() {
return getLeftX() + 275; //exact pos where you cant hit it, as it should knockback
}
public static final void hitSnowball(final MapleCharacter chr) {
int team = chr.getTruePosition().y > -80 ? 0 : 1;
final MapleSnowball sb = ((MapleSnowball) chr.getClient().getChannelServer().getEvent(MapleEventType.Snowball));
final MapleSnowballs ball = sb.getSnowBall(team);
if (ball != null && !ball.isInvis()) {
boolean snowman = chr.getTruePosition().x < -360 && chr.getTruePosition().x > -560;
if (!snowman) {
int damage = (Math.random() < 0.01 || (chr.getTruePosition().x > ball.getLeftX() && chr.getTruePosition().x < ball.getRightX())) && ball.isHittable() ? 10 : 0;
chr.getMap().broadcastMessage(MaplePacketCreator.hitSnowBall(team, damage, 0, 1));
if (damage == 0) {
if (Math.random() < 0.2) {
chr.getClient().getSession().write(MaplePacketCreator.leftKnockBack());
chr.getClient().getSession().write(MaplePacketCreator.enableActions());
}
} else {
ball.setPositionX(ball.getPosition() + 1);
//System.out.println("pos: " + chr.getPosition().x + ", ballpos: " + ball.getPosition().x + ", hittable: " + ball.isHittable() + ", startPoints: " + startPoints[0] + "," + startPoints[1] + ", damage: " + damage + ", snowmens: " + snowmens[0] + "," + snowmens[1] + ", extraDistances: " + extraDistances[0] + "," + extraDistances[1] + ", HP: " + ball.getHP());
if (ball.getPosition() == 255 || ball.getPosition() == 511 || ball.getPosition() == 767) { // Going to stage
ball.setStartPoint(chr.getMap());
chr.getMap().broadcastMessage(MaplePacketCreator.rollSnowball(4, sb.getSnowBall(0), sb.getSnowBall(1)));
} else if (ball.getPosition() == 899) { // Crossing the finishing line
final MapleMap map = chr.getMap();
for (int i = 0; i < 2; i++) {
sb.getSnowBall(i).setInvis(true);
map.broadcastMessage(MaplePacketCreator.rollSnowball(i + 2, sb.getSnowBall(0), sb.getSnowBall(1))); //inviseble
}
chr.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "Congratulations! Team " + (team == 0 ? "Story" : "Maple") + " has won the Snowball Event!"));
for (MapleCharacter chrz : chr.getMap().getCharactersThreadsafe()) {
if ((team == 0 && chrz.getTruePosition().y > -80) || (team == 1 && chrz.getTruePosition().y <= -80)) { //winner
sb.givePrize(chrz);
}
sb.warpBack(chrz);
}
sb.unreset();
} else if (ball.getPosition() < 899) {
chr.getMap().broadcastMessage(MaplePacketCreator.rollSnowball(4, sb.getSnowBall(0), sb.getSnowBall(1)));
ball.setInvis(false);
}
}
} else if (ball.getPosition() < 899) {
int damage = 15;
if (Math.random() < 0.3) {
damage = 0;
}
if (Math.random() < 0.05) {
damage = 45;
}
chr.getMap().broadcastMessage(MaplePacketCreator.hitSnowBall(team + 2, damage, 0, 0)); // Hitting the snowman
ball.setSnowmanHP(ball.getSnowmanHP() - damage);
if (damage > 0) {
chr.getMap().broadcastMessage(MaplePacketCreator.rollSnowball(0, sb.getSnowBall(0), sb.getSnowBall(1))); //not sure
if (ball.getSnowmanHP() <= 0) {
ball.setSnowmanHP(7500);
final MapleSnowballs oBall = sb.getSnowBall(team == 0 ? 1 : 0);
oBall.setHittable(false);
final MapleMap map = chr.getMap();
oBall.broadcast(map, 4);
oBall.snowmanSchedule = EventTimer.getInstance().schedule(new Runnable() {
@Override
public void run() {
oBall.setHittable(true);
oBall.broadcast(map, 5);
}
}, 10000);
for (MapleCharacter chrz : chr.getMap().getCharactersThreadsafe()) {
if ((ball.getTeam() == 0 && chr.getTruePosition().y < -80) || (ball.getTeam() == 1 && chr.getTruePosition().y > -80)) {
chrz.giveDebuff(MapleDisease.SEDUCE, MobSkillFactory.getMobSkill(128, 1)); //go left
}
}
}
}
}
}
}
}
}
| [
"[email protected]"
] | |
b1b147eaf281538acb0d5c3573a2c11c25331feb | bbf526bca24e395fcc87ef627f6c196d30a1844f | /building-h2o/H2O.java | 927559b8d809f0b9f31c08716163b062fe2baf47 | [] | no_license | charles-wangkai/leetcode | 864e39505b230ec056e9b4fed3bb5bcb62c84f0f | 778c16f6cbd69c0ef6ccab9780c102b40731aaf8 | refs/heads/master | 2023-08-31T14:44:52.850805 | 2023-08-31T03:04:02 | 2023-08-31T03:04:02 | 25,644,039 | 52 | 18 | null | 2021-06-05T00:02:50 | 2014-10-23T15:29:44 | Java | UTF-8 | Java | false | false | 1,290 | java | import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class H2O {
Lock lock = new ReentrantLock();
Condition canReleaseH = lock.newCondition();
Condition canReleaseO = lock.newCondition();
int hCount = 0;
int oCount = 0;
int releaseCount = 0;
int index;
public void hydrogen(Runnable releaseHydrogen) throws InterruptedException {
lock.lock();
try {
hCount++;
if (hCount >= 2 && oCount >= 1) {
releaseCount++;
}
while (!(index < releaseCount * 3 && index % 3 != 2)) {
canReleaseH.await();
}
// releaseHydrogen.run() outputs "H". Do not change or remove this line.
releaseHydrogen.run();
index++;
canReleaseH.signal();
canReleaseO.signal();
} finally {
lock.unlock();
}
}
public void oxygen(Runnable releaseOxygen) throws InterruptedException {
lock.lock();
try {
oCount++;
if (hCount >= 2 && oCount >= 1) {
releaseCount++;
}
while (!(index < releaseCount * 3 && index % 3 == 2)) {
canReleaseO.await();
}
// releaseOxygen.run() outputs "H". Do not change or remove this line.
releaseOxygen.run();
index++;
canReleaseH.signal();
canReleaseO.signal();
} finally {
lock.unlock();
}
}
}
| [
"[email protected]"
] | |
10027820f70c78aa770e168648f694f4013936ff | a5a7c6814a41bc3d74c59072eb739cad8a714b33 | /src/main/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages.java | 72f9062818880ef9545239613ba8a5905a4989ab | [
"Apache-2.0"
] | permissive | as543343879/myReadBook | 3dcbbf739c184a84b32232373708c73db482f352 | 5f3af76e58357a0b2b78cc7e760c1676fe19414b | refs/heads/master | 2023-09-01T16:09:21.287327 | 2023-08-23T06:44:46 | 2023-08-23T06:44:46 | 139,959,385 | 3 | 3 | Apache-2.0 | 2023-06-14T22:31:32 | 2018-07-06T08:54:15 | Java | UTF-8 | Java | false | false | 8,230 | java | /*
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/*
* Copyright 2004 The Apache Software Foundation.
*
* 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.sun.org.apache.xml.internal.serializer.utils;
import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
* An instance of this class is a ListResourceBundle that
* has the required getContents() method that returns
* an array of message-key/message associations.
* <p>
* The message keys are defined in {@link MsgKey}. The
* messages that those keys map to are defined here.
* <p>
* The messages in the English version are intended to be
* translated.
*
* This class is not a public API, it is only public because it is
* used in com.sun.org.apache.xml.internal.serializer.
*
* @xsl.usage internal
*/
public class SerializerMessages extends ListResourceBundle {
/*
* This file contains error and warning messages related to
* Serializer Error Handling.
*
* General notes to translators:
* 1) A stylesheet is a description of how to transform an input XML document
* into a resultant XML document (or HTML document or text). The
* stylesheet itself is described in the form of an XML document.
*
* 2) An element is a mark-up tag in an XML document; an attribute is a
* modifier on the tag. For example, in <elem attr='val' attr2='val2'>
* "elem" is an element name, "attr" and "attr2" are attribute names with
* the values "val" and "val2", respectively.
*
* 3) A namespace declaration is a special attribute that is used to associate
* a prefix with a URI (the namespace). The meanings of element names and
* attribute names that use that prefix are defined with respect to that
* namespace.
*
*
*/
/** The lookup table for error messages. */
public Object[][] getContents() {
Object[][] contents = new Object[][] {
{ MsgKey.BAD_MSGKEY,
"The message key ''{0}'' is not in the message class ''{1}''" },
{ MsgKey.BAD_MSGFORMAT,
"The format of message ''{0}'' in message class ''{1}'' failed." },
{ MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
"The serializer class ''{0}'' does not implement org.xml.sax.ContentHandler." },
{ MsgKey.ER_RESOURCE_COULD_NOT_FIND,
"The resource [ {0} ] could not be found.\n {1}" },
{ MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
"The resource [ {0} ] could not load: {1} \n {2} \t {3}" },
{ MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
"Buffer size <=0" },
{ MsgKey.ER_INVALID_UTF16_SURROGATE,
"Invalid UTF-16 surrogate detected: {0} ?" },
{ MsgKey.ER_OIERROR,
"IO error" },
{ MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
"Cannot add attribute {0} after child nodes or before an element is produced. Attribute will be ignored." },
/*
* Note to translators: The stylesheet contained a reference to a
* namespace prefix that was undefined. The value of the substitution
* text is the name of the prefix.
*/
{ MsgKey.ER_NAMESPACE_PREFIX,
"Namespace for prefix ''{0}'' has not been declared." },
/*
* Note to translators: This message is reported if the stylesheet
* being processed attempted to construct an XML document with an
* attribute in a place other than on an element. The substitution text
* specifies the name of the attribute.
*/
{ MsgKey.ER_STRAY_ATTRIBUTE,
"Attribute ''{0}'' outside of element." },
/*
* Note to translators: As with the preceding message, a namespace
* declaration has the form of an attribute and is only permitted to
* appear on an element. The substitution text {0} is the namespace
* prefix and {1} is the URI that was being used in the erroneous
* namespace declaration.
*/
{ MsgKey.ER_STRAY_NAMESPACE,
"Namespace declaration ''{0}''=''{1}'' outside of element." },
{ MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
"Could not load ''{0}'' (check CLASSPATH), now using just the defaults" },
{ MsgKey.ER_ILLEGAL_CHARACTER,
"Attempt to output character of integral value {0} that is not represented in specified output encoding of {1}." },
{ MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
"Could not load the propery file ''{0}'' for output method ''{1}'' (check CLASSPATH)" },
{ MsgKey.ER_INVALID_PORT,
"Invalid port number" },
{ MsgKey.ER_PORT_WHEN_HOST_NULL,
"Port cannot be set when host is null" },
{ MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
"Host is not a well formed address" },
{ MsgKey.ER_SCHEME_NOT_CONFORMANT,
"The scheme is not conformant." },
{ MsgKey.ER_SCHEME_FROM_NULL_STRING,
"Cannot set scheme from null string" },
{ MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
"Path contains invalid escape sequence" },
{ MsgKey.ER_PATH_INVALID_CHAR,
"Path contains invalid character: {0}" },
{ MsgKey.ER_FRAG_INVALID_CHAR,
"Fragment contains invalid character" },
{ MsgKey.ER_FRAG_WHEN_PATH_NULL,
"Fragment cannot be set when path is null" },
{ MsgKey.ER_FRAG_FOR_GENERIC_URI,
"Fragment can only be set for a generic URI" },
{ MsgKey.ER_NO_SCHEME_IN_URI,
"No scheme found in URI" },
{ MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
"Cannot initialize URI with empty parameters" },
{ MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
"Fragment cannot be specified in both the path and fragment" },
{ MsgKey.ER_NO_QUERY_STRING_IN_PATH,
"Query string cannot be specified in path and query string" },
{ MsgKey.ER_NO_PORT_IF_NO_HOST,
"Port may not be specified if host is not specified" },
{ MsgKey.ER_NO_USERINFO_IF_NO_HOST,
"Userinfo may not be specified if host is not specified" },
{ MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
"Warning: The version of the output document is requested to be ''{0}''. This version of XML is not supported. The version of the output document will be ''1.0''." },
{ MsgKey.ER_SCHEME_REQUIRED,
"Scheme is required!" },
/*
* Note to translators: The words 'Properties' and
* 'SerializerFactory' in this message are Java class names
* and should not be translated.
*/
{ MsgKey.ER_FACTORY_PROPERTY_MISSING,
"The Properties object passed to the SerializerFactory does not have a ''{0}'' property." },
{ MsgKey.ER_ENCODING_NOT_SUPPORTED,
"Warning: The encoding ''{0}'' is not supported by the Java runtime." },
};
return contents;
}
}
| [
"[email protected]"
] | |
7961b6683fc1deba8760586976375574d8f5434e | 6def7510eff84f1f87c3a8104d025acabe6daf72 | /redisson/src/main/java/org/redisson/api/mapreduce/RReducer.java | 36aed233ce42995558030f770a8571ce64336b9a | [
"Apache-2.0"
] | permissive | superhealth/redisson | 3137702cd6d001efa9ea87a4d37fae8e35067dc1 | 09b2724c44567035c8806bfe4a79bdf355c816b8 | refs/heads/master | 2021-09-01T03:32:05.669015 | 2017-12-20T11:36:20 | 2017-12-20T11:36:20 | 115,315,003 | 1 | 0 | null | 2017-12-25T07:04:48 | 2017-12-25T07:04:48 | null | UTF-8 | Java | false | false | 1,091 | java | /**
* Copyright 2016 Nikita Koksharov
*
* 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.redisson.api.mapreduce;
import java.io.Serializable;
import java.util.Iterator;
/**
* Reduces values mapped by key into single value.
*
* @author Nikita Koksharov
*
* @param <K> key type
* @param <V> value type
*/
public interface RReducer<K, V> extends Serializable {
/**
* Invoked for each key
*
* @param reducedKey - key
* @param iter - collection of values
* @return value
*/
V reduce(K reducedKey, Iterator<V> iter);
}
| [
"[email protected]"
] | |
ff10f3b0a325c6ddfda805ac79cbc6db1dbb4476 | e3622c6483135f17f5f2ebeae21865638757a66c | /turbo-jmh/src/main/java/rpc/turbo/benchmark/threadlocal/ThreadLocalBenchmark.java | 47ad94c8fa6af893024bd5040e3c93021f6295ae | [
"Apache-2.0"
] | permissive | solerwell/turbo-rpc | 6533697dee5a30f0773f0db7ee5e0d9f82aac817 | 49f0389a6beb370f73b85aa0d55af119360d8b54 | refs/heads/master | 2020-03-19T11:35:06.537496 | 2018-09-04T02:24:32 | 2018-09-04T02:24:32 | 136,463,431 | 0 | 0 | Apache-2.0 | 2018-09-03T14:46:21 | 2018-06-07T10:49:40 | Java | UTF-8 | Java | false | false | 6,061 | java | package rpc.turbo.benchmark.threadlocal;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import io.netty.util.concurrent.FastThreadLocalThread;
import io.netty.util.internal.InternalThreadLocalMap;
import rpc.turbo.util.concurrent.AttachmentThread;
import rpc.turbo.util.concurrent.AttachmentThreadUtils;
import rpc.turbo.util.concurrent.ConcurrentIntToObjectArrayMap;
/**
*
* @author Hank
*
*/
@State(Scope.Benchmark)
public class ThreadLocalBenchmark {
public static final int CONCURRENCY = Runtime.getRuntime().availableProcessors();
private final Integer value = 100;
private final ThreadLocal<Integer> threadLocal = new ThreadLocal<>();
private final ConcurrentIntToObjectArrayMap<Integer> arrayMap = new ConcurrentIntToObjectArrayMap<>(1024);
private final ConcurrentHashMap<Long, Integer> threadIdMap = new ConcurrentHashMap<>();
private final ConcurrentHashMap<Thread, Integer> threadMap = new ConcurrentHashMap<>();
private final ConcurrentLinkedQueue<Integer> concurrentLinkedQueue = new ConcurrentLinkedQueue<>();
private final Holder holder = new Holder(new Holder(new ConcurrentIntToObjectArrayMap<>()));
private final Supplier<Integer> supplier = () -> value;
private final FastThreadLocalThread fastThread = new FastThreadLocalThread();
private final AttachmentThread attachmentThread = new AttachmentThread();
public ThreadLocalBenchmark() {
fastThread.setThreadLocalMap(InternalThreadLocalMap.get());
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void _do_nothing() {
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer directGet() {
return value;
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer threadLocal() {
Integer value = threadLocal.get();
if (value != null) {
return value;
}
value = 100;
threadLocal.set(value);
return value;
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@SuppressWarnings("unchecked")
public Integer fastThreadWithArrayMap() {
Object obj = fastThread.threadLocalMap().indexedVariable(1024);
ConcurrentIntToObjectArrayMap<Integer> map;
if (obj != InternalThreadLocalMap.UNSET) {
map = (ConcurrentIntToObjectArrayMap<Integer>) obj;
return map.getOrUpdate(1024, () -> value);
}
map = new ConcurrentIntToObjectArrayMap<>();
fastThread.threadLocalMap().setIndexedVariable(1024, map);
return map.getOrUpdate(1024, () -> value);
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer fastThread() {
Object obj = fastThread.threadLocalMap().indexedVariable(256);
if (obj != InternalThreadLocalMap.UNSET) {
return (Integer) obj;
}
Integer value = 100;
fastThread.threadLocalMap().setIndexedVariable(256, value);
return value;
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer attachmentThread() {
return attachmentThread.getOrUpdate(1, supplier);
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer attachmentThreadUtils() {
return AttachmentThreadUtils.getOrUpdate(1, supplier);
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer arrayMap() {
int key = (int) Thread.currentThread().getId();
return arrayMap.getOrUpdate(key, () -> 1);
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer arrayMapConstantProducer() {
int key = (int) Thread.currentThread().getId();
return arrayMap.getOrUpdate(key, supplier);
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer threadMap() {
Thread key = Thread.currentThread();
Integer value = threadMap.get(key);
if (value != null) {
return value;
}
value = 100;
threadMap.put(key, value);
return value;
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer threadIdMap() {
Long key = Thread.currentThread().getId();
Integer value = threadIdMap.get(key);
if (value != null) {
return value;
}
value = 100;
threadIdMap.put(key, value);
return value;
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Integer concurrentLinkedQueue() {
Integer value = concurrentLinkedQueue.poll();
if (value == null) {
value = 100;
}
concurrentLinkedQueue.add(value);
return value;
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@SuppressWarnings("unchecked")
public Integer getByHolder() {
return ((ConcurrentIntToObjectArrayMap<Integer>) ((Holder) holder.obj).obj).getOrUpdate(1, () -> 1);
}
@Benchmark
@BenchmarkMode({ Mode.Throughput })
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public Thread currentThread() {
return Thread.currentThread();
}
public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder()//
.include(ThreadLocalBenchmark.class.getName())//
.warmupIterations(5)//
.measurementIterations(5)//
.threads(CONCURRENCY)//
.forks(1)//
.build();
new Runner(opt).run();
}
}
class Holder {
public final Object obj;
public Holder(Object obj) {
this.obj = obj;
}
} | [
"[email protected]"
] | |
79006559b82164b8abb596508f05cf4f99c375d8 | 52d70ecd16e9043be3623c66b3b2ac486422fbd4 | /src/main/java/de/fearnixx/jeak/service/command/matcher/meta/FirstOfMatcher.java | 04cccce49a42a84e0b9b36db79984cc7eb2ca12f | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | jeakfrw/jeak-framework | 01cbbda4b713b1ae48e37fb8fe6fcf3d00335079 | bede7f4f575d828e67fa54c4f65b338c70c73443 | refs/heads/bleeding-1.X.X | 2023-02-20T11:35:57.312649 | 2022-01-03T19:57:07 | 2022-01-03T19:57:07 | 188,801,672 | 8 | 5 | MIT | 2021-07-30T03:18:02 | 2019-05-27T08:19:58 | Java | UTF-8 | Java | false | false | 1,878 | java | package de.fearnixx.jeak.service.command.matcher.meta;
import de.fearnixx.jeak.reflect.Inject;
import de.fearnixx.jeak.reflect.LocaleUnit;
import de.fearnixx.jeak.service.command.ICommandExecutionContext;
import de.fearnixx.jeak.service.command.spec.matcher.*;
import de.fearnixx.jeak.service.locale.ILocalizationUnit;
import java.util.Map;
import java.util.stream.Collectors;
public class FirstOfMatcher implements ICriterionMatcher<Void> {
@Inject
@LocaleUnit("commandService")
private ILocalizationUnit localeUnit;
@Override
public Class<Void> getSupportedType() {
return Void.class;
}
@Override
public IMatcherResponse tryMatch(ICommandExecutionContext ctx, IMatchingContext matchingContext) {
for (var child : matchingContext.getChildren()) {
var childResponse = child.getMatcher().tryMatch(ctx, child);
if (childResponse.getResponseType().equals(MatcherResponseType.SUCCESS)) {
ctx.getParameterIndex().incrementAndGet();
return childResponse;
} else if (childResponse.getResponseType().equals(MatcherResponseType.NOTICE)) {
ctx.getCommandInfo().getErrorMessages().add(childResponse.getFailureMessage());
}
}
String typeList = matchingContext
.getChildren()
.stream()
.map(m -> m.getMatcher().getSupportedType().getName())
.collect(Collectors.joining(", "));
String unmatchedMessage = localeUnit.getContext(ctx.getSender().getCountryCode())
.getMessage("matcher.firstOf.unmatched",
Map.of(
"types", typeList
));
return new BasicMatcherResponse(MatcherResponseType.ERROR, ctx.getParameterIndex().get(), unmatchedMessage);
}
}
| [
"[email protected]"
] | |
b24f85f62e6090a6a451280643588575a0c3ae00 | ad2f2cff744dd3203b0d060273bd8c39774eb626 | /app/src/main/java/com/ifox/zh/rca/app/net/Urls.java | 62c8c5ddcdae9e432b1e5536e1aaed94a372d269 | [] | no_license | csIfox/RemoteCompileApp | 5aed001d6fd8cefe2c92c7c8c0eb58ea879a2cfd | f4f6cd2ab4f1f7a7e7d7f4480d081e1f646fd13b | refs/heads/master | 2021-01-10T13:20:17.288015 | 2016-02-13T14:00:18 | 2016-02-13T14:00:18 | 50,641,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 113 | java | package com.ifox.zh.rca.app.net;
/**
* Created by zh on 2016/2/4.
* @author zh
*/
public interface Urls {
}
| [
"[email protected]"
] | |
8d150fb83c61ee629b3bab60c1af31145e229851 | a05d9347d233152affa726a2359be87e42b22e03 | /Trabajos/Proyecto ErickOre/NDRAsistencias/src/pe/eeob/ndrasistencias/view/MantEstView.java | 08823cdd05479b3d70990824f1fec124e93d80f9 | [] | no_license | gcoronelc/SISTUNI_JAVA_JDBC_002 | 2aa5393d8e20cb5e9fe747255bca7dec17689f58 | 7ae0b7f53b2585d01f34fa337464e22b040712f6 | refs/heads/master | 2021-01-10T11:17:06.603759 | 2016-03-25T21:47:44 | 2016-03-25T21:47:44 | 51,031,997 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 11,844 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pe.eeob.ndrasistencias.view;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import pe.eeob.ndrasistencias.controller.ApoderadoController;
import pe.eeob.ndrasistencias.controller.EstudianteController;
import pe.eeob.ndrasistencias.domain.Estudiante;
import pe.eeob.ndrasistencias.util.Dialogo;
import pe.eeob.ndrasistencias.util.Ndr;
/**
*
* @author ErickOre
*/
public class MantEstView extends javax.swing.JInternalFrame {
private String accion;
/**
* Creates new form MantEstView
*/
public MantEstView() {
initComponents();
}
public void setAccion(String accion) {
this.accion = accion;
establecerTitulo();
habilitarControles();
// Inicializando combo box
try {
ApoderadoController cr = new ApoderadoController();
llenarCombo(cr.getDniApos());
} catch (Exception e) {
Dialogo.error(rootPane, e.getMessage());
}
comboDniApoderado.setSelectedIndex(-1);
}
private void establecerTitulo() {
String titulo = "%s ESTUDIANTE";
titulo = String.format(titulo, accion);
this.setTitle(titulo);
}
private void habilitarControles() {
txtDni.setEnabled(!accion.equals(Ndr.CRUD_ELIMINAR));
txtPaterno.setEnabled(!accion.equals(Ndr.CRUD_ELIMINAR));
txtMaterno.setEnabled(!accion.equals(Ndr.CRUD_ELIMINAR));
txtNombre.setEnabled(!accion.equals(Ndr.CRUD_ELIMINAR));
txtEdad.setEnabled(!accion.equals(Ndr.CRUD_ELIMINAR));
txtDistrito.setEnabled(!accion.equals(Ndr.CRUD_ELIMINAR));
comboDniApoderado.setEnabled(!accion.equals(Ndr.CRUD_ELIMINAR));
}
/**
* Inyecta el bean a editar
*
* @param bean Datos del cliente a editar.
*/
public void setBean(Estudiante bean) {
txtDni.setText(bean.getDni());
txtPaterno.setText(bean.getPaterno());
txtMaterno.setText(bean.getMaterno());
txtNombre.setText(bean.getNombre());
txtEdad.setText(bean.getEdad());
txtDistrito.setText(bean.getDistrito());
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
btnProcesar = new javax.swing.JButton();
btnSalir = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
comboDniApoderado = new javax.swing.JComboBox<>();
txtDni = new javax.swing.JTextField();
txtPaterno = new javax.swing.JTextField();
txtMaterno = new javax.swing.JTextField();
txtNombre = new javax.swing.JTextField();
txtEdad = new javax.swing.JTextField();
txtDistrito = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
setClosable(true);
setTitle("Mantenimiento Estudiante");
btnProcesar.setText("AGREGAR");
btnProcesar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnProcesarActionPerformed(evt);
}
});
btnSalir.setText("SALIR");
btnSalir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSalirActionPerformed(evt);
}
});
jLabel1.setText("DNI:");
jLabel5.setText("EDAD:");
jLabel2.setText("APELLIDO PATERNO:");
jLabel6.setText("DISTRITO:");
jLabel3.setText("APELLIDO MATERNO:");
jLabel7.setText("DNI APODERADO:");
comboDniApoderado.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jLabel4.setText("NOMBRE:");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7))
.addGap(46, 46, 46)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtDni, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
.addComponent(txtPaterno)
.addComponent(txtMaterno)
.addComponent(txtNombre)
.addComponent(txtEdad)
.addComponent(txtDistrito)
.addComponent(comboDniApoderado, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addGap(91, 91, 91)
.addComponent(btnProcesar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnSalir)))
.addContainerGap(45, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtPaterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtMaterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(txtEdad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(txtDistrito, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(comboDniApoderado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(30, 30, 30)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnProcesar)
.addComponent(btnSalir))
.addContainerGap(28, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnProcesarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProcesarActionPerformed
Estudiante bean = new Estudiante();
bean.setDni(txtDni.getText());
bean.setPaterno(txtPaterno.getText());
bean.setMaterno(txtMaterno.getText());
bean.setNombre(txtNombre.getText());
bean.setEdad(txtEdad.getText());
bean.setDistrito(txtDistrito.getText());
bean.setDni_apoderado(comboDniApoderado.getSelectedItem().toString());
EstudianteController control = new EstudianteController();
control.insertar(bean);
JOptionPane.showMessageDialog(null, "Estudiante Ingresado!");
txtDni.setText("");
txtPaterno.setText("");
txtMaterno.setText("");
txtNombre.setText("");
txtEdad.setText("");
txtDistrito.setText("");
comboDniApoderado.setSelectedIndex(-1);
}//GEN-LAST:event_btnProcesarActionPerformed
private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
this.dispose();
}//GEN-LAST:event_btnSalirActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnProcesar;
private javax.swing.JButton btnSalir;
private javax.swing.JComboBox<String> comboDniApoderado;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JTextField txtDistrito;
private javax.swing.JTextField txtDni;
private javax.swing.JTextField txtEdad;
private javax.swing.JTextField txtMaterno;
private javax.swing.JTextField txtNombre;
private javax.swing.JTextField txtPaterno;
// End of variables declaration//GEN-END:variables
private void llenarCombo(List<String> ls) {
DefaultComboBoxModel combo;
combo = (DefaultComboBoxModel) comboDniApoderado.getModel();
combo.removeAllElements();
for ( String c : ls) {
String row = c;
combo.addElement(row);
}
}
}
| [
"[email protected]"
] | |
94d1c7d254cfd292a64e22732851a5c059e50b39 | d1e6dcf0cd24690658182b842f45a1876c4c7124 | /wolf_openresource/src/com/wzd/openresource/util/JsonUtil.java | bf8d0f7de7c67609f84710f645809ee1e9d82d44 | [] | no_license | 423811758/android_frame | b606ab07e49eada4272741310a1be68047c2349e | 789bac56254127a473ad4d0b3a2c027d90d0d152 | refs/heads/master | 2021-01-20T00:28:29.063359 | 2017-08-24T09:31:08 | 2017-08-24T09:31:08 | 101,277,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | package com.wzd.openresource.util;
import org.codehaus.jackson.map.ObjectMapper;
/**
* Json 和 Java 对象转化工具类
*/
public class JsonUtil {
private static ObjectMapper objectMapper;
static {
objectMapper = new ObjectMapper();
}
/**
* bean 到 json 转化
*/
public static String bean2Json ( Object bean ) throws Exception {
String s = objectMapper.writeValueAsString(bean);
return s;
}
/**
* json 到 bean 转化
*/
public static Object json2Bean ( String json, Class<?> cls ) throws Exception {
return objectMapper.readValue(json, cls);
}
}
| [
"[email protected]"
] | |
1739ce1ff99e171730d3608dba71c1996f11b268 | a56873f51b9acb825c1491a4b9047ad03971d7dd | /app/src/main/java/com/nmakademija/nmaakademija/listener/ClickListener.java | 8fe21a1de400bd58e218e2eb4782c6cf65757e4b | [
"Unlicense"
] | permissive | vycius/NMAkademija | c9b7940cba9b376d8806a73d42e4e8bc22cc1a69 | dfa9e21efb8403cf5504ed500b1ce77f4464387e | refs/heads/master | 2020-09-12T09:17:57.289630 | 2017-11-27T14:12:00 | 2017-11-27T14:12:00 | 66,378,139 | 4 | 1 | Unlicense | 2020-03-28T17:55:56 | 2016-08-23T15:12:37 | Java | UTF-8 | Java | false | false | 201 | java | package com.nmakademija.nmaakademija.listener;
import android.view.View;
public interface ClickListener {
void onClick(View view, int position);
void onLongClick(View view, int position);
}
| [
"[email protected]"
] | |
ce61eb1c849977c5605dc78a6c87d8e52ec21e69 | fb86ca764176fd27d9a228d2494b0ee76133a4da | /src/main/java/co/com/grupoasd/documental/presentacion/service/correspondencia/iface/CorRadicadoService.java | c4d75b434e7c0572fd55fd2716001532f279aa5f | [] | no_license | jc-mojicap/pruebas-pryFinal-front | 38ea208ccedc33fdb139e7129ef70836e7e2f08c | 50fafd87998d20f8d91719f3557dff0e52d57baf | refs/heads/master | 2022-06-29T15:50:40.726186 | 2019-11-28T05:00:28 | 2019-11-28T05:00:28 | 224,572,147 | 0 | 0 | null | 2022-06-20T22:28:45 | 2019-11-28T04:50:34 | Java | UTF-8 | Java | false | false | 8,287 | java | /*
* Archivo: EstadoRadicadoService.java
* Fecha creacion: 14/03/2017
* Todos los derechos de propiedad intelectual e industrial sobre esta
* aplicacion son de propiedad exclusiva del GRUPO ASESORIA EN
* SISTEMATIZACION DE DATOS SOCIEDAD POR ACCIONES SIMPLIFICADA – GRUPO ASD S.A.S.
* Su uso, alteracion, reproduccion o modificacion sin la debida
* consentimiento por escrito de GRUPO ASD S.A.S.
* autorizacion por parte de su autor quedan totalmente prohibidos.
*
* Este programa se encuentra protegido por las disposiciones de la
* Ley 23 de 1982 y demas normas concordantes sobre derechos de autor y
* propiedad intelectual. Su uso no autorizado dara lugar a las sanciones
* previstas en la Ley.
*/
package co.com.grupoasd.documental.presentacion.service.correspondencia.iface;
import java.util.List;
import co.com.grupoasd.documental.cliente.comun.Token;
import co.com.grupoasd.documental.cliente.correspondencia.model.CorAdjunto;
import co.com.grupoasd.documental.cliente.correspondencia.model.CorCanal;
import co.com.grupoasd.documental.cliente.correspondencia.model.CorRadicado;
import co.com.grupoasd.documental.cliente.correspondencia.model.CorTerceroXRadicado;
import co.com.grupoasd.documental.cliente.correspondencia.model.CorUsuarioXRadicado;
import co.com.grupoasd.documental.cliente.correspondencia.model.EstadoRadicado;
import co.com.grupoasd.documental.presentacion.comun.dto.InfoMedia;
import co.com.grupoasd.documental.presentacion.service.correspondencia.dto.RadicadoDto;
/**
* Servicios del recurso estado radicado.
*
* @author cestrada
*
*/
public interface CorRadicadoService {
/*******************************
* EstadoRadicado
******************************/
/**
* Lista los estados radicado activas e inactivas.
*
* @return Listado con estados radicado. Si no existen retorna vacio.
* @author cestrada
*/
public List<EstadoRadicado> listarEstadosRadicado();
/*******************************
* CorCanal
******************************/
/**
* Buscar un corCanal por su id.
*
* @param id
* identificador del corCanal.
* @return CorCanal asociado.
*/
CorCanal buscarCanalPorId(Integer id);
/**
* Lista los corCanales.
*
* @return Lista de corCanales.
*/
List<CorCanal> listarCanales();
/*******************************
* CorRadicado
******************************/
/**
* Lista los radicados de comunicación por filtros.
*
* @return Listado con estados radicado. Si no existen retorna vacio.
* @author cestrada
*/
public List<CorRadicado> listarRadicadosComunicacionPorFiltros(CorRadicado filtros);
/**
* Crea un nuevo radicado.
*
* @param token
* Token con identificacion del usuario.
* @param corRadicado
* Objeto CorRadicado.
* @return Objeto CorRadicado creado con identificador asignado.
*/
public CorRadicado crear(Token token, CorRadicado corRadicado);
/**
* Busca un radicado por empresa y código de radicado.
*
* @param empresaId
* Identificador de la empresa.
* @param radicado
* Código del radicado.
* @return Objeto CorRadicado.
*/
public CorRadicado buscarPorEmpresaYRadicado(Integer empresaId, String radicado);
/*******************************
* CorRadicado
******************************/
/**
* Lista los radicados de comunicación por filtros.
*
* @param filtros
* Filtros para la consulta.
* @return Listado con estados radicado. Si no existen retorna vacio.
* @author cestrada
*/
public List<RadicadoDto> listarRadicadosComunicacionPorFiltros(RadicadoDto filtros);
/**
* Cantidad de radicados filtrados.
*
* @param filtros
* Filtros para la consulta.
* @return Integer
* @author cestrada
*/
public Integer contarRadicadosComunicacionPorFiltros(RadicadoDto filtros);
/**
* Archivo de radicados filtrados enviando el tipo de archivo.
*
* @return InfoMedia Archivo de radicados.
* @author cestrada
*/
public InfoMedia obtenerArchivoRadicadosComunicacionPorFiltros(RadicadoDto filtros, String tipoArchivo);
/*******************************
* CorAdjunto
******************************/
/**
* Lista los adjuntos de radicados.
*
* @param radicadoId
* Identificador del radicado.
* @param eliminado
* Adjunto eliminado.
* @return Listado con adjuntos de radicados. Si no existen retorna vacio.
* @author cestrada
*/
public List<CorAdjunto> listarAdjuntosPorRadicadoIdEliminado(Long radicadoId, Boolean eliminado);
/**
* Lista los adjuntos de radicados.
*
* @param radicadoId
* Identificador del radicado.
* @return Listado con adjuntos de radicados. Si no existen retorna vacio.
* @author cestrada
*/
public List<CorAdjunto> listarAdjuntosPorRadicadoId(Long radicadoId);
/**
* Cantidad de adjuntos por radicado.
*
* @param radicadoId
* Identificador del radicado.
* @param eliminado
* Adjunto eliminado.
* @return Integer Cantidad de adjuntos.
* @author cestrada
*/
public Integer contarAdjuntosPorRadicadoIdEliminado(Long radicadoId, Boolean eliminado);
/*******************************
* CorTerceroXRadicado
******************************/
/**
* listarRadicadosPorTerceroId.
*
* @param terceroId
* Identificador del tercero.
* @return Lista de radicados por tercero.
* @author cestrada
*/
public List<CorTerceroXRadicado> listarRadicadosPorTerceroId(Integer terceroId);
/**
* listarTercerosPorRadicadoId.
*
* @param radicadoId
* Identificador del radicado.
* @return Lista de terceros por radicado.
* @author cestrada
*/
public List<CorTerceroXRadicado> listarTercerosPorRadicadoId(Long radicadoId);
/**
* listarTercerosConRadicados.
*
* @return Lista de terceros con radicados.
* @author cestrada
*/
public List<CorTerceroXRadicado> listarTercerosConRadicados();
/*******************************
* CorUsuarioXRadicado
******************************/
/**
* listarRadicadosPorUsuarioId.
*
* @param terceroId
* Identificador del tercero.
* @return Lista de radicados por usuario.
* @author cestrada
*/
public List<CorUsuarioXRadicado> listarRadicadosPorUsuarioId(Integer usuarioId);
/**
* listarUsuariosPorRadicadoId.
*
* @param radicadoId
* Identificador del radicado.
* @return Lista de usuarios por radicado.
* @author cestrada
*/
public List<CorUsuarioXRadicado> listarUsuariosPorRadicadoId(Long radicadoId);
/**
* listarUsuariosConRadicados.
*
* @return Lista de usuarios con radicados.
* @author cestrada
*/
public List<CorUsuarioXRadicado> listarUsuariosConRadicados();
/**
* Obtiene la información del radicado por radicado_id
* @param id Id del radicado
* @return Objeto corRadicado
*/
CorRadicado obtenerPorId(Long id);
/**
* Anular radicado
* @param token
* Token con identificacion del usuario.
* @param corRadicado Objeto CorRadicado
* @return Objeto CorRadicado
*/
CorRadicado anularRadicado(Token token, CorRadicado corRadicado);
/**
* Asignar responsables
* @param token
* Token con identificacion del usuario.
* @param corRadicado Objeto CorRadicado
* @return Objeto CorRadicado
*/
CorRadicado asignarResponsables(Token token, CorRadicado corRadicado);
/**
* Actualiza un CorRadicado.
* @param token Token de autenticación.
* @param radicado CorRadicado a actualizar.
* @return radicado actualizado.
*/
public CorRadicado actualizarRadicado(Token token, CorRadicado radicado);
}
| [
"[email protected]"
] | |
a90650f5efac6588ebc727f08069bc28ff331663 | 2038ae1d81705a7f743174bd8d91cea547779794 | /BTHienThiCacLoaiHinh/src/BTHienThiCacLoaiHinh.java | f440926bcc96a82cb21b9932c914afe795fa8096 | [] | no_license | herokillv1/Module2_Tuan1 | 1098a69979344bdfe92da11f05f0c8a0c9473ec6 | 884a3267ebcbd39092aebc490b246aec67c9b54f | refs/heads/master | 2022-11-09T21:31:41.558966 | 2020-07-06T06:46:31 | 2020-07-06T06:46:31 | 276,839,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,662 | java | import java.util.Scanner;
public class BTHienThiCacLoaiHinh {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Menu");
System.out.println("1. Print the rectangle");
System.out.println("2. Print the square triangle");
System.out.println("3. Print isosceles triangle");
System.out.println("4. Exit");
System.out.println("Enter your choice: ");
while(true) {
int choice = input.nextInt();
switch (choice) {
case 1:
System.out.println("Print the rectangle");
for (int i=0;i<3;i++){
for (int j=0;j<7;j++){
System.out.print("* ");
}
System.out.println("");
}
break;
case 2:
System.out.println("Print the square triangle");
for(int i=0; i<=5; i++){
for(int j=0; j<i; j++){
System.out.print("* ");
}
System.out.println("");
}
System.out.println("");
for(int i=0; i<=5; i++){
for(int j=5; j>i; j--){
System.out.print("* ");
}
System.out.println("");
}
break;
case 3:
System.out.println("Print isosceles triangle");
int i,j;
for (i=0;i<5;i++){
for (j=0;j<5-i;j++){
System.out.print("");
for (j=0;j<2*i-1;j++){
if (j==0||j==2*i-1){
System.out.print("*");
}else {
System.out.print("");
}
}
}
System.out.println("");
if (i==5-1){
for (j=0;j<2*5-1;j++){
System.out.print("*");
break;
}
}
}
break;
case 0:
System.exit(0);
default:
System.out.println("No choice!");
}
}
}
}
| [
"[email protected]"
] | |
55b22956eb703bc7892de03138c23641617796eb | 5784885d3d232a1197a76a9918a5b43c514ba4fb | /jspeedtest/src/test/java/fr/bmartel/speedtest/test/server/IHttpStream.java | a2f0effbdb9048aaf67f29f86c2a780d65a81f3d | [
"MIT"
] | permissive | sherry-android/speed-test-lib | bd8177e8779682e8a6621d0984cb58f6430a37c2 | 882d0afdb46b8c7f86bff1d978a38727f1b1f600 | refs/heads/master | 2021-03-29T05:36:28.677849 | 2020-04-08T03:03:52 | 2020-04-08T03:03:52 | 247,923,342 | 0 | 0 | MIT | 2020-03-17T09:01:32 | 2020-03-17T09:01:31 | null | UTF-8 | Java | false | false | 1,495 | java | /*
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016-2017 Bertrand Martel
* <p/>
* 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:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package fr.bmartel.speedtest.test.server;
/**
* Interface for writing http data frame
*
* @author Bertrand Martel
*/
public interface IHttpStream {
/**
* Write http request frame
*
* @param data data to be written
* @return 0 if OK -1 if error
*/
int writeHttpFrame(byte[] data);
} | [
"[email protected]"
] | |
447de6390077076a6327c92cec8b27612792efa0 | 5e38017e1fcb4b69614f0a72f018cf3b960d9246 | /org/omg/DynamicAny/_DynSequenceStub.java | 0baf4afc18775d304e4129560b34f807b73b3549 | [] | no_license | leeon/annotated-jdk | bea64a10ed766faa5fd0792d7dd0d3de815e6678 | 4703f5e51cb2fcffe219ffa15e64215fb19c66c7 | refs/heads/master | 2021-01-13T02:40:11.648169 | 2014-03-10T14:18:55 | 2014-03-10T14:18:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 50,619 | java | package org.omg.DynamicAny;
/**
* org/omg/DynamicAny/_DynSequenceStub.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/org/omg/DynamicAny/DynamicAny.idl
* Monday, June 27, 2011 2:16:34 AM PDT
*/
/**
* DynSequence objects support the manipulation of IDL sequences.
*/
public class _DynSequenceStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.DynamicAny.DynSequence
{
final public static java.lang.Class _opsClass = DynSequenceOperations.class;
/**
* Returns the current length of the sequence.
*/
public int get_length ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_length", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_length ();
} finally {
_servant_postinvoke ($so);
}
} // get_length
/**
* Sets the length of the sequence.
* Increasing the length of a sequence adds new elements at the tail without affecting the values
* of already existing elements. Newly added elements are default-initialized.
* Increasing the length of a sequence sets the current position to the first newly-added element
* if the previous current position was -1. Otherwise, if the previous current position was not -1,
* the current position is not affected.
* Decreasing the length of a sequence removes elements from the tail without affecting the value
* of those elements that remain. The new current position after decreasing the length of a sequence
* is determined as follows:
* <UL>
* <LI>If the length of the sequence is set to zero, the current position is set to -1.
* <LI>If the current position is -1 before decreasing the length, it remains at -1.
* <LI>If the current position indicates a valid element and that element is not removed when the length
* is decreased, the current position remains unaffected.
* <LI>If the current position indicates a valid element and that element is removed,
* the current position is set to -1.
* </UL>
*
* @exception InvalidValue if this is a bounded sequence and len is larger than the bound
*/
public void set_length (int len) throws org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("set_length", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.set_length (len);
} finally {
_servant_postinvoke ($so);
}
} // set_length
/**
* Returns the elements of the sequence.
*/
public org.omg.CORBA.Any[] get_elements ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_elements", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_elements ();
} finally {
_servant_postinvoke ($so);
}
} // get_elements
/**
* Sets the elements of a sequence.
* The length of the DynSequence is set to the length of value. The current position is set to zero
* if value has non-zero length and to -1 if value is a zero-length sequence.
*
* @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent
* to the element TypeCode of the DynSequence
* @exception InvalidValue if the length of value exceeds the bound of a bounded sequence
*/
public void set_elements (org.omg.CORBA.Any[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("set_elements", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.set_elements (value);
} finally {
_servant_postinvoke ($so);
}
} // set_elements
/**
* Returns the DynAnys representing the elements of the sequence.
*/
public org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_elements_as_dyn_any", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_elements_as_dyn_any ();
} finally {
_servant_postinvoke ($so);
}
} // get_elements_as_dyn_any
/**
* Sets the elements of a sequence using DynAnys.
* The length of the DynSequence is set to the length of value. The current position is set to zero
* if value has non-zero length and to -1 if value is a zero-length sequence.
*
* @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent
* to the element TypeCode of the DynSequence
* @exception InvalidValue if the length of value exceeds the bound of a bounded sequence
*/
public void set_elements_as_dyn_any (org.omg.DynamicAny.DynAny[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("set_elements_as_dyn_any", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.set_elements_as_dyn_any (value);
} finally {
_servant_postinvoke ($so);
}
} // set_elements_as_dyn_any
/**
* Returns the TypeCode associated with this DynAny object.
* A DynAny object is created with a TypeCode value assigned to it.
* This TypeCode value determines the type of the value handled through the DynAny object.
* Note that the TypeCode associated with a DynAny object is initialized at the time the
* DynAny is created and cannot be changed during lifetime of the DynAny object.
*
* @return The TypeCode associated with this DynAny object
*/
public org.omg.CORBA.TypeCode type ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("type", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.type ();
} finally {
_servant_postinvoke ($so);
}
} // type
/**
* Initializes the value associated with a DynAny object with the value
* associated with another DynAny object.
* The current position of the target DynAny is set to zero for values that have components
* and to -1 for values that do not have components.
*
* @param dyn_any
* @exception TypeMismatch if the type of the passed DynAny is not equivalent to the type of target DynAny
*/
public void assign (org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("assign", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.assign (dyn_any);
} finally {
_servant_postinvoke ($so);
}
} // assign
/**
* Initializes the value associated with a DynAny object with the value contained in an any.
* The current position of the target DynAny is set to zero for values that have components
* and to -1 for values that do not have components.
*
* @exception TypeMismatch if the type of the passed Any is not equivalent to the type of target DynAny
* @exception InvalidValue if the passed Any does not contain a legal value (such as a null string)
*/
public void from_any (org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("from_any", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.from_any (value);
} finally {
_servant_postinvoke ($so);
}
} // from_any
/**
* Creates an any value from a DynAny object.
* A copy of the TypeCode associated with the DynAny object is assigned to the resulting any.
* The value associated with the DynAny object is copied into the any.
*
* @return a new Any object with the same value and TypeCode
*/
public org.omg.CORBA.Any to_any ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("to_any", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.to_any ();
} finally {
_servant_postinvoke ($so);
}
} // to_any
/**
* Compares two DynAny values for equality.
* Two DynAny values are equal if their TypeCodes are equivalent and, recursively, all component DynAnys
* have equal values.
* The current position of the two DynAnys being compared has no effect on the result of equal.
*
* @return true of the DynAnys are equal, false otherwise
*/
public boolean equal (org.omg.DynamicAny.DynAny dyn_any)
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("equal", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.equal (dyn_any);
} finally {
_servant_postinvoke ($so);
}
} // equal
/**
* Destroys a DynAny object.
* This operation frees any resources used to represent the data value associated with a DynAny object.
* It must be invoked on references obtained from one of the creation operations on the ORB interface
* or on a reference returned by DynAny.copy() to avoid resource leaks.
* Invoking destroy on component DynAny objects (for example, on objects returned by the
* current_component operation) does nothing.
* Destruction of a DynAny object implies destruction of all DynAny objects obtained from it.
* That is, references to components of a destroyed DynAny become invalid.
* Invocations on such references raise OBJECT_NOT_EXIST.
* It is possible to manipulate a component of a DynAny beyond the life time of the DynAny
* from which the component was obtained by making a copy of the component with the copy operation
* before destroying the DynAny from which the component was obtained.
*/
public void destroy ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("destroy", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.destroy ();
} finally {
_servant_postinvoke ($so);
}
} // destroy
/**
* Creates a new DynAny object whose value is a deep copy of the DynAny on which it is invoked.
* The operation is polymorphic, that is, invoking it on one of the types derived from DynAny,
* such as DynStruct, creates the derived type but returns its reference as the DynAny base type.
*
* @return a deep copy of the DynAny object
*/
public org.omg.DynamicAny.DynAny copy ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("copy", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.copy ();
} finally {
_servant_postinvoke ($so);
}
} // copy
/**
* Inserts a boolean value into the DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_boolean (boolean value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_boolean", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_boolean (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_boolean
/**
* Inserts a byte value into the DynAny. The IDL octet data type is mapped to the Java byte data type.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_octet (byte value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_octet", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_octet (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_octet
/**
* Inserts a char value into the DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_char (char value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_char", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_char (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_char
/**
* Inserts a short value into the DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_short (short value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_short", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_short (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_short
/**
* Inserts a short value into the DynAny. The IDL ushort data type is mapped to the Java short data type.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_ushort (short value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_ushort", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_ushort (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_ushort
/**
* Inserts an integer value into the DynAny. The IDL long data type is mapped to the Java int data type.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_long (int value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_long", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_long (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_long
/**
* Inserts an integer value into the DynAny. The IDL ulong data type is mapped to the Java int data type.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_ulong (int value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_ulong", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_ulong (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_ulong
/**
* Inserts a float value into the DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_float (float value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_float", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_float (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_float
/**
* Inserts a double value into the DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_double (double value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_double", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_double (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_double
/**
* Inserts a string value into the DynAny.
* Both bounded and unbounded strings are inserted using this method.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception InvalidValue if the string inserted is longer than the bound of a bounded string
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_string (String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_string", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_string (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_string
/**
* Inserts a reference to a CORBA object into the DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_reference (org.omg.CORBA.Object value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_reference", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_reference (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_reference
/**
* Inserts a TypeCode object into the DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_typecode (org.omg.CORBA.TypeCode value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_typecode", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_typecode (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_typecode
/**
* Inserts a long value into the DynAny. The IDL long long data type is mapped to the Java long data type.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_longlong (long value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_longlong", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_longlong (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_longlong
/**
* Inserts a long value into the DynAny.
* The IDL unsigned long long data type is mapped to the Java long data type.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_ulonglong (long value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_ulonglong", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_ulonglong (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_ulonglong
/**
* Inserts a char value into the DynAny. The IDL wchar data type is mapped to the Java char data type.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_wchar (char value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_wchar", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_wchar (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_wchar
/**
* Inserts a string value into the DynAny.
* Both bounded and unbounded strings are inserted using this method.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception InvalidValue if the string inserted is longer than the bound of a bounded string
*/
public void insert_wstring (String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_wstring", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_wstring (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_wstring
/**
* Inserts an Any value into the Any represented by this DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_any (org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_any", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_any (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_any
/**
* Inserts the Any value contained in the parameter DynAny into the Any represented by this DynAny.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_dyn_any (org.omg.DynamicAny.DynAny value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_dyn_any", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_dyn_any (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_dyn_any
/**
* Inserts a reference to a Serializable object into this DynAny.
* The IDL ValueBase type is mapped to the Java Serializable type.
*
* @exception InvalidValue if this DynAny has components but has a current position of -1
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public void insert_val (java.io.Serializable value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_val", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.insert_val (value);
} finally {
_servant_postinvoke ($so);
}
} // insert_val
/**
* Extracts the boolean value from this DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public boolean get_boolean () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_boolean", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_boolean ();
} finally {
_servant_postinvoke ($so);
}
} // get_boolean
/**
* Extracts the byte value from this DynAny. The IDL octet data type is mapped to the Java byte data type.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public byte get_octet () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_octet", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_octet ();
} finally {
_servant_postinvoke ($so);
}
} // get_octet
/**
* Extracts the char value from this DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public char get_char () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_char", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_char ();
} finally {
_servant_postinvoke ($so);
}
} // get_char
/**
* Extracts the short value from this DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public short get_short () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_short", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_short ();
} finally {
_servant_postinvoke ($so);
}
} // get_short
/**
* Extracts the short value from this DynAny. The IDL ushort data type is mapped to the Java short data type.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public short get_ushort () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_ushort", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_ushort ();
} finally {
_servant_postinvoke ($so);
}
} // get_ushort
/**
* Extracts the integer value from this DynAny. The IDL long data type is mapped to the Java int data type.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public int get_long () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_long", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_long ();
} finally {
_servant_postinvoke ($so);
}
} // get_long
/**
* Extracts the integer value from this DynAny. The IDL ulong data type is mapped to the Java int data type.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public int get_ulong () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_ulong", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_ulong ();
} finally {
_servant_postinvoke ($so);
}
} // get_ulong
/**
* Extracts the float value from this DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public float get_float () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_float", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_float ();
} finally {
_servant_postinvoke ($so);
}
} // get_float
/**
* Extracts the double value from this DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public double get_double () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_double", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_double ();
} finally {
_servant_postinvoke ($so);
}
} // get_double
/**
* Extracts the string value from this DynAny.
* Both bounded and unbounded strings are extracted using this method.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public String get_string () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_string", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_string ();
} finally {
_servant_postinvoke ($so);
}
} // get_string
/**
* Extracts the reference to a CORBA Object from this DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public org.omg.CORBA.Object get_reference () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_reference", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_reference ();
} finally {
_servant_postinvoke ($so);
}
} // get_reference
/**
* Extracts the TypeCode object from this DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public org.omg.CORBA.TypeCode get_typecode () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_typecode", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_typecode ();
} finally {
_servant_postinvoke ($so);
}
} // get_typecode
/**
* Extracts the long value from this DynAny. The IDL long long data type is mapped to the Java long data type.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public long get_longlong () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_longlong", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_longlong ();
} finally {
_servant_postinvoke ($so);
}
} // get_longlong
/**
* Extracts the long value from this DynAny.
* The IDL unsigned long long data type is mapped to the Java long data type.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public long get_ulonglong () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_ulonglong", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_ulonglong ();
} finally {
_servant_postinvoke ($so);
}
} // get_ulonglong
/**
* Extracts the long value from this DynAny. The IDL wchar data type is mapped to the Java char data type.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public char get_wchar () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_wchar", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_wchar ();
} finally {
_servant_postinvoke ($so);
}
} // get_wchar
/**
* Extracts the string value from this DynAny.
* Both bounded and unbounded strings are extracted using this method.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
*/
public String get_wstring () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_wstring", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_wstring ();
} finally {
_servant_postinvoke ($so);
}
} // get_wstring
/**
* Extracts an Any value contained in the Any represented by this DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public org.omg.CORBA.Any get_any () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_any", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_any ();
} finally {
_servant_postinvoke ($so);
}
} // get_any
/**
* Extracts the Any value contained in the Any represented by this DynAny and returns it wrapped
* into a new DynAny.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public org.omg.DynamicAny.DynAny get_dyn_any () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_dyn_any", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_dyn_any ();
} finally {
_servant_postinvoke ($so);
}
} // get_dyn_any
/**
* Extracts a Serializable object from this DynAny.
* The IDL ValueBase type is mapped to the Java Serializable type.
*
* @exception TypeMismatch if the accessed component in the DynAny is of a type
* that is not equivalent to the requested type.
* @exception TypeMismatch if called on a DynAny whose current component itself has components
* @exception InvalidValue if this DynAny has components but has a current position of -1
*/
public java.io.Serializable get_val () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_val", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.get_val ();
} finally {
_servant_postinvoke ($so);
}
} // get_val
/**
* Sets the current position to index. The current position is indexed 0 to n-1, that is,
* index zero corresponds to the first component. The operation returns true if the resulting
* current position indicates a component of the DynAny and false if index indicates
* a position that does not correspond to a component.
* Calling seek with a negative index is legal. It sets the current position to -1 to indicate
* no component and returns false. Passing a non-negative index value for a DynAny that does not
* have a component at the corresponding position sets the current position to -1 and returns false.
*/
public boolean seek (int index)
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("seek", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.seek (index);
} finally {
_servant_postinvoke ($so);
}
} // seek
/**
* Is equivalent to seek(0).
*/
public void rewind ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("rewind", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
$self.rewind ();
} finally {
_servant_postinvoke ($so);
}
} // rewind
/**
* Advances the current position to the next component.
* The operation returns true while the resulting current position indicates a component, false otherwise.
* A false return value leaves the current position at -1.
* Invoking next on a DynAny without components leaves the current position at -1 and returns false.
*/
public boolean next ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("next", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.next ();
} finally {
_servant_postinvoke ($so);
}
} // next
/**
* Returns the number of components of a DynAny.
* For a DynAny without components, it returns zero.
* The operation only counts the components at the top level.
* For example, if component_count is invoked on a DynStruct with a single member,
* the return value is 1, irrespective of the type of the member.
* <UL>
* <LI>For sequences, the operation returns the current number of elements.
* <LI>For structures, exceptions, and value types, the operation returns the number of members.
* <LI>For arrays, the operation returns the number of elements.
* <LI>For unions, the operation returns 2 if the discriminator indicates that a named member is active,
* otherwise, it returns 1.
* <LI>For DynFixed and DynEnum, the operation returns zero.
* </UL>
*/
public int component_count ()
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("component_count", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.component_count ();
} finally {
_servant_postinvoke ($so);
}
} // component_count
/**
* Returns the DynAny for the component at the current position.
* It does not advance the current position, so repeated calls to current_component
* without an intervening call to rewind, next, or seek return the same component.
* The returned DynAny object reference can be used to get/set the value of the current component.
* If the current component represents a complex type, the returned reference can be narrowed
* based on the TypeCode to get the interface corresponding to the to the complex type.
* Calling current_component on a DynAny that cannot have components,
* such as a DynEnum or an empty exception, raises TypeMismatch.
* Calling current_component on a DynAny whose current position is -1 returns a nil reference.
* The iteration operations, together with current_component, can be used
* to dynamically compose an any value. After creating a dynamic any, such as a DynStruct,
* current_component and next can be used to initialize all the components of the value.
* Once the dynamic value is completely initialized, to_any creates the corresponding any value.
*
* @exception TypeMismatch If called on a DynAny that cannot have components,
* such as a DynEnum or an empty exception
*/
public org.omg.DynamicAny.DynAny current_component () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch
{
org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("current_component", _opsClass);
DynSequenceOperations $self = (DynSequenceOperations) $so.servant;
try {
return $self.current_component ();
} finally {
_servant_postinvoke ($so);
}
} // current_component
// Type-specific CORBA::Object operations
private static String[] __ids = {
"IDL:omg.org/DynamicAny/DynSequence:1.0",
"IDL:omg.org/DynamicAny/DynAny:1.0"};
public String[] _ids ()
{
return (String[])__ids.clone ();
}
private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
{
String str = s.readUTF ();
String[] args = null;
java.util.Properties props = null;
org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
_set_delegate (delegate);
}
private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
{
String[] args = null;
java.util.Properties props = null;
String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
s.writeUTF (str);
}
} // class _DynSequenceStub
| [
"[email protected]"
] | |
0e78add91ba4c99513a442202bfe748036ca4853 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_459/Testnull_45875.java | 276222ef3549b3dd56e5bc4912fa7f43a19969a5 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 308 | java | package org.gradle.test.performancenull_459;
import static org.junit.Assert.*;
public class Testnull_45875 {
private final Productionnull_45875 production = new Productionnull_45875("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"[email protected]"
] | |
efacc38cd6dab7d8b46f29d4a32f1930f3e0d954 | 0eb37ae3ccd63221b5abaf167d5bceb4e0705fbc | /web-s/src/main/java/com/enjoygolf24/online/web/controller/PointHistoryController.java | fe5a1e5258e2a7d18a5f298814e0922deb24bf06 | [] | no_license | r-e-d-dragon/myWork | 2405303054d4bb181cc129a007b4fe5db3bb29e1 | 62a147ccd6f7749aaddc42d1f9fec4f9afb85551 | refs/heads/master | 2022-12-25T12:55:56.015817 | 2020-10-09T16:01:39 | 2020-10-09T16:01:39 | 291,210,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,825 | java | package com.enjoygolf24.online.web.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.enjoygolf24.api.common.code.CodeTypeCd;
import com.enjoygolf24.api.common.database.bean.TblPointManage;
import com.enjoygolf24.api.common.utility.DefaultPageSizeUtility;
import com.enjoygolf24.api.common.utility.LoginUtility;
import com.enjoygolf24.api.common.validator.groups.Search0;
import com.enjoygolf24.api.service.AspService;
import com.enjoygolf24.api.service.CdMapService;
import com.enjoygolf24.api.service.MemberInfoManageService;
import com.enjoygolf24.api.service.MemberReservationManageService;
import com.enjoygolf24.api.service.PointService;
import com.enjoygolf24.online.web.form.PointHistoryListForm;
import com.github.pagehelper.PageInfo;
@Controller
@RequestMapping("/admin/member/pointHistory")
public class PointHistoryController {
private static final Logger logger = LoggerFactory.getLogger(PointHistoryController.class);
@Autowired
HttpServletRequest request;
@Autowired
PointService pointService;
@Autowired
AspService aspService;
@Autowired
MemberInfoManageService memberInfoManageService;
@Autowired
MemberReservationManageService memberReservationManageService;
@Autowired
private CdMapService cdMapService;
@RequestMapping(value = "/index", method = RequestMethod.POST)
public String index(@ModelAttribute("pointHistoryListForm") PointHistoryListForm form,
HttpServletRequest request,
Model model) {
logger.info("Start pointHistory Controller");
initListForm(form, model);
form.setPageNo(DefaultPageSizeUtility.PAGE_FIRST);
List<TblPointManage> pointHistoryList = pointService.getHistoryListAll(form.getAspCode(), form.getPageNo(),
form.getPageSize());
PageInfo<TblPointManage> pageInfo = new PageInfo<TblPointManage>(pointHistoryList);
model.addAttribute("pageInfo", pageInfo);
form.setPointHistoryList(pointHistoryList);
model.addAttribute("modelPointHistoryList", pointHistoryList);
model.addAttribute("pointHistoryListForm", form);
logger.info("End pointHistory Controller");
return "/admin/member/pointHistory/index";
}
@RequestMapping(value = "", method = RequestMethod.GET)
public String memberHistoryList(@ModelAttribute("pointHistoryListForm") PointHistoryListForm form,
Model model) {
logger.info("Start pointHistory Controller");
initListForm(form, model);
form.setPageNo(DefaultPageSizeUtility.PAGE_FIRST);
List<TblPointManage> pointHistoryList = pointService.getHistoryListAll(form.getAspCode(), form.getPageNo(),
form.getPageSize());
PageInfo<TblPointManage> pageInfo = new PageInfo<TblPointManage>(pointHistoryList);
model.addAttribute("pageInfo", pageInfo);
form.setPointHistoryList(pointHistoryList);
model.addAttribute("modelPointHistoryList", pointHistoryList);
model.addAttribute("pointHistoryListForm", form);
logger.info("End pointHistory Controller");
return "/admin/member/pointHistory/index";
}
@RequestMapping(value = "/list", method = RequestMethod.POST)
public String list(@ModelAttribute @Validated(Search0.class) PointHistoryListForm form, BindingResult result,
Model model) {
logger.info("Start pointHistory Controller");
if (result.hasErrors()) {
return memberHistoryList(form, model);
}
initListForm(form, model);
List<TblPointManage> pointHistoryList = pointService.getHistoryList(form.getMemberCode(),
form.getName(), form.getRegisterUserCode(), form.getRegisterUserName(), form.getRegisteredMonth(),
form.getStartMonth(),
form.getAspCode(), form.getPageNo(),
form.getPageSize());
PageInfo<TblPointManage> pageInfo = new PageInfo<TblPointManage>(pointHistoryList);
model.addAttribute("pageInfo", pageInfo);
form.setPointHistoryList(pointHistoryList);
model.addAttribute("modelPointHistoryList", pointHistoryList);
model.addAttribute("pointHistoryListForm", form);
logger.info("End pointHistory Controller");
return "/admin/member/pointHistory/index";
}
@RequestMapping(value = "/list/prev", method = RequestMethod.POST)
public String listPrev(@ModelAttribute @Validated(Search0.class) PointHistoryListForm form,
BindingResult result, Model model) {
logger.info("Start pointHistory Controller");
if (result.hasErrors()) {
return memberHistoryList(form, model);
}
initListForm(form, model);
form.setPageNo(form.getPageNo() - 1);
List<TblPointManage> pointHistoryList = pointService.getHistoryList(form.getMemberCode(), form.getName(),
form.getRegisterUserCode(), form.getRegisterUserName(), form.getRegisteredMonth(), form.getStartMonth(),
form.getAspCode(),
form.getPageNo(), form.getPageSize());
PageInfo<TblPointManage> pageInfo = new PageInfo<TblPointManage>(pointHistoryList);
model.addAttribute("pageInfo", pageInfo);
form.setPointHistoryList(pointHistoryList);
model.addAttribute("modelPointHistoryList", pointHistoryList);
model.addAttribute("pointHistoryListForm", form);
logger.info("End pointHistory Controller");
return "/admin/member/pointHistory/index";
}
@RequestMapping(value = "/list/next", method = RequestMethod.POST)
public String listNext(@ModelAttribute @Validated(Search0.class) PointHistoryListForm form,
BindingResult result, Model model) {
logger.info("Start pointHistory Controller");
if (result.hasErrors()) {
return memberHistoryList(form, model);
}
initListForm(form, model);
form.setPageNo(form.getPageNo() + 1);
List<TblPointManage> pointHistoryList = pointService.getHistoryList(form.getMemberCode(), form.getName(),
form.getRegisterUserCode(), form.getRegisterUserName(), form.getRegisteredMonth(), form.getStartMonth(),
form.getAspCode(),
form.getPageNo(), form.getPageSize());
PageInfo<TblPointManage> pageInfo = new PageInfo<TblPointManage>(pointHistoryList);
model.addAttribute("pageInfo", pageInfo);
form.setPointHistoryList(pointHistoryList);
model.addAttribute("modelPointHistoryList", pointHistoryList);
model.addAttribute("pointHistoryListForm", form);
logger.info("End pointHistory Controller");
return "/admin/member/pointHistory/index";
}
@RequestMapping(value = "/details", method = RequestMethod.POST)
public String details(@ModelAttribute PointHistoryListForm form, BindingResult result, Model model) {
TblPointManage pointHistory = pointService.getHistory(form.getSelectedId(), form.getSelectedMemberCode());
model.addAttribute("pointHistory", pointHistory);
model.addAttribute("pointHistoryId", pointHistory.getId().getId());
model.addAttribute("memberCode", pointHistory.getId().getMemberCode());
model.addAttribute("pointTypeName",
cdMapService.getName(CodeTypeCd.POINT_TYPE_CD, pointHistory.getPointType()));
model.addAttribute("pointCategoryName",
cdMapService.getName(CodeTypeCd.POINT_CATEGORY_CD, pointHistory.getCategoryCode()));
model.addAttribute("memberName",
memberInfoManageService.selectMember(pointHistory.getId().getMemberCode()).getUserName());
return "/admin/member/pointHistory/details";
}
private void initListForm(PointHistoryListForm form, Model model) {
String aspCode = LoginUtility.getLoginUser().getAspCode();
if (!aspService.getAspByName("本社").getAspCode().equals(aspCode)) {
form.setAspCode(aspCode);
}
}
}
| [
"H1705635@H1705635"
] | H1705635@H1705635 |
f006012a88cc12300062e4c5be3a62ce60ca0ab9 | e5bd02c1fa54af85e1b8d9e2f2a4fe00409b75c6 | /app/src/main/java/com/example/kenvin/launchpageview/ButterKnifeActivity.java | 2e0154162d91e283403a5222eaafc36bd46c3a86 | [] | no_license | summerHearts/LaunchPageView | d0541e6785d3bc13dfb9f47a1a3b680aaed71214 | c4ec2a89cf358db1edf83277fe50f0aac0b84fe1 | refs/heads/master | 2021-07-24T12:50:47.119277 | 2017-11-06T06:58:05 | 2017-11-06T06:58:10 | 109,365,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,159 | java | package com.example.kenvin.launchpageview;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.Toast;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.OnLongClick;
/**
* Created by Kenvin on 2017/11/6.
*/
public class ButterKnifeActivity extends AppCompatActivity {
@BindView(R.id.button1)
Button button1;
@BindView(R.id.button2)
Button button2;
@BindView(R.id.button3)
Button button3;
@OnClick(R.id.button1 ) //点击事件
public void showToast(){
Toast.makeText(this, " OnClick", Toast.LENGTH_SHORT).show();
}
@OnLongClick( R.id.button1 ) //长按事件
public boolean showToast2(){
Toast.makeText(this, " OnLongClick", Toast.LENGTH_SHORT).show();
return true ;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_butterkinfe);
ButterKnife.bind(this);
}
}
| [
"[email protected]"
] | |
4aa0221871b81ae3fd55e244a43f0055495b155a | 62b162a1d7367e475aacb5cc5bcbedb13f7c6508 | /PMIS_Report/src/com/tetrapak/util/cip/TPM4CIPReportAnalyser.java | 10d74a820a4755dae9056062554815b2efbcad93 | [] | no_license | frankshou1988/Work | 1f66e4871661cca473c9ab628449cd8a50064afb | 4309ab9ae474c6cd8f4217827e26e3479a0d8611 | refs/heads/master | 2021-01-17T17:05:46.667235 | 2013-09-04T14:41:12 | 2013-09-04T14:41:12 | 12,592,530 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,265 | java | package com.tetrapak.util.cip;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.tetrapak.dao.CommonDao;
import com.tetrapak.domain.cip.CIPMasterLine;
import com.tetrapak.domain.cip.CIPPhase;
import com.tetrapak.domain.cip.CIPReportAnalysePoint;
import com.tetrapak.domain.cip.CIPReportResult;
import com.tetrapak.domain.cip.CIPResult;
import com.tetrapak.domain.cip.CIPSlaveLine;
import com.tetrapak.domain.cip.CIPTarget;
import com.tetrapak.domain.cip.CIPType;
import com.tetrapak.domain.comm.HMIOperator;
import com.tetrapak.insql.InSQLDaoUtil;
import com.tetrapak.metaclass.CIPResults;
import com.tetrapak.metaclass.CIPStepN;
import com.tetrapak.metaclass.EdgeSection;
import com.tetrapak.metaclass.PLCStructureTypes;
import com.tetrapak.metaclass.TPM4CIPType;
import com.tetrapak.metaclass.TimePeriod;
import com.tetrapak.util.common.HMIOperatorUtil;
import com.tetrapak.util.common.Tools;
/**
* This class used to analyze the TPM4-based structure CIP Program
* */
public class TPM4CIPReportAnalyser extends CIPReportAnalyserUtil {
private static Logger log = LoggerFactory.getLogger(TPM4CIPReportAnalyser.class);
public static void cipReportAnalyse() throws Exception {
String queryEndDate = Tools.toDateStr(new Date());
// This code only for the TPM4 based structure cip
List<CIPMasterLine> cipMasterLineList = CIPLineUtil.getCIPMasterLineOfTPM4();
// execute the query
for (CIPMasterLine ml : cipMasterLineList) {
String latestCIPEndTime = "";
// get the latest cip analyse time
CIPReportAnalysePoint point = CIPReportUtil.getCIPLastestAnalyseDateTime(ml.getCipMasterLineName());
String queryStartDate = point.getCipLatestAnalyseDateTime();
List<EdgeSection> edgeSectionList = InSQLDaoUtil.getEdgeSectionList(ml.getCipMasterLineOperTag(),
queryStartDate, queryEndDate);
for (EdgeSection edgeSection : edgeSectionList) {
CIPReportResult cipReportResult = new CIPReportResult();
String cipEdgeLeadingTime = edgeSection.getEdgeStartDateTime();
String cipEdgeTrailingTime = edgeSection.getEdgeEndDateTime();
Map<String, Integer> cipSteps = getCIPSteps(ml.getCipMasterLineStepsTag(), cipEdgeLeadingTime,
cipEdgeTrailingTime);
long programID = getCIPProgramID(ml.getCipMasterLineCIPProgramIDTag(), cipEdgeLeadingTime,
cipEdgeTrailingTime);
long phaseID = getCIPPhaseID(ml.getCipMasterLineRoutePhaseIDTag(), cipEdgeLeadingTime,
cipEdgeTrailingTime);
if (phaseID == 0) {
if (log.isErrorEnabled())
log.error("Unable to find the phaseID [" + phaseID + "] for " + ml.getCipMasterLineName()
+ "\t[" + cipEdgeLeadingTime + ":" + cipEdgeTrailingTime + "]");
continue;
}
CIPPhase cipPhase = CIPReportUtil.getCIPPhaseByPhaseID(phaseID);
if (cipPhase == null) {
if (log.isErrorEnabled())
log.error("Unable to find cip phase for phase id: " + phaseID + "\t"
+ ml.getCipMasterLineName() + "\t[" + cipEdgeLeadingTime + ":" + cipEdgeTrailingTime
+ "]");
continue;
}
long cipResultID = CIPResults.NOT_CLEAN;
Collection<Integer> values = cipSteps.values();
List<Integer> steps = new ArrayList<Integer>();
for (Integer value : values) {
steps.add(value);
}
int size = steps.size();
int lastStep = steps.get(size - 1);
if (lastStep == 0) {
if (size - 2 >= 0) {
lastStep = steps.get(size - 2);
}
}
if (lastStep == CIPStepN.TPM4_STEP_38 || lastStep == CIPStepN.TPM4_STEP_49
|| lastStep == CIPStepN.TPM4_STEP_94) {
if (programID == TPM4CIPType.LYE || programID == TPM4CIPType.LYE_ACID
|| programID == TPM4CIPType.ACID) {
cipResultID = CIPResults.CLEANED;
} else if (programID == TPM4CIPType.RINSE) {
cipResultID = CIPResults.RINSED;
} else if (programID == TPM4CIPType.STERILIZE) {
cipResultID = CIPResults.CLEANED_STERILIZED;
}
}
CIPResult cipResult = CIPReportUtil.getCIPResultByResultIDOfTPM4(cipResultID);
// Attention: Get TPM4 CIP Types
CIPType cipType = CIPReportUtil.getCIPTypeByProgramIDOfTPM4(programID);
if (cipType == null) {
if (log.isErrorEnabled())
log.error("[TPM4 CIP] Unable to find cip type for type id: " + programID + "\t"
+ ml.getCipMasterLineName() + "\t[" + cipEdgeLeadingTime + ":" + cipEdgeTrailingTime
+ "]");
// Error tolerant
cipType = new CIPType();
cipType.setCipTypePLCId(programID);
cipType.setCipTypeDesc("N/A");
}
HMIOperator operator = HMIOperatorUtil.getHMIOperatorByPLCId(0, PLCStructureTypes.TPM4);
CIPSlaveLine slaveLine = cipPhase.getCipSlaveLine();
CIPTarget cipTarget = cipPhase.getCipTarget();
// set the general information for cip report result
cipReportResult.setCipMasterLineId(ml.getId());
cipReportResult.setCipMasterLineName(ml.getCipMasterLineDesc());
cipReportResult.setCipSlaveLineId(slaveLine.getId());
cipReportResult.setCipSlaveLineName(slaveLine.getCipSlaveLineDesc());
cipReportResult.setCipStartDateTime(Tools.toDate(cipEdgeLeadingTime).getTime());
cipReportResult.setCipEndDateTime(Tools.toDate(cipEdgeTrailingTime).getTime());
cipReportResult.setCipLastTime(Tools.dateDiffMinutes(cipEdgeLeadingTime, cipEdgeTrailingTime)
.getHumanTime());
cipReportResult.setCipTargetDesc(cipTarget.getCipTargetDesc());
cipReportResult.setCipTargetName(cipTarget.getCipTargetName());
cipReportResult.setCipType(cipType.getCipTypeDesc());
cipReportResult.setCipTypePLCId(cipType.getCipTypePLCId());
cipReportResult.setCipResultPLCId(cipResultID);
cipReportResult.setCipResult(cipResult.getCipResultDesc());
cipReportResult.setCipOperatedByID(10L);
cipReportResult.setCipOperatedByName(operator.getOperatorName());
cipReportResult.setPlcStructureType(ml.getPlcStructureType());
cipReportResult.setWorkshopType(ml.getWorkshopType());
Set<Entry<String, Integer>> entrySet = cipSteps.entrySet();
if (programID == TPM4CIPType.LYE) {
String preRinseStartDateTime = null;
String preRinseEndDateTime = null;
String lyeCycleStartDateTime = null;
String lyeCycleEndDateTime = null;
String finalRinseStartDateTime = null;
String finalRinseEndDateTime = null;
for (Entry<String, Integer> each : entrySet) {
Integer stepN = each.getValue();
if (stepN.equals(CIPStepN.TPM4_STEP_5)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_5, cipEdgeLeadingTime, cipEdgeTrailingTime);
preRinseStartDateTime = tp.getStartDateTime();
preRinseEndDateTime = tp.getEndDateTime();
} else if (stepN.equals(CIPStepN.TPM4_STEP_10)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_10, cipEdgeLeadingTime, cipEdgeTrailingTime);
lyeCycleStartDateTime = tp.getStartDateTime();
lyeCycleEndDateTime = tp.getEndDateTime();
} else if (stepN.equals(CIPStepN.TPM4_STEP_29)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_29, cipEdgeLeadingTime, cipEdgeTrailingTime);
finalRinseStartDateTime = tp.getStartDateTime();
finalRinseEndDateTime = tp.getEndDateTime();
}
}
// pre rinse
setCIPPreRinse(ml, cipReportResult, preRinseStartDateTime, preRinseEndDateTime);
// lye cycle
setCIPLyeCycle(ml, cipReportResult, lyeCycleStartDateTime, lyeCycleEndDateTime);
// final rinse
setCIPFinalRinse(ml, cipReportResult, finalRinseStartDateTime, finalRinseEndDateTime);
} else if (programID == TPM4CIPType.ACID) {
String preRinseStartDateTime = null;
String preRinseEndDateTime = null;
String acidCycleStartDateTime = null;
String acidCycleEndDateTime = null;
String finalRinseStartDateTime = null;
String finalRinseEndDateTime = null;
for (Entry<String, Integer> each : entrySet) {
Integer stepN = each.getValue();
if (stepN.equals(CIPStepN.TPM4_STEP_5)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_5, cipEdgeLeadingTime, cipEdgeTrailingTime);
preRinseStartDateTime = tp.getStartDateTime();
preRinseEndDateTime = tp.getEndDateTime();
} else if (stepN.equals(CIPStepN.TPM4_STEP_20)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_20, cipEdgeLeadingTime, cipEdgeTrailingTime);
acidCycleStartDateTime = tp.getStartDateTime();
acidCycleEndDateTime = tp.getEndDateTime();
} else if (stepN.equals(CIPStepN.TPM4_STEP_29)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_29, cipEdgeLeadingTime, cipEdgeTrailingTime);
finalRinseStartDateTime = tp.getStartDateTime();
finalRinseEndDateTime = tp.getEndDateTime();
}
}
// pre rinse
setCIPPreRinse(ml, cipReportResult, preRinseStartDateTime, preRinseEndDateTime);
// acid cycle
setCIPAcidCycle(ml, cipReportResult, acidCycleStartDateTime, acidCycleEndDateTime);
// final rinse
setCIPFinalRinse(ml, cipReportResult, finalRinseStartDateTime, finalRinseEndDateTime);
} else if (programID == TPM4CIPType.LYE_ACID) {
String preRinseStartDateTime = null;
String preRinseEndDateTime = null;
String lyeCycleStartDateTime = null;
String lyeCycleEndDateTime = null;
String interRinseStartDateTime = null;
String interRinseEndDateTime = null;
String acidCycleStartDateTime = null;
String acidCycleEndDateTime = null;
String finalRinseStartDateTime = null;
String finalRinseEndDateTime = null;
for (Entry<String, Integer> each : entrySet) {
Integer stepN = each.getValue();
if (stepN.equals(CIPStepN.TPM4_STEP_5)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_5, cipEdgeLeadingTime, cipEdgeTrailingTime);
preRinseStartDateTime = tp.getStartDateTime();
preRinseEndDateTime = tp.getEndDateTime();
} else if (stepN.equals(CIPStepN.TPM4_STEP_10)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_10, cipEdgeLeadingTime, cipEdgeTrailingTime);
lyeCycleStartDateTime = tp.getStartDateTime();
lyeCycleEndDateTime = tp.getEndDateTime();
} else if (stepN.equals(CIPStepN.TPM4_STEP_15)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_15, cipEdgeLeadingTime, cipEdgeTrailingTime);
interRinseStartDateTime = tp.getStartDateTime();
interRinseEndDateTime = tp.getEndDateTime();
} else if (stepN.equals(CIPStepN.TPM4_STEP_20)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_20, cipEdgeLeadingTime, cipEdgeTrailingTime);
acidCycleStartDateTime = tp.getStartDateTime();
acidCycleEndDateTime = tp.getEndDateTime();
} else if (stepN.equals(CIPStepN.TPM4_STEP_29)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_29, cipEdgeLeadingTime, cipEdgeTrailingTime);
finalRinseStartDateTime = tp.getStartDateTime();
finalRinseEndDateTime = tp.getEndDateTime();
}
}
// pre rinse
setCIPPreRinse(ml, cipReportResult, preRinseStartDateTime, preRinseEndDateTime);
// lye cycle
setCIPLyeCycle(ml, cipReportResult, lyeCycleStartDateTime, lyeCycleEndDateTime);
// inter rinse
setCIPInterRinse(ml, cipReportResult, interRinseStartDateTime, interRinseEndDateTime);
// acid cycle
setCIPAcidCycle(ml, cipReportResult, acidCycleStartDateTime, acidCycleEndDateTime);
// final rinse
setCIPFinalRinse(ml, cipReportResult, finalRinseStartDateTime, finalRinseEndDateTime);
} else if (programID == TPM4CIPType.RINSE) {
String finalRinseStartDateTime = null;
String finalRinseEndDateTime = null;
for (Entry<String, Integer> each : entrySet) {
Integer stepN = each.getValue();
if (stepN.equals(CIPStepN.TPM4_STEP_32)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_32, cipEdgeLeadingTime, cipEdgeTrailingTime);
finalRinseStartDateTime = tp.getStartDateTime();
finalRinseEndDateTime = tp.getEndDateTime();
}
}
setCIPFinalRinse(ml, cipReportResult, finalRinseStartDateTime, finalRinseEndDateTime);
} else if (programID == TPM4CIPType.STERILIZE) {
String sterStartDateTime = null;
String sterEndDateTime = null;
for (Entry<String, Integer> each : entrySet) {
Integer stepN = each.getValue();
if (stepN.equals(CIPStepN.TPM4_STEP_35)) {
TimePeriod tp = InSQLDaoUtil.getTimePeriodOfTagValue(ml.getCipMasterLineStepsTag(),
CIPStepN.TPM4_STEP_35, cipEdgeLeadingTime, cipEdgeTrailingTime);
sterStartDateTime = tp.getStartDateTime();
sterEndDateTime = tp.getEndDateTime();
}
}
setCIPSterilize(ml, cipReportResult, sterStartDateTime, sterEndDateTime);
}
// get the last time operation
CIPReportResult lastCIPReportResult = CIPReportUtil.getLastCIPOperation(cipTarget.getCipTargetName());
if (lastCIPReportResult != null) {
Date lastCIPOperationEndTime = lastCIPReportResult.getCipEndDateTime();
cipReportResult.setTimeSinceLastOperation(Tools.dateDiffMinutes(lastCIPOperationEndTime,
cipReportResult.getCipEndDateTime()).getHumanTime());
}
// save cip result to database
CIPReportUtil.saveCIPReportResult(cipReportResult);
// compare the cip end time with the cipendtime
if (cipEdgeTrailingTime.compareTo(latestCIPEndTime) >= 0) {
latestCIPEndTime = cipEdgeTrailingTime;
}
// save or update cip end time
if (!latestCIPEndTime.isEmpty()) {
point.setCipLatestAnalyseDateTime(latestCIPEndTime);
CommonDao.update(point);
}
}
}
}
} | [
"[email protected]"
] | |
2e26d7fee3d25b3270fae845b70abadc6573b815 | 627eebf240f38c07ef6e3ee7bc33378bfe64d86a | /StickHeaderLayout/app/src/main/java/com/stickheaderlayout/simple/RecyclerViewSimpleActivity.java | 48ebd8b53e62e6caa911cdf0f03b3b80edca18cb | [
"Apache-2.0"
] | permissive | chenchengyin/StickHeaderLayout | b0d5495327c1ace2fa5f9081bf33be9af84e4e47 | 83de5943ce78bde58ab994faf2154ef2b0d249e7 | refs/heads/master | 2021-05-30T03:34:52.551548 | 2015-11-30T07:36:54 | 2015-11-30T07:36:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,040 | java | package com.stickheaderlayout.simple;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.stickheaderlayout.RecyclerWithHeaderAdapter;
import java.util.ArrayList;
import java.util.List;
public class RecyclerViewSimpleActivity extends AppCompatActivity {
public static void openActivity(Activity activity){
activity.startActivity(new Intent(activity,RecyclerViewSimpleActivity.class));
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recyclerview);
RecyclerView v_scroll = (RecyclerView)findViewById(R.id.v_scroll);
LinearLayoutManager mLayoutMgr = new LinearLayoutManager(this);
v_scroll.setLayoutManager(mLayoutMgr);
RecyclerAdapter recyclerAdapter = new RecyclerAdapter();
recyclerAdapter.addItems(createItemList());
v_scroll.setAdapter(recyclerAdapter);
}
private List<String> createItemList() {
List<String> list = new ArrayList<>();
for(int i = 0 ; i < 100 ; i++){
list.add("" + i);
}
return list;
}
public class RecyclerAdapter extends RecyclerWithHeaderAdapter {
private List<String> mItemList;
public RecyclerAdapter() {
super();
mItemList = new ArrayList<>();
}
public void addItems(List<String> list) {
mItemList.addAll(list);
}
@Override
public RecyclerView.ViewHolder oncreateViewHolder(ViewGroup viewGroup, int viewType) {
Context context = viewGroup.getContext();
View view;
view = LayoutInflater.from(context).inflate(R.layout.item_recyclerview, viewGroup, false);
return new RecyclerItemViewHolder(view);
}
@Override
public void onbindViewHolder(RecyclerView.ViewHolder holder, int position) {
RecyclerItemViewHolder viewHolder = (RecyclerItemViewHolder) holder;
viewHolder.tvTitle.setText(mItemList.get(position - 1));
}
@Override
public int getitemCount() {
return mItemList == null ? 0 : mItemList.size();
}
private class RecyclerItemViewHolder extends RecyclerView.ViewHolder {
private final TextView tvTitle;
private final ImageView ivIcon;
public RecyclerItemViewHolder(View itemView) {
super(itemView);
tvTitle = (TextView) itemView.findViewById(R.id.tv_title);
ivIcon = (ImageView) itemView.findViewById(R.id.iv_icon);
}
}
}
}
| [
"[email protected]"
] | |
fee30667b7b00a09ab088b3e97bca444d25b489a | baf18fbf9ad3fbc94fc7e7aa22c1daec5dce57ce | /ProyectoTDP/src/Engine/IUpdatable.java | 58c8015dff78f2ddf4987b4c2d99fa1d869681d6 | [] | no_license | Nicolas-Guasch/Proyecto-TDP | 9dc37086538f8f7b96cd2cad2981b0176a858439 | 0e2e0bc65790cf9a8c615163bcd0f3c84bcd3327 | refs/heads/master | 2020-03-26T09:52:51.608125 | 2018-11-30T01:31:33 | 2018-11-30T01:31:33 | 144,770,001 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69 | java | package Engine;
public interface IUpdatable {
void update();
}
| [
"wallywest"
] | wallywest |
6c1f6c1a240478ac5a1bd2b59a9708b83afa4c8b | 363a26167be723be18b6aee917e5996a18a1fe1d | /backend/src/main/java/de/neuefische/saildog/service/RouteService.java | 8b55d3b3861999130f82830a8a02da3965d85a86 | [] | no_license | LennartSchwier/saildog | f00e3de090b8984bfad89d5571d5f0c7fd71a598 | f384be6d70bf981e2e9d36f18904b4b03b10155b | refs/heads/main | 2023-02-01T03:17:55.359021 | 2020-12-14T16:36:13 | 2020-12-14T16:36:13 | 311,796,641 | 1 | 0 | null | 2020-12-14T16:36:14 | 2020-11-10T22:09:42 | Java | UTF-8 | Java | false | false | 2,980 | java | package de.neuefische.saildog.service;
import de.neuefische.saildog.dao.RouteDao;
import de.neuefische.saildog.dto.LegDto;
import de.neuefische.saildog.dto.RouteDto;
import de.neuefische.saildog.enums.TypeOfWaypoint;
import de.neuefische.saildog.model.Leg;
import de.neuefische.saildog.model.Route;
import de.neuefische.saildog.model.Waypoint;
import de.neuefische.saildog.utils.RouteUtils;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.web.server.ResponseStatusException;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class RouteService {
private final RouteDao routeDao;
private final RouteUtils routeUtils;
public RouteService(RouteDao routeDao, RouteUtils routeUtils) {
this.routeDao = routeDao;
this.routeUtils = routeUtils;
}
public List<Route> getRoutesByCreator(String creator) {
return routeDao.findAllByCreator(creator);
}
public Route addNewRoute(RouteDto routeToAdd, String creator) {
Route newRoute = Route.builder()
.routeId(routeUtils.createRandomId())
.routeName(routeToAdd.getRouteName())
.creator(creator)
.legs(createRouting(routeToAdd))
.totalDistance(calculateTotalDistance(routeToAdd))
.build();
routeDao.save(newRoute);
return newRoute;
}
public List<Leg> createRouting(RouteDto routeToCreate) {
return routeToCreate.getLegs().stream()
.map(this::createLeg)
.collect(Collectors.toList());
}
public double calculateTotalDistance(RouteDto totalRoute) {
double totalDistance = createRouting(totalRoute).stream()
.map(Leg::getDistance)
.reduce(0.00, Double::sum);
return Math.round(totalDistance * 100.0) / 100.0;
}
public Leg createLeg(LegDto legToCreate) {
Waypoint startWaypoint = new Waypoint(TypeOfWaypoint.START, legToCreate.getStartLatitude(), legToCreate.getStartLongitude());
Waypoint endWaypoint = new Waypoint(TypeOfWaypoint.END, legToCreate.getEndLatitude(), legToCreate.getEndLongitude());
return Leg.builder()
.legId(routeUtils.createRandomId())
.startWaypoint(startWaypoint)
.endWaypoint(endWaypoint)
.distance(routeUtils.calculateDistance(startWaypoint, endWaypoint))
.bearing(routeUtils.calculateBearing(startWaypoint, endWaypoint))
.build();
}
public void deleteRoute(String routeId, String creator) {
Route routeToDelete = routeDao.findById(routeId).orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND));
if (!routeToDelete.getCreator().equals(creator)) {
throw new ResponseStatusException(HttpStatus.FORBIDDEN);
}
routeDao.deleteById(routeId);
}
}
| [
"[email protected]"
] | |
64e67c28c54adfd988f96eaabb5d7cd3f5340d76 | b7136c0502eed5038c546af8fc24f503172dabe6 | /Ch21 Generic Queue/src/DD_QueueExceptions.java | 6eb4aef4dfbcfe646e3e94838bcb278544e2d520 | [] | no_license | dolnuea/Generic-Queue | 0684d0b8226ad4bbb48a47f513146615cdf2c9d9 | a65a8b07dc03dd2691df32977e55b985107f5c95 | refs/heads/master | 2022-12-03T20:47:46.819800 | 2020-08-20T10:19:48 | 2020-08-20T10:19:48 | 288,974,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 380 | java | /**
* @author Dolunay Dagci
* Assignment: CH21 Generic Queue
* Due: 05/05/2019
* Extra classes, copied from the book source code, to use for appropiate exception names. These two classes represent exceptions
thrown by the queue methods.
*/
class DD_QueueOverFlowException extends RuntimeException
{
}
class DD_EmptyQueueException extends RuntimeException
{
} | [
"[email protected]"
] | |
7e0d5af77de0474ccd6b2363ed71718c12183c51 | 3a15c4070a3c9774b3a2ccca818bceb41047429c | /src/com/sist/Ex07.java | 8d7c192bbe5c5bcfeeffae211c01890d76f8c077 | [] | no_license | Seo-Baek/SsYJavaOperator | 00f09dbf2a45a09bfdca3eb806b5436c60c76f20 | cdedd6f85bf500066e0716fd23cd7ed2fb52dceb | refs/heads/master | 2020-10-01T13:21:54.594361 | 2019-12-13T06:46:22 | 2019-12-13T06:46:22 | 227,546,043 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package com.sist;
/*
* 7. 쉬프트(shift) 연산자
* - 비트열을 대상으로 왼쪽/오른쪽으로 비트를 밀어서 연산을 수행하는 연산자.
* - 왼쪽 쉬프트(<<) : 곱하기의 의미.
* - 오른쪽 쉬프트(>>) : 나누기의 의미.
*/
public class Ex07 {
public static void main(String[] args) {
int num1 = 10, num2 = 5;
System.out.println(num2 << 3);
System.out.println(num2 >> 1);
}
}
| [
"sist87@DESKTOP-SPLIGP1"
] | sist87@DESKTOP-SPLIGP1 |
ee090459e4c074154b8c3f4219a70a79b431b20f | 00f9bfc3bda11e828dfee5796c811a36f3ccd617 | /7.0.0-alpha03/com.android.tools.build/gradle/com/android/build/gradle/internal/plugins/DynamicFeaturePlugin.java | f781d87e72fc1bbee29cb93e4fe156e2ac5361e5 | [
"Apache-2.0"
] | permissive | NirvanaNimbusa/agp-sources | c2fa758f27a628121c60a770ff046c1860cd4177 | 2b16dd9e08744d6e4f011fa5d0c550530c6a2c0e | refs/heads/master | 2023-02-17T22:11:45.787321 | 2021-01-19T22:06:09 | 2021-01-19T22:10:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,166 | java | /*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.build.gradle.internal.plugins;
import com.android.AndroidProjectTypes;
import com.android.annotations.NonNull;
import com.android.build.api.component.impl.TestComponentBuilderImpl;
import com.android.build.api.component.impl.TestComponentImpl;
import com.android.build.api.extension.DynamicFeatureAndroidComponentsExtension;
import com.android.build.api.extension.impl.DynamicFeatureAndroidComponentsExtensionImpl;
import com.android.build.api.extension.impl.VariantApiOperationsRegistrar;
import com.android.build.api.variant.impl.DynamicFeatureVariantBuilderImpl;
import com.android.build.api.variant.impl.DynamicFeatureVariantImpl;
import com.android.build.gradle.BaseExtension;
import com.android.build.gradle.api.BaseVariantOutput;
import com.android.build.gradle.internal.ExtraModelInfo;
import com.android.build.gradle.internal.dsl.BuildType;
import com.android.build.gradle.internal.dsl.DefaultConfig;
import com.android.build.gradle.internal.dsl.DynamicFeatureExtension;
import com.android.build.gradle.internal.dsl.DynamicFeatureExtensionImpl;
import com.android.build.gradle.internal.dsl.ProductFlavor;
import com.android.build.gradle.internal.dsl.SigningConfig;
import com.android.build.gradle.internal.scope.GlobalScope;
import com.android.build.gradle.internal.services.DslServices;
import com.android.build.gradle.internal.services.ProjectServices;
import com.android.build.gradle.internal.tasks.DynamicFeatureTaskManager;
import com.android.build.gradle.internal.variant.ComponentInfo;
import com.android.build.gradle.internal.variant.DynamicFeatureVariantFactory;
import com.android.build.gradle.options.BooleanOption;
import com.android.builder.model.v2.ide.ProjectType;
import com.google.wireless.android.sdk.stats.GradleBuildProject;
import java.util.List;
import javax.inject.Inject;
import org.gradle.api.NamedDomainObjectContainer;
import org.gradle.api.Project;
import org.gradle.api.component.SoftwareComponentFactory;
import org.gradle.build.event.BuildEventsListenerRegistry;
import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry;
/** Gradle plugin class for 'application' projects, applied on an optional APK module */
public class DynamicFeaturePlugin
extends AbstractAppPlugin<
DynamicFeatureAndroidComponentsExtension,
DynamicFeatureVariantBuilderImpl,
DynamicFeatureVariantImpl> {
@Inject
public DynamicFeaturePlugin(
ToolingModelBuilderRegistry registry,
SoftwareComponentFactory componentFactory,
BuildEventsListenerRegistry listenerRegistry) {
super(registry, componentFactory, listenerRegistry);
}
@Override
protected int getProjectType() {
return AndroidProjectTypes.PROJECT_TYPE_DYNAMIC_FEATURE;
}
@Override
protected ProjectType getProjectTypeV2() {
return ProjectType.DYNAMIC_FEATURE;
}
@NonNull
@Override
protected GradleBuildProject.PluginType getAnalyticsPluginType() {
return GradleBuildProject.PluginType.DYNAMIC_FEATURE;
}
@Override
protected void pluginSpecificApply(@NonNull Project project) {
// do nothing
}
@NonNull
@Override
protected BaseExtension createExtension(
@NonNull DslServices dslServices,
@NonNull GlobalScope globalScope,
@NonNull
DslContainerProvider<DefaultConfig, BuildType, ProductFlavor, SigningConfig>
dslContainers,
@NonNull NamedDomainObjectContainer<BaseVariantOutput> buildOutputs,
@NonNull ExtraModelInfo extraModelInfo) {
if (globalScope.getProjectOptions().get(BooleanOption.USE_NEW_DSL_INTERFACES)) {
return (BaseExtension)
project.getExtensions()
.create(
com.android.build.api.dsl.DynamicFeatureExtension.class,
"android",
DynamicFeatureExtension.class,
dslServices,
globalScope,
buildOutputs,
dslContainers.getSourceSetManager(),
extraModelInfo,
new DynamicFeatureExtensionImpl(dslServices, dslContainers));
}
return project.getExtensions()
.create(
"android",
DynamicFeatureExtension.class,
dslServices,
globalScope,
buildOutputs,
dslContainers.getSourceSetManager(),
extraModelInfo,
new DynamicFeatureExtensionImpl(dslServices, dslContainers));
}
@NonNull
@Override
protected DynamicFeatureAndroidComponentsExtension createComponentExtension(
@NonNull DslServices dslServices,
@NonNull
VariantApiOperationsRegistrar<
DynamicFeatureVariantBuilderImpl, DynamicFeatureVariantImpl>
variantApiOperationsRegistrar) {
return project.getExtensions()
.create(
DynamicFeatureAndroidComponentsExtension.class,
"androidComponents",
DynamicFeatureAndroidComponentsExtensionImpl.class,
dslServices,
variantApiOperationsRegistrar);
}
@NonNull
@Override
protected DynamicFeatureTaskManager createTaskManager(
@NonNull
List<ComponentInfo<DynamicFeatureVariantBuilderImpl, DynamicFeatureVariantImpl>>
variants,
@NonNull
List<ComponentInfo<TestComponentBuilderImpl, TestComponentImpl>> testComponents,
boolean hasFlavors,
@NonNull GlobalScope globalScope,
@NonNull BaseExtension extension) {
return new DynamicFeatureTaskManager(
variants, testComponents, hasFlavors, globalScope, extension);
}
@NonNull
@Override
protected DynamicFeatureVariantFactory createVariantFactory(
@NonNull ProjectServices projectServices, @NonNull GlobalScope globalScope) {
return new DynamicFeatureVariantFactory(projectServices, globalScope);
}
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.