blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
listlengths 1
1
| author
stringlengths 0
161
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e280bf1306c3c889ab8b60bf8c544983d12cc07d | aad5ce4aceeec5848825346f49637cd741998f84 | /AuthenticationDemo/redis/AuthenticationDemo/src/main/java/com/wangyb/learningdemo/authentication/controller/request/UserEditReq.java | 3aa46c458aa035d824ffa9a1abcb66db22962321 | [] | no_license | 0415wangyibo/learningDemo | 9445324f41173bcd4cdf12f28e62f9cb1673b949 | 40ef0a580677322bca1bec0d6c0547d0dac1bb1b | refs/heads/master | 2022-12-21T19:55:53.733482 | 2019-12-21T07:55:36 | 2019-12-21T07:55:36 | 145,055,185 | 2 | 1 | null | 2022-12-06T00:33:36 | 2018-08-17T01:10:04 | TSQL | UTF-8 | Java | false | false | 871 | java | package com.wangyb.learningdemo.authentication.controller.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Created with Intellij IDEA.
*
* @author wangyb
* @Date 2018/9/25 14:03
* Modified By:
* Description:用于接收编辑后台用户的参数
*/
@Data
public class UserEditReq {
@ApiModelProperty(value = "用户id",required = true)
private Integer userId;
@ApiModelProperty(value = "用户名",required = true)
private String userName;
@ApiModelProperty(value = "角色Id",required = true)
private Integer roleId;
@ApiModelProperty(value = "邮箱")
private String email;
public UserEditReq(Integer userId, String userName, Integer roleId, String email) {
this.userId = userId;
this.userName = userName;
this.roleId = roleId;
this.email = email;
}
}
| [
"[email protected]"
] | |
5ad46224a2aec6f6c7eef446cd9aad204abac3e1 | 11410afbac84ce0be61ad0f94f5997bcfa34dc8e | /src/main/java/it/at/cms/controller/SinglePageApplicationController.java | 53282dfdaf007d86126119ab6f2642b35b510ca4 | [] | no_license | purusha/cms | 7db8a2a90694d300d31a4c5191be684581b00222 | ce83bbd1b13b45c906cb32b284edc1b88fc94079 | refs/heads/master | 2023-04-16T09:00:08.325092 | 2020-05-19T07:04:52 | 2020-05-19T07:04:52 | 261,810,140 | 0 | 0 | null | 2021-04-26T20:16:15 | 2020-05-06T16:00:56 | CSS | UTF-8 | Java | false | false | 1,875 | java | package it.at.cms.controller;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import it.at.cms.repo.Asset;
import it.at.cms.repo.AssetRepository;
import it.at.cms.repo.Blueprint;
import it.at.cms.repo.BlueprintRepository;
@Controller
public class SinglePageApplicationController {
private final BlueprintRepository blueRepository;
private final AssetRepository assetRepository;
@Autowired
public SinglePageApplicationController(BlueprintRepository blueRepository, AssetRepository assetRepository) {
this.blueRepository = blueRepository;
this.assetRepository = assetRepository;
}
@GetMapping("/")
public String showHome(Model model) {
model.addAttribute("blueprints", blueRepository.findAll());
return "home";
}
@GetMapping("/draw")
public String draw(Model model) {
return "draw";
}
@GetMapping("/asset/{id}")
public String showBlueprint(@PathVariable("id") String id, Model model) {
final Optional<Blueprint> blueprint = blueRepository.findById(id);
blueprint.ifPresent(b -> {
model.addAttribute("blueprint", b);
model.addAttribute("assets", assetRepository.findAllByBlueprint(b));
});
return "asset";
}
@PostMapping("/asset/{id}")
public String showBlueprint(@PathVariable("id") String id, @RequestBody Asset asset) {
final Optional<Blueprint> blueprint = blueRepository.findById(id);
blueprint.ifPresent(b -> {
assetRepository.createToBlueprint(b, asset);
});
return "redirect:/asset/ + id";
}
}
| [
"[email protected]"
] | |
d718b5b6be1dcfd741924c1c25e3b871476afa66 | 5db41e65e28d2b082875a64a6cf71af1620ea909 | /a5-noebrown/src/a5/ShrimpPortion.java | 8d4be070fbfdc1cfb04f4baa6459e2db5ee53c5f | [] | no_license | noebrown/COMP401 | 5bbed77fae60daffb383a32dcc2223d0e938f71c | c3d93ad4ba797fd217a1aca08ee3a935028431ce | refs/heads/master | 2022-12-17T16:38:22.503199 | 2020-09-22T22:33:39 | 2020-09-22T22:33:39 | 297,787,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 148 | java | package a5;
public class ShrimpPortion extends IngredientPortionImpl{
public ShrimpPortion(double amount) {
super(new Shrimp(), amount);
}
}
| [
"[email protected]"
] | |
83131748a59b7c2944f5f18cfb0136234b46c05a | ade1ac2d2c1e409c7b6c81c9f73945dce2f13481 | /src/main/java/com/xxkm/management/office/materials/entity/Materials.java | a73b373d1b0bcc7e2f4a17a31c69ccced2759dae | [
"MIT"
] | permissive | gitofwyx/xxkm_management | e318003921b643a6da2b1068aef26d1c5a3a9a08 | 9182434c500660107840e297125fda861afa91d8 | refs/heads/master | 2023-06-23T06:30:03.596017 | 2021-07-22T08:07:48 | 2021-07-22T08:07:48 | 383,026,998 | 0 | 0 | null | 2021-07-05T06:09:34 | 2021-07-05T05:45:34 | Java | UTF-8 | Java | false | false | 2,390 | java | package com.xxkm.management.office.materials.entity;
import com.xxkm.core.entity.BaseInfoEntity;
/**
* Created by Administrator on 2017/3/15.
*/
public class Materials extends BaseInfoEntity {
private String id;
private String material_id;
private String material_ident;
private String office_id;
private String material_name;
private String mediaOfLANId;
private String related_flag;
private String related_id;
private String material_flag;
private String remark;
private String keyWord;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getMaterial_id() {
return material_id;
}
public void setMaterial_id(String material_id) {
this.material_id = material_id;
}
public String getMaterial_ident() {
return material_ident;
}
public void setMaterial_ident(String material_ident) {
this.material_ident = material_ident;
}
public String getOffice_id() {
return office_id;
}
public void setOffice_id(String office_id) {
this.office_id = office_id;
}
public String getMaterial_name() {
return material_name;
}
public void setMaterial_name(String material_name) {
this.material_name = material_name;
}
public String getMediaOfLANId() {
return mediaOfLANId;
}
public void setMediaOfLANId(String mediaOfLANId) {
this.mediaOfLANId = mediaOfLANId;
}
public String getRelated_flag() {
return related_flag;
}
public void setRelated_flag(String related_flag) {
this.related_flag = related_flag;
}
public String getRelated_id() {
return related_id;
}
public void setRelated_id(String related_id) {
this.related_id = related_id;
}
public String getMaterial_flag() {
return material_flag;
}
public void setMaterial_flag(String material_flag) {
this.material_flag = material_flag;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getKeyWord() {
return keyWord;
}
public void setKeyWord(String keyWord) {
this.keyWord = keyWord;
}
}
| [
"[email protected]"
] | |
94b93621e76beb8fe994410c98afe36d2ba0106d | 0a97b83f01e751291e911d9a5cec50854b2014e7 | /chapter5/tree/src/test/java/ru/job4j/package-info.java | 1fa2196e1a50d74c48e5fa40789ba57525629425 | [] | no_license | Error4ik/java-a-to-z | a10a7a3104ae8ebf159e4234bd76785fcf24b575 | 21a3f0938ca3899d7ea50af6ccabcac420eaf26e | refs/heads/master | 2022-10-06T15:45:22.983278 | 2022-03-25T20:28:12 | 2022-03-25T20:28:12 | 75,481,679 | 5 | 2 | null | 2022-09-22T17:36:08 | 2016-12-03T15:23:42 | Java | UTF-8 | Java | false | false | 74 | java | /**
* @author Alexey Voronin.
* @since 24.03.2017.
*/
package ru.job4j; | [
"[email protected]"
] | |
17a9ef6f5505af46addce12e3c357ce19ae89bd4 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_266/Testnull_26504.java | bc3e98b2721c808626bbee181860b56407755e7a | [] | 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_266;
import static org.junit.Assert.*;
public class Testnull_26504 {
private final Productionnull_26504 production = new Productionnull_26504("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"[email protected]"
] | |
4a4cab1e379469c745c678629d2af320caf54a3f | fe77d687e0a3db75acc5983d10d1783c5cd1a0c5 | /studyspring/src/main/java/com/jacen/study/v3/sample/aop/MyBeforeAdvice.java | 25d2fe8f184f13f00baa27e28cafa8a7165b92db | [] | no_license | JacenWang/springframework | 3e455f7728cfecc1d84b0fff1a2093af41fd5846 | 45c74d401fd554b0f492915f38caa58b2d81c784 | refs/heads/master | 2023-08-10T07:53:06.258825 | 2021-09-13T08:03:09 | 2021-09-13T08:03:09 | 405,378,923 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package com.jacen.study.v3.sample.aop;
import com.jacen.study.v3.aop.advice.MethodBeforeAdvice;
import java.lang.reflect.Method;
public class MyBeforeAdvice implements MethodBeforeAdvice {
@Override
public void before(Method method, Object[] args, Object target){
System.out.println(this + " 对 " + target + " 进行了前置增强!");
}
}
| [
"[email protected]"
] | |
cdafcc235b1ad777fada3be1a64483c22a9effbf | 1245fd639b3c35772ce1dbccb89ee1b86038133b | /app/facedetection/src/main/java/com/faisal/facedetection/util/googlevision/GraphicFaceTracker.java | ab9be6457b18a299d3fce66a7d67f49cd4081a76 | [] | no_license | resilientbd/facedetection | b71b8b309be37332573ad1ae077b9205fcb65653 | 4964905b0ac01bff5e5379e48be705ff35b7e9fe | refs/heads/master | 2023-06-25T02:46:51.709545 | 2021-07-25T18:41:11 | 2021-07-25T18:41:11 | 389,311,756 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,866 | java | package com.faisal.facedetection.util.googlevision;
import android.content.Context;
import com.google.android.gms.vision.Tracker;
import com.google.android.gms.vision.face.Face;
import com.google.android.gms.vision.face.FaceDetector;
class GraphicFaceTracker extends Tracker<Face> {
private GraphicOverlay mOverlay;
private FaceGraphic mFaceGraphic;
private FaceGraphic.FaceDataUpdater faceDataUpdater;
GraphicFaceTracker(GraphicOverlay overlay, FaceGraphic.FaceDataUpdater faceDataUpdater, FaceDetectListener faceDetectListener, Context context) {
mOverlay = overlay;
mFaceGraphic = new FaceGraphic(overlay,faceDetectListener,context);
this.faceDataUpdater = faceDataUpdater;
}
/**
* Start tracking the detected face instance within the face overlay.
*/
@Override
public void onNewItem(int faceId, Face item) {
mFaceGraphic.setId(faceId);
}
/**
* Update the position/characteristics of the face within the overlay.
*/
@Override
public void onUpdate(FaceDetector.Detections<Face> detectionResults, Face face) {
mOverlay.add(mFaceGraphic);
mFaceGraphic.updateFace(face);
if(faceDataUpdater!=null)
{
faceDataUpdater.onTrackFaceData(face);
}
}
/**
* Hide the graphic when the corresponding face was not detected. This can happen for
* intermediate frames temporarily (e.g., if the face was momentarily blocked from
* view).
*/
@Override
public void onMissing(FaceDetector.Detections<Face> detectionResults) {
mOverlay.remove(mFaceGraphic);
}
/**
* Called when the face is assumed to be gone for good. Remove the graphic annotation from
* the overlay.
*/
@Override
public void onDone() {
mOverlay.remove(mFaceGraphic);
}
}
| [
"[email protected]"
] | |
77e560aca57da08573e7d89607399f32c2ef8f26 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2016/8/MyUnmanagedExtension.java | e54d6b6e38687630f654b7c547f37413a305c1cd | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 1,076 | java | /*
* Licensed to Neo Technology under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Neo Technology licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.neo4j.harness.extensionpackage;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
@Path("/myExtension")
public class MyUnmanagedExtension
{
@GET
public Response doSomething()
{
return Response.status(234).build();
}
}
| [
"[email protected]"
] | |
ae4a47b7369e5e46542ebe0cbde61da2ae320609 | 26b7f30c6640b8017a06786e4a2414ad8a4d71dd | /src/number_of_direct_superinterfaces/i19710.java | 6cb73974844d02f158e4d320bfdd236b49809c92 | [] | no_license | vincentclee/jvm-limits | b72a2f2dcc18caa458f1e77924221d585f23316b | 2fd1c26d1f7984ea8163bc103ad14b6d72282281 | refs/heads/master | 2020-05-18T11:18:41.711400 | 2014-09-14T04:25:18 | 2014-09-14T04:25:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 69 | java | package number_of_direct_superinterfaces;
public interface i19710 {} | [
"[email protected]"
] | |
8e4b2905118c9eaeb60bc40e56a0cab7839fd459 | 1b599e3a9adee5dd8af011fdf82972824562a872 | /sa_center/sacenter-parent/sacenter-shcmcc/src/main/java/com/asiainfo/sacenter/shcmcc/receive/cboss/bean/iot/ecsyn/req/CustomerInfo.java | a50eaca2ee676033857944d8b5812f5e2e39e570 | [] | no_license | mtbdc-dy/zhongds01 | e1381d44b0562d576cfdff6b7a5fb7297990a2a4 | ceb5e90d468add16d982f3eb10d5503a7a5c1cea | refs/heads/master | 2020-07-07T10:30:32.012016 | 2019-08-07T08:18:08 | 2019-08-07T08:18:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,224 | java | /*
* This class was automatically generated with
* <a href="http://www.castor.org">Castor 1.0.1</a>, using an XML
* Schema.
* $Id$
*/
package com.asiainfo.sacenter.shcmcc.receive.cboss.bean.iot.ecsyn.req;
//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/
import java.util.Vector;
/**
* Class CustomerInfo.
*
* @version $Revision$ $Date$
*/
public class CustomerInfo implements java.io.Serializable {
//--------------------------/
//- Class/Member Variables -/
//--------------------------/
/**
* Field _oprSeq
*/
private java.lang.String _oprSeq;
/**
* Field _oprTime
*/
private java.lang.String _oprTime;
/**
* Field _oprCode
*/
private java.lang.String _oprCode;
/**
* Field _parentCustomerNumber
*/
private java.lang.String _parentCustomerNumber;
/**
* Field _customer
*/
private Customer _customer;
/**
* Field _customerManager
*/
private CustomerManager _customerManager;
/**
* Field _keyPersonsList
*/
private java.util.Vector _keyPersonsList;
/**
* Field _extInfoList
*/
private java.util.Vector _extInfoList;
//----------------/
//- Constructors -/
//----------------/
public CustomerInfo()
{
super();
_keyPersonsList = new Vector();
_extInfoList = new Vector();
} //-- CustomerInfo()
//-----------/
//- Methods -/
//-----------/
/**
* Method addExtInfo
*
*
*
* @param vExtInfo
*/
public void addExtInfo(ExtInfo vExtInfo)
throws java.lang.IndexOutOfBoundsException
{
_extInfoList.addElement(vExtInfo);
} //-- void addExtInfo(ExtInfo)
/**
* Method addExtInfo
*
*
*
* @param index
* @param vExtInfo
*/
public void addExtInfo(int index, ExtInfo vExtInfo)
throws java.lang.IndexOutOfBoundsException
{
_extInfoList.insertElementAt(vExtInfo, index);
} //-- void addExtInfo(int, ExtInfo)
/**
* Method addKeyPersons
*
*
*
* @param vKeyPersons
*/
public void addKeyPersons(KeyPersons vKeyPersons)
throws java.lang.IndexOutOfBoundsException
{
_keyPersonsList.addElement(vKeyPersons);
} //-- void addKeyPersons(KeyPersons)
/**
* Method addKeyPersons
*
*
*
* @param index
* @param vKeyPersons
*/
public void addKeyPersons(int index, KeyPersons vKeyPersons)
throws java.lang.IndexOutOfBoundsException
{
_keyPersonsList.insertElementAt(vKeyPersons, index);
} //-- void addKeyPersons(int, KeyPersons)
/**
* Method enumerateExtInfo
*
*
*
* @return Enumeration
*/
public java.util.Enumeration enumerateExtInfo()
{
return _extInfoList.elements();
} //-- java.util.Enumeration enumerateExtInfo()
/**
* Method enumerateKeyPersons
*
*
*
* @return Enumeration
*/
public java.util.Enumeration enumerateKeyPersons()
{
return _keyPersonsList.elements();
} //-- java.util.Enumeration enumerateKeyPersons()
/**
* Returns the value of field 'customer'.
*
* @return Customer
* @return the value of field 'customer'.
*/
public Customer getCustomer()
{
return this._customer;
} //-- Customer getCustomer()
/**
* Returns the value of field 'customerManager'.
*
* @return CustomerManager
* @return the value of field 'customerManager'.
*/
public CustomerManager getCustomerManager()
{
return this._customerManager;
} //-- CustomerManager getCustomerManager()
/**
* Method getExtInfo
*
*
*
* @param index
* @return ExtInfo
*/
public ExtInfo getExtInfo(int index)
throws java.lang.IndexOutOfBoundsException
{
//-- check bounds for index
if ((index < 0) || (index >= _extInfoList.size())) {
throw new IndexOutOfBoundsException("getExtInfo: Index value '"+index+"' not in range [0.."+(_extInfoList.size() - 1) + "]");
}
return (ExtInfo) _extInfoList.elementAt(index);
} //-- ExtInfo getExtInfo(int)
/**
* Method getExtInfo
*
*
*
* @return ExtInfo
*/
public ExtInfo[] getExtInfo()
{
int size = _extInfoList.size();
ExtInfo[] mArray = new ExtInfo[size];
for (int index = 0; index < size; index++) {
mArray[index] = (ExtInfo) _extInfoList.elementAt(index);
}
return mArray;
} //-- ExtInfo[] getExtInfo()
/**
* Method getExtInfoCount
*
*
*
* @return int
*/
public int getExtInfoCount()
{
return _extInfoList.size();
} //-- int getExtInfoCount()
/**
* Method getKeyPersons
*
*
*
* @param index
* @return KeyPersons
*/
public KeyPersons getKeyPersons(int index)
throws java.lang.IndexOutOfBoundsException
{
//-- check bounds for index
if ((index < 0) || (index >= _keyPersonsList.size())) {
throw new IndexOutOfBoundsException("getKeyPersons: Index value '"+index+"' not in range [0.."+(_keyPersonsList.size() - 1) + "]");
}
return (KeyPersons) _keyPersonsList.elementAt(index);
} //-- KeyPersons getKeyPersons(int)
/**
* Method getKeyPersons
*
*
*
* @return KeyPersons
*/
public KeyPersons[] getKeyPersons()
{
int size = _keyPersonsList.size();
KeyPersons[] mArray = new KeyPersons[size];
for (int index = 0; index < size; index++) {
mArray[index] = (KeyPersons) _keyPersonsList.elementAt(index);
}
return mArray;
} //-- KeyPersons[] getKeyPersons()
/**
* Method getKeyPersonsCount
*
*
*
* @return int
*/
public int getKeyPersonsCount()
{
return _keyPersonsList.size();
} //-- int getKeyPersonsCount()
/**
* Returns the value of field 'oprCode'.
*
* @return String
* @return the value of field 'oprCode'.
*/
public java.lang.String getOprCode()
{
return this._oprCode;
} //-- java.lang.String getOprCode()
/**
* Returns the value of field 'oprSeq'.
*
* @return String
* @return the value of field 'oprSeq'.
*/
public java.lang.String getOprSeq()
{
return this._oprSeq;
} //-- java.lang.String getOprSeq()
/**
* Returns the value of field 'oprTime'.
*
* @return String
* @return the value of field 'oprTime'.
*/
public java.lang.String getOprTime()
{
return this._oprTime;
} //-- java.lang.String getOprTime()
/**
* Returns the value of field 'parentCustomerNumber'.
*
* @return String
* @return the value of field 'parentCustomerNumber'.
*/
public java.lang.String getParentCustomerNumber()
{
return this._parentCustomerNumber;
} //-- java.lang.String getParentCustomerNumber()
/**
* Method isValid
*
*
*
* @return boolean
*/
/**
* Method removeAllExtInfo
*
*/
public void removeAllExtInfo()
{
_extInfoList.removeAllElements();
} //-- void removeAllExtInfo()
/**
* Method removeAllKeyPersons
*
*/
public void removeAllKeyPersons()
{
_keyPersonsList.removeAllElements();
} //-- void removeAllKeyPersons()
/**
* Method removeExtInfo
*
*
*
* @param index
* @return ExtInfo
*/
public ExtInfo removeExtInfo(int index)
{
java.lang.Object obj = _extInfoList.elementAt(index);
_extInfoList.removeElementAt(index);
return (ExtInfo) obj;
} //-- ExtInfo removeExtInfo(int)
/**
* Method removeKeyPersons
*
*
*
* @param index
* @return KeyPersons
*/
public KeyPersons removeKeyPersons(int index)
{
java.lang.Object obj = _keyPersonsList.elementAt(index);
_keyPersonsList.removeElementAt(index);
return (KeyPersons) obj;
} //-- KeyPersons removeKeyPersons(int)
/**
* Sets the value of field 'customer'.
*
* @param customer the value of field 'customer'.
*/
public void setCustomer(Customer customer)
{
this._customer = customer;
} //-- void setCustomer(Customer)
/**
* Sets the value of field 'customerManager'.
*
* @param customerManager the value of field 'customerManager'.
*/
public void setCustomerManager(CustomerManager customerManager)
{
this._customerManager = customerManager;
} //-- void setCustomerManager(CustomerManager)
/**
* Method setExtInfo
*
*
*
* @param index
* @param vExtInfo
*/
public void setExtInfo(int index, ExtInfo vExtInfo)
throws java.lang.IndexOutOfBoundsException
{
//-- check bounds for index
if ((index < 0) || (index >= _extInfoList.size())) {
throw new IndexOutOfBoundsException("setExtInfo: Index value '"+index+"' not in range [0.." + (_extInfoList.size() - 1) + "]");
}
_extInfoList.setElementAt(vExtInfo, index);
} //-- void setExtInfo(int, ExtInfo)
/**
* Method setExtInfo
*
*
*
* @param extInfoArray
*/
public void setExtInfo(ExtInfo[] extInfoArray)
{
//-- copy array
_extInfoList.removeAllElements();
for (int i = 0; i < extInfoArray.length; i++) {
_extInfoList.addElement(extInfoArray[i]);
}
} //-- void setExtInfo(ExtInfo)
/**
* Method setKeyPersons
*
*
*
* @param index
* @param vKeyPersons
*/
public void setKeyPersons(int index, KeyPersons vKeyPersons)
throws java.lang.IndexOutOfBoundsException
{
//-- check bounds for index
if ((index < 0) || (index >= _keyPersonsList.size())) {
throw new IndexOutOfBoundsException("setKeyPersons: Index value '"+index+"' not in range [0.." + (_keyPersonsList.size() - 1) + "]");
}
_keyPersonsList.setElementAt(vKeyPersons, index);
} //-- void setKeyPersons(int, KeyPersons)
/**
* Method setKeyPersons
*
*
*
* @param keyPersonsArray
*/
public void setKeyPersons(KeyPersons[] keyPersonsArray)
{
//-- copy array
_keyPersonsList.removeAllElements();
for (int i = 0; i < keyPersonsArray.length; i++) {
_keyPersonsList.addElement(keyPersonsArray[i]);
}
} //-- void setKeyPersons(KeyPersons)
/**
* Sets the value of field 'oprCode'.
*
* @param oprCode the value of field 'oprCode'.
*/
public void setOprCode(java.lang.String oprCode)
{
this._oprCode = oprCode;
} //-- void setOprCode(java.lang.String)
/**
* Sets the value of field 'oprSeq'.
*
* @param oprSeq the value of field 'oprSeq'.
*/
public void setOprSeq(java.lang.String oprSeq)
{
this._oprSeq = oprSeq;
} //-- void setOprSeq(java.lang.String)
/**
* Sets the value of field 'oprTime'.
*
* @param oprTime the value of field 'oprTime'.
*/
public void setOprTime(java.lang.String oprTime)
{
this._oprTime = oprTime;
} //-- void setOprTime(java.lang.String)
/**
* Sets the value of field 'parentCustomerNumber'.
*
* @param parentCustomerNumber the value of field
* 'parentCustomerNumber'.
*/
public void setParentCustomerNumber(java.lang.String parentCustomerNumber)
{
this._parentCustomerNumber = parentCustomerNumber;
} //-- void setParentCustomerNumber(java.lang.String)
/**
* Method unmarshal
*
*
*
* @param reader
* @return CustomerInfo
*/
}
| [
"[email protected]"
] | |
79a4935819b42c86c57e00d6c809a8503c399752 | 232ef7ae446bd6977d5b6409e0519e427ae83098 | /src/com/shubhendu/javaworld/datastructures/tree/InrderSuccessor.java | ea8386b4c8a6749abc8d5b29899e008f94a23bb7 | [] | no_license | Shubhendu/algorithms | b4fb3163c4fcdd7d0c0052818c9cb31631cb0a12 | 7fa04797760c49270257b11d18aaffeb16128a5b | refs/heads/master | 2021-04-30T04:39:29.163956 | 2018-02-14T17:50:07 | 2018-02-14T17:50:07 | 80,980,673 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,943 | java | /**
*
*/
package com.shubhendu.javaworld.datastructures.tree;
import java.util.ArrayList;
import java.util.List;
/**
* @author ssingh
*
*/
public class InrderSuccessor {
static class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) {
val = x;
}
}
public TreeNode inorderSuccessor(TreeNode root, TreeNode p) {
if (root == null || p == null)
return null;
List<TreeNode> inOrderTraversalList = new ArrayList<TreeNode>();
traverseInorder(root, inOrderTraversalList);
int index = binarySearchNode(p, inOrderTraversalList);
if (index == -1)
return null;
return index < inOrderTraversalList.size() - 1 ? inOrderTraversalList.get(index + 1) : null;
}
private void traverseInorder(TreeNode node, List<TreeNode> inOrderTraversalList) {
if (node == null)
return;
traverseInorder(node.left, inOrderTraversalList);
inOrderTraversalList.add(node);
traverseInorder(node.right, inOrderTraversalList);
}
private int binarySearchNode(TreeNode node, List<TreeNode> inOrderTraversalList) {
int lo = 0;
int hi = inOrderTraversalList.size() - 1;
TreeNode midNode = null;
while (lo <= hi) {
int mid = (hi + lo) / 2;
midNode = inOrderTraversalList.get(mid);
if (node == midNode)
return mid;
else if (node.val < midNode.val)
hi = mid - 1;
else
lo = mid + 1;
}
return -1;
}
private void printNode(TreeNode node) {
if (node == null)
System.out.println("Null");
else
System.out.println("Inorder: " + node.val);
}
public static void main(String[] args) {
int x = 4 ^ 1;
int count = 0;
while (x != 0) {
System.out.println(count + " : " + x);
x = x & (x- 1);
count++;
}
// TreeNode root = new TreeNode(23);
// root.left = new TreeNode(15);
// root.left.left = new TreeNode(10);
// root.left.right = new TreeNode(18);
//
// root.right = new TreeNode(34);
// root.right.left = new TreeNode(28);
// root.right.right = new TreeNode(35);
// root.right.left.left = new TreeNode(25);
// root.right.left.right = new TreeNode(29);
// root.right.left.right.right = new TreeNode(30);
//
// InrderSuccessor inrderSuccessor = new InrderSuccessor();
//// inrderSuccessor.printNode(inrderSuccessor.inorderSuccessor(root,
// root.right.left));
//// inrderSuccessor.printNode(inrderSuccessor.inorderSuccessor(root,
// root));
//// inrderSuccessor.printNode(inrderSuccessor.inorderSuccessor(root,
// root.left.left));
//// inrderSuccessor.printNode(inrderSuccessor.inorderSuccessor(root,
// root.left));
//// inrderSuccessor.printNode(inrderSuccessor.inorderSuccessor(root,
// new TreeNode(35)));
// inrderSuccessor.printNode(inrderSuccessor.inorderSuccessor(root,
// root.right.right));
//// inrderSuccessor.printNode(inrderSuccessor.inorderSuccessor(root,
// root.left.right));
System.out.println(16 >> 1);
String s = "abs";
System.out.println((char) (97 +25));
}
}
| [
"[email protected]"
] | |
ab630259413e26ce59bad86ac7279e660cca3fef | 732a286c54ecf87ecbdcc984da4589b1b28d6ec4 | /6-thread-group/src/main/java/com/thread/group/parent/Parent.java | f166b918c2a17f8ac9c55021bb25bad230eaef33 | [] | no_license | wu383933588lyy/ThreadCode | a0af535750badf1c0ea93c14de498a2ce1c51409 | f52aafb4adf29520eb155b6b2afabb341e1e3bfc | refs/heads/master | 2023-02-02T15:13:58.626803 | 2020-12-22T06:16:30 | 2020-12-22T06:16:30 | 274,810,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package com.thread.group.parent;
/**
* @Author WuRui
* @ClassName Parent
* @Date 2020/11/11 17:01
* @Version 1.0
* @Description //TODO
**/
public interface Parent {
public void play();
public String eat();
}
| [
"[email protected]"
] | |
b47c18c3ad6daefec22e632e2e60d4d4f21788a8 | 20a3092c426d726b502630157ca31417e5a8d1d1 | /src/main/java/com/zlp/service/BookServiceImpl.java | 44ee565f2fc7fcde199e2de3f34afd29d2c3a683 | [] | no_license | zlp-github/ssmBuilder | 711829980fdb23e6875e5ec723243b40ed4a541d | 7ab06b7c1a94579280f3cffd4133ae704e1d7684 | refs/heads/master | 2022-12-22T06:28:20.473980 | 2020-03-09T11:52:01 | 2020-03-09T11:52:01 | 246,022,106 | 0 | 0 | null | 2022-12-16T00:39:31 | 2020-03-09T11:50:28 | Java | UTF-8 | Java | false | false | 918 | java | package com.zlp.service;
import com.zlp.dao.BookMapper;
import com.zlp.pojo.Books;
import java.util.List;
/**
* Author: zlp
* Date: 2020-03-09 0:02
* Description:张立朋,写点注释吧!!
*/
public class BookServiceImpl implements BookService {
//调用dao层的操作,设置一个set接口,方便spring管理
private BookMapper bookMapper;
public void setBookMapper(BookMapper bookMapper){
this.bookMapper = bookMapper;
}
public int addBook(Books book) {
return bookMapper.addBook(book);
}
public int deleteBookById(int id) {
return bookMapper.deleteBookById(id);
}
public int updateBook(Books books) {
return bookMapper.updateBook(books);
}
public Books queryBookById(int id) {
return bookMapper.queryBookId(id);
}
public List<Books> queryAllBook() {
return bookMapper.queryAllBooks();
}
}
| [
"[email protected]"
] | |
14803abbd835aac40e426709e2dde238ba6bc88c | 94c905e5f70eb3a0a5f04b3bfd26b87e7f3845b2 | /TravelApps/app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/viewpager/R.java | 22c4f3ca710268df095d353b087ddbf199704ac5 | [] | no_license | VinaSantaRosaManurung/Project-Android | ec767d5eb38b67b7f0f98707f0cf1ad8d872f93c | d806cddca52fe66a54bb890966e700852cfa2004 | refs/heads/master | 2023-06-16T04:42:27.752687 | 2021-07-17T05:59:16 | 2021-07-17T05:59:16 | 386,851,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,449 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.viewpager;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f030027;
public static final int font = 0x7f0300e0;
public static final int fontProviderAuthority = 0x7f0300e2;
public static final int fontProviderCerts = 0x7f0300e3;
public static final int fontProviderFetchStrategy = 0x7f0300e4;
public static final int fontProviderFetchTimeout = 0x7f0300e5;
public static final int fontProviderPackage = 0x7f0300e6;
public static final int fontProviderQuery = 0x7f0300e7;
public static final int fontStyle = 0x7f0300e8;
public static final int fontVariationSettings = 0x7f0300e9;
public static final int fontWeight = 0x7f0300ea;
public static final int ttcIndex = 0x7f030216;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f05006c;
public static final int notification_icon_bg_color = 0x7f05006d;
public static final int ripple_material_light = 0x7f050077;
public static final int secondary_text_default_material_light = 0x7f050079;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f060051;
public static final int compat_button_inset_vertical_material = 0x7f060052;
public static final int compat_button_padding_horizontal_material = 0x7f060053;
public static final int compat_button_padding_vertical_material = 0x7f060054;
public static final int compat_control_corner_material = 0x7f060055;
public static final int compat_notification_large_icon_max_height = 0x7f060056;
public static final int compat_notification_large_icon_max_width = 0x7f060057;
public static final int notification_action_icon_size = 0x7f0600c3;
public static final int notification_action_text_size = 0x7f0600c4;
public static final int notification_big_circle_margin = 0x7f0600c5;
public static final int notification_content_margin_start = 0x7f0600c6;
public static final int notification_large_icon_height = 0x7f0600c7;
public static final int notification_large_icon_width = 0x7f0600c8;
public static final int notification_main_column_padding_top = 0x7f0600c9;
public static final int notification_media_narrow_margin = 0x7f0600ca;
public static final int notification_right_icon_size = 0x7f0600cb;
public static final int notification_right_side_padding_top = 0x7f0600cc;
public static final int notification_small_icon_background_padding = 0x7f0600cd;
public static final int notification_small_icon_size_as_large = 0x7f0600ce;
public static final int notification_subtext_size = 0x7f0600cf;
public static final int notification_top_pad = 0x7f0600d0;
public static final int notification_top_pad_large_text = 0x7f0600d1;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f070084;
public static final int notification_bg = 0x7f070085;
public static final int notification_bg_low = 0x7f070086;
public static final int notification_bg_low_normal = 0x7f070087;
public static final int notification_bg_low_pressed = 0x7f070088;
public static final int notification_bg_normal = 0x7f070089;
public static final int notification_bg_normal_pressed = 0x7f07008a;
public static final int notification_icon_background = 0x7f07008b;
public static final int notification_template_icon_bg = 0x7f07008c;
public static final int notification_template_icon_low_bg = 0x7f07008d;
public static final int notification_tile_bg = 0x7f07008e;
public static final int notify_panel_notification_icon_bg = 0x7f07008f;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f08002e;
public static final int action_divider = 0x7f080030;
public static final int action_image = 0x7f080031;
public static final int action_text = 0x7f080037;
public static final int actions = 0x7f080038;
public static final int async = 0x7f080040;
public static final int blocking = 0x7f080044;
public static final int chronometer = 0x7f08004e;
public static final int forever = 0x7f08007a;
public static final int icon = 0x7f080081;
public static final int icon_group = 0x7f080082;
public static final int info = 0x7f08008b;
public static final int italic = 0x7f08008d;
public static final int line1 = 0x7f080097;
public static final int line3 = 0x7f080098;
public static final int normal = 0x7f0800a9;
public static final int notification_background = 0x7f0800aa;
public static final int notification_main_column = 0x7f0800ab;
public static final int notification_main_column_container = 0x7f0800ac;
public static final int right_icon = 0x7f0800c0;
public static final int right_side = 0x7f0800c1;
public static final int tag_transition_group = 0x7f0800f5;
public static final int tag_unhandled_key_event_manager = 0x7f0800f6;
public static final int tag_unhandled_key_listeners = 0x7f0800f7;
public static final int text = 0x7f0800fe;
public static final int text2 = 0x7f0800ff;
public static final int time = 0x7f080108;
public static final int title = 0x7f080109;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f09000e;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f0b0035;
public static final int notification_action_tombstone = 0x7f0b0036;
public static final int notification_template_custom_big = 0x7f0b0037;
public static final int notification_template_icon_group = 0x7f0b0038;
public static final int notification_template_part_chronometer = 0x7f0b0039;
public static final int notification_template_part_time = 0x7f0b003a;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0d002e;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0e0116;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0e0117;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e0118;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0e0119;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0e011a;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0e01c3;
public static final int Widget_Compat_NotificationActionText = 0x7f0e01c4;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f0300e2, 0x7f0300e3, 0x7f0300e4, 0x7f0300e5, 0x7f0300e6, 0x7f0300e7 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300e0, 0x7f0300e8, 0x7f0300e9, 0x7f0300ea, 0x7f030216 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"[email protected]"
] | |
41e65ece55d205bf46186ff041899ee30f278596 | 4d97a8ec832633b154a03049d17f8b58233cbc5d | /Lang/63/Lang/evosuite-branch/8/org/apache/commons/lang/time/DurationFormatUtilsEvoSuite_branch_Test.java | d3c35368e678102bb3fbdb2c40f3efccffe519e3 | [] | no_license | 4open-science/evosuite-defects4j | be2d172a5ce11e0de5f1272a8d00d2e1a2e5f756 | ca7d316883a38177c9066e0290e6dcaa8b5ebd77 | refs/heads/master | 2021-06-16T18:43:29.227993 | 2017-06-07T10:37:26 | 2017-06-07T10:37:26 | 93,623,570 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 20,344 | java | /*
* This file was automatically generated by EvoSuite
* Thu Dec 11 18:44:20 GMT 2014
*/
package org.apache.commons.lang.time;
import static org.junit.Assert.*;
import org.junit.Test;
import java.util.TimeZone;
import org.apache.commons.lang.time.DurationFormatUtils;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.EvoSuiteFile;
import org.junit.runner.RunWith;
import sun.util.calendar.ZoneInfo;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, resetStaticState = true)
public class DurationFormatUtilsEvoSuite_branch_Test extends DurationFormatUtilsEvoSuite_branch_Test_scaffolding {
@Test
public void test00() throws Throwable {
String string0 = "^3";
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(string0);
assertNotNull(durationFormatUtils_Token0);
boolean boolean0 = durationFormatUtils_Token0.equals((Object) durationFormatUtils_Token0);
assertTrue(boolean0);
}
@Test
public void test01() throws Throwable {
int int0 = 1350;
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(int0);
assertNotNull(durationFormatUtils_Token0);
boolean boolean0 = durationFormatUtils_Token0.equals((Object) durationFormatUtils_Token0);
assertTrue(boolean0);
}
@Test
public void test02() throws Throwable {
String string0 = "zM_1";
int int0 = (-1941);
StringBuffer stringBuffer0 = new StringBuffer(string0);
assertEquals(4, stringBuffer0.length());
assertEquals(20, stringBuffer0.capacity());
assertEquals("zM_1", stringBuffer0.toString());
assertNotNull(stringBuffer0);
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(stringBuffer0, int0);
assertEquals(4, stringBuffer0.length());
assertEquals(20, stringBuffer0.capacity());
assertEquals("zM_1", stringBuffer0.toString());
assertNotNull(durationFormatUtils_Token0);
boolean boolean0 = durationFormatUtils_Token0.equals((Object) durationFormatUtils_Token0);
assertEquals(4, stringBuffer0.length());
assertEquals(20, stringBuffer0.capacity());
assertEquals("zM_1", stringBuffer0.toString());
assertTrue(boolean0);
}
@Test
public void test03() throws Throwable {
String string0 = "G";
DurationFormatUtils.Token[] durationFormatUtils_TokenArray0 = new DurationFormatUtils.Token[4];
int int0 = 978;
int int1 = 163;
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(string0, int1);
assertFalse(int1 == int0);
assertNotNull(durationFormatUtils_Token0);
durationFormatUtils_TokenArray0[2] = durationFormatUtils_Token0;
assertNotNull(durationFormatUtils_TokenArray0[2]);
DurationFormatUtils.Token durationFormatUtils_Token1 = new DurationFormatUtils.Token(string0, int0);
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertFalse(int0 == int1);
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
assertNotNull(durationFormatUtils_Token1);
boolean boolean0 = durationFormatUtils_TokenArray0[2].equals((Object) durationFormatUtils_Token1);
assertFalse(boolean0);
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertFalse(int0 == int1);
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
}
@Test
public void test04() throws Throwable {
String string0 = "^3";
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(string0);
assertNotNull(durationFormatUtils_Token0);
DurationFormatUtils.Token durationFormatUtils_Token1 = new DurationFormatUtils.Token(durationFormatUtils_Token0);
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertNotSame(durationFormatUtils_Token0, durationFormatUtils_Token1);
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
assertFalse(durationFormatUtils_Token0.equals((Object)durationFormatUtils_Token1));
assertNotNull(durationFormatUtils_Token1);
boolean boolean0 = durationFormatUtils_Token0.equals((Object) durationFormatUtils_Token1);
assertFalse(boolean0);
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertNotSame(durationFormatUtils_Token0, durationFormatUtils_Token1);
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
assertFalse(durationFormatUtils_Token0.equals((Object)durationFormatUtils_Token1));
}
@Test
public void test05() throws Throwable {
DurationFormatUtils durationFormatUtils0 = new DurationFormatUtils();
assertNotNull(durationFormatUtils0);
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(durationFormatUtils0);
assertNotNull(durationFormatUtils_Token0);
boolean boolean0 = durationFormatUtils_Token0.equals((Object) durationFormatUtils0);
assertFalse(boolean0);
}
@Test
public void test06() throws Throwable {
boolean boolean0 = true;
String string0 = "4ItUHr9C} kcr";
DurationFormatUtils.Token[] durationFormatUtils_TokenArray0 = new DurationFormatUtils.Token[8];
StringBuffer stringBuffer0 = new StringBuffer((CharSequence) string0);
assertEquals(30, stringBuffer0.capacity());
assertEquals(14, stringBuffer0.length());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertNotNull(stringBuffer0);
int int0 = 343;
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(stringBuffer0, int0);
assertEquals(30, stringBuffer0.capacity());
assertEquals(14, stringBuffer0.length());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertNotNull(durationFormatUtils_Token0);
durationFormatUtils_TokenArray0[0] = durationFormatUtils_Token0;
assertEquals(30, stringBuffer0.capacity());
assertEquals(14, stringBuffer0.length());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertNotNull(durationFormatUtils_TokenArray0[0]);
Integer integer0 = new Integer(int0);
assertEquals(343, (int)integer0);
assertTrue(integer0.equals((Object)int0));
durationFormatUtils_TokenArray0[1] = durationFormatUtils_Token0;
assertEquals(30, stringBuffer0.capacity());
assertEquals(14, stringBuffer0.length());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertNotNull(durationFormatUtils_TokenArray0[1]);
durationFormatUtils_TokenArray0[2] = durationFormatUtils_Token0;
assertEquals(30, stringBuffer0.capacity());
assertEquals(14, stringBuffer0.length());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertNotNull(durationFormatUtils_TokenArray0[2]);
durationFormatUtils_TokenArray0[3] = durationFormatUtils_TokenArray0[1];
assertNotNull(durationFormatUtils_TokenArray0[3]);
durationFormatUtils_TokenArray0[4] = durationFormatUtils_TokenArray0[0];
assertNotNull(durationFormatUtils_TokenArray0[4]);
durationFormatUtils_TokenArray0[5] = durationFormatUtils_TokenArray0[0];
assertNotNull(durationFormatUtils_TokenArray0[5]);
String string1 = (String)DurationFormatUtils.S;
assertEquals("S", string1);
assertNotSame(string1, string0);
assertFalse(string1.equals((Object)string0));
assertNotNull(string1);
DurationFormatUtils.Token durationFormatUtils_Token1 = new DurationFormatUtils.Token(string1);
assertNotSame(string1, string0);
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertFalse(string1.equals((Object)string0));
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
assertNotNull(durationFormatUtils_Token1);
durationFormatUtils_TokenArray0[6] = durationFormatUtils_Token1;
assertNotNull(durationFormatUtils_TokenArray0[6]);
// Undeclared exception!
try {
String string2 = DurationFormatUtils.format(durationFormatUtils_TokenArray0, int0, (int) integer0, (int) integer0, int0, (int) integer0, (int) integer0, int0, boolean0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test
public void test07() throws Throwable {
int int0 = 87;
String string0 = "AUcS";
boolean boolean0 = false;
String string1 = DurationFormatUtils.formatDuration((long) int0, string0, boolean0);
assertEquals("AUc87", string1);
assertNotSame(string1, string0);
assertNotSame(string0, string1);
assertFalse(string1.equals((Object)string0));
assertFalse(string0.equals((Object)string1));
assertNotNull(string1);
}
@Test
public void test08() throws Throwable {
boolean boolean0 = true;
String string0 = "4ItUHr9C} kcr";
DurationFormatUtils.Token[] durationFormatUtils_TokenArray0 = new DurationFormatUtils.Token[8];
StringBuffer stringBuffer0 = new StringBuffer((CharSequence) string0);
assertEquals(30, stringBuffer0.capacity());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertEquals(14, stringBuffer0.length());
assertNotNull(stringBuffer0);
int int0 = 343;
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(stringBuffer0, int0);
assertEquals(30, stringBuffer0.capacity());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertEquals(14, stringBuffer0.length());
assertNotNull(durationFormatUtils_Token0);
durationFormatUtils_TokenArray0[0] = durationFormatUtils_Token0;
assertEquals(30, stringBuffer0.capacity());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertEquals(14, stringBuffer0.length());
assertNotNull(durationFormatUtils_TokenArray0[0]);
Integer integer0 = new Integer(int0);
assertEquals(343, (int)integer0);
assertTrue(integer0.equals((Object)int0));
durationFormatUtils_TokenArray0[1] = durationFormatUtils_Token0;
assertEquals(30, stringBuffer0.capacity());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertEquals(14, stringBuffer0.length());
assertNotNull(durationFormatUtils_TokenArray0[1]);
durationFormatUtils_TokenArray0[2] = durationFormatUtils_Token0;
assertEquals(30, stringBuffer0.capacity());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertEquals(14, stringBuffer0.length());
assertNotNull(durationFormatUtils_TokenArray0[2]);
durationFormatUtils_TokenArray0[3] = durationFormatUtils_TokenArray0[1];
assertNotNull(durationFormatUtils_TokenArray0[3]);
DurationFormatUtils.Token durationFormatUtils_Token1 = new DurationFormatUtils.Token(durationFormatUtils_Token0, int0);
assertEquals(30, stringBuffer0.capacity());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertEquals(14, stringBuffer0.length());
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertNotSame(durationFormatUtils_Token0, durationFormatUtils_Token1);
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
assertFalse(durationFormatUtils_Token0.equals((Object)durationFormatUtils_Token1));
assertNotNull(durationFormatUtils_Token1);
durationFormatUtils_TokenArray0[4] = durationFormatUtils_Token1;
assertEquals(30, stringBuffer0.capacity());
assertEquals("4ItUHr9C} kcr", stringBuffer0.toString());
assertEquals(14, stringBuffer0.length());
assertNotNull(durationFormatUtils_TokenArray0[4]);
// Undeclared exception!
try {
String string1 = DurationFormatUtils.format(durationFormatUtils_TokenArray0, int0, (int) integer0, (int) integer0, int0, (int) integer0, (int) integer0, int0, boolean0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test
public void test09() throws Throwable {
long long0 = (-1098L);
long long1 = 2419199996L;
String string0 = "*|C_!Um6";
String string1 = DurationFormatUtils.formatPeriod(long0, long1, string0);
assertEquals("*|C_!U-4449606", string1);
assertNotSame(string0, string1);
assertNotSame(string1, string0);
assertFalse(long0 == long1);
assertFalse(long1 == long0);
assertFalse(string0.equals((Object)string1));
assertFalse(string1.equals((Object)string0));
assertNotNull(string1);
}
@Test
public void test10() throws Throwable {
int int0 = (-1231);
long long0 = 2419200001L;
String string0 = "'P'yyyy'>'v'M'd'DT'H'H'm'M's.S'SX";
String string1 = DurationFormatUtils.formatPeriod((long) int0, long0, string0);
assertEquals("P0000>vM-308DT0H0M1.232SX", string1);
assertNotSame(string0, string1);
assertNotSame(string1, string0);
assertFalse(string0.equals((Object)string1));
assertFalse(string1.equals((Object)string0));
assertNotNull(string1);
}
@Test
public void test11() throws Throwable {
String string0 = "zM_1";
long long0 = (-1648L);
long long1 = 2419200001L;
boolean boolean0 = true;
ZoneInfo zoneInfo0 = (ZoneInfo)TimeZone.getTimeZone(string0);
assertEquals("GMT", zoneInfo0.getID());
assertNotNull(zoneInfo0);
String string1 = DurationFormatUtils.formatPeriod(long0, long1, string0, boolean0, (TimeZone) zoneInfo0);
assertEquals("GMT", zoneInfo0.getID());
assertEquals("z0_1", string1);
assertNotSame(string0, string1);
assertNotSame(string1, string0);
assertFalse(string0.equals((Object)string1));
assertFalse(long1 == long0);
assertFalse(string1.equals((Object)string0));
assertFalse(long0 == long1);
assertNotNull(string1);
}
@Test
public void test12() throws Throwable {
long long0 = 71L;
boolean boolean0 = true;
String string0 = DurationFormatUtils.formatDurationWords(long0, boolean0, boolean0);
assertEquals("0 seconds", string0);
assertNotNull(string0);
}
@Test
public void test13() throws Throwable {
boolean boolean0 = true;
long long0 = 60052L;
String string0 = DurationFormatUtils.formatDurationWords(long0, boolean0, boolean0);
assertEquals("1 minute", string0);
assertNotNull(string0);
}
@Test
public void test14() throws Throwable {
long long0 = 86400000L;
boolean boolean0 = true;
String string0 = DurationFormatUtils.formatDurationWords(long0, boolean0, boolean0);
assertEquals("1 day", string0);
assertNotNull(string0);
}
@Test
public void test15() throws Throwable {
long long0 = 3600120L;
boolean boolean0 = true;
String string0 = DurationFormatUtils.formatDurationWords(long0, boolean0, boolean0);
assertEquals("1 hour", string0);
assertNotNull(string0);
}
@Test
public void test16() throws Throwable {
String string0 = (String)DurationFormatUtils.d;
assertEquals("d", string0);
assertNotNull(string0);
int int0 = 87;
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(string0, int0);
assertNotNull(durationFormatUtils_Token0);
String string1 = "AUcS";
assertNotSame(string1, string0);
assertFalse(string1.equals((Object)string0));
DurationFormatUtils.Token durationFormatUtils_Token1 = new DurationFormatUtils.Token(string1, int0);
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertNotSame(string1, string0);
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
assertFalse(string1.equals((Object)string0));
assertNotNull(durationFormatUtils_Token1);
boolean boolean0 = durationFormatUtils_Token1.equals((Object) durationFormatUtils_Token0);
assertFalse(boolean0);
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertNotSame(string0, string1);
assertNotSame(string1, string0);
assertNotSame(durationFormatUtils_Token0, durationFormatUtils_Token1);
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
assertFalse(string0.equals((Object)string1));
assertFalse(string1.equals((Object)string0));
assertFalse(durationFormatUtils_Token0.equals((Object)durationFormatUtils_Token1));
String string2 = DurationFormatUtils.formatDurationWords((long) int0, boolean0, boolean0);
assertEquals("0 days 0 hours 0 minutes 0 seconds", string2);
assertNotSame(durationFormatUtils_Token1, durationFormatUtils_Token0);
assertNotSame(string0, string2);
assertNotSame(string0, string1);
assertNotSame(string1, string0);
assertNotSame(string1, string2);
assertNotSame(string2, string0);
assertNotSame(string2, string1);
assertNotSame(durationFormatUtils_Token0, durationFormatUtils_Token1);
assertFalse(durationFormatUtils_Token1.equals((Object)durationFormatUtils_Token0));
assertFalse(string0.equals((Object)string2));
assertFalse(string0.equals((Object)string1));
assertFalse(string1.equals((Object)string0));
assertFalse(string1.equals((Object)string2));
assertFalse(string2.equals((Object)string0));
assertFalse(string2.equals((Object)string1));
assertFalse(durationFormatUtils_Token0.equals((Object)durationFormatUtils_Token1));
assertNotNull(string2);
}
@Test
public void test17() throws Throwable {
String string0 = (String)DurationFormatUtils.d;
assertEquals("d", string0);
assertNotNull(string0);
int int0 = 87;
DurationFormatUtils.Token durationFormatUtils_Token0 = new DurationFormatUtils.Token(string0, int0);
assertNotNull(durationFormatUtils_Token0);
String string1 = durationFormatUtils_Token0.toString();
assertEquals("ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", string1);
assertNotSame(string0, string1);
assertNotSame(string1, string0);
assertFalse(string0.equals((Object)string1));
assertFalse(string1.equals((Object)string0));
assertNotNull(string1);
}
@Test
public void test18() throws Throwable {
long long0 = (-1098L);
String string0 = DurationFormatUtils.formatDurationHMS(long0);
assertEquals("0:00:-1.02", string0);
assertNotNull(string0);
}
@Test
public void test19() throws Throwable {
long long0 = (-1648L);
String string0 = DurationFormatUtils.formatDurationISO(long0);
assertEquals("P0Y0M0DT0H0M-1.52S", string0);
assertNotNull(string0);
}
@Test
public void test20() throws Throwable {
String string0 = "^3";
int int0 = (-1231);
String string1 = DurationFormatUtils.formatPeriod((long) int0, (long) int0, string0);
assertEquals("^3", string1);
assertNotSame(string0, string1);
assertNotSame(string1, string0);
assertTrue(string0.equals((Object)string1));
assertTrue(string1.equals((Object)string0));
assertNotNull(string1);
}
@Test
public void test21() throws Throwable {
long long0 = 3600120L;
String string0 = DurationFormatUtils.formatPeriodISO(long0, long0);
assertEquals("P0Y0M0DT0H0M0.000S", string0);
assertNotNull(string0);
}
}
| [
"[email protected]"
] | |
b5718e65ac70fe8b259e6327a7751b69f7f8531e | 484fbbd022d623eb0ffadd42649a3b7601ab0855 | /kongcv/src/com/kongcv/utils/NormalPostRequest.java | dfef02c1eb5127512bc303e41bd923eb7130f8c5 | [] | no_license | kongcv/kongcv_android | 56a1fb1bc57f3a20dc7f714f46e404864b3283b1 | b1134effb0761a25800ec6a83644f43b8af094ec | refs/heads/master | 2021-01-10T08:32:42.488528 | 2016-04-11T10:37:00 | 2016-04-11T10:37:00 | 54,869,366 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,014 | java | package com.kongcv.utils;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import android.util.Log;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.toolbox.HttpHeaderParser;
import com.kongcv.global.Information;
public class NormalPostRequest extends Request<JSONObject> {
private Listener<JSONObject> mListener;
private Map<String, String> mMap;
public NormalPostRequest(String url, Listener<JSONObject> listener,
ErrorListener errorListener, Map<String, String> map) {
super(Request.Method.POST, url, errorListener);
mListener = listener;
mMap = map;
}
// mMap是已经按照前面的方式,设置了参数的实例
@Override
protected Map<String, String> getParams() throws AuthFailureError {
return mMap;
}
/*private Map<String, String> mMap;
public NormalPostRequest(String url, Listener<JSONObject> listener,
ErrorListener errorListener, Map<String, String> map) {
super(Request.Method.POST, url, errorListener);
mListener = listener;
mMap = map;
}
public Map<String, String> getmMap() {
return mMap;
}
*/
// 此处因为response返回值需要json数据,和JsonObjectRequest类一样即可
@Override
protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) {
String jsonString=null;
try {
jsonString = new String(response.data,
HttpHeaderParser.parseCharset(response.headers));
return Response.success(new JSONObject(jsonString),
HttpHeaderParser.parseCacheHeaders(response));
} catch (UnsupportedEncodingException e) {
return Response.error(new ParseError(e));
} catch (JSONException je) {
Log.v("JSONException>>>>>", jsonString+"::::");
Log.v("JSONException>>>>>", jsonString+"::::");
return Response.error(new ParseError(je));
}
}
@Override
protected void deliverResponse(JSONObject response) {
mListener.onResponse(response);
}
/**
* 设置属性参数
*/
@Override
protected Map<String, String> getPostParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("Content-Type", "application/json;charset=utf-8");
params.put("Accept", "application/json");
return params;
}
/**
* 添加请求头信息
*/
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
// TODO Auto-generated method stub
Map<String, String> headers = new HashMap<String, String>();
headers.put("X-LC-Id", Information.APP_ID);
headers.put("X-LC-Key", Information.APP_KEY);
return headers;
}
}
| [
"[email protected]"
] | |
3c26358be1c54a9b8235add25a6b4db5f4357834 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/14/14_4fd57c1fc989eea1fb385768a099049dcc61787a/MarkupViewRenderer/14_4fd57c1fc989eea1fb385768a099049dcc61787a_MarkupViewRenderer_s.java | 5503b76f37fa6ce646fe6ea23a88e6d0d5c08106 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,903 | java | package ca.simplegames.micro.viewers.markup;
import ca.simplegames.micro.MicroContext;
import ca.simplegames.micro.repositories.Repository;
import ca.simplegames.micro.utils.IO;
import ca.simplegames.micro.viewers.ViewException;
import ca.simplegames.micro.viewers.ViewRenderer;
import org.pegdown.PegDownProcessor;
import java.io.*;
import java.util.Map;
/**
* todo implement the support for rendering Markdown
*
* @author <a href="mailto:[email protected]">Florin T.PATRASCU</a>
* @since $Revision$ (created: 2012-12-30 7:19 PM)
*/
public class MarkupViewRenderer implements ViewRenderer {
PegDownProcessor pegDownProcessor = new PegDownProcessor();
protected String name = "markdown";
public long render(String path, Repository repository, MicroContext context, Reader in, Writer out)
throws FileNotFoundException, ViewException {
if (repository != null && out != null) {
try {
String source = repository.read(path);
String html = pegDownProcessor.markdownToHtml(source);
return IO.copy(new StringReader(html), out);
} catch (FileNotFoundException e) {
throw new FileNotFoundException(String.format("%s not found.", path));
} catch (Exception e) {
throw new ViewException(e);
}
}
return 0;
}
public void loadConfiguration(Map<String, Object> configuration) throws Exception {
}
public long render(String path, Repository repository, MicroContext context, InputStream in, OutputStream out)
throws FileNotFoundException, ViewException {
return render(path, repository, context, new InputStreamReader(in), new OutputStreamWriter(out));
}
@Override
public String getName() {
return name;
}
}
| [
"[email protected]"
] | |
65b8fd98bf03af5f70bb1ee5bf0f6d741e138dcd | f91ec134d1ce9196f990e6e136204ca4564cd976 | /rollviewpager/src/main/java/com/jude/rollviewpager/adapter/LoopPagerAdapter.java | 2303959919826830a54754e122dfca8f85f01e9f | [
"MIT"
] | permissive | Revival-liangjialiang/ShoppingApp | 2dbeb6ea8d55a34f5ee6f7c7ad9ee6accc0f6936 | 7262be78cd45e895b561a67ba518e861be54effd | refs/heads/branch_2 | 2021-01-16T21:39:43.610602 | 2016-07-31T11:47:30 | 2016-07-31T11:47:30 | 64,544,108 | 2 | 0 | null | 2016-08-03T10:23:57 | 2016-07-30T12:56:55 | Java | UTF-8 | Java | false | false | 2,906 | java | package com.jude.rollviewpager.adapter;
import android.database.DataSetObserver;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import com.jude.rollviewpager.HintView;
import com.jude.rollviewpager.RollPagerView;
import java.util.ArrayList;
/**
* Created by Mr.Jude on 2016/1/9.
*/
public abstract class LoopPagerAdapter extends PagerAdapter {
private RollPagerView mViewPager;
private ArrayList<View> mViewList = new ArrayList<>();
private class LoopHintViewDelegate implements RollPagerView.HintViewDelegate {
//*******************************1
@Override
public void setCurrentPosition(int position, HintView hintView) {
if (hintView != null)
hintView.setCurrent(position % getRealCount());
}
@Override
public void initView(int length, int gravity, HintView hintView) {
if (hintView != null)
hintView.initView(getRealCount(), gravity);
}
}
@Override
public void notifyDataSetChanged() {
super.notifyDataSetChanged();
mViewList.clear();
}
@Override
public void registerDataSetObserver(DataSetObserver observer) {
super.registerDataSetObserver(observer);
if (getCount() == 0) return;
int half = Integer.MAX_VALUE / 2;
int start = half - half % getRealCount();
mViewPager.getViewPager().setCurrentItem(start, false);
}
//**************************************2
public LoopPagerAdapter(RollPagerView viewPager) {
this.mViewPager = viewPager;
viewPager.setHintViewDelegate(new LoopHintViewDelegate());
}
@Override
public boolean isViewFromObject(View arg0, Object arg1) {
return arg0 == arg1;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
//实际位置
int realPosition = position % getRealCount();
View itemView = findViewByPosition(container, realPosition);
container.addView(itemView);
return itemView;
}
private View findViewByPosition(ViewGroup container, int position) {
for (View view : mViewList) {
if (((int) view.getTag()) == position && view.getParent() == null) {
return view;
}
}
View view = getView(container, position);
view.setTag(position);
mViewList.add(view);
return view;
}
public abstract View getView(ViewGroup container, int position);
@Deprecated
@Override
public final int getCount() {
return getRealCount() <= 1 ? getRealCount() : Integer.MAX_VALUE;
}
protected abstract int getRealCount();
}
| [
"[email protected]"
] | |
6f0f2cc1f86c4a9ebfef5629ec7f176a6162a0cb | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project98/src/main/java/org/gradle/test/performance98_5/Production98_496.java | 514268aaeb25ec1e34cd9a6fc3ec2c9e6f614ab5 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 305 | java | package org.gradle.test.performance98_5;
public class Production98_496 extends org.gradle.test.performance17_5.Production17_496 {
private final String property;
public Production98_496() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"[email protected]"
] | |
6f53e2c1748257630b0b14e894685e703ce9ea58 | b005b7fb4d704c9fcd0c1ecd35d1c4d942c7f31c | /2.JavaCore/src/com/javarush/task/task18/task1815/Solution.java | 0fb5a1e8a52bc8f8f245e9da9a74fe0c3ee62b51 | [] | no_license | MJGTMJGT/MyJavaRushRep | 790b1a764e3370d7710d52dc0fd095a601fd8dcd | 0b2445bbf1502d67ef2f7b848c908f8fa824970d | refs/heads/master | 2020-04-29T18:57:59.620428 | 2019-12-23T18:38:48 | 2019-12-23T18:38:48 | 176,339,371 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 934 | java | package com.javarush.task.task18.task1815;
import java.util.List;
/*
Таблица
*/
public class Solution {
public class TableInterfaceWrapper implements TableInterface {
TableInterface tif;
public TableInterfaceWrapper(TableInterface tif) {
this.tif = tif;
}
@Override
public void setModel(List rows) {
System.out.println(rows.size());
tif.setModel(rows);
}
@Override
public String getHeaderText() {
return tif.getHeaderText().toUpperCase();
}
@Override
public void setHeaderText(String newHeaderText) {
tif.setHeaderText(newHeaderText);
}
}
public interface TableInterface {
void setModel(List rows);
String getHeaderText();
void setHeaderText(String newHeaderText);
}
public static void main(String[] args) {
}
} | [
"[email protected]"
] | |
44030e6bb1cc6c665887e4e36fe1637a205e1a4b | 77f36f4a0b2b2ef08398460013dd1bbbdc7bffe9 | /Frog_jump/src/p4_group_8_repo/Game_actor/package-info.java | c695036932faddfeb0d0fddceea44998b04b9a64 | [] | no_license | junyuan007/COMP_CW_V7 | bdee7f5d829deb82321ecce64152bf80dae7cc69 | 0224c8db52104e8aefa74e1b5df3cfc9f84cfe8a | refs/heads/main | 2023-02-06T00:44:04.751858 | 2020-12-18T14:23:01 | 2020-12-18T14:23:01 | 310,335,910 | 3 | 0 | null | 2020-11-25T16:17:34 | 2020-11-05T15:10:37 | HTML | UTF-8 | Java | false | false | 35 | java | package p4_group_8_repo.Game_actor; | [
"[email protected]"
] | |
3a5b966eb9ca1c3d46ca68150f2bdbbb5028e71d | a744882fb7cf18944bd6719408e5a9f2f0d6c0dd | /sourcecode7/src/java/awt/peer/WindowPeer.java | 7a4df1c35380bf60b5fa8ae590538ab6f7477025 | [
"Apache-2.0"
] | permissive | hanekawasann/learn | a39b8d17fd50fa8438baaa5b41fdbe8bd299ab33 | eef678f1b8e14b7aab966e79a8b5a777cfc7ab14 | refs/heads/master | 2022-09-13T02:18:07.127489 | 2020-04-26T07:58:35 | 2020-04-26T07:58:35 | 176,686,231 | 0 | 0 | Apache-2.0 | 2022-09-01T23:21:38 | 2019-03-20T08:16:05 | Java | UTF-8 | Java | false | false | 3,568 | java | /*
* Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.awt.peer;
import java.awt.*;
import java.awt.image.BufferedImage;
/**
* The peer interface for {@link Window}.
* <p>
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
* nor invoke any of the peer methods directly on the peer
* instances.
*/
public interface WindowPeer extends ContainerPeer {
/**
* Makes this window the topmost window on the desktop.
*
* @see Window#toFront()
*/
void toFront();
/**
* Makes this window the bottommost window on the desktop.
*
* @see Window#toBack()
*/
void toBack();
/**
* Sets if the window should always stay on top of all other windows or
* not.
*
* @param alwaysOnTop if the window should always stay on top of all other
* windows or not
* @see Window#setAlwaysOnTop(boolean)
*/
void setAlwaysOnTop(boolean alwaysOnTop);
/**
* Updates the window's focusable state.
*
* @see Window#setFocusableWindowState(boolean)
*/
void updateFocusableWindowState();
/**
* Sets if this window is blocked by a modal dialog or not.
*
* @param blocker the blocking modal dialog
* @param blocked {@code true} to block the window, {@code false}
* to unblock it
*/
void setModalBlocked(Dialog blocker, boolean blocked);
/**
* Updates the minimum size on the peer.
*
* @see Window#setMinimumSize(Dimension)
*/
void updateMinimumSize();
/**
* Updates the icons for the window.
*
* @see Window#setIconImages(java.util.List)
*/
void updateIconImages();
/**
* Sets the level of opacity for the window.
*
* @see Window#setOpacity(float)
*/
void setOpacity(float opacity);
/**
* Enables the per-pixel alpha support for the window.
*
* @see Window#setBackground(Color)
*/
void setOpaque(boolean isOpaque);
/**
* Updates the native part of non-opaque window.
*
* @see Window#setBackground(Color)
*/
void updateWindow();
/**
* Instructs the peer to update the position of the security warning.
*/
void repositionSecurityWarning();
}
| [
"[email protected]"
] | |
4ecca906ba95a7631256867d03a1b4112c929b80 | 660e7190772cc129ddf36df0621d23b2fec9d08d | /src/test/decoratores/MinorMatrixTest.java | 3c9b68a83b337e8f81419aa9b10b0fce157c54fd | [] | no_license | inhabitantNewCity/decorator_commands | 412838ef62b1a11e164bb790286a3f4abdcab937 | c0b7cd0181b67d0cbcdf957b28d91d03ac188cc9 | refs/heads/master | 2020-03-16T21:24:16.300956 | 2018-05-11T15:44:20 | 2018-05-11T15:44:20 | 132,997,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,579 | java | package test.decoratores;
import main.decoratores.BaseMatrix;
import main.decoratores.IMatrix;
import main.decoratores.MinorMatrix;
import org.junit.Test;
import static org.junit.Assert.*;
public class MinorMatrixTest {
@Test
public void getElement() {
Number[][] elements = {{1,2,3}, {3,1,2}, {2,1,3}};
int[] indexes = {1,1};
IMatrix matrix = new BaseMatrix(elements);
matrix = new MinorMatrix(matrix, indexes);
assertEquals(1, matrix.getElement(0,0));
}
@Test
public void getElementNull() {
Number[][] elements = {{1,2,3}, {3,1,2}, {2,1,3}};
int[] indexes = {1,1,1,2};
IMatrix matrix = new BaseMatrix(elements);
matrix = new MinorMatrix(matrix, indexes);
assertNull(matrix.getElement(0,0));
}
@Test
public void getElementNullInd() {
Number[][] elements = {{1,2,3}, {3,1,2}, {2,1,3}};
int[] indexes = {1,7};
IMatrix matrix = new BaseMatrix(elements);
matrix = new MinorMatrix(matrix, indexes);
assertNull(matrix.getElement(1,7));
}
@Test
public void getElementNullInds() {
Number[][] elements = {{1,2,3}, {3,1,2}, {2,1,3}};
int[] indexes = {1,7};
IMatrix matrix = new BaseMatrix(elements);
matrix = new MinorMatrix(matrix, indexes);
assertNull(matrix.getElement(1,1));
}
@Test
public void getElementEmptyInd() {
Number[][] elements = {{1,2,3}, {3,1,2}, {2,1,3}};
int[] indexes = {};
IMatrix matrix = new BaseMatrix(elements);
matrix = new MinorMatrix(matrix, indexes);
assertNull(matrix.getElement(0,0));
}
@Test
public void getN() {
Number[][] elements = {{1,2,3}, {3,1,2}, {2,1,3}};
int[] indexes = {1,1};
IMatrix matrix = new BaseMatrix(elements);
matrix = new MinorMatrix(matrix, indexes);
assertEquals(2, matrix.getN());
}
@Test
public void getNNull() {
Number[][] elements = {{1,2,3}, {3,1,2}, {2,1,3}};
int[] indexes = {1,1,1,1,1};
IMatrix matrix = new BaseMatrix(elements);
matrix = new MinorMatrix(matrix, indexes);
assertEquals(-1, matrix.getN());
}
@Test
public void revertOperation() {
Number[][] elements = {{1,2,3}, {3,1,2}, {2,1,3}};
int[] indexes = {1,1,1,1,1};
IMatrix matrix = new BaseMatrix(elements);
matrix = new MinorMatrix(matrix, indexes);
matrix = matrix.revertOperation();
assertEquals(1, matrix.getElement(0,0));
}
} | [
"[email protected]"
] | |
508441db14537ef3654be77c5a81181c80be4d7b | 59147fc9e2064b2e76b590d1b852e46c8c02135a | /tools_java/verdant/demo/demo-common/src/main/java/com/verdant/demo/common/base/GenTimestamp.java | cd1c77031ddc2e19358cda1153bccabf711f8ed7 | [] | no_license | verdantyang/verdant | 17fb495088795945bdd87176afdb208a055786d3 | c9c174aa93494ac4f92c33ae9763e0e9ed868995 | refs/heads/master | 2022-11-07T12:49:53.025081 | 2020-07-20T02:12:28 | 2020-07-20T02:12:28 | 38,293,154 | 5 | 3 | null | 2022-10-04T23:44:06 | 2015-06-30T07:01:16 | Java | UTF-8 | Java | false | false | 759 | java | package com.verdant.demo.common.base;
import java.util.Calendar;
import java.util.Date;
/**
* 获取时间戳
*
* @author verdant
* @since 2016/07/27
*/
public class GenTimestamp {
private static long getMillis1() {
return System.currentTimeMillis();
}
private static long getMillis2() {
return new Date().getTime();
}
private static long getMillis3() {
return Calendar.getInstance().getTimeInMillis();
}
private static long getNano() {
return System.nanoTime();
}
public static void main(String[] args) {
System.out.println(getMillis1());
System.out.println(getMillis2());
System.out.println(getMillis3());
System.out.println(getNano());
}
}
| [
"[email protected]"
] | |
75f5ec6d8f9aed35b255d0a98a07d96d957ae154 | fb3c113fb60b1d42adc1fbade3d9d07cf0893563 | /MementoJava/src/mementojava/memento/Originator.java | 0b38f00acd52173f65355bec3e0fc825cea9ec51 | [] | no_license | emanuelcortez32/PatronesDeDise-oJAVA | 963ca7a6696eaae541f5a3085a6624aac94228c5 | a277b09c573f9ae4fa93ce072c28a72bbf9e0bd4 | refs/heads/master | 2020-04-14T11:53:05.654267 | 2019-01-02T10:14:39 | 2019-01-02T10:14:39 | 163,825,365 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | 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 mementojava.memento;
/**
*
* @author emanuel
*/
//CLASE QUE SABE COMO GUARDAR EL OBJETO
public class Originator {
private Juego estado;
public Juego getEstado() {
return estado;
}
public void setEstado(Juego estado) {
this.estado = estado;
}
public Memento guardar(){
return new Memento(estado);
}
public void restaurar(Memento m){
this.estado = m.getEstado();
}
}
| [
"[email protected]"
] | |
16175e61ce97be878cf6390633f0a7f706990a9e | e83a8f64cfdd9baa787a81d857ed5399ff3e9887 | /src/main/java/com/sberbank/dictionaryapp/servicies/CityService.java | 017d848df64dd3b46a0681184884f3273eb5bfe0 | [] | no_license | MaxZhivYN/DictionaryApp | 9949ac8c71bbab33c852bf8e609f23e9af899698 | cf47fe405796e58333c986858de880526e3a7bbd | refs/heads/main | 2023-08-17T15:15:05.364162 | 2021-10-05T14:45:07 | 2021-10-05T14:45:07 | 413,809,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,213 | java | package com.sberbank.dictionaryapp.servicies;
import com.sberbank.dictionaryapp.Entitis.City;
import com.sberbank.dictionaryapp.data.DataParser;
import com.sberbank.dictionaryapp.repositories.CityRepository;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import java.io.FileNotFoundException;
import java.text.ParseException;
import java.util.*;
@Service
public class CityService {
private final CityRepository cityRepository;
private final DataParser dataParser;
public CityService(CityRepository cityRepository, DataParser dataParser) {
this.cityRepository = cityRepository;
this.dataParser = dataParser;
}
public void exitApplication(ApplicationContext applicationContext) {
SpringApplication.exit(applicationContext, () -> 0);
}
public List<City> getCities() {
return cityRepository.findAll();
}
public void saveCitiesFromFile() {
try {
cityRepository.saveAll(dataParser.parseData());
} catch (FileNotFoundException | ParseException e) {
e.printStackTrace();
}
}
public List<City> getCitiesOrderByName() {
return cityRepository.findAll(Sort.by(Sort.Order.asc("name").ignoreCase()));
}
public List<City> getCitiesOrderByDistrictAndName() {
List<Sort.Order> orders = new ArrayList<>();
orders.add(new Sort.Order(Sort.Direction.ASC, "district"));
orders.add(new Sort.Order(Sort.Direction.ASC, "name"));
return cityRepository.findAll(Sort.by(orders));
}
public City getCityWithMaxPopulation() {
List<City> cities = cityRepository.findAll();
if (!cities.isEmpty()) {
return Collections.max(cities, Comparator.comparing(City::getPopulation));
}
return null;
}
public Map<String, Integer> getRegionAndCountOfCity() {
Map<String, Integer> dictionary = new HashMap<>();
cityRepository.findAll().forEach(city -> dictionary.merge(city.getRegion(), 1, (o, n) -> 1 + n));
return dictionary;
}
}
| [
"[email protected]"
] | |
bc7128b1bdcbf0925c6c536ac7b95121bad6aa30 | f787964b2eb70971c558892c37f3036dda7f5cb8 | /.JETEmitters/src/org/talend/designer/codegen/translators/file/output/TFileOutputJSONSparkstreamingcodeJava.java | 2e4715b45a1e77799c489087e3139577ed0aeb22 | [] | no_license | sharrake/SampleTalendWorkspace | 1746e1600ec667efc8a929c8fc33ca1e3d1f09f5 | b518c24aca165408eaef0353a7bb208ac4c9bd96 | refs/heads/master | 2021-01-10T04:19:48.039640 | 2015-11-23T11:16:36 | 2015-11-23T11:16:36 | 46,714,207 | 0 | 4 | null | null | null | null | UTF-8 | Java | false | false | 12,612 | java | package org.talend.designer.codegen.translators.file.output;
import java.util.List;
import java.util.Map;
import org.talend.core.model.metadata.IMetadataColumn;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.types.JavaType;
import org.talend.core.model.metadata.types.JavaTypesManager;
import org.talend.core.model.process.EConnectionType;
import org.talend.core.model.process.ElementParameterParser;
import org.talend.core.model.process.IConnection;
import org.talend.core.model.process.IConnectionCategory;
import org.talend.core.model.process.INode;
import org.talend.designer.common.BigDataCodeGeneratorArgument;
public class TFileOutputJSONSparkstreamingcodeJava
{
protected static String nl;
public static synchronized TFileOutputJSONSparkstreamingcodeJava create(String lineSeparator)
{
nl = lineSeparator;
TFileOutputJSONSparkstreamingcodeJava result = new TFileOutputJSONSparkstreamingcodeJava();
nl = null;
return result;
}
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
protected final String TEXT_1 = NL + "\t";
protected final String TEXT_2 = NL + "\tpublic static class ";
protected final String TEXT_3 = "StructOutputFormat extends FileOutputFormat<NullWritable, ";
protected final String TEXT_4 = "> {" + NL + "" + NL + "\t\tprivate ContextProperties context;" + NL + "" + NL + "\t\tprotected static class HDFSRecordWriter implements RecordWriter<NullWritable, ";
protected final String TEXT_5 = "> {" + NL + "\t\t\tprotected DataOutputStream out;" + NL + "\t\t\tprivate ContextProperties context;" + NL + "\t\t\t";
protected final String TEXT_6 = NL + "\t\t\t\tprivate org.json.simple.JSONArray jsonSet_";
protected final String TEXT_7 = ";" + NL + "\t\t\t\tprivate org.json.simple.JSONObject jsonOut_";
protected final String TEXT_8 = ";" + NL + "\t\t\t";
protected final String TEXT_9 = NL + "\t\t\tprivate org.json.simple.JSONObject jsonRow_";
protected final String TEXT_10 = ";" + NL + "" + NL + "\t\t\tpublic HDFSRecordWriter(DataOutputStream out, JobConf job) {" + NL + "\t\t\t\tthis.out = out;" + NL + "\t\t\t\tthis.context = new ContextProperties(job);" + NL + "\t\t\t\t";
protected final String TEXT_11 = "\t" + NL + "\t\t\t\t\tthis.jsonSet_";
protected final String TEXT_12 = " = new org.json.simple.JSONArray();" + NL + "\t\t\t\t\tjsonOut_";
protected final String TEXT_13 = " = new org.json.simple.JSONObject();" + NL + "\t\t\t\t";
protected final String TEXT_14 = NL + "\t\t\t\t\tjsonRow_";
protected final String TEXT_15 = " = new org.json.simple.JSONObject();" + NL + "\t\t\t\t";
protected final String TEXT_16 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate void writeObject(";
protected final String TEXT_17 = " value) throws IOException {" + NL + "\t\t\t\t";
protected final String TEXT_18 = NL + "\t\t\t\t\tjsonRow_";
protected final String TEXT_19 = " = new org.json.simple.JSONObject();" + NL + "\t\t\t\t";
protected final String TEXT_20 = NL + "\t\t\t\t";
protected final String TEXT_21 = NL + "\t\t\t\t \tif(value.";
protected final String TEXT_22 = " != null){" + NL + "\t\t\t\t ";
protected final String TEXT_23 = NL + "\t\t\t\t\t\tjsonRow_";
protected final String TEXT_24 = ".put(\"";
protected final String TEXT_25 = "\", FormatterUtils.format_DateInUTC(value.";
protected final String TEXT_26 = ", ";
protected final String TEXT_27 = "));" + NL + "\t\t\t\t\t";
protected final String TEXT_28 = NL + "\t\t\t\t\t\tjsonRow_";
protected final String TEXT_29 = ".put(\"";
protected final String TEXT_30 = "\", String.valueOf(value.";
protected final String TEXT_31 = "));" + NL + "\t\t\t\t\t";
protected final String TEXT_32 = NL + "\t\t\t\t\t\tjsonRow_";
protected final String TEXT_33 = ".put(\"";
protected final String TEXT_34 = "\", value.";
protected final String TEXT_35 = ");" + NL + "\t\t\t\t\t";
protected final String TEXT_36 = NL + "\t\t\t\t\t\t}else{" + NL + "\t\t\t\t\t\t\tjsonRow_";
protected final String TEXT_37 = ".put(\"";
protected final String TEXT_38 = "\", null);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t";
protected final String TEXT_39 = NL + "\t\t\t\t";
protected final String TEXT_40 = NL + "\t\t\t\t\tjsonSet_";
protected final String TEXT_41 = ".add(jsonRow_";
protected final String TEXT_42 = ");" + NL + "\t\t\t\t";
protected final String TEXT_43 = NL + "\t\t\t\t\t\tout.write(jsonRow_";
protected final String TEXT_44 = ".toString().getBytes(";
protected final String TEXT_45 = "));" + NL + "\t\t\t\t\t\tout.write(\"\\n\".getBytes(";
protected final String TEXT_46 = "));" + NL + "\t\t\t\t\t";
protected final String TEXT_47 = NL + "\t\t\t\t\t\tout.write(jsonRow_";
protected final String TEXT_48 = ".toString().getBytes());" + NL + "\t\t\t\t\t\tout.write(\"\\n\".getBytes());" + NL + "\t\t\t\t\t";
protected final String TEXT_49 = NL + "\t\t\t\t";
protected final String TEXT_50 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\tpublic synchronized void write(NullWritable key, ";
protected final String TEXT_51 = " value)" + NL + "\t\t\t\t\tthrows IOException {" + NL + "\t\t\t\tboolean nullValue = value == null;" + NL + "\t\t\t\tif (nullValue) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\twriteObject(value);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tpublic synchronized void close(Reporter reporter) throws IOException {" + NL + "\t\t\t\t";
protected final String TEXT_52 = NL + "\t\t\t\t\tjsonOut_";
protected final String TEXT_53 = ".put(";
protected final String TEXT_54 = ",jsonSet_";
protected final String TEXT_55 = ");" + NL + "\t\t\t\t\t";
protected final String TEXT_56 = NL + "\t\t\t\t\t\tout.write(jsonOut_";
protected final String TEXT_57 = ".toString().getBytes(";
protected final String TEXT_58 = "));" + NL + "\t\t\t\t\t";
protected final String TEXT_59 = "\t" + NL + "\t\t\t\t\t\tout.write(jsonOut_";
protected final String TEXT_60 = ".toString().getBytes());" + NL + "\t\t\t\t\t";
protected final String TEXT_61 = NL + " \t\t\t\t";
protected final String TEXT_62 = NL + "\t\t\t\tout.close();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\tpublic RecordWriter<NullWritable, ";
protected final String TEXT_63 = "> getRecordWriter(" + NL + "\t\t\t\tFileSystem ignored, JobConf job, String name, Progressable progress) throws IOException{" + NL + "\t\t\t\tthis.context = new ContextProperties(job);" + NL + "\t\t\t\tPath file = FileOutputFormat.getTaskOutputPath(job, name);" + NL + "\t\t\t\tFileSystem fs = file.getFileSystem(job);" + NL + "\t\t\t\tDataOutputStream fileOut = fs.create(file, progress);" + NL + "\t\t\t\treturn new HDFSRecordWriter(fileOut, job);" + NL + "\t\t\t}" + NL + "\t\t}";
public String generate(Object argument)
{
final StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(TEXT_1);
BigDataCodeGeneratorArgument codeGenArgument = (BigDataCodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
String inConnName = null;
String connTypeName = null;
List<IMetadataColumn> inColumnsTemp = null;
List<? extends IConnection> inConns = node.getIncomingConnections();
if(inConns != null){
for(IConnection inConn : inConns){
if(inConn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)){
inConnName = inConn.getName();
inColumnsTemp = inConn.getMetadataTable().getListColumns();
connTypeName = codeGenArgument.getRecordStructName(inConn);
break;
}
}
}
List<IMetadataColumn> inColumns = inColumnsTemp;
if(inConnName == null || inColumns == null || inColumns.size() == 0){
return "";
}
String datablockname = ElementParameterParser.getValue(node, "__DATABLOCKNAME__");
String type = ElementParameterParser.getValue(node, "__TYPE__");
boolean customEncoding = "true".equals(ElementParameterParser.getValue(node, "__CUSTOM_ENCODING__"));
String encoding = ElementParameterParser.getValue(node,"__ENCODING__");
boolean allInOne = "ALL_IN_ONE".equals(type);
stringBuffer.append(TEXT_2);
stringBuffer.append(cid);
stringBuffer.append(TEXT_3);
stringBuffer.append(connTypeName);
stringBuffer.append(TEXT_4);
stringBuffer.append(connTypeName);
stringBuffer.append(TEXT_5);
if(allInOne){
stringBuffer.append(TEXT_6);
stringBuffer.append(cid);
stringBuffer.append(TEXT_7);
stringBuffer.append(cid);
stringBuffer.append(TEXT_8);
}
stringBuffer.append(TEXT_9);
stringBuffer.append(cid);
stringBuffer.append(TEXT_10);
if(allInOne){
stringBuffer.append(TEXT_11);
stringBuffer.append(cid);
stringBuffer.append(TEXT_12);
stringBuffer.append(cid);
stringBuffer.append(TEXT_13);
}else{
stringBuffer.append(TEXT_14);
stringBuffer.append(cid);
stringBuffer.append(TEXT_15);
}
stringBuffer.append(TEXT_16);
stringBuffer.append(connTypeName);
stringBuffer.append(TEXT_17);
if(allInOne){
stringBuffer.append(TEXT_18);
stringBuffer.append(cid);
stringBuffer.append(TEXT_19);
}
stringBuffer.append(TEXT_20);
for(IMetadataColumn column : inColumns){
String columnName = column.getLabel();
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
String pattern = column.getPattern() == null || column.getPattern().trim().length() == 0 ? null : column.getPattern();
boolean isPrimitive = JavaTypesManager.isJavaPrimitiveType(javaType, column.isNullable());
if(!isPrimitive){
stringBuffer.append(TEXT_21);
stringBuffer.append(columnName);
stringBuffer.append(TEXT_22);
}
if(javaType == JavaTypesManager.DATE && pattern != null && pattern.trim().length() != 0){
stringBuffer.append(TEXT_23);
stringBuffer.append(cid);
stringBuffer.append(TEXT_24);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_25);
stringBuffer.append(columnName);
stringBuffer.append(TEXT_26);
stringBuffer.append(pattern);
stringBuffer.append(TEXT_27);
}else if(javaType == JavaTypesManager.CHARACTER){
stringBuffer.append(TEXT_28);
stringBuffer.append(cid);
stringBuffer.append(TEXT_29);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_30);
stringBuffer.append(columnName);
stringBuffer.append(TEXT_31);
}else{
stringBuffer.append(TEXT_32);
stringBuffer.append(cid);
stringBuffer.append(TEXT_33);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_34);
stringBuffer.append(columnName);
stringBuffer.append(TEXT_35);
}
if(!isPrimitive){
stringBuffer.append(TEXT_36);
stringBuffer.append(cid);
stringBuffer.append(TEXT_37);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_38);
}
}
stringBuffer.append(TEXT_39);
if(allInOne){
stringBuffer.append(TEXT_40);
stringBuffer.append(cid);
stringBuffer.append(TEXT_41);
stringBuffer.append(cid);
stringBuffer.append(TEXT_42);
}else{
if (customEncoding) {
stringBuffer.append(TEXT_43);
stringBuffer.append(cid);
stringBuffer.append(TEXT_44);
stringBuffer.append(encoding);
stringBuffer.append(TEXT_45);
stringBuffer.append(encoding);
stringBuffer.append(TEXT_46);
} else {
stringBuffer.append(TEXT_47);
stringBuffer.append(cid);
stringBuffer.append(TEXT_48);
}
stringBuffer.append(TEXT_49);
}
stringBuffer.append(TEXT_50);
stringBuffer.append(connTypeName);
stringBuffer.append(TEXT_51);
if(allInOne){
stringBuffer.append(TEXT_52);
stringBuffer.append(cid);
stringBuffer.append(TEXT_53);
stringBuffer.append(datablockname);
stringBuffer.append(TEXT_54);
stringBuffer.append(cid);
stringBuffer.append(TEXT_55);
if (customEncoding) {
stringBuffer.append(TEXT_56);
stringBuffer.append(cid);
stringBuffer.append(TEXT_57);
stringBuffer.append(encoding);
stringBuffer.append(TEXT_58);
} else {
stringBuffer.append(TEXT_59);
stringBuffer.append(cid);
stringBuffer.append(TEXT_60);
}
stringBuffer.append(TEXT_61);
}
stringBuffer.append(TEXT_62);
stringBuffer.append(connTypeName);
stringBuffer.append(TEXT_63);
return stringBuffer.toString();
}
}
| [
"[email protected]"
] | |
c0ed40eb3f9d0a954a034f4a8ee0d6593f6f6f34 | bccb412254b3e6f35a5c4dd227f440ecbbb60db9 | /hl7/model/V2_7/group/ORDER_DETAIL_RSP_K31.java | e640e42924443372677185c5f9be0fe77cd01913 | [] | no_license | nlp-lap/Version_Compatible_HL7_Parser | 8bdb307aa75a5317265f730c5b2ac92ae430962b | 9977e1fcd1400916efc4aa161588beae81900cfd | refs/heads/master | 2021-03-03T15:05:36.071491 | 2020-03-09T07:54:42 | 2020-03-09T07:54:42 | 245,967,680 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 9,613 | java | package hl7.model.V2_7.group;
import hl7.bean.Structure;
import hl7.bean.group.Group;
import hl7.bean.message.MessageStructure;
import hl7.bean.segment.Segment;
public class ORDER_DETAIL_RSP_K31 extends hl7.model.V2_6.group.ORDER_DETAIL_RSP_K31{
public static final String VERSION = "2.7";
public static int SIZE = 4;
public Structure[][] components = new Structure[SIZE][];
public static Structure[] standard = new Structure[SIZE];
public static boolean[] optional = new boolean[SIZE];
public static boolean[] repeatable = new boolean[SIZE];
static{
standard[0]=hl7.pseudo.segment.RXO.CLASS;
standard[1]=hl7.pseudo.segment.NTE.CLASS;
standard[2]=hl7.pseudo.segment.RXR.CLASS;
standard[3]=hl7.pseudo.group.COMPONENTS_RSP_K31.CLASS;
optional[0]=false;
optional[1]=false;
optional[2]=false;
optional[3]=true;
repeatable [0]=false;
repeatable [1]=false;
repeatable [2]=false;
repeatable [3]=true;
}
@Override
public Group cloneClass(String originalVersion, String setVersion) {
hl7.pseudo.group.ORDER_DETAIL_RSP_K31 group = new hl7.pseudo.group.ORDER_DETAIL_RSP_K31();
group.originalVersion = originalVersion;
group.setVersion = setVersion;
return group;
}
public void setVersion(String setVersion) {
super.setVersion(setVersion);
this.setVersion = setVersion;
for(int i=0; i<components.length; i++){
Structure[] structures = components[i];
for(int c=0; structures!=null&&c<structures.length; c++){
Structure structure = components[i][c];
structure.setVersion(setVersion);
}
}
}
public void originalVersion(String originalVersion) {
super.originalVersion(originalVersion);
this.originalVersion = originalVersion;
for(int i=0; i<components.length; i++){
Structure[] structures = components[i];
for(int c=0; structures!=null&&c<structures.length; c++){
Structure structure = components[i][c];
structure.originalVersion(originalVersion);
}
}
}
public Structure[][] getComponents(){
if(setVersion.equals(VERSION)){
return components;
}else{
return super.getComponents();
}
}
public boolean needsNewGroup(String segmentType, Structure[] comps){
if(comps==null) return true;
//앱력 Segment의 위치 알아내기
int stdIndex = indexStandard(segmentType);
//현재 components의 마지막 객체 저장 위치 알아내기
int compIndex = -1;
for(int i=0; i<comps.length; i++){
if(comps[i]!=null) compIndex = i;
}
//입력 Segment의 위치가 components 마지막 객체 위치보다 같거나(중복저장) 뒤(추가) 인가?
return stdIndex>=compIndex;
}
public int indexStandard(String segmentType){
int stdIndex = -1;
for(int i=0; i<standard.length; i++){
Structure structure = standard[i];
if(structure instanceof Segment){
if(segmentType.equals(structure.getType())){
stdIndex = i;
break;
}
}else if(structure instanceof Group){
Group group = (Group)structure;
stdIndex = group.indexStandard(segmentType);
if(stdIndex>=0) break;
}
}
return stdIndex;
}
private boolean compiled = false; //최초 컴파일 여부 확인
public void decode(String message) throws Exception {
if(MessageStructure.getVersionCode(originalVersion)<MessageStructure.getVersionCode(VERSION)){
super.decode(message);
}else{
compiled = true; //최초 컴파일 여부 확인
char separator = MessageStructure.SEGMENT_TERMINATOR;
String[] comps = divide(message, separator);
if(comps==null) return;
int[] index = new int[2];
while(index[0]<comps.length && index[1]<SIZE){
decode(originalVersion, setVersion, VERSION, index, index[1], comps);
}
}
}
public void decode(String originalVersion, String setVersion, String VERSION, int[] index, int prevLength, String[] comps) throws Exception{
int[] newIndex = new int[]{index[0], 0};
while(newIndex[1]<standard.length){
Structure structure = standard[newIndex[1]];
if(comps.length<=newIndex[0]){
index[0]=newIndex[0];
return;
}
String comp = comps[newIndex[0]];
String segmentType = comp.substring(0, 3);
if(structure instanceof Segment){ //Segment일 때
String standardType = structure.getType();
if(segmentType.equals(standardType)){ //표준과 Type이 동일한가?
Segment segment = ((Segment)structure).cloneClass(originalVersion, setVersion);
segment.originalVersion(originalVersion);
segment.decode(comp);
addStructure(components, segment, newIndex[1]);
newIndex[0]++; //다음 comp 처리
}else{
newIndex[1]++; //다음 Segment와 비교
}
}else if(structure instanceof Group){
Group group = (Group)structure;
int stdIndex = group.indexStandard(segmentType);
if(stdIndex<0){
newIndex[1]++;
}else{
boolean needsNewGroup = group.needsNewGroup(segmentType, components[newIndex[1]]);
if(needsNewGroup){
Group newGroup = group.cloneClass(originalVersion, setVersion);
newGroup.originalVersion(originalVersion);
newGroup.decode(originalVersion, setVersion, VERSION, newIndex, prevLength, comps);
addStructure(components, newGroup, newIndex[1]);
newIndex[0]++;
}else{
group.decode(originalVersion, setVersion, VERSION, newIndex, prevLength, comps);
}
}
}
}
index[0]=newIndex[0];
}
public static void addStructure(Structure[][] components, Structure structure, int index){
if(components.length<=index) return;
Structure[] comps = components[index];
Structure[] newComps;
newComps = (comps==null)?new Structure[1]:new Structure[comps.length+1];
for(int i=0; i<newComps.length-1; i++) newComps[i]=comps[i];
newComps[newComps.length-1] = structure;
components[index] = newComps;
}
/* -----------------------------------------------------------------
* 이전 버전으로 매핑 components:구버전, subComponents:신버전
* 신버전 메시지-->구버전 파서(상위호환)
* -----------------------------------------------------------------
*/
public static void backward(Structure[][] components, Structure[][] subComponents, String originalVersion, String setVersion) throws Exception{
}
/* -----------------------------------------------------------------
* 이후 버전으로 매핑 components:구버전, subComponents:신버전
* 구버전 메시지-->신버전 파서(하위호환)
* -----------------------------------------------------------------
*/
public static void forward(Structure[][] components, Structure[][] subComponents, String originalVersion, String setVersion) throws Exception{
subComponents[0] = components[0];
subComponents[1] = components[1];
subComponents[2] = components[2];
subComponents[3] = components[3];
}
public String encode() throws Exception{
seekOriginalVersion = true; //가장 마지막 메소드에서 위치찾기 옵션 설정
return encode(null);
}
public String encode(Structure[][] subComponents) throws Exception{
if(seekOriginalVersion&&MessageStructure.getVersionCode(originalVersion)<MessageStructure.getVersionCode(VERSION)){ //실제 버전의 위치 찾기
//실제 버전이 현재 위치가 아닐 때
//실제 버전 위치 찾아가기
return super.encode(null);
}else{//실제 버전의 위치 찾기
seekOriginalVersion = false;
//실제 버전이 현재 위치일 때
if(setVersion.equals(VERSION)){ //설정 버전의 위치 찾기
//설정 버전이 현재 위치일 때
String message = this.makeMessage(components, VERSION);
return message;
}else{ //설정 버전의 위치 찾기
//설정 버전이 현재 위치가 아닐 때
if(MessageStructure.getVersionCode(setVersion)<MessageStructure.getVersionCode(VERSION)){ //버전으로 이동 방향 찾기
//설정 버전이 현재 버전보다 낮을 때 (backward)
hl7.model.V2_6.group.ORDER_DETAIL_RSP_K31 type = (hl7.model.V2_6.group.ORDER_DETAIL_RSP_K31)this;
type.backward(type.components, components, originalVersion, setVersion);
//}
return super.encode(components);
}else{ //버전으로 이동 방향 찾기
/*-------------------------------------------------------------
*설정 버전이 현재 버전보다 높을 때(forward)
*이후 버전으로 Casting 후 forward 호출
*마지막 버전은 생략
*-----------------------------------------------------------------
*/
encodeVersion = VERSION;
return this.encodeForward(encodeVersion, setVersion);
}
}
}
}
public String encodeForward(String encodeVersion, String setVersion) throws Exception{
//하위 버전으로 인코딩 시 해당 위치를 찾아 가도록 (메소드 오버라이딩 때문에 처음부터 다시 찾아가야 함)
if(encodeVersion.equals(VERSION)){
return null;
}else{
return super.encodeForward(encodeVersion, setVersion);
}
}
public String makeMessage(Structure[][] components, String version) throws Exception{
if(VERSION.equals(version)){
setCharacter(components, version);
String message = "";
char separator = MessageStructure.SEGMENT_TERMINATOR;
for(int i=0; i<SIZE; i++){
if(components[i]==null) continue;
for(int j=0; j<components[i].length; j++){
if(!repeatable[i]&&j>0) continue;
String segment = components[i][j].encode();
if(segment!=null){
if(message.length()>0) message += separator;
message += segment;
}
}
}
return (message.length()==0)?null:message;
}else{
return super.makeMessage(components, version);
}
}
}
| [
"[email protected]"
] | |
0f8c15ce6631f2c8312089701fff71bb8094bc3f | 757c1b5f9b2905ebf4365b8745701725c5a2a954 | /hero-manager-api/src/main/java/com/digitalinnovationone/heromanager/hero/manager/entity/Heroes.java | fce061d5f5bed9dbd49d701bf5f72be6e674c362 | [] | no_license | L-Finistao/HeroManager_API_Reativa_MARVEL_DC | 4240c74fd9a37b690cc01d234f1fb1dfacffca65 | 881da8e2f3e4b69634b9730975ca4479b6351bac | refs/heads/master | 2023-03-10T21:41:57.689805 | 2021-02-26T20:17:39 | 2021-02-26T20:17:39 | 342,614,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | package com.digitalinnovationone.heromanager.hero.manager.entity;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@Data
@NoArgsConstructor
@Entity
public class Heroes {
@Id
@Column(nullable = false,unique = true)
private Long id;
@Column(nullable = false,unique = true)
private String nome;
@Column(nullable = false)
private String universo;
@Column(nullable = false)
private String filmes;
public Heroes(Long id, String name, String universo, String filmes) {
this.id = id;
this.nome = name;
this.universo = universo;
this.filmes = filmes;
}
}
| [
"[email protected]"
] | |
c021c4530362b49d1169e0b7adb6088b999124f5 | 3dd613dbdabfaa5096f75ae075dcb2606e68ab62 | /test/de/mss/utils/logging/LoggingUtilTest.java | 9e4156c3167ae901eafaab5b562c6996195a7a09 | [] | no_license | MTschach/MssUtils | 9a5b6da2f0c2a4e60ddd2ba0e187e7297385158e | 3fed837296344229d9bbebcd7c7391c6b888c233 | refs/heads/master | 2023-02-09T08:26:38.586501 | 2023-02-03T09:39:26 | 2023-02-03T09:39:26 | 143,291,163 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,118 | java | package de.mss.utils.logging;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import org.junit.jupiter.api.Test;
import de.mss.utils.DateTimeTools;
import de.mss.utils.exception.MssException;
public class LoggingUtilTest {
@Test
public void testBigDecimal() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", BigDecimal.ONE, props);
props = LoggingUtil.addLogging("array", new BigDecimal[] {BigDecimal.TEN, BigDecimal.ZERO}, props);
props = LoggingUtil.addLogging("nullValue", (BigDecimal)null, props);
props = LoggingUtil.addLogging("nullArray", (BigDecimal[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", BigDecimal.ONE, null));
assertNull(LoggingUtil.addLogging("nullProps", new BigDecimal[] {BigDecimal.TEN, BigDecimal.ZERO}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {0} ] ", props.get("array"));
}
@Test
public void testBigInteger() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", BigInteger.ONE, props);
props = LoggingUtil.addLogging("array", new BigInteger[] {BigInteger.TEN, BigInteger.ZERO}, props);
props = LoggingUtil.addLogging("nullValue", (BigInteger)null, props);
props = LoggingUtil.addLogging("nullValue", (BigInteger[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", BigInteger.ONE, null));
assertNull(LoggingUtil.addLogging("nullProps", new BigInteger[] {BigInteger.TEN, BigInteger.ZERO}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {0} ] ", props.get("array"));
}
@Test
public void testBool() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", true, props);
props = LoggingUtil.addLogging("array", new boolean[] {true, false}, props);
props = LoggingUtil.addLogging("arrayNull", (boolean[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", true, null));
assertNull(LoggingUtil.addLogging("nullProps", new boolean[] {true, false}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("true", props.get("simple"));
assertEquals("[ size {2} [0] {true} [1] {false} ] ", props.get("array"));
}
@Test
public void testBoolean() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", Boolean.TRUE, props);
props = LoggingUtil.addLogging("array", new Boolean[] {Boolean.TRUE, Boolean.FALSE}, props);
props = LoggingUtil.addLogging("nullValue", (Boolean)null, props);
props = LoggingUtil.addLogging("nullValue", (Boolean[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", Boolean.TRUE, null));
assertNull(LoggingUtil.addLogging("nullProps", new Boolean[] {Boolean.TRUE, Boolean.FALSE}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("true", props.get("simple"));
assertEquals("[ size {2} [0] {true} [1] {false} ] ", props.get("array"));
}
@Test
public void testbyte() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", (byte)1, props);
props = LoggingUtil.addLogging("array", new byte[] {(byte)10, (byte)0}, props);
props = LoggingUtil.addLogging("arrayNull", (byte[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", (byte)1, null));
assertNull(LoggingUtil.addLogging("nullProps", new byte[] {(byte)10, (byte)0}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {0} ] ", props.get("array"));
}
@Test
public void testByte() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", Byte.valueOf("1"), props);
props = LoggingUtil.addLogging("array", new Byte[] {Byte.valueOf("10"), Byte.valueOf("0")}, props);
props = LoggingUtil.addLogging("nullValue", (Byte)null, props);
props = LoggingUtil.addLogging("nullValue", (Byte[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", Byte.valueOf("1"), null));
assertNull(LoggingUtil.addLogging("nullProps", new Byte[] {Byte.valueOf("10"), Byte.valueOf("0")}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {0} ] ", props.get("array"));
}
@Test
public void testDate() throws MssException {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", DateTimeTools.parseString2Date("2022-01-06 12:34:56"), props);
props = LoggingUtil
.addLogging(
"array",
new Date[] {DateTimeTools.parseString2Date("2021-12-31 23:59:59"), DateTimeTools.parseString2Date("2020-12-24 18:56:12")},
props);
props = LoggingUtil.addLogging("nullValue", (Date)null, props);
props = LoggingUtil.addLogging("nullValue", (Date[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", DateTimeTools.parseString2Date("2021-12-31 23:59:56"), null));
assertNull(
LoggingUtil
.addLogging(
"nullProps",
new Date[] {DateTimeTools.parseString2Date("2021-12-31 23:59:59"), DateTimeTools.parseString2Date("2020-12-24 18:56:12")},
null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("2022-01-06T12:34:56 +0100", props.get("simple"));
assertEquals("[ size {2} [0] {2021-12-31T23:59:59 +0100} [1] {2020-12-24T18:56:12 +0100} ] ", props.get("array"));
}
@Test
public void testdouble() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", 1.2, props);
props = LoggingUtil.addLogging("array", new double[] {10, 0.1}, props);
props = LoggingUtil.addLogging("arrayNull", (double[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", 1.2, null));
assertNull(LoggingUtil.addLogging("nullProps", new double[] {1.2, 1.1}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1.2", props.get("simple"));
assertEquals("[ size {2} [0] {10.0} [1] {0.1} ] ", props.get("array"));
}
@Test
public void testDouble() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", Double.valueOf(1.2), props);
props = LoggingUtil.addLogging("array", new Double[] {Double.valueOf(10), Double.valueOf(0.1)}, props);
props = LoggingUtil.addLogging("nullValue", (Double)null, props);
props = LoggingUtil.addLogging("nullValue", (Double[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", Double.valueOf(1.2), null));
assertNull(LoggingUtil.addLogging("nullProps", new Double[] {Double.valueOf(1.2), Double.valueOf(1.1)}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1.2", props.get("simple"));
assertEquals("[ size {2} [0] {10.0} [1] {0.1} ] ", props.get("array"));
}
@Test
public void testfloat() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", 1.2f, props);
props = LoggingUtil.addLogging("array", new float[] {10, 0.1f}, props);
props = LoggingUtil.addLogging("arrayNull", (float[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", 0.1f, null));
assertNull(LoggingUtil.addLogging("nullProps", new float[] {1, 0.9f}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1.2", props.get("simple"));
assertEquals("[ size {2} [0] {10.0} [1] {0.1} ] ", props.get("array"));
}
@Test
public void testFloat() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", Float.valueOf(1.2f), props);
props = LoggingUtil.addLogging("array", new Float[] {Float.valueOf(10), Float.valueOf(0.1f)}, props);
props = LoggingUtil.addLogging("nullValue", (Float)null, props);
props = LoggingUtil.addLogging("nullValue", (Float[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", Float.valueOf(1.2f), null));
assertNull(LoggingUtil.addLogging("nullProps", new Float[] {Float.valueOf(2.1f), Float.valueOf(1.1f)}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1.2", props.get("simple"));
assertEquals("[ size {2} [0] {10.0} [1] {0.1} ] ", props.get("array"));
}
@Test
public void testGetLogString() {
assertEquals("", LoggingUtil.getLogString(null));
Map<String, String> props = new HashMap<>();
assertEquals("", LoggingUtil.getLogString(props));
props = LoggingUtil.addLogging("intValue", 1, props);
props = LoggingUtil.addLogging("boolValue", true, props);
props = LoggingUtil.addLogging("stringValue", "String", props);
props = LoggingUtil.addLogging("object", new LoggingTestObject("testValue"), props);
assertEquals("boolValue {true} intValue {1} object {Name {testValue} } stringValue {String} ", LoggingUtil.getLogString(props));
}
@Test
public void testint() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", 1, props);
props = LoggingUtil.addLogging("array", new int[] {10, 1}, props);
props = LoggingUtil.addLogging("arrayNull", (int[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", 1, null));
assertNull(LoggingUtil.addLogging("nullProps", new int[] {3, 1}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {1} ] ", props.get("array"));
}
@Test
public void testInteger() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", Integer.valueOf(1), props);
props = LoggingUtil.addLogging("array", new Integer[] {Integer.valueOf(10), Integer.valueOf(1)}, props);
props = LoggingUtil.addLogging("nullValue", (Integer)null, props);
props = LoggingUtil.addLogging("nullValue", (Integer[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", Integer.valueOf(1), null));
assertNull(LoggingUtil.addLogging("nullProps", new Integer[] {Integer.valueOf(2), Integer.valueOf(4)}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {1} ] ", props.get("array"));
}
@Test
public void testList() {
final List<String> list = new ArrayList<>();
list.add("first");
list.add("second");
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("list", list, props);
props = LoggingUtil.addLogging("null", (List<?>)null, props);
assertNull(LoggingUtil.addLogging("null", list, null));
assertEquals(Integer.valueOf(1), Integer.valueOf(props.size()));
assertEquals("[ size {2} [0] {first} [1] {second} ] ", props.get("list"));
}
@Test
public void testlong() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", 1l, props);
props = LoggingUtil.addLogging("array", new long[] {10l, 1l}, props);
props = LoggingUtil.addLogging("arrayNull", (long[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", 1l, null));
assertNull(LoggingUtil.addLogging("nullProps", new long[] {2l, 1l}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {1} ] ", props.get("array"));
}
@Test
public void testLong() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", Long.valueOf(1), props);
props = LoggingUtil.addLogging("array", new Long[] {Long.valueOf(10), Long.valueOf(1)}, props);
props = LoggingUtil.addLogging("nullValue", (Long)null, props);
props = LoggingUtil.addLogging("nullValue", (Long[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", Long.valueOf(1), null));
assertNull(LoggingUtil.addLogging("nullProps", new Long[] {Long.valueOf(2), Long.valueOf(1)}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {1} ] ", props.get("array"));
}
@Test
public void testMap() {
final Map<String, String> list = new HashMap<>();
list.put("firstName", "firstValue");
list.put("secondName", "secondValue");
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("list", list, props);
props = LoggingUtil.addLogging("null", (List<?>)null, props);
assertNull(LoggingUtil.addLogging("null", list, null));
assertEquals(Integer.valueOf(1), Integer.valueOf(props.size()));
assertEquals("[ size {2} [firstName] {firstValue} [secondName] {secondValue} ] ", props.get("list"));
}
@Test
public void testMaxArrayLenght() {
LoggingUtil.setMaxArrayLength(2);
Map<String, String> props = new HashMap<>();
final Map<Integer, String> map = new HashMap<>();
map.put(Integer.valueOf(2), "first Entry");
map.put(Integer.valueOf(5), "second Entry");
map.put(Integer.valueOf(1), "third Entry");
props = LoggingUtil.addLogging("Map", map, props);
final String[] array = new String[3];
array[0] = "first String";
array[1] = "second String";
array[2] = "third String";
props = LoggingUtil.addLogging("Array", array, props);
final List<Integer> list = new ArrayList<>();
list.add(Integer.valueOf(10));
list.add(Integer.valueOf(8));
list.add(Integer.valueOf(25));
props = LoggingUtil.addLogging("List", list, props);
final Vector<String> vec = new Vector<>();
vec.add("first Vector");
vec.add("second Vector");
vec.add("third Vector");
props = LoggingUtil.addLogging("Vector", vec, props);
assertEquals(
"Array {[ size {3} [0] {first String} [1] {second String} ... ] } List {[ size {3} [0] {10} [1] {8} ... ] } Map {[ size {3} [1] {third Entry} [2] {first Entry} [5] {second Entry} ... ] } Vector {[ size {3} [0] {first Vector} [1] {second Vector} ... ] } ",
LoggingUtil.getLogString(props));
}
@Test
public void testObject() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", new LoggingTestObject("single"), props);
props = LoggingUtil.addLogging("array", new LoggingTestObject[] {new LoggingTestObject("first"), new LoggingTestObject("second")}, props);
props = LoggingUtil.addLogging("nullValue", (LoggingTestObject)null, props);
props = LoggingUtil.addLogging("nullValue", (LoggingTestObject[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", new LoggingTestObject("single"), null));
assertNull(
LoggingUtil.addLogging("nullProps", new LoggingTestObject[] {new LoggingTestObject("first"), new LoggingTestObject("second")}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("Name {single} ", props.get("simple"));
assertEquals("[ size {2} [0] {Name {first} } [1] {Name {second} } ] ", props.get("array"));
}
@Test
public void testshort() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", (short)1, props);
props = LoggingUtil.addLogging("array", new short[] {10, 1}, props);
props = LoggingUtil.addLogging("arrayNull", (short[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", (short)1, null));
assertNull(LoggingUtil.addLogging("nullProps", new short[] {(short)1, (short)0}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {1} ] ", props.get("array"));
}
@Test
public void testShort() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", Short.valueOf("1"), props);
props = LoggingUtil.addLogging("array", new Short[] {Short.valueOf("10"), Short.valueOf("1")}, props);
props = LoggingUtil.addLogging("nullValue", (Short)null, props);
props = LoggingUtil.addLogging("nullValue", (Short[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", Short.valueOf("1"), null));
assertNull(LoggingUtil.addLogging("nullProps", new Short[] {Short.valueOf("3"), Short.valueOf("1")}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {1} ] ", props.get("array"));
}
@Test
public void testString() {
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("simple", "1", props);
props = LoggingUtil.addLogging("array", new String[] {"10", "1"}, props);
props = LoggingUtil.addLogging("nullValue", (String)null, props);
props = LoggingUtil.addLogging("nullValue", (String[])null, props);
assertNull(LoggingUtil.addLogging("nullProps", "1", null));
assertNull(LoggingUtil.addLogging("nullProps", new String[] {"3", "1"}, null));
assertEquals(Integer.valueOf(2), Integer.valueOf(props.size()));
assertEquals("1", props.get("simple"));
assertEquals("[ size {2} [0] {10} [1] {1} ] ", props.get("array"));
}
@Test
public void testVector() {
final Vector<String> list = new Vector<>();
list.add("first");
list.add("second");
Map<String, String> props = new HashMap<>();
props = LoggingUtil.addLogging("list", list, props);
props = LoggingUtil.addLogging("null", (List<?>)null, props);
assertNull(LoggingUtil.addLogging("null", list, null));
assertEquals(Integer.valueOf(1), Integer.valueOf(props.size()));
assertEquals("[ size {2} [0] {first} [1] {second} ] ", props.get("list"));
}
}
| [
"[email protected]"
] | |
19a95e3364d488a11d53747a887a8f6d9bed2a30 | 208ac6bb8a2f9b78c6afa15d255814200733de59 | /BOJ/boj_9093.java | c116c3b691134b7262f370b988e43f094371179c | [] | no_license | yagee97/algorithm | 2832e976b13df6a431c1a02aab400a943b099bd0 | f40918e810fee1d5f78894461e9b5c4b9cf61fe2 | refs/heads/master | 2021-06-05T12:27:43.911932 | 2020-07-25T14:19:48 | 2020-07-25T14:19:48 | 140,398,432 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,067 | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
import java.util.StringTokenizer;
// 단어 뒤집기
public class boj_9093 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N= Integer.parseInt(br.readLine());
for (int tc = 0; tc < N; tc++) {
StringBuilder sb = new StringBuilder();
StringBuilder ret = new StringBuilder();
String original = br.readLine();
for (int i = 0; i < original.length(); i++) {
char c = original.charAt(i);
if(c != ' ') {
sb.append(c);
}
else if(c == ' ') {
String str = reverse(sb.toString());
ret.append(str+" ");
sb = new StringBuilder();
}
if(i == original.length()-1) {
String str = reverse(sb.toString());
ret.append(str);
}
}
System.out.println(ret.toString());
}
}
private static String reverse(String str) {
return new StringBuffer(str).reverse().toString();
}
}
| [
"[email protected]"
] | |
615e9258f40fad8e4738c157d5319f5c9e587c56 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_fb1401f3b4c193b646ffe3504f2769a065f4c01f/DatabaseConnector/2_fb1401f3b4c193b646ffe3504f2769a065f4c01f_DatabaseConnector_s.java | 2bbb2ce163f548c3ae95f3410130a4ffa7565fc6 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 9,663 | java | import java.sql.*;
import javax.sql.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
class DatabaseConnector {
private static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
private static final String DB_URL = "jdbc:mysql://localhost/vcf_analyzer";
static final String USER = "vcf_user";
static final String PASS = "vcf";
private static final ArrayList<String> EntryFixedInfo = new ArrayList<String>(
Arrays.asList("CHROM", "FILTER", "ID", "POS", "REF", "QUAL", "ALT"));
private Connection conn;
private Statement stmt;
private ArrayList<Statement> stmtList;
public DatabaseConnector() throws SQLException, ClassNotFoundException {
try{
this.conn = null;
this.stmt = null;
Class.forName(JDBC_DRIVER);
conn = DriverManager.getConnection(DB_URL, USER, PASS);
stmt = conn.createStatement();
}
catch (Exception e) {
throw new SQLException("Could not connect to database");
}
}
public long getVcfId(String vcfName) throws IllegalArgumentException,
SQLException {
String sql = "";
try {
sql = "SELECT `VcfId` FROM `vcf_analyzer`.`Vcf` WHERE `VcfName` = '"
+ vcfName + "'";
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
long id = Long.parseLong(rs.getString("VcfId"));
rs.close();
return id;
}
throw new IllegalArgumentException("VCF: " + vcfName + " not found");
} catch (SQLException se) {
throw new SQLException("Invalid Query " + sql);
}
}
public String getVcfHeader(long vcfId) throws IllegalArgumentException,
SQLException {
String sql = "";
try {
sql = "SELECT `Header` FROM `vcf_analyzer`.`VcfHeader` WHERE `VcfId` = '"
+ vcfId + "'";
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
String result = rs.getString("Header");
rs.close();
return result;
}
throw new IllegalArgumentException("VCF header for: " + vcfId
+ " not found");
} catch (SQLException se) {
throw new SQLException("Invalid Query: " + sql);
}
}
public int createFilter(String filterName) throws SQLException, ClassNotFoundException {
String sql = null;
try {
sql = String.format("INSERT into `Filter` VALUES (NULL, '%s', '0');", filterName);
this.stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS);
ResultSet rs = this.stmt.getGeneratedKeys();
rs.next();
return rs.getInt(1);
} catch(SQLException se) {
throw new SQLException(se.getMessage());
}
}
public int createFilterEntry(int filterID, int operator, String infoName, String[] operands) throws SQLException {
String sql = null;
try {
if (operands.length == 1) {
sql = String.format("INSERT INTO `vcf_analyzer`.`FilterEntry` VALUES (NULL, '%s', '%s', '%d', '%s');",
filterID, infoName, operator, operands[0]);
} else if (operands.length == 2) {
sql = String.format("INSERT INTO `vcf_analyzer`.`FilterEntry` VALUES (NULL, '%s', '%s', '%d', '%s', '%s');",
filterID, infoName, operator, operands[0], operands[1]);
} else if (operands.length == 0) {
System.out.println("No operands given");
return 0;
} else {
System.out.println("Too many operands given");
return 0;
}
System.out.println(sql);
this.stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS);
ResultSet rs = this.stmt.getGeneratedKeys();
rs.next();
int filterEntryID = rs.getInt(1);
return filterEntryID;
} catch(SQLException se) {
throw new SQLException(se.getMessage());
}
}
public int getFilterID(String filterName) throws IllegalArgumentException,
SQLException {
String sql = "";
try {
sql = "SELECT `FilID` FROM `vcf_analyzer`.`Filter` WHERE `FilName` = '"
+ filterName + "'";
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
int id = Integer.parseInt(rs.getString("FilId"));
rs.close();
return id;
}
throw new IllegalArgumentException("Filter: " + filterName
+ " not found");
} catch (SQLException se) {
throw new SQLException("Invalid Query " + sql);
}
}
public ResultSet getVcfEntries(long vcfId) throws SQLException {
String sql = "";
try {
sql = "SELECT * FROM `vcf_analyzer`.`VcfEntry` WHERE `VcfId` = '"
+ vcfId + "' ORDER BY `EntryId` ASC";
ResultSet rs = stmt.executeQuery(sql);
return rs;
} catch (SQLException se) {
throw new SQLException("Invalid Query " + sql);
}
}
public ArrayList<String> getInfoTableNames() throws SQLException
{
String sql = "";
ArrayList<String> tables = new ArrayList<String>();
try
{
sql = "SELECT `InfoName` FROM `vcf_analyzer`.`InfoTable` ORDER BY `InfoName` ASC";
ResultSet rs = this.stmt.executeQuery(sql);
while (rs.next()) {
String infoName = rs.getString("InfoName");
if (! EntryFixedInfo.contains(infoName) ) {
tables.add(infoName);
}
}
rs.close();
return tables;
} catch (SQLException se) {
throw new SQLException("Invalid Query " + sql);
}
}
public ResultSet getInfoDatum(long entryId, String infoTableName ) throws SQLException {
String sql = "";
try {
if (! EntryFixedInfo.contains(infoTableName)) {
sql = String
.format("SELECT * FROM `vcf_analyzer`.`%s` WHERE `EntryId` = '%d'",
infoTableName, entryId);
ResultSet infoSet = this.stmt.executeQuery(sql);
return infoSet;
}
return null;
} catch (SQLException se) {
throw new SQLException("Invalid Query " + sql);
}
}
public ResultSet getIndividuals(long entryId) throws SQLException {
String sql = "";
try {
sql = "SELECT * FROM `vcf_analyzer`.`IndividualEntry` WHERE `EntryId` = '"
+ entryId + "' ORDER BY `IndID` ASC";
ResultSet rs = this.stmt.executeQuery(sql);
return rs;
} catch (SQLException se) {
throw new SQLException("Invalid Query " + sql);
}
}
public ResultSet getIndividualDatum(long indId,
String genotypeTableName) throws SQLException {
String sql = "";
try
{
sql = String
.format("SELECT * FROM `vcf_analyzer`.`%s` WHERE `IndID` = '%d'",
genotypeTableName, indId);
ResultSet infoSet = this.stmt.executeQuery(sql);
/*
if (!infoSet.isBeforeFirst()) {
// not empty
return infoSet;
}
*/
//return null;
return infoSet;
} catch (SQLException se) {
throw new SQLException("Invalid Query " + sql);
}
}
public void CloseConnection() throws SQLException {
if (this.conn != null) {
this.conn.close();
}
if (this.stmt != null) {
this.stmt.close();
}
if (this.stmtList != null )
{
for( Statement state : this.stmtList)
{
state.close();
}
}
}
private boolean hasOpenStatementAndConnection() throws SQLException {
return !this.conn.isClosed() && !this.stmt.isClosed();
}
private void reopenConnectionAndStatement() throws SQLException,
ClassNotFoundException {
if (this.conn == null || this.conn.isClosed())
this.conn = DriverManager.getConnection(DB_URL, USER, PASS);
if (this.stmt == null || this.stmt.isClosed())
this.stmt = this.conn.createStatement();
}
/**
*
* TODO consider refactoring to one general upload method
*
* @param name
*
* @param chromosome
* @param position
* @param divValue
* @return TODO
* @throws ClassNotFoundException
* @throws SQLException
*/
protected int uploadDivergence(String name, String chromosome,
int position, int divValue) throws ClassNotFoundException,
SQLException {
if (!hasOpenStatementAndConnection())
reopenConnectionAndStatement();
String sql = String
.format("INSERT into `Divergence` (`DivName`, `Chromosome`, `Position`, `DivValue`) VALUES ('%s','%s','%d','%d');",
name, chromosome, position, divValue);
int rs = this.stmt.executeUpdate(sql);
return rs;
}
/**
* TODO: Finish Testing
*
* @param tableName
* , String idName
*
* @return
* @throws SQLException
* @throws ClassNotFoundException
*/
private int getHighestId(String tableName, String idName)
throws ClassNotFoundException, SQLException {
if (!hasOpenStatementAndConnection())
reopenConnectionAndStatement();
String sql = String.format(
"SELECT %s FROM %s ORDER BY %s desc LIMIT 0,1;", idName,
tableName, idName);
ResultSet rs = this.stmt.executeQuery(sql);
return Integer.parseInt(rs.getString("DivID"));
}
/**
* TODO consider refactoring to one general upload method
*
* @param annoName
* @return TODO
* @throws ClassNotFoundException
* @throws SQLException
*/
protected int uploadAnnotation(String annoName, String chromosome,
int startPosition, int endPosition, String geneName, String geneDirection) throws ClassNotFoundException,
SQLException {
if (!hasOpenStatementAndConnection())
reopenConnectionAndStatement();
String sql = String
.format("INSERT into `Annotation` (`Chromosome`, `StartPosition`, `EndPosition`, `GeneName`, `GeneDirection`, `AnnoName`) VALUES ('%s','%d','%d','%s','%s','%s');",
chromosome, startPosition, endPosition,geneName, geneDirection,annoName);
int rs = this.stmt.executeUpdate(sql);
return rs;
}
}
| [
"[email protected]"
] | |
28d4304338adc1c6ad3f1b99654ec198adecaf0f | 0603c55b81898389f81b7dbb4f78f48e7070be70 | /SortingStringArray/src/Tester.java | e19325bad0f3122ee6922f2f10f3ee78b8e6aca1 | [] | no_license | Svvanson1/OLDLearningJava | fbbe6ff797cc13d32c77fc4497f57a9ccc5bdab9 | 8ee93566224c0a450ac44e3d8a907454c22b66ca | refs/heads/master | 2021-01-12T02:36:47.632054 | 2017-01-05T04:03:42 | 2017-01-05T04:03:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | import java.util.*;
public class Tester {
public static void main(String[] args) {
// TODO Auto-generated method stub
String ss[] = {"Bill", "Mary", "Lee", "Agnes", "Alfred", "Thomas", "Alvin", "Bernard", "Ezra", "Herman"};
Arrays.sort(ss);
for (int i = 0; i < ss.length; i++){
System.out.println(ss[i]);
}
}
}
| [
"[email protected]"
] | |
c7d1047e45af2986b966a0baedbd2a937b4e304f | 2afdc434064510869b75fe157b82b3440ddbb748 | /presto-spi/src/test/java/io/prestosql/spi/type/RowParametricTypeTest.java | ab6509308b06abbcb9d4bd329c143e7844edbdff | [] | no_license | openlookeng/hetu-core | 6dd74c62303f91d70e5eb6043b320054d1b4b550 | 73989707b733c11c74147d9228a0600e16fe5193 | refs/heads/master | 2023-09-03T20:27:49.706678 | 2023-06-26T09:51:37 | 2023-06-26T09:51:37 | 276,025,804 | 553 | 398 | null | 2023-09-14T17:07:01 | 2020-06-30T07:14:20 | Java | UTF-8 | Java | false | false | 1,470 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.prestosql.spi.type;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
import static org.testng.Assert.assertEquals;
public class RowParametricTypeTest
{
private RowParametricType rowParametricTypeUnderTest;
@BeforeMethod
public void setUp() throws Exception
{
rowParametricTypeUnderTest = null /* TODO: construct the instance */;
}
@Test
public void testGetName() throws Exception
{
assertEquals("row", rowParametricTypeUnderTest.getName());
}
@Test
public void testCreateType() throws Exception
{
// Setup
final List<TypeParameter> parameters = Arrays.asList(TypeParameter.of(0L));
// Run the test
final Type result = rowParametricTypeUnderTest.createType(null, parameters);
// Verify the results
}
}
| [
"[email protected]"
] | |
0f94e2f00d12c56e5a68986bfc89c12ff0487167 | 922edf0a17c089c02e36b9d64174596e707fac25 | /template/src/com/internousdev/template/dao/MyPageDAO.java | 7b96f3074446578afb94b17ba8629e1a29fbab14 | [] | no_license | shinnnosuke1109/ECsite | 20192872815ff58e0507c1ac849aca251eab4d0f | ec89d4f183bf8332d6f9fedf08450cec9d0abfa3 | refs/heads/master | 2020-03-27T00:46:35.064037 | 2018-08-31T01:24:58 | 2018-08-31T01:24:58 | 145,654,328 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,167 | java | package com.internousdev.template.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.internousdev.template.dto.MyPageDTO;
import com.internousdev.template.util.DBConnector;
public class MyPageDAO {
public MyPageDTO getMyPageUserInfo(String item_transaction_id, String user_master_id)
throws SQLException {
DBConnector dbConnector = new DBConnector();
Connection connection = dbConnector.getConnection();
MyPageDTO myPageDTO = new MyPageDTO();
String sql = "SELECT iit.item_name, ubit.total_price, ubit.total_count, ubit.pay FROM user_buy_item_transaction ubit LEFT JOIN item_info_transaction iit ON ubit.item_transaction_id = iit.id WHERE ubit.item_transaction_id = ? AND ubit.user_master_id = ? ORDER BY ubit.insert_date DESC";
try{
PreparedStatement preparedStatement = connection.prepareStatement(sql);
preparedStatement.setString(1, item_transaction_id);
preparedStatement.setString(2, user_master_id);
ResultSet resultSet = preparedStatement.executeQuery();
if(resultSet.next()) {
myPageDTO.setItemName(resultSet.getString("item_name"));
myPageDTO.setTotalPrice(resultSet.getString("total_price"));
myPageDTO.setTotalCount(resultSet.getString("total_count"));
myPageDTO.setPayment(resultSet.getString("pay"));
}
}catch (Exception e) {
e.printStackTrace();
}finally {
connection.close();
}
return myPageDTO;
}
public int buyItemHistoryDelete(String item_transaction_id, String user_master_id)
throws SQLException {
DBConnector dbConnector = new DBConnector();
Connection connection = dbConnector.getConnection();
String sql = "DELETE FROM user_buy_item_transaction WHERE item_transaction_id = ? AND user_master_id= ?";
PreparedStatement preparedStatement;
int result = 0;
try{
preparedStatement= connection.prepareStatement(sql);
preparedStatement.setString(1, item_transaction_id);
preparedStatement.setString(2, user_master_id);
result = preparedStatement.executeUpdate();
}catch(SQLException e) {
e.printStackTrace();
}finally{
connection.close();
}
return result;
}
}
| [
"[email protected]"
] | |
278b91dfbf3189149c5d5c516f647a1d64cc8cb2 | 984ea0a26012a67b4ae473830f4b3cb0c237e41e | /src/main/java/net/floodlightcontroller/core/web/AllSwitchStatisticsResource.java | f8509d9223e38b3f689edeb16d1be576e50a8c69 | [
"Apache-2.0"
] | permissive | sausab/floodlight | 34c1820496aac7dc268ce170b2a7ccce362caa2b | dfe45f8459dafc034627f655618fe031943c2832 | refs/heads/master | 2021-09-27T01:38:13.756002 | 2012-03-08T21:19:42 | 2012-03-08T21:19:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,580 | java | /**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* 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 net.floodlightcontroller.core.web;
import java.lang.Thread.State;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.floodlightcontroller.core.IFloodlightProviderService;
import net.floodlightcontroller.core.types.MacVlanPair;
import org.openflow.protocol.OFFeaturesReply;
import org.openflow.protocol.statistics.OFStatistics;
import org.openflow.protocol.statistics.OFStatisticsType;
import org.openflow.util.HexString;
import org.restlet.resource.Get;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Return switch statistics information for all switches
* @author readams
*/
public class AllSwitchStatisticsResource extends SwitchResourceBase {
protected static Logger log =
LoggerFactory.getLogger(AllSwitchStatisticsResource.class);
@Get("json")
public Map<String, Object> retrieve() {
String statType = (String) getRequestAttributes().get("statType");
return retrieveInternal(statType);
}
public Map<String, Object> retrieveInternal(String statType) {
HashMap<String, Object> model = new HashMap<String, Object>();
OFStatisticsType type = null;
REQUESTTYPE rType = null;
if (statType.equals("port")) {
type = OFStatisticsType.PORT;
rType = REQUESTTYPE.OFSTATS;
} else if (statType.equals("queue")) {
type = OFStatisticsType.QUEUE;
rType = REQUESTTYPE.OFSTATS;
} else if (statType.equals("flow")) {
type = OFStatisticsType.FLOW;
rType = REQUESTTYPE.OFSTATS;
} else if (statType.equals("aggregate")) {
type = OFStatisticsType.AGGREGATE;
rType = REQUESTTYPE.OFSTATS;
} else if (statType.equals("desc")) {
type = OFStatisticsType.DESC;
rType = REQUESTTYPE.OFSTATS;
} else if (statType.equals("table")) {
type = OFStatisticsType.TABLE;
rType = REQUESTTYPE.OFSTATS;
} else if (statType.equals("features")) {
rType = REQUESTTYPE.OFFEATURES;
} else if (statType.equals("host")) {
rType = REQUESTTYPE.SWITCHTABLE;
} else {
return model;
}
IFloodlightProviderService floodlightProvider =
(IFloodlightProviderService)getContext().getAttributes().
get(IFloodlightProviderService.class.getCanonicalName());
Long[] switchDpids = floodlightProvider.getSwitches().keySet().toArray(new Long[0]);
List<GetConcurrentStatsThread> activeThreads = new ArrayList<GetConcurrentStatsThread>(switchDpids.length);
List<GetConcurrentStatsThread> pendingRemovalThreads = new ArrayList<GetConcurrentStatsThread>();
GetConcurrentStatsThread t;
for (Long l : switchDpids) {
t = new GetConcurrentStatsThread(l, rType, type);
activeThreads.add(t);
t.start();
}
// Join all the threads after the timeout. Set a hard timeout
// of 12 seconds for the threads to finish. If the thread has not
// finished the switch has not replied yet and therefore we won't
// add the switch's stats to the reply.
for (int iSleepCycles = 0; iSleepCycles < 12; iSleepCycles++) {
for (GetConcurrentStatsThread curThread : activeThreads) {
if (curThread.getState() == State.TERMINATED) {
if (rType == REQUESTTYPE.OFSTATS) {
model.put(HexString.toHexString(curThread.getSwitchId()), curThread.getStatisticsReply());
} else if (rType == REQUESTTYPE.OFFEATURES) {
model.put(HexString.toHexString(curThread.getSwitchId()), curThread.getFeaturesReply());
} else if (rType == REQUESTTYPE.SWITCHTABLE) {
model.put(HexString.toHexString(curThread.getSwitchId()), getSwitchTableJson(curThread.getSwitchId()));
}
pendingRemovalThreads.add(curThread);
}
}
// remove the threads that have completed the queries to the switches
for (GetConcurrentStatsThread curThread : pendingRemovalThreads) {
activeThreads.remove(curThread);
}
// clear the list so we don't try to double remove them
pendingRemovalThreads.clear();
// if we are done finish early so we don't always get the worst case
if (activeThreads.isEmpty()) {
break;
}
// sleep for 1 s here
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
System.out.println("CoreWebManageable thread failed to sleep!");
e.printStackTrace();
}
}
return model;
}
protected class GetConcurrentStatsThread extends Thread {
private List<OFStatistics> switchReply;
private long switchId;
private OFStatisticsType statType;
private REQUESTTYPE requestType;
private OFFeaturesReply featuresReply;
private Map<MacVlanPair, Short> switchTable;
public GetConcurrentStatsThread(long switchId, REQUESTTYPE requestType, OFStatisticsType statType) {
this.switchId = switchId;
this.requestType = requestType;
this.statType = statType;
this.switchReply = null;
this.featuresReply = null;
this.switchTable = null;
}
public List<OFStatistics> getStatisticsReply() {
return switchReply;
}
public OFFeaturesReply getFeaturesReply() {
return featuresReply;
}
public Map<MacVlanPair, Short> getSwitchTable() {
return switchTable;
}
public long getSwitchId() {
return switchId;
}
public void run() {
IFloodlightProviderService floodlightProvider =
(IFloodlightProviderService)getContext().getAttributes().
get(IFloodlightProviderService.class.getCanonicalName());
if ((requestType == REQUESTTYPE.OFSTATS) && (statType != null)) {
switchReply = getSwitchStatistics(switchId, statType);
} else if (requestType == REQUESTTYPE.OFFEATURES) {
featuresReply = floodlightProvider.getSwitches().get(switchId).getFeaturesReply();
} else if (requestType == REQUESTTYPE.SWITCHTABLE) {
switchTable = floodlightProvider.getSwitches().get(switchId).getMacVlanToPortMap();
}
}
}
}
| [
"[email protected]"
] | |
c850a54180324d7a9abac5c601137c76946ca9e8 | 169c06871863ca0c249a1fbc16c5d1a7fc0621bb | /JavaOperator/src/array/InputSum.java | ecc64147038a76fa7c10c8e7c65f5fad94ea5b07 | [] | no_license | qhddlsthtjf/JavaOperator | b5ffe86a2d2e44bdeadea5f422d9a19a2fb0c59b | 994ba8c784db5ab33c4d150d1f25ed5268ec70b3 | refs/heads/master | 2021-01-25T04:01:36.797225 | 2015-07-13T06:17:02 | 2015-07-13T06:17:43 | 38,734,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 889 | java | package array;
import java.util.Scanner;
/*
* @ Date : 2015.07.13
* @ Author : me
* @ Story : int형(숫자형) 배열 입력 예제
* */
public class InputSum {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[] arr = new int[3];
int sum = 0, avg =0;
System.out.println("3개의 점수를 입력하세요");
for (int i = 0; i < arr.length; i++) {//배열에 값을 입력하라고 하면 무조건 for ctrl+space
arr[i] = scanner.nextInt();
//sum += arr[i];
//avg = sum / 3;
}
//입력된 값을 출력해 보세요
for (int i = 0; i < arr.length; i++) {
//System.out.println("입력된 값 출력" + arr[i]);
sum += arr[i];
//avg = sum / arr.length;
}
System.out.println("합 : "+sum);
avg = sum / arr.length;
System.out.println("평균 : "+avg);
}
}
| [
"itbank@itbank-PC"
] | itbank@itbank-PC |
776e21b1bd08436498c060e3d3da66a5118190ee | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/sonar/server/component/index/ComponentIndexFeatureRecentlyBrowsedTest.java | b1d93112fd8d8f535785ff09ffa8a157be253806 | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 1,929 | java | /**
* SonarQube
* Copyright (C) 2009-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.server.component.index;
import com.google.common.collect.ImmutableSet;
import java.util.Collections;
import org.junit.Test;
import org.sonar.db.component.ComponentDto;
public class ComponentIndexFeatureRecentlyBrowsedTest extends ComponentIndexTest {
@Test
public void scoring_cares_about_recently_browsed() {
ComponentDto project1 = indexProject("sonarqube", "SonarQube");
ComponentDto project2 = indexProject("recent", "SonarQube Recently");
SuggestionQuery query1 = SuggestionQuery.builder().setQuery("SonarQube").setQualifiers(Collections.singletonList(PROJECT)).setRecentlyBrowsedKeys(ImmutableSet.of(project1.getDbKey())).build();
assertSearch(query1).containsExactly(ComponentIndexTest.uuids(project1, project2));
SuggestionQuery query2 = SuggestionQuery.builder().setQuery("SonarQube").setQualifiers(Collections.singletonList(PROJECT)).setRecentlyBrowsedKeys(ImmutableSet.of(project2.getDbKey())).build();
assertSearch(query2).containsExactly(ComponentIndexTest.uuids(project2, project1));
}
}
| [
"[email protected]"
] | |
8d79864abf233cf00abe44e982e8bc580e0be53d | 05d5f944eeb17205929f9c92dd8150d3a04c45d9 | /seckill-api/src/main/java/com/cgx/marketing/infrastructure/repository/convert/StockReduceFlowConverter.java | 766ab6e5453fc01d40ac65f596fe46c37bd5c6d6 | [] | no_license | TaoZhuGongBoy/seckill | b413f353f6feadbc30dda0f9b197c2c535c565eb | c899b2d8a7fab51d13ebd27a0e2b1a9372a2ef46 | refs/heads/master | 2023-04-14T05:19:49.066813 | 2023-04-06T00:42:47 | 2023-04-06T00:42:47 | 617,264,532 | 1 | 0 | null | 2023-03-22T02:43:43 | 2023-03-22T02:43:43 | null | UTF-8 | Java | false | false | 1,544 | java | package com.cgx.marketing.infrastructure.repository.convert;
import com.cgx.marketing.domain.model.activity.*;
import com.cgx.marketing.infrastructure.model.StockReduceFlowDO;
public abstract class StockReduceFlowConverter {
public static StockReduceFlowDO toDO(StockReduceFlow flow) {
StockReduceFlowDO flowDO = new StockReduceFlowDO();
flowDO.setActivityId(flow.getActivityId().getId());
OrderInfo orderInfo = flow.getOrderInfo();
flowDO.setItemId(orderInfo.getItemId().getId());
flowDO.setQuantity(orderInfo.getQuantity());
flowDO.setOrderId(orderInfo.getOrderId().getId());
flowDO.setOrderTime(orderInfo.getOrderTime());
flowDO.setBuyerId(flow.getBuyerId().getId());
return flowDO;
}
public static StockReduceFlow fromDO(StockReduceFlowDO flowDO) {
OrderInfo orderInfo = OrderInfo.builder()
.orderId(new OrderId(flowDO.getOrderId()))
.itemId(new ItemId(flowDO.getItemId()))
.orderTime(flowDO.getOrderTime())
.quantity(flowDO.getQuantity())
.build();
return StockReduceFlow.builder()
.activityId(new ActivityId(flowDO.getActivityId()))
.buyerId(new BuyerId(flowDO.getBuyerId()))
.orderInfo(orderInfo)
.build();
}
}
| [
"[email protected]"
] | |
a8b765379e5ffb2b04235227c2a30a16809d6fa9 | f14ce268dff09a090aa2e8c5616ff569fe2289e5 | /designPattern/src/main/java/com/lxl/tiger/designpattern/factory/PisaStore.java | a376067004492a7bd752acf8d729cf215b65af58 | [] | no_license | lxltiger/Android_Basic | 104bc6299afe09107e1c739a6c427f99865120fd | 8df7f2c90b6f865b85cbe78e99a6da01635b0731 | refs/heads/master | 2022-08-18T13:41:38.632459 | 2020-05-26T09:29:38 | 2020-05-26T09:29:38 | 112,807,364 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | package com.lxl.tiger.designpattern.factory;
public abstract class PisaStore {
public Pisa orderPisa(String type) {
Pisa pisa = cretePias(type);
pisa.prepare();
pisa.bake();
pisa.cut();
pisa.box();
return pisa;
}
protected abstract Pisa cretePias(String type);
}
| [
"[email protected]"
] | |
bcb6f7e3737b33bf359b52e672c84d6312fcc924 | 27b50989684daae7e7b9562d22acd77ebae75095 | /src/main/java/br/com/snacksapi/exceptions/PedidoNotFoundException.java | e7fd8bb8beb0cfd66bcad1a76d59cb92dcf3b330 | [] | no_license | alexmarques/snacks-api | 82c37d040883f342a91168e38abbe4d5dcf7a868 | a1a5736e01a85c9f388a94a86d2eef39acdac851 | refs/heads/master | 2022-12-28T18:09:33.794798 | 2020-10-13T03:32:08 | 2020-10-13T03:32:08 | 303,520,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 217 | java | package br.com.snacksapi.exceptions;
public class PedidoNotFoundException extends NotFoundException {
public PedidoNotFoundException(String fieldName, Long pedidoId) {
super(fieldName, pedidoId);
}
}
| [
"[email protected]"
] | |
9ff610a600dd67f6f243788e524654d37352beca | da5940bdc8045d60063c5e8e1cdce9e8d9bd977a | /Licenta/src/org/w3/x2001/xmlSchema/SimpleContentDocument.java | 36257715bea1a46cb99d7726504cd43c97476f1c | [] | no_license | dorapolicarp/MyRepo | a9afb3fae31bb067041a62d1369ccc7e1bb67134 | 937632317a3187e756bec021c0719e4c7ed5f5f7 | refs/heads/master | 2021-03-12T22:07:03.287136 | 2013-05-11T10:36:13 | 2013-05-11T10:36:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,343 | java | /*
* An XML document type.
* Localname: simpleContent
* Namespace: http://www.w3.org/2001/XMLSchema
* Java type: org.w3.x2001.xmlSchema.SimpleContentDocument
*
* Automatically generated - do not modify.
*/
package org.w3.x2001.xmlSchema;
/**
* A document containing one simpleContent(@http://www.w3.org/2001/XMLSchema) element.
*
* This is a complex type.
*/
public interface SimpleContentDocument extends org.apache.xmlbeans.XmlObject
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)
org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(SimpleContentDocument.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.s074985EFE4BCD563FC15DE11E5DA0167").resolveHandle("simplecontent8acedoctype");
/**
* Gets the "simpleContent" element
*/
org.w3.x2001.xmlSchema.SimpleContentDocument.SimpleContent getSimpleContent();
/**
* Sets the "simpleContent" element
*/
void setSimpleContent(org.w3.x2001.xmlSchema.SimpleContentDocument.SimpleContent simpleContent);
/**
* Appends and returns a new empty "simpleContent" element
*/
org.w3.x2001.xmlSchema.SimpleContentDocument.SimpleContent addNewSimpleContent();
/**
* An XML simpleContent(@http://www.w3.org/2001/XMLSchema).
*
* This is a complex type.
*/
public interface SimpleContent extends org.w3.x2001.xmlSchema.Annotated
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)
org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(SimpleContent.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.s074985EFE4BCD563FC15DE11E5DA0167").resolveHandle("simplecontent9a5belemtype");
/**
* Gets the "restriction" element
*/
org.w3.x2001.xmlSchema.SimpleRestrictionType getRestriction();
/**
* True if has "restriction" element
*/
boolean isSetRestriction();
/**
* Sets the "restriction" element
*/
void setRestriction(org.w3.x2001.xmlSchema.SimpleRestrictionType restriction);
/**
* Appends and returns a new empty "restriction" element
*/
org.w3.x2001.xmlSchema.SimpleRestrictionType addNewRestriction();
/**
* Unsets the "restriction" element
*/
void unsetRestriction();
/**
* Gets the "extension" element
*/
org.w3.x2001.xmlSchema.SimpleExtensionType getExtension();
/**
* True if has "extension" element
*/
boolean isSetExtension();
/**
* Sets the "extension" element
*/
void setExtension(org.w3.x2001.xmlSchema.SimpleExtensionType extension);
/**
* Appends and returns a new empty "extension" element
*/
org.w3.x2001.xmlSchema.SimpleExtensionType addNewExtension();
/**
* Unsets the "extension" element
*/
void unsetExtension();
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.w3.x2001.xmlSchema.SimpleContentDocument.SimpleContent newInstance() {
return (org.w3.x2001.xmlSchema.SimpleContentDocument.SimpleContent) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument.SimpleContent newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.w3.x2001.xmlSchema.SimpleContentDocument.SimpleContent) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
private Factory() { } // No instance of this class allowed
}
}
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static org.w3.x2001.xmlSchema.SimpleContentDocument newInstance() {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument newInstance(org.apache.xmlbeans.XmlOptions options) {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
/** @param xmlAsString the string value to parse */
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
/** @param file the file from which to load an xml document */
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.w3.x2001.xmlSchema.SimpleContentDocument parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (org.w3.x2001.xmlSchema.SimpleContentDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
private Factory() { } // No instance of this class allowed
}
}
| [
"[email protected]"
] | |
3bf106a0fd95c7c77fe318c099cddd2e2b2e39e4 | 430c98b25a330ec85b97b1509843bd8eee4e0877 | /src/main/java/com/pfchoice/springboot/model/Problem.java | 00cdfbe01a2edba1204c8f850925c05a67bd19be | [] | no_license | SunilNekkanti/PrasBoot | 4f2d069053517c63b74be477ad1201952fd681f2 | 562f6bfe8a2664cf677259ef20767902b3d991fe | refs/heads/master | 2020-03-15T13:33:58.520178 | 2018-05-02T14:29:05 | 2018-05-02T14:29:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,605 | java | package com.pfchoice.springboot.model;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.Where;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
*
* @author SarathGandluri
*/
@Entity
@Table(name = "problems")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class Problem extends RecordDetails implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "pbm_id", nullable = false)
private Integer id;
@Column(name = "description")
private String description;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ins_id", referencedColumnName = "Insurance_Id")
@Where(clause = "active_ind ='Y'")
private Insurance insId;
@Column(name = "effective_year")
private Integer effectiveYear;
@Fetch(FetchMode.SELECT)
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinTable(name = "problems_icd", joinColumns = {
@JoinColumn(name = "pbm_Id", referencedColumnName = "pbm_Id") }, inverseJoinColumns = {
@JoinColumn(name = "icd_id", referencedColumnName = "icd_id") })
@Where(clause = "active_ind ='Y'")
private Set<ICDMeasure> icdCodes;
/**
*
*/
public Problem() {
super();
}
/**
* @param id
*/
public Problem(final Integer id) {
super();
this.id = id;
}
/**
* @return
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(final Integer id) {
this.id = id;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description
* the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the insId
*/
public Insurance getInsId() {
return insId;
}
/**
* @param insId
* the insId to set
*/
public void setInsId(Insurance insId) {
this.insId = insId;
}
/**
* @return the effectiveYear
*/
public Integer getEffectiveYear() {
return effectiveYear;
}
/**
* @param effectiveYear
* the effectiveYear to set
*/
public void setEffectiveYear(Integer effectiveYear) {
this.effectiveYear = effectiveYear;
}
/**
* @return the icdCodes
*/
public Set<ICDMeasure> getIcdCodes() {
return icdCodes;
}
/**
* @param icdCodes
* the icdCodes to set
*/
public void setIcdCodes(Set<ICDMeasure> icdCodes) {
this.icdCodes = icdCodes;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
if (!(object instanceof Problem)) {
return false;
}
Problem other = (Problem) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.pfchoice.springboot.model.Problem[ id=" + id + " ]";
}
}
| [
"[email protected]"
] | |
22aad35f8c37e23934f0b5254aff73136ae8e71e | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-418-7-19-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer_ESTest_scaffolding.java | b783d6ffd35e5825be14047b9090f7f5cfebb3c0 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 469 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sat Apr 04 03:32:36 UTC 2020
*/
package org.xwiki.rendering.internal.renderer.xhtml;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class XHTMLChainingRenderer_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"[email protected]"
] | |
362cbf9dbd3f4a73c83952e2db053dd24cb44734 | 49e822b7b9465f8136d34e53ec46cba43de9f4b8 | /src/Lista.java | 9ad875cb643fdd3133059fd7687192fd36cfd8fa | [] | no_license | NicoSalva/Programaci-n-3-Ej-1 | 3cb9412f66262f0d102ce015c87c6bb8734c869b | aaa36ec86c875f2c726f17501d58536b87fbbeec | refs/heads/master | 2021-01-18T18:34:05.561307 | 2017-03-31T21:26:16 | 2017-03-31T21:26:16 | 86,860,937 | 0 | 0 | null | null | null | null | ISO-8859-10 | Java | false | false | 657 | java |
public class Lista {
protected Nodo raiz;
private int contador;
public Lista(){
raiz=null;
contador=0;
}
public int getTamaņo(){
return contador;
}
public void addElemento(int n){
if(raiz==null){
raiz=new Nodo(n);
}
else
{
Nodo nuevo=new Nodo(n);
nuevo.setNext(raiz);
raiz=nuevo;
}
contador++;
}
public Integer at(int pos){
int i=0;
Nodo puntero=raiz;
while(i<this.getTamaņo()){
if(pos==i)
return puntero.getValor();
else{
puntero=puntero.getSig();
i++;
}
}return null;
}
public void Eliminar(){
raiz=raiz.getSig();
contador--;
}
}
| [
"[email protected]"
] | |
ccfbeec902f7d20c72dd7a6cf4eca4ca2995215f | 9c7d27aa807f02bf64899c4883f55e551a080a13 | /TianTianDaPaoServer/src/client/money_append/DaPaoBossOverDao.java | f47056c134644873d6d97e6990fd330dc63b3d0c | [] | no_license | LouiLam/TianTianDaPaoServer | 033074e3bd12ad30c73d0c39006c1663fd8c5fd3 | 2ed419ea4b0c3913475c286ceb6eb8a0420ec764 | refs/heads/master | 2020-06-15T04:23:16.822468 | 2014-07-31T05:10:24 | 2014-07-31T05:10:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 495 | java | package client.money_append;
import java.util.Map;
public interface DaPaoBossOverDao {
/**
* 根据用户token 返回用户是否合法
* @return
*/
public Map<Object,Object> selectBossOverByUtoken(Map<? extends Object,? extends Object> params);
/**
* 更新话费点
* @param params
*/
public void updateChargeByUserGame(Map<? extends Object,? extends Object> params);
public Map<Object,Object> selectBossOverByUID(Map<? extends Object,? extends Object> params);
}
| [
"[email protected]"
] | |
af16a69b29385f88ebb69f8f7ca7417354ff7c76 | e62054f18009b6935db0a4c4dcfa96004876b017 | /CodeGym/src/main/java/LevelOne/GreatPurge.java | e9c1c6fd55d17cbafcaec4a2f7ff8d0c96b6dc60 | [] | no_license | EliCas5931/CodeGymLessons | 8b7387967a36537035fa7d22f003a24e2e6f611f | 2de10c9135097e779d512526d76319c52caddbfd | refs/heads/master | 2021-01-26T04:21:04.023667 | 2020-03-24T16:36:58 | 2020-03-24T16:36:58 | 243,306,959 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 654 | java | package LevelOne;
public class GreatPurge {
// Declare the missing variables and comment out those that are not used anywhere.
//
// Requirements:
// • The program should display text.
// • Four variables must be declared.
// • You need to comment out the unused variables.
// • The program's output should not change.
public static void main(String[] args) {
// Given code:
// String s = "15";
int a = 5;
// int z = 18;
int d = 18;
int c = a + d;
String b = " is better than ";
System.out.println(a + b + c);
}
}
| [
"[email protected]"
] | |
3bbf5abe464fe68879e5772f06b54c8e9fdf833e | 55b01bfe2be2d2f39ca1c155f7389f11771cc8c7 | /app/src/test/java/com/example/app4go/ExampleUnitTest.java | e80c9e5fc829ac1ca4df621113bd18c60a0c0107 | [] | no_license | bennetnetan/App4Go | 55c8e2ed4ef94dca94fd4407ae84cd383fc8d37e | be42c7ee336a090815ba99acb27d830f90a39d15 | refs/heads/master | 2022-12-15T01:57:39.481078 | 2020-09-15T20:48:35 | 2020-09-15T20:48:35 | 295,846,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 379 | java | package com.example.app4go;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
05930a03bb7cfc2427766552449fb844e414de27 | 1400083d71e121cb20fcc85c5127b2eb6d0c18de | /src/Scuba/javatraining/StackExample.java | c2405a4cac09c906d3bd9944b05443395869a4a8 | [] | no_license | SindhujaMarimuthu/TrialTest | ae7501432da98cecf62805a58ff6351c7e79bc8d | 4d2e3fbfc555531f6dd9e577025f23594ad90153 | refs/heads/master | 2022-11-20T07:18:52.557072 | 2020-07-02T05:27:29 | 2020-07-02T05:27:29 | 276,556,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 108 | java | package Scuba.javatraining;
public class StackExample {
public static void main(String[] args) {
}
}
| [
"[email protected]"
] | |
d77ebc26db0d18ed7e0bcc8754f7cb8da0740541 | 762a280f5356d7ad564520a0ca18b4665852c0bf | /app/src/main/java/com/michaelmagdy/lifecycleawarecomponentexample/SecondActivity.java | bf3ba70a83fbe7699674d603922348daee374c8e | [] | no_license | MichaelTheBestProgrammerInTheWorld/LifecycleAwareComponentExample | 342925adf517777fba6f0aca2454c3bee1e6e962 | 6519aa5ab6d95dae6dfac052e193aa12e9076853 | refs/heads/master | 2022-11-17T17:16:21.460196 | 2020-07-17T20:16:19 | 2020-07-17T20:16:19 | 280,516,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 447 | java | package com.michaelmagdy.lifecycleawarecomponentexample;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class SecondActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
getLifecycle().addObserver(new LifecycleComponent(getLocalClassName()));
}
}
| [
"[email protected]"
] | |
e5d0c76ec06059a811733da3842251ba223f4731 | efb7efbbd6baa5951748dfbe4139e18c0c3608be | /sources/com/bitcoin/mwallet/core/views/ContactListViewHolder.java | bc90dd5d46240acc80d1c4cbc8deb7cdc2f84edd | [] | no_license | blockparty-sh/600302-1_source_from_JADX | 08b757291e7c7a593d7ec20c7c47236311e12196 | b443bbcde6def10895756b67752bb1834a12650d | refs/heads/master | 2020-12-31T22:17:36.845550 | 2020-02-07T23:09:42 | 2020-02-07T23:09:42 | 239,038,650 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,183 | java | package com.bitcoin.mwallet.core.views;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.bitcoin.mwallet.C1018R;
import com.bitcoin.mwallet.core.models.Coin;
import com.bitcoin.mwallet.core.models.contact.Contact;
import com.leanplum.internal.Constants.Params;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
@Metadata(mo37403bv = {1, 0, 3}, mo37404d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u000e\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000eR\u000e\u0010\u0005\u001a\u00020\u0006X\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\n¨\u0006\u000f"}, mo37405d2 = {"Lcom/bitcoin/mwallet/core/views/ContactListViewHolder;", "Landroidx/recyclerview/widget/RecyclerView$ViewHolder;", "view", "Landroid/view/View;", "(Landroid/view/View;)V", "contactIcon", "Landroid/widget/ImageView;", "contactName", "Landroid/widget/TextView;", "getView", "()Landroid/view/View;", "bind", "", "item", "Lcom/bitcoin/mwallet/core/models/contact/Contact;", "app_replaceRelease"}, mo37406k = 1, mo37407mv = {1, 1, 15})
/* compiled from: ContactListViewHolder.kt */
public final class ContactListViewHolder extends ViewHolder {
private final ImageView contactIcon;
private final TextView contactName;
@NotNull
private final View view;
public ContactListViewHolder(@NotNull View view2) {
Intrinsics.checkParameterIsNotNull(view2, "view");
super(view2);
this.view = view2;
View findViewById = this.view.findViewById(C1018R.C1021id.contactName);
Intrinsics.checkExpressionValueIsNotNull(findViewById, "view.findViewById(R.id.contactName)");
this.contactName = (TextView) findViewById;
View findViewById2 = this.view.findViewById(C1018R.C1021id.contactIcon);
Intrinsics.checkExpressionValueIsNotNull(findViewById2, "view.findViewById(R.id.contactIcon)");
this.contactIcon = (ImageView) findViewById2;
}
@NotNull
public final View getView() {
return this.view;
}
public final void bind(@NotNull Contact contact) {
Intrinsics.checkParameterIsNotNull(contact, Params.IAP_ITEM);
this.contactName.setText(contact.getName());
if (Intrinsics.areEqual((Object) contact.getName(), (Object) "SatoshiDice")) {
this.contactIcon.setImageResource(C1018R.C1020drawable.ic_satoshi_dice_round);
}
if (contact.getCoin() == Coin.BCH) {
this.contactIcon.setImageResource(C1018R.C1020drawable.logo_bch_green);
} else if (contact.getCoin() == Coin.BTC) {
this.contactIcon.setImageResource(C1018R.C1020drawable.logo_btc);
}
}
}
| [
"[email protected]"
] | |
aebeb012654f6533173064c39bd060e98a62fd8b | 783174820f45c1d8ae64af86c77406c1c41678ca | /String/returnString4.java | 360e70e39196cd87289d996c29c6415e49818a8a | [] | no_license | vanshitamanral/WiproTrainingModule | 3972b9efca3592ffa59ca0d60e2d2dc4c6aa7c52 | e666ae33beb2de30f23a535007c6cea44ea544ec | refs/heads/main | 2023-06-25T01:32:17.500552 | 2021-07-22T18:45:28 | 2021-07-22T18:45:28 | 385,812,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 563 | java | package String;
import java.util.Scanner;
public class returnString4 {
public static void main(String[] args) {
Scanner s= new Scanner(System.in);
String str=s.next();
if(str.charAt(0)=='x' && str.charAt(str.length()-1)=='x')
{
System.out.println(str.substring(1, str.length()-1));
}else if(str.charAt(0)=='x')
{
System.out.println(str.substring(1,str.length()));
}else if(str.charAt(str.length()-1)=='x')
{
System.out.println(str.substring(0,str.length()-1));
}else
{
System.out.println(str);
}
}
}
| [
"[email protected]"
] | |
4f1ae9113c5758dac6f9a631607db477fbf7783b | b4b6321637ea1220a14c0731a5f044c73827ecd1 | /app/src/main/java/net/nutrima/client/GetTokenResponse.java | 0ed366ae0b72b50b651ea75ee0d2d0f8f95f3758 | [] | no_license | melsisi/NutrimaProtoGUI | abbcfe7d266a522a9cb566add78ef7d0edb4bcb6 | b85c5760a43ab3223595e48e8eb6f34edcbdb42b | refs/heads/master | 2021-01-13T13:11:54.694416 | 2017-03-13T17:46:55 | 2017-03-13T17:46:55 | 72,691,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,617 | java | /**
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package net.nutrima.client;
/**
* This class is used to store the response of the GetToken call of the sample
* Cognito developer authentication.
*/
public class GetTokenResponse extends Response {
private final String identityId;
private final String identityPoolId;
private final String token;
public GetTokenResponse(final int responseCode, final String responseMessage) {
super(responseCode, responseMessage);
this.identityId = null;
this.identityPoolId = null;
this.token = null;
}
public GetTokenResponse(final String identityId,
final String identityPoolId, final String token) {
super(200, null);
this.identityId = identityId;
this.identityPoolId = identityPoolId;
this.token = token;
}
public String getIdentityId() {
return this.identityId;
}
public String getIdentityPoolId() {
return this.identityPoolId;
}
public String getToken() {
return this.token;
}
}
| [
"[email protected]"
] | |
4d85d0daefc3ca86791a56866814c83b1f3ae94e | 790cecc9a26dc52b515615100931452ea5faafc6 | /src/com/interview/algorithms/dp/C12_1_BooleanKnapsack.java | ed25f45362fa07c08580ecf50aded3be7737b1ce | [] | no_license | rioshen/interview | 33b55d9ff1bcd1f794c9d37c3678177afdf66d9f | 02eb5ef8b9ad0c98c0315b383ccdd449c05402d4 | refs/heads/master | 2020-12-26T02:59:38.797166 | 2015-01-21T13:05:55 | 2015-01-21T13:05:55 | 29,694,448 | 2 | 2 | null | 2015-01-22T18:55:58 | 2015-01-22T18:55:57 | null | UTF-8 | Java | false | false | 3,734 | java | package com.interview.algorithms.dp;
/**
* Created_By: zouzhile
* Date: 2/23/14
* Time: 5:02 PM
*
* Provide three different solutions for Boolean Knapsack
* 1. Recursive O(2^n)
* 2. DP Solution 1: define opt[n][w] = max profit of packing items 1..n with weight limit w
* scan the items, and only consider ith item put in or not.
* opt[i, j] = max( opt[i-1, j-Wi] + Vi (j >= Wi), opt[i-1, j] )
* 3. DP Solution 2: define optimal[S], the max profit could get when put S weight in bag
* scan the W, try to build opt[W] and solution[W][_]
* opt[S] = max(opt[S-Wi]+Vi. opt[S-1]) and filter the item if it already in the bag
*/
public class C12_1_BooleanKnapsack {
public static int getMaxValueByRecursion(int index, int W, int[] weights, int[] values) {
if(index < 0)
return 0;
if(weights[index] > W) {
return getMaxValueByRecursion(index - 1, W, weights, values);
} else {
return Math.max(getMaxValueByRecursion(index - 1, W, weights, values),
getMaxValueByRecursion(index - 1, W - weights[index], weights, values) + values[index]);
}
}
public static boolean[] getMaxValueByDPS2(int W, int[] weights, int[] values) {
int N = values.length;
// optimal[S], the max profit could get when put S weight in bag
// solution[S][], the solution of the max profit of S
int[] optimal = new int[W + 1];
boolean[][] solution = new boolean[W + 1][N];
for(int s = 1; s <= W; s++){
for(int j = 0; j < N; j++){
int left = s - weights[j];
//if jth item could put in, and optimal is larger and jth item haven't been put in before
if(left >= 0 && optimal[left] + values[j] > optimal[s] && !solution[left][j]) {
optimal[s] = optimal[s - weights[j]] + values[j];
copySolution(solution, N, left, s);
solution[s][j] = true;
}
}
if(s < W) { //if have next S
optimal[s+1] = optimal[s];
copySolution(solution, N, s, s+1);
}
}
return solution[W];
}
private static void copySolution(boolean[][] solution, int N, int from, int to){
for(int i = 0; i < N; i ++) {
solution[to][i] = solution[from][i];
}
}
//NOT A GOOD SOLUTION AS getMaxValueByDPS2
public static int getMaxValueByDPS1(int W, int[] weights, int[] values) {
int N = weights.length; // the number of item types
weights = shift(weights);
values = shift(values);
// opt[n][w] = max profit of packing items 1..n with weight limit w
// sol[n][w] = does opt solution to pack items 1..n with weight limit w include item n?
int[][] opt = new int[N+1][W+1];
boolean[][] sol = new boolean[N+1][W+1];
for (int n = 1; n <= N; n++) {
for (int w = 1; w <= W; w++) {
// don't take item n
int option1 = opt[n-1][w];
// take item n
int option2 = Integer.MIN_VALUE;
if (weights[n] <= w)
option2 = values[n] + opt[n-1][w-weights[n]];
// select better of two options
opt[n][w] = Math.max(option1, option2);
sol[n][w] = (option2 > option1);
}
}
return opt[N][W];
}
private static int[] shift(int[] array){
int[] result = new int[array.length + 1];
for(int i = 0; i < array.length; i++)
result[i+1] = array[i];
result[0] = 0;
return result;
}
}
| [
"[email protected]"
] | |
f2b72011ccac7691f67c8f54520a7321e18ddb09 | cdb04a34ed64dd1f74980a7c262e2a7ac8b8008c | /google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java | c11f9d2c5acb7a22dfda2350635743b82dd8ca31 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | scraly/gcloud-java | a47269696fd81e37e9c661afaa40a8a1a2c2bc59 | fccd5e2ae7445213f82c5ce5ec0ee2b4834fc150 | refs/heads/master | 2021-04-12T12:11:54.217277 | 2017-06-16T04:25:16 | 2017-06-16T04:46:08 | 94,550,155 | 2 | 0 | null | 2017-06-16T14:09:36 | 2017-06-16T14:09:36 | null | UTF-8 | Java | false | false | 7,317 | java | /*
* Copyright 2017, Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.logging.v2.stub;
import static com.google.cloud.logging.v2.PagedResponseWrappers.ListSinksPagedResponse;
import com.google.api.core.BetaApi;
import com.google.api.gax.grpc.GrpcCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.api.gax.rpc.UnaryCallableImpl;
import com.google.cloud.logging.v2.ConfigSettings;
import com.google.logging.v2.CreateSinkRequest;
import com.google.logging.v2.DeleteSinkRequest;
import com.google.logging.v2.GetSinkRequest;
import com.google.logging.v2.ListSinksRequest;
import com.google.logging.v2.ListSinksResponse;
import com.google.logging.v2.LogSink;
import com.google.logging.v2.UpdateSinkRequest;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS
@Generated("by GAPIC v0.0.5")
@BetaApi
public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub {
private static final UnaryCallableImpl<ListSinksRequest, ListSinksResponse>
directListSinksCallable =
GrpcCallableFactory.createDirectCallable(
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
"google.logging.v2.ConfigServiceV2/ListSinks",
io.grpc.protobuf.ProtoUtils.marshaller(ListSinksRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(ListSinksResponse.getDefaultInstance())));
private static final UnaryCallableImpl<GetSinkRequest, LogSink> directGetSinkCallable =
GrpcCallableFactory.createDirectCallable(
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
"google.logging.v2.ConfigServiceV2/GetSink",
io.grpc.protobuf.ProtoUtils.marshaller(GetSinkRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(LogSink.getDefaultInstance())));
private static final UnaryCallableImpl<CreateSinkRequest, LogSink> directCreateSinkCallable =
GrpcCallableFactory.createDirectCallable(
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
"google.logging.v2.ConfigServiceV2/CreateSink",
io.grpc.protobuf.ProtoUtils.marshaller(CreateSinkRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(LogSink.getDefaultInstance())));
private static final UnaryCallableImpl<UpdateSinkRequest, LogSink> directUpdateSinkCallable =
GrpcCallableFactory.createDirectCallable(
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
"google.logging.v2.ConfigServiceV2/UpdateSink",
io.grpc.protobuf.ProtoUtils.marshaller(UpdateSinkRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(LogSink.getDefaultInstance())));
private static final UnaryCallableImpl<DeleteSinkRequest, Empty> directDeleteSinkCallable =
GrpcCallableFactory.createDirectCallable(
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
"google.logging.v2.ConfigServiceV2/DeleteSink",
io.grpc.protobuf.ProtoUtils.marshaller(DeleteSinkRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(Empty.getDefaultInstance())));
private final List<AutoCloseable> closeables = new ArrayList<>();
private final UnaryCallable<ListSinksRequest, ListSinksResponse> listSinksCallable;
private final UnaryCallable<ListSinksRequest, ListSinksPagedResponse> listSinksPagedCallable;
private final UnaryCallable<GetSinkRequest, LogSink> getSinkCallable;
private final UnaryCallable<CreateSinkRequest, LogSink> createSinkCallable;
private final UnaryCallable<UpdateSinkRequest, LogSink> updateSinkCallable;
private final UnaryCallable<DeleteSinkRequest, Empty> deleteSinkCallable;
public static final GrpcConfigServiceV2Stub create(ConfigSettings settings) throws IOException {
return new GrpcConfigServiceV2Stub(settings, ClientContext.create(settings));
}
public static final GrpcConfigServiceV2Stub create(ClientContext clientContext)
throws IOException {
return new GrpcConfigServiceV2Stub(ConfigSettings.defaultBuilder().build(), clientContext);
}
/**
* Constructs an instance of GrpcConfigServiceV2Stub, using the given settings. This is protected
* so that it easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected GrpcConfigServiceV2Stub(ConfigSettings settings, ClientContext clientContext)
throws IOException {
this.listSinksCallable =
GrpcCallableFactory.create(
directListSinksCallable, settings.listSinksSettings(), clientContext);
this.listSinksPagedCallable =
GrpcCallableFactory.createPagedVariant(
directListSinksCallable, settings.listSinksSettings(), clientContext);
this.getSinkCallable =
GrpcCallableFactory.create(
directGetSinkCallable, settings.getSinkSettings(), clientContext);
this.createSinkCallable =
GrpcCallableFactory.create(
directCreateSinkCallable, settings.createSinkSettings(), clientContext);
this.updateSinkCallable =
GrpcCallableFactory.create(
directUpdateSinkCallable, settings.updateSinkSettings(), clientContext);
this.deleteSinkCallable =
GrpcCallableFactory.create(
directDeleteSinkCallable, settings.deleteSinkSettings(), clientContext);
closeables.addAll(clientContext.getCloseables());
}
public UnaryCallable<ListSinksRequest, ListSinksPagedResponse> listSinksPagedCallable() {
return listSinksPagedCallable;
}
public UnaryCallable<ListSinksRequest, ListSinksResponse> listSinksCallable() {
return listSinksCallable;
}
public UnaryCallable<GetSinkRequest, LogSink> getSinkCallable() {
return getSinkCallable;
}
public UnaryCallable<CreateSinkRequest, LogSink> createSinkCallable() {
return createSinkCallable;
}
public UnaryCallable<UpdateSinkRequest, LogSink> updateSinkCallable() {
return updateSinkCallable;
}
public UnaryCallable<DeleteSinkRequest, Empty> deleteSinkCallable() {
return deleteSinkCallable;
}
/**
* Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately
* cancelled.
*/
@Override
public final void close() throws Exception {
for (AutoCloseable closeable : closeables) {
closeable.close();
}
}
}
| [
"[email protected]"
] | |
71b88ecd7a8977d386718325c837bb72be27b54f | 30d2c198c7f56ad46a9015dde96db926b822423f | /src/br/com/ctesop/model/Terra.java | 64ba667653be48c6d27075157c090b02b7ef52e6 | [] | no_license | BrunaCoppo/ProjetoTCC | 49bd7b79b1043a123b596458f97350a20defcdcf | d44e92b4571a905922dacff1a201f5179f0d78cb | refs/heads/master | 2020-05-21T09:16:16.503415 | 2017-12-09T10:42:25 | 2017-12-09T10:42:25 | 84,609,476 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,694 | java | package br.com.ctesop.model;
import br.com.ctesop.controller.util.ExceptionValidacao;
import java.security.InvalidParameterException;
import java.text.NumberFormat;
import java.text.ParseException;
/**
*
* @author Bruna
*/
public class Terra {
private int codigo;
private Cidade cidade;
private float tamanho;
private String descricao;
private String status;
public Terra(int aInt, String string) {
this.codigo = codigo;
}
public Terra() {
}
public int getCodigo() {
return codigo;
}
public void setCodigo(int codigo) {
if (codigo < 0) {
throw new InvalidParameterException("Código inválido.");
}
this.codigo = codigo;
}
public Cidade getCidade() {
return cidade;
}
public void setCidade(Cidade cidade) throws ExceptionValidacao {
if (cidade==null) {
throw new ExceptionValidacao("Cidade obrigatória.");
}
this.cidade = cidade;
}
public float getTamanho() {
return tamanho;
}
public String getTamanhoFormatado() {
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMinimumFractionDigits(2);
return nf.format(this.tamanho);
}
public void setTamanho(float tamanho) {
this.tamanho = tamanho;
}
public void setTamanho(String tamanho) throws ExceptionValidacao {
NumberFormat nf = NumberFormat.getNumberInstance();
try {
this.tamanho = nf.parse(tamanho).floatValue();
} catch (ParseException ex) {
throw new ExceptionValidacao("Tamanho inválido.");
}
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) throws ExceptionValidacao {
if (descricao.isEmpty()) {
throw new ExceptionValidacao("Descrição obrigatória.");
}
if (descricao.trim().length() < 2) {
throw new ExceptionValidacao("Descriçao muito curta.");
}
if (descricao.trim().length() > 200) {
throw new ExceptionValidacao("Descrição muito longa.");
}
this.descricao = descricao;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return getDescricao() + " "+ getTamanhoFormatado() + " " + getCidade();
}
@Override
public boolean equals(Object o) {
if (o instanceof Terra) {
return ((Terra) o).getCodigo() == getCodigo();
}
return false;
}
}
| [
"[email protected]"
] | |
2fd836cc8917a4621d34fc77f1ce12b9da37a93d | 488238968311068c363662f9f3c50b256bfdc92e | /JAVA/Designer.java | aa3983763c2825be0da945124932cc2f3da7bc43 | [] | no_license | fedetandil/SummaExerciseJavaAndPhp | c50a31f39c43c2847c907b75be210509cfe56d96 | 7e53fd28a23b9ba084b709719627c05810cc0eff | refs/heads/main | 2023-02-04T20:04:29.545526 | 2020-12-30T14:29:33 | 2020-12-30T14:29:33 | 324,143,783 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 481 | java | public class Designer extends Employee{
private String type;
public Designer(int id, String name, String lastName, int age,String type) {
super(id, name, lastName, age);
this.type=type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public String toString() {
return super.toString()+
", Designer in='" + type+"'";
}
}
| [
"[email protected]"
] | |
bb530889ae6a70cfbca8a6741cfdc75d0e295019 | 9e84a115957d9556590875e6d3ef4932c423fcb1 | /unit4j-support-jackson/src/test/java/org/caotc/unit4j/support/jackson/Unit4jModuleTest.java | 7000541c7e07cb9b7470f84d750d58e27aa67a58 | [
"Apache-2.0"
] | permissive | liudaomanbu/unt4j | ee000cfb114a567b43d0ddcf588769585b2b5d79 | 24f20607be82b174904d1aed122d6aba2d4699c0 | refs/heads/master | 2023-08-16T18:51:59.570923 | 2022-06-29T07:57:02 | 2022-06-29T07:57:02 | 193,667,920 | 0 | 0 | Apache-2.0 | 2023-07-07T21:56:47 | 2019-06-25T08:34:51 | Java | UTF-8 | Java | false | false | 931 | java | package org.caotc.unit4j.support.jackson;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.caotc.unit4j.core.Amount;
import org.caotc.unit4j.core.constant.UnitConstant;
import org.caotc.unit4j.support.Unit4jProperties;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@Slf4j
class Unit4jModuleTest {
Unit4jProperties unit4jProperties = new Unit4jProperties();
Amount amount = Amount.create("123.56", UnitConstant.SECOND);
AmountField amountFieldTest = AmountField.create(amount);
Unit4jModule module = Unit4jModule.create(unit4jProperties);
ObjectMapper mapper = new ObjectMapper();
@BeforeEach
void init() {
module.registerTo(mapper);
}
@Test
void serialize() throws Exception {
log.info("amount:{}", mapper.writeValueAsString(amount));
log.info("amountFieldTest:{}", mapper.writeValueAsString(amountFieldTest));
}
} | [
"[email protected]"
] | |
6027482a7f85808e49374d7353f02328aaedc3ee | 4de546ffee8c6ca1b37ce3cd78f5d559f5942441 | /src/main/java/bs/kirill/repository/EShipRepository.java | 35184e06c05fae3f81b52f887d838f7cfb3575a3 | [] | no_license | Gotus/Battleship_online | b5b862016294bc4f75609d3e30c1039468acdc18 | d9154aa0c56515af483b43e3633f76e46cc43813 | refs/heads/master | 2020-06-13T07:12:27.166782 | 2017-06-17T12:50:21 | 2017-06-17T12:50:21 | 75,414,550 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package bs.kirill.repository;
import bs.kirill.entity.EShip;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Created by Администратор on 23.12.2016.
*/
public interface EShipRepository extends JpaRepository<EShip, Long>{
EShipRepository findByBattleID(Long S_ID);
EShipRepository findByUserID(Integer U_ID);
}
| [
"[email protected]"
] | |
1aa14e003f439bf4d6029f64c7560d508e135aea | ca7850d079b3892ccdd69e57d7311e4ad484a37a | /source/src/com/lzx/frame/GameJPanel.java | 625e006535b1a3bd726090102784e0c25ccb72ad | [] | no_license | lzxqaq/CrazyArcade | e7166cd00ceff444336a7d1588f565336b707bc8 | 137882f4d063e64b910513f871e92c589fc3c489 | refs/heads/master | 2023-04-26T17:56:10.888573 | 2021-05-26T15:35:18 | 2021-05-26T15:35:18 | 365,517,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,089 | java | package com.lzx.frame;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import javax.swing.JPanel;
import com.lzx.model.manager.ElementManager;
import com.lzx.model.vo.Player;
import com.lzx.model.vo.SuperElement;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
public class GameJPanel extends JPanel implements Runnable{
private ElementManager manager;
public GameJPanel() {
setLayout(null);
setSize(650, 550);
manager = ElementManager.getInstance();
}
/**
* paint方法由底层自动调用,重写父类方法
* 只会执行一次,除非主动调用
* 帧 : 50-100毫秒每帧 , 10-20帧每秒
*/
//作用 显示
@Override
public void paint(Graphics g) {
super.paint(g);
//给一个判定值 枚举
//1.前动画
//System.out.println("11");
//2.gameRuntime
gameRunTime(g);//Graphics 画笔
//this.setBackground(Color.black);
//3.衔接动画
ImageIcon imageIcon = new ImageIcon("img/bg/right_sight.png");
g.drawImage(imageIcon.getImage(), 480,0,160,530, null);
ImageIcon imageIcon2 = new ImageIcon("img/bg/bottom.png");
g.drawImage(imageIcon2.getImage(), 0,480,480,50, null);
g.setColor(Color.RED);
List<SuperElement> list = manager.getElementList("play");
if(list.size()==2) {
Player player = (Player)(manager.getElementList("play").get(0));
if(player !=null) {
g.drawString(""+player.getNum(), 560, 60);
if (player.getNum()>=1000) {
ImageIcon img = new ImageIcon("img/bg/gameovers.png");
g.drawImage(img.getImage(),0,0,640,550,null);
g.setFont(new Font("123",0,50));
g.drawString("1p获胜!", 250, 350);
return ;
}
}
g.setColor(Color.RED);
Player player2 = (Player)(manager.getElementList("play").get(1));
if(player2!=null) {
g.drawString(""+player2.getNum(), 560, 110);
if (player2.getNum()>=1000) {
ImageIcon img = new ImageIcon("img/bg/gameovers.png");
g.drawImage(img.getImage(),0,0,640,550,null);
g.setFont(new Font("123",0,50));
g.drawString("2p获胜!", 250, 350);
return ;
}
}
}
}
private void gameRunTime(Graphics g){
//List<SuperElement> list = ElementManager.getInstance().getElementList("XX");
//g.drawString("132456", 100, 100);
Map<String, List<SuperElement> > map = ElementManager.getInstance().getMap();
Set<String> set = map.keySet();
List<String> temp = new ArrayList<>(set);
Collections.sort(temp);
for (String key : temp) {
List<SuperElement> list = map.get(key);
for (SuperElement superElement : list) {
superElement.showElement(g);
}
}
}
/**
* 重写
* 继承关系的类与类之间的语法现象 多态的一种实现
* 重写的方法必须与父类的签名一样 返回值 方法名称 参数
* 重写的方法 访问修饰符可以比父类更加开放
* 重写的方法抛出异常不可以比父类的更宽
*/
@Override
public void run() {
//死循环 界面会不停止的刷新
while (true) {
try {
TimeUnit.MILLISECONDS.sleep(150);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
this.repaint();
}
}
}
| [
"[email protected]"
] | |
58a57947410167735b90215c6e1c4fc6d5499168 | 494d378111a6dd7e14ae3e9c12c020db2007aaac | /src/TheGame.java | 1db44a2448c14968b39b6549f32c58ccd900ccd3 | [
"MIT"
] | permissive | t-r-e-y/pong | dba932ec90ba9b07d4cd1a295656e18a1e394d59 | 0fe95fea609429da8b8af031c8b2b3bb528549c9 | refs/heads/master | 2020-05-04T18:45:40.326050 | 2013-12-18T19:52:44 | 2013-12-18T19:52:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 574 | java | import javax.swing.*;
public class TheGame extends JFrame {
private static final int WIDTH = 800;
private static final int HEIGHT = 600;
public TheGame() {
super("PONG");
setSize(WIDTH, HEIGHT);
Pong game = new Pong();
game.setFocusable(true);
getContentPane().add(game);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setVisible(true);
}
@SuppressWarnings("unused")
public static void main(String args[]) {
TheGame run = new TheGame();
}
} | [
"[email protected]"
] | |
9cb5939d08ce0b9feb5dad812f9586362bcb095f | 06a9ceffe887a48434acbcbbf7162d7c2d3ee0d9 | /src/main/java/pl/narodzinyprogramsity/modelType/LocationType.java | 8eb36920b6f4b2af6a5f3f958cfbecf39b859874 | [] | no_license | Kwarku/GTFSApp | f5fc8c0af5676dba495be6f63a7a21641905ee36 | 544a36be060d8e5da2bad01be393ef4cca39cd4b | refs/heads/master | 2021-04-09T15:54:31.836083 | 2018-05-23T14:05:38 | 2018-05-23T14:05:38 | 125,617,454 | 0 | 0 | null | 2018-05-23T14:05:40 | 2018-03-17T10:13:16 | Java | UTF-8 | Java | false | false | 475 | java | package pl.narodzinyprogramsity.modelType;
public enum LocationType {
STOP(0),STATION(1), ENTER_OR_EXIT(2), UNKNOWN(-1);
private int type;
LocationType(int type) {
this.type = type;
}
public static LocationType getLocationType(int type){
for (LocationType locationType : LocationType.values()) {
if (locationType.type == type) {
return locationType;
}
}
return UNKNOWN;
}
}
| [
"[email protected]"
] | |
b92137991559fed19d2a055ec40339b09073ff57 | 048bc037dc8d392d7f97cd852d0a8869072f87ca | /src/main/java/com/ld/jwc/jwc_score_job/dao/mysql/mapper/XincheDataQuality/JobMapper.java | 2dbdf16a513aadf3e09ca4fc7b42dbc045683759 | [] | no_license | happy-le/jwc | 9e3823aff1279c434269e48431fec15045c781ec | f009e72ba2c528dfcda0d0d521c25aa67cf42045 | refs/heads/master | 2022-09-19T12:30:39.516648 | 2019-06-05T09:07:52 | 2019-06-05T09:07:52 | 178,994,933 | 4 | 0 | null | 2022-09-01T23:04:51 | 2019-04-02T03:51:37 | Java | UTF-8 | Java | false | false | 1,096 | java | package com.ld.jwc.jwc_score_job.dao.mysql.mapper.XincheDataQuality;
import com.ld.jwc.jwc_score_job.model.mysql.entity.JwcScoreJob.Job;
import com.ld.jwc.jwc_score_job.model.mysql.entity.JwcScoreJob.JobExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface JobMapper {
long countByExample(JobExample example);
int deleteByExample(JobExample example);
int deleteByPrimaryKey(Long id);
int insert(Job record);
int insertSelective(Job record);
List<Job> selectByExampleWithBLOBs(JobExample example);
List<Job> selectByExample(JobExample example);
Job selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Job record, @Param("example") JobExample example);
int updateByExampleWithBLOBs(@Param("record") Job record, @Param("example") JobExample example);
int updateByExample(@Param("record") Job record, @Param("example") JobExample example);
int updateByPrimaryKeySelective(Job record);
int updateByPrimaryKeyWithBLOBs(Job record);
int updateByPrimaryKey(Job record);
} | [
"[email protected]"
] | |
167ed61267af571c961c54450d702a45efcef114 | e6d15cd4c054711baae7451ac30f23dbf044e6c0 | /src/main/java/cn/haichang/assignment/weforward/BugMethods.java | 40c48463870a78b023d53bcd839e84bcd1d68ebe | [] | no_license | linhaichang/lhc_assignment | deae0ce5de8589fa06f741f68c3c14fcd8a715c6 | 24e15dc1db7bf1f8b61351da457dd927a725ef33 | refs/heads/main | 2023-01-02T14:43:58.608775 | 2020-10-29T09:54:25 | 2020-10-29T09:54:25 | 305,633,172 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,857 | java | package cn.haichang.assignment.weforward;
import cn.haichang.assignment.Assignment;
import cn.haichang.assignment.AssignmentService;
import cn.haichang.assignment.Bug;
import cn.haichang.assignment.MyException;
import cn.haichang.assignment.weforward.param.*;
import cn.haichang.assignment.weforward.view.BugView;
import cn.haichang.assignment.weforward.view.SimpleAssignmentView;
import cn.haichang.assignment.weforward.view.SimpleBugView;
import cn.weforward.common.ResultPage;
import cn.weforward.common.util.StringUtil;
import cn.weforward.common.util.TransResultPage;
import cn.weforward.data.log.BusinessLog;
import cn.weforward.framework.*;
import cn.weforward.framework.doc.DocMethods;
import cn.weforward.framework.exception.ForwardException;
import cn.weforward.framework.util.ValidateUtil;
import cn.weforward.protocol.doc.annotation.DocAttribute;
import cn.weforward.protocol.doc.annotation.DocMethod;
import cn.weforward.protocol.doc.annotation.DocParameter;
import cn.weforward.protocol.support.datatype.FriendlyObject;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
/**
* @author HaiChang
* @date 2020/10/22
**/
@DocMethods(index = 300)
@WeforwardMethods
public class BugMethods implements ExceptionHandler {
@Resource
protected AssignmentService m_AssignmentService;
@WeforwardMethod
@DocMethod(description = "创建缺陷",index = 0)
public BugView create(BugParam params) throws ApiException {
String assignmentId = params.getAssignmentId();
String bugContent = params.getBugContent();
String severity = params.getSeverity();
Set<String > handlers = new HashSet<>(params.getHandlers());
String versionAndPlatform = params.getVersionAndPlatform();
ValidateUtil.isEmpty(assignmentId, "任务id不能为空");
ValidateUtil.isEmpty(bugContent, "缺陷内容不能为空");
ValidateUtil.isEmpty(severity, "严重性不能为空");
ValidateUtil.isEmpty(versionAndPlatform, "版本与平台不能为空");
Bug bug = m_AssignmentService.createBug(assignmentId,
bugContent, severity, handlers, versionAndPlatform);
return BugView.valueOf(bug);
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter({
@DocAttribute(name = "assignmentId", type = String.class, necessary = true, description = "任务Id"),
@DocAttribute(name = "page", type = Integer.class, necessary = true, description = "第几页"),
@DocAttribute(name = "pageSize", type = Integer.class, necessary = true, description = "一页的大小")
})
@DocMethod(description = "根据任务Id搜索缺陷", index = 1)
public ResultPage<SimpleBugView> getBugByAssignmentId(FriendlyObject params) throws ApiException, MyException {
String id = params.getString("assignmentId");
ValidateUtil.isEmpty(id, "任务id不能为空");
ResultPage<Bug> rp = m_AssignmentService.getBugByAssignmentId(id);
return new TransResultPage<SimpleBugView,Bug>(rp) {
@Override
protected SimpleBugView trans(Bug src) {
return SimpleBugView.valueOf(src);
}
};
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId", type = String.class, necessary = true, description = "缺陷id"))
@DocMethod(description = "根据缺陷Id搜索缺陷", index = 2)
public BugView getBugByBugId(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
return BugView.valueOf(m_AssignmentService.getBug(bugId));
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter({
@DocAttribute(name = "assignmentId",type = String.class,necessary = true,description = "任务id"),
@DocAttribute(name = "keywords", type = String.class, necessary = true, description = "搜索关键词"),
@DocAttribute(name = "page", type = Integer.class, necessary = true, description = "第几页"),
@DocAttribute(name = "pageSize", type = Integer.class, necessary = true, description = "一页的大小")
})
@DocMethod(description = "通过关键词获取缺陷列表",index = 3)
public ResultPage<SimpleBugView> getByKeyWord(FriendlyObject params) throws ApiException, MyException {
String keywords = params.getString("keywords");
String assignmentId = params.getString("assignmentId");
ValidateUtil.isEmpty(keywords, "关键字id不能为空");
ValidateUtil.isEmpty(assignmentId, "任务id不能为空");
ResultPage<Bug> rp = m_AssignmentService.getBugByKeyWord(assignmentId,keywords);
return new TransResultPage<SimpleBugView,Bug>(rp) {
@Override
protected SimpleBugView trans(Bug src) {
return SimpleBugView.valueOf(src);
}
};
}
@KeepServiceOrigin
@WeforwardMethod
@DocMethod(description = "通过条件查询获取缺陷" , index = 4 )
public ResultPage<SimpleBugView> getByCondition(ConditionQueryBugParam params) throws ApiException, MyException {
String assignmentId = params.getAssignmentId();
String tester = params.getTester();
String handler = params.getHandler();
int state = params.getState();
ValidateUtil.isEmpty(state, "状态不能为空");
ResultPage<Bug> rp = m_AssignmentService.searchBugs(assignmentId,tester,handler
,state);
return new TransResultPage<SimpleBugView, Bug>(rp) {
@Override
protected SimpleBugView trans(Bug src) {
return SimpleBugView.valueOf(src);
}
};
}
@KeepServiceOrigin
@WeforwardMethod
@DocMethod(description = "更新Bug",index = 5)
public BugView update(UpdateBugParam params) throws ApiException, MyException {
String id = params.getId();
ValidateUtil.isEmpty(id, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(id);
if (null == bug){
return null;
}
String bugContent = params.getBugContent();
if (!StringUtil.isEmpty(bugContent)){
bug.setBugContent(bugContent);
}
Set<String> testers = new HashSet<>(params.getTesters());
bug.setTesters(testers);
Set<String> handlers = new HashSet<>(params.getHandlers());
bug.setTestHandler(handlers);
bug.setLastTime(new Date());
String severity = params.getSeverity();
if (!StringUtil.isEmpty(severity)){
bug.setSeverity(severity);
}
return BugView.valueOf(bug);
}
/*状态扭转*/
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId",type = String.class,necessary = true,description = "缺陷id"))
@DocMethod(description = "缺陷状态扭转至待修正",index = 6)
public void turnWaitingCorrect(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(bugId);
bug.turnWaitingCorrect();
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId",type = String.class,necessary = true,description = "缺陷id"))
@DocMethod(description = "缺陷状态扭转至待复测中",index = 7)
public void turnWaitingRetest(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(bugId);
bug.turnWaitingRetest();
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId",type = String.class,necessary = true,description = "缺陷id"))
@DocMethod(description = "缺陷状态扭转至建议不作修改",index = 8)
public void turnAdviseDontEdit(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(bugId);
bug.turnAdviseDontEdit();
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId",type = String.class,necessary = true,description = "缺陷id"))
@DocMethod(description = "缺陷状态扭转至申请无法修改",index = 9)
public void turnAskingCantEdit(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(bugId);
bug.turnAskingCantEdit();
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId",type = String.class,necessary = true,description = "缺陷id"))
@DocMethod(description = "缺陷状态扭转至已解决",index = 10)
public void turnSolved(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(bugId);
bug.turnSolved();
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId",type = String.class,necessary = true,description = "缺陷id"))
@DocMethod(description = "缺陷状态扭转至不作修改",index = 11)
public void turnNoEdit(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(bugId);
bug.turnNoEdit();
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId",type = String.class,necessary = true,description = "缺陷id"))
@DocMethod(description = "缺陷状态扭转至无法修改",index = 12)
public void turnCantSolved(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(bugId);
bug.turnCantSolved();
}
@KeepServiceOrigin
@WeforwardMethod
@DocParameter(@DocAttribute(name = "BugId",type = String.class,necessary = true,description = "缺陷id"))
@DocMethod(description = "缺陷状态扭转至重新打开",index = 13)
public void turnReopen(FriendlyObject params) throws ApiException, MyException {
String bugId = params.getString("BugId");
ValidateUtil.isEmpty(bugId, "缺陷id不能为空");
Bug bug = m_AssignmentService.getBug(bugId);
bug.turnReopen();
}
@WeforwardMethod
@DocMethod(description = "获取Bug日志", index = 14)
public ResultPage<LogView> logs(LogsParam params) throws ApiException, MyException {
String id = params.getId();
ValidateUtil.isEmpty(id, "id不能为空");
Bug bug = m_AssignmentService.getBug(id);
ForwardException.forwardToIfNeed(bug);
return new TransResultPage<LogView, BusinessLog>(bug.getLogs()) {
@Override
protected LogView trans(BusinessLog src) {
return LogView.valueOf(src);
}
};
}
@Override
public Throwable exception(Throwable error) {
if (error instanceof MyException){
return new ApiException(AssignmentServiceCode.getCode((MyException) error), error.getMessage());
}
return error;
}
}
| [
"[email protected]"
] | |
878b34b1897dc8b9ead48903b7a5786d6149e96a | 25ec75af70f56cf34d0d4ccc81a473423a7b92fd | /src/task2/subtask1/Vegetable.java | 0255a976fb2dc42f5a4283472b25054fc6c821a2 | [] | no_license | AnastasiyaLemesh/automatization | eb392e55e7e387ccadf4ddafec393762b8d10678 | e2261ffb28c3349d9a224c1dcc3cac7de362528d | refs/heads/master | 2021-01-19T08:21:32.132685 | 2017-05-18T21:32:46 | 2017-05-18T21:32:46 | 87,620,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 182 | java | package task2.subtask1;
/**
* Created by Anastasiya_Lemesh on 2/21/2017.
*/
public interface Vegetable {
int calcCalorific();
String getName();
int getWeight();
}
| [
"[email protected]"
] | |
b7b786f49e314d5f4a582c286952762e994b60f6 | 5ea2551acddfb2eebdee9d9c36754a98b231e163 | /MobilisXHunt_Service/src/de/tudresden/inf/rn/mobilis/services/xhunt/proxy/DepartureDataRequest.java | fe78e7c211e2f269514d09f20aed80c0d601d32a | [] | no_license | mobilis/XHunt | 0c480aa0e5804ecfdbc9d9cf38af334cd5a87349 | f22e2b2bc4ada1a4c3ba656bebb2aa667e9f625e | refs/heads/master | 2021-01-20T00:58:40.916442 | 2013-11-27T09:10:53 | 2013-11-27T09:10:53 | 10,053,469 | 1 | 1 | null | 2013-11-27T09:10:53 | 2013-05-14T11:13:07 | Java | UTF-8 | Java | false | false | 2,085 | java | package de.tudresden.inf.rn.mobilis.services.xhunt.proxy;
import org.xmlpull.v1.XmlPullParser;
import de.tudresden.inf.rn.mobilis.xmpp.beans.XMPPBean;
public class DepartureDataRequest extends XMPPBean {
private int StationId = Integer.MIN_VALUE;
public DepartureDataRequest( int StationId ) {
super();
this.StationId = StationId;
this.setType( XMPPBean.TYPE_GET );
}
public DepartureDataRequest(){
this.setType( XMPPBean.TYPE_GET );
}
@Override
public void fromXML( XmlPullParser parser ) throws Exception {
boolean done = false;
do {
switch (parser.getEventType()) {
case XmlPullParser.START_TAG:
String tagName = parser.getName();
if (tagName.equals(getChildElement())) {
parser.next();
}
else if (tagName.equals( "StationId" ) ) {
this.StationId = Integer.parseInt( parser.nextText() );
}
else if (tagName.equals("error")) {
parser = parseErrorAttributes(parser);
}
else
parser.next();
break;
case XmlPullParser.END_TAG:
if (parser.getName().equals(getChildElement()))
done = true;
else
parser.next();
break;
case XmlPullParser.END_DOCUMENT:
done = true;
break;
default:
parser.next();
}
} while (!done);
}
public static final String CHILD_ELEMENT = "DepartureDataRequest";
@Override
public String getChildElement() {
return CHILD_ELEMENT;
}
public static final String NAMESPACE = "mobilisxhunt:iq:departure";
@Override
public String getNamespace() {
return NAMESPACE;
}
@Override
public XMPPBean clone() {
DepartureDataRequest clone = new DepartureDataRequest( StationId );
this.cloneBasicAttributes( clone );
return clone;
}
@Override
public String payloadToXML() {
StringBuilder sb = new StringBuilder();
sb.append( "<StationId>" )
.append( this.StationId )
.append( "</StationId>" );
sb = appendErrorPayload(sb);
return sb.toString();
}
public int getStationId() {
return this.StationId;
}
public void setStationId( int StationId ) {
this.StationId = StationId;
}
} | [
"[email protected]"
] | |
542e2b8d0ce0d3b1fe60066cf0a89e2a732f4977 | fe3b1b73172fad6af5fdf30b314d432e05eb8f6b | /vitro-core/webapp/test/edu/cornell/mannlib/vitro/webapp/filters/URLRewritingHttpServletResponseTest.java | f54472c22080dc0461ba852fe1c9383ed2e80c2d | [] | no_license | zahrahariry/VIVO-OpenSocial | 4921d2d9698bca4a81d576e11750df86da860332 | c031938459c2ac09d36b579c660878756643f4c9 | refs/heads/master | 2020-04-09T03:14:39.287107 | 2012-09-28T19:33:33 | 2012-09-28T19:33:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 39,044 | java | /*
Copyright (c) 2012, Cornell University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Cornell University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.cornell.mannlib.vitro.webapp.filters;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletResponse;
import junit.framework.Assert;
import org.junit.Test;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import edu.cornell.mannlib.vitro.webapp.utils.NamespaceMapper;
public class URLRewritingHttpServletResponseTest {
/*
* Style A is for sites that are running at a URL like http://localhost:8080/vivo
* with no portals.
*/
protected void urlEncodingStyleA(String urlToEncode, String expectedUrlResult ){
URLRewritingHttpServletResponse urhsr = new URLRewritingHttpServletResponse(new stubs.javax.servlet.http.HttpServletResponseStub());
List<String>externalNamespaces = new ArrayList();
externalNamespaces.add("http://vivo.med.cornell.edu/individual/");
String actual = urhsr.encodeForVitro(urlToEncode, "UTF-8",
true, 1,
getMockNamespaceMapper(),
"http://vivo.cornell.edu/individual/",
externalNamespaces);
Assert.assertEquals(expectedUrlResult, actual);
}
/*
* Style A is for sites that are running behind apache httpd at a
* URL like http://caruso.mannlib.cornell.edu/ with no portals.
*/
protected void urlEncodingStyleB(String urlToEncode, String expectedUrlResult){
URLRewritingHttpServletResponse urhsr = new URLRewritingHttpServletResponse(new stubs.javax.servlet.http.HttpServletResponseStub());
List<String>externalNamespaces = new ArrayList();
externalNamespaces.add("http://vivo.med.cornell.edu/individual/");
String actual = urhsr.encodeForVitro(urlToEncode, "UTF-8",
true, 0,
getMockNamespaceMapper(),
"http://vivo.cornell.edu/individual/",
externalNamespaces);
Assert.assertEquals(expectedUrlResult, actual);
}
@Test
public void test40984(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test40988(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/getURLParam.js",
"/vivo/js/jquery_plugins/getURLParam.js"); }
@Test
public void test40994(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/colorAnimations.js",
"/vivo/js/jquery_plugins/colorAnimations.js"); }
@Test
public void test40995(){ urlEncodingStyleA(
"/vivo/js/propertyGroupSwitcher.js",
"/vivo/js/propertyGroupSwitcher.js"); }
@Test
public void test40996(){ urlEncodingStyleA( "/vivo/js/controls.js",
"/vivo/js/controls.js"); }
@Test
public void test40999(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.form.js",
"/vivo/js/jquery_plugins/jquery.form.js"); }
@Test
public void test41004(){ urlEncodingStyleA(
"/vivo/js/tiny_mce/tiny_mce.js", "/vivo/js/tiny_mce/tiny_mce.js"); }
@Test
public void test41133(){ urlEncodingStyleA(
"/vivo/entityEdit?uri=http%3a%2f%2fbogus.com%2findividual%2fn3671",
"/vivo/entityEdit?uri=http%3A%2F%2Fbogus.com%2Findividual%2Fn3671"); }
@Test
public void test41464(){ urlEncodingStyleA(
"/vivo/themes/vivo-basic/site_icons/visualization/ajax-loader.gif",
"/vivo/themes/vivo-basic/site_icons/visualization/ajax-loader.gif"); }
@Test
public void test41465(){ urlEncodingStyleA(
"/vivo/visualization?render_mode=dynamic&container=vis_container&vis=person_pub_count&vis_mode=short&uri=http%3a%2f%2fbogus.com%2findividual%2fn3671",
"/vivo/visualization?render_mode=dynamic&container=vis_container&vis=person_pub_count&vis_mode=short&uri=http%3A%2F%2Fbogus.com%2Findividual%2Fn3671");
}
@Test
public void test42110(){ urlEncodingStyleA(
"/vivo/js/imageUpload/imageUploadUtils.js",
"/vivo/js/imageUpload/imageUploadUtils.js"); }
@Test
public void test57982(){ urlEncodingStyleA(
"entityEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fAgent",
"entityEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FAgent");
}
@Test
public void test57983(){ urlEncodingStyleA(
"/vivo/vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fAgent",
"/vivo/vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FAgent"); }
@Test
public void test57986(){ urlEncodingStyleA(
"entityEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fPerson",
"entityEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FPerson");
}
@Test
public void test57987(){ urlEncodingStyleA(
"/vivo/vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fPerson",
"/vivo/vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FPerson");
}
@Test
public void test57988(){ urlEncodingStyleA(
"entityEdit?uri=http%3a%2f%2fwww.w3.org%2f2002%2f07%2fowl%23Thing",
"entityEdit?uri=http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23Thing");
}
@Test
public void test57989(){ urlEncodingStyleA(
"/vivo/vclassEdit?uri=http%3a%2f%2fwww.w3.org%2f2002%2f07%2fowl%23Thing",
"/vivo/vclassEdit?uri=http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23Thing");
}
@Test
public void test42083(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23Address",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23Address");
}
@Test
public void test42084(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23DateTimeInterval",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23DateTimeInterval");
}
@Test
public void test42085(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23URLLink",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23URLLink");
}
@Test
public void test42086(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23AcademicDegree",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23AcademicDegree");
}
@Test
public void test42087(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fpurl.org%2fontology%2fbibo%2fDocumentStatus",
"vclassEdit?uri=http%3A%2F%2Fpurl.org%2Fontology%2Fbibo%2FDocumentStatus");
}
@Test
public void test42088(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23DateTimeValuePrecision",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23DateTimeValuePrecision");
}
@Test
public void test42089(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23DateTimeValue",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23DateTimeValue");
}
@Test
public void test42090(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23Award",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23Award");
}
@Test
public void test42091(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23Authorship",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23Authorship");
}
@Test
public void test48256(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fPerson",
"vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FPerson");
}
@Test
public void test11309(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-43882498%3a12c1825c819%3a-7df6",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-43882498%3A12c1825c819%3A-7df6");
}
@Test
public void test11310(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-43882498%3a12c1825c819%3a-7e02",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-43882498%3A12c1825c819%3A-7e02");
}
@Test
public void test11311(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-43882498%3a12c1825c819%3a-7e09",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-43882498%3A12c1825c819%3A-7e09");
}
@Test
public void test11312(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-43882498%3a12c1825c819%3a-7df5",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-43882498%3A12c1825c819%3A-7df5");
}
@Test
public void test11313(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-43882498%3a12c1825c819%3a-7df4",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-43882498%3A12c1825c819%3A-7df4");
}
@Test
public void test11314(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-43882498%3a12c1825c819%3a-7df9",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-43882498%3A12c1825c819%3A-7df9");
}
@Test
public void test11315(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-43882498%3a12c1825c819%3a-7df8",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-43882498%3A12c1825c819%3A-7df8");
}
@Test
public void test11317(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-43882498%3a12c1825c819%3a-7df7",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-43882498%3A12c1825c819%3A-7df7");
}
@Test
public void test11318(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fAgent",
"vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FAgent");
}
@Test
public void test11319(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23Librarian",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23Librarian");
}
@Test
public void test11320(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23Student",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23Student");
}
@Test
public void test11321(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23NonAcademic",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23NonAcademic");
}
@Test
public void test11322(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23NonFacultyAcademic",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23NonFacultyAcademic");
}
@Test
public void test113222(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23FacultyMember",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23FacultyMember");
}
@Test
public void test11323(){ urlEncodingStyleA(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23EmeritusProfessor",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23EmeritusProfessor");
}
@Test
public void test53543(){ urlEncodingStyleA(
"ingest?action=outputModel&modelName=http%3a%2f%2fvitro.mannlib.cornell.edu%2fdefault%2fvitro-kb-2",
"ingest?action=outputModel&modelName=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fdefault%2Fvitro-kb-2");
}
@Test
public void test53549(){ urlEncodingStyleA(
"ingest?action=outputModel&modelName=http%3a%2f%2fvitro.mannlib.cornell.edu%2fdefault%2fvitro-kb-inf",
"ingest?action=outputModel&modelName=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fdefault%2Fvitro-kb-inf");
}
@Test
public void test53555(){ urlEncodingStyleA(
"ingest?action=outputModel&modelName=http%3a%2f%2fvitro.mannlib.cornell.edu%2fdefault%2fvitro-kb-userAccounts",
"ingest?action=outputModel&modelName=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fdefault%2Fvitro-kb-userAccounts");
}
@Test
public void test53557(){ urlEncodingStyleA(
"ingest?action=outputModel&modelName=http%3a%2f%2fvitro.mannlib.cornell.edu%2fdefault%2fvitro-kb-displayMetadata",
"ingest?action=outputModel&modelName=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fdefault%2Fvitro-kb-displayMetadata");
}
@Test
public void test391499(){ urlEncodingStyleA(
"/vivo/edit/forms/css/customForm.css",
"/vivo/edit/forms/css/customForm.css"); }
@Test
public void test39149(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox.css",
"/vivo/js/jquery_plugins/thickbox/thickbox.css"); }
@Test
public void test39153(){ urlEncodingStyleA(
"/vivo/edit/processRdfForm2.jsp", "/vivo/edit/processRdfForm2.jsp"); }
@Test
public void test39472(){ urlEncodingStyleA(
"/vivo/js/extensions/String.js", "/vivo/js/extensions/String.js"); }
@Test
public void test394730(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test39473(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js",
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js"); }
@Test
public void test39474(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js",
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js"); }
@Test
public void test39475(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/ui.datepicker.js",
"/vivo/js/jquery_plugins/ui.datepicker.js"); }
@Test
public void test14958(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test14968(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/getURLParam.js",
"/vivo/js/jquery_plugins/getURLParam.js"); }
@Test
public void test14972(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/colorAnimations.js",
"/vivo/js/jquery_plugins/colorAnimations.js"); }
@Test
public void test14979(){ urlEncodingStyleA(
"/vivo/js/propertyGroupSwitcher.js",
"/vivo/js/propertyGroupSwitcher.js"); }
@Test
public void test14980(){ urlEncodingStyleA( "/vivo/js/controls.js",
"/vivo/js/controls.js"); }
@Test
public void test14982(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.form.js",
"/vivo/js/jquery_plugins/jquery.form.js"); }
@Test
public void test14986(){ urlEncodingStyleA(
"/vivo/js/tiny_mce/tiny_mce.js", "/vivo/js/tiny_mce/tiny_mce.js"); }
@Test
public void test14999(){ urlEncodingStyleA(
"/vivo/entityEdit?uri=http%3a%2f%2fbogus.com%2findividual%2fn3671",
"/vivo/entityEdit?uri=http%3A%2F%2Fbogus.com%2Findividual%2Fn3671"); }
@Test
public void test15011(){ urlEncodingStyleA(
"/vivo/themes/vivo-basic/site_icons/visualization/ajax-loader.gif",
"/vivo/themes/vivo-basic/site_icons/visualization/ajax-loader.gif"); }
@Test
public void test15014(){ urlEncodingStyleA(
"/vivo/visualization?render_mode=dynamic&container=vis_container&vis=person_pub_count&vis_mode=short&uri=http%3a%2f%2fbogus.com%2findividual%2fn3671",
"/vivo/visualization?render_mode=dynamic&container=vis_container&vis=person_pub_count&vis_mode=short&uri=http%3A%2F%2Fbogus.com%2Findividual%2Fn3671");
}
@Test
public void test15143(){ urlEncodingStyleA(
"/vivo/js/imageUpload/imageUploadUtils.js",
"/vivo/js/imageUpload/imageUploadUtils.js"); }
@Test
public void test184670(){ urlEncodingStyleA(
"/vivo/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css",
"/vivo/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css"); }
@Test
public void test18467(){ urlEncodingStyleA(
"/vivo/edit/forms/css/customForm.css",
"/vivo/edit/forms/css/customForm.css"); }
@Test
public void test184680(){ urlEncodingStyleA(
"/vivo/edit/forms/css/customFormWithAutocomplete.css",
"/vivo/edit/forms/css/customFormWithAutocomplete.css"); }
@Test
public void test18468(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox.css",
"/vivo/js/jquery_plugins/thickbox/thickbox.css"); }
@Test
public void test18472(){ urlEncodingStyleA(
"/vivo/edit/processRdfForm2.jsp", "/vivo/edit/processRdfForm2.jsp"); }
@Test
public void test18506(){ urlEncodingStyleA( "/vivo/individual?uri=",
"/vivo/individual?uri="); }
@Test
public void test18512(){ urlEncodingStyleA(
"/vivo/autocomplete?tokenize=true&stem=true",
"/vivo/autocomplete?tokenize=true&stem=true"); }
@Test
public void test18516(){ urlEncodingStyleA(
"/vivo/js/extensions/String.js", "/vivo/js/extensions/String.js"); }
@Test
public void test18543(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test185440(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js",
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js"); }
@Test
public void test18544(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js",
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js"); }
@Test
public void test18545(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/ui.datepicker.js",
"/vivo/js/jquery_plugins/ui.datepicker.js"); }
@Test
public void test18546(){ urlEncodingStyleA(
"/vivo/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js",
"/vivo/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"); }
@Test
public void test185470(){ urlEncodingStyleA(
"/vivo/js/customFormUtils.js", "/vivo/js/customFormUtils.js"); }
@Test
public void test18547(){ urlEncodingStyleA(
"/vivo/edit/forms/js/customFormWithAutocomplete.js",
"/vivo/edit/forms/js/customFormWithAutocomplete.js"); }
@Test
public void test27127(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox.css",
"/vivo/js/jquery_plugins/thickbox/thickbox.css"); }
@Test
public void test27130(){ urlEncodingStyleA(
"/vivo/edit/processDatapropRdfForm.jsp",
"/vivo/edit/processDatapropRdfForm.jsp"); }
@Test
public void test271590(){ urlEncodingStyleA(
"/vivo/js/extensions/String.js", "/vivo/js/extensions/String.js"); }
@Test
public void test27159(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test27160(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js",
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js"); }
@Test
public void test27161(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js",
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js"); }
@Test
public void test27166(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/ui.datepicker.js",
"/vivo/js/jquery_plugins/ui.datepicker.js"); }
@Test
public void test14842(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox.css",
"/vivo/js/jquery_plugins/thickbox/thickbox.css"); }
@Test
public void test14846(){ urlEncodingStyleA(
"/vivo/edit/processDatapropRdfForm.jsp",
"/vivo/edit/processDatapropRdfForm.jsp"); }
@Test
public void test148510(){ urlEncodingStyleA(
"/vivo/js/extensions/String.js", "/vivo/js/extensions/String.js"); }
@Test
public void test14851(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test14852(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js",
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js"); }
@Test
public void test148530(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js",
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js"); }
@Test
public void test14853(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/ui.datepicker.js",
"/vivo/js/jquery_plugins/ui.datepicker.js"); }
@Test
public void test43748(){ urlEncodingStyleA(
"/vivo/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css",
"/vivo/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css"); }
@Test
public void test43749(){ urlEncodingStyleA(
"/vivo/edit/forms/css/customForm.css",
"/vivo/edit/forms/css/customForm.css"); }
@Test
public void test437500(){ urlEncodingStyleA(
"/vivo/edit/forms/css/customFormWithAutocomplete.css",
"/vivo/edit/forms/css/customFormWithAutocomplete.css"); }
@Test
public void test43750(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox.css",
"/vivo/js/jquery_plugins/thickbox/thickbox.css"); }
@Test
public void test437540(){ urlEncodingStyleA(
"/vivo/edit/processRdfForm2.jsp", "/vivo/edit/processRdfForm2.jsp"); }
@Test
public void test43754(){ urlEncodingStyleA( "/vivo/individual?uri=",
"/vivo/individual?uri="); }
@Test
public void test43757(){ urlEncodingStyleA(
"/vivo/autocomplete?tokenize=true&stem=true",
"/vivo/autocomplete?tokenize=true&stem=true"); }
@Test
public void test43760(){ urlEncodingStyleA(
"/vivo/js/extensions/String.js", "/vivo/js/extensions/String.js"); }
@Test
public void test437610(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test43761(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js",
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js"); }
@Test
public void test43762(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js",
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js"); }
@Test
public void test437630(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/ui.datepicker.js",
"/vivo/js/jquery_plugins/ui.datepicker.js"); }
@Test
public void test43763(){ urlEncodingStyleA(
"/vivo/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js",
"/vivo/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"); }
@Test
public void test437640(){ urlEncodingStyleA(
"/vivo/js/customFormUtils.js", "/vivo/js/customFormUtils.js"); }
@Test
public void test43764(){ urlEncodingStyleA(
"/vivo/edit/forms/js/customFormWithAutocomplete.js",
"/vivo/edit/forms/js/customFormWithAutocomplete.js"); }
@Test
public void test14550(){ urlEncodingStyleA(
"/vivo/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css",
"/vivo/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css"); }
@Test
public void test14551(){ urlEncodingStyleA(
"/vivo/edit/forms/css/customForm.css",
"/vivo/edit/forms/css/customForm.css"); }
@Test
public void test1455200(){ urlEncodingStyleA(
"/vivo/edit/forms/css/customFormWithAutocomplete.css",
"/vivo/edit/forms/css/customFormWithAutocomplete.css"); }
@Test
public void test14552(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox.css",
"/vivo/js/jquery_plugins/thickbox/thickbox.css"); }
@Test
public void test14556(){ urlEncodingStyleA(
"/vivo/edit/processRdfForm2.jsp", "/vivo/edit/processRdfForm2.jsp"); }
@Test
public void test14557(){ urlEncodingStyleA( "/vivo/individual?uri=",
"/vivo/individual?uri="); }
@Test
public void test145610(){ urlEncodingStyleA(
"/vivo/autocomplete?tokenize=true&stem=true",
"/vivo/autocomplete?tokenize=true&stem=true"); }
@Test
public void test14561(){ urlEncodingStyleA( "/vivo/admin/sparqlquery",
"/vivo/admin/sparqlquery"); }
@Test
public void test14565(){ urlEncodingStyleA(
"/vivo/js/extensions/String.js", "/vivo/js/extensions/String.js"); }
@Test
public void test145650(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test145660(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js",
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js"); }
@Test
public void test14566(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js",
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js"); }
@Test
public void test14567(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/ui.datepicker.js",
"/vivo/js/jquery_plugins/ui.datepicker.js"); }
@Test
public void test145680(){ urlEncodingStyleA(
"/vivo/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js",
"/vivo/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"); }
@Test
public void test14568(){ urlEncodingStyleA(
"/vivo/js/customFormUtils.js", "/vivo/js/customFormUtils.js"); }
@Test
public void test145690(){ urlEncodingStyleA(
"/vivo/js/browserUtils.js", "/vivo/js/browserUtils.js"); }
@Test
public void test14569(){ urlEncodingStyleA(
"/vivo/edit/forms/js/customFormWithAutocomplete.js",
"/vivo/edit/forms/js/customFormWithAutocomplete.js"); }
@Test
public void test29078(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox.css",
"/vivo/js/jquery_plugins/thickbox/thickbox.css"); }
@Test
public void test29081(){ urlEncodingStyleA(
"/vivo/edit/processDatapropRdfForm.jsp",
"/vivo/edit/processDatapropRdfForm.jsp"); }
@Test
public void test29084(){ urlEncodingStyleA(
"/vivo/js/extensions/String.js", "/vivo/js/extensions/String.js"); }
@Test
public void test29085(){ urlEncodingStyleA( "/vivo/js/jquery.js",
"/vivo/js/jquery.js"); }
@Test
public void test290860(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js",
"/vivo/js/jquery_plugins/jquery.bgiframe.pack.js"); }
@Test
public void test29086(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js",
"/vivo/js/jquery_plugins/thickbox/thickbox-compressed.js"); }
@Test
public void test29087(){ urlEncodingStyleA(
"/vivo/js/jquery_plugins/ui.datepicker.js",
"/vivo/js/jquery_plugins/ui.datepicker.js"); }
@Test
public void test35560(){ urlEncodingStyleB( "/js/jquery.js",
"/js/jquery.js"); }
@Test
public void test35562(){ urlEncodingStyleB(
"/js/jquery_plugins/getURLParam.js",
"/js/jquery_plugins/getURLParam.js"); }
@Test
public void test35564(){ urlEncodingStyleB(
"/js/jquery_plugins/colorAnimations.js",
"/js/jquery_plugins/colorAnimations.js"); }
@Test
public void test35568(){ urlEncodingStyleB(
"/js/propertyGroupSwitcher.js", "/js/propertyGroupSwitcher.js"); }
@Test
public void test35617(){ urlEncodingStyleB( "/js/controls.js",
"/js/controls.js"); }
@Test
public void test35618(){ urlEncodingStyleB(
"/js/jquery_plugins/jquery.form.js",
"/js/jquery_plugins/jquery.form.js"); }
@Test
public void test356180(){ urlEncodingStyleB(
"/js/tiny_mce/tiny_mce.js", "/js/tiny_mce/tiny_mce.js"); }
@Test
public void test37150(){ urlEncodingStyleB(
"/entityEdit?uri=http%3a%2f%2fbogus.com%2findividual%2fn3671",
"/entityEdit?uri=http%3A%2F%2Fbogus.com%2Findividual%2Fn3671"); }
@Test
public void test37402(){ urlEncodingStyleB(
"/themes/vivo-basic/site_icons/visualization/ajax-loader.gif",
"/themes/vivo-basic/site_icons/visualization/ajax-loader.gif"); }
@Test
public void test37403(){ urlEncodingStyleB(
"/visualization?render_mode=dynamic&container=vis_container&vis=person_pub_count&vis_mode=short&uri=http%3a%2f%2fbogus.com%2findividual%2fn3671",
"/visualization?render_mode=dynamic&container=vis_container&vis=person_pub_count&vis_mode=short&uri=http%3A%2F%2Fbogus.com%2Findividual%2Fn3671");
}
@Test
public void test38667(){ urlEncodingStyleB(
"/js/imageUpload/imageUploadUtils.js",
"/js/imageUpload/imageUploadUtils.js"); }
@Test
public void test47087(){ urlEncodingStyleB(
"entityEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fAgent",
"entityEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FAgent");
}
@Test
public void test47088(){ urlEncodingStyleB(
"/vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fAgent",
"/vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FAgent"); }
@Test
public void test470910(){ urlEncodingStyleB(
"entityEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fPerson",
"entityEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FPerson");
}
@Test
public void test47091(){ urlEncodingStyleB(
"/vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fPerson",
"/vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FPerson"); }
@Test
public void test470930(){ urlEncodingStyleB(
"entityEdit?uri=http%3a%2f%2fwww.w3.org%2f2002%2f07%2fowl%23Thing",
"entityEdit?uri=http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23Thing");
}
@Test
public void test47093(){ urlEncodingStyleB(
"/vclassEdit?uri=http%3a%2f%2fwww.w3.org%2f2002%2f07%2fowl%23Thing",
"/vclassEdit?uri=http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23Thing");
}
@Test
public void test04993(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-20981c46%3a12c18866689%3a-7d2e",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-20981c46%3A12c18866689%3A-7d2e");
}
@Test
public void test04994(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-20981c46%3a12c18866689%3a-7dad",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-20981c46%3A12c18866689%3A-7dad");
}
@Test
public void test04995(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-20981c46%3a12c18866689%3a-7d31",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-20981c46%3A12c18866689%3A-7d31");
}
@Test
public void test04996(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-20981c46%3a12c18866689%3a-7db7",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-20981c46%3A12c18866689%3A-7db7");
}
@Test
public void test04997(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-20981c46%3a12c18866689%3a-7df2",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-20981c46%3A12c18866689%3A-7df2");
}
@Test
public void test04999(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fOrganization",
"vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FOrganization");
}
@Test
public void test05000(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fPerson",
"vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FPerson");
}
@Test
public void test13898(){ urlEncodingStyleB(
"entityEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fvitro%2fpublic%23File",
"entityEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fvitro%2Fpublic%23File");
}
@Test
public void test13899(){ urlEncodingStyleB(
"/vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fvitro%2fpublic%23File",
"/vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fvitro%2Fpublic%23File");
}
@Test
public void test28454(){ urlEncodingStyleB(
"entityEdit?uri=http%3a%2f%2fwww.w3.org%2f2002%2f07%2fowl%23Thing",
"entityEdit?uri=http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23Thing");
}
@Test
public void test28458(){ urlEncodingStyleB(
"/vclassEdit?uri=http%3a%2f%2fwww.w3.org%2f2002%2f07%2fowl%23Thing",
"/vclassEdit?uri=http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23Thing");
}
@Test
public void test38687(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-20981c46%3a12c18866689%3a-7d75",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-20981c46%3A12c18866689%3A-7d75");
}
@Test
public void test38693(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-20981c46%3a12c18866689%3a-7d76",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-20981c46%3A12c18866689%3A-7d76");
}
@Test
public void test38694(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23AbstractInformation",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23AbstractInformation");
}
@Test
public void test38695(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvitro.mannlib.cornell.edu%2fns%2fbnode%23-20981c46%3a12c18866689%3a-7d77",
"vclassEdit?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fns%2Fbnode%23-20981c46%3A12c18866689%3A-7d77");
}
@Test
public void test38696(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fpurl.org%2fontology%2fbibo%2fThesisDegree",
"vclassEdit?uri=http%3A%2F%2Fpurl.org%2Fontology%2Fbibo%2FThesisDegree");
}
@Test
public void test43123(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fxmlns.com%2ffoaf%2f0.1%2fPerson",
"vclassEdit?uri=http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FPerson");
}
@Test
public void test43124(){ urlEncodingStyleB(
"vclassEdit?uri=http%3a%2f%2fvivoweb.org%2fontology%2fcore%23Postdoc",
"vclassEdit?uri=http%3A%2F%2Fvivoweb.org%2Fontology%2Fcore%23Postdoc");
}
@Test
public void test59983(){ urlEncodingStyleB(
"propertyEdit?uri=http%3a%2f%2fpurl.org%2fdc%2fterms%2fcontributor",
"propertyEdit?uri=http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2Fcontributor");
}
@Test
public void test17004(){ urlEncodingStyleB(
"ingest?action=outputModel&modelName=http%3a%2f%2fvitro.mannlib.cornell.edu%2fdefault%2fvitro-kb-2",
"ingest?action=outputModel&modelName=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fdefault%2Fvitro-kb-2");
}
@Test
public void test17017(){ urlEncodingStyleB(
"ingest?action=outputModel&modelName=http%3a%2f%2fvitro.mannlib.cornell.edu%2fdefault%2fvitro-kb-inf",
"ingest?action=outputModel&modelName=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fdefault%2Fvitro-kb-inf");
}
@Test
public void test17021(){ urlEncodingStyleB(
"ingest?action=outputModel&modelName=http%3a%2f%2fvitro.mannlib.cornell.edu%2fdefault%2fvitro-kb-userAccounts",
"ingest?action=outputModel&modelName=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fdefault%2Fvitro-kb-userAccounts");
}
@Test
public void test17033(){ urlEncodingStyleB(
"ingest?action=outputModel&modelName=http%3a%2f%2fvitro.mannlib.cornell.edu%2fdefault%2fvitro-kb-displayMetadata",
"ingest?action=outputModel&modelName=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fdefault%2Fvitro-kb-displayMetadata");
}
public NamespaceMapper getMockNamespaceMapper(){
return new NamespaceMapper() {
@Override
public void removedStatements(Model arg0) {
// TODO Auto-generated method stub
}
@Override
public void removedStatements(StmtIterator arg0) {
// TODO Auto-generated method stub
}
@Override
public void removedStatements(List<Statement> arg0) {
// TODO Auto-generated method stub
}
@Override
public void removedStatements(Statement[] arg0) {
// TODO Auto-generated method stub
}
@Override
public void removedStatement(Statement arg0) {
// TODO Auto-generated method stub
}
@Override
public void notifyEvent(Model arg0, Object arg1) {
// TODO Auto-generated method stub
}
@Override
public void addedStatements(Model arg0) {
// TODO Auto-generated method stub
}
@Override
public void addedStatements(StmtIterator arg0) {
// TODO Auto-generated method stub
}
@Override
public void addedStatements(List<Statement> arg0) {
// TODO Auto-generated method stub
}
@Override
public void addedStatements(Statement[] arg0) {
// TODO Auto-generated method stub
}
@Override
public void addedStatement(Statement arg0) {
// TODO Auto-generated method stub
}
@Override
public List<String> getPrefixesForNamespace(String namespace) {
// TODO Auto-generated method stub
return null;
}
@Override
public String getPrefixForNamespace(String namespace) {
// TODO Auto-generated method stub
return null;
}
@Override
public String getNamespaceForPrefix(String prefix) {
// TODO Auto-generated method stub
return null;
}
};
}
}
| [
"[email protected]"
] | |
25cb0c47371d9b4f6a9ce58c251600a2c857565a | 6b3d2336aa7e7310b163280b439cfb315a2f22e6 | /src/com/Servlet/JuicioMaker.java | 62e11c4a8d1853f8b8470b5edea1342d842890da | [] | no_license | MariaEugenia/JuiciosMaker | 680932f38c23b7d4d4c4c13e7f1b49df3f3b871b | 6cdf7ffa218f4f8afd412ead8738ab8d00e6c7ad | refs/heads/master | 2020-04-08T12:23:26.157716 | 2018-11-30T20:02:59 | 2018-11-30T20:02:59 | 159,345,499 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,959 | java | package com.Servlet;
import java.sql.*;
import java.util.ArrayList;
//import com.mysql.jdbc.Driver;
import java.util.Date;
import java.util.List;
public class JuicioMaker {
private Connection connect() {
// create a java mysql database connection
//LOCAL//
//HEROKU//
Connection conn = null;
try {
Class.forName(myDriver);
//HEROKU
} catch (SQLException e) {
System.out.println(e.getMessage());
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
/**
* Update data of a warehouse specified by the id
*
* @param id
* @param name name of the warehouse
* @param capacity capacity of the warehouse
*/
public void insertJuicio(String alumno, String mes, String juicio, int grupo, int numero, int nota) {
// create the java mysql update preparedstatement
String query = "Insert into Juicios (alumno, mes, juicio, grupo, numero, nota) values (?, ? , ?, ?, ?, ?)";
try (Connection conn = this.connect();
PreparedStatement preparedStmt = conn.prepareStatement(query)){
preparedStmt.setString (1, alumno);
preparedStmt.setString (2, mes);
preparedStmt.setString (3, juicio);
preparedStmt.setInt (4, grupo);
preparedStmt.setInt (5, numero);
preparedStmt.setInt (6, nota);
// update
preparedStmt.executeUpdate();
conn.close();
} catch (SQLException e) {
System.out.println(e.getMessage());
}
}
public void updateJuicio(String alumno, String mes, String juicio, int nota) {
// create the java mysql update preparedstatement
String query = "Update Juicios set juicio = ?, nota = ? where mes = ? and alumno = ?";
System.out.println("en update "+ alumno+" "+mes+" "+juicio);
try (Connection conn = this.connect();
PreparedStatement preparedStmt = conn.prepareStatement(query)){
preparedStmt.setString (1, juicio);
preparedStmt.setInt (2, nota);
preparedStmt.setString (3, mes);
preparedStmt.setString (4, alumno);
// update
preparedStmt.executeUpdate();
conn.close();
} catch (SQLException e) {
System.out.println(e.getMessage());
}
}
public List<Juicio> getJuiciosForMonth(String mes, int grupo) {
// create the java mysql update preparedstatement
String query = "Select alumno, juicio, numero, nota From Juicios where mes = ? and grupo = ? order by numero asc";
List<Juicio> lista = new ArrayList<Juicio>();
try (Connection conn = this.connect();
PreparedStatement preparedStmt = conn.prepareStatement(query)){
preparedStmt.setString(1, mes);
preparedStmt.setInt(2, grupo);
// update
ResultSet rs = preparedStmt.executeQuery();
while (rs.next()) {
lista.add(new Juicio(rs.getString("alumno"),mes,rs.getString("juicio"),grupo, rs.getInt("numero"), rs.getInt("nota")));
}
conn.close();
} catch (SQLException e) {
System.out.println(e.getMessage());
}
return lista;
}
public List<Juicio> getJuiciosForStudent(String alumno) {
// create the java mysql update preparedstatement
String query = "Select mes, juicio, grupo, nota, numero From Juicios where alumno = ?";
List<Juicio> lista = new ArrayList<Juicio>();
try (Connection conn = this.connect();
PreparedStatement preparedStmt = conn.prepareStatement(query)){
preparedStmt.setString(1, alumno);
// update
ResultSet rs = preparedStmt.executeQuery();
while (rs.next()) {
lista.add(new Juicio(alumno,rs.getString("mes"),rs.getString("juicio"),rs.getInt("grupo"),rs.getInt("numero"), rs.getInt("nota")));
}
conn.close();
} catch (SQLException e) {
System.out.println(e.getMessage());
}
return lista;
}
public boolean existsJuicio(String mes, String alumno) {
// create the java mysql update preparedstatement
String query = "Select juicio From Juicios where alumno = ? and mes = ?";
boolean exists = false;
try (Connection conn = this.connect();
PreparedStatement preparedStmt = conn.prepareStatement(query)){
preparedStmt.setString(1, alumno);
preparedStmt.setString(2, mes);
// update
ResultSet rs = preparedStmt.executeQuery();
while (rs.next()) {
exists = true;
}
conn.close();
} catch (SQLException e) {
System.out.println(e.getMessage());
}
return exists;
}
public int logIn(String user, String pass) {
// create the java mysql update preparedstatement
String query = "Select id From User where user = ? and password = ?";
int id = -1;
try (Connection conn = this.connect();
PreparedStatement preparedStmt = conn.prepareStatement(query)){
preparedStmt.setString(1, user);
preparedStmt.setString(2, pass);
// update
ResultSet rs = preparedStmt.executeQuery();
while (rs.next()) {
id = rs.getInt("id");
}
conn.close();
} catch (SQLException e) {
System.out.println(e.getMessage());
}
return id;
}
/**
* @param args the command line arguments
*/
public static void main (String[] args) {
// update the warehouse with id 3
//app.insertUser( mail, name, password);
//System.out.println(app.checkUserExists("[email protected]"));
//System.out.println(app.checkUserPassword("[email protected]","test2"));
//app.updateUserPasword( "[email protected]", "test2");
}
}
| [
"[email protected]"
] | |
a6d2925c303d69a34a320b91e3329b6ecb0afcd4 | f33516ffd4ac82b741f936ae2f7ef974b5f7e2f9 | /changedPlugins/org.emftext.language.java/src-gen/org/emftext/language/java/modifiers/impl/ProtectedImpl.java | 25c6a460d1e3e603e41c1c95a4a06a57a6cfb574 | [] | no_license | ichupakhin/sdq | e8328d5fdc30482c2f356da6abdb154e948eba77 | 32cc990e32b761aa37420f9a6d0eede330af50e2 | refs/heads/master | 2023-01-06T13:33:20.184959 | 2020-11-01T13:29:04 | 2020-11-01T13:29:04 | 246,244,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,348 | java | /**
* Copyright (c) 2006-2014
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
*
*/
package org.emftext.language.java.modifiers.impl;
import org.eclipse.emf.ecore.EClass;
import org.emftext.language.java.modifiers.ModifiersPackage;
import org.emftext.language.java.modifiers.Protected;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Protected</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generated
*/
public class ProtectedImpl extends ModifierImpl implements Protected
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ProtectedImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ModifiersPackage.Literals.PROTECTED;
}
} //ProtectedImpl
| [
"[email protected]"
] | |
53d7eb08f5188a80005feca5a23e0b7d6496be85 | b175b23895f3b4f0468c4ed0523bd22b25973291 | /android/app/src/main/java/guide/theta360/theta_v_basic_app/MainActivity.java | 9ee85d9212f671df3796bc22a8f944db61d17c08 | [] | no_license | KaiyoteSoft/theta-basic-app | 51202d0f121ec9a8dea013487b8f3b0cfd460832 | b1f20d1994b4b72d8c6eff00954fda50a176d91e | refs/heads/master | 2022-12-12T06:33:55.839654 | 2020-09-03T22:48:34 | 2020-09-03T22:48:34 | 289,072,224 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 151 | java | package guide.theta360.theta_v_basic_app;
import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity {
}
| [
"[email protected]"
] | |
f9829067bf1c97741b21a5bef2427e9cebb14e30 | 8c31be91a9295b3a53eed6ae504e884aeb48c0d2 | /src/builder/errorcheckers/ThisKeywordChecker.java | 6bb4e1aab3dd60aff01f3ab838c7c23a1e15324d | [] | no_license | darrengoldwin/JabaProgram | 253de30ee38972657302cee27687a35f61798b6c | e72d2feb0c49ba295bbc89acdc03422f8aa877db | refs/heads/master | 2021-08-23T18:03:00.049155 | 2017-12-06T00:52:08 | 2017-12-06T00:52:08 | 110,914,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | /**
*
*/
package builder.errorcheckers;
import builder.BuildChecker;
import builder.ErrorRepository;
import initial.JabaParser.ExpressionContext;
/**
* @author NeilDG
*
*/
public class ThisKeywordChecker implements IErrorChecker {
private final static String TAG = "ThisKeywordChecker";
private ExpressionContext exprCtx;
private int lineNumber;
public ThisKeywordChecker(ExpressionContext exprCtx) {
this.exprCtx = exprCtx;
this.lineNumber = this.exprCtx.getStart().getLine();
}
/* (non-Javadoc)
* @see com.neildg.mobiprog.builder.errorcheckers.IErrorChecker#verify()
*/
@Override
public void verify() {
if(exprCtx.Identifier() == null && this.exprCtx.primary() == null) {
BuildChecker.reportCustomError(ErrorRepository.MISSING_THIS_KEYWORD, "", this.exprCtx.getText(), this.lineNumber);
}
}
}
| [
"[email protected]"
] | |
fc5a2f7d11626f08a5849b327ad5ba21205b592d | 955f2465790e3f5f8f69db9ad1c661861f584ead | /K2M5S3/src/client/commands/Command.java | 19a1c3fae193ec8a9adaa04bd647f7990b936f89 | [] | no_license | v3921358/K2M5S3 | e894fde3955a5a2956378877981c2c3f24672b68 | fac5a85a67dac51d3fa77fa62309310f43493855 | refs/heads/master | 2022-03-31T19:39:55.685009 | 2017-01-19T22:34:02 | 2017-01-19T22:34:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 241 | java | package client.commands;
import client.MapleClient;
public interface Command {
CommandDefinition[] getDefinition();
void execute (final MapleClient c, final String []splittedLine) throws Exception, IllegalCommandSyntaxException;
} | [
"kwon@kwon-PC"
] | kwon@kwon-PC |
d5a9ddb2fb3e9c8e2d7f21dde3387d990eedc1a1 | a3ffc54b314500103c5c224f13bf51744de0e250 | /library/src/main/java/com/alley/van/model/Album.java | a199ddd84636fe54b8a598c339bde1d1777ec714 | [
"Apache-2.0"
] | permissive | kwmax/VanGogh | a9819c7ae49a4dd3fda61e2b1ad75bfe8b51005f | 06530fb610e50224e24efbfde070a368384cea68 | refs/heads/master | 2020-05-20T15:38:23.184226 | 2018-06-04T15:58:07 | 2018-06-04T15:58:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,753 | java | package com.alley.van.model;
import android.content.Context;
import android.database.Cursor;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;
import android.support.annotation.Nullable;
import com.alley.van.R;
import com.alley.van.helper.AlbumLoader;
public class Album implements Parcelable {
public static final Creator<Album> CREATOR = new Creator<Album>() {
@Nullable
@Override
public Album createFromParcel(Parcel source) {
return new Album(source);
}
@Override
public Album[] newArray(int size) {
return new Album[size];
}
};
public static final String ALBUM_ID_ALL = String.valueOf(-1);
public static final String ALBUM_NAME_ALL = "All";
private final String mId;
private final String mCoverPath;
private final String mDisplayName;
private long mCount;
Album(String id, String coverPath, String albumName, long count) {
mId = id;
mCoverPath = coverPath;
mDisplayName = albumName;
mCount = count;
}
Album(Parcel source) {
mId = source.readString();
mCoverPath = source.readString();
mDisplayName = source.readString();
mCount = source.readLong();
}
/**
* Constructs a new {@link Album} entity from the {@link Cursor}.
* This method is not responsible for managing cursor resource, such as close, iterate, and so on.
*/
public static Album valueOf(Cursor cursor) {
return new Album(
cursor.getString(cursor.getColumnIndex("bucket_id")),
cursor.getString(cursor.getColumnIndex(MediaStore.MediaColumns.DATA)),
cursor.getString(cursor.getColumnIndex("bucket_display_name")),
cursor.getLong(cursor.getColumnIndex(AlbumLoader.COLUMN_COUNT)));
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mId);
dest.writeString(mCoverPath);
dest.writeString(mDisplayName);
dest.writeLong(mCount);
}
public String getId() {
return mId;
}
public String getCoverPath() {
return mCoverPath;
}
public long getCount() {
return mCount;
}
public void addCaptureCount() {
mCount++;
}
public String getDisplayName(Context context) {
if (isAll()) {
return context.getString(R.string.van_all_media);
}
return mDisplayName;
}
public boolean isAll() {
return ALBUM_ID_ALL.equals(mId);
}
public boolean isEmpty() {
return mCount == 0;
}
} | [
"[email protected]"
] | |
f21e7711d38fb8b237ec83596db9d2925990c84f | 35fb83f2a0a7ea04722acfd2afb24035f7400793 | /Janra.Jowi/src/main/java/Server/IHeader.java | a6149fc020b12a6336110f4429f53d76aed3c350 | [] | no_license | AcunaTR/Jowi2 | 37ab5c8f58a289824fe851ee1c86a64454b8f1e8 | c6c1ea2ecd98aa74fe161476ff533ecd9134a926 | refs/heads/master | 2020-04-04T05:14:19.826488 | 2018-11-08T15:37:54 | 2018-11-08T15:37:54 | 155,738,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | /*
* Copyright (C) 2017 jmillen
*
* 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 Server;
/**
*
* @author jmillen
*/
public interface IHeader
{
String key();
Integer occurences();
String value();
String value(Integer index);
}
| [
"[email protected]"
] | |
9489efd56003e8337a9db39294bd8c6a7f30085d | 1074c97cdd65d38c8c6ec73bfa40fb9303337468 | /rda0105-agl-aus-java-a43926f304e3/xms-dto/src/main/java/com/gms/xms/txndb/vo/PackageShipmentCarrierVO.java | cf2eb03b87c4728158e23b2937cf6b8a8c2576f4 | [] | no_license | gahlawat4u/repoName | 0361859254766c371068e31ff7be94025c3e5ca8 | 523cf7d30018b7783e90db98e386245edad34cae | refs/heads/master | 2020-05-17T01:26:00.968575 | 2019-04-29T06:11:52 | 2019-04-29T06:11:52 | 183,420,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,496 | java | package com.gms.xms.txndb.vo;
public class PackageShipmentCarrierVO extends BaseVo {
/**
*
*/
private static final long serialVersionUID = 3734111423930427567L;
private Long pccID;
private Integer serviceId;
private String servicename;
private String serviceCategory;
private Integer shipmentTypeId;
private String shipmentTypeName;
private Integer packageId;
private String packageName;
private Integer statusBoth;
private Integer defaultBoth;
private Integer docStatus;
private Integer docDefault;
private Integer nonDocStatus;
private Integer nonDocDefault;
private String packageTypeCode;
public Long getPccID() {
return pccID;
}
public void setPccID(Long pccID) {
this.pccID = pccID;
}
public Integer getServiceId() {
return serviceId;
}
public void setServiceId(Integer serviceId) {
this.serviceId = serviceId;
}
public String getServicename() {
return servicename;
}
public void setServicename(String servicename) {
this.servicename = servicename;
}
public Integer getShipmentTypeId() {
return shipmentTypeId;
}
public void setShipmentTypeId(Integer shipmentTypeId) {
this.shipmentTypeId = shipmentTypeId;
}
public String getShipmentTypeName() {
return shipmentTypeName;
}
public void setShipmentTypeName(String shipmentTypeName) {
this.shipmentTypeName = shipmentTypeName;
}
public Integer getPackageId() {
return packageId;
}
public void setPackageId(Integer packageId) {
this.packageId = packageId;
}
public String getPackageName() {
return packageName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
public String getServiceCategory() {
return serviceCategory;
}
public void setServiceCategory(String serviceCategory) {
this.serviceCategory = serviceCategory;
}
public Integer getStatusBoth() {
return statusBoth;
}
public void setStatusBoth(Integer statusBoth) {
this.statusBoth = statusBoth;
}
public Integer getDefaultBoth() {
return defaultBoth;
}
public void setDefaultBoth(Integer defaultBoth) {
this.defaultBoth = defaultBoth;
}
public Integer getDocStatus() {
return docStatus;
}
public void setDocStatus(Integer docStatus) {
this.docStatus = docStatus;
}
public Integer getDocDefault() {
return docDefault;
}
public void setDocDefault(Integer docDefault) {
this.docDefault = docDefault;
}
public Integer getNonDocStatus() {
return nonDocStatus;
}
public void setNonDocStatus(Integer nonDocStatus) {
this.nonDocStatus = nonDocStatus;
}
public Integer getNonDocDefault() {
return nonDocDefault;
}
public void setNonDocDefault(Integer nonDocDefault) {
this.nonDocDefault = nonDocDefault;
}
public String getPackageTypeCode() {
return packageTypeCode;
}
public void setPackageTypeCode(String packageTypeCode) {
this.packageTypeCode = packageTypeCode;
}
@Override
public String toString() {
return "PackageShipmentCarrierVO [pccID=" + pccID + ", serviceId=" + serviceId + ", servicename=" + servicename
+ ", serviceCategory=" + serviceCategory + ", shipmentTypeId=" + shipmentTypeId + ", shipmentTypeName="
+ shipmentTypeName + ", packageId=" + packageId + ", packageName=" + packageName + ", statusBoth="
+ statusBoth + ", defaultBoth=" + defaultBoth + ", docStatus=" + docStatus + ", docDefault="
+ docDefault + ", nonDocStatus=" + nonDocStatus + ", nonDocDefault=" + nonDocDefault
+ ", packageTypeCode=" + packageTypeCode + "]";
}
}
| [
"[email protected]"
] | |
86ce1cabd98fb8d41e0108e3ae396754a6950673 | 9c6f80f8b0b9985bd7a774e38bfadf52e335bf2a | /TreeCensusService/src/main/java/com/innowave/mahaulb/service/treecensus/master/treemastermas/TreeMasterMasServImpl.java | 79847969eed38eff55107a2f9df518306d53f85d | [] | no_license | jswordfish/innowave_inventory | 0ce7265cbbac6991780cbf20361e35e229c9c8ce | 964eef7df5a932084298dc92a98644c897858cfe | refs/heads/master | 2021-05-10T21:48:31.670452 | 2018-03-01T01:01:02 | 2018-03-01T01:01:02 | 118,237,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,875 | java | package com.innowave.mahaulb.service.treecensus.master.treemastermas;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.gson.Gson;
import com.innowave.mahaulb.common.dao.TmCmLookup;
import com.innowave.mahaulb.common.dao.TmCmLookupDet;
import com.innowave.mahaulb.common.service.LookupDetServ;
import com.innowave.mahaulb.common.service.utils.FileDownloadService;
import com.innowave.mahaulb.repository.treecensus.dao.master.TmTreeMasterMas;
import com.innowave.mahaulb.repository.treecensus.dao.master.TmTreeNameMaster;
import com.innowave.mahaulb.repository.treecensus.dao.trans.TtTreeSurveyDetails;
import com.innowave.mahaulb.repository.treecensus.dao.trans.TtTreeSurveyUploadList;
import com.innowave.mahaulb.repository.treecensus.master.TreeMasterMasRepo;
import com.innowave.mahaulb.repository.treecensus.repo.GetTreeSeqNoRepo;
import com.innowave.mahaulb.service.treecensus.bean.TreeSurveyDetailsBean;
import com.innowave.mahaulb.service.treecensus.bean.TtTreeSurveyDetailsBean;
@Service("treeMasterMasServ")
@Transactional
public class TreeMasterMasServImpl implements TreeMasterMasServ {
@Autowired
private TreeMasterMasRepo treeMasterMasRepo;
@Autowired
LookupDetServ lookupDetServ;
@Autowired
FileDownloadService fileDownloadService;
@Autowired
GetTreeSeqNoRepo getTreeSeqNoRepo;
@Override
public int save(TmTreeMasterMas tmTreeMasterMas) {
return (Integer) treeMasterMasRepo.save(tmTreeMasterMas);
}
@Override
public List<TmTreeMasterMas> getTreeMasterMasList(TmTreeMasterMas tmTreeMasterMas) {
return treeMasterMasRepo.getTreeMasterMasList(tmTreeMasterMas);
}
@Override
public void delete(TmTreeMasterMas tmTreeMasterMas) {
treeMasterMasRepo.delete(tmTreeMasterMas);
}
@Override
public void update(TmTreeMasterMas tmTreeMasterMas) {
treeMasterMasRepo.update(tmTreeMasterMas);
}
@Override
public Set<TmTreeMasterMas> getTreeMasterDetails(String prefix) {
return treeMasterMasRepo.getTreeMasterDetails(prefix);
}
@Override
public int saveTreeMasterDetailsServ(TreeSurveyDetailsBean treeSurveyDetailsBean)
{
TmTreeNameMaster tTNM = new TmTreeNameMaster();
tTNM.setTreeComNameEn(treeSurveyDetailsBean.getTreeComNameEn());
tTNM.setUlbId(treeSurveyDetailsBean.getUlbId());
tTNM.setTreeComNameRg(treeSurveyDetailsBean.getTreeComNameRg());
tTNM.setTreeFamNameEn(treeSurveyDetailsBean.getTreeFamNameEn());
tTNM.setTreeFamNameRg(treeSurveyDetailsBean.getTreeFamNameRg());
tTNM.setTreeSciNameEn(treeSurveyDetailsBean.getTreeSciNameEn());
tTNM.setTreeSciNameRg(treeSurveyDetailsBean.getTreeSciNameRg());
tTNM.setTreeVerNameEn(treeSurveyDetailsBean.getTreeVerNameEn());
tTNM.setTreeVerNameRg(treeSurveyDetailsBean.getTreeVerNameRg());
tTNM.setTreemasIdFnm(treeSurveyDetailsBean.getLookupDetIdFnm()); //Flower
tTNM.setTreemasIdCom(treeSurveyDetailsBean.getLookupDetIdCom()); //colour
tTNM.setTreemasIdFrm(treeSurveyDetailsBean.getLookupDetIdFrm()); //fruit
tTNM.setTreemasIdSma(treeSurveyDetailsBean.getLookupDetIdSma()); //shape
tTNM.setTreemasIdOdm(treeSurveyDetailsBean.getLookupDetIdOdm()); //odour
tTNM.setTreemasIdTst(treeSurveyDetailsBean.getLookupDetIdTst()); //tree status
tTNM.setTreemasIdTsm(treeSurveyDetailsBean.getLookupDetIdTsm()); //tree species master
tTNM.setTreemasIdBsm(treeSurveyDetailsBean.getLookupDetIdBsm()); // bark
tTNM.setTreemasIdLsm(treeSurveyDetailsBean.getLookupDetIdLsm()); //leaf shape
tTNM.setTreemasIdLcm(treeSurveyDetailsBean.getLookupDetIdLcm()); //leaf colour
tTNM.setTreemasIdTms(treeSurveyDetailsBean.getLookupDetIdTms()); //texture
tTNM.setLookupDetAesthetic(treeSurveyDetailsBean.getLookupDetAesthetic());
tTNM.setLookupDetCultural(treeSurveyDetailsBean.getLookupDetCultural());
tTNM.setLookupDetEcological(treeSurveyDetailsBean.getLookupDetEcological());
tTNM.setLookupDetEconomical(treeSurveyDetailsBean.getLookupDetEconomical());
tTNM.setStatus(1);
tTNM.setCreatedBy(treeSurveyDetailsBean.getCreatedBy());
tTNM.setCreatedDate(treeSurveyDetailsBean.getCreatedDate());
tTNM.setDeviceFrom(treeSurveyDetailsBean.getDeviceFrom());
tTNM.setIpAddress(treeSurveyDetailsBean.getIpAddress());
tTNM.setMacId(treeSurveyDetailsBean.getMacId());
return (int) treeMasterMasRepo.saveTreeMasterDetailsRepo(tTNM);
}
@Override
public Set<TmTreeNameMaster> getTreeNameDetailsServ(String treeNameType, String searchString) {
return treeMasterMasRepo.getTreeNameDetailsServ(treeNameType, searchString);
}
@Override
public int saveApplicationSurveyInspector(TtTreeSurveyDetailsBean ttTreeSurveyDetails) {
TtTreeSurveyDetails tTSD = new TtTreeSurveyDetails();
tTSD.setUlbId(ttTreeSurveyDetails.getUlbId());
tTSD.setTreeSurveyId(ttTreeSurveyDetails.getTreeSurveyId());
tTSD.setSurveyNumber(ttTreeSurveyDetails.getSurveyNumber());
tTSD.setSurveyDate(ttTreeSurveyDetails.getSurveyDate());
tTSD.setTreeIdentificationNo(ttTreeSurveyDetails.getTreeIdentificationNo());
tTSD.setTmTreeNameMaster(ttTreeSurveyDetails.getTmTreeNameMaster());
tTSD.setRefNo(ttTreeSurveyDetails.getSeqNO());
tTSD.setTreemasIdCom(ttTreeSurveyDetails.getTreemasIdCom()); //colour
tTSD.setTreemasIdFrm(ttTreeSurveyDetails.getTreemasIdFrm()); //fruit
tTSD.setTreemasIdBsm(ttTreeSurveyDetails.getTreemasIdBsm()); //bark
tTSD.setTreemasIdSma(ttTreeSurveyDetails.getTreemasIdSma()); //shape master
tTSD.setTreemasIdTst(ttTreeSurveyDetails.getTreemasIdTst()); //tree status
tTSD.setTreemasIdOdm(ttTreeSurveyDetails.getTreemasIdOdm()); //odour
tTSD.setTreemasIdFnm(ttTreeSurveyDetails.getTreemasIdFnm()); //flower
tTSD.setTreemasIdTsm(ttTreeSurveyDetails.getTreemasIdTsm()); //TreeSpecies
tTSD.setTreemasIdLsm(ttTreeSurveyDetails.getTreemasIdLsm()); //leaf shape
tTSD.setTreemasIdLcm(ttTreeSurveyDetails.getTreemasIdLcm()); //Leaf colour
tTSD.setTreemasIdTms(ttTreeSurveyDetails.getTreemasIdTms()); //Texture
tTSD.setGirthAtBreastHieght(ttTreeSurveyDetails.getGirthAtBreastHieght());
tTSD.setHieght(ttTreeSurveyDetails.getHieght());
tTSD.setApproxAge(ttTreeSurveyDetails.getApproxAge());
tTSD.setCanopyWidth(ttTreeSurveyDetails.getCanopyWidth());
tTSD.setMsebCtcNo(ttTreeSurveyDetails.getMsebCtcNo());
tTSD.setSizeValue(ttTreeSurveyDetails.getSizeValue());
tTSD.setLocation(ttTreeSurveyDetails.getLocation());
tTSD.setApartmentComplex(ttTreeSurveyDetails.getApartmentComplex());
tTSD.setRoad(ttTreeSurveyDetails.getRoad());
tTSD.setBuilding(ttTreeSurveyDetails.getBuilding());
tTSD.setLocality(ttTreeSurveyDetails.getLocality());
tTSD.setLatitude(ttTreeSurveyDetails.getLatitude());
tTSD.setLongitude(ttTreeSurveyDetails.getLongitude());
tTSD.setObservationRemarks(ttTreeSurveyDetails.getObservationRemarks());
tTSD.setLookupDetIdOlt(ttTreeSurveyDetails.getLookupDetIdOlt());
tTSD.setLookupDetIdRsu(ttTreeSurveyDetails.getLookupDetIdRsu());
tTSD.setLookupDetHierIdAwz1(ttTreeSurveyDetails.getLookupDetHierIdAwz1());
tTSD.setLookupDetHierIdAwz2(ttTreeSurveyDetails.getLookupDetHierIdAwz2());
tTSD.setCreatedBy(ttTreeSurveyDetails.getCreatedBy());
tTSD.setCreatedDate(ttTreeSurveyDetails.getCreatedDate());
tTSD.setMacId(ttTreeSurveyDetails.getMacId());
tTSD.setDeviceFrom(ttTreeSurveyDetails.getDeviceFrom());
tTSD.setIpAddress(ttTreeSurveyDetails.getIpAddress());
SimpleDateFormat sm = new SimpleDateFormat("dd/MM/yyyy");
int modId = getTreeSeqNoRepo.getModId("TRR");
String ulbCode = getTreeSeqNoRepo.getUlbShortsCode(ttTreeSurveyDetails.getUlbId());
Date fromDate = getTreeSeqNoRepo.getFromFinancialDate(ttTreeSurveyDetails.getCreatedDate());
Date toDate = getTreeSeqNoRepo.getFinancialDate(ttTreeSurveyDetails.getCreatedDate());
/*String fDt = sm.format(fromDate);
String tDt = sm.format(toDate);*/
char year = 'F';
//Date txDt = DateTimeZoneHelper.getSysDate();
Date txDt=null;
String SeqNo = null;
String newConnectionNo = null;
try {
SeqNo = getTreeSeqNoRepo.getAutoConnectionLoiNo(modId, ttTreeSurveyDetails.getUlbId(), "tt_tree_survey_details", "survey_number", year, txDt);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String ulbshortCode="";
if(ulbCode.length()<4)
{
ulbshortCode=ulbCode+0;
}
else
{
ulbshortCode=ulbCode;
}
SimpleDateFormat frmtDt = new SimpleDateFormat("yy");
String curYr = frmtDt.format(fromDate);
String futYr = frmtDt.format(toDate);
String sequenceNo = "000000000".substring(SeqNo.toString().length()) + SeqNo;
newConnectionNo = ulbshortCode+curYr+futYr+sequenceNo;
tTSD.setSurveyNumber(newConnectionNo);
ttTreeSurveyDetails.setSurveyNumber(newConnectionNo);
int a = (int) treeMasterMasRepo.saveApplicationSurveyInspector(tTSD);
String url = null ;
if(ttTreeSurveyDetails.getFile() != null){
url = fileDownloadService.uploadFile(ttTreeSurveyDetails.getFile());
}
TtTreeSurveyUploadList ttTreeSurveyUploadList = new TtTreeSurveyUploadList();
ttTreeSurveyUploadList.setTtTreeSurveyDetails(new TtTreeSurveyDetails(a));
ttTreeSurveyUploadList.setUlbId(ttTreeSurveyDetails.getUlbId());
if(url != null){
ttTreeSurveyUploadList.setUploadedDesc(url);
}
ttTreeSurveyUploadList.setStatus(1);
ttTreeSurveyUploadList.setCreatedBy(ttTreeSurveyDetails.getCreatedBy());
ttTreeSurveyUploadList.setCreatedDate(ttTreeSurveyDetails.getCreatedDate());
ttTreeSurveyUploadList.setMacId(ttTreeSurveyDetails.getMacId());
ttTreeSurveyUploadList.setDeviceFrom(ttTreeSurveyDetails.getDeviceFrom());
ttTreeSurveyUploadList.setIpAddress(ttTreeSurveyDetails.getIpAddress());
treeMasterMasRepo.saveImageUrl(ttTreeSurveyUploadList);
return a;
}
@Override
public int saveApplicationSurveyDetails(TtTreeSurveyDetailsBean ttTreeSurveyDetails) {
TtTreeSurveyDetails tTSD = new TtTreeSurveyDetails();
tTSD.setUlbId(ttTreeSurveyDetails.getUlbId());
tTSD.setTreeSurveyId(ttTreeSurveyDetails.getTreeSurveyId());
tTSD.setSurveyNumber(ttTreeSurveyDetails.getSurveyNumber());
tTSD.setSurveyDate(ttTreeSurveyDetails.getSurveyDate());
tTSD.setTreeIdentificationNo(ttTreeSurveyDetails.getTreeIdentificationNo());
tTSD.setTmTreeNameMaster(ttTreeSurveyDetails.getTmTreeNameMaster());
tTSD.setTreemasIdCom(ttTreeSurveyDetails.getTreemasIdCom()); //colour
tTSD.setTreemasIdFrm(ttTreeSurveyDetails.getTreemasIdFrm()); //fruit
tTSD.setTreemasIdBsm(ttTreeSurveyDetails.getTreemasIdBsm()); //bark
tTSD.setTreemasIdSma(ttTreeSurveyDetails.getTreemasIdSma()); //shape master
tTSD.setTreemasIdTst(ttTreeSurveyDetails.getTreemasIdTst()); //tree status
tTSD.setTreemasIdOdm(ttTreeSurveyDetails.getTreemasIdOdm()); //odour
tTSD.setTreemasIdFnm(ttTreeSurveyDetails.getTreemasIdFnm()); //flower
tTSD.setTreemasIdTsm(ttTreeSurveyDetails.getTreemasIdTsm()); //TreeSpecies
tTSD.setTreemasIdLsm(ttTreeSurveyDetails.getTreemasIdLsm()); //leaf shape
tTSD.setTreemasIdLcm(ttTreeSurveyDetails.getTreemasIdLcm()); //Leaf colour
tTSD.setTreemasIdTms(ttTreeSurveyDetails.getTreemasIdTms()); //Texture
tTSD.setGirthAtBreastHieght(ttTreeSurveyDetails.getGirthAtBreastHieght());
tTSD.setHieght(ttTreeSurveyDetails.getHieght());
tTSD.setApproxAge(ttTreeSurveyDetails.getApproxAge());
tTSD.setCanopyWidth(ttTreeSurveyDetails.getCanopyWidth());
tTSD.setMsebCtcNo(ttTreeSurveyDetails.getMsebCtcNo());
tTSD.setSizeValue(ttTreeSurveyDetails.getSizeValue());
tTSD.setLocation(ttTreeSurveyDetails.getLocation());
tTSD.setApartmentComplex(ttTreeSurveyDetails.getApartmentComplex());
tTSD.setRoad(ttTreeSurveyDetails.getRoad());
tTSD.setBuilding(ttTreeSurveyDetails.getBuilding());
tTSD.setLocality(ttTreeSurveyDetails.getLocality());
tTSD.setLatitude(ttTreeSurveyDetails.getLatitude());
tTSD.setLongitude(ttTreeSurveyDetails.getLongitude());
tTSD.setObservationRemarks(ttTreeSurveyDetails.getObservationRemarks());
tTSD.setLookupDetIdOlt(ttTreeSurveyDetails.getLookupDetIdOlt());
tTSD.setCreatedBy(ttTreeSurveyDetails.getCreatedBy());
tTSD.setCreatedDate(ttTreeSurveyDetails.getCreatedDate());
tTSD.setMacId(ttTreeSurveyDetails.getMacId());
tTSD.setDeviceFrom(ttTreeSurveyDetails.getDeviceFrom());
tTSD.setIpAddress(ttTreeSurveyDetails.getIpAddress());
int a = (int) treeMasterMasRepo.saveApplicationSurveyDetails(tTSD);
String url = null ;
if(ttTreeSurveyDetails.getFile() != null){
url = fileDownloadService.uploadFile(ttTreeSurveyDetails.getFile());
}
TtTreeSurveyUploadList ttTreeSurveyUploadList = new TtTreeSurveyUploadList();
ttTreeSurveyUploadList.setTtTreeSurveyDetails(new TtTreeSurveyDetails(a));
ttTreeSurveyUploadList.setUlbId(ttTreeSurveyDetails.getUlbId());
if(url != null){
ttTreeSurveyUploadList.setUploadedDesc(url);
}
ttTreeSurveyUploadList.setStatus(1);
ttTreeSurveyUploadList.setCreatedBy(ttTreeSurveyDetails.getCreatedBy());
ttTreeSurveyUploadList.setCreatedDate(ttTreeSurveyDetails.getCreatedDate());
ttTreeSurveyUploadList.setMacId(ttTreeSurveyDetails.getMacId());
ttTreeSurveyUploadList.setDeviceFrom(ttTreeSurveyDetails.getDeviceFrom());
ttTreeSurveyUploadList.setIpAddress(ttTreeSurveyDetails.getIpAddress());
treeMasterMasRepo.saveImageUrl(ttTreeSurveyUploadList);
return a;
}
@Override
public List<TmTreeMasterMas> getMasterDataListServ(String prefix, String searchString,int ulbIdAuto) {
return treeMasterMasRepo.getMasterDataListServ(prefix,searchString,ulbIdAuto);
}
@Override
public String getlookupDetData(int ulbId, String prefix) {
List<TreeSurveyDetailsBean> treeSurveyDetailsBean = new ArrayList<TreeSurveyDetailsBean>();
TmCmLookup tmCmLookup = treeMasterMasRepo.getLookupId(prefix);
List<TmCmLookupDet> tmCmLookupDet = treeMasterMasRepo.getLookupDetId(ulbId, tmCmLookup.getLookupId());
for(TmCmLookupDet obj : tmCmLookupDet){
TreeSurveyDetailsBean tSDB = new TreeSurveyDetailsBean();
tSDB.setLookupDetId(obj.getLookupDetId());
tSDB.setLookupDetName(obj.getLookupDetDescEn());
tSDB.setUlbId(obj.getUlbId());
treeSurveyDetailsBean.add(tSDB);
}
Gson gson = new Gson();
String str = gson.toJson(treeSurveyDetailsBean);
//return JsonResponseHelper.getJSONResponseString(str);
return null;
}
@Override
public Set<TtTreeSurveyDetails> getDataBySrnNumber(String treeNameType, String searchString) {
return treeMasterMasRepo.getDataBySrnNumber(treeNameType, searchString);
}
}
| [
"[email protected]"
] | |
ee7c58153a32249607dc5974909f3334208ca20e | 2328abd96bfc33aa79937ed156fb86d97c5ed5c3 | /angular-spring-boot-jhipster/src/main/java/com/pluralsight/patientportal/config/LiquibaseConfiguration.java | 4b7e56a554eb5ef983d20648642c90fe9881ef8a | [] | no_license | mateusz58/PluralSight | 5746c0155c8e1fdc36663ad2b6f0da4690052e35 | c3c81a7066ccc976837a562afe9e047eea57e935 | refs/heads/master | 2023-01-22T14:18:01.413232 | 2020-02-07T16:58:47 | 2020-02-07T16:58:47 | 228,117,071 | 0 | 0 | null | 2023-01-06T00:59:43 | 2019-12-15T02:17:41 | Java | UTF-8 | Java | false | false | 3,220 | java | package com.pluralsight.patientportal.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.liquibase.SpringLiquibaseUtil;
import liquibase.integration.spring.SpringLiquibase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseDataSource;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
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 javax.sql.DataSource;
import java.util.concurrent.Executor;
@Configuration
public class LiquibaseConfiguration {
private final Logger log = LoggerFactory.getLogger(LiquibaseConfiguration.class);
private final Environment env;
public LiquibaseConfiguration(Environment env) {
this.env = env;
}
@Bean
public SpringLiquibase liquibase(@Qualifier("taskExecutor") Executor executor,
@LiquibaseDataSource ObjectProvider<DataSource> liquibaseDataSource, LiquibaseProperties liquibaseProperties,
ObjectProvider<DataSource> dataSource, DataSourceProperties dataSourceProperties) {
// If you don't want Liquibase to start asynchronously, substitute by this:
// SpringLiquibase liquibase = SpringLiquibaseUtil.createSpringLiquibase(liquibaseDataSource.getIfAvailable(), liquibaseProperties, dataSource.getIfUnique(), dataSourceProperties);
SpringLiquibase liquibase = SpringLiquibaseUtil.createAsyncSpringLiquibase(this.env, executor, liquibaseDataSource.getIfAvailable(), liquibaseProperties, dataSource.getIfUnique(), dataSourceProperties);
liquibase.setChangeLog("classpath:config/liquibase/master.xml");
liquibase.setContexts(liquibaseProperties.getContexts());
liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema());
liquibase.setLiquibaseSchema(liquibaseProperties.getLiquibaseSchema());
liquibase.setLiquibaseTablespace(liquibaseProperties.getLiquibaseTablespace());
liquibase.setDatabaseChangeLogLockTable(liquibaseProperties.getDatabaseChangeLogLockTable());
liquibase.setDatabaseChangeLogTable(liquibaseProperties.getDatabaseChangeLogTable());
liquibase.setDropFirst(liquibaseProperties.isDropFirst());
liquibase.setLabels(liquibaseProperties.getLabels());
liquibase.setChangeLogParameters(liquibaseProperties.getParameters());
liquibase.setRollbackFile(liquibaseProperties.getRollbackFile());
liquibase.setTestRollbackOnUpdate(liquibaseProperties.isTestRollbackOnUpdate());
if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE))) {
liquibase.setShouldRun(false);
} else {
liquibase.setShouldRun(liquibaseProperties.isEnabled());
log.debug("Configuring Liquibase");
}
return liquibase;
}
}
| [
"[email protected]"
] | |
e6d66a7e38a1bdb85d09ec26f51840a1aabd996c | ef084385abe65f2fa699b34eeac08ac1dd0d7407 | /routing/src/main/java/com/maiya/routing/RoutingApplication.java | 1ceecbc718ee482cfff844b1632b5b040e54c4b1 | [] | no_license | maiya-tracy/JavaSpringBoot | 862c27282fee97583ea23cc4f67760dc73513d8c | 743ffc7b894b165e99c91462ea9a6e4617845cbf | refs/heads/master | 2020-07-01T23:34:49.630960 | 2019-08-20T22:29:55 | 2019-08-20T22:29:55 | 201,342,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 577 | java | package com.maiya.routing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PathVariable;
@SpringBootApplication
@RestController
public class RoutingApplication {
public static void main(String[] args) {
SpringApplication.run(RoutingApplication.class, args);
}
}
| [
"[email protected]"
] | |
aa1ba9ca5093a03b982b86710f912be3a5985de3 | 2ce7780f7dc00986f5807178c07cbe949c05ff18 | /_myCMS/src/chstu/clans/mycms/server/EchoSrever.java | 40eac6e320c75403b3fbcbc99d1cc27d9fb8b0e3 | [] | no_license | Clans/diploma-bi-501 | bad1bb645f300240ea747a5239a22b3185ee6389 | 4182246e2e14f2c323e8eb3c9bbb967a219fcba9 | refs/heads/master | 2021-01-01T06:27:27.244106 | 2010-04-25T12:12:47 | 2010-04-25T12:12:47 | 32,133,521 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,205 | java | package chstu.clans.mycms.server;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
class EchoServer {
public static void main(String[] arstring) {
try {
SSLServerSocketFactory sslserversocketfactory =
(SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
SSLServerSocket sslserversocket =
(SSLServerSocket) sslserversocketfactory.createServerSocket(9999);
SSLSocket sslsocket = (SSLSocket) sslserversocket.accept();
InputStream inputstream = sslsocket.getInputStream();
InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
BufferedReader bufferedreader = new BufferedReader(inputstreamreader);
String string = null;
while ((string = bufferedreader.readLine()) != null) {
System.out.println(string);
System.out.flush();
}
} catch (Exception exception) {
exception.printStackTrace();
}
}
}
| [
"[email protected]@0de6fe82-2e71-11df-a76b-1fcfea12351c"
] | [email protected]@0de6fe82-2e71-11df-a76b-1fcfea12351c |
8517fb36fae10cba973053b6a65ecf711da922a6 | 47a755ab816b2055d116b047b4aeda15bd1f7351 | /build-logic/src/main/java/com/sun/apache/xalan/internal/xsltc/compiler/Instruction.java | edc073c9699deb720de05906f6d73e821865d517 | [] | no_license | MikeAndrson/kotlinc-android | 4548581c7972b13b45dff4ccdd11747581349ded | ebc9b1d78bbd97083e860a1e8887b25469a13ecf | refs/heads/master | 2023-08-20T05:17:30.605126 | 2021-10-04T16:06:46 | 2021-10-04T16:06:46 | 413,486,864 | 25 | 12 | null | null | null | null | UTF-8 | Java | false | false | 1,788 | java | /*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2001-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.
*/
/*
* $Id: Instruction.java,v 1.2.4.1 2005/09/01 15:45:11 pvedula Exp $
*/
package com.sun.apache.xalan.internal.xsltc.compiler;
import com.sun.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
abstract class Instruction extends SyntaxTreeNode {
/**
* Type check all the children of this node.
*/
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
return typeCheckContents(stable);
}
/**
* Translate this node into JVM bytecodes.
*/
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
ErrorMsg msg = new ErrorMsg(ErrorMsg.NOT_IMPLEMENTED_ERR,
getClass(), this);
getParser().reportError(FATAL, msg);
}
}
| [
"[email protected]"
] | |
051762e3786e11b7103f2d45c742229bd9bcde00 | 7b4db8556edaa4524148e4cfa5b44a8611a460b2 | /src/main/java/com/ebay/service/feedback/FeedbackServiceImpl.java | 741dc399fbf5147c8153b40bb9d289bc3f3bfc1e | [
"Apache-2.0"
] | permissive | demochen/ebaySpider | e5fa72abb0ec0141f3250e4d0b68391455cb7e05 | a3a19bc1832178a6383d7015e7d0e807448d9033 | refs/heads/master | 2016-09-05T11:53:33.556321 | 2014-09-16T13:54:13 | 2014-09-16T13:54:13 | 23,626,842 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,410 | java | package com.ebay.service.feedback;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ebay.dao.feedback.FeedbackDao;
import com.ebay.domain.feedback.FeedBack;
import com.ebay.domain.item.Item;
import com.ebay.domain.price.PriceDot;
import com.ebay.domain.price.Pring;
import com.ebay.util.kmeans.Kmeans;
@Service("feedbackService")
public class FeedbackServiceImpl implements FeedbackService{
@Resource(name = "ebayfeedbackdao")
private FeedbackDao feedbackdao;
@Override
@Transactional
public void AddFeedback(FeedBack feedback) {
feedbackdao.Save(feedback);
}
@Override
@Transactional
public void AddFeedbacks(List<FeedBack> feedbacks) {
if(feedbacks!=null){
for(int i=0;i<feedbacks.size();i++){
feedbackdao.Save(feedbacks.get(i));
}
}
}
@Override
public List<FeedBack> selectFeedback(String sellername) {
return feedbackdao.fecthFeedback(sellername);
}
@Override
public List<Item> getSpecial(String sellername) {
List<Item> list=new ArrayList<Item>();
List<Item> max=feedbackdao.getMaxItems(sellername);
List<Item> min=feedbackdao.getMinItems(sellername);
list.addAll(max);
list.addAll(min);
return list;
}
@Override
public List<PriceDot> getDots(String sellername) {
return feedbackdao.getPriceDtos(sellername);
}
@Override
public double[] getTypePrice(String sellername) {
List<PriceDot> list=getDots(sellername);
double[] result=new double[2];
result=Kmeans.dealDots(list);
return result;
}
@Override
public List<Pring> getResult(String sellername) {
List<Pring> list=new ArrayList<Pring>();
double[] array=getTypePrice(sellername);
double min=array[0];
double max=array[1];
double maxprice=feedbackdao.getMaxPrice(sellername);
if(min>array[1]){
min=array[1];
max=array[0];
}
int mincount=feedbackdao.getKmeansMin(sellername, min);
int betcount=feedbackdao.getKmeansBet(sellername, min, max);
int maxcount=feedbackdao.getKmenasMax(sellername, max);
Pring p1=new Pring("0-"+min, mincount);
Pring p2=new Pring(min+"-"+max,betcount);
Pring p3=new Pring(max+"-"+maxprice,maxcount);
list.add(p1);
list.add(p2);
list.add(p3);
return list;
}
}
| [
"[email protected]"
] | |
b780ce96e4d02ab0961656744c76990ddae4768e | 56e9d8b9f4cef5f614594a1efff5b349b9cd5a97 | /src/main/java/uz/skladapp/services/ExchangeService.java | ce67ffd639be62c422126c2af87195f0ecd657e7 | [] | no_license | Ravshann/skladApp | 2a27237b5863d6a374224907c5d1101de217898a | f26c5e1502dab38b5f8c680d927cba591c0c6712 | refs/heads/master | 2022-03-31T08:15:35.489557 | 2019-12-26T11:26:26 | 2019-12-26T11:26:26 | 175,924,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,598 | java | package uz.skladapp.services;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import uz.skladapp.model.pure_models.AlternativeInOutRecord;
import uz.skladapp.DTO.Exchange;
import uz.skladapp.repositories.AlternativeInOutRecordRepository;
import java.util.ArrayList;
import java.util.List;
@Service
public class ExchangeService {
@Autowired
private AlternativeInOutRecordRepository repository;
@Autowired
private AlternativeInOutRecordService dao;
public List<Exchange> getAllExchangeRecords() {
List<Exchange> exchanges = new ArrayList<>();
List<AlternativeInOutRecord> records = repository.findAllExchange();
for (AlternativeInOutRecord record : records) {
Exchange item = new Exchange();
item.setRecord_ID(record.getRecord_ID());
item.setProduct_ID(record.getProduct_ID().getProduct_ID());
item.setCategory_ID(record.getProduct_ID().getCategory_ID().getCategory_ID());
item.setProduct_name(record.getProduct_ID().getProductName());
item.setCategory_name(record.getProduct_ID().getCategory_ID().getCategoryName());
item.setSupplier_storage_name(record.getSupplier_storage_ID().getStorageName());
item.setSupplier_storage_ID(record.getSupplier_storage_ID().getStorage_ID());
item.setRecord_datetime(record.getRecord_time());
item.setQuantity(record.getQuantity());
item.setStorage_name(record.getStorage_ID().getStorageName());
item.setStorage_ID(record.getStorage_ID().getStorage_ID());
item.setNote(record.getRecord_note());
item.setUpdated_time(record.getUpdated_time());
exchanges.add(item);
}
return exchanges;
}
public void save(String data) throws Exception {
dao.create(data);
}
public void update(String data) throws Exception {
ObjectMapper mapper = new ObjectMapper();
JsonNode json = mapper.readTree(data);
Long rec_id = json.get("record_ID").asLong();
//here value 4 means id of defected type of product
dao.update(data, rec_id, Long.valueOf(5));
}
public List<Exchange> getListByStorage(String storage_id, String type) {
List<Exchange> exchanges = new ArrayList<>();
List<AlternativeInOutRecord> records = null;
if (type.contains("supplier"))
records = repository.findAllExchangeBySupplierStorage(Long.valueOf(storage_id));
else
records = repository.findAllExchangeByStorage(Long.valueOf(storage_id));
for (AlternativeInOutRecord record : records) {
Exchange item = new Exchange();
item.setRecord_ID(record.getRecord_ID());
item.setProduct_ID(record.getProduct_ID().getProduct_ID());
item.setCategory_ID(record.getProduct_ID().getCategory_ID().getCategory_ID());
item.setProduct_name(record.getProduct_ID().getProductName());
item.setCategory_name(record.getProduct_ID().getCategory_ID().getCategoryName());
item.setSupplier_storage_name(record.getSupplier_storage_ID().getStorageName());
item.setSupplier_storage_ID(record.getSupplier_storage_ID().getStorage_ID());
item.setRecord_datetime(record.getRecord_time());
item.setQuantity(record.getQuantity());
item.setStorage_name(record.getStorage_ID().getStorageName());
item.setStorage_ID(record.getStorage_ID().getStorage_ID());
item.setNote(record.getRecord_note());
item.setUpdated_time(record.getUpdated_time());
exchanges.add(item);
}
return exchanges;
}
public List<Exchange> getListByCommonDepartment(String storages_json) throws Exception {
List<Long> storage_ids = new ArrayList<>();
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonArray = mapper.readTree(storages_json);
for (JsonNode json : jsonArray) {
Long id = json.get("storage_ID").asLong();
storage_ids.add(id);
}
List<Exchange> exchanges = new ArrayList<>();
List<AlternativeInOutRecord> records = repository.findAllExchangeByCommonDepartment(storage_ids);
for (AlternativeInOutRecord record : records) {
Exchange item = new Exchange();
item.setRecord_ID(record.getRecord_ID());
item.setProduct_ID(record.getProduct_ID().getProduct_ID());
item.setCategory_ID(record.getProduct_ID().getCategory_ID().getCategory_ID());
item.setProduct_name(record.getProduct_ID().getProductName());
item.setCategory_name(record.getProduct_ID().getCategory_ID().getCategoryName());
item.setSupplier_storage_name(record.getSupplier_storage_ID().getStorageName());
item.setSupplier_storage_ID(record.getSupplier_storage_ID().getStorage_ID());
item.setRecord_datetime(record.getRecord_time());
item.setQuantity(record.getQuantity());
item.setStorage_name(record.getStorage_ID().getStorageName());
item.setStorage_ID(record.getStorage_ID().getStorage_ID());
item.setNote(record.getRecord_note());
item.setUpdated_time(record.getUpdated_time());
exchanges.add(item);
}
return exchanges;
}
}
| [
"[email protected]"
] | |
e0cd38bb480d4bef91ea49c50ee30a8293403ce8 | 28b10b51dbdda9b457b2b8861d9fe969fbf0b37f | /Programming Code of GUI (Java)/MainClass.java | ce7ddf39d9762fe4e762d79368ceadf47e81efd9 | [] | no_license | ATGupta/Unitor | 928dc501003e9b9b40eb34de90be2116ce5f3d23 | d7cf67128991613b80918704de6cad06432b0a3f | refs/heads/master | 2021-10-07T21:43:37.784702 | 2021-09-29T17:21:49 | 2021-09-29T17:21:49 | 132,704,760 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,862 | java |
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.swing.JOptionPane;
import sun.misc.FloatingDecimal.BinaryToASCIIConverter;
import com.sun.javafx.fxml.expression.BinaryExpression;
public class MainClass {
private static String userName="[email protected]";
private static String password="internetofthings";
private JOptionPane op;
public MainClass(String subject, String messageText, String sendTo) {
Thread th=new Thread(new Runnable(){
public void run() {
op=new JOptionPane();
op.showOptionDialog(null, "Success","Wait...", JOptionPane.DEFAULT_OPTION,JOptionPane.INFORMATION_MESSAGE, null, new Object[]{}, null);
}
});
th.start();
Properties prop=new Properties();
prop.put("mail.smtp.ssl.trust", "smtp.gmail.com");
prop.put("mail.smtp.auth", "true");
prop.put("mail.smtp.starttls.enable", "true");
prop.put("mail.smtp.host", "smtp.gmail.com");
prop.put("mail.smtp.port", "587");
Session session = Session.getInstance(prop, new javax.mail.Authenticator(){
protected javax.mail.PasswordAuthentication getPasswordAuthentication()
{
return new javax.mail.PasswordAuthentication(userName, password);
}
});
try {
Message message=new MimeMessage(session);
message.setFrom(new InternetAddress(userName));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(sendTo));
message.setSubject(subject);
messageText=encryptEdon80(messageText);
String st2="";
for(int i=0;i<messageText.length();i++){
String a=Integer.toBinaryString((int)(messageText.charAt(i)));
for(int j=a.length();j<8;j++)
a='0'+a;
st2+=a;
}messageText=st2;
message.setText(messageText);
Transport.send(message);
op.getRootFrame().dispose();
th.stop();
JOptionPane.showMessageDialog(
null,
"Command Sent.",
"Success",
JOptionPane.OK_OPTION);
} catch (MessagingException e) {
op.getRootFrame().dispose();
th.stop();
JOptionPane.showMessageDialog(
null,
"Command not sent. Try again",
"Error",
JOptionPane.OK_OPTION);
e.printStackTrace();
}
}
private String encryptEdon80(String messageText) {
String st="";
int posAtST = 0;
boolean repeat;
do{
repeat=false;
try {
int character=0;
BufferedReader br=new BufferedReader(new FileReader("Keystream.txt"));
for(;;){
if(posAtST>=messageText.length()*8)break;
int x=br.read();
if(x==-1){
repeat = true;
break;
}
x=x-48;
char c = messageText.charAt(posAtST/8);
int i = (int)c;
int pos = 7 - (posAtST%8);
int count=0;
int r=0;
while(count<=pos){
r=i%2;
i=i/2;
count++;
}
if((r==1&&x==0)||(r==0&&x==1))r=1;
else r=0;
character=character*2+r;
posAtST++;
if(posAtST%8==0){
st=st+(char)character;
character=0;
}
}
} catch (FileNotFoundException e) {
JOptionPane.showMessageDialog(null, "There was an error encrypting the message.\n" +
"Try again.", "Error", JOptionPane.ERROR_MESSAGE);
break;
} catch (IOException e) {
JOptionPane.showMessageDialog(null, "There was an error encrypting the message.\n" +
"Try again.", "Error", JOptionPane.ERROR_MESSAGE);
break;
}
}while(repeat);
return st;
}
}
| [
"[email protected]"
] | |
620f24ca61cc015c9b3a46941be80073c7b5ac8a | 7b818769a8cd8819f4564c703f06098c87ce1fe5 | /src/main/java/com/blakebr0/mysticalagriculture/lib/Parts.java | d728f8d6444efe237b868582ff6e9c50eaa28d00 | [
"MIT"
] | permissive | ToMe25/MysticalAgriculture | 8a4c9e6a87a755b25a63b4a80277a02772f3fab2 | 63a0f62f927bcd09973f70812461b676a5166601 | refs/heads/master | 2020-04-30T08:12:40.508825 | 2019-07-13T09:52:53 | 2019-07-13T09:52:53 | 176,707,634 | 0 | 0 | MIT | 2019-03-23T12:17:02 | 2019-03-20T10:17:39 | Java | UTF-8 | Java | false | false | 5,832 | java | package com.blakebr0.mysticalagriculture.lib;
import com.blakebr0.mysticalagriculture.util.ModChecker;
import net.minecraft.item.Item;
public class Parts {
public static Item itemTinkersIngots;
public static Item itemBotaniaFlowers;
public static Item itemBotaniaPetals;
public static Item itemBotaniaResources;
public static Item itemChiselMarble;
public static Item itemChiselLimestone;
public static Item itemChiselBasalt;
public static Item itemBOPGems;
public static Item itemRSIngot;
public static Item itemAEMaterial;
public static Item itemAESkyStone;
public static Item itemGCPMars;
public static Item itemIC2MiscResource;
public static Item itemIC2Nuclear;
public static Item itemAstralMarble;
public static Item itemAstralCrafting;
public static Item itemAstralOre;
public static Item itemAstralRockCrystal;
public static Item itemRusticSlate;
public static Item itemIDMenrilLog;
public static Item itemIDMenrilSapling;
public static Item itemIDMenrilBerry;
public static Item itemBLMisc;
public static void getParts(){
if(ModChecker.TINKERS_CONSTRUCT){
try {
Item item = getItem("tconstruct:ingots");
itemTinkersIngots = item;
} catch(Throwable e){
e.printStackTrace();
}
}
if(ModChecker.BOTANIA){
try {
Item item = getItem("botania:flower");
itemBotaniaFlowers = item;
} catch(Throwable e){
e.printStackTrace();
}
try {
Item item = getItem("botania:petal");
itemBotaniaPetals = item;
} catch(Throwable e){
e.printStackTrace();
}
try {
Item item = getItem("botania:manaResource");
itemBotaniaResources = item;
} catch(Throwable e){
e.printStackTrace();
}
}
if(ModChecker.CHISEL){
try {
Item item = getItem("chisel:marble2");
itemChiselMarble = item;
} catch(Throwable e){
e.printStackTrace();
}
try {
Item item = getItem("chisel:limestone2");
itemChiselLimestone = item;
} catch(Throwable e){
e.printStackTrace();
}
try {
Item item = getItem("chisel:basalt2");
itemChiselBasalt = item;
} catch(Throwable e){
e.printStackTrace();
}
}
if(ModChecker.BIOMES_O_PLENTY){
try {
Item item = getItem("biomesoplenty:gem");
itemBOPGems = item;
} catch(Throwable e){
e.printStackTrace();
}
}
if(ModChecker.REFINED_STORAGE){
try {
Item item = getItem("refinedstorage:quartz_enriched_iron");
itemRSIngot = item;
} catch(Throwable e){
e.printStackTrace();
}
}
if(ModChecker.APPLIED_ENERGISTICS_2){
try {
Item item = getItem("appliedenergistics2:material");
itemAEMaterial = item;
} catch(Throwable e){
e.printStackTrace();
}
try {
Item item = getItem("appliedenergistics2:sky_stone_block");
itemAESkyStone = item;
} catch (Throwable e) {
e.printStackTrace();
}
}
if(ModChecker.GALACTICRAFT_PLANETS){
try {
Item item = getItem("galacticraftplanets:item_basic_mars");
itemGCPMars = item;
} catch(Throwable e){
e.printStackTrace();
}
}
if(ModChecker.IC2){
try {
Item item = getItem("ic2:misc_resource");
itemIC2MiscResource = item;
} catch(Throwable e){
e.printStackTrace();
}
try {
Item item = getItem("ic2:nuclear");
itemIC2Nuclear = item;
} catch(Throwable e){
e.printStackTrace();
}
}
if(ModChecker.ASTRAL_SORCERY){
try {
itemAstralMarble = getItem("astralsorcery:blockmarble");
itemAstralCrafting = getItem("astralsorcery:ItemCraftingComponent");
} catch(Throwable e){
e.printStackTrace();
}
try {
Item item = getItem("astralsorcery:BlockCustomOre");
itemAstralOre = item;
} catch(Throwable e){
e.printStackTrace();
}
try {
Item item = getItem("astralsorcery:ItemRockCrystalSimple");
itemAstralRockCrystal = item;
} catch(Throwable e){
e.printStackTrace();
}
}
if (ModChecker.RUSTIC) {
try {
Item item = getItem("rustic:slate");
itemRusticSlate = item;
} catch (Throwable e) {
e.printStackTrace();
}
}
if (ModChecker.INTEGRATED_DYNAMICS) {
try {
itemIDMenrilLog = getItem("integrateddynamics:menril_log");
itemIDMenrilSapling = getItem("integrateddynamics:menril_sapling");
itemIDMenrilBerry = getItem("integrateddynamics:menril_berries");
} catch (Throwable e) {
e.printStackTrace();
}
}
if (ModChecker.THE_BETWEENLANDS) {
try {
itemBLMisc = getItem("thebetweenlands:items_misc");
} catch (Exception e) {
e.printStackTrace();
}
}
}
public static Item getItem(String item) throws ItemNotFoundException {
Item target = Item.getByNameOrId(item);
if(target == null){
throw new ItemNotFoundException(item);
}
return target;
}
public static class ItemNotFoundException extends Exception {
public ItemNotFoundException(String thing){
super("Unable to find " + thing + "! Are you using the correct version of the mod?");
}
}
}
| [
"[email protected]"
] | |
df0ae47b5d10777ba0328869b9f4f3e772284d26 | 7b2a944d7acdd0da84d91f2cb2b88e039a66b2db | /src/test/java/entities/Genre.java | 473f33f1ac3cc8f58f5d41139e4f3582f5de59cb | [] | no_license | devnet-io/path | 6583b65c3032299f39c7c57abf858c97909a280b | 3815e872e93c1c113f4e295a4a6e1ace3abac7e3 | refs/heads/master | 2023-05-05T11:49:53.161058 | 2021-05-24T07:17:53 | 2021-05-24T07:17:53 | 233,804,816 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 94 | java | package entities;
import lombok.Data;
@Data
public class Genre {
private String name;
}
| [
"[email protected]"
] | |
8ed11318671742c1283ffecedec97166b29bdf93 | 0cbbc5868f4e4af4e5a270031e57625534c89d3d | /app/src/main/java/gabriel/ignacio/com/myapplication/Doggs.java | 68f87a5abdb66c1fde1cfad73827f18022be6ad3 | [] | no_license | gjignacioo/ProjectFinal | 6045ab0e787e19947fc8782c3ddedb1077d391e0 | b0121de593e89e29e21a431bf345aae391673fad | refs/heads/master | 2020-06-21T18:26:20.695084 | 2019-07-19T07:29:19 | 2019-07-19T07:29:19 | 197,525,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,035 | java | package gabriel.ignacio.com.myapplication;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Doggs extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dogs);
Button b = findViewById(R.id.back);
}
public void back(View v){
Intent i = new Intent(this, HomePage.class);
startActivity(i);
}
public void maxx(View v){
Intent i = new Intent(this, Maxx.class);
startActivity(i);
}
public void rumpole(View v){
Intent i = new Intent(this, Rumpole.class);
startActivity(i);
}
public void lucky(View v){
Intent i = new Intent(this, Lucky.class);
startActivity(i);
}
public void buttons(View v){
Intent i = new Intent(this, Buttons.class);
startActivity(i);
}
}
| [
"[email protected]"
] | |
b99005f2520fb29b22d227361943aab272c7fcd9 | 1a32d704493deb99d3040646afbd0f6568d2c8e7 | /BOOT-INF/lib/org/hibernate/validator/internal/constraintvalidators/bv/MaxValidatorForNumber.java | 9ddd7a5877037a1820fca8a3f1fb302e3519da58 | [] | no_license | yanrumei/bullet-zone-server-2.0 | e748ff40f601792405143ec21d3f77aa4d34ce69 | 474c4d1a8172a114986d16e00f5752dc019cdcd2 | refs/heads/master | 2020-05-19T11:16:31.172482 | 2019-03-25T17:38:31 | 2019-03-25T17:38:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,450 | java | /* */ package org.hibernate.validator.internal.constraintvalidators.bv;
/* */
/* */ import java.math.BigDecimal;
/* */ import java.math.BigInteger;
/* */ import javax.validation.ConstraintValidator;
/* */ import javax.validation.ConstraintValidatorContext;
/* */ import javax.validation.constraints.Max;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class MaxValidatorForNumber
/* */ implements ConstraintValidator<Max, Number>
/* */ {
/* */ private long maxValue;
/* */
/* */ public void initialize(Max maxValue)
/* */ {
/* 29 */ this.maxValue = maxValue.value();
/* */ }
/* */
/* */
/* */ public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext)
/* */ {
/* 35 */ if (value == null) {
/* 36 */ return true;
/* */ }
/* */
/* */
/* 40 */ if ((value instanceof Double)) {
/* 41 */ if (((Double)value).doubleValue() == Double.NEGATIVE_INFINITY) {
/* 42 */ return true;
/* */ }
/* 44 */ if ((Double.isNaN(((Double)value).doubleValue())) || (((Double)value).doubleValue() == Double.POSITIVE_INFINITY)) {
/* 45 */ return false;
/* */ }
/* */ }
/* 48 */ else if ((value instanceof Float)) {
/* 49 */ if (((Float)value).floatValue() == Float.NEGATIVE_INFINITY) {
/* 50 */ return true;
/* */ }
/* 52 */ if ((Float.isNaN(((Float)value).floatValue())) || (((Float)value).floatValue() == Float.POSITIVE_INFINITY)) {
/* 53 */ return false;
/* */ }
/* */ }
/* 56 */ if ((value instanceof BigDecimal)) {
/* 57 */ return ((BigDecimal)value).compareTo(BigDecimal.valueOf(this.maxValue)) != 1;
/* */ }
/* 59 */ if ((value instanceof BigInteger)) {
/* 60 */ return ((BigInteger)value).compareTo(BigInteger.valueOf(this.maxValue)) != 1;
/* */ }
/* */
/* 63 */ long longValue = value.longValue();
/* 64 */ return longValue <= this.maxValue;
/* */ }
/* */ }
/* Location: C:\Users\ikatwal\Downloads\bullet-zone-server-2.0.jar!\BOOT-INF\lib\hibernate-validator-5.3.6.Final.jar!\org\hibernate\validator\internal\constraintvalidators\bv\MaxValidatorForNumber.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
4786b60bbf87ac810c1caa6f7f5fef99fabff93b | 51fa3cc281eee60058563920c3c9059e8a142e66 | /Java/src/testcases/CWE191_Integer_Underflow/s05/CWE191_Integer_Underflow__int_getParameter_Servlet_predec_16.java | 7efe3b583baa664b1aab147987adf6b4bb79616b | [] | no_license | CU-0xff/CWE-Juliet-TestSuite-Java | 0b4846d6b283d91214fed2ab96dd78e0b68c945c | f616822e8cb65e4e5a321529aa28b79451702d30 | refs/heads/master | 2020-09-14T10:41:33.545462 | 2019-11-21T07:34:54 | 2019-11-21T07:34:54 | 223,105,798 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 4,427 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE191_Integer_Underflow__int_getParameter_Servlet_predec_16.java
Label Definition File: CWE191_Integer_Underflow__int.label.xml
Template File: sources-sinks-16.tmpl.java
*/
/*
* @description
* CWE: 191 Integer Underflow
* BadSource: getParameter_Servlet Read data from a querystring using getParameter()
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: decrement
* GoodSink: Ensure there will not be an underflow before decrementing data
* BadSink : Decrement data, which can cause an Underflow
* Flow Variant: 16 Control flow: while(true)
*
* */
package testcases.CWE191_Integer_Underflow.s05;
import testcasesupport.*;
import javax.servlet.http.*;
import java.util.logging.Level;
public class CWE191_Integer_Underflow__int_getParameter_Servlet_predec_16 extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
while (true)
{
data = Integer.MIN_VALUE; /* Initialize data */
/* POTENTIAL FLAW: Read data from a querystring using getParameter() */
{
String stringNumber = request.getParameter("name");
try
{
data = Integer.parseInt(stringNumber.trim());
}
catch(NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception reading data from parameter 'name'", exceptNumberFormat);
}
}
break;
}
while (true)
{
/* POTENTIAL FLAW: if data == Integer.MIN_VALUE, this will overflow */
int result = (int)(--data);
IO.writeLine("result: " + result);
break;
}
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
while (true)
{
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
break;
}
while (true)
{
/* POTENTIAL FLAW: if data == Integer.MIN_VALUE, this will overflow */
int result = (int)(--data);
IO.writeLine("result: " + result);
break;
}
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
while (true)
{
data = Integer.MIN_VALUE; /* Initialize data */
/* POTENTIAL FLAW: Read data from a querystring using getParameter() */
{
String stringNumber = request.getParameter("name");
try
{
data = Integer.parseInt(stringNumber.trim());
}
catch(NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception reading data from parameter 'name'", exceptNumberFormat);
}
}
break;
}
while (true)
{
/* FIX: Add a check to prevent an underflow from occurring */
if (data > Integer.MIN_VALUE)
{
int result = (int)(--data);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("data value is too small to decrement.");
}
break;
}
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
goodB2G(request, response);
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"[email protected]"
] | |
477f93df8b7350a2ee035b54307831cf668ed748 | 495cdbe2769409c6c6778d741e98610f5d247a14 | /Museum-manager/Museum-manager-pojo/src/main/java/com/museum/pojo/LostInfoExample.java | 3fe2ec2bcffa80c175ff096184d17e76352cb81e | [] | no_license | ygchange/museum | ca22baf69000a7b9de73695212fbd6cad115858b | d27235bad82b54c9a078f31dd86b1f905d4e7bfc | refs/heads/master | 2022-12-21T00:20:10.951640 | 2019-08-08T10:13:49 | 2019-08-08T10:13:49 | 189,807,867 | 0 | 0 | null | 2022-12-16T07:14:02 | 2019-06-02T05:22:12 | Java | UTF-8 | Java | false | false | 25,430 | java | package com.museum.pojo;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class LostInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public LostInfoExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andArticleNameIsNull() {
addCriterion("article_name is null");
return (Criteria) this;
}
public Criteria andArticleNameIsNotNull() {
addCriterion("article_name is not null");
return (Criteria) this;
}
public Criteria andArticleNameEqualTo(String value) {
addCriterion("article_name =", value, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameNotEqualTo(String value) {
addCriterion("article_name <>", value, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameGreaterThan(String value) {
addCriterion("article_name >", value, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameGreaterThanOrEqualTo(String value) {
addCriterion("article_name >=", value, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameLessThan(String value) {
addCriterion("article_name <", value, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameLessThanOrEqualTo(String value) {
addCriterion("article_name <=", value, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameLike(String value) {
addCriterion("article_name like", value, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameNotLike(String value) {
addCriterion("article_name not like", value, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameIn(List<String> values) {
addCriterion("article_name in", values, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameNotIn(List<String> values) {
addCriterion("article_name not in", values, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameBetween(String value1, String value2) {
addCriterion("article_name between", value1, value2, "articleName");
return (Criteria) this;
}
public Criteria andArticleNameNotBetween(String value1, String value2) {
addCriterion("article_name not between", value1, value2, "articleName");
return (Criteria) this;
}
public Criteria andLostPlaceIsNull() {
addCriterion("lost_place is null");
return (Criteria) this;
}
public Criteria andLostPlaceIsNotNull() {
addCriterion("lost_place is not null");
return (Criteria) this;
}
public Criteria andLostPlaceEqualTo(String value) {
addCriterion("lost_place =", value, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceNotEqualTo(String value) {
addCriterion("lost_place <>", value, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceGreaterThan(String value) {
addCriterion("lost_place >", value, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceGreaterThanOrEqualTo(String value) {
addCriterion("lost_place >=", value, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceLessThan(String value) {
addCriterion("lost_place <", value, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceLessThanOrEqualTo(String value) {
addCriterion("lost_place <=", value, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceLike(String value) {
addCriterion("lost_place like", value, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceNotLike(String value) {
addCriterion("lost_place not like", value, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceIn(List<String> values) {
addCriterion("lost_place in", values, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceNotIn(List<String> values) {
addCriterion("lost_place not in", values, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceBetween(String value1, String value2) {
addCriterion("lost_place between", value1, value2, "lostPlace");
return (Criteria) this;
}
public Criteria andLostPlaceNotBetween(String value1, String value2) {
addCriterion("lost_place not between", value1, value2, "lostPlace");
return (Criteria) this;
}
public Criteria andLostTimeIsNull() {
addCriterion("lost_time is null");
return (Criteria) this;
}
public Criteria andLostTimeIsNotNull() {
addCriterion("lost_time is not null");
return (Criteria) this;
}
public Criteria andLostTimeEqualTo(Date value) {
addCriterion("lost_time =", value, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeNotEqualTo(Date value) {
addCriterion("lost_time <>", value, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeGreaterThan(Date value) {
addCriterion("lost_time >", value, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeGreaterThanOrEqualTo(Date value) {
addCriterion("lost_time >=", value, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeLessThan(Date value) {
addCriterion("lost_time <", value, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeLessThanOrEqualTo(Date value) {
addCriterion("lost_time <=", value, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeIn(List<Date> values) {
addCriterion("lost_time in", values, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeNotIn(List<Date> values) {
addCriterion("lost_time not in", values, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeBetween(Date value1, Date value2) {
addCriterion("lost_time between", value1, value2, "lostTime");
return (Criteria) this;
}
public Criteria andLostTimeNotBetween(Date value1, Date value2) {
addCriterion("lost_time not between", value1, value2, "lostTime");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andOperatorIdIsNull() {
addCriterion("operator_id is null");
return (Criteria) this;
}
public Criteria andOperatorIdIsNotNull() {
addCriterion("operator_id is not null");
return (Criteria) this;
}
public Criteria andOperatorIdEqualTo(Integer value) {
addCriterion("operator_id =", value, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdNotEqualTo(Integer value) {
addCriterion("operator_id <>", value, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdGreaterThan(Integer value) {
addCriterion("operator_id >", value, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdGreaterThanOrEqualTo(Integer value) {
addCriterion("operator_id >=", value, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdLessThan(Integer value) {
addCriterion("operator_id <", value, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdLessThanOrEqualTo(Integer value) {
addCriterion("operator_id <=", value, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdIn(List<Integer> values) {
addCriterion("operator_id in", values, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdNotIn(List<Integer> values) {
addCriterion("operator_id not in", values, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdBetween(Integer value1, Integer value2) {
addCriterion("operator_id between", value1, value2, "operatorId");
return (Criteria) this;
}
public Criteria andOperatorIdNotBetween(Integer value1, Integer value2) {
addCriterion("operator_id not between", value1, value2, "operatorId");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andReceiveUserIdIsNull() {
addCriterion("receive_user_id is null");
return (Criteria) this;
}
public Criteria andReceiveUserIdIsNotNull() {
addCriterion("receive_user_id is not null");
return (Criteria) this;
}
public Criteria andReceiveUserIdEqualTo(Integer value) {
addCriterion("receive_user_id =", value, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdNotEqualTo(Integer value) {
addCriterion("receive_user_id <>", value, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdGreaterThan(Integer value) {
addCriterion("receive_user_id >", value, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdGreaterThanOrEqualTo(Integer value) {
addCriterion("receive_user_id >=", value, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdLessThan(Integer value) {
addCriterion("receive_user_id <", value, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdLessThanOrEqualTo(Integer value) {
addCriterion("receive_user_id <=", value, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdIn(List<Integer> values) {
addCriterion("receive_user_id in", values, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdNotIn(List<Integer> values) {
addCriterion("receive_user_id not in", values, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdBetween(Integer value1, Integer value2) {
addCriterion("receive_user_id between", value1, value2, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserIdNotBetween(Integer value1, Integer value2) {
addCriterion("receive_user_id not between", value1, value2, "receiveUserId");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneIsNull() {
addCriterion("receive_user_phone is null");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneIsNotNull() {
addCriterion("receive_user_phone is not null");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneEqualTo(String value) {
addCriterion("receive_user_phone =", value, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneNotEqualTo(String value) {
addCriterion("receive_user_phone <>", value, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneGreaterThan(String value) {
addCriterion("receive_user_phone >", value, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneGreaterThanOrEqualTo(String value) {
addCriterion("receive_user_phone >=", value, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneLessThan(String value) {
addCriterion("receive_user_phone <", value, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneLessThanOrEqualTo(String value) {
addCriterion("receive_user_phone <=", value, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneLike(String value) {
addCriterion("receive_user_phone like", value, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneNotLike(String value) {
addCriterion("receive_user_phone not like", value, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneIn(List<String> values) {
addCriterion("receive_user_phone in", values, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneNotIn(List<String> values) {
addCriterion("receive_user_phone not in", values, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneBetween(String value1, String value2) {
addCriterion("receive_user_phone between", value1, value2, "receiveUserPhone");
return (Criteria) this;
}
public Criteria andReceiveUserPhoneNotBetween(String value1, String value2) {
addCriterion("receive_user_phone not between", value1, value2, "receiveUserPhone");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"[email protected]"
] | |
93137671c6a480bdc269a3175753fdd8b47074a3 | a66a4d91639836e97637790b28b0632ba8d0a4f9 | /src/generators/maths/csi_wizDE.java | f53d0b76cc2c02f45bc1af8ad1d622f1a20bbd7e | [] | no_license | roessling/animal-av | 7d0ba53dda899b052a6ed19992fbdfbbc62cf1c9 | 043110cadf91757b984747750aa61924a869819f | refs/heads/master | 2021-07-13T05:31:42.223775 | 2020-02-26T14:47:31 | 2020-02-26T14:47:31 | 206,062,707 | 0 | 2 | null | 2020-10-13T15:46:14 | 2019-09-03T11:37:11 | Java | UTF-8 | Java | false | false | 1,902 | java | /*
* csi_wiz.java
* Mavin Stiller, Marius Süßmilch, 2017 for the Animal project at TU Darmstadt.
* Copying this file for educational purposes is permitted without further authorization.
*/
package generators.maths;
import generators.framework.Generator;
import generators.framework.GeneratorType;
import java.util.Locale;
import algoanim.primitives.generators.Language;
import java.util.Hashtable;
import generators.framework.properties.AnimationPropertiesContainer;
import algoanim.animalscript.AnimalScript;
public class csi_wizDE implements Generator {
private Language lang;
public void init(){
lang = new AnimalScript("Cubic Spline Interpolation", "Mavin Stiller, Marius Süßmilch", 800, 600);
}
public String generate(AnimationPropertiesContainer props,Hashtable<String, Object> primitives) {
CubicSplineGenDE csg = new CubicSplineGenDE();
return csg.run(props, primitives, lang);
}
public String getName() {
return "Cubic Spline Interpolation[DE]";
}
public String getAlgorithmName() {
return "Cubic Spline Interpolation";
}
public String getAnimationAuthor() {
return "Marvin Stiller, Marius Süßmilch";
}
public String getDescription(){
return "In dieser Animation wird gezeigt, wie man mit Hilfe von Polynomen dritter Ordnung verschiedene Funktionen interpolieren kann. Ihr könnt euer Wissen an den Fragen in der Animation testen.";
}
public String getCodeExample(){
return "---";
}
public String getFileExtension(){
return "asu";
}
public Locale getContentLocale() {
return Locale.GERMAN;
}
public GeneratorType getGeneratorType() {
return new GeneratorType(GeneratorType.GENERATOR_TYPE_MATHS);
}
public String getOutputLanguage() {
return Generator.JAVA_OUTPUT;
}
} | [
"[email protected]"
] | |
076bdfe344fa10d97372c3e8f68d2daf71b0def8 | 9bd270e6713ef7f4f887ff8413d6b94d314849a1 | /1. 수업 예제/06. Exception/Ex03_Exception03.java | d99cb8fb3996bfb61957ea78b03264ecc3ee73ff | [] | no_license | dongryoung/Class_Examples | ab0242dde514ab72f1d8088cf0698693fb36d665 | 90040f40742d9bf8d8030388cec24bc548ae9c92 | refs/heads/master | 2023-04-10T20:37:01.794232 | 2020-07-29T03:56:24 | 2020-07-29T03:56:24 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,166 | java | import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class Ex03_Exception03 {
public static void main(String[] args) {
try {
int result = 10 / 2; // ArithmeticException : 미확인 예외
System.out.println(result);
int[] arr = new int[3]; // ArrayIndexOutOf
arr[0] = 10;
System.out.println(arr[0]);
String str = "100a";
int pstr = Integer.parseInt(str); // NumberFormatException : 미확인 에러
System.out.println(pstr);
FileInputStream fis = new FileInputStream("abc.txt"); // FileNotFoundException : 확인 예외
} catch (ArithmeticException e) {
System.out.println("입력 값이 잘못 되었습니다.");
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("배열의 index가 잘못 되었습니다.");
} catch (FileNotFoundException e) {
System.out.println("해당 파일이 존재하지 않습니다.");
} catch (Exception e) { // 모든 예외 클래스의 상위 클래스
e.printStackTrace(); // 예외 발생한 시점을 메모리에서 추적하여 상세하게 출력
} // try catch
} // main()
} // class | [
"[email protected]"
] | |
fcdd59cba0c98bf06ccadc0bd22c31a65a0465d1 | c074789a1a170fd8f692bcff67584fb5af10d9f4 | /src/main/java/com/liuwq/linkedlist/Test.java | 7e27c9ea250dc26e48b06e3b01d91de8e685701c | [] | no_license | rulerliu/ext_arraylist | 33e3958d2b67e644e4c4a6c93d5662d34e8e3bf1 | 13ae971f5378ed87d2a33b35e6f13374076bafdd | refs/heads/master | 2020-07-01T01:37:23.544113 | 2019-08-14T09:27:51 | 2019-08-14T09:27:51 | 201,010,087 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 833 | java | package com.liuwq.linkedlist;
import java.util.LinkedList;
/**
* @description:
* @author: liuwq
* @date: 2019/8/14 0014 下午 3:43
* @version: V1.0
*/
public class Test {
public static void main(String[] args) {
LinkedList<Integer> l = new LinkedList<>();
ExtLinkedList<Integer> list = new ExtLinkedList();
for (int i = 0; i < 10; i++) {
list.add(i);
}
System.out.println(list.get(2));
System.out.println(list.get(8));
System.out.println(list.remove());
System.out.println(list.remove());
// System.out.println(list.remove(2));
// System.out.println(list.remove(7));
for (int i = 0; i < list.size(); i++) {
System.out.println("integer:" + list.get(i));
}
System.out.println(8 >> 1);
}
}
| [
"[email protected]"
] | |
adac061a15b33cacf75a34707582c612b5a9e839 | 58644d923df595084e7274625f1d9da0bd4f2355 | /P6-Percolation-master/src/TestPercolation.java | 9a6a0df3c38fb2e68d7464972d6d6cab9c016bcd | [] | no_license | saraliszeski/cs201 | 2a0d20deec50d01270a4beb36ed53d125eae6dfa | aaf9b9282d2d2a3c065762d88ae828600767f3b3 | refs/heads/master | 2023-02-25T08:45:52.378827 | 2021-01-28T02:38:52 | 2021-01-28T02:38:52 | 333,623,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,042 | java | import static org.junit.jupiter.api.Assertions.*;
import org.junit.Test;
import org.junit.jupiter.api.*;
public class TestPercolation {
public IPercolate getPercolator(int size) {
// return new PercolationDFS(size);
//return new PercolationBFS(size);
//return new PercolationDFSFast(size);
IUnionFind finder = new QuickUWPC();
IPercolate perc = new PercolationUF(finder,size);
return perc;
}
/**
* test checks if IPercolate's isOpen method works correctly
*/
@Test
public void testIsOpen() {
IPercolate perc = getPercolator(10);
for (int i = 1; i < 10; i++)
for (int j = 0; j < 10; j++) {
perc.open(i, j);
assertTrue( perc.isOpen(i, j),"This test checks if IPercolate's isOpen method " + "works correctly");
}
}
/**
* This test checks if IPercolate's isFull method works correctly
*/
@Test
public void testIsFull() {
IPercolate perc = getPercolator(10);
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++) {
perc.open(i, j);
assertTrue(perc.isFull(i, j),"This test checks if IPercolate's isFull method " + "works correctly");
}
}
private void doTestPercolate(IPercolate perc) {
for (int i = 0; i < 9; i++)
for (int j = 0; j < 10; j++) {
perc.open(i, j);
assertFalse(perc.percolates(),
"This test checks if " + perc.getClass().getName() + " percolates method works correctly");
}
perc.open(9, 0);
assertTrue(perc.percolates(),
"This test checks if " + perc.getClass().getName() + "percolates method works correctly");
}
/**
* This test checks if IPercolate's percolates method works correctly
*/
@Test
public void testPercolates() {
IPercolate perc = getPercolator(10);
doTestPercolate(perc);
}
/**
* Check if Exception is thrown unless (0 <= i < N) and (0 <= j < N)
*/
private static void bounds(IPercolate perc, int N, int i, int j) {
boolean passed1 = false;
boolean passed2 = false;
boolean passed3 = false;
System.out.println(" * N = " + N + ", (i, j) = (" + i + ", " + j + ")");
try {
perc.open(i, j);
} catch (Exception e) {
passed1 = true;
}
assertTrue(passed1,"This test checks if Exception thrown for open() for " + perc.getClass().getName());
try {
boolean b = perc.isOpen(i, j);
} catch (Exception e) {
passed2 = true;
}
assertTrue(passed2,"This test checks if Exception thrown for isOpen() for " + perc.getClass().getName());
try {
boolean b = perc.isFull(i, j);
} catch (Exception e) {
passed3 = true;
}
assertTrue(passed3,"This test checks if Exception thrown for isFull() for " + perc.getClass().getName());
}
private void testBounds(IPercolate perc) {
bounds(perc, 10, -1, 5);
bounds(perc, 10, 11, 5);
bounds(perc, 10, 10, 5);
bounds(perc, 10, 5, -1);
bounds(perc, 10, 5, 11);
bounds(perc, 10, 5, 10);
}
/**
* Check if Exception is thrown when (i, j) are out of bounds
*/
@Test
public void testBounds() {
IPercolate perc = getPercolator(10);
testBounds(perc);
}
}
| [
"[email protected]"
] | |
4d9e90ac6fd0cc0d238ed3961e35889729c9d0e5 | 2e9289609edff7ce6b18a5d41da6490c0dd75cf2 | /TP05/area-calculator/src/main/java/Circle.java | b6040befcfac5337b1b61d7f0bbc249235499bc8 | [] | no_license | Homailot/FEUP-LPOO | 9a9e9be25d5ffff28a293ac1832375ba83844442 | 69c497714f331789e4ac09d6dbcf80173ada272b | refs/heads/master | 2023-04-02T22:06:04.940925 | 2021-03-31T17:08:57 | 2021-03-31T17:08:57 | 341,851,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 448 | java | public class Circle implements AreaShape {
private double radius;
Circle(double radius) {
this.radius = radius;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this.radius = radius;
}
@Override
public double getArea() {
return Math.PI * Math.pow(radius, 2);
}
@Override
public String draw() {
return "Circle";
}
}
| [
"[email protected]"
] | |
5c91235d6e9a8190874ebdb86ac499f8bcf17028 | 07302d5e3627f89cea32fa0ae9003125b5c43d66 | /src/main/java/edu/sysu/lhfcws/mailplus/commons/db/sqlite/resultset/RemoteHostResultSetHandler.java | 1a232537e85cb7e02e2afbfb4c4b8ef81c4e0e2f | [] | no_license | Lhfcws/mail-plus | 8ea257c2bb32784f50038d5c9969eae46ec74526 | cca11fcce544cd89f6f143c7b850cc8d7f839dce | refs/heads/master | 2016-09-02T03:50:27.338593 | 2015-01-02T11:44:23 | 2015-01-02T11:44:24 | 25,814,328 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 867 | java | package edu.sysu.lhfcws.mailplus.commons.db.sqlite.resultset;
import edu.sysu.lhfcws.mailplus.commons.model.RemoteHost;
import org.apache.commons.dbutils.ResultSetHandler;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* The resultset handler of RemoteHosts.
* @author lhfcws
* @time 14-10-27.
*/
public class RemoteHostResultSetHandler implements ResultSetHandler<RemoteHost> {
@Override
public RemoteHost handle(ResultSet rs) throws SQLException {
if (rs.next()) {
RemoteHost remoteHost = new RemoteHost();
remoteHost.setId(rs.getInt("id"));
remoteHost.setImapHost(rs.getString("imap"));
remoteHost.setSmtpHost(rs.getString("smtp"));
remoteHost.setPop3Host(rs.getString("pop3"));
return remoteHost;
}
else
return null;
}
}
| [
"[email protected]"
] | |
14219aa49706642d46f88dba79a8e83b36bcfc7b | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/gradle--gradle/d09762fbfbb8689cf51390d547de8da8db5996d5/after/ForcedModuleNotationParser.java | a1744b91ae20733d48549031fe7797e5542b4c2c | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,625 | java | /*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.api.internal.artifacts.configurations;
import org.gradle.api.artifacts.ModuleVersionIdentifier;
import org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier;
import org.gradle.api.internal.notations.NotationParserBuilder;
import org.gradle.api.internal.notations.api.InvalidNotationFormat;
import org.gradle.api.internal.notations.api.NotationParser;
import org.gradle.api.internal.notations.api.TopLevelNotationParser;
import org.gradle.api.internal.notations.parsers.TypedNotationParser;
import org.gradle.util.ConfigureUtil;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static java.util.Arrays.asList;
/**
* by Szczepan Faber, created at: 10/11/11
*/
public class ForcedModuleNotationParser implements TopLevelNotationParser, NotationParser<Set<ModuleVersionIdentifier>> {
private NotationParser<Set<ModuleVersionIdentifier>> delegate = new NotationParserBuilder()
.resultingType(ModuleVersionIdentifier.class)
.parser(new ForcedModuleStringParser())
.parser(new ForcedModuleMapParser())
.invalidNotationMessage(
"The forced module notation cannot be used to form the forced module.\n"
+ "Forced module notation only supports following types/formats:\n"
+ " 1. instances of ModuleIdentifier\n"
+ " 2. Strings (actually CharSequences), e.g. 'org.gradle:gradle-core:1.0'\n"
+ " 3. Maps, e.g. [group: 'org.gradle', name:'gradle-core', version: '1.0']\n"
+ " 4. A Collection or array of above (nested collections/arrays will be flattened)\n"
)
.build();
public Set<ModuleVersionIdentifier> parseNotation(Object notation) {
assert notation != null : "notation cannot be null";
return delegate.parseNotation(notation);
}
public boolean canParse(Object notation) {
return delegate.canParse(notation);
}
static class ForcedModuleMapParser extends TypedNotationParser<Map, ModuleVersionIdentifier> {
public ForcedModuleMapParser() {
super(Map.class);
}
public ModuleVersionIdentifier parseType(Map notation) {
ModuleVersionIdentifier out = identifier(null, null, null);
List<String> mandatoryKeys = asList("group", "name", "version");
try {
ConfigureUtil.configureByMap(notation, out, mandatoryKeys);
} catch (ConfigureUtil.IncompleteInputException e) {
throw new InvalidNotationFormat(
"Invalid format: " + notation + ". Missing mandatory key(s): " + e.getMissingKeys() + "\n"
+ "The correct notation is a map with keys: " + mandatoryKeys + ", for example: [group: 'org.gradle', name:'gradle-core', version: '1.0']", e);
}
return out;
}
}
static class ForcedModuleStringParser extends TypedNotationParser<CharSequence, ModuleVersionIdentifier> {
public ForcedModuleStringParser() {
super(CharSequence.class);
}
public ModuleVersionIdentifier parseType(CharSequence notation) {
String[] split = notation.toString().split(":");
if (split.length != 3) {
throw new InvalidNotationFormat(
"Invalid format: '" + notation + "'. The Correct notation is a 3-part group:name:version notation,"
+ "e.g: org.gradle:gradle-core:1.0");
}
final String group = split[0];
final String name = split[1];
final String version = split[2];
return identifier(group, name, version);
}
}
static ModuleVersionIdentifier identifier(final String group, final String name, final String version) {
return new DefaultModuleVersionIdentifier(group, name, version);
}
} | [
"[email protected]"
] | |
4bc67d0014bffb3ca5b827832ed9e090d0585a39 | 67ba62069c623b1f772fc34af63e68d47d88711a | /src/com/jdbc/scroll/demo/TestScroll.java | de0241e1aa2c8a286a378804ecde5c26c323581a | [] | no_license | WillamLan/JDBC_Demo | 1d65a5c4338caca00bfee0c061ce5a0846cefe2c | 28e1019bf8c045afc39e0bb89101233fca56ae56 | refs/heads/master | 2016-09-05T16:31:45.818188 | 2015-04-06T12:11:46 | 2015-04-06T12:11:46 | 33,391,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,553 | java | package com.jdbc.scroll.demo;
import java.sql.*;
import com.jdbc.util.DBUtilFactory;
/**
*
* 类: TestScroll <br>
* 描述: Movable ResultSet
* 设置结果集为可滚动结果集 <br>
* 作者: xiaoxiaolan <br>
* 时间: 2015-4-6 下午1:28:28
*/
public class TestScroll {
private static Connection conn=null;
public static void main(String args[]) throws Exception {
try {
conn=DBUtilFactory.getFactory();
//只要对结果集设置以下两个静态常量,结果集就可以滚动。不过为了保险起见,能只用next就能实现的就不要使用可滚动结果集。
Statement stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt
.executeQuery("select * from emp order by sal");
rs.next();//获取下一条。
System.out.println(rs.getInt(1));
rs.last();//获取最后一条
System.out.println(rs.getString(1));
System.out.println(rs.isLast());//判断是否是最后一条记录
System.out.println(rs.isAfterLast());
System.out.println(rs.getRow());//获取结果集中记录的条数。
rs.previous();//获取当前记录的前一条记录。
System.out.println(rs.getString(1));
rs.absolute(6);//绝对定位到第六条记录
System.out.println(rs.getString(1));//以字符串的方式获取当前记录的第一个字段的值。
rs.close();
stmt.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
4c4b5488e657f87efb7e2fe17c99c70a87f95950 | f5f51f989252e9db84988b0d6a582e2c5c421204 | /Conta/Deposito.java | 78ea498546f807b8dfeba31e5f55e647b864be25 | [] | no_license | charlistonrodrigo/Conta-github | 991a080aa82629feed8264c4a28d04e4d6ecd1d6 | dcd4793e5dd658a5b40cf02edd032d31595bc65b | refs/heads/master | 2022-07-07T12:13:43.656943 | 2022-06-25T19:51:49 | 2022-06-25T19:51:49 | 187,410,905 | 0 | 0 | null | 2022-06-25T19:49:44 | 2019-05-18T22:28:15 | Java | UTF-8 | Java | false | false | 3,125 | 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 Conta;
import java.util.Scanner;
import transporte.Transporte;
/**
*
* @author charlistonrodrigo
*/
public class Deposito {
public static void main (String[] args) {
Transporte obj = new Transporte();
int i, num ,opçao, estoque_jatiboca, estoque_pontal, ent_est_jatiboca, ent_est_pontal,sai_est_jatiboca,sai_est_pontal;
Scanner ler = new Scanner(System.in);
estoque_jatiboca = 0;
estoque_pontal = 0;
ent_est_jatiboca = 0;
ent_est_pontal = 0;
sai_est_jatiboca = 0;
sai_est_pontal = 0;
i = 1;
// (i) - e o condicional de execução do programa. Caso seja igual a (0) o programa será interrompido.
while (i != 0){
System.out.println("PARA TERMINAR DIGITE A OPÇÃO 5 E DEPOIS TECLE 0 " );
System.out.println(" MENU " );
System.out.println(" INFORME A OPÇAO DESEJADA : " );
System.out.println(" ");
System.out.println(" 1- ENTRADA DE ESTOQUE : " );
System.out.println(" 2- SAIDA DE ESTOQUE : " );
System.out.println(" 3- TRANSFERENCIA DE ESTOQUE : " );
System.out.println(" 4- CONSULTA DE ESTOQUE : " );
System.out.println(" 5- FINALIZAR : " );
System.out.println(" ");
opçao = ler.nextInt();
switch (opçao)
{
case 1:
System.out.println(" INFORME QUAL A QUANTIDADE DE AÇUCAR : " );
obj.ent_est_jatiboca = ler.nextInt();
System.out.println( " ESTOQUE1:" + obj.estoque_inicial_jatiboca() );
break;
case 2:
System.out.println(" INFORME QUAL A QUANTIDADE DE AÇUCAR : " );
obj.sai_est_jatiboca = ler.nextInt();
System.out.println( " ESTOQUE2 :" + obj.estoque_saida_jatiboca() );
break;
case 3:
System.out.println(" CASO QUEIRA TRANSFERENCIA DE JATIBOCA PARA PORTAL, DIGITE 1 : " );
System.out.println(" SENÃO DIGITE QUALQUER NUMERO DIFERENTE DE 1, PARA RETORNAR : " );
System.out.println("");
num = ler.nextInt();
if (num == 1){
obj.sai_est_jatiboca = ler.nextInt();
System.out.println( " ESTOQUE PONTAL :" + obj.transfere_jatiboca( ));
}
break;
case 4:
System.out.println(" RESULTADO : " + obj.estoque_jatiboca);
System.out.println( " ESTOQUE PONTAL :" + obj.estoque_pontal);
break;
case 5:
break;
// default : System.out.println(" OPÇAO INVALIDA " );
}
System.out.println("");
System.out.println(" PARA SAIR TECLE (O), SENÃO INFORME QUALQUER OUTRO VALOR: " );
i = ler.nextInt();
}
}
}
| [
"[email protected]"
] | |
d971f776580a544760b3f2b31d4c2a4d0169244d | 1ce63afa6702d03ebc087c4462a3a60b6c66ab89 | /pinyougou-parent/pinyougou-shop-web/src/main/java/com/pinyougou/shop/controller/GoodsController.java | 92cf510984645cf830a4995695976ca797cea053 | [] | no_license | MrLiuYangYang/pinyougou | 94e5e0ef21d2e80f86b211917e4afae04fe45249 | 0f172dffe9d578c3f8ae650cbbb141fd44ccf90c | refs/heads/master | 2020-05-16T15:35:33.585892 | 2019-04-27T08:32:42 | 2019-04-27T08:32:42 | 181,817,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,990 | java | package com.pinyougou.shop.controller;
import java.util.List;
import org.omg.IOP.ServiceContextHolder;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.dubbo.config.annotation.Reference;
import com.pinyougou.pojo.TbGoods;
import com.pinyougou.pojogroup.Goods;
import com.pinyougou.sellergoods.service.GoodsService;
import entity.PageResult;
import entity.Result;
/**
* controller
* @author Administrator
*
*/
@RestController
@RequestMapping("/goods")
public class GoodsController {
@Reference
private GoodsService goodsService;
/**
* 返回全部列表
* @return
*/
@RequestMapping("/findAll")
public List<TbGoods> findAll(){
return goodsService.findAll();
}
/**
* 返回全部列表
* @return
*/
@RequestMapping("/findPage")
public PageResult findPage(int page,int rows){
return goodsService.findPage(page, rows);
}
/**
* 增加
* @param goods
* @return
*/
@RequestMapping("/add")
public Result add(@RequestBody Goods goods){
String sellerId = SecurityContextHolder.getContext().getAuthentication().getName();
goods.getGoods().setSellerId(sellerId);
try {
goodsService.add(goods);
return new Result(true, "增加成功");
} catch (Exception e) {
e.printStackTrace();
return new Result(false, "增加失败");
}
}
/**
* 修改
* @param goods
* @return
*/
@RequestMapping("/update")
public Result update(@RequestBody Goods goods){
String sellerId = SecurityContextHolder.getContext().getAuthentication().getName();
Goods goods2 = goodsService.findOne(goods.getGoods().getId());
if (!goods2.getGoods().getSellerId().equals(sellerId) || !goods.getGoods().getSellerId().equals(sellerId)) {
return new Result(false, "非法操作");
}
try {
goodsService.update(goods);
return new Result(true, "修改成功");
} catch (Exception e) {
e.printStackTrace();
return new Result(false, "修改失败");
}
}
/**
* 获取实体
* @param id
* @return
*/
@RequestMapping("/findOne")
public Goods findOne(Long id){
return goodsService.findOne(id);
}
/**
* 批量删除
* @param ids
* @return
*/
@RequestMapping("/delete")
public Result delete(Long [] ids){
try {
goodsService.delete(ids);
return new Result(true, "删除成功");
} catch (Exception e) {
e.printStackTrace();
return new Result(false, "删除失败");
}
}
/**
* 查询+分页
* @param brand
* @param page
* @param rows
* @return
*/
@RequestMapping("/search")
public PageResult search(@RequestBody TbGoods goods, int page, int rows ){
String sellerId = SecurityContextHolder.getContext().getAuthentication().getName();
goods.setSellerId(sellerId);
return goodsService.findPage(goods, page, rows);
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.