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
d9598ebb8ece63db7d97dd0b8c9bfbf162222418
43f07a4d054bacf3bfb47d7f32c2834945877871
/src/main/java/th/co/ananta/x/web/tag/form/RadioButtonsTag.java
1b7a3c1f897ffde9633c362d80a8f80e75d3bae5
[]
no_license
anantaDiamond/ananta
110633ec652213c85e7997c1eddbdc49792928b9
d96ca048716d5b91a96f839d2b9a15621548a66f
refs/heads/master
2023-08-10T06:15:40.890110
2019-06-03T16:22:06
2019-06-03T16:22:06
189,717,433
0
0
null
2023-07-22T07:15:54
2019-06-01T10:02:42
Java
UTF-8
Java
false
false
180
java
package th.co.ananta.x.web.tag.form; public class RadioButtonsTag extends org.springframework.web.servlet.tags.form.RadioButtonsTag { public RadioButtonsTag() { super(); } }
[ "ananta4test@gmail.com" ]
ananta4test@gmail.com
1e659a12e2b966ea6523d1d5b6ef53e02da6f0fd
0a9534cf101e58538417ebc32ff645ee379fbaab
/src/TestGraphics.java
480df77f00272bea308fcbc872acba899b2a51e6
[]
no_license
wordplayer/MemoriamMedia
8db836cb4746547494338787ed79be87eca21ff2
2984856eed1f26f00de2dff48562428c1a48bc11
refs/heads/master
2021-01-25T04:43:13.845306
2019-03-20T02:27:15
2019-03-20T02:27:15
93,475,188
0
0
null
null
null
null
UTF-8
Java
false
false
1,485
java
import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.paint.Color; import javafx.stage.Stage; import javafx.scene.media.MediaPlayer; import javafx.scene.media.Media; import com.mpatric.mp3agic.*; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.File; import javafx.embed.swing.SwingFXUtils; import javafx.geometry.Pos; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.StackPane; import javax.imageio.ImageIO; public class TestGraphics extends Application{ public static void main(String args[])throws Exception { launch(args); } @Override public void start(Stage stage) throws Exception { stage.setFullScreen(true); Group root=new Group(); String source="C:\\Users\\Smart User\\Downloads\\06 So Far Away.mp3"; Mp3File mp3=new Mp3File(source); ID3v2 id3v2Tag=mp3.getId3v2Tag(); Media media=new Media(new File(source).toURI().toString()); MediaPlayer player=new MediaPlayer(media); player.setAutoPlay(true); TestWindow1 obj=new TestWindow1(id3v2Tag,player); Scene scene=new Scene(root); scene.setRoot(obj); scene.setFill(Color.BLACK); stage.setScene(scene); stage.show(); } }
[ "soumyarajbo@gmail.com" ]
soumyarajbo@gmail.com
546e25636abcc094343c804bdab2174492415cac
04a760f7c3ba1e7e89ff1f01e26ae629af8dd383
/commonsutils/src/main/java/com/lsh/utils/text/translate/package-info.java
6c557518ec11a4b18bd8a2f4d604d0af1f03ac4c
[]
no_license
adonis-lsh/LshUtils
1de67c8f11fb475bcfebaee148016845c703d8af
25ebe3a4d7f835114fba59cc1750fa53e8d2f280
refs/heads/master
2021-05-08T01:56:44.152702
2017-10-23T08:56:24
2017-10-23T08:56:24
107,943,854
1
0
null
null
null
null
UTF-8
Java
false
false
1,354
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * <p> An API for creating text translation routines from a set of smaller building blocks. Initially created to make it * possible for the user to customize the rules in the StringEscapeUtils class.</p> * <p>These classes are immutable, and therefore thread-safe.</p> * * @since 3.0 * @deprecated as of 3.6, use the commons-text * <a href="https://commons.apache.org/proper/commons-text/javadocs/api-release/org/apache/commons/text/translate/package-summary.html"> * translate package</a> instead */ package com.lsh.utils.text.translate;
[ "adonis_lsh@163.com" ]
adonis_lsh@163.com
28979c6042d39f9705654e224c29e7820439af68
ba41c1e85414ebf9e593bb7354783e76e18ecc79
/src/model/Sensor.java
f78ee82a2b88c1cf5d325ef200f21ef2a2d69676
[]
no_license
phdYang/bjd-xqs-project
1b2c116e7d2e56dd2363cfb59d89eb19bb6d31c3
f10298b67ba620f117bd14fac021e39d15eaeff6
refs/heads/master
2020-03-26T20:06:53.445334
2018-08-26T12:01:33
2018-08-26T12:01:33
145,305,582
1
0
null
null
null
null
UTF-8
Java
false
false
5,590
java
package model; public class Sensor { private int sensorId; private String sensorCode; private String sensorName; private String channelCode; private int sensorItemId; private int mySensorItemId; private double initKValue; private double initWave; private double initValue; private int initOrientations; private double bdWave; private double bdTemperature; private int refSensorId; private double refWDKValue; private int targetId; private int sectionId; private int typeId; private int isValid; private int range; private double accuracy; private String info; private String sDec; public Sensor() { super(); // TODO Auto-generated constructor stub } public Sensor(int sensorId, String sensorCode, String sensorName, String channelCode, int sensorItemId, int mySensorItemId, double initKValue, double initWave, double initValue, int initOrientations, double bdWave, double bdTemperature, int refSensorId, double refWDKValue, int targetId, int sectionId, int typeId, int isValid, int range, double accuracy, String info, String sDec) { super(); this.sensorId = sensorId; this.sensorCode = sensorCode; this.sensorName = sensorName; this.channelCode = channelCode; this.sensorItemId = sensorItemId; this.mySensorItemId = mySensorItemId; this.initKValue = initKValue; this.initWave = initWave; this.initValue = initValue; this.initOrientations = initOrientations; this.bdWave = bdWave; this.bdTemperature = bdTemperature; this.refSensorId = refSensorId; this.refWDKValue = refWDKValue; this.targetId = targetId; this.sectionId = sectionId; this.typeId = typeId; this.isValid = isValid; this.range = range; this.accuracy = accuracy; this.info = info; this.sDec = sDec; } public int getSensorId() { return sensorId; } public void setSensorId(int sensorId) { this.sensorId = sensorId; } public String getSensorCode() { return sensorCode; } public void setSensorCode(String sensorCode) { this.sensorCode = sensorCode; } public String getSensorName() { return sensorName; } public void setSensorName(String sensorName) { this.sensorName = sensorName; } public String getChannelCode() { return channelCode; } public void setChannelCode(String channelCode) { this.channelCode = channelCode; } public int getSensorItemId() { return sensorItemId; } public void setSensorItemId(int sensorItemId) { this.sensorItemId = sensorItemId; } public int getMySensorItemId() { return mySensorItemId; } public void setMySensorItemId(int mySensorItemId) { this.mySensorItemId = mySensorItemId; } public double getInitKValue() { return initKValue; } public void setInitKValue(double initKValue) { this.initKValue = initKValue; } public double getInitWave() { return initWave; } public void setInitWave(double initWave) { this.initWave = initWave; } public double getInitValue() { return initValue; } public void setInitValue(double initValue) { this.initValue = initValue; } public int getInitOrientations() { return initOrientations; } public void setInitOrientations(int initOrientations) { this.initOrientations = initOrientations; } public double getBdWave() { return bdWave; } public void setBdWave(double bdWave) { this.bdWave = bdWave; } public double getBdTemperature() { return bdTemperature; } public void setBdTemperature(double bdTemperature) { this.bdTemperature = bdTemperature; } public int getRefSensorId() { return refSensorId; } public void setRefSensorId(int refSensorId) { this.refSensorId = refSensorId; } public double getRefWDKValue() { return refWDKValue; } public void setRefWDKValue(double refWDKValue) { this.refWDKValue = refWDKValue; } public int getTargetId() { return targetId; } public void setTargetId(int targetId) { this.targetId = targetId; } public int getSectionId() { return sectionId; } public void setSectionId(int sectionId) { this.sectionId = sectionId; } public int getTypeId() { return typeId; } public void setTypeId(int typeId) { this.typeId = typeId; } public int getIsValid() { return isValid; } public void setIsValid(int isValid) { this.isValid = isValid; } public int getRange() { return range; } public void setRange(int range) { this.range = range; } public double getAccuracy() { return accuracy; } public void setAccuracy(double accuracy) { this.accuracy = accuracy; } public String getInfo() { return info; } public void setInfo(String info) { this.info = info; } public String getsDec() { return sDec; } public void setsDec(String sDec) { this.sDec = sDec; } @Override public String toString() { return "Sensor [sensorId=" + sensorId + ", sensorCode=" + sensorCode + ", sensorName=" + sensorName + ", channelCode=" + channelCode + ", sensorItemId=" + sensorItemId + ", mySensorItemId=" + mySensorItemId + ", initKValue=" + initKValue + ", initWave=" + initWave + ", initValue=" + initValue + ", initOrientations=" + initOrientations + ", bdWave=" + bdWave + ", bdTemperature=" + bdTemperature + ", refSensorId=" + refSensorId + ", refWDKValue=" + refWDKValue + ", targetId=" + targetId + ", sectionId=" + sectionId + ", typeId=" + typeId + ", isValid=" + isValid + ", range=" + range + ", accuracy=" + accuracy + ", info=" + info + ", sDec=" + sDec + "]"; } }
[ "zhaoyang@DESKTOP-43GQA0U.lan" ]
zhaoyang@DESKTOP-43GQA0U.lan
5a0b7a2eb81b25a8ba02976d6e50988aa33323c6
0e0fa1be645a47ac78d7dcd42975ce389913901d
/app/src/main/java/personal/yulie/android/yuliegallery/utils/FileUtils.java
3ba1ba428c100859fd6c042e2192f0227be0eb05
[]
no_license
blizz2night/YulieGallery
cafe0b371f8e3efca1b4d3d059024fe6a3e407ae
8f275b25de3cb406da951299a2de39e04305ca0f
refs/heads/master
2021-06-26T15:32:16.191763
2017-09-11T12:52:31
2017-09-11T12:52:31
103,135,521
0
0
null
null
null
null
UTF-8
Java
false
false
795
java
package personal.yulie.android.yuliegallery.utils; import android.content.Context; import android.os.Environment; import java.io.File; /** * Created by android on 17-9-7. */ public class FileUtils { public static File getDCIMFolder() { return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); } public static File getOutputFolder(File dir, String name) { File folder = new File(dir, name); if (!folder.exists()) { folder.mkdirs(); } return folder; } public static File getOutputFolder() { return FileUtils.getOutputFolder(FileUtils.getDCIMFolder(), "Camera"); } public static File getDiskCacheDir(Context context) { return context.getExternalCacheDir(); } }
[ "yulie.yan@tinno.com" ]
yulie.yan@tinno.com
05c8d64d3330017f60c20aef81d9ec68c43e31fa
6859399247afa3da7ab4a22516bd3f74205069f7
/Web/src/com/lingtong/vo/ContractVo.java
a72e869e496ec9c46e6525b1ade50b2cbf3a3131
[]
no_license
sjpsega/uzuer
75d603a4107f5df1ee96b27f2acc831f0fcd2a64
13e21856318fd99f3a449b269ce4706727cbd6af
refs/heads/master
2021-01-16T19:41:54.606752
2016-02-03T06:34:27
2016-02-03T06:34:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,323
java
package com.lingtong.vo; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.util.Locale; import org.apache.commons.lang.StringUtils; /** * 合同 * * @author MTT * */ public class ContractVo { public static final String TABLENAME = "contract"; public static final String VIEWNAME = "contractView"; public static final String DETAILVIEWNAME = "contractDetailView"; //原始合同信息 private Integer id;// 合同ID private String contractno;//合同编号 private Integer host_id;//关联房东ID private Integer tenant_id;//关联租客ID private Integer contract_type_id;//关联合同类型ID private Integer company_id;//关联公司ID private Integer room_id;//关联房源ID private String house_commander;//关联方司令 private String sign_time;//合同签订时间。 生效时间 private String end_time;//合同到期日 private String signid;//上上签的合同编号 private String docid;//合同上传之后的id private Integer status;//合同状态 private String ssq_email;//合同上传之后,ssq系统生成的新的邮箱 private String completedState;//合同状态 0 是未完成 ,1 是完成的合同 ,-1 是付款超市状态 //房源信息 private Integer price;//租金 private String cityid;//省市区/县 private Integer size;// 面积 private String room_name; private String roomSeq; //房客信息 private String first_name;//姓氏 private String last_name;//名字 private String tel_number;//手机号码 private String id_card;//身份证 private String email;// 邮箱 private String kind;//厅室信息 private String full_name;//在数据库里是没这个字段,只用来查询用的 //小区信息 private String comm_address;//小区地址 private String comm_name;//小区名称 //公司信息 private String company_name;//公司名称 public String getComm_name() { return comm_name; } public void setComm_name(String comm_name) { this.comm_name = comm_name; } public String getKind() { return kind; } public void setKind(String kind) { this.kind = kind; } public String getContractno() { return contractno; } public void setContractno(String contractno) { this.contractno = contractno; } public Integer getId() { return id; } public void setId(Integer value) { this.id = value; } public Integer getHost_id() { return host_id; } public void setHost_id(Integer value) { this.host_id = value; } public Integer getTenant_id() { return tenant_id; } public void setTenant_id(Integer value) { this.tenant_id = value; } public Integer getContract_type_id() { return contract_type_id; } public void setContract_type_id(Integer value) { this.contract_type_id = value; } public Integer getCompany_id() { return company_id; } public void setCompany_id(Integer value) { this.company_id = value; } public Integer getRoom_id() { return room_id; } public void setRoom_id(Integer value) { this.room_id = value; } public String getHouse_commander() { return house_commander; } public void setHouse_commander(String value) { this.house_commander = value; } public String getSign_time() { return sign_time; } public void setSign_time(String value) { this.sign_time = value; } public String getEnd_time() { return end_time; } public void setEnd_time(String value) { this.end_time = value; } public String getSignid() { return signid; } public void setSignid(String signid) { this.signid = signid; } public String getSsq_email() { return ssq_email; } public void setSsq_email(String ssq_email) { this.ssq_email = ssq_email; } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } public String getCityid() { return cityid; } public void setCityid(String cityid) { this.cityid = cityid; } public Integer getSize() { return size; } public void setSize(Integer size) { this.size = size; } public String getFirst_name() { return first_name; } public void setFirst_name(String first_name) { this.first_name = first_name; } public String getLast_name() { return last_name; } public void setLast_name(String last_name) { this.last_name = last_name; } public String getTel_number() { return tel_number; } public void setTel_number(String tel_number) { this.tel_number = tel_number; } public String getId_card() { return id_card; } public void setId_card(String id_card) { this.id_card = id_card; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getDocid() { return docid; } public void setDocid(String docid) { this.docid = docid; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getCompletedState() { return completedState; } public void setCompletedState(String completedState) { this.completedState = completedState; } public String getRoom_name() { return room_name; } public void setRoom_name(String room_name) { this.room_name = room_name; } public String getComm_address() { return comm_address; } public void setComm_address(String comm_address) { this.comm_address = comm_address; } public String getRoomSeq() { return roomSeq; } public void setRoomSeq(String roomSeq) { this.roomSeq = roomSeq; } public String getCompany_name() { return company_name; } public void setCompany_name(String company_name) { this.company_name = company_name; } public String getFull_name() { return full_name; } public void setFull_name(String full_name) { this.full_name = full_name; } public boolean equals(Object obj) { if (obj == null) return false; else if (obj instanceof ContractVo) { ContractVo contract = (ContractVo) obj; if (contract.id == this.id) return true; } return false; } }
[ "tcyx@tcyxdeMacBook-Pro-2.local" ]
tcyx@tcyxdeMacBook-Pro-2.local
13b91c1ff02d08cde78e9babd7e09871d286486c
58f7f550ad8547834b2e985f76a27745cb29eaba
/src/com/scaler/bitmanipulation/MinXorValueOfPairs.java
2b038193679e1e4c1c3af8ebeb7c425431275ef7
[]
no_license
neel-spartacus/algorist
5dffcd9ab2c26ac4844dd293d2d1c658ce697252
3773a2a4652d1684c55f08fad6d786bb6cb9b7c2
refs/heads/main
2023-05-30T03:16:54.287964
2023-05-12T09:21:31
2023-05-12T09:21:31
340,591,760
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.scaler.bitmanipulation; import java.util.Arrays; public class MinXorValueOfPairs { public static int findMinXor(int[] A) { Arrays.sort(A); int n=A.length; int min=Integer.MAX_VALUE; int val=0; for(int i=0;i<n-1;i++){ val=A[i]^A[i+1]; min=Math.min(val,min); } return min; } public static void main(String[] args) { // int[] A={ 4, 7,0, 9}; int[] A={ 15, 5, 1, 10, 2}; System.out.println(findMinXor(A)); } }
[ "neel.abstract@gmail.com" ]
neel.abstract@gmail.com
d027db8558ff9783b76c339b4d01746ac4e52919
642e90aa1c85330cee8bbe8660ca277655bc4f78
/gameserver/src/main/java/l2s/gameserver/templates/DoorTemplate.java
8337751a8ec508088a0cdb784e153954bfdcb9fe
[]
no_license
BETAJIb/Studious
ac329f850d8c670d6e355ef68138c9e8fd525986
328e344c2eaa70238c403754566865e51629bd7b
refs/heads/master
2020-04-04T08:41:21.112223
2018-10-31T20:18:49
2018-10-31T20:18:49
155,790,706
0
0
null
null
null
null
UTF-8
Java
false
false
4,359
java
package l2s.gameserver.templates; import java.lang.reflect.Constructor; import java.util.regex.Matcher; import java.util.regex.Pattern; import l2s.commons.geometry.Polygon; import l2s.gameserver.ai.CharacterAI; import l2s.gameserver.ai.DoorAI; import l2s.gameserver.model.instances.DoorInstance; import l2s.gameserver.scripts.Scripts; import l2s.gameserver.utils.Location; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @author VISTALL * @date 8:35/15.04.2011 */ public class DoorTemplate extends CreatureTemplate { private static final Logger _log = LoggerFactory.getLogger(DoorTemplate.class); private static final Pattern MAP_X_Y_FROM_ID_PATTERN = Pattern.compile("([0-9]{2})([0-9]{2})[0-9]*", Pattern.DOTALL); @SuppressWarnings("unchecked") public static final Constructor<DoorAI> DEFAULT_AI_CONSTRUCTOR = (Constructor<DoorAI>) CharacterAI.class.getConstructors()[0]; public static enum DoorType { DOOR, WALL } private final int _id; private final String _name; private final DoorType _doorType; private final boolean _unlockable; private final boolean _isHPVisible; private final boolean _opened; private final boolean _targetable; private final Polygon _polygon; private final Location _loc; private final int _key; private final int _openTime; private final int _rndTime; private final int _closeTime; private final int _masterDoor; private final int _mapX; private final int _mapY; private StatsSet _aiParams; private Class<DoorAI> _classAI = DoorAI.class; private Constructor<DoorAI> _constructorAI = DEFAULT_AI_CONSTRUCTOR; public DoorTemplate(StatsSet set) { super(set); _id = set.getInteger("uid"); _name = set.getString("name"); _doorType = set.getEnum("door_type", DoorType.class, DoorType.DOOR); _unlockable = set.getBool("unlockable", false); _isHPVisible = set.getBool("show_hp", false); _opened = set.getBool("opened", false); _targetable = set.getBool("targetable", true); _loc = (Location) set.get("pos"); _polygon = (Polygon) set.get("shape"); _key = set.getInteger("key", 0); _openTime = set.getInteger("open_time", 0); _rndTime = set.getInteger("random_time", 0); _closeTime = set.getInteger("close_time", 0); _masterDoor = set.getInteger("master_door", 0); _aiParams = (StatsSet) set.getObject("ai_params", StatsSet.EMPTY); Matcher mapMatcher = MAP_X_Y_FROM_ID_PATTERN.matcher(String.valueOf(_id)); mapMatcher.find(); _mapX = Integer.parseInt(mapMatcher.group(1)); _mapY = Integer.parseInt(mapMatcher.group(2)); setAI(set.getString("ai", "DoorAI")); } @SuppressWarnings("unchecked") private void setAI(String ai) { Class<DoorAI> classAI = null; try { classAI = (Class<DoorAI>) Class.forName("l2s.gameserver.ai." + ai); } catch(ClassNotFoundException e) { classAI = (Class<DoorAI>) Scripts.getInstance().getClasses().get("ai.door." + ai); } if(classAI == null) _log.error("Not found ai class for ai: " + ai + ". DoorId: " + _id); else { _classAI = classAI; _constructorAI = (Constructor<DoorAI>) _classAI.getConstructors()[0]; } if(_classAI.isAnnotationPresent(Deprecated.class)) _log.error("Ai type: " + ai + ", is deprecated. DoorId: " + _id); } public CharacterAI getNewAI(DoorInstance door) { try { return _constructorAI.newInstance(door); } catch(Exception e) { _log.error("Unable to create ai of doorId " + _id, e); } return new DoorAI(door); } @Override public int getId() { return _id; } public String getName() { return _name; } public DoorType getDoorType() { return _doorType; } public boolean isUnlockable() { return _unlockable; } public boolean isHPVisible() { return _isHPVisible; } public Polygon getPolygon() { return _polygon; } public int getKey() { return _key; } public boolean isOpened() { return _opened; } public Location getLoc() { return _loc; } public int getOpenTime() { return _openTime; } public int getRandomTime() { return _rndTime; } public int getCloseTime() { return _closeTime; } public boolean isTargetable() { return _targetable; } public int getMasterDoor() { return _masterDoor; } public StatsSet getAIParams() { return _aiParams; } public int getMapX() { return _mapX; } public int getMapY() { return _mapY; } }
[ "gladiadorse@hotmail.com" ]
gladiadorse@hotmail.com
34059e6000f28d52e16cc4bd753ae93ef56c859c
a12cec1c55ab58e9dfa11806c1143594a67aa7e6
/reader/src/mekhails/reader/ArrayConverter.java
a0298738e584c5abf28ea222cb3404e8c3b05d3a
[]
no_license
MekhailS/java-assignment3
2d76ebfe915f63451ed6930298d2afffe19bed80
5db68b496acc80abc76cfdeea506be9eb3879764
refs/heads/master
2023-01-29T14:02:32.365469
2020-12-15T21:43:32
2020-12-15T21:43:32
320,856,055
0
0
null
null
null
null
UTF-8
Java
false
false
730
java
package mekhails.reader; import java.nio.ByteBuffer; class ArrayConverter { static short[] byteToShort(byte[] src) { if (src == null || src.length % 2 != 0) return null; short[] res = new short[src.length/2]; ByteBuffer byteBuffer = ByteBuffer.wrap(src); for (int i = 0; i < res.length; i++) { res[i] = byteBuffer.getShort(2*i); } return res; } static byte[] shortToByte(short[] src) { if (src == null) return null; ByteBuffer byteBuffer = ByteBuffer.allocate(2 * src.length); for (short shortCur : src) { byteBuffer.putShort(shortCur); } return byteBuffer.array(); } }
[ "shagvaliev.mikhail@gmail.com" ]
shagvaliev.mikhail@gmail.com
b0d160214506b34ff974fac823459401e00443e0
4f30ae9caec07d0818a8a65e431e70273f276836
/src/main/java/com/example/demo/ClientsGroup.java
b5a60f724cf15e60f1b3a2cc08619cc39298992a
[]
no_license
dpsisodia/restaurant
87e47e125fc7fddf32a88974b667695f59670d63
fc8bec2a5f749ab07776de7e4b7879ace2eb5048
refs/heads/master
2020-04-08T16:55:21.827009
2018-12-01T12:23:45
2018-12-01T12:23:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
817
java
package com.example.demo; import java.util.Objects; import java.util.UUID; public class ClientsGroup implements Comparable { public final int size; // number of clients private final String id = UUID.randomUUID().toString(); public ClientsGroup(int size) { this.size = size; } @Override public int hashCode() { return Objects.hash(size); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof ClientsGroup)) return false; ClientsGroup other = (ClientsGroup) obj; return size == other.size && id.equals(other.id); } @Override public String toString() { return "ClientsGroup [size=" + size + "]"; } @Override public int compareTo(Object o) { return this.size > ((ClientsGroup)o).size ? 1 :-1 ; } }
[ "dsisodia@ads.eso.org" ]
dsisodia@ads.eso.org
c620c85f4c20cc433c4e467390f35ac610dc5e7f
9e8acf446e5f78645e07acd2f41a616a132b4ba2
/ITSCommonModule/src/main/java/converter/DateTableCellRenderer.java
f4e84a5c81ca4a62b6c043490cf0be3c4ea10e97
[]
no_license
avincze73/its-medhub-server
42e0d09b410cc2d38e924a9d66e804dba70fffe5
46c534b05dbaad4cba912eb990af4cfa6c92c693
refs/heads/master
2021-01-22T12:07:59.896818
2014-04-29T12:51:57
2014-04-29T12:51:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
836
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package converter; import java.awt.Component; import java.text.Format; import java.text.SimpleDateFormat; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; /** * * @author vincze.attila */ public class DateTableCellRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Format formatter = new SimpleDateFormat("yyyy.MM.dd."); ((JLabel) cell).setText(formatter.format(value)); return cell; } }
[ "vincze.attila@192.168.2.10" ]
vincze.attila@192.168.2.10
65dc1f43f725222803fc7bd55d011a6d43dbf879
5042557ebb9918defc8e8d9b63df7ce1216c2590
/src/main/java/tw/gov/ndc/emsg/mydata/entity/PortalResourceDownloadExample.java
9233acd16e8f4d96db0791c73d54c702a94cf39a
[]
no_license
jennyming622/mydata-master
71f4b5dde8c64401d55672e6986fc70c844d16c8
cfa5c6dbc4669ce7450058c3873d30b1b4cbb087
refs/heads/main
2023-07-10T03:35:19.493574
2021-08-09T07:50:24
2021-08-09T07:50:24
394,197,542
0
3
null
null
null
null
UTF-8
Java
false
false
47,007
java
package tw.gov.ndc.emsg.mydata.entity; import java.util.ArrayList; import java.util.Date; import java.util.List; public class PortalResourceDownloadExample { /** * This field was generated by MyBatis Generator. This field corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ protected String orderByClause; /** * This field was generated by MyBatis Generator. This field corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ protected boolean distinct; /** * This field was generated by MyBatis Generator. This field corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ protected List<Criteria> oredCriteria; /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public PortalResourceDownloadExample() { oredCriteria = new ArrayList<Criteria>(); } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public String getOrderByClause() { return orderByClause; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public void setDistinct(boolean distinct) { this.distinct = distinct; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public boolean isDistinct() { return distinct; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public List<Criteria> getOredCriteria() { return oredCriteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public void or(Criteria criteria) { oredCriteria.add(criteria); } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } /** * This method was generated by MyBatis Generator. This method corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } /** * This class was generated by MyBatis Generator. This class corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ 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 andDownloadSnIsNull() { addCriterion("download_sn is null"); return (Criteria) this; } public Criteria andDownloadSnIsNotNull() { addCriterion("download_sn is not null"); return (Criteria) this; } public Criteria andDownloadSnEqualTo(String value) { addCriterion("download_sn =", value, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnNotEqualTo(String value) { addCriterion("download_sn <>", value, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnGreaterThan(String value) { addCriterion("download_sn >", value, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnGreaterThanOrEqualTo(String value) { addCriterion("download_sn >=", value, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnLessThan(String value) { addCriterion("download_sn <", value, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnLessThanOrEqualTo(String value) { addCriterion("download_sn <=", value, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnLike(String value) { addCriterion("download_sn like", value, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnNotLike(String value) { addCriterion("download_sn not like", value, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnIn(List<String> values) { addCriterion("download_sn in", values, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnNotIn(List<String> values) { addCriterion("download_sn not in", values, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnBetween(String value1, String value2) { addCriterion("download_sn between", value1, value2, "downloadSn"); return (Criteria) this; } public Criteria andDownloadSnNotBetween(String value1, String value2) { addCriterion("download_sn not between", value1, value2, "downloadSn"); return (Criteria) this; } public Criteria andProviderKeyIsNull() { addCriterion("provider_key is null"); return (Criteria) this; } public Criteria andProviderKeyIsNotNull() { addCriterion("provider_key is not null"); return (Criteria) this; } public Criteria andProviderKeyEqualTo(String value) { addCriterion("provider_key =", value, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyNotEqualTo(String value) { addCriterion("provider_key <>", value, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyGreaterThan(String value) { addCriterion("provider_key >", value, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyGreaterThanOrEqualTo(String value) { addCriterion("provider_key >=", value, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyLessThan(String value) { addCriterion("provider_key <", value, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyLessThanOrEqualTo(String value) { addCriterion("provider_key <=", value, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyLike(String value) { addCriterion("provider_key like", value, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyNotLike(String value) { addCriterion("provider_key not like", value, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyIn(List<String> values) { addCriterion("provider_key in", values, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyNotIn(List<String> values) { addCriterion("provider_key not in", values, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyBetween(String value1, String value2) { addCriterion("provider_key between", value1, value2, "providerKey"); return (Criteria) this; } public Criteria andProviderKeyNotBetween(String value1, String value2) { addCriterion("provider_key not between", value1, value2, "providerKey"); return (Criteria) this; } public Criteria andPrIdIsNull() { addCriterion("pr_id is null"); return (Criteria) this; } public Criteria andPrIdIsNotNull() { addCriterion("pr_id is not null"); return (Criteria) this; } public Criteria andPrIdEqualTo(Integer value) { addCriterion("pr_id =", value, "prId"); return (Criteria) this; } public Criteria andPrIdNotEqualTo(Integer value) { addCriterion("pr_id <>", value, "prId"); return (Criteria) this; } public Criteria andPrIdGreaterThan(Integer value) { addCriterion("pr_id >", value, "prId"); return (Criteria) this; } public Criteria andPrIdGreaterThanOrEqualTo(Integer value) { addCriterion("pr_id >=", value, "prId"); return (Criteria) this; } public Criteria andPrIdLessThan(Integer value) { addCriterion("pr_id <", value, "prId"); return (Criteria) this; } public Criteria andPrIdLessThanOrEqualTo(Integer value) { addCriterion("pr_id <=", value, "prId"); return (Criteria) this; } public Criteria andPrIdIn(List<Integer> values) { addCriterion("pr_id in", values, "prId"); return (Criteria) this; } public Criteria andPrIdNotIn(List<Integer> values) { addCriterion("pr_id not in", values, "prId"); return (Criteria) this; } public Criteria andPrIdBetween(Integer value1, Integer value2) { addCriterion("pr_id between", value1, value2, "prId"); return (Criteria) this; } public Criteria andPrIdNotBetween(Integer value1, Integer value2) { addCriterion("pr_id not between", value1, value2, "prId"); return (Criteria) this; } public Criteria andFilesIsNull() { addCriterion("files is null"); return (Criteria) this; } public Criteria andFilesIsNotNull() { addCriterion("files is not null"); return (Criteria) this; } public Criteria andFilesEqualTo(String value) { addCriterion("files =", value, "files"); return (Criteria) this; } public Criteria andFilesNotEqualTo(String value) { addCriterion("files <>", value, "files"); return (Criteria) this; } public Criteria andFilesGreaterThan(String value) { addCriterion("files >", value, "files"); return (Criteria) this; } public Criteria andFilesGreaterThanOrEqualTo(String value) { addCriterion("files >=", value, "files"); return (Criteria) this; } public Criteria andFilesLessThan(String value) { addCriterion("files <", value, "files"); return (Criteria) this; } public Criteria andFilesLessThanOrEqualTo(String value) { addCriterion("files <=", value, "files"); return (Criteria) this; } public Criteria andFilesLike(String value) { addCriterion("files like", value, "files"); return (Criteria) this; } public Criteria andFilesNotLike(String value) { addCriterion("files not like", value, "files"); return (Criteria) this; } public Criteria andFilesIn(List<String> values) { addCriterion("files in", values, "files"); return (Criteria) this; } public Criteria andFilesNotIn(List<String> values) { addCriterion("files not in", values, "files"); return (Criteria) this; } public Criteria andFilesBetween(String value1, String value2) { addCriterion("files between", value1, value2, "files"); return (Criteria) this; } public Criteria andFilesNotBetween(String value1, String value2) { addCriterion("files not between", value1, value2, "files"); return (Criteria) this; } public Criteria andWaitTimeIsNull() { addCriterion("wait_time is null"); return (Criteria) this; } public Criteria andWaitTimeIsNotNull() { addCriterion("wait_time is not null"); return (Criteria) this; } public Criteria andWaitTimeEqualTo(Integer value) { addCriterion("wait_time =", value, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeNotEqualTo(Integer value) { addCriterion("wait_time <>", value, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeGreaterThan(Integer value) { addCriterion("wait_time >", value, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeGreaterThanOrEqualTo(Integer value) { addCriterion("wait_time >=", value, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeLessThan(Integer value) { addCriterion("wait_time <", value, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeLessThanOrEqualTo(Integer value) { addCriterion("wait_time <=", value, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeIn(List<Integer> values) { addCriterion("wait_time in", values, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeNotIn(List<Integer> values) { addCriterion("wait_time not in", values, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeBetween(Integer value1, Integer value2) { addCriterion("wait_time between", value1, value2, "waitTime"); return (Criteria) this; } public Criteria andWaitTimeNotBetween(Integer value1, Integer value2) { addCriterion("wait_time not between", value1, value2, "waitTime"); return (Criteria) this; } public Criteria andCtimeIsNull() { addCriterion("ctime is null"); return (Criteria) this; } public Criteria andCtimeIsNotNull() { addCriterion("ctime is not null"); return (Criteria) this; } public Criteria andCtimeEqualTo(Date value) { addCriterion("ctime =", value, "ctime"); return (Criteria) this; } public Criteria andCtimeNotEqualTo(Date value) { addCriterion("ctime <>", value, "ctime"); return (Criteria) this; } public Criteria andCtimeGreaterThan(Date value) { addCriterion("ctime >", value, "ctime"); return (Criteria) this; } public Criteria andCtimeGreaterThanOrEqualTo(Date value) { addCriterion("ctime >=", value, "ctime"); return (Criteria) this; } public Criteria andCtimeLessThan(Date value) { addCriterion("ctime <", value, "ctime"); return (Criteria) this; } public Criteria andCtimeLessThanOrEqualTo(Date value) { addCriterion("ctime <=", value, "ctime"); return (Criteria) this; } public Criteria andCtimeIn(List<Date> values) { addCriterion("ctime in", values, "ctime"); return (Criteria) this; } public Criteria andCtimeNotIn(List<Date> values) { addCriterion("ctime not in", values, "ctime"); return (Criteria) this; } public Criteria andCtimeBetween(Date value1, Date value2) { addCriterion("ctime between", value1, value2, "ctime"); return (Criteria) this; } public Criteria andCtimeNotBetween(Date value1, Date value2) { addCriterion("ctime not between", value1, value2, "ctime"); return (Criteria) this; } public Criteria andStatIsNull() { addCriterion("stat is null"); return (Criteria) this; } public Criteria andStatIsNotNull() { addCriterion("stat is not null"); return (Criteria) this; } public Criteria andStatEqualTo(Integer value) { addCriterion("stat =", value, "stat"); return (Criteria) this; } public Criteria andStatNotEqualTo(Integer value) { addCriterion("stat <>", value, "stat"); return (Criteria) this; } public Criteria andStatGreaterThan(Integer value) { addCriterion("stat >", value, "stat"); return (Criteria) this; } public Criteria andStatGreaterThanOrEqualTo(Integer value) { addCriterion("stat >=", value, "stat"); return (Criteria) this; } public Criteria andStatLessThan(Integer value) { addCriterion("stat <", value, "stat"); return (Criteria) this; } public Criteria andStatLessThanOrEqualTo(Integer value) { addCriterion("stat <=", value, "stat"); return (Criteria) this; } public Criteria andStatIn(List<Integer> values) { addCriterion("stat in", values, "stat"); return (Criteria) this; } public Criteria andStatNotIn(List<Integer> values) { addCriterion("stat not in", values, "stat"); return (Criteria) this; } public Criteria andStatBetween(Integer value1, Integer value2) { addCriterion("stat between", value1, value2, "stat"); return (Criteria) this; } public Criteria andStatNotBetween(Integer value1, Integer value2) { addCriterion("stat not between", value1, value2, "stat"); return (Criteria) this; } public Criteria andDtimeIsNull() { addCriterion("dtime is null"); return (Criteria) this; } public Criteria andDtimeIsNotNull() { addCriterion("dtime is not null"); return (Criteria) this; } public Criteria andDtimeEqualTo(Date value) { addCriterion("dtime =", value, "dtime"); return (Criteria) this; } public Criteria andDtimeNotEqualTo(Date value) { addCriterion("dtime <>", value, "dtime"); return (Criteria) this; } public Criteria andDtimeGreaterThan(Date value) { addCriterion("dtime >", value, "dtime"); return (Criteria) this; } public Criteria andDtimeGreaterThanOrEqualTo(Date value) { addCriterion("dtime >=", value, "dtime"); return (Criteria) this; } public Criteria andDtimeLessThan(Date value) { addCriterion("dtime <", value, "dtime"); return (Criteria) this; } public Criteria andDtimeLessThanOrEqualTo(Date value) { addCriterion("dtime <=", value, "dtime"); return (Criteria) this; } public Criteria andDtimeIn(List<Date> values) { addCriterion("dtime in", values, "dtime"); return (Criteria) this; } public Criteria andDtimeNotIn(List<Date> values) { addCriterion("dtime not in", values, "dtime"); return (Criteria) this; } public Criteria andDtimeBetween(Date value1, Date value2) { addCriterion("dtime between", value1, value2, "dtime"); return (Criteria) this; } public Criteria andDtimeNotBetween(Date value1, Date value2) { addCriterion("dtime not between", value1, value2, "dtime"); return (Criteria) this; } public Criteria andBatchIdIsNull() { addCriterion("batch_id is null"); return (Criteria) this; } public Criteria andBatchIdIsNotNull() { addCriterion("batch_id is not null"); return (Criteria) this; } public Criteria andBatchIdEqualTo(Integer value) { addCriterion("batch_id =", value, "batchId"); return (Criteria) this; } public Criteria andBatchIdNotEqualTo(Integer value) { addCriterion("batch_id <>", value, "batchId"); return (Criteria) this; } public Criteria andBatchIdGreaterThan(Integer value) { addCriterion("batch_id >", value, "batchId"); return (Criteria) this; } public Criteria andBatchIdGreaterThanOrEqualTo(Integer value) { addCriterion("batch_id >=", value, "batchId"); return (Criteria) this; } public Criteria andBatchIdLessThan(Integer value) { addCriterion("batch_id <", value, "batchId"); return (Criteria) this; } public Criteria andBatchIdLessThanOrEqualTo(Integer value) { addCriterion("batch_id <=", value, "batchId"); return (Criteria) this; } public Criteria andBatchIdIn(List<Integer> values) { addCriterion("batch_id in", values, "batchId"); return (Criteria) this; } public Criteria andBatchIdNotIn(List<Integer> values) { addCriterion("batch_id not in", values, "batchId"); return (Criteria) this; } public Criteria andBatchIdBetween(Integer value1, Integer value2) { addCriterion("batch_id between", value1, value2, "batchId"); return (Criteria) this; } public Criteria andBatchIdNotBetween(Integer value1, Integer value2) { addCriterion("batch_id not between", value1, value2, "batchId"); return (Criteria) this; } public Criteria andEmailIsNull() { addCriterion("email is null"); return (Criteria) this; } public Criteria andEmailIsNotNull() { addCriterion("email is not null"); return (Criteria) this; } public Criteria andEmailEqualTo(String value) { addCriterion("email =", value, "email"); return (Criteria) this; } public Criteria andEmailNotEqualTo(String value) { addCriterion("email <>", value, "email"); return (Criteria) this; } public Criteria andEmailGreaterThan(String value) { addCriterion("email >", value, "email"); return (Criteria) this; } public Criteria andEmailGreaterThanOrEqualTo(String value) { addCriterion("email >=", value, "email"); return (Criteria) this; } public Criteria andEmailLessThan(String value) { addCriterion("email <", value, "email"); return (Criteria) this; } public Criteria andEmailLessThanOrEqualTo(String value) { addCriterion("email <=", value, "email"); return (Criteria) this; } public Criteria andEmailLike(String value) { addCriterion("email like", value, "email"); return (Criteria) this; } public Criteria andEmailNotLike(String value) { addCriterion("email not like", value, "email"); return (Criteria) this; } public Criteria andEmailIn(List<String> values) { addCriterion("email in", values, "email"); return (Criteria) this; } public Criteria andEmailNotIn(List<String> values) { addCriterion("email not in", values, "email"); return (Criteria) this; } public Criteria andEmailBetween(String value1, String value2) { addCriterion("email between", value1, value2, "email"); return (Criteria) this; } public Criteria andEmailNotBetween(String value1, String value2) { addCriterion("email not between", value1, value2, "email"); return (Criteria) this; } public Criteria andCodeIsNull() { addCriterion("code is null"); return (Criteria) this; } public Criteria andCodeIsNotNull() { addCriterion("code is not null"); return (Criteria) this; } public Criteria andCodeEqualTo(String value) { addCriterion("code =", value, "code"); return (Criteria) this; } public Criteria andCodeNotEqualTo(String value) { addCriterion("code <>", value, "code"); return (Criteria) this; } public Criteria andCodeGreaterThan(String value) { addCriterion("code >", value, "code"); return (Criteria) this; } public Criteria andCodeGreaterThanOrEqualTo(String value) { addCriterion("code >=", value, "code"); return (Criteria) this; } public Criteria andCodeLessThan(String value) { addCriterion("code <", value, "code"); return (Criteria) this; } public Criteria andCodeLessThanOrEqualTo(String value) { addCriterion("code <=", value, "code"); return (Criteria) this; } public Criteria andCodeLike(String value) { addCriterion("code like", value, "code"); return (Criteria) this; } public Criteria andCodeNotLike(String value) { addCriterion("code not like", value, "code"); return (Criteria) this; } public Criteria andCodeIn(List<String> values) { addCriterion("code in", values, "code"); return (Criteria) this; } public Criteria andCodeNotIn(List<String> values) { addCriterion("code not in", values, "code"); return (Criteria) this; } public Criteria andCodeBetween(String value1, String value2) { addCriterion("code between", value1, value2, "code"); return (Criteria) this; } public Criteria andCodeNotBetween(String value1, String value2) { addCriterion("code not between", value1, value2, "code"); return (Criteria) this; } public Criteria andTransactionUidIsNull() { addCriterion("transaction_uid is null"); return (Criteria) this; } public Criteria andTransactionUidIsNotNull() { addCriterion("transaction_uid is not null"); return (Criteria) this; } public Criteria andTransactionUidEqualTo(String value) { addCriterion("transaction_uid =", value, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidNotEqualTo(String value) { addCriterion("transaction_uid <>", value, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidGreaterThan(String value) { addCriterion("transaction_uid >", value, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidGreaterThanOrEqualTo(String value) { addCriterion("transaction_uid >=", value, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidLessThan(String value) { addCriterion("transaction_uid <", value, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidLessThanOrEqualTo(String value) { addCriterion("transaction_uid <=", value, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidLike(String value) { addCriterion("transaction_uid like", value, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidNotLike(String value) { addCriterion("transaction_uid not like", value, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidIn(List<String> values) { addCriterion("transaction_uid in", values, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidNotIn(List<String> values) { addCriterion("transaction_uid not in", values, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidBetween(String value1, String value2) { addCriterion("transaction_uid between", value1, value2, "transactionUid"); return (Criteria) this; } public Criteria andTransactionUidNotBetween(String value1, String value2) { addCriterion("transaction_uid not between", value1, value2, "transactionUid"); return (Criteria) this; } public Criteria andDownloadTypeIsNull() { addCriterion("download_type is null"); return (Criteria) this; } public Criteria andDownloadTypeIsNotNull() { addCriterion("download_type is not null"); return (Criteria) this; } public Criteria andDownloadTypeEqualTo(String value) { addCriterion("download_type =", value, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeNotEqualTo(String value) { addCriterion("download_type <>", value, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeGreaterThan(String value) { addCriterion("download_type >", value, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeGreaterThanOrEqualTo(String value) { addCriterion("download_type >=", value, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeLessThan(String value) { addCriterion("download_type <", value, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeLessThanOrEqualTo(String value) { addCriterion("download_type <=", value, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeLike(String value) { addCriterion("download_type like", value, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeNotLike(String value) { addCriterion("download_type not like", value, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeIn(List<String> values) { addCriterion("download_type in", values, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeNotIn(List<String> values) { addCriterion("download_type not in", values, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeBetween(String value1, String value2) { addCriterion("download_type between", value1, value2, "downloadType"); return (Criteria) this; } public Criteria andDownloadTypeNotBetween(String value1, String value2) { addCriterion("download_type not between", value1, value2, "downloadType"); return (Criteria) this; } public Criteria andPreviewCountIsNull() { addCriterion("preview_count is null"); return (Criteria) this; } public Criteria andPreviewCountIsNotNull() { addCriterion("preview_count is not null"); return (Criteria) this; } public Criteria andPreviewCountEqualTo(Integer value) { addCriterion("preview_count =", value, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountNotEqualTo(Integer value) { addCriterion("preview_count <>", value, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountGreaterThan(Integer value) { addCriterion("preview_count >", value, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountGreaterThanOrEqualTo(Integer value) { addCriterion("preview_count >=", value, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountLessThan(Integer value) { addCriterion("preview_count <", value, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountLessThanOrEqualTo(Integer value) { addCriterion("preview_count <=", value, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountIn(List<Integer> values) { addCriterion("preview_count in", values, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountNotIn(List<Integer> values) { addCriterion("preview_count not in", values, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountBetween(Integer value1, Integer value2) { addCriterion("preview_count between", value1, value2, "previewCount"); return (Criteria) this; } public Criteria andPreviewCountNotBetween(Integer value1, Integer value2) { addCriterion("preview_count not between", value1, value2, "previewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountIsNull() { addCriterion("verification_preview_count is null"); return (Criteria) this; } public Criteria andVerificationPreviewCountIsNotNull() { addCriterion("verification_preview_count is not null"); return (Criteria) this; } public Criteria andVerificationPreviewCountEqualTo(Integer value) { addCriterion("verification_preview_count =", value, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountNotEqualTo(Integer value) { addCriterion("verification_preview_count <>", value, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountGreaterThan(Integer value) { addCriterion("verification_preview_count >", value, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountGreaterThanOrEqualTo(Integer value) { addCriterion("verification_preview_count >=", value, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountLessThan(Integer value) { addCriterion("verification_preview_count <", value, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountLessThanOrEqualTo(Integer value) { addCriterion("verification_preview_count <=", value, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountIn(List<Integer> values) { addCriterion("verification_preview_count in", values, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountNotIn(List<Integer> values) { addCriterion("verification_preview_count not in", values, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountBetween(Integer value1, Integer value2) { addCriterion("verification_preview_count between", value1, value2, "verificationPreviewCount"); return (Criteria) this; } public Criteria andVerificationPreviewCountNotBetween(Integer value1, Integer value2) { addCriterion("verification_preview_count not between", value1, value2, "verificationPreviewCount"); return (Criteria) this; } public Criteria andServerDownloadTimeIsNull() { addCriterion("server_download_time is null"); return (Criteria) this; } public Criteria andServerDownloadTimeIsNotNull() { addCriterion("server_download_time is not null"); return (Criteria) this; } public Criteria andServerDownloadTimeEqualTo(Date value) { addCriterion("server_download_time =", value, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeNotEqualTo(Date value) { addCriterion("server_download_time <>", value, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeGreaterThan(Date value) { addCriterion("server_download_time >", value, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeGreaterThanOrEqualTo(Date value) { addCriterion("server_download_time >=", value, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeLessThan(Date value) { addCriterion("server_download_time <", value, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeLessThanOrEqualTo(Date value) { addCriterion("server_download_time <=", value, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeIn(List<Date> values) { addCriterion("server_download_time in", values, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeNotIn(List<Date> values) { addCriterion("server_download_time not in", values, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeBetween(Date value1, Date value2) { addCriterion("server_download_time between", value1, value2, "serverDownloadTime"); return (Criteria) this; } public Criteria andServerDownloadTimeNotBetween(Date value1, Date value2) { addCriterion("server_download_time not between", value1, value2, "serverDownloadTime"); return (Criteria) this; } public Criteria andDownloadTimeIsNull() { addCriterion("download_time is null"); return (Criteria) this; } public Criteria andDownloadTimeIsNotNull() { addCriterion("download_time is not null"); return (Criteria) this; } public Criteria andDownloadTimeEqualTo(Date value) { addCriterion("download_time =", value, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeNotEqualTo(Date value) { addCriterion("download_time <>", value, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeGreaterThan(Date value) { addCriterion("download_time >", value, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeGreaterThanOrEqualTo(Date value) { addCriterion("download_time >=", value, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeLessThan(Date value) { addCriterion("download_time <", value, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeLessThanOrEqualTo(Date value) { addCriterion("download_time <=", value, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeIn(List<Date> values) { addCriterion("download_time in", values, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeNotIn(List<Date> values) { addCriterion("download_time not in", values, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeBetween(Date value1, Date value2) { addCriterion("download_time between", value1, value2, "downloadTime"); return (Criteria) this; } public Criteria andDownloadTimeNotBetween(Date value1, Date value2) { addCriterion("download_time not between", value1, value2, "downloadTime"); return (Criteria) this; } public Criteria andRequestStatusIsNull() { addCriterion("request_status is null"); return (Criteria) this; } public Criteria andRequestStatusIsNotNull() { addCriterion("request_status is not null"); return (Criteria) this; } public Criteria andRequestStatusEqualTo(String value) { addCriterion("request_status =", value, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusNotEqualTo(String value) { addCriterion("request_status <>", value, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusGreaterThan(String value) { addCriterion("request_status >", value, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusGreaterThanOrEqualTo(String value) { addCriterion("request_status >=", value, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusLessThan(String value) { addCriterion("request_status <", value, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusLessThanOrEqualTo(String value) { addCriterion("request_status <=", value, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusLike(String value) { addCriterion("request_status like", value, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusNotLike(String value) { addCriterion("request_status not like", value, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusIn(List<String> values) { addCriterion("request_status in", values, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusNotIn(List<String> values) { addCriterion("request_status not in", values, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusBetween(String value1, String value2) { addCriterion("request_status between", value1, value2, "requestStatus"); return (Criteria) this; } public Criteria andRequestStatusNotBetween(String value1, String value2) { addCriterion("request_status not between", value1, value2, "requestStatus"); return (Criteria) this; } public Criteria andVerificationTypeIsNull() { addCriterion("verification_type is null"); return (Criteria) this; } public Criteria andVerificationTypeIsNotNull() { addCriterion("verification_type is not null"); return (Criteria) this; } public Criteria andVerificationTypeEqualTo(String value) { addCriterion("verification_type =", value, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeNotEqualTo(String value) { addCriterion("verification_type <>", value, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeGreaterThan(String value) { addCriterion("verification_type >", value, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeGreaterThanOrEqualTo(String value) { addCriterion("verification_type >=", value, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeLessThan(String value) { addCriterion("verification_type <", value, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeLessThanOrEqualTo(String value) { addCriterion("verification_type <=", value, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeLike(String value) { addCriterion("verification_type like", value, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeNotLike(String value) { addCriterion("verification_type not like", value, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeIn(List<String> values) { addCriterion("verification_type in", values, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeNotIn(List<String> values) { addCriterion("verification_type not in", values, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeBetween(String value1, String value2) { addCriterion("verification_type between", value1, value2, "verificationType"); return (Criteria) this; } public Criteria andVerificationTypeNotBetween(String value1, String value2) { addCriterion("verification_type not between", value1, value2, "verificationType"); return (Criteria) this; } public Criteria andResponseTimeIsNull() { addCriterion("response_time is null"); return (Criteria) this; } public Criteria andResponseTimeIsNotNull() { addCriterion("response_time is not null"); return (Criteria) this; } public Criteria andResponseTimeEqualTo(Integer value) { addCriterion("response_time =", value, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeNotEqualTo(Integer value) { addCriterion("response_time <>", value, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeGreaterThan(Integer value) { addCriterion("response_time >", value, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeGreaterThanOrEqualTo(Integer value) { addCriterion("response_time >=", value, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeLessThan(Integer value) { addCriterion("response_time <", value, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeLessThanOrEqualTo(Integer value) { addCriterion("response_time <=", value, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeIn(List<Integer> values) { addCriterion("response_time in", values, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeNotIn(List<Integer> values) { addCriterion("response_time not in", values, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeBetween(Integer value1, Integer value2) { addCriterion("response_time between", value1, value2, "responseTime"); return (Criteria) this; } public Criteria andResponseTimeNotBetween(Integer value1, Integer value2) { addCriterion("response_time not between", value1, value2, "responseTime"); return (Criteria) this; } public Criteria andPsdIdIsNull() { addCriterion("psd_id is null"); return (Criteria) this; } public Criteria andPsdIdIsNotNull() { addCriterion("psd_id is not null"); return (Criteria) this; } public Criteria andPsdIdEqualTo(Integer value) { addCriterion("psd_id =", value, "psdId"); return (Criteria) this; } public Criteria andPsdIdNotEqualTo(Integer value) { addCriterion("psd_id <>", value, "psdId"); return (Criteria) this; } public Criteria andPsdIdGreaterThan(Integer value) { addCriterion("psd_id >", value, "psdId"); return (Criteria) this; } public Criteria andPsdIdGreaterThanOrEqualTo(Integer value) { addCriterion("psd_id >=", value, "psdId"); return (Criteria) this; } public Criteria andPsdIdLessThan(Integer value) { addCriterion("psd_id <", value, "psdId"); return (Criteria) this; } public Criteria andPsdIdLessThanOrEqualTo(Integer value) { addCriterion("psd_id <=", value, "psdId"); return (Criteria) this; } public Criteria andPsdIdIn(List<Integer> values) { addCriterion("psd_id in", values, "psdId"); return (Criteria) this; } public Criteria andPsdIdNotIn(List<Integer> values) { addCriterion("psd_id not in", values, "psdId"); return (Criteria) this; } public Criteria andPsdIdBetween(Integer value1, Integer value2) { addCriterion("psd_id between", value1, value2, "psdId"); return (Criteria) this; } public Criteria andPsdIdNotBetween(Integer value1, Integer value2) { addCriterion("psd_id not between", value1, value2, "psdId"); return (Criteria) this; } } /** * This class was generated by MyBatis Generator. This class corresponds to the database table portal_resource_download * @mbg.generated Mon Jun 08 15:49:20 CST 2020 */ 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); } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table portal_resource_download * * @mbg.generated do_not_delete_during_merge Wed Nov 20 13:58:26 CST 2019 */ public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } }
[ "82488195+jennyming622@users.noreply.github.com" ]
82488195+jennyming622@users.noreply.github.com
1ad48e469eaa4517a6b435e9a317729489dd02a4
c2aa75d93dea45d104cd8e17203e510a6f4e68c4
/src/client/feeder/Petter.java
410fe9b720febd38420111ba3f0f14806469a309
[]
no_license
manturovDan/NetCat
7084e2163477c5c7c8b835516ae9b86a76144524
3dd490563b8b25e365af9fd05fa7cfbe45b84237
refs/heads/master
2023-05-05T00:33:39.005911
2021-05-25T21:24:22
2021-05-25T21:24:22
370,692,773
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package client.feeder; import java.io.IOException; public class Petter { private static void interact() throws IOException { EchoPetter petter = new EchoPetter(); petter.startConnection("localhost", 6001); petter.sendMessage("hello server"); petter.stopConnection(); } public static void main(String[] args) throws IOException { interact(); } }
[ "manturov.dan@mail.ru" ]
manturov.dan@mail.ru
970b73f254a76d7e6570680321a5d069b71e5079
e5ad951a160852335c1e7e716f407393c23f1619
/libraries/CouchbaseLibFromDarioOld/app/src/main/java/com/couchbase/http/annotation/GuardedBy.java
77053b0d22336380ed7b46a82e23ef3facc49064
[]
no_license
alexmirash/CouchbaseVsSQLiteCipher
fee0a755a350f9b02e59efd424b938fb8f001c76
7533aacc5a0e4fd469333ef52b7679aebedd5dd0
refs/heads/master
2021-01-01T05:34:18.207472
2015-01-26T16:04:38
2015-01-26T16:04:38
29,732,986
0
0
null
null
null
null
UTF-8
Java
false
false
3,109
java
/* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package com.couchbase.http.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The field or method to which this annotation is applied can only be accessed * when holding a particular lock, which may be a built-in (synchronization) lock, * or may be an explicit java.util.concurrent.Lock. * * The argument determines which lock guards the annotated field or method: * <ul> * <li> * <code>this</code> : The intrinsic lock of the object in whose class the field is defined. * </li> * <li> * <code>class-name.this</code> : For inner classes, it may be necessary to disambiguate 'this'; * the <em>class-name.this</em> designation allows you to specify which 'this' reference is intended * </li> * <li> * <code>itself</code> : For reference fields only; the object to which the field refers. * </li> * <li> * <code>field-name</code> : The lock object is referenced by the (instance or static) field * specified by <em>field-name</em>. * </li> * <li> * <code>class-name.field-name</code> : The lock object is reference by the static field specified * by <em>class-name.field-name</em>. * </li> * <li> * <code>method-name()</code> : The lock object is returned by calling the named nil-ary method. * </li> * <li> * <code>class-name.class</code> : The Class object for the specified class should be used as the lock object. * </li> * <p> * Based on code developed by Brian Goetz and Tim Peierls and concepts * published in 'Java Concurrency in Practice' by Brian Goetz, Tim Peierls, * Joshua Bloch, Joseph Bowbeer, David Holmes and Doug Lea. */ @Documented @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.CLASS) // The original version used RUNTIME public @interface GuardedBy { String value(); }
[ "alex.mirash@gmail.com" ]
alex.mirash@gmail.com
60c6e30a46f1fd0de35971b4c200357c046ada47
37b6550e8196725dfc1dbecb0fbe09763f009480
/sw2-pos/src/main/java/com/luxsoft/siipap/pos/ui/venta/forms/PedidoDetFormModel.java
1c2f0aa5de047b3a752253ed50a1c5f332be019b
[]
no_license
rcancino/sw2
9509e5e2060923e882cb341d4c987e6f6eade69d
7d832ce1c28fdfb6efd21823411bae86d0cf2a91
refs/heads/master
2020-04-07T07:12:14.337028
2017-11-27T22:59:33
2017-11-27T22:59:33
14,619,759
0
3
null
null
null
null
ISO-8859-1
Java
false
false
8,714
java
package com.luxsoft.siipap.pos.ui.venta.forms; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.math.BigDecimal; import java.text.MessageFormat; import java.util.Comparator; import java.util.Date; import java.util.List; import java.util.Map; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.springframework.dao.DataAccessException; import ca.odell.glazedlists.BasicEventList; import ca.odell.glazedlists.EventList; import ca.odell.glazedlists.FilterList; import ca.odell.glazedlists.GlazedLists; import ca.odell.glazedlists.SortedList; import ca.odell.glazedlists.matchers.Matcher; import ca.odell.glazedlists.matchers.Matchers; import com.jgoodies.validation.util.PropertyValidationSupport; import com.luxsoft.siipap.inventarios.model.Existencia; import com.luxsoft.siipap.model.Sucursal; import com.luxsoft.siipap.model.core.Producto; import com.luxsoft.siipap.swing.controls.Header; import com.luxsoft.siipap.swing.form2.DefaultFormModel; import com.luxsoft.siipap.util.SQLUtils; import com.luxsoft.sw3.services.Services; import com.luxsoft.sw3.ventas.PedidoDet; public class PedidoDetFormModel extends DefaultFormModel implements PropertyChangeListener{ private EventList<Existencia> existencias; private Sucursal sucursal; private boolean credito=false; private Date fecha=new Date(); private Header header; private double existenciaTotal; public PedidoDetFormModel(PedidoDet bean) { super(bean); } protected void init(){ existencias=new BasicEventList<Existencia>(0); Matcher<Existencia> matcher=Matchers.beanPropertyMatcher(Existencia.class, "sucursal.habilitada", Boolean.TRUE); existencias=new FilterList<Existencia>(existencias,matcher); Comparator<Existencia> c2=GlazedLists.beanPropertyComparator(Existencia.class, "sucursal.clave"); existencias=new SortedList<Existencia>(existencias,GlazedLists.chainComparators(c2)); addBeanPropertyChangeListener(this); setSucursal(Services.getInstance().getConfiguracion().getSucursal()); setFecha(Services.getInstance().obtenerFechaDelSistema()); if(getProductio()!=null){ actualizarExistencias(); } } @Override protected void addValidation(PropertyValidationSupport support) { if(getPedidoDet().getCantidad()==0){ support.getResult().addError("La cantidad no puede ser 0"); }if(getPedidoDet().getProducto()!=null) if(getPedidoDet().getProducto().getPaquete()>1){ System.out.println("Validando paquete"); double cantidad=getPedidoDet().getCantidad(); double paquete=(double)getPedidoDet().getProducto().getPaquete(); double modulo=cantidad%paquete; System.out.println("Modulo: "+modulo); if(modulo!=0){ double faltante=paquete-modulo; support.getResult().addError("Este producto se vende en multiplos de: "+getPedidoDet().getProducto().getPaquete()+ " Faltante: "+faltante); } } } public void dispose(){ removeBeanPropertyChangeListener(this); } protected Producto getProductio(){ return (Producto)getValue("producto"); } protected PedidoDet getPedidoDet(){ return (PedidoDet)getBaseBean(); } private void actualizarPrecio(){ double precio=getProductio().getPrecioContado(); if(isCredito()) precio=getProductio().getPrecioCredito(); setValue("precio", BigDecimal.valueOf(precio)); } private void actualizarMedidasDeCorte(){ if(1==1) //DEBUG por ERRORES return; if(getPedidoDet().getCorteLargo()>0){ if(getPedidoDet().getCorteAncho()>0){ } } if(getPedidoDet().getCorteAncho()>0){ if(getPedidoDet().getCorteLargo()>0){ try { double largo=getPedidoDet().getCorteLargo(); double ancho=getPedidoDet().getCorteAncho(); double minimo=Math.min(getPedidoDet().getCorteLargo(), getPedidoDet().getCorteAncho()); //System.out.println("Evaluando cortes para largo: "+largo+ " Ancho: "+ancho); String clave=getPedidoDet().getClave(); String sql=SQLUtils.loadSQLQueryFromResource("sql/calculoDeCortes.sql"); sql=sql.replaceAll("@PRODUCTO","\'"+clave+"\'" ); sql=sql.replaceAll("@MEDIDA", String.valueOf(minimo)); //System.out.println("SQL para cortes: "+sql); List<Map<String, Object>> rows=Services.getInstance() .getJdbcTemplate().queryForList(sql); //System.out.println("Res: "+rows); if(!rows.isEmpty()){ Map<String,Object> row=rows.get(0); Number cortes=(Number)row.get("CORTES"); if(cortes==null) return; Number pcontado=(Number)row.get("PRECIO_CONTADO"); Number pcredito=(Number)row.get("PRECIO_CREDITO"); Number maximoHojas=(Number)row.get("maximo_hojas"); if(maximoHojas==null){ //System.out.println("Error en sql para la columna maximo_hojas es nulo: "+sql); return; } BigDecimal precio=BigDecimal.valueOf(pcontado.doubleValue()); if(isCredito()){ precio=BigDecimal.valueOf(pcredito.doubleValue()); } int cantidad=(int)getPedidoDet().getCantidad(); int res=cantidad/maximoHojas.intValue(); if(cantidad%maximoHojas.intValue()>0) res+=1; res=res*cortes.intValue(); getPedidoDet().setCortes(res); getPedidoDet().setPrecioCorte(precio); } } catch (DataAccessException e) { e.printStackTrace(); } } } } protected void actualizarExistencias(){ existencias.clear(); existencias.addAll(Services.getInstance() .getExistenciasDao() .buscarExistencias(getPedidoDet().getProducto(), getFecha()) ); existenciaTotal=0; for(Existencia e:existencias){ existenciaTotal+=e.getCantidad(); } } public EventList<Existencia> getExistencias() { return existencias; } public double getExistencia(){ Existencia res= (Existencia)CollectionUtils.find(getExistencias(), new Predicate(){ public boolean evaluate(Object object) { Existencia exis=(Existencia)object; return exis.getSucursal().equals(getSucursal()); } }); //System.out.println("Existencia localizada: "+res); double exi= res!=null?res.getDisponible():0.0; //System.out.println("Existencia detectada: "+exi); return exi; } public boolean isCredito() { return credito; } public void setCredito(boolean credito) { this.credito = credito; } public void updateHeader() { if(header!=null){ Producto p=getProductio(); if(p!=null){ header.setTitulo(MessageFormat.format("{0} ({1})",p.getDescripcion(),p.getClave())); String pattern="Uni:{0}\t Ancho:{1}\tLargo:{2}\t Calibre:{3}" + "\nAcabado:{4}\t Caras:{5}\tPrecio:{6}" + "\nCrédito: {7,number,currency}\tContado: {8,number,currency} " + "\n\nExistencias Sucursal:{9,number,#,###,###} Total: {10,number,#,###,###}" ; String desc=MessageFormat.format(pattern ,p.getUnidad().getNombre() ,p.getAncho() ,p.getLargo() ,p.getCalibre() ,p.getAcabado() ,p.getCaras() ,p.getModoDeVenta()!=null?(p.getModoDeVenta().equals("B")?"Bruto":"Neto"):"" ,p.getPrecioCredito() ,p.getPrecioContado() ,getExistencia() ,this.existenciaTotal ); if(p.getPaquete()>1) desc+=" Paquete: "+p.getPaquete(); header.setDescripcion(desc); } else{ header.setTitulo("Seleccione un producto"); header.setDescripcion(""); } } } public void propertyChange(PropertyChangeEvent evt) { if(evt.getPropertyName().equals("producto")){ actualizarExistencias(); actualizarPrecio(); updateHeader(); }else if("cantidad".equals(evt.getPropertyName())){ getPedidoDet().actualizar(); }else if("corteLargo".equals(evt.getPropertyName())){ actualizarMedidasDeCorte(); }else if("corteAncho".equals(evt.getPropertyName())){ actualizarMedidasDeCorte(); }else if("cortes".equals(evt.getPropertyName())){ getPedidoDet().actualizar(); }else if("precioCorte".equals(evt.getPropertyName())){ getPedidoDet().actualizar(); } } public Sucursal getSucursal() { return sucursal; } public void setSucursal(Sucursal sucursal) { this.sucursal = sucursal; } public Date getFecha() { return fecha; } public void setFecha(Date fecha) { this.fecha = fecha; } public Header getHeader() { if(header==null){ header=new Header("Seleccione un producto",""); header.setDescRows(5); updateHeader(); } return header; } }
[ "rubencancino6@gmail.com" ]
rubencancino6@gmail.com
a5bd886589813caf899b2643902dafc20ac4c51d
14aef6d59d3f79901dad2ef6953db4f3b8a58e06
/src/com/kesd/action/dyjc/ActCardReadInfo.java
21524d464bd2cc01e01998663af3fe414d62b1f5
[]
no_license
17734576784/sdweb_sts_f
972aac5371bbb25c93190efecc7cec4c63405672
ea23d2b13f4f5b158155f1fa404100a9f264b58e
refs/heads/master
2021-02-09T05:39:05.281360
2020-03-06T03:55:23
2020-03-06T03:55:23
244,246,842
0
0
null
null
null
null
UTF-8
Java
false
false
7,527
java
package com.kesd.action.dyjc; import java.util.ArrayList; import net.sf.json.JSONObject; import com.libweb.common.CommBase; import com.libweb.comnt.ComntFunc; import com.libweb.comnt.ComntVector; import com.kesd.common.CommCardWrt; import com.kesd.common.CommFunc; import com.kesd.common.Dict; import com.kesd.common.SDDef; import com.kesd.comnt.ComntDef; import com.kesd.comnt.ComntMsg; import com.kesd.comnt.ComntMsgDy; import com.kesd.comnt.ComntProtMsg; import com.kesd.comntpara.ComntParaBase; import com.kesd.comntpara.ComntUseropDef; import com.kesd.util.Rd; public class ActCardReadInfo { private static final long serialVersionUID = 3607391502741009698L; private String userData1 = null; //RTU_ID private String userData2 = null; //USEROP_ID private String result = null; //SUCCESS/FAIL private String detailInfo = null; private String userInfo = null; private String firstLastFlag = null; private String err_strinfo = null; private String mpid = null; private String gsmflag = null; private String dyOperGParaState = null; //低压操作-获得预付费参数及状态 public String taskProc(){ ComntParaBase.OpDetailInfo op_detail = new ComntParaBase.OpDetailInfo(); StringBuffer err_str_1 = new StringBuffer(); ComntParaBase.SALEMAN_TASK_RESULT_DETAIL task_result_detail = new ComntParaBase.SALEMAN_TASK_RESULT_DETAIL(); if (result == null) { result = SDDef.FAIL; return SDDef.SUCCESS; } CommCardWrt.MET_RES_MP met_res_mp = CommCardWrt.loadMetResMpPara(result); JSONObject j_obj = new JSONObject(); j_obj.put("cons_no", String.valueOf(result)); j_obj.put("meter_no", String.valueOf(met_res_mp==null?"":met_res_mp.meter_no)); j_obj.put("cons_desc", String.valueOf(met_res_mp==null?"":met_res_mp.cons_desc)); j_obj.put("cons_addr", String.valueOf(met_res_mp==null?"":met_res_mp.cons_addr)); j_obj.put("cons_telno", String.valueOf(met_res_mp==null?"":met_res_mp.cons_telno)); j_obj.put("pt_n", met_res_mp==null?"":met_res_mp.pt_n); j_obj.put("pt_d", met_res_mp==null?"":met_res_mp.pt_d); j_obj.put("pt", met_res_mp==null?"":met_res_mp.pt); j_obj.put("ct_n", met_res_mp==null?"":met_res_mp.ct_n); j_obj.put("ct_d", met_res_mp==null?"":met_res_mp.ct_d); j_obj.put("ct", met_res_mp==null?"":met_res_mp.ct); j_obj.put("rtu_id", met_res_mp==null?"":met_res_mp.rtu_id); j_obj.put("mp_id", met_res_mp==null?"":met_res_mp.mp_id); if(met_res_mp == null){ userInfo = j_obj.toString(); result = SDDef.FAIL; return SDDef.SUCCESS; } int rtu_id = met_res_mp.rtu_id; short mp_id = met_res_mp.mp_id; int userop_id = CommBase.strtoi(userData2); ComntParaBase.RTU_PARA rtu_para = ComntParaBase.loadRtuActPara(rtu_id); if (rtu_para == null) { result = SDDef.FAIL; op_detail.addTaskInfo("ERR:无效的终端ID[" + rtu_id + "]"); detailInfo = op_detail.toJsonString(); return SDDef.SUCCESS; } String user_name = ComntParaBase.getUserName(); String ret_val = SDDef.FAIL; if (userop_id == ComntUseropDef.YFF_DYOPER_GPARASTATE) { //低压操作-获得预付费参数及状态 String firstlast_str = firstLastFlag.trim(); boolean first_flag = (firstlast_str.compareToIgnoreCase(SDDef.TRUE) == 0); ret_val = DYGetPayParaState(user_name, rtu_para, mp_id, first_flag, op_detail, err_str_1, task_result_detail); } else { op_detail.addTaskInfo("ERR:未知的操作类型[" + userop_id + "]"); } result = ret_val; userInfo = j_obj.toString(); err_strinfo = err_str_1.toString(); detailInfo = op_detail.toJsonString(); return SDDef.SUCCESS; } //低压操作-获得预付费参数及状态 private String DYGetPayParaState(String user_name, ComntParaBase.RTU_PARA rtu_para, short mp_id, boolean first_flag, ComntParaBase.OpDetailInfo op_detail, StringBuffer err_str_1, ComntParaBase.SALEMAN_TASK_RESULT_DETAIL task_result_detail) { int i_user_data1 = CommBase.strtoi(userData1); //RTU ID int i_user_data2 = CommBase.strtoi(userData2); //USEROPER ID int i = 0; boolean ret_val = false; //发送 if (first_flag) { //20131019 ComntMsgDy.MSG_DYOPER_GETPARASTATE dyoper = new ComntMsgDy.MSG_DYOPER_GETPARASTATE(); dyoper.testf = 0; dyoper.gsmf = 0; dyoper.mpid = mp_id; ComntFunc.string2Byte(user_name, dyoper.operman); ComntVector.ByteVector task_data_vect = new ComntVector.ByteVector(); dyoper.toDataStream(task_data_vect); ret_val = ComntParaBase.sendNStepTask(ComntDef.SALEMANAGER_VERSION, user_name, i_user_data1, i_user_data2, rtu_para, (byte)ComntDef.YD_YFF_TASKAPPTYPE_DYOPER_GPARASTATE, (byte)ComntDef.YD_TASKASSIGNTYPE_MAN, task_data_vect, op_detail); if (!ret_val) { return SDDef.FAIL; } } //接受 byte []task_result = new byte[1]; task_result[0] = ComntDef.YD_YFF_TASKRESULT_NULL; ArrayList<ComntMsg.MSG_RESULT_DATA> ret_data_vect = new ArrayList<ComntMsg.MSG_RESULT_DATA>(); ret_val = ComntParaBase.getNStepTaskResult(user_name, i_user_data1, i_user_data2, rtu_para, task_result, ret_data_vect, op_detail, err_str_1, task_result_detail); dyOperGParaState = SDDef.EMPTY; if (ret_data_vect.size() > 0) { ComntMsg.MSG_RESULT_DATA msg_result_data = null; ComntProtMsg.YFF_DATA_DYOPER_PARASTATE dyoper_parastate = new ComntProtMsg.YFF_DATA_DYOPER_PARASTATE(); for (i = 0; i < ret_data_vect.size(); i++) { msg_result_data = ret_data_vect.get(i); if (msg_result_data.datatype == ComntProtMsg.YFF_DATATYPE_DYOPER_PARASTATE) { dyoper_parastate.fromDataStream(msg_result_data.data_vect, 0); dyOperGParaState = dyoper_parastate.toJsonString(); } } } if (ret_val) { if (task_result[0] != ComntDef.YD_YFF_TASKRESULT_NULL) firstLastFlag = SDDef.TRUE; else firstLastFlag = SDDef.FALSE; } return ret_val ? SDDef.SUCCESS : SDDef.FAIL; } public String getUserData1() { return userData1; } public void setUserData1(String userData1) { this.userData1 = userData1; } public String getUserData2() { return userData2; } public void setUserData2(String userData2) { this.userData2 = userData2; } public String getResult() { return result; } public void setResult(String result) { this.result = result; } public String getDetailInfo() { return detailInfo; } public void setDetailInfo(String detailInfo) { this.detailInfo = detailInfo; } public String getFirstLastFlag() { return firstLastFlag; } public void setFirstLastFlag(String firstLastFlag) { this.firstLastFlag = firstLastFlag; } public String getErr_strinfo() { return err_strinfo; } public void setErr_strinfo(String errStrinfo) { err_strinfo = errStrinfo; } public String getMpid() { return mpid; } public void setMpid(String mpid) { this.mpid = mpid; } public String getGsmflag() { return gsmflag; } public void setGsmflag(String gsmflag) { this.gsmflag = gsmflag; } public String getDyOperGParaState() { return dyOperGParaState; } public void setDyOperGParaState(String dyOperGParaState) { this.dyOperGParaState = dyOperGParaState; } public String getUserInfo() { return userInfo; } public void setUserInfo(String userInfo) { this.userInfo = userInfo; } }
[ "Administrator@BY-201904200956" ]
Administrator@BY-201904200956
04af4eafd24af9ca3ff0f23214a7d9ea6bd83339
fde2bcd8dae7d8c820985ded6e92212edb0c1541
/app/src/main/java/com/docscan/st/interfaces/PhotoSavedListener.java
f69eafd864db414c775db1ae92733c1b3e42fc8c
[]
no_license
Hiteshx13/DocScan
ec7aa45b29b91fa4152e4f60be54e5a3ecb0678c
dbd71968baa11e3178e19c89aeee8b56f8a9eb6e
refs/heads/master
2022-12-09T12:54:25.000097
2020-09-04T13:59:17
2020-09-04T13:59:17
277,387,101
0
0
null
null
null
null
UTF-8
Java
false
false
1,361
java
/* * The MIT License (MIT) * * Copyright (c) 2014 Zillow * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is furnished * to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.docscan.st.interfaces; import com.docscan.st.db.models.NoteGroup; public interface PhotoSavedListener { public void photoSaved(String path, String name); void onNoteGroupSaved(NoteGroup noteGroup); }
[ "imhr1727@gmail.com" ]
imhr1727@gmail.com
bd23570ce023e989d939818d7b7e2f5b634e70f6
37b09edcf5e668646004c99ef7632b2e4b42b206
/OnlineSurveyBuilder/src/main/java/com/cg/repo/RespondantRepo.java
83067915fc88c09b77919812a57d787ccaa48899
[]
no_license
SushmaKollati/Sprint1
48d75809491085fe4e79908883439417a09ea7bb
3b551c71c35d33d1c927015bc763ce798925dc4b
refs/heads/master
2023-04-23T08:09:13.853760
2021-04-24T11:14:46
2021-04-24T11:14:46
358,203,924
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
package com.cg.repo; import org.springframework.data.jpa.repository.config.JpaRepositoryConfigExtension; import org.springframework.data.repository.CrudRepository; import com.cg.domain.Respondant; public interface RespondantRepo extends CrudRepository<Respondant,Integer>{ Respondant save(Respondant respo); }
[ "dell@dell-PC" ]
dell@dell-PC
7bcab638096733d2429b646eb1254fd4dcc1c004
03ff6eb03beb8cab9e5dd3dc10b4a90d269b3f30
/src/main/java/de/tudarmstadt/ito/schemas/converters/DDMLToDTD.java
bfa3896b150449314ee4ac13a591f7e47c0d957f
[]
no_license
moink-net/dtd-parser
e15e537a792e53ef8408808b197528ef97371993
8ced68ddc68b708e65cd9aba21508bede11e04bd
refs/heads/master
2020-12-03T23:43:03.238065
2016-11-05T22:13:35
2016-11-05T22:13:35
66,624,434
0
0
null
null
null
null
UTF-8
Java
false
false
23,822
java
// No copyright, no warranty; use as you will. // Written by Ronald Bourret, Technical University of Darmstadt, 1998-9 // Version 1.1 // Changes from version 1.0: None // Changes from version 1.01: None package de.tudarmstadt.ito.schemas.converters; import de.tudarmstadt.ito.schemas.dtd.Attribute; import de.tudarmstadt.ito.schemas.dtd.DTD; import de.tudarmstadt.ito.schemas.dtd.DTDException; import de.tudarmstadt.ito.schemas.dtd.ElementType; import de.tudarmstadt.ito.schemas.dtd.Group; import de.tudarmstadt.ito.schemas.dtd.Notation; import de.tudarmstadt.ito.schemas.dtd.Particle; import de.tudarmstadt.ito.schemas.dtd.Reference; import de.tudarmstadt.ito.schemas.dtd.UnparsedEntity; import de.tudarmstadt.ito.utils.NSName; import de.tudarmstadt.ito.utils.TokenList; import java.io.IOException; import java.util.Stack; import java.util.Vector; import org.xml.sax.AttributeList; import org.xml.sax.HandlerBase; import org.xml.sax.InputSource; import org.xml.sax.Parser; import org.xml.sax.SAXException; /** * Convert a DDML document to a DTD object. * * @author Ronald Bourret, Technical University of Darmstadt * @version 1.1 */ public class DDMLToDTD extends HandlerBase { // This class assumes that the DDML file is correct. //************************************************************************* // Private variables //************************************************************************* private int moreLevel, docLevel; private boolean inElementDecl, inMixed, inGroup; private DTD dtd; private ElementType elementType; private Attribute attribute; private String globalURI, globalPrefix, globalRefURI, elementURI, elementPrefix, mixedRefURI, groupRefURI, attrGroupURI, attrGroupPrefix; private Stack attrGroupURIStack = new Stack(), attrGroupPrefixStack = new Stack(), groupStack = new Stack(), groupURIStack = new Stack(); private Group group; private Parser parser; TokenList elementTokens, enumTokens; //************************************************************************* // Constructors //************************************************************************* /** Create a new DDMLToDTD object. */ public DDMLToDTD() { initTokens(); } /** Create a new DDMLToDTD object and set the SAX Parser. */ public DDMLToDTD(Parser parser) { this.parser = parser; initTokens(); } //************************************************************************* // Public methods //************************************************************************* /** * Get the current SAX Parser. * * @return The current SAX Parser. */ public Parser getParser() { return parser; } /** * Set the current SAX Parser. * * @param parser The current SAX Parser. */ public void setParser(Parser parser) { this.parser = parser; } /** * Set the SAX parser, then convert the DDML document to a DTD object. * * @param parser The current SAX Parser. * @param src A SAX InputSource for the DDML document. * @return A DTD object. */ public DTD convert(Parser parser, InputSource src) throws SAXException, IOException { setParser(parser); return convert(src); } /** * Convert the DDML document to a DTD object. * * @param src A SAX InputSource for the DDML document. * @return A DTD object. */ public DTD convert(InputSource src) throws SAXException, IOException { if (src == null) throw new IllegalArgumentException("The src argument must not be null."); if (parser == null) throw new IllegalStateException("You must set the parser before creating a DTD object."); // Initialize the global variables. initGlobals(); // Parse the DDML document. parser.setDocumentHandler(this); parser.parse(src); // Post-process the DTD object postProcessDTD(); // Return the DTD object. return dtd; } //************************************************************************* // SAX methods //************************************************************************* /** * Implementation of startDocument in SAX' DocumentHandler interface. * This method is called by the SAX Parser and should not be called by * programmers using DDMLToDTD. */ public void startDocument() throws SAXException { } /** * Implementation of startElement in SAX' DocumentHandler interface. * This method is called by the SAX Parser and should not be called by * programmers using DDMLToDTD. */ public void startElement(String name, AttributeList attrs) throws SAXException { int token; token = elementTokens.getToken(name); // // Debugging code. // if (debug) // { // indent(); // System.out.println(name + " (start)"); // indent += 3; // } // If we are not inside an element type declaration, then the only // elements we are interested in are Notation, DocumentDef, // and ElementDecl. if (!inElementDecl) { if ((token != DDMLConst.ELEM_TOKEN_DOCUMENTDEF) && (token != DDMLConst.ELEM_TOKEN_ELEMENTDECL) && (token != DDMLConst.ELEM_TOKEN_NOTATION)) { return; } } // If we are inside a More element, ignore all elements and return. // Note that we keep track of the level of More elements in case they // are nested inside each other. Thus, we know when we have exited // the outermost More element. if (moreLevel > 0) { if (token == DDMLConst.ELEM_TOKEN_MORE) { moreLevel++; } return; } // If we are inside a Doc element, ignore all elements and return. // Note that we keep track of the level of Doc elements in case they // are nested inside each other. Thus, we know when we have exited // the outermost Doc element. Note that Doc elements inside More // elements are ignored. if (docLevel > 0) { if (token == DDMLConst.ELEM_TOKEN_DOC) { docLevel++; } return; } switch (token) { case DDMLConst.ELEM_TOKEN_ANY: processAny(); break; case DDMLConst.ELEM_TOKEN_ATTDEF: processAttDef(attrs); break; case DDMLConst.ELEM_TOKEN_ATTGROUP: processAttGroupStart(attrs); break; case DDMLConst.ELEM_TOKEN_CHOICE: case DDMLConst.ELEM_TOKEN_SEQ: processChoiceOrSeqStart(attrs, token); break; case DDMLConst.ELEM_TOKEN_DOC: docLevel++; break; case DDMLConst.ELEM_TOKEN_DOCUMENTDEF: processDocumentDef(attrs); break; case DDMLConst.ELEM_TOKEN_ELEMENTDECL: processElementDeclStart(attrs); break; case DDMLConst.ELEM_TOKEN_EMPTY: processEmpty(); break; case DDMLConst.ELEM_TOKEN_ENUMERATION: processEnumeration(); break; case DDMLConst.ELEM_TOKEN_ENUMERATIONVALUE: processEnumerationValue(attrs); break; case DDMLConst.ELEM_TOKEN_MIXED: processMixedStart(attrs); break; case DDMLConst.ELEM_TOKEN_MODEL: // Container element -- nothing to do. break; case DDMLConst.ELEM_TOKEN_MORE: moreLevel++; break; case DDMLConst.ELEM_TOKEN_NOTATION: processNotation(attrs); break; case DDMLConst.ELEM_TOKEN_PCDATA: processPCData(); break; case DDMLConst.ELEM_TOKEN_REF: processRef(attrs); break; case DDMLConst.ELEM_TOKEN_UNPARSEDENTITY: processUnparsedEntity(attrs); break; case DDMLConst.ELEM_TOKEN_UNKNOWN: throw new SAXException("Unknown element: " + name); } } /** * Implementation of endElement in SAX' DocumentHandler interface. * This method is called by the SAX Parser and should not be called by * programmers using DDMLToDTD. */ public void endElement (String name) throws SAXException { int token; token = elementTokens.getToken(name); // Debugging code. // if (debug) // { // indent -= 3; // indent(); // System.out.println(name + " (end)"); // } // If we are not inside an element declaration, nothing is of // interest, so just return. if (!inElementDecl) return; // If we are inside a More element, check if we are ending that // More element. if (moreLevel > 0) { if (token == DDMLConst.ELEM_TOKEN_MORE) { moreLevel--; } return; } // If we are inside a Doc element, check if we are ending that // Doc element. Note that Doc elements inside More elements are // ignored. if (docLevel > 0) { if (token == DDMLConst.ELEM_TOKEN_DOC) { docLevel--; } return; } switch (token) { case DDMLConst.ELEM_TOKEN_ATTGROUP: processAttGroupEnd(); break; case DDMLConst.ELEM_TOKEN_CHOICE: case DDMLConst.ELEM_TOKEN_SEQ: processChoiceOrSeqEnd(); break; case DDMLConst.ELEM_TOKEN_ELEMENTDECL: processElementDeclEnd(); break; case DDMLConst.ELEM_TOKEN_MIXED: processMixedEnd(); break; case DDMLConst.ELEM_TOKEN_ANY: case DDMLConst.ELEM_TOKEN_ATTDEF: case DDMLConst.ELEM_TOKEN_DOC: case DDMLConst.ELEM_TOKEN_DOCUMENTDEF: case DDMLConst.ELEM_TOKEN_EMPTY: case DDMLConst.ELEM_TOKEN_ENUMERATION: case DDMLConst.ELEM_TOKEN_ENUMERATIONVALUE: case DDMLConst.ELEM_TOKEN_MODEL: case DDMLConst.ELEM_TOKEN_MORE: case DDMLConst.ELEM_TOKEN_NOTATION: case DDMLConst.ELEM_TOKEN_PCDATA: case DDMLConst.ELEM_TOKEN_REF: case DDMLConst.ELEM_TOKEN_UNPARSEDENTITY: case DDMLConst.ELEM_TOKEN_UNKNOWN: // There is nothing to do for these elements. Either they are // not part of the DTD (e.g. More, DocumentDef) or they // are completely handled elsewhere (usually by startElement). break; } } /** * Implementation of characters in SAX' DocumentHandler interface. * This method is called by the SAX Parser and should not be called by * programmers using DDMLToDTD. */ public void characters (char ch[], int start, int length) throws SAXException { // DDML documents only have character data inside More and Doc // elements, both of which we ignore. } /** * Implementation of endDocument in SAX' DocumentHandler interface. * This method is called by the SAX Parser and should not be called by * programmers using DDMLToDTD. */ public void endDocument() throws SAXException { } //************************************************************************* // Private methods -- element processing //************************************************************************* private void processAny() { elementType.contentType = ElementType.CONTENT_ANY; } private void processAttDef(AttributeList attrs) { String name, prefix, uri; // Get the prefix and namespace of the attribute. // // There is a flaw in DDML with respect to namespaces. // // According to the namespaces spec, an unprefixed attribute name does // not exist in any XML namespace. (Instead, it exists in a "traditional // namespace" local to the element type.) This is the most common // situation. However, when we were designing DDML, we did not understand // this and thought it belonged to the same namespace as the element type. // This can be seen in the inheritence of ns and prefix attributes from // ElementDecl to AttGroup to AttDef. // // To remedy this situation, we check if they are the same as those of // the element type, we set them to null. Note that this action is // probably contrary to section 3.2 of the DDML spec. prefix = getAttrValue(attrs, DDMLConst.ATTR_PREFIX); if (prefix == null) prefix = attrGroupPrefix; if (prefix != null) { if (prefix.equals(elementPrefix)) prefix = null; } uri = getAttrValue(attrs, DDMLConst.ATTR_NS); if (uri == null) uri = attrGroupURI; if (uri != null) { if (uri.equals(elementURI)) uri = null; } // Get the attribute's name and create a new Attribute name = getAttrValue(attrs, DDMLConst.ATTR_NAME); attribute = new Attribute(name, prefix, uri); // Set the type, default value, etc. of the attribute. attribute.type = getAttrType(getAttrValue(attrs, DDMLConst.ATTR_TYPE)); attribute.defaultValue = getAttrValue(attrs, DDMLConst.ATTR_ATTVALUE); attribute.required = getAttrRequired(attribute.defaultValue, getAttrValue(attrs, DDMLConst.ATTR_REQUIRED)); // Add the attribute to the element type. elementType.attributes.put(attribute.name.qualified, attribute); } private void processAttGroupStart(AttributeList attrs) { attrGroupURIStack.push(attrGroupURI); attrGroupPrefixStack.push(attrGroupPrefix); attrGroupURI = getAttrValue(attrs, DDMLConst.ATTR_NS); if (attrGroupURI == null) { attrGroupURI = elementURI; } attrGroupPrefix = getAttrValue(attrs, DDMLConst.ATTR_PREFIX); if (attrGroupPrefix == null) { attrGroupPrefix = elementPrefix; } } private void processAttGroupEnd() { attrGroupURI = (String)attrGroupURIStack.pop(); attrGroupPrefix = (String)attrGroupPrefixStack.pop(); } private void processChoiceOrSeqStart(AttributeList attrs, int token) { Group parent; String uri; // Push the current Group (which is null if there is no group) // onto the stack and create a new one. parent = group; groupStack.push(parent); group = new Group(); // Get the namespace URI, if any. If it is null and we are in the // top level group, use the global URI. Otherwise, use the parent // URI. Then push the parent URI on the stack. uri = getAttrValue(attrs, DDMLConst.ATTR_ELEMENTNS); if (uri == null) { uri = (inGroup) ? groupRefURI : globalRefURI; } groupURIStack.push(groupRefURI); groupRefURI = uri; // Set the frequency and type of the new group. setFrequency(group, getAttrValue(attrs, DDMLConst.ATTR_FREQUENCY)); if (token == DDMLConst.ELEM_TOKEN_CHOICE) { group.type = Particle.PARTICLE_CHOICE; } else { group.type = Particle.PARTICLE_SEQUENCE; } // Add the new group to its parent. If there is no parent, then this // is the content for the element type. if (parent != null) { parent.members.addElement(group); } else { elementType.content = group; } // Set a flag saying we are in a group, so we know how to // process Ref elements. inGroup = true; } private void processChoiceOrSeqEnd() { // Pop the previous group and URI off the stack. If there was no // previous group, we get a null. group = (Group)groupStack.pop(); groupRefURI = (String)groupURIStack.pop(); inGroup = (group != null); } private void processDocumentDef(AttributeList attrs) throws SAXException { String version; version = getAttrValue(attrs, DDMLConst.ATTR_VERSION); if (version != null) { if (!version.equals(DDMLConst.DEF_VERSION)) throw new SAXException("Invalid DDML version number: " + version); } globalURI = getAttrValue(attrs, DDMLConst.ATTR_NS); globalPrefix = getAttrValue(attrs, DDMLConst.ATTR_PREFIX); globalRefURI = getAttrValue(attrs, DDMLConst.ATTR_ELEMENTNS); } private void processElementDeclStart(AttributeList attrs) throws SAXException { String name; // Get the ElementType. Note that this might already have been created, // for example, when the element type was referred to in the content model // of a different element type. name = getAttrValue(attrs, DDMLConst.ATTR_NAME); elementPrefix = getAttrValue(attrs, DDMLConst.ATTR_PREFIX); if (elementPrefix == null) { // If no prefix is defined here, use the prefix from the // DocumentDef element. elementPrefix = globalPrefix; } elementURI = getAttrValue(attrs, DDMLConst.ATTR_NS); if (elementURI == null) { // If no namespace URI is defined here, use the URI from the // DocumentDef element. elementURI = globalURI; } try { elementType = dtd.addElementType(name, elementPrefix, elementURI); } catch (DTDException e) { throw new SAXException(e); } // Set the prefixed name. If the ElementType had already been created, // this wouldn't have been set because the prefix was not known at that // time. elementType.name.prefixed = NSName.getPrefixedName(name, elementPrefix); // Set the content model type to CONTENT_ELEMENT. This is overridden by // the PCData, Any, Empty, and Mixed elements. elementType.contentType = ElementType.CONTENT_ELEMENT; // Set the state. inElementDecl = true; } private void processElementDeclEnd() { inElementDecl = false; } private void processEmpty() { elementType.contentType = ElementType.CONTENT_EMPTY; } private void processEnumeration() { attribute.enums = new Vector(); } private void processEnumerationValue(AttributeList attrs) { attribute.enums.addElement(getAttrValue(attrs, DDMLConst.ATTR_VALUE)); } private void processMixedStart(AttributeList attrs) { elementType.contentType = ElementType.CONTENT_MIXED; elementType.content = new Group(); elementType.content.type = Particle.PARTICLE_CHOICE; elementType.content.isRequired = false; elementType.content.isRepeatable = true; mixedRefURI = getAttrValue(attrs, DDMLConst.ATTR_ELEMENTNS); if (mixedRefURI == null) { mixedRefURI = globalRefURI; } inMixed = true; } private void processMixedEnd() { inMixed = false; } private void processNotation(AttributeList attrs) { Notation n = new Notation(); n.name = getAttrValue(attrs, DDMLConst.ATTR_NAME); n.publicID = getAttrValue(attrs, DDMLConst.ATTR_PUBIDLITERAL); n.systemID = getAttrValue(attrs, DDMLConst.ATTR_SYSTEMLITERAL); dtd.notations.put(n.name, n); } private void processPCData() { elementType.contentType = ElementType.CONTENT_PCDATA; } private void processRef(AttributeList attrs) { String refURI, refName; Reference ref; ElementType child; // Get the name and namespace URI of the referenced element // type, then get the ElementType for it. refURI = getAttrValue(attrs, DDMLConst.ATTR_ELEMENTNS); if (refURI == null) { if (inMixed) { refURI = mixedRefURI; } else if (inGroup) { refURI = groupRefURI; } else { refURI = globalRefURI; } } refName = getAttrValue(attrs, DDMLConst.ATTR_ELEMENT); child = dtd.getElementType(refName, null, refURI); // Add the referenced ElementType to the children of the // current ElementType and add the current ElementType to // the parents of the referenced ElementType. elementType.children.put(child.name.qualified, child); child.parents.put(elementType.name.qualified, elementType); // Process the reference. ref = new Reference(child); if (inMixed) { // Add the Reference to the members of the content Group. elementType.content.members.addElement(ref); } else { setFrequency(ref, getAttrValue(attrs, DDMLConst.ATTR_FREQUENCY)); if (inGroup) // In Choice or Seq element { // Add the Reference as a member of the current choice // or sequence Group. group.members.addElement(ref); } else // Stand-alone Ref element { // For a stand-alone Ref element, create a new Group for // the content and add the Reference to its members. elementType.content = new Group(); elementType.content.type = Particle.PARTICLE_SEQUENCE; elementType.content.members.addElement(ref); } } } private void processUnparsedEntity(AttributeList attrs) { UnparsedEntity entity = new UnparsedEntity(); entity.name = getAttrValue(attrs, DDMLConst.ATTR_NAME); entity.notation = getAttrValue(attrs, DDMLConst.ATTR_NOTATION); entity.systemID = getAttrValue(attrs, DDMLConst.ATTR_SYSTEMLITERAL); entity.publicID = getAttrValue(attrs, DDMLConst.ATTR_PUBIDLITERAL); } //************************************************************************* // Private methods -- general processing //************************************************************************* private void initGlobals() { // Initialize state variables. // indent = 0; moreLevel = 0; docLevel = 0; inElementDecl = false; inMixed = false; inGroup = false; attrGroupURI = null; attrGroupPrefix = null; group = null; groupRefURI = null; // Create a new DTD object. dtd = new DTD(); } private void initTokens() { elementTokens = new TokenList(DDMLConst.ELEMS, DDMLConst.ELEM_TOKENS, DDMLConst.ELEM_TOKEN_UNKNOWN); enumTokens = new TokenList(DDMLConst.ENUMS, DDMLConst.ENUM_TOKENS, DDMLConst.ENUM_TOKEN_UNKNOWN); } private void postProcessDTD() throws SAXException { dtd.updateANYParents(); try { dtd.checkElementTypeReferences(); dtd.checkNotationReferences(); } catch (DTDException e) { throw new SAXException(e); } } private int getAttrType(String type) { if (type == null) type = DDMLConst.DEF_TYPE; switch (enumTokens.getToken(type)) { case DDMLConst.ENUM_TOKEN_CDATA: return Attribute.TYPE_CDATA; case DDMLConst.ENUM_TOKEN_ENUMERATED: return Attribute.TYPE_ENUMERATED; case DDMLConst.ENUM_TOKEN_NMTOKEN: return Attribute.TYPE_NMTOKEN; case DDMLConst.ENUM_TOKEN_ID: return Attribute.TYPE_ID; case DDMLConst.ENUM_TOKEN_IDREF: return Attribute.TYPE_IDREF; case DDMLConst.ENUM_TOKEN_IDREFS: return Attribute.TYPE_IDREFS; case DDMLConst.ENUM_TOKEN_ENTITY: return Attribute.TYPE_ENTITY; case DDMLConst.ENUM_TOKEN_ENTITIES: return Attribute.TYPE_ENTITIES; case DDMLConst.ENUM_TOKEN_NMTOKENS: return Attribute.TYPE_NMTOKENS; case DDMLConst.ENUM_TOKEN_NOTATION: return Attribute.TYPE_NOTATION; default: throw new IllegalArgumentException("Invalid attribute type: " + type); } } private void setFrequency(Particle p, String freq) { if (freq == null) freq = DDMLConst.DEF_OTHER_FREQUENCY; switch (enumTokens.getToken(freq)) { case DDMLConst.ENUM_TOKEN_REQUIRED: p.isRequired = true; p.isRepeatable = false; break; case DDMLConst.ENUM_TOKEN_OPTIONAL: p.isRequired = false; p.isRepeatable = false; break; case DDMLConst.ENUM_TOKEN_ZEROORMORE: p.isRequired = false; p.isRepeatable = true; break; case DDMLConst.ENUM_TOKEN_ONEORMORE: p.isRequired = true; p.isRepeatable = true; break; default: throw new IllegalArgumentException("Invalid frequency: " + freq); } } private int getAttrRequired(String defaultValue, String required) { if (required == null) required = DDMLConst.DEF_REQUIRED; if (required.equals("No")) { return (defaultValue == null) ? Attribute.REQUIRED_OPTIONAL : Attribute.REQUIRED_DEFAULT; } else // if (required.equals("Yes")) { return (defaultValue == null) ? Attribute.REQUIRED_REQUIRED : Attribute.REQUIRED_FIXED; } } private String getAttrValue(AttributeList attrs, String name) { String value; value = attrs.getValue(name); // Work-around for parsers that incorrectly return an empty // string instead of a null when the attribute is not found. if (value != null) { if (value.length() == 0) { value = null; } } return value; } // Debugging tools // private boolean debug = false; // private int indent; // private static String SPACE = " "; // // private void indent() // { // for (int i = 0; i < indent; i++) // { // System.out.print(SPACE); // } // } }
[ "" ]
4c88a8c4690b9da95e58b33c2eaaca301aae56b8
90960e128c8e625038bd06b62947a30e7d43d413
/src/main/java/com/xksquare/pattern/design/mediator/sample1/strategy/DefaultAmountUsageStrategy.java
e3b7109f308459b9e133747ab893576a31133084
[]
no_license
4017147/xk-design
8bbbdc2388571bae4038ca51e33d790e9f355c4a
39ca177548a0acf0f159b92c1d9ff7a0442a1a20
refs/heads/master
2023-03-05T21:33:09.424279
2021-02-19T02:55:34
2021-02-19T02:55:34
259,842,878
1
1
null
2020-10-13T21:35:47
2020-04-29T06:26:05
Java
UTF-8
Java
false
false
935
java
package com.xksquare.pattern.design.mediator.sample1.strategy; import java.util.Arrays; import com.xksquare.pattern.design.mediator.sample1.CareForDividedType; import com.xksquare.pattern.design.mediator.sample1.RecommandDivided; import com.xksquare.pattern.design.mediator.sample1.RevenueType.DividedType.Recommend; public class DefaultAmountUsageStrategy implements CareForDividedType, AmountUsageStrategy { @Override public long cardinalAmount(RecommandDivided recommandDivided) { return recommandDivided.getCardinalMoney(); } @Override public boolean supportDivided(String dividedCode) { return Arrays.asList(this.careForDividedType()).contains(dividedCode); } @Override public String[] careForDividedType() { return new String[] {Recommend.R1M.getCode(), Recommend.R1M.getCode(), Recommend.R2D.getCode(), Recommend.R2M.getCode(), Recommend.R3D.getCode(), Recommend.R3M.getCode()}; } }
[ "4017147@qq.com" ]
4017147@qq.com
0e96622f1b5b7934c5d345115c50cf3eadab3e77
92f73038b2c03fe179d86383a46e6f6baeda0a80
/Inventory_Management/src/com/servlet/Login.java
85984d1d99d0d35f8cc73530f5df2dfa142e56a1
[]
no_license
harsh599/sims
3f86c0a91cfc8ab3fd42beae2b96e1eec5672cf0
0377236461a9f310fae93d69ec1f016f85f624d2
refs/heads/master
2020-04-28T08:25:43.193261
2019-04-07T10:52:35
2019-04-07T10:52:35
175,125,715
0
0
null
null
null
null
UTF-8
Java
false
false
1,756
java
package com.servlet; import java.io.IOException; import java.io.PrintWriter; import java.sql.SQLException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.database.Database_Connectivity; @WebServlet("/Login") public class Login extends HttpServlet { private static final long serialVersionUID = 1L; public Login() { super(); // TODO Auto-generated constructor stub } public void init(ServletConfig config) throws ServletException { } protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Database_Connectivity dc = new Database_Connectivity(); PrintWriter out = response.getWriter(); String uName = request.getParameter("username"); String uPass = request.getParameter("password"); System.out.println(uName+":"+uPass); boolean k = dc.validate(uName, uPass); if(k == true) { RequestDispatcher rd = request.getRequestDispatcher("/index.html"); //System.out.println("request granted"); rd.forward(request, response); } else { RequestDispatcher rd = request.getRequestDispatcher("/login.html"); System.out.println("request not granted"); rd.include(request, response); } } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "noreply@github.com" ]
noreply@github.com
c76db6aca04ec78aaa4bb3ec95f0e0b837cd9837
b36a85dd502904fc014f318e91a7ff5d67537905
/src/main/java/com/redxun/mobile/core/controller/CustomFormController.java
fff8229b5a6d3541ebd14c0a123aca855b2c5f1b
[]
no_license
clickear/jsaas
7c0819b4f21443c10845e549b521fa50c3a1c760
ddffd4c42ee40c8a2728d46e4c7009a95f7f801f
refs/heads/master
2020-03-16T09:00:40.649868
2018-04-18T12:13:50
2018-04-18T12:13:50
132,606,788
4
8
null
2018-05-08T12:37:25
2018-05-08T12:37:25
null
UTF-8
Java
false
false
5,778
java
package com.redxun.mobile.core.controller; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.redxun.bpm.activiti.util.ProcessHandleHelper; import com.redxun.bpm.core.entity.BpmInst; import com.redxun.bpm.core.manager.BpmFormRightManager; import com.redxun.bpm.form.entity.BpmMobileForm; import com.redxun.bpm.form.entity.FormModel; import com.redxun.bpm.form.entity.FormViewRight; import com.redxun.bpm.form.impl.formhandler.FormUtil; import com.redxun.bpm.form.manager.BpmMobileFormManager; import com.redxun.core.util.StringUtil; import com.redxun.org.api.context.ProfileUtil; import com.redxun.saweb.context.ContextUtil; import com.redxun.sys.bo.entity.SysBoEnt; import com.redxun.sys.core.dao.SysMenuQueryDao; import com.redxun.sys.core.entity.SysMenu; import com.redxun.sys.customform.entity.SysCustomFormSetting; import com.redxun.sys.customform.manager.SysCustomFormSettingManager; @Controller @RequestMapping("/mobile/custom/") public class CustomFormController { @Resource SysMenuQueryDao sysMenuQueryDao ; @Resource SysCustomFormSettingManager sysCustomFormSettingManager; @Resource BpmMobileFormManager bpmMobileFormManager; @Resource BpmFormRightManager bpmFormRightManager; /** * 获取表单过程。 * 1.根据别名获取SysCustomFormSetting对象。 * 2.获取手机表单名称。 * 3.获取手机表单的html。 * 4.获取表单权限。 * 5.获取表单数据。 * * @param alias * @return */ @ResponseBody @RequestMapping(value={"form/{alias}/{id}"}) public JSONObject getFormModel( @PathVariable(value="alias")String alias, @PathVariable(value="id")String id){ JSONObject json=new JSONObject(); FormModel formModel=new FormModel(); formModel.setResult(false); String tenantId=ContextUtil.getCurrentTenantId(); SysCustomFormSetting setting=sysCustomFormSettingManager.getByAlias(alias); if(setting==null){ json.put("msg", "没有找到表单设定!"); json.put("result", false); return json; } String mobileAlias=setting.getMobileFormAlias(); BpmMobileForm mobileForm= bpmMobileFormManager.getByAlias(mobileAlias); if(mobileForm==null){ json.put("msg", "没有设置手机表单!"); json.put("result", false); return json; } //设置子表权限。 ProcessHandleHelper.clearObjectLocal(); ProcessHandleHelper.setObjectLocal(setting.getTableRightJson()); JSONObject jsonData= FormUtil.getData(setting.getBodefId(),id); formModel.setBoDefId(setting.getBodefId()); formModel.setContent(mobileForm.getFormHtml()); formModel.setJsonData(jsonData); JSONObject permission= getPermission(setting.getFormAlias(),tenantId,false); formModel.setPermission(JSONObject.toJSONString(permission)); formModel.setResult(true); boolean canStartFlow=canStartFlow(setting,jsonData); json.put("canStartFlow",canStartFlow); json.put("formModel",formModel); json.put("result",true); return json; } /** * 是否能启动流程。 * @param setting * @param jsonData * @return */ private boolean canStartFlow(SysCustomFormSetting setting,JSONObject jsonData){ if(StringUtil.isEmpty(setting.getSolId())){ return false; } String status=jsonData.getString(SysBoEnt.FIELD_INST_STATUS_); if(StringUtil.isEmpty(status)) return true; if(BpmInst.STATUS_DRAFTED.equals(status)) return true; return false; } private JSONObject getPermission(String formKey,String tenantId,boolean readOnly){ Map<String, Set<String>> profileMap=ProfileUtil.getCurrentProfile(); JSONObject rightSetting=FormUtil.getRightByForm(formKey); JSONObject permisson= bpmFormRightManager.calcRights(rightSetting, profileMap, readOnly); return permisson; } /** * 返回有权限的自定义列表。 * 自定义表格式: * [{ * name:"", * key:"", * childs:[ * {MENU_ID_:"",PARENT_ID_:"",NAME_:"",BO_LIST_ID_:"",KEY_:""}, * {MENU_ID_:"",PARENT_ID_:"",NAME_:"",BO_LIST_ID_:"",KEY_:""} * ] * }] * * @param request * @return */ @ResponseBody @RequestMapping(value={"getMyMobileList"}) public JSONArray getMyMobileList(HttpServletRequest request){ String userId=ContextUtil.getCurrentUserId(); String tenantId=ContextUtil.getCurrentTenantId(); List<Map<String,Object>> menus= sysMenuQueryDao.getBoMenuByUserId(tenantId, userId); JSONObject menuObj=new JSONObject(); for(Map<String,Object> menu:menus){ //m.MENU_ID_ MENUID,m.PARENT_ID_ ,m.NAME_,m.BO_LIST_ID_,boList.KEY_ String parentId=(String)menu.get("PARENT_ID_"); if(menuObj.containsKey(parentId)){ List<Map<String,Object>> list= menuObj.getObject(parentId, List.class); list.add(menu); } else{ List<Map<String,Object>> list=new ArrayList<Map<String,Object>>(); list.add(menu); menuObj.put(parentId, list); } } JSONArray jsonAry=new JSONArray(); Set<String> set= menuObj.keySet(); for(Iterator<String> it=set.iterator();it.hasNext();){ String menuId=it.next(); SysMenu menu=sysMenuQueryDao.get(menuId); if(menu==null) continue; JSONObject level1=new JSONObject(); level1.put("name", menu.getName()); level1.put("key", menu.getKey()); level1.put("childs", menuObj.getObject(menuId, List.class)); jsonAry.add(level1); } return jsonAry; } }
[ "yijiang331" ]
yijiang331
b10f8106b96d96c88b92a530f4f9441e2abac9b4
10d8a0a63cf0e787c012c7aede3a09bdffbdeec6
/Programming1st year/Jlab2b3.java
6ec5fca6e18707a0d142fdbc1ed3336e155fe48e
[]
no_license
makluktech/College-programming
3fde4217096bbbf5763e532302d965ab3ccd8cd9
3502b6b9a237c9b178323064ee403d5cfdfb004d
refs/heads/master
2021-01-11T06:20:25.521641
2016-10-04T12:44:08
2016-10-04T12:44:08
69,952,923
0
0
null
null
null
null
UTF-8
Java
false
false
1,495
java
class Jlab2b3 // Student Name : Colm Carey // Student Id Number : CO0197157 // Date : 10/10/2014 // Purpose : Lowest of 3 numbers { public static void main(String[] args) { int num1; // variables been used int num2; int num3; int lowestNum; System.out.print("Please enter your first number :"); // takes in numbers from the user num1 = EasyIn.getInt(); System.out.print("Please enter your secound number :"); num2 = EasyIn.getInt(); System.out.print("Please enter your third number :"); num3 = EasyIn.getInt(); if(num1 < num2 && num1 < num3) // if num1 is less than num2 and num3 { // print num1 is lowest num lowestNum = num1; System.out.println("Number 1 is the lowest entered number :\t" + num1); } if(num2 < num1 && num2 < num3) // if num2 is less than num1 and num3 { // print num2 is lowest num lowestNum = num2; System.out.println("Number 2 is the lowest entered number :\t" + num2); } if(num3 < num1 && num3 < num2) // if num3 is less than num1 and num2 { // num3 is lowest num lowestNum = num3; System.out.println("Number 3 is the lowest entered number :\t" + num3); } } }
[ "noreply@github.com" ]
noreply@github.com
68900dc2b7f2762227e2dc2d0ed53753ae8cd0c5
afd8be503fe037306fcc6c7f721c9e0ec1a8c7c2
/src/main/java/com/uzdz/行为型模式/命令模式/ConsoleMain.java
c3a4cf56d66bc62f7d4574656347ddb660808651
[]
no_license
uzdz/design-pattern
512a45a63f4929ea25d312044ac71d3fa88c2272
6f5bfabcef0e09346dedc33ee12b71260fe75f94
refs/heads/master
2020-04-27T15:34:53.137965
2019-04-09T08:04:32
2019-04-09T08:04:32
174,451,614
2
0
null
null
null
null
UTF-8
Java
false
false
1,775
java
package com.uzdz.行为型模式.命令模式; import com.uzdz.行为型模式.命令模式.project.Controller; import com.uzdz.行为型模式.命令模式.project.appliance.Light; import com.uzdz.行为型模式.命令模式.project.appliance.Tv; import com.uzdz.行为型模式.命令模式.project.command.light.LightOffCommand; import com.uzdz.行为型模式.命令模式.project.command.light.LightOnCommand; import com.uzdz.行为型模式.命令模式.project.command.tv.TvOffCommand; import com.uzdz.行为型模式.命令模式.project.command.tv.TvOnCommand; public class ConsoleMain { public static void main(String[] args) { Controller controller = new Controller(); // 卧室灯 Light bedroomLight = new Light("卧室"); LightOnCommand bedroomLightOn = new LightOnCommand(bedroomLight); LightOffCommand bedroomLightOff = new LightOffCommand(bedroomLight); // 客厅灯 Light livingRoomLight = new Light("客厅"); LightOnCommand livingRoomLightOn = new LightOnCommand(livingRoomLight); LightOffCommand livingRoomLightOff = new LightOffCommand(livingRoomLight); // 客厅电视 Tv livingRoomTv = new Tv("客厅"); TvOnCommand livingRoomTvOn = new TvOnCommand(livingRoomTv); TvOffCommand livingRoomTvOff = new TvOffCommand(livingRoomTv); // 将设置好的命令绑定到控制器上 controller.setCommand(0, bedroomLightOn, bedroomLightOff); controller.setCommand(1, livingRoomLightOn, livingRoomLightOff); controller.setCommand(2, livingRoomTvOn, livingRoomTvOff); // 开启1号槽位的电器 controller.onButton(1); // 关闭1号槽位的电器 controller.offButton(1); } }
[ "devmen@163.com" ]
devmen@163.com
6be331894bbd689e7bd11be4f0cedcb22c7546b3
61a7716e3464534ff16afc192a844486240db73d
/singleton/unterklasse/KaltesSingleton.java
843bbfe624914fd1dbcf5a23c10e518c24668a15
[ "MIT" ]
permissive
isfarca/Singleton_Console_Java
d5a3ccdd13f5e349120f773b0b8b583ad6736a50
c32ac5b9aa2d57f6bac1fba098d777d6857d0d26
refs/heads/master
2020-04-21T19:09:14.288227
2019-07-13T18:22:13
2019-07-13T18:22:13
169,796,567
0
0
null
null
null
null
ISO-8859-1
Java
false
false
247
java
package headfirst.singleton.unterklasse; public class KaltesSingleton extends Singleton { // nützliche Instanzvariablen protected static Singleton einzigeInstanz; private KaltesSingleton() { super(); } // nützliche Instanzmethoden }
[ "fisfarca@googlemail.com" ]
fisfarca@googlemail.com
49365ddc633cbff16c57ff0056a57fd7345ae54b
e421c4fc766bb9f977bef167cb8d831add2b9871
/hw8/dp2021s_hw_107590026/src/main/java/org/ntutssl/shop/PayByCreditCardStrategy.java
eefac4cd7c6886ada1ef554888180f88f8f7bdb6
[]
no_license
zaqNitori/Design-Pattern
913a4c6fbf8d561443febc7c3c8299481049b7eb
f01788b131c1b6a04cc8c2367c0e20b2de217052
refs/heads/master
2023-05-30T08:33:21.722219
2021-06-15T15:14:25
2021-06-15T15:14:25
345,054,521
0
0
null
2021-03-06T09:56:57
2021-03-06T09:27:37
Java
UTF-8
Java
false
false
1,521
java
package org.ntutssl.shop; import java.text.DecimalFormat; import java.util.Scanner; public class PayByCreditCardStrategy implements PayStrategy, EventListener { private EventManager eventManager; private Scanner scanner; private String ans; public PayByCreditCardStrategy() { eventManager = EventManager.getInstance(); scanner = new Scanner(System.in); eventManager.subscribe(EventType.CALCULATE, this); } public void onEvent(Event event) { if(event.type() == EventType.CALCULATE) { System.out.print("Enter the card number: "); String card = scanner.nextLine().trim(); System.out.print("Enter the card expiration date 'mm/yy': "); String date = scanner.nextLine().trim(); System.out.print("Enter the CVV code: "); String cvv = scanner.nextLine().trim(); if(card.matches("\\d{16}") && date.matches("((0[1-9])|(1[0-2]))/\\d{2}") && cvv.matches("\\d{3}")) calculate(Double.valueOf(event.data().toString())); else System.out.println("Pay Failed!"); } } public String getCalculate() { return ans; } /** * Card number are 16 digits. * The format of card expiration date is 'mm/yy', such as '06/21'. * CVV code are 3 digits. */ @Override public void calculate(double totalPrice) { DecimalFormat f = new DecimalFormat("###.00"); String str = "$" + f.format(totalPrice - (totalPrice * 0.1)); ans = str; eventManager.publish(new StringEvent(EventType.PRINT_RECEIPT, str)); System.out.println("Pay successfully!"); } }
[ "zaq155162@yahoo.com" ]
zaq155162@yahoo.com
77017a26b7b21396931afd4275f068a2b4f2d188
38801ab66863e9db549c2f3d5e73fb9fac4db3dc
/src/main/java/br/com/swconsultoria/nfe/schema_4/enviNFe/ObjectFactory.java
52e23f1c4c21e37d7b02b25161c695b3cba29f05
[ "MIT" ]
permissive
tiagoceridorio/Java_NFe
c5050a89301678fe567e0c8b7766ad587040a0f6
bafd4dfb5938509ce3e15cf7aa5aad1d28e46422
refs/heads/master
2022-05-13T14:45:45.627504
2022-05-01T02:25:40
2022-05-01T02:25:40
84,336,574
1
0
MIT
2022-01-23T20:42:20
2017-03-08T15:35:21
Java
UTF-8
Java
false
false
33,722
java
package br.com.swconsultoria.nfe.schema_4.enviNFe; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the br.com.swconsultoria.nfe.schema_4.enviNFe package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { private final static QName _Signature_QNAME = new QName("http://www.w3.org/2000/09/xmldsig#", "Signature"); private final static QName _EnviNFe_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "enviNFe"); private final static QName _TNFeInfNFeDetImpostoICMS_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "ICMS"); private final static QName _TNFeInfNFeDetImpostoPISST_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "PISST"); private final static QName _TNFeInfNFeDetImpostoCOFINSST_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "COFINSST"); private final static QName _TNFeInfNFeDetImpostoIPI_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "IPI"); private final static QName _TNFeInfNFeDetImpostoICMSUFDest_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "ICMSUFDest"); private final static QName _TNFeInfNFeDetImpostoVTotTrib_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "vTotTrib"); private final static QName _TNFeInfNFeDetImpostoII_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "II"); private final static QName _TNFeInfNFeDetImpostoISSQN_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "ISSQN"); private final static QName _TNFeInfNFeDetImpostoCOFINS_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "COFINS"); private final static QName _TNFeInfNFeDetImpostoPIS_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "PIS"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: br.com.swconsultoria.nfe.schema_4.enviNFe * */ public ObjectFactory() { } /** * Create an instance of {@link ReferenceType } * */ public ReferenceType createReferenceType() { return new ReferenceType(); } /** * Create an instance of {@link SignedInfoType } * */ public SignedInfoType createSignedInfoType() { return new SignedInfoType(); } /** * Create an instance of {@link TNFe } * */ public TNFe createTNFe() { return new TNFe(); } /** * Create an instance of {@link TNFe.InfNFe } * */ public TNFe.InfNFe createTNFeInfNFe() { return new TNFe.InfNFe(); } /** * Create an instance of {@link TNFe.InfNFe.Cana } * */ public TNFe.InfNFe.Cana createTNFeInfNFeCana() { return new TNFe.InfNFe.Cana(); } /** * Create an instance of {@link TNFe.InfNFe.InfAdic } * */ public TNFe.InfNFe.InfAdic createTNFeInfNFeInfAdic() { return new TNFe.InfNFe.InfAdic(); } /** * Create an instance of {@link TNFe.InfNFe.Pag } * */ public TNFe.InfNFe.Pag createTNFeInfNFePag() { return new TNFe.InfNFe.Pag(); } /** * Create an instance of {@link TNFe.InfNFe.Pag.DetPag } * */ public TNFe.InfNFe.Pag.DetPag createTNFeInfNFePagDetPag() { return new TNFe.InfNFe.Pag.DetPag(); } /** * Create an instance of {@link TNFe.InfNFe.Cobr } * */ public TNFe.InfNFe.Cobr createTNFeInfNFeCobr() { return new TNFe.InfNFe.Cobr(); } /** * Create an instance of {@link TNFe.InfNFe.Transp } * */ public TNFe.InfNFe.Transp createTNFeInfNFeTransp() { return new TNFe.InfNFe.Transp(); } /** * Create an instance of {@link TNFe.InfNFe.Transp.Vol } * */ public TNFe.InfNFe.Transp.Vol createTNFeInfNFeTranspVol() { return new TNFe.InfNFe.Transp.Vol(); } /** * Create an instance of {@link TNFe.InfNFe.Total } * */ public TNFe.InfNFe.Total createTNFeInfNFeTotal() { return new TNFe.InfNFe.Total(); } /** * Create an instance of {@link TNFe.InfNFe.Det } * */ public TNFe.InfNFe.Det createTNFeInfNFeDet() { return new TNFe.InfNFe.Det(); } /** * Create an instance of {@link TNFe.InfNFe.Det.ObsItem } * */ public TNFe.InfNFe.Det.ObsItem createTNFeInfNFeDetObsItem() { return new TNFe.InfNFe.Det.ObsItem(); } /** * Create an instance of {@link TNFe.InfNFe.Det.ImpostoDevol } * */ public TNFe.InfNFe.Det.ImpostoDevol createTNFeInfNFeDetImpostoDevol() { return new TNFe.InfNFe.Det.ImpostoDevol(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto } * */ public TNFe.InfNFe.Det.Imposto createTNFeInfNFeDetImposto() { return new TNFe.InfNFe.Det.Imposto(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.COFINS } * */ public TNFe.InfNFe.Det.Imposto.COFINS createTNFeInfNFeDetImpostoCOFINS() { return new TNFe.InfNFe.Det.Imposto.COFINS(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.PIS } * */ public TNFe.InfNFe.Det.Imposto.PIS createTNFeInfNFeDetImpostoPIS() { return new TNFe.InfNFe.Det.Imposto.PIS(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS } * */ public TNFe.InfNFe.Det.Imposto.ICMS createTNFeInfNFeDetImpostoICMS() { return new TNFe.InfNFe.Det.Imposto.ICMS(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod } * */ public TNFe.InfNFe.Det.Prod createTNFeInfNFeDetProd() { return new TNFe.InfNFe.Det.Prod(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.Comb } * */ public TNFe.InfNFe.Det.Prod.Comb createTNFeInfNFeDetProdComb() { return new TNFe.InfNFe.Det.Prod.Comb(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.DetExport } * */ public TNFe.InfNFe.Det.Prod.DetExport createTNFeInfNFeDetProdDetExport() { return new TNFe.InfNFe.Det.Prod.DetExport(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.DI } * */ public TNFe.InfNFe.Det.Prod.DI createTNFeInfNFeDetProdDI() { return new TNFe.InfNFe.Det.Prod.DI(); } /** * Create an instance of {@link TNFe.InfNFe.Ide } * */ public TNFe.InfNFe.Ide createTNFeInfNFeIde() { return new TNFe.InfNFe.Ide(); } /** * Create an instance of {@link TNFe.InfNFe.Ide.NFref } * */ public TNFe.InfNFe.Ide.NFref createTNFeInfNFeIdeNFref() { return new TNFe.InfNFe.Ide.NFref(); } /** * Create an instance of {@link TProtNFe } * */ public TProtNFe createTProtNFe() { return new TProtNFe(); } /** * Create an instance of {@link TRetEnviNFe } * */ public TRetEnviNFe createTRetEnviNFe() { return new TRetEnviNFe(); } /** * Create an instance of {@link TIpi } * */ public TIpi createTIpi() { return new TIpi(); } /** * Create an instance of {@link TEnviNFe } * */ public TEnviNFe createTEnviNFe() { return new TEnviNFe(); } /** * Create an instance of {@link TConsReciNFe } * */ public TConsReciNFe createTConsReciNFe() { return new TConsReciNFe(); } /** * Create an instance of {@link TVeiculo } * */ public TVeiculo createTVeiculo() { return new TVeiculo(); } /** * Create an instance of {@link TEnderEmi } * */ public TEnderEmi createTEnderEmi() { return new TEnderEmi(); } /** * Create an instance of {@link TEndereco } * */ public TEndereco createTEndereco() { return new TEndereco(); } /** * Create an instance of {@link TInfRespTec } * */ public TInfRespTec createTInfRespTec() { return new TInfRespTec(); } /** * Create an instance of {@link TLocal } * */ public TLocal createTLocal() { return new TLocal(); } /** * Create an instance of {@link TNfeProc } * */ public TNfeProc createTNfeProc() { return new TNfeProc(); } /** * Create an instance of {@link TRetConsReciNFe } * */ public TRetConsReciNFe createTRetConsReciNFe() { return new TRetConsReciNFe(); } /** * Create an instance of {@link SignatureType } * */ public SignatureType createSignatureType() { return new SignatureType(); } /** * Create an instance of {@link X509DataType } * */ public X509DataType createX509DataType() { return new X509DataType(); } /** * Create an instance of {@link SignatureValueType } * */ public SignatureValueType createSignatureValueType() { return new SignatureValueType(); } /** * Create an instance of {@link TransformsType } * */ public TransformsType createTransformsType() { return new TransformsType(); } /** * Create an instance of {@link TransformType } * */ public TransformType createTransformType() { return new TransformType(); } /** * Create an instance of {@link KeyInfoType } * */ public KeyInfoType createKeyInfoType() { return new KeyInfoType(); } /** * Create an instance of {@link ReferenceType.DigestMethod } * */ public ReferenceType.DigestMethod createReferenceTypeDigestMethod() { return new ReferenceType.DigestMethod(); } /** * Create an instance of {@link SignedInfoType.CanonicalizationMethod } * */ public SignedInfoType.CanonicalizationMethod createSignedInfoTypeCanonicalizationMethod() { return new SignedInfoType.CanonicalizationMethod(); } /** * Create an instance of {@link SignedInfoType.SignatureMethod } * */ public SignedInfoType.SignatureMethod createSignedInfoTypeSignatureMethod() { return new SignedInfoType.SignatureMethod(); } /** * Create an instance of {@link TNFe.InfNFeSupl } * */ public TNFe.InfNFeSupl createTNFeInfNFeSupl() { return new TNFe.InfNFeSupl(); } /** * Create an instance of {@link TNFe.InfNFe.Emit } * */ public TNFe.InfNFe.Emit createTNFeInfNFeEmit() { return new TNFe.InfNFe.Emit(); } /** * Create an instance of {@link TNFe.InfNFe.Avulsa } * */ public TNFe.InfNFe.Avulsa createTNFeInfNFeAvulsa() { return new TNFe.InfNFe.Avulsa(); } /** * Create an instance of {@link TNFe.InfNFe.Dest } * */ public TNFe.InfNFe.Dest createTNFeInfNFeDest() { return new TNFe.InfNFe.Dest(); } /** * Create an instance of {@link TNFe.InfNFe.AutXML } * */ public TNFe.InfNFe.AutXML createTNFeInfNFeAutXML() { return new TNFe.InfNFe.AutXML(); } /** * Create an instance of {@link TNFe.InfNFe.InfIntermed } * */ public TNFe.InfNFe.InfIntermed createTNFeInfNFeInfIntermed() { return new TNFe.InfNFe.InfIntermed(); } /** * Create an instance of {@link TNFe.InfNFe.Exporta } * */ public TNFe.InfNFe.Exporta createTNFeInfNFeExporta() { return new TNFe.InfNFe.Exporta(); } /** * Create an instance of {@link TNFe.InfNFe.Compra } * */ public TNFe.InfNFe.Compra createTNFeInfNFeCompra() { return new TNFe.InfNFe.Compra(); } /** * Create an instance of {@link TNFe.InfNFe.InfSolicNFF } * */ public TNFe.InfNFe.InfSolicNFF createTNFeInfNFeInfSolicNFF() { return new TNFe.InfNFe.InfSolicNFF(); } /** * Create an instance of {@link TNFe.InfNFe.Cana.ForDia } * */ public TNFe.InfNFe.Cana.ForDia createTNFeInfNFeCanaForDia() { return new TNFe.InfNFe.Cana.ForDia(); } /** * Create an instance of {@link TNFe.InfNFe.Cana.Deduc } * */ public TNFe.InfNFe.Cana.Deduc createTNFeInfNFeCanaDeduc() { return new TNFe.InfNFe.Cana.Deduc(); } /** * Create an instance of {@link TNFe.InfNFe.InfAdic.ObsCont } * */ public TNFe.InfNFe.InfAdic.ObsCont createTNFeInfNFeInfAdicObsCont() { return new TNFe.InfNFe.InfAdic.ObsCont(); } /** * Create an instance of {@link TNFe.InfNFe.InfAdic.ObsFisco } * */ public TNFe.InfNFe.InfAdic.ObsFisco createTNFeInfNFeInfAdicObsFisco() { return new TNFe.InfNFe.InfAdic.ObsFisco(); } /** * Create an instance of {@link TNFe.InfNFe.InfAdic.ProcRef } * */ public TNFe.InfNFe.InfAdic.ProcRef createTNFeInfNFeInfAdicProcRef() { return new TNFe.InfNFe.InfAdic.ProcRef(); } /** * Create an instance of {@link TNFe.InfNFe.Pag.DetPag.Card } * */ public TNFe.InfNFe.Pag.DetPag.Card createTNFeInfNFePagDetPagCard() { return new TNFe.InfNFe.Pag.DetPag.Card(); } /** * Create an instance of {@link TNFe.InfNFe.Cobr.Fat } * */ public TNFe.InfNFe.Cobr.Fat createTNFeInfNFeCobrFat() { return new TNFe.InfNFe.Cobr.Fat(); } /** * Create an instance of {@link TNFe.InfNFe.Cobr.Dup } * */ public TNFe.InfNFe.Cobr.Dup createTNFeInfNFeCobrDup() { return new TNFe.InfNFe.Cobr.Dup(); } /** * Create an instance of {@link TNFe.InfNFe.Transp.Transporta } * */ public TNFe.InfNFe.Transp.Transporta createTNFeInfNFeTranspTransporta() { return new TNFe.InfNFe.Transp.Transporta(); } /** * Create an instance of {@link TNFe.InfNFe.Transp.RetTransp } * */ public TNFe.InfNFe.Transp.RetTransp createTNFeInfNFeTranspRetTransp() { return new TNFe.InfNFe.Transp.RetTransp(); } /** * Create an instance of {@link TNFe.InfNFe.Transp.Vol.Lacres } * */ public TNFe.InfNFe.Transp.Vol.Lacres createTNFeInfNFeTranspVolLacres() { return new TNFe.InfNFe.Transp.Vol.Lacres(); } /** * Create an instance of {@link TNFe.InfNFe.Total.ICMSTot } * */ public TNFe.InfNFe.Total.ICMSTot createTNFeInfNFeTotalICMSTot() { return new TNFe.InfNFe.Total.ICMSTot(); } /** * Create an instance of {@link TNFe.InfNFe.Total.ISSQNtot } * */ public TNFe.InfNFe.Total.ISSQNtot createTNFeInfNFeTotalISSQNtot() { return new TNFe.InfNFe.Total.ISSQNtot(); } /** * Create an instance of {@link TNFe.InfNFe.Total.RetTrib } * */ public TNFe.InfNFe.Total.RetTrib createTNFeInfNFeTotalRetTrib() { return new TNFe.InfNFe.Total.RetTrib(); } /** * Create an instance of {@link TNFe.InfNFe.Det.ObsItem.ObsCont } * */ public TNFe.InfNFe.Det.ObsItem.ObsCont createTNFeInfNFeDetObsItemObsCont() { return new TNFe.InfNFe.Det.ObsItem.ObsCont(); } /** * Create an instance of {@link TNFe.InfNFe.Det.ObsItem.ObsFisco } * */ public TNFe.InfNFe.Det.ObsItem.ObsFisco createTNFeInfNFeDetObsItemObsFisco() { return new TNFe.InfNFe.Det.ObsItem.ObsFisco(); } /** * Create an instance of {@link TNFe.InfNFe.Det.ImpostoDevol.IPI } * */ public TNFe.InfNFe.Det.ImpostoDevol.IPI createTNFeInfNFeDetImpostoDevolIPI() { return new TNFe.InfNFe.Det.ImpostoDevol.IPI(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.II } * */ public TNFe.InfNFe.Det.Imposto.II createTNFeInfNFeDetImpostoII() { return new TNFe.InfNFe.Det.Imposto.II(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ISSQN } * */ public TNFe.InfNFe.Det.Imposto.ISSQN createTNFeInfNFeDetImpostoISSQN() { return new TNFe.InfNFe.Det.Imposto.ISSQN(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.PISST } * */ public TNFe.InfNFe.Det.Imposto.PISST createTNFeInfNFeDetImpostoPISST() { return new TNFe.InfNFe.Det.Imposto.PISST(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.COFINSST } * */ public TNFe.InfNFe.Det.Imposto.COFINSST createTNFeInfNFeDetImpostoCOFINSST() { return new TNFe.InfNFe.Det.Imposto.COFINSST(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMSUFDest } * */ public TNFe.InfNFe.Det.Imposto.ICMSUFDest createTNFeInfNFeDetImpostoICMSUFDest() { return new TNFe.InfNFe.Det.Imposto.ICMSUFDest(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.COFINS.COFINSAliq } * */ public TNFe.InfNFe.Det.Imposto.COFINS.COFINSAliq createTNFeInfNFeDetImpostoCOFINSCOFINSAliq() { return new TNFe.InfNFe.Det.Imposto.COFINS.COFINSAliq(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.COFINS.COFINSQtde } * */ public TNFe.InfNFe.Det.Imposto.COFINS.COFINSQtde createTNFeInfNFeDetImpostoCOFINSCOFINSQtde() { return new TNFe.InfNFe.Det.Imposto.COFINS.COFINSQtde(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.COFINS.COFINSNT } * */ public TNFe.InfNFe.Det.Imposto.COFINS.COFINSNT createTNFeInfNFeDetImpostoCOFINSCOFINSNT() { return new TNFe.InfNFe.Det.Imposto.COFINS.COFINSNT(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.COFINS.COFINSOutr } * */ public TNFe.InfNFe.Det.Imposto.COFINS.COFINSOutr createTNFeInfNFeDetImpostoCOFINSCOFINSOutr() { return new TNFe.InfNFe.Det.Imposto.COFINS.COFINSOutr(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.PIS.PISAliq } * */ public TNFe.InfNFe.Det.Imposto.PIS.PISAliq createTNFeInfNFeDetImpostoPISPISAliq() { return new TNFe.InfNFe.Det.Imposto.PIS.PISAliq(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.PIS.PISQtde } * */ public TNFe.InfNFe.Det.Imposto.PIS.PISQtde createTNFeInfNFeDetImpostoPISPISQtde() { return new TNFe.InfNFe.Det.Imposto.PIS.PISQtde(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.PIS.PISNT } * */ public TNFe.InfNFe.Det.Imposto.PIS.PISNT createTNFeInfNFeDetImpostoPISPISNT() { return new TNFe.InfNFe.Det.Imposto.PIS.PISNT(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.PIS.PISOutr } * */ public TNFe.InfNFe.Det.Imposto.PIS.PISOutr createTNFeInfNFeDetImpostoPISPISOutr() { return new TNFe.InfNFe.Det.Imposto.PIS.PISOutr(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS00 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS00 createTNFeInfNFeDetImpostoICMSICMS00() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS00(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS10 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS10 createTNFeInfNFeDetImpostoICMSICMS10() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS10(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS20 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS20 createTNFeInfNFeDetImpostoICMSICMS20() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS20(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS30 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS30 createTNFeInfNFeDetImpostoICMSICMS30() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS30(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS40 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS40 createTNFeInfNFeDetImpostoICMSICMS40() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS40(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS51 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS51 createTNFeInfNFeDetImpostoICMSICMS51() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS51(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS60 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS60 createTNFeInfNFeDetImpostoICMSICMS60() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS60(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS70 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS70 createTNFeInfNFeDetImpostoICMSICMS70() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS70(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMS90 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMS90 createTNFeInfNFeDetImpostoICMSICMS90() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMS90(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMSPart } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMSPart createTNFeInfNFeDetImpostoICMSICMSPart() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMSPart(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMSST } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMSST createTNFeInfNFeDetImpostoICMSICMSST() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMSST(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN101 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN101 createTNFeInfNFeDetImpostoICMSICMSSN101() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN101(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN102 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN102 createTNFeInfNFeDetImpostoICMSICMSSN102() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN102(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN201 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN201 createTNFeInfNFeDetImpostoICMSICMSSN201() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN201(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN202 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN202 createTNFeInfNFeDetImpostoICMSICMSSN202() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN202(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN500 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN500 createTNFeInfNFeDetImpostoICMSICMSSN500() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN500(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN900 } * */ public TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN900 createTNFeInfNFeDetImpostoICMSICMSSN900() { return new TNFe.InfNFe.Det.Imposto.ICMS.ICMSSN900(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.Rastro } * */ public TNFe.InfNFe.Det.Prod.Rastro createTNFeInfNFeDetProdRastro() { return new TNFe.InfNFe.Det.Prod.Rastro(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.InfProdNFF } * */ public TNFe.InfNFe.Det.Prod.InfProdNFF createTNFeInfNFeDetProdInfProdNFF() { return new TNFe.InfNFe.Det.Prod.InfProdNFF(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.InfProdEmb } * */ public TNFe.InfNFe.Det.Prod.InfProdEmb createTNFeInfNFeDetProdInfProdEmb() { return new TNFe.InfNFe.Det.Prod.InfProdEmb(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.VeicProd } * */ public TNFe.InfNFe.Det.Prod.VeicProd createTNFeInfNFeDetProdVeicProd() { return new TNFe.InfNFe.Det.Prod.VeicProd(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.Med } * */ public TNFe.InfNFe.Det.Prod.Med createTNFeInfNFeDetProdMed() { return new TNFe.InfNFe.Det.Prod.Med(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.Arma } * */ public TNFe.InfNFe.Det.Prod.Arma createTNFeInfNFeDetProdArma() { return new TNFe.InfNFe.Det.Prod.Arma(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.Comb.CIDE } * */ public TNFe.InfNFe.Det.Prod.Comb.CIDE createTNFeInfNFeDetProdCombCIDE() { return new TNFe.InfNFe.Det.Prod.Comb.CIDE(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.Comb.Encerrante } * */ public TNFe.InfNFe.Det.Prod.Comb.Encerrante createTNFeInfNFeDetProdCombEncerrante() { return new TNFe.InfNFe.Det.Prod.Comb.Encerrante(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.DetExport.ExportInd } * */ public TNFe.InfNFe.Det.Prod.DetExport.ExportInd createTNFeInfNFeDetProdDetExportExportInd() { return new TNFe.InfNFe.Det.Prod.DetExport.ExportInd(); } /** * Create an instance of {@link TNFe.InfNFe.Det.Prod.DI.Adi } * */ public TNFe.InfNFe.Det.Prod.DI.Adi createTNFeInfNFeDetProdDIAdi() { return new TNFe.InfNFe.Det.Prod.DI.Adi(); } /** * Create an instance of {@link TNFe.InfNFe.Ide.NFref.RefNF } * */ public TNFe.InfNFe.Ide.NFref.RefNF createTNFeInfNFeIdeNFrefRefNF() { return new TNFe.InfNFe.Ide.NFref.RefNF(); } /** * Create an instance of {@link TNFe.InfNFe.Ide.NFref.RefNFP } * */ public TNFe.InfNFe.Ide.NFref.RefNFP createTNFeInfNFeIdeNFrefRefNFP() { return new TNFe.InfNFe.Ide.NFref.RefNFP(); } /** * Create an instance of {@link TNFe.InfNFe.Ide.NFref.RefECF } * */ public TNFe.InfNFe.Ide.NFref.RefECF createTNFeInfNFeIdeNFrefRefECF() { return new TNFe.InfNFe.Ide.NFref.RefECF(); } /** * Create an instance of {@link TProtNFe.InfProt } * */ public TProtNFe.InfProt createTProtNFeInfProt() { return new TProtNFe.InfProt(); } /** * Create an instance of {@link TRetEnviNFe.InfRec } * */ public TRetEnviNFe.InfRec createTRetEnviNFeInfRec() { return new TRetEnviNFe.InfRec(); } /** * Create an instance of {@link TIpi.IPITrib } * */ public TIpi.IPITrib createTIpiIPITrib() { return new TIpi.IPITrib(); } /** * Create an instance of {@link TIpi.IPINT } * */ public TIpi.IPINT createTIpiIPINT() { return new TIpi.IPINT(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link SignatureType }{@code >}} * */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Signature") public JAXBElement<SignatureType> createSignature(SignatureType value) { return new JAXBElement<SignatureType>(_Signature_QNAME, SignatureType.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TEnviNFe }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "enviNFe") public JAXBElement<TEnviNFe> createEnviNFe(TEnviNFe value) { return new JAXBElement<TEnviNFe>(_EnviNFe_QNAME, TEnviNFe.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TNFe.InfNFe.Det.Imposto.ICMS }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "ICMS", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TNFe.InfNFe.Det.Imposto.ICMS> createTNFeInfNFeDetImpostoICMS(TNFe.InfNFe.Det.Imposto.ICMS value) { return new JAXBElement<TNFe.InfNFe.Det.Imposto.ICMS>(_TNFeInfNFeDetImpostoICMS_QNAME, TNFe.InfNFe.Det.Imposto.ICMS.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TNFe.InfNFe.Det.Imposto.PISST }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "PISST", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TNFe.InfNFe.Det.Imposto.PISST> createTNFeInfNFeDetImpostoPISST(TNFe.InfNFe.Det.Imposto.PISST value) { return new JAXBElement<TNFe.InfNFe.Det.Imposto.PISST>(_TNFeInfNFeDetImpostoPISST_QNAME, TNFe.InfNFe.Det.Imposto.PISST.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TNFe.InfNFe.Det.Imposto.COFINSST }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "COFINSST", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TNFe.InfNFe.Det.Imposto.COFINSST> createTNFeInfNFeDetImpostoCOFINSST(TNFe.InfNFe.Det.Imposto.COFINSST value) { return new JAXBElement<TNFe.InfNFe.Det.Imposto.COFINSST>(_TNFeInfNFeDetImpostoCOFINSST_QNAME, TNFe.InfNFe.Det.Imposto.COFINSST.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TIpi }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "IPI", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TIpi> createTNFeInfNFeDetImpostoIPI(TIpi value) { return new JAXBElement<TIpi>(_TNFeInfNFeDetImpostoIPI_QNAME, TIpi.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TNFe.InfNFe.Det.Imposto.ICMSUFDest }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "ICMSUFDest", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TNFe.InfNFe.Det.Imposto.ICMSUFDest> createTNFeInfNFeDetImpostoICMSUFDest(TNFe.InfNFe.Det.Imposto.ICMSUFDest value) { return new JAXBElement<TNFe.InfNFe.Det.Imposto.ICMSUFDest>(_TNFeInfNFeDetImpostoICMSUFDest_QNAME, TNFe.InfNFe.Det.Imposto.ICMSUFDest.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "vTotTrib", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<String> createTNFeInfNFeDetImpostoVTotTrib(String value) { return new JAXBElement<String>(_TNFeInfNFeDetImpostoVTotTrib_QNAME, String.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TNFe.InfNFe.Det.Imposto.II }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "II", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TNFe.InfNFe.Det.Imposto.II> createTNFeInfNFeDetImpostoII(TNFe.InfNFe.Det.Imposto.II value) { return new JAXBElement<TNFe.InfNFe.Det.Imposto.II>(_TNFeInfNFeDetImpostoII_QNAME, TNFe.InfNFe.Det.Imposto.II.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TNFe.InfNFe.Det.Imposto.ISSQN }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "ISSQN", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TNFe.InfNFe.Det.Imposto.ISSQN> createTNFeInfNFeDetImpostoISSQN(TNFe.InfNFe.Det.Imposto.ISSQN value) { return new JAXBElement<TNFe.InfNFe.Det.Imposto.ISSQN>(_TNFeInfNFeDetImpostoISSQN_QNAME, TNFe.InfNFe.Det.Imposto.ISSQN.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TNFe.InfNFe.Det.Imposto.COFINS }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "COFINS", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TNFe.InfNFe.Det.Imposto.COFINS> createTNFeInfNFeDetImpostoCOFINS(TNFe.InfNFe.Det.Imposto.COFINS value) { return new JAXBElement<TNFe.InfNFe.Det.Imposto.COFINS>(_TNFeInfNFeDetImpostoCOFINS_QNAME, TNFe.InfNFe.Det.Imposto.COFINS.class, TNFe.InfNFe.Det.Imposto.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TNFe.InfNFe.Det.Imposto.PIS }{@code >}} * */ @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "PIS", scope = TNFe.InfNFe.Det.Imposto.class) public JAXBElement<TNFe.InfNFe.Det.Imposto.PIS> createTNFeInfNFeDetImpostoPIS(TNFe.InfNFe.Det.Imposto.PIS value) { return new JAXBElement<TNFe.InfNFe.Det.Imposto.PIS>(_TNFeInfNFeDetImpostoPIS_QNAME, TNFe.InfNFe.Det.Imposto.PIS.class, TNFe.InfNFe.Det.Imposto.class, value); } }
[ "samuk.exe@hotmail.com" ]
samuk.exe@hotmail.com
e446b3abe04a2a7aab35d06975d455d9c6be8902
f269a5377819298dd4428ba936d371b2a631ef3d
/app/src/main/java/com/github/mikephil/charting/aaa/utils/ObjectPool.java
77db03b2e2927434d7585044048becdbafe3c53b
[ "Apache-2.0" ]
permissive
AndroidAppWidgetDemo/Android_Widget_MPAndroidChart
5d6bc20fac8c00aab992bf684d75a973b64d51ad
06e5eb2b5f52fd565b9fdf366bf62eef8d206d2a
refs/heads/master
2021-08-23T14:30:12.230130
2017-12-05T07:32:32
2017-12-05T07:32:32
113,148,512
0
0
null
null
null
null
UTF-8
Java
false
false
5,059
java
package com.github.mikephil.charting.aaa.utils; /** * An object pool for recycling of object instances extending Poolable. * * * Cost/Benefit : * Cost - The pool can only contain objects extending Poolable. * Benefit - The pool can very quickly determine if an object is elligable for storage without iteration. * Benefit - The pool can also know if an instance of Poolable is already stored in a different pool instance. * Benefit - The pool can grow as needed, if it is empty * Cost - However, refilling the pool when it is empty might incur a time cost with sufficiently large capacity. Set the replenishPercentage to a lower number if this is a concern. * */ public class ObjectPool<T extends ObjectPool.Poolable> { private static int ids = 0; private int poolId; private int desiredCapacity; private Object[] objects; private int objectsPointer; private T modelObject; private float replenishPercentage; /** * Returns an ObjectPool instance, of a given starting capacity, that recycles instances of a given Poolable object. * * @param withCapacity A positive integer value. * @param object An instance of the object that the pool should recycle. * @return */ public static synchronized ObjectPool create(int withCapacity, Poolable object){ ObjectPool result = new ObjectPool(withCapacity, object); result.poolId = ids; ids++; return result; } private ObjectPool(int withCapacity, T object){ if(withCapacity <= 0){ throw new IllegalArgumentException("Object Pool must be instantiated with a capacity greater than 0!"); } this.desiredCapacity = withCapacity; this.objects = new Object[this.desiredCapacity]; this.objectsPointer = 0; this.modelObject = object; this.replenishPercentage = 1.0f; this.refillPool(); } /** * Set the percentage of the pool to replenish on empty. Valid values are between * 0.00f and 1.00f * * @param percentage a value between 0 and 1, representing the percentage of the pool to replenish. */ public void setReplenishPercentage(float percentage){ float p = percentage; if(p > 1){ p = 1; } else if(p < 0f){ p = 0f; } this.replenishPercentage = p; } private void refillPool(){ this.refillPool(this.replenishPercentage); } private void refillPool(float percentage){ int portionOfCapacity = (int) (desiredCapacity * percentage); if(portionOfCapacity < 1){ portionOfCapacity = 1; }else if(portionOfCapacity > desiredCapacity){ portionOfCapacity = desiredCapacity; } for(int i = 0 ; i < portionOfCapacity ; i++){ this.objects[i] = modelObject.instantiate(); } objectsPointer = portionOfCapacity - 1; } /** * Returns an instance of Poolable. If get() is called with an empty pool, the pool will be * replenished. If the pool capacity is sufficiently large, this could come at a performance * cost. * * @return An instance of Poolable object T */ public synchronized T get(){ if(this.objectsPointer == -1 && this.replenishPercentage > 0.0f){ this.refillPool(); } T result = (T)objects[this.objectsPointer]; result.currentOwnerId = Poolable.NO_OWNER; this.objectsPointer--; return result; } /** * Recycle an instance of Poolable that this pool is capable of generating. * The T instance passed must not already exist inside this or any other ObjectPool instance. * * @param object An object of type T to recycle */ public synchronized void recycle(T object){ if(object.currentOwnerId != Poolable.NO_OWNER){ if(object.currentOwnerId == this.poolId){ throw new IllegalArgumentException("The object passed is already stored in this pool!"); }else { throw new IllegalArgumentException("The object to recycle already belongs to poolId " + object.currentOwnerId + ". Object cannot belong to two different pool instances simultaneously!"); } } this.objectsPointer++; if(this.objectsPointer >= objects.length){ this.resizePool(); } object.currentOwnerId = this.poolId; objects[this.objectsPointer] = object; } private void resizePool() { final int oldCapacity = this.desiredCapacity; this.desiredCapacity *= 2; Object[] temp = new Object[this.desiredCapacity]; for(int i = 0 ; i < oldCapacity ; i++){ temp[i] = this.objects[i]; } this.objects = temp; } public static abstract class Poolable{ public static int NO_OWNER = -1; int currentOwnerId = NO_OWNER; protected abstract Poolable instantiate(); } }
[ "bjxiaxueliang@corp.netease.com" ]
bjxiaxueliang@corp.netease.com
0dbd7a6dd237f89437d0ee22cd851003050c71b9
29daed5a7cf80ee3cc00b91f9444700e762f4b9a
/src/main/java/com/github/andersonsrocha/jescposImage/BitImageWrapper.java
bb0dedba35ef9fbeeea9d3c86a6f885bcf5e6066
[]
no_license
abadvincula/jescpos
380891294b8d4bb31d16778f45a529f4becca1fa
a6a210f74c0b27e37b70619edf2becdc46bf9e66
refs/heads/master
2022-01-09T20:24:55.705877
2019-06-07T11:56:34
2019-06-07T11:56:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,643
java
/* * Use of this source code is governed by the MIT license that can be * found in the LICENSE file. */ package com.github.andersonsrocha.jescposImage; import com.github.andersonsrocha.jescposConst.JescposEnum; import java.io.ByteArrayOutputStream; import java.util.List; /** * Supply ESC/POS Bit Image commands.<p> * using <code>ESC '*'</code> */ public class BitImageWrapper extends JescposEnum implements ImageWrapperInterface { private Justification justification; private BitImageMode mode; public BitImageWrapper() { justification = Justification.LEFT; mode = BitImageMode._24DEFAULT; } /** * Set horizontal justification of bar-code * * @param justification left, center or right * @return this object */ public BitImageWrapper setJustification(Justification justification) { this.justification = justification; return this; } /** * Select bit-image mode. <p> * * @param mode mode to be used on command ESC * * @return this object * @see #getBytes(JescposImage) */ public BitImageWrapper setMode(BitImageMode mode) { this.mode = mode; return this; } /** * Bit Image commands Assembly into ESC/POS bytes. <p> * <p> * Select justification <p> * ASCII ESC a n <p> * <p> * Set lineSpace in bytes <p> * ASCII ESC '3' n <p> * <p> * write all rows of the raster image <p> * ASCII ESC ✻ m nL nH d1 ... dk <p> * * @param image to be printed * @return bytes of ESC/POS * @see JescposImage */ @Override public byte[] getBytes(JescposImage image) { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); //justification bytes.write(ESC); bytes.write('a'); bytes.write(justification.value); //line feed bytes.write(ESC); bytes.write('3'); bytes.write(16); // getting first and second bytes separatted int nL = image.getWidthOfImageInBits() & 0xFF; int nH = (image.getWidthOfImageInBits() & 0xFF00) >> 8; List<ByteArrayOutputStream> RasterColumns = image.getRasterRows(mode.bitsForVerticalData); for (ByteArrayOutputStream rol : RasterColumns) { //write one rol to print bytes.write(ESC); bytes.write('*'); bytes.write(mode.value); bytes.write(nL); bytes.write(nH); bytes.write(rol.toByteArray(), 0, rol.size()); bytes.write(LF); } return bytes.toByteArray(); } }
[ "anderson_silva2015@outlook.com" ]
anderson_silva2015@outlook.com
c56c93e22bab5b6deef5de38898042d7a485acfb
abe42051b276790046c9efc18d9ffe8667dca98c
/src/main/java/com/rdiot/awsiot/NonBlockingPublishListener.java
9369f548483ea3791be619fc336c3b93a919cde9
[]
no_license
rdiot/rdiot-p021
322b02568e9ca79344710fd766737970d1226f48
ac2a482c4ececeea4ad7ca9d942b3f7dd82a164c
refs/heads/master
2020-03-20T18:31:20.582672
2018-06-16T15:54:16
2018-06-16T15:54:16
137,591,951
6
1
null
null
null
null
UTF-8
Java
false
false
807
java
package com.rdiot.awsiot; import com.amazonaws.services.iot.client.AWSIotMessage; import com.amazonaws.services.iot.client.AWSIotQos; public class NonBlockingPublishListener extends AWSIotMessage { public NonBlockingPublishListener(String topic, AWSIotQos qos, String payload) { super(topic, qos, payload); } @Override public void onSuccess() { System.out.println(System.currentTimeMillis() + ": >>> " + getStringPayload()); } @Override public void onFailure() { System.out.println(System.currentTimeMillis() + ": publish failed for " + getStringPayload()); } @Override public void onTimeout() { System.out.println(System.currentTimeMillis() + ": publish timeout for " + getStringPayload()); } }
[ "noreply@github.com" ]
noreply@github.com
18b3cd48adb1e2d39e670c6635aef169b14f49bc
8badc0866f5400ad6b6ea01b7f1ccf641be342d8
/paycenter-api/src/main/java/cn/gdeng/paycenter/web/api/converter/DateStringConverter.java
60b366f691ec38631d9ff8a262bc382f49bd07b0
[]
no_license
f3226912/paycenter
db5a02cfb65ee13bd5b0008d45b747b14f9e1379
c45d52c48213b20a36cb554d42445568e9edbc96
refs/heads/master
2021-01-19T06:59:00.283378
2017-04-07T06:50:43
2017-04-07T06:50:43
87,513,928
1
4
null
null
null
null
UTF-8
Java
false
false
403
java
package cn.gdeng.paycenter.web.api.converter; import java.util.Date; import org.springframework.core.convert.converter.Converter; public class DateStringConverter extends DateConverterBase implements Converter<Date, String> { @Override public String convert(Date source) { if (source == null){ return ""; } return getDateFormat().format(source); } }
[ "253332973@qq.com" ]
253332973@qq.com
561a70356b2836d6b45114126e090b1ca561891a
f5800d6d51a530bffb1b0594cc25692d8436ba05
/ListadeProdutos/app/src/androidTest/java/br/com/listaprodutos/listadeprodutos/ExampleInstrumentedTest.java
c4a1b5505fc995a2209664da839150b44fa94a90
[]
no_license
otaviohenrique1/curso-android-alura
0c1ffd89cabbdd3d4b5e1449f6eea2ba0e5e08a6
515b0d941a56879afc91aa5eba595621df401da5
refs/heads/master
2021-02-18T17:49:14.959547
2020-03-05T19:31:01
2020-03-05T19:31:01
245,219,162
0
0
null
null
null
null
UTF-8
Java
false
false
799
java
package br.com.listaprodutos.listadeprodutos; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("br.com.listaprodutos.listadeprodutos", appContext.getPackageName()); } }
[ "noreply@github.com" ]
noreply@github.com
5aa2cfe9689a7a1336274b10178886483b91178c
b63572fddbafe4ad290d2405241f256b0b2aca13
/src/filter/AdminFilter.java
a3dfdcac8ae22008199c9cbcb90e96a0303e5857
[]
no_license
liawuhenmeidi/meidi
01d80af2cd59bdb5d78cbfefa923d534f764cd16
4eabd5a1ec759be7a04028ab66c8c253cd8b0c22
refs/heads/master
2021-01-17T09:18:36.896335
2016-05-17T11:30:36
2016-05-17T11:30:36
24,178,886
5
3
null
null
null
null
UTF-8
Java
false
false
1,376
java
package filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import user.User; public class AdminFilter implements Filter { protected static Log logger = LogFactory.getLog(AdminFilter.class); public void destroy() { logger.info("authfilter destroy"); } public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { //logger.info("authfilter dofilter"); HttpServletRequest request = (HttpServletRequest)req; HttpServletResponse response = (HttpServletResponse)resp; HttpSession session = request.getSession(false); if(session == null || (User)session.getAttribute("user") == null) { response.sendRedirect( request.getContextPath() + "/meidiserver/login.jsp"); return; } chain.doFilter(req, resp); } public void init(FilterConfig config) throws ServletException { logger.info("authfilter init"); } }
[ "think@Lenovo-PC" ]
think@Lenovo-PC
3f8b2a7e22207a61f82819e972fcd2c20e408345
abc7e2b2a4f4f835b5bc695dd8087e1c8c1199df
/pankaj/SparkExamples/transent/src/com/verifone/isd/vsms2/sales/ent/trans/MobileSLAData.java
7fdf1119d295eee2bbbdd085767e53e4d81c15dd
[]
no_license
katpb/spark-mongo-test
db54e83f94fc8f4d7638ea0838742331711025ed
4489ae3315dafc828ec5fbeefd3257bc2252be8c
refs/heads/master
2023-04-28T15:34:31.788929
2020-07-19T17:49:46
2020-07-19T17:49:46
268,293,363
0
2
null
2023-04-21T20:44:21
2020-05-31T14:09:23
Java
UTF-8
Java
false
false
1,181
java
/** * */ package com.verifone.isd.vsms2.sales.ent.trans; import java.io.Serializable; /** * This class holds mobile SLA specific auth-data to be populated in mobile advice request * * @author t_shivrajs1 * */ public class MobileSLAData implements Serializable { private static final long serialVersionUID = 7031804067586264737L; private String transactionRefId; private String hostId; private String hostName; /** * @return the transactionRefId */ public String getTransactionRefId() { return transactionRefId; } /** * @param transactionRefId the transactionRefId to set */ public void setTransactionRefId(String transactionRefId) { this.transactionRefId = transactionRefId; } /** * @return the hostId */ public String getHostId() { return hostId; } /** * @param histId the hostId to set */ public void setHostId(String hostId) { this.hostId = hostId; } /** * @return the hostName */ public String getHostName() { return hostName; } /** * @param hostName the hostName to set */ public void setHostName(String hostName) { this.hostName = hostName; } }
[ "PankajM2@verifone.com" ]
PankajM2@verifone.com
c6db6cbd35ea2be2a5137fdc3b7d86f4c7878125
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_699a08d7df9c2cceb8c331d330bb4e23fa99a75e/JSONHelper/16_699a08d7df9c2cceb8c331d330bb4e23fa99a75e_JSONHelper_s.java
19a1fdd86e62dab85221e5b5f649696f70e90956
[]
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
15,932
java
package com.dozuki.ifixit.util; import android.text.Spannable; import android.text.Spanned; import android.text.style.URLSpan; import android.util.Log; import com.dozuki.ifixit.dozuki.model.Site; import com.dozuki.ifixit.gallery.model.UploadedImageInfo; import com.dozuki.ifixit.gallery.model.UserImageInfo; import com.dozuki.ifixit.gallery.model.UserImageList; import com.dozuki.ifixit.guide_view.model.Embed; import com.dozuki.ifixit.guide_view.model.Guide; import com.dozuki.ifixit.guide_view.model.GuideInfo; import com.dozuki.ifixit.guide_view.model.GuidePart; import com.dozuki.ifixit.guide_view.model.GuideStep; import com.dozuki.ifixit.guide_view.model.GuideTool; import com.dozuki.ifixit.guide_view.model.OEmbed; import com.dozuki.ifixit.guide_view.model.StepImage; import com.dozuki.ifixit.guide_view.model.StepLine; import com.dozuki.ifixit.guide_view.model.StepVideo; import com.dozuki.ifixit.guide_view.model.StepVideoThumbnail; import com.dozuki.ifixit.guide_view.model.VideoEncoding; import com.dozuki.ifixit.login.model.User; import com.dozuki.ifixit.topic_view.model.TopicLeaf; import com.dozuki.ifixit.topic_view.model.TopicNode; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Map; public class JSONHelper { private static final String LEAF_INDICATOR = "TOPICS"; public static ArrayList<Site> parseSites(String json) { ArrayList<Site> sites = new ArrayList<Site>(); try { JSONArray jSites = new JSONArray(json); Site site; for (int i = 0; i < jSites.length(); i++) { site = parseSite(jSites.getJSONObject(i)); if (site != null) { sites.add(site); } } } catch (JSONException e) { Log.e("iFixit", "Error parsing sites: " + e); } return sites; } private static Site parseSite(JSONObject jSite) throws JSONException { Site site = new Site(jSite.getInt("siteid")); site.mName = jSite.getString("name"); site.mDomain = jSite.getString("domain"); site.mTitle = jSite.getString("title"); site.mTheme = jSite.getString("theme"); site.mPublic = !jSite.getBoolean("private"); site.mDescription = jSite.getString("description"); site.mAnswers = jSite.getInt("answers") != 0; setAuthentication(site, jSite.getJSONObject("authentication")); return site; } private static void setAuthentication(Site site, JSONObject jAuth) throws JSONException { site.mStandardAuth = jAuth.has("standard") ? jAuth.getBoolean("standard") : false; site.mSsoUrl = jAuth.has("sso") ? jAuth.getString("sso") : null; site.mPublicRegistration = jAuth.getBoolean("public-registration"); } /** * Guide parsing */ public static Guide parseGuide(String json) throws JSONException { JSONObject jGuideInfo = new JSONObject(json); JSONObject jGuide = jGuideInfo.getJSONObject("guide"); JSONArray jSteps = jGuide.getJSONArray("steps"); JSONArray jTools = jGuide.getJSONArray("tools"); JSONArray jParts = jGuide.getJSONArray("parts"); JSONObject jAuthor = jGuide.getJSONObject("author"); JSONObject jImage = jGuide.getJSONObject("image"); Guide guide = new Guide(jGuideInfo.getInt("guideid")); guide.setTitle(jGuide.getString("title")); guide.setTopic(jGuideInfo.getString("topic")); guide.setSubject(jGuide.getString("subject")); guide.setAuthor(jAuthor.getString("text")); guide.setTimeRequired(jGuide.getString("time_required")); guide.setDifficulty(jGuide.getString("difficulty")); guide.setIntroduction(jGuide.getString("introduction")); guide.setIntroImage(jImage.getString("text")); guide.setSummary(jGuide.getString("summary")); for (int i = 0; i < jSteps.length(); i++) { guide.addStep(parseStep(jSteps.getJSONObject(i))); } for (int i = 0; i < jTools.length(); i++) { guide.addTool(parseTool(jTools.getJSONObject(i))); } for (int i = 0; i < jParts.length(); i++) { guide.addPart(parsePart(jParts.getJSONObject(i))); } return guide; } private static GuidePart parsePart(JSONObject jPart) throws JSONException { return new GuidePart(jPart.getString("text"), jPart.getString("url"), jPart.getString("thumbnail"), jPart.getString("notes")); } private static GuideTool parseTool(JSONObject jTool) throws JSONException { return new GuideTool(jTool.getString("text"), jTool.getString("url"), jTool.getString("thumbnail"), jTool.getString("notes")); } private static GuideStep parseStep(JSONObject jStep) throws JSONException { JSONArray jLines = jStep.getJSONArray("lines"); GuideStep step = new GuideStep(jStep.getInt("number")); step.setTitle(jStep.getString("title")); try { JSONObject jMedia = jStep.getJSONObject("media"); if (jMedia.has("image")) { JSONArray jImages = jMedia.getJSONArray("image"); for (int i = 0; i < jImages.length(); i++) step.addImage(parseImage(jImages.getJSONObject(i))); } if (jMedia.has("video")) { JSONObject jVideo = jMedia.getJSONObject("video"); step.addVideo(parseVideo(jVideo)); } if (jMedia.has("embed")) { JSONObject jEmbed = jMedia.getJSONObject("embed"); step.addEmbed(parseEmbed(jEmbed)); } } catch (JSONException e) { StepImage image = new StepImage(0); image.setOrderby(1); image.setText(""); step.addImage(image); } for (int i = 0; i < jLines.length(); i++) { step.addLine(parseLine(jLines.getJSONObject(i))); } return step; } public static Map<String, String> getQueryMap(String url) { String query = url.substring(url.indexOf('?') + 1); String[] params = query.split("&"); Map<String, String> map = new HashMap<String, String>(); for (String param : params) { String name = param.split("=")[0]; String value = param.split("=")[1]; map.put(name, value); } return map; } private static StepImage parseImage(JSONObject jImage) throws JSONException { StepImage image = new StepImage(jImage.getInt("imageid")); // last image doesn't have orderby so this is necessary. API bug? try { image.setOrderby(jImage.getInt("orderby")); } catch (JSONException e) { image.setOrderby(1); } image.setText(jImage.getString("text")); return image; } private static StepVideo parseVideo(JSONObject jVideo) throws JSONException { StepVideo video = new StepVideo(); try { JSONArray jEncodings = jVideo.getJSONArray("encoding"); for (int i = 0; i < jEncodings.length(); i++) { video.addEncoding(parseVideoEncoding(jEncodings.getJSONObject(i))); } } catch (JSONException e) { e.printStackTrace(); } video.setThumbnail(parseVideoThumbnail(jVideo.getJSONObject("thumbnail"))); return video; } private static StepVideoThumbnail parseVideoThumbnail(JSONObject jVideoThumb) throws JSONException { String guid = jVideoThumb.getString("guid"); int imageid = jVideoThumb.getInt("imageid"); String ratio = jVideoThumb.getString("ratio"); int width = jVideoThumb.getInt("width"); int height = jVideoThumb.getInt("height"); String url = jVideoThumb.getString("medium"); url = url.substring(0, url.lastIndexOf(".")); Log.w("StepVideoThumbnail URL:", " >>> " + url); return new StepVideoThumbnail(guid, imageid, url, ratio, width, height); } private static Embed parseEmbed(JSONObject jEmbed) throws JSONException { Embed em = new Embed(jEmbed.getInt("width"), jEmbed.getInt("height"), jEmbed.getString("type"), jEmbed.getString("url")); em.setContentURL(getQueryMap(jEmbed.getString("url")).get("url")); return em; } public static OEmbed parseOEmbed(String embed) throws JSONException { JSONObject jOEmbed = new JSONObject(embed); String thumbnail = null; if (jOEmbed.has("thumbnail_url")) { thumbnail = jOEmbed.getString("thumbnail_url"); } Document doc = Jsoup.parse(jOEmbed.getString("html")); return new OEmbed(jOEmbed.getString("html"), doc.getElementsByAttribute("src").get(0).attr("src"), thumbnail); } private static StepLine parseLine(JSONObject jLine) throws JSONException { return new StepLine(jLine.getString("bullet"), jLine.getInt("level"), jLine.getString("text")); } /** * Topic hierarchy parsing */ public static TopicNode parseTopics(String json) throws JSONException { JSONObject jTopics = new JSONObject(json); ArrayList<TopicNode> topics = parseTopicChildren(jTopics); TopicNode root = null; root = new TopicNode(); root.addAllTopics(topics); return root; } /** * Reads through the given JSONObject and adds any topics to the given * topic */ private static ArrayList<TopicNode> parseTopicChildren(JSONObject jTopic) throws JSONException { @SuppressWarnings("unchecked") Iterator<String> iterator = jTopic.keys(); String topicName; ArrayList<TopicNode> topics = new ArrayList<TopicNode>(); TopicNode currentTopic; while (iterator.hasNext()) { topicName = iterator.next(); if (topicName.equals(LEAF_INDICATOR)) { topics.addAll(parseTopicLeaves( jTopic.getJSONArray(LEAF_INDICATOR))); } else { currentTopic = new TopicNode(topicName); currentTopic.addAllTopics(parseTopicChildren( jTopic.getJSONObject(topicName))); topics.add(currentTopic); } } return topics; } private static ArrayList<TopicNode> parseTopicLeaves(JSONArray jLeaves) throws JSONException { ArrayList<TopicNode> topics = new ArrayList<TopicNode>(); for (int i = 0; i < jLeaves.length(); i++) { topics.add(new TopicNode(jLeaves.getString(i))); } return topics; } /** * Topic leaf parsing */ public static TopicLeaf parseTopicLeaf(String json) throws JSONException { JSONObject jTopic = new JSONObject(json); JSONArray jGuides = jTopic.getJSONArray("guides"); JSONObject jSolutions = jTopic.getJSONObject("solutions"); JSONObject jInfo = jTopic.getJSONObject("topic_info"); TopicLeaf topicLeaf = new TopicLeaf(jInfo.getString("name")); for (int i = 0; i < jGuides.length(); i++) { topicLeaf.addGuide(parseGuideInfo(jGuides.getJSONObject(i))); } topicLeaf.setNumSolutions(Integer.parseInt(jSolutions.getString("count"))); topicLeaf.setSolutionsUrl(jSolutions.getString("url")); return topicLeaf; } private static GuideInfo parseGuideInfo(JSONObject jGuide) { try { GuideInfo guideInfo = new GuideInfo(jGuide.getInt("guideid")); guideInfo.setSubject(jGuide.getString("subject")); guideInfo.setImage(jGuide.getString("image_url")); guideInfo.setTitle(jGuide.getString("title")); guideInfo.setType(jGuide.getString("type")); guideInfo.setUrl(jGuide.getString("url")); return guideInfo; } catch (JSONException e) { Log.e("iFixit", "Error parsing guide info: " + e); return null; } } /** * Parsing list of UserImageInfo. */ public static UserImageList parseUserImages(String json) throws JSONException { JSONArray jImages = new JSONArray(json); UserImageList userImageList = new UserImageList(); for (int i = 0; i < jImages.length(); i++) { userImageList.addImage((parseUserImageInfo(jImages.getJSONObject(i)))); } return userImageList; } public static UserImageInfo parseUserImageInfo(JSONObject jImage) throws JSONException { UserImageInfo userImageInfo = new UserImageInfo(); userImageInfo.setImageid(jImage.getString("imageid")); userImageInfo.setGuid(jImage.getString("guid")); userImageInfo.setHeight(jImage.getString("height")); userImageInfo.setWidth(jImage.getString("width")); userImageInfo.setRatio(jImage.getString("ratio")); return userImageInfo; } public static UploadedImageInfo parseUploadedImageInfo(String image) throws JSONException { JSONObject jImage = new JSONObject(image); UploadedImageInfo userImageInfo = new UploadedImageInfo(); userImageInfo.setImageid(jImage.getString("imageid")); userImageInfo.setGuid(jImage.getString("guid")); return userImageInfo; } /** * Login parsing info */ public static User parseLoginInfo(String json) throws JSONException { JSONObject jUser = new JSONObject(json); User user = new User(); user.setUserid(jUser.getString("userid")); user.setUsername(jUser.getString("username")); user.setImageid(jUser.getString("imageid")); user.setSession(jUser.getString("session")); return user; } /** * Returns the error message contained in the given JSON, or null if one * does not exist. * * e.g. Returns "Guide not found" for: * "{"error":true,"msg":"Guide not found"}" */ public static String parseError(String json) { String error = null; try { JSONObject jError = new JSONObject(json); if (jError.getBoolean("error")) { error = jError.getString("msg"); } }catch(JSONException e) { } return error; } /** * Removes relative a hrefs * * TODO: Update domain with the current site's domain. * * @param spantext (from Html.fromhtml()) * @return spanned with fixed links */ public static Spanned correctLinkPaths(Spanned spantext) { Object[] spans = spantext.getSpans(0, spantext.length(), Object.class); for (Object span : spans) { int start = spantext.getSpanStart(span); int end = spantext.getSpanEnd(span); int flags = spantext.getSpanFlags(span); if (span instanceof URLSpan) { URLSpan urlSpan = (URLSpan) span; if (!urlSpan.getURL().startsWith("http")) { if (urlSpan.getURL().startsWith("/")) { urlSpan = new URLSpan("http://www.ifixit.com" + urlSpan.getURL()); } else { urlSpan = new URLSpan("http://www.ifixit.com/" + urlSpan.getURL()); } } ((Spannable)spantext).removeSpan(span); ((Spannable)spantext).setSpan(urlSpan, start, end, flags); } } return spantext; } private static VideoEncoding parseVideoEncoding(JSONObject jVideoEncoding) throws JSONException { VideoEncoding encoding = new VideoEncoding(jVideoEncoding.getInt("width"), jVideoEncoding.getInt("height"), jVideoEncoding.getString("url"), jVideoEncoding.getString("format")); return encoding; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d1f962101b01a0133a2f70e6b6d3cf92940a9a9d
8cf50228b37db664448f37a670621544c0b0f67d
/src/com/threads/BlockSynchronization.java
7bfc99725da9aa2ef90ed0b0afec4ee6d1771e08
[]
no_license
MalleNaveen/coreJavaProgramesPractice
048cfa190b027446e59a16e461d24f9c1cc4e44b
31117453f34afa15b4c2703455b0ef23c5776093
refs/heads/master
2023-03-20T16:57:10.527721
2021-03-20T12:01:41
2021-03-20T12:01:41
345,021,124
1
0
null
null
null
null
MacCentralEurope
Java
false
false
1,724
java
package com.threads; import java.io.*; import java.util.*; /* * When a thread enters into synchronized method or block, it acquires lock and once it completes its task and exits from the synchronized method, it releases the lock. When thread enters into synchronized instance method or block, it acquires Object level lock and when it enters into synchronized static method or block it acquires class level lock. Java synchronization will throw null pointer exception if Object used in synchronized block is null. For example, If in synchronized(instance) , instance is null then it will throw null pointer exception. In Java, wait(), notify() and notifyAll() are the important methods that are used in synchronization. You can not apply java synchronized keyword with the variables. Donít synchronize on the non-final field on synchronized block because the reference to the non-final field may change anytime and then different threads might synchronize on different objects i.e. no synchronization at all. */ class Geek { String name = ""; public int count = 0; public void geekName(String geek, List<String> list) { // Only one thread is permitted // to change geek's name at a time. synchronized(this) { name = geek; count++; // how many threads change geek's name. } // All other threads are permitted // to add geek name into list. list.add(geek); } } public class BlockSynchronization { public static void main (String[] args) { Geek gk = new Geek(); List<String> list = new ArrayList<String>(); gk.geekName("mohit", list); gk.geekName("naveen", list); System.out.println(gk.name); } }
[ "noreply@github.com" ]
noreply@github.com
2f9e799e47e282e2419f447aaecf9e8a0d23dd8b
d3534c9e89f0d2be4b69451b0b9c7fcb2f436cf6
/sdi2021-213-lab-soap-cliente/src/main/java/com/uniovi/wsdl/ObjectFactory.java
0baeacda554e2dadac7efe4e65e9928136dc591f
[]
no_license
uo258270/sdi2021-213-lab-soap-sw
1f1356830125f93e2e1016eefb5c68ae946cc9c8
d62900513845016e72f11515f6741ceed7bb62f1
refs/heads/main
2023-04-19T11:20:39.471576
2021-04-28T16:41:36
2021-04-28T16:41:36
362,506,777
0
0
null
null
null
null
UTF-8
Java
false
false
1,882
java
// // Este archivo ha sido generado por la arquitectura JavaTM para la implantación de la referencia de enlace (JAXB) XML v2.3.0 // Visite <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Todas las modificaciones realizadas en este archivo se perderán si se vuelve a compilar el esquema de origen. // Generado el: 2020.04.22 a las 08:05:06 PM CEST // package com.uniovi.wsdl; import javax.xml.bind.annotation.XmlRegistry; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the com.uniovi.wsdl package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.uniovi.wsdl * */ public ObjectFactory() { } /** * Create an instance of {@link GetMarksRequest } * */ public GetMarksRequest createGetMarksRequest() { return new GetMarksRequest(); } /** * Create an instance of {@link GetMarksResponse } * */ public GetMarksResponse createGetMarksResponse() { return new GetMarksResponse(); } /** * Create an instance of {@link User } * */ public User createUser() { return new User(); } /** * Create an instance of {@link Mark } * */ public Mark createMark() { return new Mark(); } }
[ "uo258270@uniovi.es" ]
uo258270@uniovi.es
e23517f32f01977865a04e8663cb4cf90c40af0b
47ca50146f11e9e2d189fbf7c12e3ed12390b30c
/Payhum/src/com/openhr/position/action/ReadPositionAction.java
773ea7b722508d597fdef4fa9d04c9d664fd078c
[]
no_license
payhum/codebase
ddb8eba4754ea59a9e74e0a522475db8d5904413
b7c4c29a245c6c72e0f2f4c0e81f77ef9be26343
refs/heads/master
2020-12-24T16:15:04.226749
2014-09-15T14:51:18
2014-09-15T14:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,831
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.openhr.position.action; import com.openhr.data.Position; import com.openhr.factories.PositionFactory; import com.openhr.position.form.PositionForm; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONArray; import net.sf.json.JSONSerializer; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; /** * * @author Mekbib */ public class ReadPositionAction extends Action { @Override public ActionForward execute(ActionMapping map, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { JSONArray result = null; PositionForm pf=null; try { List<PositionForm> pfl=new ArrayList<PositionForm>(); List<Position> positions = PositionFactory.findAll(); for(Position pp:positions) { pf=new PositionForm(); pf.setName(pp.getName()); pf.setCoantcatVal(pp.getId()+"-"+pp.getLowSal()+"-"+pp.getHighSal()); pfl.add(pf); } result = JSONArray.fromObject(pfl); } catch (Exception e) { e.printStackTrace(); } if(result != null) { response.setContentType("application/json; charset=utf-8"); PrintWriter out = response.getWriter(); out.print(result.toString()); out.flush(); } return map.findForward(""); } }
[ "vijayns@gmail.com" ]
vijayns@gmail.com
c288e80e296c040ec95546ad6d69d98ec424c24f
718b754fe4c8741c939bb9aec5016eb7f2b6d270
/part07-Part07_07.RecipeSearch/src/main/java/RecipeSearch.java
27101f6b30430ee08bf5b01d59e80e551a496d67
[]
no_license
ericcc70/mooc-java-programming-1
6384018cf12fd6248a46c1f12ff8dffe044da805
ea1abce055f1142cda48cbd5fad911515df7302f
refs/heads/main
2023-02-19T20:37:07.810639
2021-01-15T02:05:36
2021-01-15T02:05:36
329,778,707
0
0
null
null
null
null
UTF-8
Java
false
false
4,951
java
import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class RecipeSearch { public static void main(String[] args) { ArrayList<String> recipes = new ArrayList<>(); // ALL recipes in recipe.txt ArrayList<Recipe> recipesO = new ArrayList<>(); // recipes splitted & grouped in objects ArrayList<Integer> indices = new ArrayList<>(); // cooking times in all recipes list List<String> ingr; // ingredients separated by recipe // create recipes - all lines together Scanner user = new Scanner(System.in); try (Scanner scanner = new Scanner(Paths.get(user.next()))) { while (scanner.hasNextLine()) { String row = scanner.nextLine(); if (row.isEmpty()) { continue; } recipes.add(row); } } catch (Exception e) { System.out.println("An error occured.."); } // find cooking times (integers) in file for (String r: recipes) { if (isInteger(r)) { indices.add(recipes.indexOf(r)); } } // split and group recipes for (int i = 0; i < indices.size() - 1; i++) { int time = Integer.valueOf(recipes.get(indices.get(i))); String name = recipes.get(indices.get(i) - 1); recipesO.add(new Recipe(name, time, recipes.subList(indices.get(i) + 1, indices.get(i + 1) - 1))); } int j = indices.size() - 1; int time = Integer.valueOf(recipes.get(indices.get(j))); String name = recipes.get(indices.get(j) - 1); recipesO.add(new Recipe(name, time, recipes.subList(indices.get(j) + 1, recipes.size()))); /* for (Recipe r: recipesO) { System.out.println(r); System.out.println(r.getIngr()); } */ System.out.println("File to read: recipes.txt"); System.out.println(""); System.out.println("Commands:"); System.out.println("list - lists the recipes"); System.out.println("stop - stops the program"); System.out.println("find name - searches recipes by name"); System.out.println("find cooking time - searches recipes by cooking time"); System.out.println("find ingredient - searches recipes by ingredient"); System.out.println(""); // accept command from user and execute command while (true) { System.out.print("Enter command: "); String command = user.nextLine(); // command "stop" implementation if (command.equals("stop")) { break; } // command "list" implementation if (command.equals("list")) { System.out.println(""); System.out.println("Recipes:"); for (Recipe r: recipesO) { System.out.println(r); } System.out.println(""); } // command "find name" implementation if (command.equals("find name")) { System.out.print("Searched word: "); String search = user.nextLine(); System.out.println(""); System.out.println("Recipes:"); for (Recipe r: recipesO) { if (r.getName().contains(search)) { System.out.println(r); } } System.out.println(""); } // command "find cooking time" implementation if (command.equals("find cooking time")) { System.out.print("Max cooking time: "); int maxTime = Integer.valueOf(user.nextLine()); System.out.println(""); System.out.println("Recipes:"); for (Recipe r: recipesO) { if (r.getTime() <= maxTime) { System.out.println(r); } } System.out.println(""); } // command "find ingredient" implementation if (command.equals("find ingredient")) { System.out.print("Ingredient: "); String ingredient = user.nextLine(); System.out.println(""); System.out.println("Recipes:"); for (Recipe r: recipesO) { if (r.getIngr().contains(ingredient)) { System.out.println(r); } } System.out.println(""); } } } public static boolean isInteger(String s) { try { Integer.parseInt(s); return true; } catch (Exception e) { return false; } } }
[ "noreply@github.com" ]
noreply@github.com
b970f273862b4609ca9291bdedb2b94ff2b23666
1690b1a472c7ae779832c00b762464c073baed09
/src/org/scapesoft/game/npc/combat/impl/RefugeOfFearSOLMageMininionCombat.java
ffedcfdd333b63c703198b8b68701b33a3398ddc
[]
no_license
bradleysixx/insomniapk-server
e5d78ab14786e49b18dccf742a6572da698b8ec6
e5ec12bfca18ed6885c2a99320f12d908a9168f5
refs/heads/master
2022-01-23T20:23:22.177976
2019-04-02T18:42:24
2019-04-02T18:42:24
177,716,541
0
0
null
null
null
null
UTF-8
Java
false
false
2,131
java
package org.scapesoft.game.npc.combat.impl; import java.util.Random; import org.scapesoft.game.Animation; import org.scapesoft.game.Entity; import org.scapesoft.game.Graphics; import org.scapesoft.game.World; import org.scapesoft.game.npc.NPC; import org.scapesoft.game.npc.combat.CombatScript; import org.scapesoft.game.npc.combat.NPCCombatDefinitions; import org.scapesoft.game.player.Player; import org.scapesoft.game.tasks.WorldTask; import org.scapesoft.game.tasks.WorldTasksManager; public class RefugeOfFearSOLMageMininionCombat extends CombatScript { @Override public Object[] getKeys() { return new Object[] { 15172 }; } @Override public int attack(final NPC npc, final Entity target) { final NPCCombatDefinitions defs = npc.getCombatDefinitions(); boolean player = target instanceof Player; // shouldn't have player as // target unless bind spell. startAttack(npc, target, player, player ? 4 : new Random().nextInt(4)); return defs.getAttackDelay(); } private void startAttack(final NPC npc, final Entity entity, boolean player, int attack) { switch (attack) { case 0: // Vengeance other - to be casted on one of the minions. if (entity.getTemporaryAttributtes().get("vengeance_activated") == Boolean.TRUE) { startAttack(npc, entity, player, new Random().nextInt(3) + 1); return; } npc.setNextAnimation(new Animation(4411)); entity.setNextGraphics(new Graphics(725, 0, 96)); break; case 1: // Heal other - to be casted on one of the minions. case 2: // ? case 3: // ? case 4: // Entangle - to be casted on the player. if (!player) { startAttack(npc, entity, player, new Random().nextInt(4)); return; } final Player p = (Player) entity; npc.setNextGraphics(new Graphics(177, 0, 96)); npc.setNextAnimation(new Animation(710)); WorldTasksManager.schedule(new WorldTask() { @Override public void run() { super.stop(); p.setNextGraphics(new Graphics(179, 0, 96)); } }, 2); p.addFreezeDelay(20000, true); World.sendProjectile(npc, p, 178, 36, 32, 50, 70, 0, 0); break; } } }
[ "37641668+bradleysixx@users.noreply.github.com" ]
37641668+bradleysixx@users.noreply.github.com
ec8f947c904ca76b0037800874efb46dba77798e
c74c1426677a7f07a518f1b3c12b5f76baa493aa
/dkplayer-ui/src/main/java/com/dueeeke/videocontroller/MarqueeTextView.java
b2c92550b241d8a8e860efeb48def9f757f6228e
[ "Apache-2.0" ]
permissive
1982582704/DKVideoPlayer
e16f1bcc24ee2213e8508ffdc4869fa1562147d2
f46b106d60143cdb2001029e0ca7076decfdbf82
refs/heads/master
2020-09-26T10:41:43.394571
2019-12-04T15:31:48
2019-12-04T15:31:48
226,238,217
1
0
Apache-2.0
2019-12-06T03:28:25
2019-12-06T03:28:24
null
UTF-8
Java
false
false
925
java
package com.dueeeke.videocontroller; import android.content.Context; import android.util.AttributeSet; import android.widget.TextView; /** * 实现跑马灯效果的TextView */ public class MarqueeTextView extends TextView { private boolean mNeedFocus; public MarqueeTextView(Context context) { super(context); } public MarqueeTextView(Context context, AttributeSet attrs) { super(context, attrs); } public MarqueeTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } //返回textview是否处在选中的状态 //而只有选中的textview才能够实现跑马灯效果 @Override public boolean isFocused() { if (mNeedFocus) { return false; } return super.isFocused(); } public void setNeedFocus(boolean needFocus) { mNeedFocus = needFocus; } }
[ "xinyunjian1995@gmail.com" ]
xinyunjian1995@gmail.com
ecd735922fbef36463f34a942cf1ccb2cd5bc147
d18af2a6333b1a868e8388f68733b3fccb0b4450
/java/src/retrofit/Endpoints$FixedEndpoint.java
001bbd74bbba2758ea74c1da8205e058a065de4d
[]
no_license
showmaxAlt/showmaxAndroid
60576436172495709121f08bd9f157d36a077aad
d732f46d89acdeafea545a863c10566834ba1dec
refs/heads/master
2021-03-12T20:01:11.543987
2015-08-19T20:31:46
2015-08-19T20:31:46
41,050,587
0
1
null
null
null
null
UTF-8
Java
false
false
595
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package retrofit; // Referenced classes of package retrofit: // Endpoint, Endpoints private static class name implements Endpoint { private final String apiUrl; private final String name; public String getName() { return name; } public String getUrl() { return apiUrl; } (String s, String s1) { apiUrl = s; name = s1; } }
[ "invisible@example.com" ]
invisible@example.com
5b930fd0358bc247c40d98cd5e246fbdb5fead65
bb534a46e039662a48a25d095ae4b209617f91cc
/src/cfdi33/CTipoDeComprobante.java
b86d3fc91dd8956c96c31caba8ef753bd05e89bc
[]
no_license
dcore099/FacturaElectronica-CFDI-ver-3.3
378bb7ef356fff3120f25891f141b254d3977f06
ce76cc70fd5d5419d2cb9fd99e623cf7ebb39b80
refs/heads/master
2021-09-11T19:34:24.033249
2018-04-11T15:28:50
2018-04-11T15:28:50
100,305,642
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
1,466
java
// // Este archivo ha sido generado por la arquitectura JavaTM para la implantación de la referencia de enlace (JAXB) XML v2.2.8-b130911.1802 // Visite <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Todas las modificaciones realizadas en este archivo se perderán si se vuelve a compilar el esquema de origen. // Generado el: 2017.06.22 a las 09:26:52 AM CDT // package mx.gob.seseqro.cfdi33; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Clase Java para c_TipoDeComprobante. * * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase. * <p> * <pre> * &lt;simpleType name="c_TipoDeComprobante"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;whiteSpace value="collapse"/> * &lt;enumeration value="I"/> * &lt;enumeration value="E"/> * &lt;enumeration value="T"/> * &lt;enumeration value="N"/> * &lt;enumeration value="P"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "c_TipoDeComprobante", namespace = "http://www.sat.gob.mx/sitio_internet/cfd/catalogos") @XmlEnum public enum CTipoDeComprobante { I, E, T, N, P; public String value() { return name(); } public static CTipoDeComprobante fromValue(String v) { return valueOf(v); } }
[ "noreply@github.com" ]
noreply@github.com
c2478220f8823077515ea69c8fd5e1f1054b08b4
3f0dbde43291f51c5ee9351721f8521ba9b6442b
/src/AutomationTest/JointPanelQuotesBelowMinimum.java
c29d9a820505cea43a85871f5d849846b958b0e6
[]
no_license
BradMorgan96/SeleniumAutomation
ef0e67ea8b5071a8842aba4d0d02c3e68cb54762
34c6c614d2e010a3db9a1660d2c26a4b36d537ca
refs/heads/master
2021-06-06T16:03:10.346228
2020-02-10T14:03:25
2020-02-10T14:03:25
132,759,837
0
1
null
2020-02-10T14:03:26
2018-05-09T13:18:41
Java
UTF-8
Java
false
false
22,285
java
package AutomationTest; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.Select; import org.testng.annotations.Test; import java.io.*; import java.text.SimpleDateFormat; import java.util.Date; public class JointPanelQuotesBelowMinimum extends TestBase.ClassGlobals { @Test public void main() throws FileNotFoundException { /* Define Time Recording Elements */ Date now = new Date(); String nowDate = new SimpleDateFormat("dd/MM/yyyy").format(new Date()); String nowTime = new SimpleDateFormat("HH:mm:ss").format(new Date()); String amendedDate = new SimpleDateFormat("ddMMyyyy").format(new Date()); String amendedTime = new SimpleDateFormat("HHmm").format(new Date()); long startTime = System.currentTimeMillis(); /* Creating Results File */ String className = this.getClass().getSimpleName(); File file = new File( fileLocation + devNo + " " + className + " " + amendedDate + " " + amendedTime + ".txt"); /* Creating file exception */ try { file.createNewFile(); } catch (IOException ex) { ex.printStackTrace(); } /* Setting inputs to go to text document */ PrintStream out = new PrintStream(new FileOutputStream(file)); System.setOut(out); /* Preliminary info */ System.out.println("-----------------------------------------------PRELIMINARY INFO-----------------------------------------------"); System.out.println("Current Date: " + nowDate); System.out.println("Current Time: " + nowTime); /* Opens CRM */ System.out.println("-------------------------------------------------TEST STARTED-------------------------------------------------"); driver().get("http://test.reassuredpensions.co.uk"); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } /* Logs into the CRM */ Select drpGhost = new Select(driver().findElement(By.xpath("//*[@id=\"ghostuser\"]"))); driver().findElement(By.id("UserUsername")).sendKeys("lwatts"); driver().findElement(By.id("UserPassword")).sendKeys("H@@mberryp13"); drpGhost.selectByVisibleText("BM"); driver().findElement(By.xpath("//*[@id=\"UserLoginForm\"]/div[2]/input")).click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } /* Searches for the Lead */ driver().findElement(By.xpath("//*[@id=\"search-basic-term\"]")).sendKeys("3170060"); driver().findElement(By.xpath("//*[@id=\"SearchBasicForm\"]/span/input")).click(); /* Opens the lead */ driver().findElement(By.xpath("//*[@id=\"body-column\"]/table/tbody/tr/td[12]/a[1]")).click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } /* Selects "Get Quotes" */ driver().findElement(By.xpath("//*[@id=\"mini-quotes\"]")).click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } /* Close Confirm Quote Details */ Boolean confirmQuote = driver().findElements(By.xpath("//*[@id=\"confirmclient\"]")).size() > 0; if (confirmQuote) { driver().findElement(By.xpath("//*[@id=\"confirmclient\"]")).click(); } /* Define dropdowns and web elements */ Select drpSmoker = new Select(driver().findElement(By.xpath("//*[@id=\"smoker_1\"]"))); Select drpSmoker2 = new Select(driver().findElement(By.xpath("//*[@id=\"smoker_2\"]"))); Select drpLives = new Select(driver().findElement(By.xpath("//*[@id=\"life_covered\"]"))); Select drpQuote = new Select(driver().findElement(By.xpath("//*[@id=\"quotation_basis\"]"))); Select drpCIC = new Select(driver().findElement(By.xpath("//*[@id=\"cic\"]"))); Select drpLevelTerm = new Select(driver().findElement(By.xpath("//*[@id=\"level_term\"]"))); Select drpGuaranteed = new Select(driver().findElement(By.xpath("//*[@id=\"guaranteed\"]"))); Select drpDeath = new Select(driver().findElement(By.xpath("//*[@id=\"death\"]"))); Select drpFrequency = new Select(driver().findElement(By.xpath("//*[@id=\"payment_frequency\"]"))); WebElement maxPremium = driver().findElement(By.xpath("//*[@id=\"quote_by_premium\"]")); WebElement toAgeOne = driver().findElement(By.xpath("//*[@id=\"toAge\"]")); WebElement wholeOfLife = driver().findElement((By.xpath("//*[@id=\"wol\"]"))); WebElement overFifty = driver().findElement(By.xpath("//*[@id=\"ovf\"]")); WebElement term = driver().findElement(By.xpath("//*[@id=\"term\"]")); WebElement percentageCommRet = driver().findElement(By.xpath("//*[@id=\"commission_retained\"]")); WebElement cicAmount = driver().findElement(By.xpath("//*[@id=\"cic_amount\"]")); WebElement generateQuote = driver().findElement(By.xpath("//*[@id=\"quoteclient\"]")); /*----------DEV-1568 - Panel Quotes with a Premium below 5.00 on a joint policy throws error----------*/ /* TEST CASE 1: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 GOF */ System.out.println("----TEST CASE 1: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 GOF----"); drpSmoker.selectByIndex(1); drpSmoker2.selectByIndex(1); overFifty.click(); drpLives.selectByIndex(0); drpQuote.selectByVisibleText("Premium"); drpDeath.selectByIndex(0); drpFrequency.selectByIndex(0); percentageCommRet.clear(); percentageCommRet.sendKeys("100"); maxPremium.clear(); maxPremium.sendKeys("4"); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears Boolean isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 2: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 GOF */ System.out.println("----TEST CASE 2: SINGULAR EXISTING NON SMOKER POLICY WITH PREMIUM BELOW 5 GOF----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(2); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 3: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 GOF */ System.out.println("----TEST CASE 3: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 GOF----"); drpSmoker.selectByIndex(1); drpSmoker2.selectByIndex(2); drpDeath.selectByIndex(1); drpDeath.selectByIndex(1); drpGuaranteed.selectByIndex(2); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 4: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 GOF */ System.out.println("----TEST CASE 4: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 GOF----"); drpSmoker.selectByIndex(1); drpSmoker2.selectByIndex(1); drpGuaranteed.selectByIndex(1); drpFrequency.selectByIndex(1); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 5: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 GOF */ System.out.println("----TEST CASE 5: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 GOF----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(2); percentageCommRet.clear(); percentageCommRet.sendKeys("80"); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 6: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 GOF */ System.out.println("----TEST CASE 6: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 GOF----"); drpSmoker.selectByIndex(2); drpGuaranteed.selectByIndex(1); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 7: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE */ System.out.println("----TEST CASE 7: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE---"); drpSmoker.selectByIndex(1); drpSmoker2.selectByIndex(1); drpLives.selectByIndex(0); drpQuote.selectByVisibleText("Premium"); overFifty.click(); wholeOfLife.click(); drpDeath.selectByIndex(0); drpFrequency.selectByIndex(0); percentageCommRet.clear(); percentageCommRet.sendKeys("100"); maxPremium.clear(); maxPremium.sendKeys("4"); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 8: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE */ System.out.println("----TEST CASE 8: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(2); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 9: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE */ System.out.println("----TEST CASE 9: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(1); drpDeath.selectByIndex(1); drpDeath.selectByIndex(1); drpGuaranteed.selectByIndex(2); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 10: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE */ System.out.println("----TEST CASE 10: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE----"); drpSmoker.selectByIndex(1); drpSmoker2.selectByIndex(1); drpGuaranteed.selectByIndex(1); drpFrequency.selectByIndex(1); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 11: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE */ System.out.println("----TEST CASE 11: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(2); percentageCommRet.clear(); percentageCommRet.sendKeys("80"); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 12: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE */ System.out.println("----TEST CASE 12: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(1); drpGuaranteed.selectByIndex(2); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 13: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 */ System.out.println("----TEST CASE 13: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5---"); drpSmoker.selectByIndex(1); drpSmoker2.selectByIndex(1); drpLives.selectByIndex(0); drpQuote.selectByVisibleText("Premium"); wholeOfLife.click(); drpDeath.selectByIndex(0); drpFrequency.selectByIndex(0); percentageCommRet.clear(); percentageCommRet.sendKeys("100"); maxPremium.clear(); maxPremium.sendKeys("4"); term.clear(); term.sendKeys("20"); drpCIC.selectByIndex(1); drpLevelTerm.selectByIndex(2); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 14: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 */ System.out.println("----TEST CASE 14: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(2); toAgeOne.clear(); toAgeOne.sendKeys("80"); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 15: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 */ System.out.println("----TEST CASE 9: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(1); drpDeath.selectByIndex(1); drpDeath.selectByIndex(1); drpGuaranteed.selectByIndex(2); drpLevelTerm.selectByIndex(2); drpCIC.selectByIndex(2); cicAmount.sendKeys("10000"); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 16: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 */ System.out.println("----TEST CASE 16: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5----"); drpSmoker.selectByIndex(1); drpSmoker2.selectByIndex(1); drpGuaranteed.selectByIndex(1); drpFrequency.selectByIndex(1); drpLevelTerm.selectByIndex(1); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 17: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5 WHOLE OF LIFE */ System.out.println("----TEST CASE 17: SINGULAR NON SMOKER POLICY WITH PREMIUM BELOW 5----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(2); percentageCommRet.clear(); percentageCommRet.sendKeys("80"); drpCIC.selectByIndex(1); drpLevelTerm.selectByIndex(2); toAgeOne.clear(); term.clear(); term.sendKeys("20"); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* TEST CASE 18: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5 */ System.out.println("----TEST CASE 18: SINGULAR SMOKER POLICY WITH PREMIUM BELOW 5----"); drpSmoker.selectByIndex(2); drpSmoker2.selectByIndex(1); drpGuaranteed.selectByIndex(2); toAgeOne.sendKeys("80"); generateQuote.click(); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } //Attempts to find the error that appears isError = driver().findElements(By.xpath("//*[@id=\"quote_by_premium-notEmpty\"]")).size() > 0; if (isError == true) { System.out.println("PASS: Expected error is displayed." ); } else { System.out.println("FAIL: Expected error is not displayed."); } /* Logs out of the CRM*/ driver().findElement(By.xpath("//*[@id=\"loggedin\"]/a[3]")).click(); /* Records execution finish time */ long stopTime = System.currentTimeMillis(); nowTime = new SimpleDateFormat("HH:mm:ss").format(new Date()); /* Displays results of test */ System.out.println("------------------------------------------------TEST FINISHED------------------------------------------------"); System.out.println("Finish Time: " + (nowTime)); System.out.println("Execution Duration: " + ((stopTime - startTime) / 1000) + " seconds (Estimated)"); /* Driver is closed */ driver().close(); } }
[ "bmorgan@re-assured.net" ]
bmorgan@re-assured.net
6239fe992663b1b9f9d3e5226ed6490fd10359b8
91df0815bd915084fc29ee91eaa37750c1be6d22
/app/src/main/java/com/rd/zhongqipiaoetong/view/pullToZoom/PullToZoomScrollViewEx.java
ced91d0297ce13d70937da0b2459291ad108098f
[]
no_license
niarehtni/Thron
78f4f46ea882df666c952dcaeb91d5eef29f9e83
f4c05424f2914d321970d7dd7d05cb571fd23fd6
refs/heads/master
2020-04-20T12:56:17.560834
2018-09-17T02:11:18
2018-09-17T02:11:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,314
java
package com.rd.zhongqipiaoetong.view.pullToZoom; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.TypedArray; import android.os.SystemClock; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Interpolator; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.ScrollView; import com.rd.zhongqipiaoetong.R; import com.rd.zhongqipiaoetong.utils.log.Logger; /** * Author: ZhuWenWu * Version V1.0 * Date: 2014/11/10 14:25. * Description: * Modification History: * Date Author Version Description * ----------------------------------------------------------------------------------- * 2014/11/10 ZhuWenWu 1.0 1.0 * Why & What is modified: */ @SuppressLint("WrongCall") public class PullToZoomScrollViewEx extends PullToZoomBase<ScrollView> { private static final String TAG = PullToZoomScrollViewEx.class.getSimpleName(); /** * 是否自定义header高度 */ private boolean isCustomHeaderHeight = false; /** * header容器 */ private FrameLayout mHeaderContainer; /** * content容器 */ private FrameLayout mContentContainer; /** * RootView */ private LinearLayout mRootContainer; /** * header的高度 */ private int mHeaderHeight; /** * 下拉动画 */ private ScalingRunnable mScalingRunnable; /** * 下拉刷新接口 */ private PullDownToRefresh pullDownToRefresh; /** 底部父控件 */ private ScrollView rootScrollView; private static final Interpolator sInterpolator = new Interpolator() { public float getInterpolation(float paramAnonymousFloat) { float f = paramAnonymousFloat - 1.0F; return 1.0F + f * (f * (f * (f * f))); } }; public PullToZoomScrollViewEx(Context context) { this(context, null); } public PullToZoomScrollViewEx(Context context, AttributeSet attrs) { super(context, attrs); mScalingRunnable = new ScalingRunnable(); } private boolean isStarted = false; /** * 下拉header水波纹动画 */ @Override protected void pullHeaderToZoom(int newScrollValue) { // Logger.d(TAG, "pullHeaderToZoom --> newScrollValue = " + newScrollValue); // Logger.d(TAG, "pullHeaderToZoom --> mHeaderHeight = " + mHeaderHeight); if (mScalingRunnable != null && !mScalingRunnable.isFinished()) { mScalingRunnable.abortAnimation(); } // 当向下滑动幅度等于0时,停止波浪动画(最大等于0) if (newScrollValue == 0) { mZoomView.stop(); isStarted = false; } else { // 当向下滑动幅度小于0时,实时更新波浪在动画中的高度 mZoomView.updateWaveLine(Math.abs(newScrollValue) + mHeaderHeight); // 如果没有开启波浪动画,则开启动画 if (!isStarted) { mZoomView.start(); isStarted = true; } } ViewGroup.LayoutParams localLayoutParams = mHeaderContainer.getLayoutParams(); localLayoutParams.height = Math.abs(newScrollValue) + mHeaderHeight; mHeaderContainer.setLayoutParams(localLayoutParams); if (isCustomHeaderHeight) { ViewGroup.LayoutParams zoomLayoutParams = mZoomView.getLayoutParams(); zoomLayoutParams.height = Math.abs(newScrollValue) + mHeaderHeight; mZoomView.setLayoutParams(zoomLayoutParams); } } /** * 是否显示headerView * * @param isHideHeader * true: show false: hide */ @Override public void setHideHeader(boolean isHideHeader) { if (isHideHeader != isHideHeader() && mHeaderContainer != null) { super.setHideHeader(isHideHeader); if (isHideHeader) { mHeaderContainer.setVisibility(GONE); } else { mHeaderContainer.setVisibility(VISIBLE); } } } @Override public void setHeaderView(View headerView) { if (headerView != null) { mHeaderView = headerView; updateHeaderView(); } } @Override public void setZoomView(WaveView zoomView) { if (zoomView != null) { mZoomView = zoomView; updateHeaderView(); } } private void updateHeaderView() { if (mHeaderContainer != null) { mHeaderContainer.removeAllViews(); if (mZoomView != null) { mHeaderContainer.addView(mZoomView); } if (mHeaderView != null) { mHeaderContainer.addView(mHeaderView); } } } public void setContentView(View contentView) { if (contentView != null) { mContentView = contentView; updateContentView(); } } private void updateContentView() { if (mContentContainer != null) { mContentContainer.removeAllViews(); if (mContentView != null) { mContentContainer.addView(mContentView); } } } @Override protected ScrollView createRootView(Context context, AttributeSet attrs) { rootScrollView = new InternalScrollView(context, attrs); rootScrollView.setId(R.id.scrollview); return rootScrollView; } @Override protected void smoothScrollToTop() { // Logger.d(TAG, "smoothScrollToTop --> "); mScalingRunnable.startAnimation(200L); } @Override protected boolean isReadyForPullStart() { return mRootView.getScrollY() == 0; } @SuppressLint("ResourceAsColor") @Override public void handleStyledAttributes(TypedArray a) { mRootContainer = new LinearLayout(getContext()); mRootContainer.setOrientation(LinearLayout.VERTICAL); mHeaderContainer = new FrameLayout(getContext()); mContentContainer = new FrameLayout(getContext()); LayoutParams lp1 = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); mContentContainer.setLayoutParams(lp1); if (mZoomView != null) { mHeaderContainer.addView(mZoomView); } if (mHeaderView != null) { mHeaderContainer.addView(mHeaderView); } int contentViewResId = a.getResourceId(R.styleable.PullToZoomView_contentView, 0); if (contentViewResId > 0) { LayoutInflater mLayoutInflater = LayoutInflater.from(getContext()); mContentView = mLayoutInflater.inflate(contentViewResId, null, false); } if (mContentView != null) { mContentContainer.addView(mContentView); } mRootContainer.addView(mHeaderContainer); mRootContainer.addView(mContentContainer); // 是否限制子View在其范围内 mRootContainer.setClipChildren(false); mHeaderContainer.setClipChildren(true); mContentContainer.setClipChildren(false); mRootView.addView(mRootContainer); } /** * 设置HeaderView高度 */ public void setHeaderViewSize(int width, int height) { if (mHeaderContainer != null) { Object localObject = mHeaderContainer.getLayoutParams(); if (localObject == null) { localObject = new ViewGroup.LayoutParams(width, height); } ((ViewGroup.LayoutParams) localObject).width = width; ((ViewGroup.LayoutParams) localObject).height = height; mHeaderContainer.setLayoutParams((ViewGroup.LayoutParams) localObject); mHeaderHeight = height; isCustomHeaderHeight = true; } } /** * 设置HeaderView LayoutParams */ public void setHeaderLayoutParams(LayoutParams layoutParams) { if (mHeaderContainer != null) { mHeaderContainer.setLayoutParams(layoutParams); mHeaderHeight = layoutParams.height; isCustomHeaderHeight = true; } } public void setPullDownToRefresh(final PullDownToRefresh pullDownToRefresh) { this.pullDownToRefresh = pullDownToRefresh; } protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4) { super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4); // Logger.d(TAG, "onLayout --> "); if (mHeaderHeight == 0 && mZoomView != null) { mHeaderHeight = mHeaderContainer.getHeight(); } } /** * 水波纹动画类 */ class ScalingRunnable implements Runnable { /** * 动画持续时间 */ protected long mDuration; /** * 动画开始事件 */ protected long mStartTime; protected float mScale; /** * 是否停止动画 */ protected boolean mIsFinished = true; /** * 是否刷新 */ protected boolean isRefresh = false; ScalingRunnable() { } /** * 终止动画 */ public void abortAnimation() { mIsFinished = true; } public boolean isFinished() { return mIsFinished; } public void run() { if (mZoomView != null) { float f2; ViewGroup.LayoutParams localLayoutParams; if ((!mIsFinished) && (mScale > 1.0D)) { float f1 = ((float) SystemClock.currentThreadTimeMillis() - (float) mStartTime) / (float) mDuration; f2 = mScale - (mScale - 1.0F) * PullToZoomScrollViewEx.sInterpolator.getInterpolation(f1); localLayoutParams = mHeaderContainer.getLayoutParams(); Logger.d(TAG, "ScalingRunnable --> f2 = " + f2); if (pullDownToRefresh != null && f2 >= 1.3 && !isRefresh) { isRefresh = true; pullDownToRefresh.onPullDownToRefresh(); } // 图片方法比例大于1时,进行缩小动画更新图片大小 if (f2 > 1.0F) { localLayoutParams.height = ((int) (f2 * mHeaderHeight)); mHeaderContainer.setLayoutParams(localLayoutParams); if (isCustomHeaderHeight) { ViewGroup.LayoutParams zoomLayoutParams; zoomLayoutParams = mZoomView.getLayoutParams(); zoomLayoutParams.height = ((int) (f2 * mHeaderHeight)); mZoomView.setLayoutParams(zoomLayoutParams); } post(this); return; } else { mZoomView.stop(); isStarted = false; isRefresh = false; } mIsFinished = true; } } } /** * 开始动画 */ public void startAnimation(long paramLong) { if (mZoomView != null) { mStartTime = SystemClock.currentThreadTimeMillis(); mDuration = paramLong; mScale = ((float) (mHeaderContainer.getBottom()) / mHeaderHeight); mIsFinished = false; post(this); } } } protected class InternalScrollView extends ScrollView { private OnScrollViewChangedListener onScrollViewChangedListener; private boolean isFirst = true; public InternalScrollView(Context context) { this(context, null); } public InternalScrollView(Context context, AttributeSet attrs) { super(context, attrs); } public void setOnScrollViewChangedListener(OnScrollViewChangedListener onScrollViewChangedListener) { this.onScrollViewChangedListener = onScrollViewChangedListener; } @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { super.onScrollChanged(l, t, oldl, oldt); if (isFirst) { isFirst = false; scrollTo(0, 0); } if (onScrollViewChangedListener != null) { onScrollViewChangedListener.onInternalScrollChanged(l, t, oldl, oldt); } } } /** * 滑动改变监听接口 */ protected interface OnScrollViewChangedListener { void onInternalScrollChanged(int left, int top, int oldLeft, int oldTop); } /** * 下拉刷新接口 */ public interface PullDownToRefresh { void onPullDownToRefresh(); } public ScrollView getRootScrollView() { return rootScrollView; } }
[ "997619452@qq.com" ]
997619452@qq.com
944355362ee907116367a169ff8194342b093d0d
9a479cc1d47b6fed86c8142ef63471f62c760e32
/B32915/Examen1B32915/src/main/java/com/exa/ucr/ac/cr/Rest/CursosRestController.java
cf3ca77ec35c3916767e31fed9f7baf560b71d88
[]
no_license
UCR-Paraiso-Lenguajes/Lenguajes-1-12019
36f3d575f9330839c519a6e2f283ccfd2d47d9c4
04498457b59982b49c15eabc39452099f7f66234
refs/heads/master
2021-06-16T18:08:00.954832
2020-09-17T07:53:21
2020-09-17T07:53:21
176,178,641
6
2
null
2021-03-31T22:24:03
2019-03-18T00:42:16
Java
UTF-8
Java
false
false
1,734
java
package com.exa.ucr.ac.cr.Rest; import java.util.Iterator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.exa.ucr.ac.cr.Business.CursosBusiness; import com.exa.ucr.ac.cr.Domain.Curso; @RestController public class CursosRestController { /*@Autowired CursosBusiness cursoBusiness; Lo tenia con el annotation pero tira un error de bean*/ @RequestMapping(value="/api/carrera/plan/curso", method=RequestMethod.PUT ) public @ResponseBody void actualizarCurso(@RequestBody Curso curso){ CursosBusiness cursoBusiness = new CursosBusiness(); cursoBusiness.updateCourses(curso); } @RequestMapping(value="/api/carrera/plan/curso/{name}", method=RequestMethod.DELETE ) public @ResponseBody void eliminaCurso(@PathVariable String name){ CursosBusiness cursoBusiness = new CursosBusiness(); cursoBusiness.deleteCourses(name); } @RequestMapping(value="/api/carrera/plan/curso", method=RequestMethod.POST ) public @ResponseBody void crearCurso(@RequestBody Curso curso){ CursosBusiness cursoBusiness = new CursosBusiness(); cursoBusiness.createCourses(curso); } @RequestMapping(value="/api/carrera/plan/curso/{name}", method=RequestMethod.GET ) public @ResponseBody Iterator<Curso> mostrarCurso(){ CursosBusiness cursoBusiness = new CursosBusiness(); return cursoBusiness.getCourses(); } }
[ "42311754+leoenterprise94@users.noreply.github.com" ]
42311754+leoenterprise94@users.noreply.github.com
8afd73e166b9b2d421a900553866fa3aee28bf99
c7c18c292b2ba415e4b04f436a936598b041cbba
/InternationalPavilionShopCenter/baseui/src/main/java/com/chrisjason/baseui/widget/dialog/LoadingDialog.java
8bf8372dc314073c35ea5c85aea6ee0454118ebc
[]
no_license
QiangHoo/codesource
1616b7b6220ae5dccb6782cc59f157b8c870c45a
d39dbcf610778c67fdaa8519dc81fd5b56d3de78
refs/heads/master
2020-04-22T16:45:13.107392
2019-03-08T03:25:29
2019-03-08T03:25:29
170,519,246
0
2
null
2019-03-08T03:25:30
2019-02-13T14:13:46
Java
UTF-8
Java
false
false
2,106
java
package com.chrisjason.baseui.widget.dialog; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.support.v4.app.Fragment; import android.text.TextUtils; import android.view.Gravity; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.TextView; import com.chrisjason.baseui.R; /** * Created by liudezhi on 16/8/19. */ public class LoadingDialog extends Dialog{ private Activity mActivity; private Context mContext; private TextView mTVStr; /** * Activity中创建 * @param mActivity */ public LoadingDialog(Activity mActivity) { super(mActivity, R.style.loading_dialog); this.mActivity = mActivity; setContentView(R.layout.loading_dialog); initLocation(); initView(); } public LoadingDialog(Context context){ super(context,R.style.loading_dialog); mContext=context; setContentView(R.layout.loading_dialog); initLocation(); initView(); } /** * Fragment中创建 * @param mFragment */ public LoadingDialog(Fragment mFragment) { super(mFragment.getActivity(), R.style.loading_dialog); this.mActivity = mFragment.getActivity(); setContentView(R.layout.loading_dialog); initLocation(); initView(); } private void initLocation(){ Window Window = this.getWindow(); //显示位置 Window.setGravity(Gravity.CENTER); WindowManager.LayoutParams params = Window.getAttributes(); params.y = 20; Window.setAttributes(params); } private void initView(){ mTVStr= (TextView) findViewById(R.id.loading_dialog_tv_str); } /** * 设置加载中的提示文字 * @param str */ public void setLoadingStr(String str){ if(!TextUtils.isEmpty(str)){ mTVStr.setText(str); mTVStr.setVisibility(View.VISIBLE); }else { mTVStr.setVisibility(View.GONE); } } }
[ "18583861496@163.com" ]
18583861496@163.com
d9da4466c7c1402a8cea87f29528f0d6dfa69c6b
db5e2811d3988a5e689b5fa63e748c232943b4a0
/jadx/sources/o/C2381.java
9778c3cbd6a969a129030b491ed8fcf2e0efb215
[]
no_license
ghuntley/TraceTogether_1.6.1.apk
914885d8be7b23758d161bcd066a4caf5ec03233
b5c515577902482d741cabdbd30f883a016242f8
refs/heads/master
2022-04-23T16:59:33.038690
2020-04-27T05:44:49
2020-04-27T05:44:49
259,217,124
0
0
null
null
null
null
UTF-8
Java
false
false
3,722
java
package o; import android.os.Bundle; import android.text.TextUtils; import java.util.Iterator; import o.C2745; /* renamed from: o.Э reason: contains not printable characters */ public final class C2381 { /* renamed from: ı reason: contains not printable characters */ final long f10910; /* renamed from: Ɩ reason: contains not printable characters */ private final String f10911; /* renamed from: ǃ reason: contains not printable characters */ final String f10912; /* renamed from: ɩ reason: contains not printable characters */ final C2433 f10913; /* renamed from: Ι reason: contains not printable characters */ final long f10914; /* renamed from: ι reason: contains not printable characters */ final String f10915; private C2381(C2658 r2, String str, String str2, String str3, long j, long j2, C2433 r10) { C2745.C2746.m14562(str2); C2745.C2746.m14562(str3); C2745.C2746.m14555(r10); this.f10915 = str2; this.f10912 = str3; this.f10911 = TextUtils.isEmpty(str) ? null : str; this.f10910 = j; this.f10914 = j2; long j3 = this.f10914; if (j3 != 0 && j3 > this.f10910) { r2.t_().A_().m11605("Event created with reverse previous/current timestamps. appId, name", C2244.m11698(str2), C2244.m11698(str3)); } this.f10913 = r10; } C2381(C2658 r1, String str, String str2, String str3, long j, long j2, Bundle bundle) { C2433 r12; C2745.C2746.m14562(str2); C2745.C2746.m14562(str3); this.f10915 = str2; this.f10912 = str3; this.f10911 = TextUtils.isEmpty(str) ? null : str; this.f10910 = j; this.f10914 = j2; long j3 = this.f10914; if (j3 != 0 && j3 > this.f10910) { r1.t_().A_().m11603("Event created with reverse previous/current timestamps. appId", C2244.m11698(str2)); } if (bundle == null || bundle.isEmpty()) { r12 = new C2433(new Bundle()); } else { Bundle bundle2 = new Bundle(bundle); Iterator it = bundle2.keySet().iterator(); while (it.hasNext()) { String str4 = (String) it.next(); if (str4 == null) { r1.t_().m11714().m11606("Param name can't be null"); it.remove(); } else { Object r5 = r1.m14116().m11401(str4, bundle2.get(str4)); if (r5 == null) { r1.t_().A_().m11603("Param value can't be null", r1.m14115().m11219(str4)); it.remove(); } else { r1.m14116().m11381(bundle2, str4, r5); } } } r12 = new C2433(bundle2); } this.f10913 = r12; } /* access modifiers changed from: package-private */ /* renamed from: ɩ reason: contains not printable characters */ public final C2381 m12377(C2658 r12, long j) { return new C2381(r12, this.f10911, this.f10915, this.f10912, this.f10910, j, this.f10913); } public final String toString() { String str = this.f10915; String str2 = this.f10912; String valueOf = String.valueOf(this.f10913); StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 33 + String.valueOf(str2).length() + valueOf.length()); sb.append("Event{appId='"); sb.append(str); sb.append("', name='"); sb.append(str2); sb.append("', params="); sb.append(valueOf); sb.append('}'); return sb.toString(); } }
[ "ghuntley@ghuntley.com" ]
ghuntley@ghuntley.com
880f21d5172e16a3a8c0343486eb20d52451a5f3
17a5b54f0c9e11a349d5a4ee2050456c8061ee44
/src/org/samism/java/utils/IntUtil/IntUtil.java
4596b87ebe5618ff015aec308ef135bcd447fd35
[]
no_license
lihuanying/XUtils
41f6ee4d6967022d02e5a9c5e2dbdfcba29dc611
2ba3e2e0a88c83abfb81ae6d1178cbf2a446cb99
refs/heads/master
2021-01-18T13:33:55.774491
2011-08-05T15:45:25
2011-08-05T15:45:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,268
java
package org.samism.java.utils.IntUtil; import java.util.ArrayList; import java.util.List; /** * Created with IntelliJ IDEA. * Author: Sameer Ismail * Date: 8/2/11 * Time: 5:41 AM */ public class IntUtil { private IntUtil() { } /** * Converts an {@link java.util.ArrayList} to a primitive integer array. * * @param old The Integer ArrayList to convert from * @return An array of primitive-type integers populated in the same order and length as the ArrayList passed in. */ public static int[] arraylistToIntegerArray(ArrayList<Integer> old) { if (old.size() > -1) { int[] newList = new int[old.size()]; for (int i = 0; i < old.size(); i++) newList[i] = old.get(i); return newList; } return null; } /** * Converts a primitive-type integer array to a {@link java.util.ArrayList}. * * @param old primitive-type integer array to convert from * @return An ArrayList populated in the same order and length as the primitive-type integer array passed in. */ public static List<Integer> intArrayToIntegerList(int[] old){ if(old.length > -1){ ArrayList<Integer> newList = new ArrayList<Integer>(); for(int i = 0; i < old.length; i++){ newList.add(old[i]); } return newList; } return null; } }
[ "hhh283@yahoo.com" ]
hhh283@yahoo.com
370374945cbbed1bec804494dd02d70c58953e25
5e6a475850de6896e7704bad6b00a1f1a3de8ade
/src/Section_12_JavaCollections/Overview/ComparableAndComparatorInterfaces.java
f2e2138bd69c119b6dc23b426c015a5e7c7787eb
[]
no_license
conorginty/Master-Java-Course
b7feab187cd02616fcf463796400a70c3b6046f9
cf2b35c59bd06b6997262344fb6e9d1d301ca55f
refs/heads/master
2023-04-11T09:10:58.910803
2021-04-03T11:45:23
2021-04-03T11:45:23
324,755,106
0
0
null
null
null
null
UTF-8
Java
false
false
2,951
java
package Section_12_JavaCollections.Overview; public class ComparableAndComparatorInterfaces { // 156. Comparable and Comparator Interfaces // The Collections framework includes classes that sort their elements, so to really use those properly, we // need to understand how that works in order to create our own classes that we can use or store in sorted // Collections. In previous videos we implemented the Comparable interface, so that we could experiment with // the Collections.sort() and reverse() methods, so we've seen how easy it is to create the 1 required // method of the Interface (i.e. the compareTo() method) // When a class (e.g. Seat) implements Comparable, we have to Override the compareTo() method, which is // often a very simple thing to do. A compareTo() method should return a number // - < 0 if the object should sort less than the object that is being compared to. // - > 0 if the object should sort greater than the object that is being compared to. // - == 0 if the objects are equal. // If you were creating a compareTo() method for a class that's got more than 1 key field // (e.g. People's names - where you may want to sort on forename first, and then on surname) // There's another way to use the sort() method, and that's to pass it a Comparator. // The Comparator Interface is similar to a Comparable, and defines a single method: compare(). // Unlike Comparable, the objects to be sorted DON'T have to implement Comparator, instead an Object of // Type Comparator can be created with a compare() method that can sort the objects. // More than 1 Comparator can be created, and this allows for objects to be sorted in different ways // We can either create a Comparator object within an existing class, OR we can create a new class that // implements the Comparator Interface // Comparator doesn't have to be static, but it makes it easier to use if we don't need a class instance // in order to use it (e.g. People.GROUP_ORDER) // You can also implement as many Comparators as you want (e.g. 1 for firstName and 1 for lastName???) // The Java Collections documentation uses a particular phrase regularly: // "An ordering being consistent with equals" // A method that produces ordering that is consistent with equals will only return 0 if the elements // being compared actually are equal // Comparable's compareTo() method IS consistent with equals - As we compare different objects and if they're // the same object, then they're equal (e.g. if we compare based on a unique field e.g. seatNumber) // Comparator's compare() method is NOT consistent with equals - As we compare different objects on // a non-unique field, and if they're the same, they're considered equal, even though they're not the same // object (e.g. price of seats) // This distinction causes problems }
[ "conorginty@gmail.com" ]
conorginty@gmail.com
c4ff55ff2791c126c981ee3c53b569739284a032
c9325fbbbeca55184274eaa49273c237681ede73
/src/unifiedview/SettingsView.java
2933ab57a71eb28c3771914cd9097fd3380fe9a5
[]
no_license
LeuCeaMia/CACSView
13d12df3e991ad041a146e8053febb75f96dbd72
fd187488b027d980f21f9b92812d188fc21b7f47
refs/heads/master
2016-09-06T15:13:47.108968
2014-10-06T04:53:05
2014-10-06T04:53:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,788
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 unifiedview; /** * * @author LCM */ public class SettingsView extends javax.swing.JFrame { /** * Creates new form SettingsView */ public SettingsView() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jbAddFileExclusions = new javax.swing.JButton(); jbAccountManagement = new javax.swing.JButton(); jbViewShareAllocation = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { formWindowClosed(evt); } }); jbAddFileExclusions.setText("Add File Type Exclusions"); jbAddFileExclusions.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jbAddFileExclusionsMouseClicked(evt); } }); jbAddFileExclusions.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbAddFileExclusionsActionPerformed(evt); } }); jbAccountManagement.setText("Account Management"); jbAccountManagement.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jbAccountManagementMouseClicked(evt); } }); jbAccountManagement.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbAccountManagementActionPerformed(evt); } }); jbViewShareAllocation.setText("View Share Allocation"); jbViewShareAllocation.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jbViewShareAllocationMouseClicked(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(37, 37, 37) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jbViewShareAllocation, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jbAccountManagement, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jbAddFileExclusions, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)) .addContainerGap(37, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(65, 65, 65) .addComponent(jbAddFileExclusions) .addGap(34, 34, 34) .addComponent(jbAccountManagement) .addGap(32, 32, 32) .addComponent(jbViewShareAllocation) .addContainerGap(54, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jbAddFileExclusionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAddFileExclusionsActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jbAddFileExclusionsActionPerformed private void jbAccountManagementActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAccountManagementActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jbAccountManagementActionPerformed private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed // TODO add your handling code here: }//GEN-LAST:event_formWindowClosed private void jbAddFileExclusionsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbAddFileExclusionsMouseClicked // TODO add your handling code here: AddFileExclusionsView afev = new AddFileExclusionsView(); afev.setVisible(true); }//GEN-LAST:event_jbAddFileExclusionsMouseClicked private void jbAccountManagementMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbAccountManagementMouseClicked // TODO add your handling code here: AccountManagementView amv = new AccountManagementView(); amv.setVisible(true); }//GEN-LAST:event_jbAccountManagementMouseClicked private void jbViewShareAllocationMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbViewShareAllocationMouseClicked // TODO add your handling code here: ShareAllocationView sav = new ShareAllocationView(); sav.setVisible(true); }//GEN-LAST:event_jbViewShareAllocationMouseClicked /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(SettingsView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(SettingsView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(SettingsView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(SettingsView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SettingsView().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jbAccountManagement; private javax.swing.JButton jbAddFileExclusions; private javax.swing.JButton jbViewShareAllocation; // End of variables declaration//GEN-END:variables }
[ "randomrelay@gmail.com" ]
randomrelay@gmail.com
f127e1f9c545c4f6beb299c3649e7abeb8171b3c
99e790addc661839a7bb41d1eef2c6ee2707be79
/src/test/java/com/mistraltech/bog/examples/defaults/builders/PhoneBuilder.java
cfc0d3021caf2eea221faad34f92dcf63a3d798c
[ "BSD-3-Clause" ]
permissive
mistraltechnologies/bog-javassist
f9567431f03bc7587b38baff5e7d501ea6c5f673
d22867ecdb3d2e826511e78ab684a356317aa181
refs/heads/master
2020-09-27T21:26:33.914323
2016-11-24T12:17:24
2016-11-24T12:17:24
67,952,391
0
0
null
null
null
null
UTF-8
Java
false
false
661
java
package com.mistraltech.bog.examples.defaults.builders; import com.mistraltech.bog.core.Builder; import com.mistraltech.bog.core.annotation.Builds; import com.mistraltech.bog.core.annotation.ConstructorParameter; import com.mistraltech.bog.examples.model.Phone; import static com.mistraltech.bog.proxy.javassist.JavassistBuilderGenerator.builderOf; @Builds(Phone.class) public interface PhoneBuilder extends Builder<Phone> { static PhoneBuilder aPhone() { return builderOf(PhoneBuilder.class); } @ConstructorParameter(0) PhoneBuilder withCode(String code); @ConstructorParameter(1) PhoneBuilder withNumber(String number); }
[ "richardjwilson@users.noreply.github.com" ]
richardjwilson@users.noreply.github.com
f50c20e827340a227dea208540203e0dbf700dea
7f6358918e0fc039bc876fe5827f2cd361c0c2f7
/pokerGame/src/test/java/org/csc478/pokerGame/TestPlayingCard.java
42805f4cfbc03ab08bfb8be45c8328b7442b8fd2
[]
no_license
caprolt/fantastic-bassoon
4eccf7de9282abaf9e1fae233013ea99878a29ef
2beba8b452183639178cf1195d3470c295459847
refs/heads/master
2020-03-31T18:07:37.119186
2018-12-14T04:34:58
2018-12-14T04:34:58
152,446,736
0
1
null
2018-12-14T01:50:04
2018-10-10T15:29:25
Java
UTF-8
Java
false
false
3,194
java
/* * project: pokerGame * file: src\test\java\org\csc478\pokerGame\TestPlayingCard.java * created: 2018-11-13 11:20:05 * by: Gino Canessa * modified: 2018-11-13 * by: Gino Canessa * * summary: Tests for org.cyc478.pokerGame.models.PlayingCard */ package org.csc478.pokerGame; import org.junit.Test; import org.csc478.pokerGame.models.*; import java.security.InvalidParameterException; import static org.junit.Assert.*; public class TestPlayingCard { @Test public void testCreateCardSuitRank01() { // **** create lowest valid card **** PlayingCard card = new PlayingCard(PlayingCard.CardSuitClubs, PlayingCard.CardRankTwo); assertNotNull(card); assertEquals(PlayingCard.CardSuitClubs, card.getCardSuit()); assertEquals(PlayingCard.CardRankTwo, card.getCardRank()); } @Test public void testCreateCardSuitRank02() { // **** create highest valid card **** PlayingCard card = new PlayingCard(PlayingCard.CardSuitSpades, PlayingCard.CardRankAce); assertNotNull(card); assertEquals(PlayingCard.CardSuitSpades, card.getCardSuit()); assertEquals(PlayingCard.CardRankAce, card.getCardRank()); } @Test(expected = InvalidParameterException.class) public void testCreateCardSuitRank03() { // **** create low suit invalid card **** PlayingCard card = new PlayingCard(0x00, PlayingCard.CardRankTwo); assertNull(card); } @Test(expected = InvalidParameterException.class) public void testCreateCardSuitRank04() { // **** create high suit invalid card **** PlayingCard card = new PlayingCard(0x50, PlayingCard.CardRankTwo); assertNull(card); } @Test(expected = InvalidParameterException.class) public void testCreateCardSuitRank05() { // **** create low rank invalid card **** PlayingCard card = new PlayingCard(PlayingCard.CardSuitClubs, 0x00); assertNull(card); } @Test(expected = InvalidParameterException.class) public void testCreateCardSuitRank06() { // **** create high rank invalid card **** PlayingCard card = new PlayingCard(PlayingCard.CardSuitClubs, 0x0F); assertNull(card); } @Test public void testCreateCardIndex01() { // **** create lowest valid card **** PlayingCard card = new PlayingCard(0); assertNotNull(card); assertEquals(PlayingCard.CardSuitClubs, card.getCardSuit()); assertEquals(PlayingCard.CardRankTwo, card.getCardRank()); } @Test public void testCreateCardIndex02() { // **** create highest valid card **** PlayingCard card = new PlayingCard(51); assertNotNull(card); assertEquals(PlayingCard.CardSuitSpades, card.getCardSuit()); assertEquals(PlayingCard.CardRankAce, card.getCardRank()); } @Test(expected = InvalidParameterException.class) public void testCreateCardIndex03() { // **** create low index invalid card **** PlayingCard card = new PlayingCard(-1); assertNull(card); } @Test(expected = InvalidParameterException.class) public void testCreateCardIndex04() { // **** create high index invalid card **** PlayingCard card = new PlayingCard(52); assertNull(card); } }
[ "ginocanessa@gmail.com" ]
ginocanessa@gmail.com
20423d5c32314d3b298113e5ee85ea4c4b0e07b6
82b2d97b7b01b2f77d58eb4fea9e3ed8dcf95c9d
/notification-center/src/main/java/com/cloud/notification/tuna/netty/util/internal/StringUtil.java
e51884641cafffda5bf5b5caf63bfa78ed18c551
[]
no_license
aiical/middle-ground
2d51bd75148a96a3a6a7dd395f602376d37a2726
5fc700aff81f868bd45abc218fc7d51dd0f91237
refs/heads/master
2023-01-30T23:18:59.606297
2020-12-13T03:33:57
2020-12-13T03:33:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,329
java
/* * Copyright 2012 The Netty Project * * The Netty Project 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 com.cloud.notification.tuna.netty.util.internal; import java.io.IOException; import java.util.ArrayList; import java.util.Formatter; import java.util.List; /** * String utility class. */ public final class StringUtil { public static final String NEWLINE; private static final String[] BYTE2HEX_PAD = new String[256]; private static final String[] BYTE2HEX_NOPAD = new String[256]; private static final String EMPTY_STRING = ""; static { // Determine the newline character of the current platform. String newLine; try { newLine = new Formatter().format("%n").toString(); } catch (Exception e) { // Should not reach here, but just in case. newLine = "\n"; } NEWLINE = newLine; // Generate the lookup table that converts a byte into a 2-digit hexadecimal integer. int i; for (i = 0; i < 10; i ++) { StringBuilder buf = new StringBuilder(2); buf.append('0'); buf.append(i); BYTE2HEX_PAD[i] = buf.toString(); BYTE2HEX_NOPAD[i] = String.valueOf(i); } for (; i < 16; i ++) { StringBuilder buf = new StringBuilder(2); char c = (char) ('a' + i - 10); buf.append('0'); buf.append(c); BYTE2HEX_PAD[i] = buf.toString(); BYTE2HEX_NOPAD[i] = String.valueOf(c); } for (; i < BYTE2HEX_PAD.length; i ++) { StringBuilder buf = new StringBuilder(2); buf.append(Integer.toHexString(i)); String str = buf.toString(); BYTE2HEX_PAD[i] = str; BYTE2HEX_NOPAD[i] = str; } } /** * Splits the specified {@link String} with the specified delimiter. This operation is a simplified and optimized * version of {@link String#split(String)}. */ public static String[] split(String value, char delim) { final int end = value.length(); final List<String> res = new ArrayList<String>(); int start = 0; for (int i = 0; i < end; i ++) { if (value.charAt(i) == delim) { if (start == i) { res.add(EMPTY_STRING); } else { res.add(value.substring(start, i)); } start = i + 1; } } if (start == 0) { // If no delimiter was found in the value res.add(value); } else { if (start != end) { // Add the last element if it's not empty. res.add(value.substring(start, end)); } else { // Truncate trailing empty elements. for (int i = res.size() - 1; i >= 0; i --) { if (res.get(i).isEmpty()) { res.remove(i); } else { break; } } } } return res.toArray(new String[res.size()]); } /** * Converts the specified byte value into a 2-digit hexadecimal integer. */ public static String byteToHexStringPadded(int value) { return BYTE2HEX_PAD[value & 0xff]; } /** * Converts the specified byte value into a 2-digit hexadecimal integer and appends it to the specified buffer. */ public static <T extends Appendable> T byteToHexStringPadded(T buf, int value) { try { buf.append(byteToHexStringPadded(value)); } catch (IOException e) { PlatformDependent.throwException(e); } return buf; } /** * Converts the specified byte array into a hexadecimal value. */ public static String toHexStringPadded(byte[] src) { return toHexStringPadded(src, 0, src.length); } /** * Converts the specified byte array into a hexadecimal value. */ public static String toHexStringPadded(byte[] src, int offset, int length) { return toHexStringPadded(new StringBuilder(length << 1), src, offset, length).toString(); } /** * Converts the specified byte array into a hexadecimal value and appends it to the specified buffer. */ public static <T extends Appendable> T toHexStringPadded(T dst, byte[] src) { return toHexStringPadded(dst, src, 0, src.length); } /** * Converts the specified byte array into a hexadecimal value and appends it to the specified buffer. */ public static <T extends Appendable> T toHexStringPadded(T dst, byte[] src, int offset, int length) { final int end = offset + length; for (int i = offset; i < end; i ++) { byteToHexStringPadded(dst, src[i]); } return dst; } /** * Converts the specified byte value into a hexadecimal integer. */ public static String byteToHexString(int value) { return BYTE2HEX_NOPAD[value & 0xff]; } /** * Converts the specified byte value into a hexadecimal integer and appends it to the specified buffer. */ public static <T extends Appendable> T byteToHexString(T buf, int value) { try { buf.append(byteToHexString(value)); } catch (IOException e) { PlatformDependent.throwException(e); } return buf; } /** * Converts the specified byte array into a hexadecimal value. */ public static String toHexString(byte[] src) { return toHexString(src, 0, src.length); } /** * Converts the specified byte array into a hexadecimal value. */ public static String toHexString(byte[] src, int offset, int length) { return toHexString(new StringBuilder(length << 1), src, offset, length).toString(); } /** * Converts the specified byte array into a hexadecimal value and appends it to the specified buffer. */ public static <T extends Appendable> T toHexString(T dst, byte[] src) { return toHexString(dst, src, 0, src.length); } /** * Converts the specified byte array into a hexadecimal value and appends it to the specified buffer. */ public static <T extends Appendable> T toHexString(T dst, byte[] src, int offset, int length) { assert length >= 0; if (length == 0) { return dst; } final int end = offset + length; final int endMinusOne = end - 1; int i; // Skip preceding zeroes. for (i = offset; i < endMinusOne; i ++) { if (src[i] != 0) { break; } } byteToHexString(dst, src[i ++]); int remaining = end - i; toHexStringPadded(dst, src, i, remaining); return dst; } /** * The shortcut to {@link #simpleClassName(Class) simpleClassName(o.getClass())}. */ public static String simpleClassName(Object o) { if (o == null) { return "null_object"; } else { return simpleClassName(o.getClass()); } } /** * Generates a simplified name from a {@link Class}. Similar to {@link Class#getSimpleName()}, but it works fine * with anonymous classes. */ public static String simpleClassName(Class<?> clazz) { if (clazz == null) { return "null_class"; } Package pkg = clazz.getPackage(); if (pkg != null) { return clazz.getName().substring(pkg.getName().length() + 1); } else { return clazz.getName(); } } private StringUtil() { // Unused. } }
[ "877671762@qq.com" ]
877671762@qq.com
1d3f44c683685cfa07ed63956ff0e2811888e64c
183267714fb491edaece8f928c5ddbd001fc45c5
/gerrit-server/src/main/java/com/google/gerrit/server/notedb/NoteDbChangeState.java
055cba9526144dda736d1cfbb3fc768a6e22726c
[ "Apache-2.0" ]
permissive
enlyn/gerrit
ecfd79862ead24da4972f5a859c4cfa23010cf95
92ba0dd2706c174f9543285ce431f64b01544c8c
refs/heads/master
2020-12-28T19:23:42.708082
2016-04-13T08:27:03
2016-04-13T08:27:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,799
java
// Copyright (C) 2016 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.gerrit.server.notedb; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import com.google.auto.value.AutoValue; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Optional; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.RefNames; import com.google.gerrit.reviewdb.server.ReviewDbUtil; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; /** * The state of all relevant NoteDb refs across all repos corresponding to a * given Change entity. * <p> * Stored serialized in the {@code Change#noteDbState} field, and used to * determine whether the state in NoteDb is out of date. * <p> * Serialized in the form: * <pre> * [meta-sha],[account1]=[drafts-sha],[account2]=[drafts-sha]... * </pre> * in numeric account ID order, with hex SHA-1s for human readability. */ public class NoteDbChangeState { @AutoValue public abstract static class Delta { static Delta create(Change.Id changeId, Optional<ObjectId> newChangeMetaId, Map<Account.Id, ObjectId> newDraftIds) { if (newDraftIds == null) { newDraftIds = ImmutableMap.of(); } return new AutoValue_NoteDbChangeState_Delta( changeId, newChangeMetaId, ImmutableMap.copyOf(newDraftIds)); } abstract Change.Id changeId(); abstract Optional<ObjectId> newChangeMetaId(); abstract ImmutableMap<Account.Id, ObjectId> newDraftIds(); } public static NoteDbChangeState parse(Change c) { return parse(c.getId(), c.getNoteDbState()); } @VisibleForTesting static NoteDbChangeState parse(Change.Id id, String str) { if (str == null) { return null; } List<String> parts = Splitter.on(',').splitToList(str); checkArgument(!parts.isEmpty(), "invalid state string for change %s: %s", id, str); ObjectId changeMetaId = ObjectId.fromString(parts.get(0)); Map<Account.Id, ObjectId> draftIds = Maps.newHashMapWithExpectedSize(parts.size() - 1); Splitter s = Splitter.on('='); for (int i = 1; i < parts.size(); i++) { String p = parts.get(i); List<String> draftParts = s.splitToList(p); checkArgument(draftParts.size() == 2, "invalid draft state part for change %s: %s", id, p); draftIds.put(Account.Id.parse(draftParts.get(0)), ObjectId.fromString(draftParts.get(1))); } return new NoteDbChangeState(id, changeMetaId, draftIds); } public static NoteDbChangeState applyDelta(Change change, Delta delta) { if (delta == null) { return null; } String oldStr = change.getNoteDbState(); if (oldStr == null && !delta.newChangeMetaId().isPresent()) { // Neither an old nor a new meta ID was present, most likely because we // aren't writing a NoteDb graph at all for this change at this point. No // point in proceeding. return null; } NoteDbChangeState oldState = parse(change.getId(), oldStr); ObjectId changeMetaId; if (delta.newChangeMetaId().isPresent()) { changeMetaId = delta.newChangeMetaId().get(); if (changeMetaId.equals(ObjectId.zeroId())) { change.setNoteDbState(null); return null; } } else { changeMetaId = oldState.changeMetaId; } Map<Account.Id, ObjectId> draftIds = new HashMap<>(); if (oldState != null) { draftIds.putAll(oldState.draftIds); } for (Map.Entry<Account.Id, ObjectId> e : delta.newDraftIds().entrySet()) { if (e.getValue().equals(ObjectId.zeroId())) { draftIds.remove(e.getKey()); } else { draftIds.put(e.getKey(), e.getValue()); } } NoteDbChangeState state = new NoteDbChangeState( change.getId(), changeMetaId, draftIds); change.setNoteDbState(state.toString()); return state; } private static String toString(ObjectId changeMetaId, Map<Account.Id, ObjectId> draftIds) { List<Account.Id> accountIds = Lists.newArrayList(draftIds.keySet()); Collections.sort(accountIds, ReviewDbUtil.intKeyOrdering()); StringBuilder sb = new StringBuilder(changeMetaId.name()); for (Account.Id id : accountIds) { sb.append(',') .append(id.get()) .append('=') .append(draftIds.get(id).name()); } return sb.toString(); } private final Change.Id changeId; private final ObjectId changeMetaId; private final ImmutableMap<Account.Id, ObjectId> draftIds; NoteDbChangeState(Change.Id changeId, ObjectId changeMetaId, Map<Account.Id, ObjectId> draftIds) { this.changeId = checkNotNull(changeId); this.changeMetaId = checkNotNull(changeMetaId); this.draftIds = ImmutableMap.copyOf(draftIds); } public boolean isChangeUpToDate(Repository changeRepo) throws IOException { Ref ref = changeRepo.exactRef(ChangeNoteUtil.changeRefName(changeId)); if (ref == null) { return changeMetaId.equals(ObjectId.zeroId()); } return ref.getObjectId().equals(changeMetaId); } public boolean areDraftsUpToDate(Repository draftsRepo, Account.Id accountId) throws IOException { Ref ref = draftsRepo.exactRef( RefNames.refsDraftComments(accountId, changeId)); if (ref == null) { return !draftIds.containsKey(accountId); } return ref.getObjectId().equals(draftIds.get(accountId)); } @VisibleForTesting Change.Id getChangeId() { return changeId; } ObjectId getChangeMetaId() { return changeMetaId; } @VisibleForTesting ImmutableMap<Account.Id, ObjectId> getDraftIds() { return draftIds; } @Override public String toString() { return toString(changeMetaId, draftIds); } }
[ "dborowitz@google.com" ]
dborowitz@google.com
67c4e38d6a01cc99230a467f7c83fe3243eb315f
dff0f84f32434ee12423d19ab6165b14e88737d2
/src/main/java/com/paynet/model/CommentRequest.java
0c8581253126507c5e55615090108754fcdcd8ce
[]
no_license
realcandy/app-register
ebf8ae7ac82eff76112f4bed579d46f083990fe6
12bac51967bb384a26c014060fd3d61ff19cde83
refs/heads/master
2021-07-03T18:46:43.111107
2019-12-23T12:03:28
2019-12-23T12:03:28
229,738,320
0
0
null
2021-04-22T18:50:55
2019-12-23T11:24:18
Java
UTF-8
Java
false
false
322
java
package com.paynet.model; import com.paynet.entity.Comment; public class CommentRequest { private String text; public String getText() { return text; } public void setText(String text) { this.text = text; } public Comment toComment(){ return new Comment(text); } }
[ "andrewpcs2016@gmail.com" ]
andrewpcs2016@gmail.com
26605073fd24cbb972543594d67622225951df31
2f50ed5e1f4c8a7b4d84d9bc0372e986363f920e
/Moments/src/com/yk/moments/httpUtil/JsonToDataUtil.java
08bb6ff568bec4dd1d9171cca51682339e8e2cb3
[]
no_license
ykzyj/moment
1f3a0363000b226cc5d6adcad0265231e18e6aeb
593e57625836cc5477914862a6e059db28f3ebd4
refs/heads/master
2021-01-20T11:54:58.153169
2017-02-21T17:34:56
2017-02-21T17:34:56
82,639,227
0
0
null
null
null
null
GB18030
Java
false
false
7,073
java
package com.yk.moments.httpUtil; import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.util.Log; /** * @Title: JsonToData.java * @Package * @Description: TODO * @author yk * @date 2015年8月19日 上午10:56:09 * @version V1.0 */ public class JsonToDataUtil { /** * @author yk * @date 2015年9月1日 下午4:10:57 * @Title: initJsonData * @Description: 获取json数据 * @param jsonstr * @param cla * @return 设定文件 * @return List<T> 返回类型 * @throws */ public static <T> List<T> initJsonDataOfLsObject(String jsonstr,Class<?> cla) { List<T> listdata=new ArrayList<T>(); Field[] field=cla.getDeclaredFields(); for(Field f:field) { f.setAccessible(true); } try { JSONObject jsonobject=new JSONObject(jsonstr); JSONArray jsonarray=jsonobject.getJSONArray("data"); for(int i=0;i<jsonarray.length();i++) { try { T T_stance=(T) cla.newInstance(); jsonobject=jsonarray.getJSONObject(i); for(Field f:field) { try { if(f.getGenericType().toString().equals("class java.lang.Integer")) { if(jsonobject.has(f.getName())) { f.set(T_stance, Integer.valueOf(jsonobject.get(f.getName()).toString())); } } else if(f.getGenericType().toString().equals("class java.lang.String")) { if(jsonobject.has(f.getName())) { f.set(T_stance, jsonobject.get(f.getName()).toString()); } } } catch (Exception e) { f.set(T_stance, ""); } } listdata.add(T_stance); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } return listdata; } public static <T> T initJsonDatatoObject(String jsonstr,Class<?> cla) { T T_stance=null; Field[] field=cla.getDeclaredFields(); for(Field f:field) { f.setAccessible(true); } try { T_stance=(T) cla.newInstance(); JSONObject jsonobject=new JSONObject(jsonstr); for(Field f:field) { try { if(f.getGenericType().toString().equals("class java.lang.Integer")) { if(jsonobject.has(f.getName())) { f.set(T_stance, Integer.valueOf(jsonobject.get(f.getName()).toString())); } } else if(f.getGenericType().toString().equals("class java.lang.String")) { if(jsonobject.has(f.getName())) { f.set(T_stance, jsonobject.get(f.getName()).toString()); } else if(jsonobject.has("profile-image")) { f.set(T_stance, jsonobject.get("profile-image").toString()); } } } catch (Exception e) { f.set(T_stance, ""); } } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IllegalAccessException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } return T_stance; } public static <T> List<T> initJsonDataOfArray(String jsonstr,Class<?> cla) { List<T> listdata=new ArrayList<T>(); Field[] field=cla.getDeclaredFields(); for(Field f:field) { f.setAccessible(true); } try { JSONArray jsonarray=new JSONArray(jsonstr); for(int i=0;i<jsonarray.length();i++) { /*if(i>4) { Log.i("YK", ""+i); }*/ try { T T_stance=(T) cla.newInstance(); JSONObject jsonobject=jsonarray.getJSONObject(i); for(Field f:field) { try { if(f.getGenericType().toString().startsWith("class java.lang")) { if(f.getGenericType().toString().equals("class java.lang.Integer")) { if(jsonobject.has(f.getName())) { f.set(T_stance, Integer.valueOf(jsonobject.get(f.getName()).toString())); } } else if(f.getGenericType().toString().equals("class java.lang.String")) { if(jsonobject.has(f.getName())) { f.set(T_stance, jsonobject.get(f.getName()).toString()); } } } else if(f.getGenericType().toString().startsWith("java.util.List")) { if(f.getType().isAssignableFrom(List.class)) { Type ft = f.getGenericType(); if(ft == null) continue; if(ft instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType) ft; Class class_parameter = (Class)pt.getActualTypeArguments()[0]; if(jsonobject.has(f.getName())) { List<Object> ls_Object=initJsonDataOfArray(jsonobject.get(f.getName()).toString(),class_parameter); f.set(T_stance, ls_Object); } } } } else { Class class_custom= f.getType(); if(jsonobject.has(f.getName())) { f.set(T_stance, initJsonDatatoObject(jsonobject.get(f.getName()).toString(),class_custom)); } } } catch (JSONException e) { throw e; } } listdata.add(T_stance); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } catch (JSONException e) { // TODO Auto-generated catch block listdata.add((T) JsonToDataUtil.initJsonDatatoObject(jsonstr, cla)); } return listdata; } /** * @throws JSONException * @author yk * @date 2015年9月1日 下午4:11:14 * @Title: initJsonSuccess * @Description: 获取success * @param jsonstr * @return * @throws JSONException 设定文件 * @return String 返回类型 * @throws */ public boolean initJsonSuccess(String jsonstr) throws JSONException { StringBuffer result=new StringBuffer(); JSONObject jsonobject=new JSONObject(jsonstr); result.append(jsonobject.get("success").toString()); return Boolean.valueOf(result.toString()); } /** * @author yk * @date 2015年9月1日 下午4:11:34 * @Title: initJsonMsg * @Description: 获取msg * @param jsonstr * @return * @throws JSONException 设定文件 * @return String 返回类型 * @throws */ public String initJsonMsg(String jsonstr) throws JSONException { StringBuffer result=new StringBuffer(); JSONObject jsonobject=new JSONObject(jsonstr); result.append(jsonobject.get("msg").toString()); return result.toString(); } }
[ "“ykzyj_email@163.com”" ]
“ykzyj_email@163.com”
ec5f4773747e3b457512cd3985d4185d180f1a5d
b355db9c0b057b2bca369a395cd744186f0aa867
/app/src/androidTest/java/com/siit/pitawat/playground2/ApplicationTest.java
de0d050eff59136d1efa9225b293dc3ba4378a1f
[]
no_license
BlackMercy/Playground2
ab94b63369d4be8861ad21d7767bd16917f0c1c7
34531b99fc751c720197a42077b508a8da78c457
refs/heads/master
2020-04-13T07:58:26.117086
2015-02-15T14:29:23
2015-02-15T14:29:23
30,829,678
0
0
null
null
null
null
UTF-8
Java
false
false
359
java
package com.siit.pitawat.playground2; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "pitawat.n@gmail.com" ]
pitawat.n@gmail.com
6b9c816e695d5e2116cba44f1584b4d413979e74
9e4209707981362c8345ce5591993b2a15da953d
/src/fr/algorithmie/InteractifStockageNombre.java
f4e01c19c26040655959279ce4f0656a1a9c93a2
[]
no_license
TomCermelli/approche-imp-rative
73068757f2c3f4959a2d715242a4369d3dc0b425
09d63d63aaa3ea6ad9771a109369adc33eae4891
refs/heads/master
2023-02-22T21:46:22.272312
2021-01-26T17:09:17
2021-01-26T17:09:17
331,973,830
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,745
java
/** * */ package fr.algorithmie; import java.util.Scanner; import java.util.ArrayList; /** * @author tomce * */ public class InteractifStockageNombre { /** * @param args */ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("1. Ajouter un nombre"); System.out.println("2. Afficher les nombres existants"); System.out.println("Ecrivez 1 ou 2"); int textNb = scanner.nextInt(); int[] array = new int[3]; int index = 0; while (true) { // Condition afin d'agrandir un tableau if (index == array.length - 1) { int[] temp = new int[array.length+1]; for(int i = 0; i<array.length; i++) { temp[i] = array[i]; } array = temp; } // Si on choisit l'option 1 , ajouter un nombre if (textNb == 1) { System.out.println("Renseignez un nombre, celui-ci s'ajoutera au tableau existant"); int nb = scanner.nextInt(); array[index] = nb; index++; // On dit à l'utilisateur qu'il faut qu'il renseigne un nombre System.out.println("Votre nombre " + nb + " a bien été ajouté"); System.out.println("Ecrivez 1 ou 2"); textNb = scanner.nextInt(); // Si on choisit l'option 2, Afficher le tableau existant } else if (textNb == 2) { System.out.println("Le tableaux comporte ces éléments : "); for (int i = 0; i < array.length; i++) { System.out.print(array[i] + " "); } System.out.println(); System.out.println("Ecrivez 1 ou 2"); textNb = scanner.nextInt(); // Si on n'entre ni dans l'option 1 ni l'option 2 } else { System.out.println("Cette option n'existe pas, veuillez choisir entre l'option 1 ou 2"); textNb = scanner.nextInt(); } } } }
[ "tomce@192.168.0.14" ]
tomce@192.168.0.14
cb217832e612202d9cca7d4096f32c3c0c29a0ff
e561d6ea521a4d7eee9c96eca671ae6212406309
/Java/src/Programmers/PG43165.java
c446cb50ce8ed0315a5db68624319cc297cfca56
[]
no_license
Seungpang/Algorithms
02a9a9dc3225caf8651c03208334082024deb65f
f7e6c5f28ce3b6509cb91d7aca162f36ae837b82
refs/heads/master
2023-08-19T03:30:24.346606
2023-08-17T15:50:18
2023-08-17T15:50:18
176,178,409
0
0
null
null
null
null
UTF-8
Java
false
false
868
java
package Programmers; public class PG43165 { public static void main(String[] args) { final PG43165 pg43165 = new PG43165(); System.out.println(pg43165.solution(new int[]{4, 1, 2, 1}, 4)); } public int solution(int[] numbers, int target) { int answer = 0; answer = dfs(numbers, target, numbers[0], 1) + dfs(numbers, target, -numbers[0], 1); return answer; } private int dfs(int[] numbers, int target, int sum, int depth) { if (numbers.length == depth) { if (target == sum) { return 1; } else { return 0; } } int result = 0; result += dfs(numbers, target, sum + numbers[depth], depth + 1); result += dfs(numbers, target, sum - numbers[depth], depth + 1); return result; } }
[ "obey1342@gmail.com" ]
obey1342@gmail.com
bfe46a0904606cab3dfce6725944cfdab0cb4586
5e83156af30cac96a0c88d63b592986617d36416
/AndroidStudio/Ch4/myUICheckBox/app/src/main/java/nhu/mobile/UIComponent/myUICheckBox.java
436b128681f66912fd0715a77c8ab4102e60816e
[]
no_license
worldstar/App-Cloud-DatabaseBook2014
7f7e41babee6e900c585a52994d4d4ea5d856802
dab51065b0f0eb8f117b2cce32de43195793fb71
refs/heads/master
2016-09-15T14:34:34.416164
2016-03-14T03:03:46
2016-03-14T03:03:46
25,573,772
1
1
null
null
null
null
BIG5
Java
false
false
2,092
java
package nhu.mobile.UIComponent; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class myUICheckBox extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button1 = (Button) findViewById(R.id.Button01); button1.setOnClickListener( new Button.OnClickListener(){ public void onClick(View v){ Toast.makeText(myUICheckBox.this, "你點選了Button01", Toast.LENGTH_LONG).show(); } }); final EditText editText1 = (EditText) findViewById(R.id.EditText01); Button button2 = (Button) findViewById(R.id.Button02); button2.setText("Button02"); button2.setOnClickListener( new Button.OnClickListener(){ public void onClick(View v){ Toast.makeText(myUICheckBox.this, editText1.getText(), Toast.LENGTH_LONG).show(); } }); final CheckBox checkBox1 = (CheckBox) findViewById(R.id.CheckBox01); checkBox1.setText("是否參加此活動"); checkBox1.setOnClickListener(new CheckBox.OnClickListener() { public void onClick(View v) { // Perform action on clicks, depending on whether it's now checked if (((CheckBox) v).isChecked()) { Toast.makeText(myUICheckBox.this, "參加", Toast.LENGTH_LONG).show(); } else { Toast.makeText(myUICheckBox.this, "不參加", Toast.LENGTH_LONG).show(); } } }); } }
[ "worldstar.chen@gmail.com" ]
worldstar.chen@gmail.com
5bbaa633de1909de721a5320ea8bbea9d4117dd4
65c37921c5000bc01a428d36f059578ce02ebaab
/jooq/src/main/test/test/generated/pg_catalog/tables/PgSettings.java
50c94d4d633d20ffafa61146a13f7b870c9e982d
[]
no_license
azeredoA/projetos
05dde053aaba32f825f17f3e951d2fcb2d3034fc
7be5995edfaad4449ec3c68d422247fc113281d0
refs/heads/master
2021-01-11T05:43:21.466522
2013-06-10T15:39:42
2013-06-10T15:40:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,557
java
/** * This class is generated by jOOQ */ package test.generated.pg_catalog.tables; /** * This class is generated by jOOQ. */ @javax.annotation.Generated(value = {"http://www.jooq.org", "2.6.0"}, comments = "This class is generated by jOOQ") @java.lang.SuppressWarnings("all") public class PgSettings extends org.jooq.impl.TableImpl<test.generated.pg_catalog.tables.records.PgSettingsRecord> { private static final long serialVersionUID = -363524301; /** * The singleton instance of pg_catalog.pg_settings */ public static final test.generated.pg_catalog.tables.PgSettings PG_SETTINGS = new test.generated.pg_catalog.tables.PgSettings(); /** * The class holding records for this type */ @Override public java.lang.Class<test.generated.pg_catalog.tables.records.PgSettingsRecord> getRecordType() { return test.generated.pg_catalog.tables.records.PgSettingsRecord.class; } /** * The table column <code>pg_catalog.pg_settings.name</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> NAME = createField("name", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.setting</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> SETTING = createField("setting", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.unit</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> UNIT = createField("unit", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.category</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> CATEGORY = createField("category", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.short_desc</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> SHORT_DESC = createField("short_desc", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.extra_desc</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> EXTRA_DESC = createField("extra_desc", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.context</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> CONTEXT = createField("context", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.vartype</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> VARTYPE = createField("vartype", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.source</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> SOURCE = createField("source", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.min_val</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> MIN_VAL = createField("min_val", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.max_val</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> MAX_VAL = createField("max_val", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.enumvals</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String[]> ENUMVALS = createField("enumvals", org.jooq.impl.SQLDataType.CLOB.getArrayDataType(), this); /** * The table column <code>pg_catalog.pg_settings.boot_val</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> BOOT_VAL = createField("boot_val", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.reset_val</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> RESET_VAL = createField("reset_val", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.sourcefile</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.String> SOURCEFILE = createField("sourcefile", org.jooq.impl.SQLDataType.CLOB, this); /** * The table column <code>pg_catalog.pg_settings.sourceline</code> */ public final org.jooq.TableField<test.generated.pg_catalog.tables.records.PgSettingsRecord, java.lang.Integer> SOURCELINE = createField("sourceline", org.jooq.impl.SQLDataType.INTEGER, this); public PgSettings() { super("pg_settings", test.generated.pg_catalog.PgCatalog.PG_CATALOG); } public PgSettings(java.lang.String alias) { super(alias, test.generated.pg_catalog.PgCatalog.PG_CATALOG, test.generated.pg_catalog.tables.PgSettings.PG_SETTINGS); } @Override public test.generated.pg_catalog.tables.PgSettings as(java.lang.String alias) { return new test.generated.pg_catalog.tables.PgSettings(alias); } }
[ "lindomar_reitz@hotmail.com" ]
lindomar_reitz@hotmail.com
c877267eceb5ac67e248135b2158e81d1311c66c
d60e287543a95a20350c2caeabafbec517cabe75
/LACCPlus/Hadoop/1120_2.java
2ef24a582a0ee931de8df52be5a4696d9189c034
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
504
java
//,temp,TopCLI.java,583,595,temp,TopCLI.java,569,581 //,2 public class xxx { private void setTerminalWidth() throws IOException, InterruptedException { if (terminalWidth != -1) { return; } String[] command = { "tput", "cols" }; String op = getCommandOutput(command).trim(); try { terminalWidth = Integer.parseInt(op); } catch (NumberFormatException ne) { LOG.warn("Couldn't determine terminal width, setting to 80", ne); terminalWidth = 80; } } };
[ "sgholami@uwaterloo.ca" ]
sgholami@uwaterloo.ca
5aa2632fd406d22ae8c0a95787362a37853da09c
da7352dc5229d48fca57a9b33d705516589fac5d
/HelloJi.java
93c7cae68aca4bac108dffb7c3494bb61a3c690a
[]
no_license
Allah-The-Dev/HelloWorld
c2cbfc594f6ed29fbd39870c4a0f0bc2f5c71fca
f5a51f9fc22a1a00e32d5907ebc6461c20c7b0d0
refs/heads/master
2020-03-31T13:05:00.929175
2019-01-06T03:58:53
2019-01-06T03:58:53
152,240,689
0
0
null
2019-01-05T16:52:56
2018-10-09T11:38:36
HTML
UTF-8
Java
false
false
147
java
public class HelloJi { public static void main(String[] args) { for (int i = 0; i < 10; i++) { System.out.println("HelloWorld"); } } }
[ "neelesh.pandey@ad.infosys.com" ]
neelesh.pandey@ad.infosys.com
bb0fefc9bf0a9a1ba2682f36249c4ef6bac63595
760626e52e80cd6210ffc9fca720e463fc63adba
/src/pack/model/tableModelToko.java
5fe193b4ae5b0f43022a27d8630fda2da365f073
[]
no_license
bacharuddinadieb/Latihan-MVC-JAVA
d0c3bd68a5247e2f1fc5487c4112031182c382ac
4c4f6d1a89ec65585cae2ea5dfab2dea6d8cd32a
refs/heads/master
2021-01-20T09:00:56.292856
2017-05-04T02:14:24
2017-05-04T02:14:24
90,210,661
0
0
null
null
null
null
UTF-8
Java
false
false
1,517
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 pack.model; import java.util.List; import javax.swing.table.AbstractTableModel; /** * * @author adieb */ public class tableModelToko extends AbstractTableModel { List<m_toko> lt; public tableModelToko(List<m_toko> lt) { this.lt = lt; } @Override public int getRowCount() { return lt.size(); } @Override public int getColumnCount() { return 5; } public String getColumnName(int column) { switch (column) { case 0: return "Kode_Barang"; case 1: return "Nama_Barang"; case 2: return "Kategori"; case 3: return "Jenis"; case 4: return "Harga"; default: return null; } } @Override public Object getValueAt(int row, int column) { switch (column) { case 0: return lt.get(row).getkode(); case 1: return lt.get(row).getnama(); case 2: return lt.get(row).getkategori(); case 3: return lt.get(row).getjenis(); case 4: return lt.get(row).getharga(); default: return null; } } }
[ "adieb@adieb-X455LD" ]
adieb@adieb-X455LD
f0969c5ccb8aa7264dd470399504472dc932c865
eddedd31b8d1389aced7d184fe8268cba8b3beee
/src/com/adult/android/entity/WxpayResult.java
54d47b438bf54d7c5917762243a118d9ba663d51
[]
no_license
dashewan11111/box_android
a87eb51c064c7bd73220488de9de0edcabe7237e
8a845e8c151ba04806d5589e1dc3f61c82d68c70
refs/heads/master
2021-01-10T12:49:43.362703
2016-01-28T11:50:34
2016-01-28T11:50:34
48,536,763
0
1
null
null
null
null
UTF-8
Java
false
false
1,376
java
package com.adult.android.entity; import java.io.Serializable; /** * User: liyuj<liyuj@cigmall.cn> * Date: 2015-08-06 * Time: 15:19 * FIXME */ public class WxpayResult implements Serializable{ private String timestamp; private String sign; private String noncestr; private String partnerid; private String prepayid; //private String package; private String appid; public String getTimestamp() { return timestamp; } public void setTimestamp(String timestamp) { this.timestamp = timestamp; } public String getSign() { return sign; } public void setSign(String sign) { this.sign = sign; } public String getNoncestr() { return noncestr; } public void setNoncestr(String noncestr) { this.noncestr = noncestr; } public String getPartnerid() { return partnerid; } public void setPartnerid(String partnerid) { this.partnerid = partnerid; } public String getPrepayid() { return prepayid; } public void setPrepayid(String prepayid) { this.prepayid = prepayid; } public String getAppid() { return appid; } public void setAppid(String appid) { this.appid = appid; } }
[ "806268354@qq.com" ]
806268354@qq.com
155149e0c06d0a3f9ae9889aeb24d1feabc623a2
9375b9e9dc04f42ba5138e7f57b57b7263465d21
/AsyncHttpClient/app/src/test/java/com/example/lcy/asynchttpclient/ExampleUnitTest.java
b724281a13e9b87abe3c1a95cc54bf6067cec4b9
[]
no_license
lcyseek/HttpAbout
c221b80584295c2797591dfdf2534e7e01d0a214
7389d53903c348b083f9f2fce60b3e3a1b636830
refs/heads/master
2021-01-17T12:39:32.612594
2016-06-27T01:48:32
2016-06-27T01:48:32
56,643,905
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package com.example.lcy.asynchttpclient; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "luchunyang@zhilai.com" ]
luchunyang@zhilai.com
36313e429bb1ae6ee27097e824ac5d1ee65ee6c2
f95461182a2c1c2f0c33e429e7492c1261402339
/app/src/androidTest/java/com/zmb/sunshine/ApplicationTest.java
18cb69d5d1e1d953acd561f709b1153537da8f0f
[ "Apache-2.0" ]
permissive
nirupammridha/sunshine
eaf5f2a349fb425211ea9b91ea9126644b4ed4ca
c8d102118974313240246d1cd7d21d80ad9e4afe
refs/heads/master
2021-01-11T19:58:46.635920
2015-01-01T01:41:42
2015-01-01T01:41:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package com.zmb.sunshine; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "zbergquist99@gmail.com" ]
zbergquist99@gmail.com
8647ee13320278c735a68037505f1951b17fa116
c523b5705ab447cc2134473e531c45d63231749a
/src/abstract_factory/MysqlDepartment.java
db29310bc28018f6f206b5113d70f8f1a5acfbf7
[]
no_license
cclouds/design_pattern
424a0d692f7ec2fd7f056de5750992f74d09ffcc
cb7f1bf6dd24eb83d026b63b9e556af6bef2a07d
refs/heads/master
2021-01-10T13:25:58.898461
2017-06-07T03:46:33
2017-06-07T03:46:33
49,691,957
1
0
null
null
null
null
UTF-8
Java
false
false
448
java
package abstract_factory; /** * MysqlDepartment实现BaseDepartment * @author user * */ public class MysqlDepartment implements BaseDepartment{ @Override public void insert(Department department) { System.out.println("在Mysql Department表中增加一条记录"); } @Override public Department getDepartment(int id) { System.out.println("在Mysql Department表中根据id查找记录"); return null; } }
[ "dongxiaopeng@zuozh.com" ]
dongxiaopeng@zuozh.com
58a53ffcd363ee48cc48c6792e02c951905ad1e6
530a921d0d095cac96fde4660315d3dc95c4d1a8
/src/main/java/edu/du/ict4361/philosophers/Philosopher.java
a114c209b81cd0380377bfee3bede419212cd00b
[]
no_license
mischwartz23/DiningPhilosophers
6bc71b116c359c3570612130429ace63bc57f82f
bc8cd3d9aa1308c63ec2fa7399fcfe15d1f7d91e
refs/heads/master
2023-08-04T23:38:31.670524
2021-09-19T22:35:43
2021-09-19T22:35:43
408,252,644
0
0
null
null
null
null
UTF-8
Java
false
false
5,983
java
package edu.du.ict4361.philosophers; //////////////////////////////////// // Philosopher.java // Author: M Schwartz // // Each Philosopher object is a thread. // There are two ways to create a working thread: // 1) Implement Runnable, implement run(), invest the object in a new Thread, and start() the Thread // (that's what this class is) // 2) Extend Thread, implement run(), create a new object, and start() the object. // // In this implementation, each Philosopher has a name (final) and a table. // The Table seats them by assigning their seat number (dependency injection). // The Philosopher's current activity is tracked in an enumeration (STATE), which changes over time. // Each activity has an associated (fixed) time, which is injected statically into the class // (each Philosopher, thus, takes the same amount of time to eat, think, and manipulate a fork). // The number of "meals" the Philosopher eats() is tracked. // A deadlock could occur if all Philosophers have their left fork in their hand and won't relinquish it. // Then the poor Philosophers will starve :-( // The state of the Philosopher uses a setter to change. // This allows, in the future, a way to measure how much time each Philosopher spends in each state. //////////////////////////////////// public class Philosopher implements Runnable { private final String name; private int tableSeatNumber; private Table table; public enum STATE { IDLE, THINKING, EATING, PICKING_UP_FORK, PUTTING_DOWN_FORK }; private volatile STATE state = STATE.IDLE; private static int thinkTime = 3000; // milliseconds private static int eatTime = 3000; // milliseconds private static int forkTime = 3000; // milliseconds private int numberOfTimesEating = 0; private int numberOfTimesThinking = 0; public Philosopher(String name, Table t) { this.name = name; table = t; } public void setSeatNumber(int seatNumber) { tableSeatNumber = seatNumber; } private Fork getLeftFork() { return table.getLeftFork(tableSeatNumber); } private Fork getRightFork() { return table.getRightFork(tableSeatNumber); } // Helper function to cause a thread to sleeps and ignore // InterruptedException events private void waitTime(int ms) { try { Thread.sleep(ms); } catch (InterruptedException ie) { System.err.println(" Philosopher: " + name + " interrupted while " + getState()); // do nothing } } // Represents a delay while the philosopher thinks private void think() { setState(STATE.THINKING); waitTime(thinkTime); setState(STATE.IDLE); numberOfTimesThinking++; } // Represents the sequence of events for the philosopher eating. private void eat() { setState(STATE.PICKING_UP_FORK); getLeftFork().pickUp(tableSeatNumber); waitTime(forkTime); getRightFork().pickUp(tableSeatNumber); waitTime(forkTime); setState(STATE.EATING); waitTime(eatTime); setState(STATE.PUTTING_DOWN_FORK); waitTime(forkTime); getLeftFork().putDown(tableSeatNumber); waitTime(forkTime); getRightFork().putDown(tableSeatNumber); numberOfTimesEating++; setState(STATE.IDLE); } public int getNumberOfTimesEating() { return numberOfTimesEating; } public int getNumberOfTimesThinking() { return numberOfTimesThinking; } public String getStatus() { Fork leftFork = getLeftFork(); Fork rightFork = getRightFork(); int lHolder = leftFork.getCurrentHolder(); int rHolder = rightFork.getCurrentHolder(); StringBuffer sb = new StringBuffer(); sb.append(name); sb.append(" is assigned forks "); sb.append("l: "); sb.append(leftFork.getName()); sb.append(" and "); sb.append("r: "); sb.append(rightFork.getName()); sb.append(" and "); sb.append(" has eaten "); sb.append(numberOfTimesEating); sb.append(" times, and currently is holding "); boolean left = (lHolder == tableSeatNumber); boolean right = (rHolder == tableSeatNumber); if (left && right) { sb.append("both forks"); } else if (!left && !right) { sb.append("neither fork"); } else if (left) { sb.append("the left fork"); sb.append(" (" + leftFork.getName() + ") "); } else { sb.append("the right fork"); sb.append(" (" + rightFork.getName() + ") "); } sb.append(" in state " + state); return sb.toString(); } @Override public void run() { // Run until the Table shut down the party while (table.isPartyIsOn()) { think(); eat(); } } public static int getThinkTime() { return thinkTime; } public static void setThinkTime(int thinkTime) { Philosopher.thinkTime = thinkTime; } public static int getEatTime() { return eatTime; } public static void setEatTime(int eatTime) { Philosopher.eatTime = eatTime; } public int getEatTimeTotal() { return eatTime * getNumberOfTimesEating(); } public int getThinkTimeTotal() { return thinkTime * getNumberOfTimesThinking(); } public static int getForkTime() { return forkTime; } public static void setForkTime(int forkTime) { Philosopher.forkTime = forkTime; } public STATE getState() { return state; } // setState could be instrumented to report what percentage of the time is // spent // in each state. private void setState(STATE state) { this.state = state; Thread.yield(); } }
[ "schwartz@schwartzcomputer.com" ]
schwartz@schwartzcomputer.com
02877d159dd6ca4ccdbb7bd2cc1feac2d8f352bd
86d2c6e478457ca97b72ee4fe142021cd203ad20
/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/jobs/parameters/PartitionedJobParameters.java
4cbbfb2fae4f78b52205f64cffdb6af68cd46405
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
nmdp-bioinformatics/hapi-fhir
c43874d5a4862a13a7c6fb434acabbec77e9dc6a
9ae71aba95d4af7650642f912c5b034ce537e835
refs/heads/master
2023-05-13T06:08:11.470244
2023-05-07T12:25:29
2023-05-07T12:25:29
71,417,241
1
1
Apache-2.0
2022-12-23T16:21:54
2016-10-20T02:17:53
Java
UTF-8
Java
false
false
1,538
java
/*- * #%L * HAPI FHIR JPA Server - Batch2 Task Processor * %% * Copyright (C) 2014 - 2023 Smile CDR, Inc. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ package ca.uhn.fhir.batch2.jobs.parameters; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.model.api.IModelJson; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.Nullable; public class PartitionedJobParameters implements IModelJson { @JsonProperty(value = "partitionId") @Nullable private RequestPartitionId myRequestPartitionId; @JsonProperty("batchSize") @Nullable private Integer myBatchSize; @Nullable public RequestPartitionId getRequestPartitionId() { return myRequestPartitionId; } public void setRequestPartitionId(@Nullable RequestPartitionId theRequestPartitionId) { myRequestPartitionId = theRequestPartitionId; } public void setBatchSize(int theBatchSize) { myBatchSize = theBatchSize; } @Nullable public Integer getBatchSize() { return myBatchSize; } }
[ "noreply@github.com" ]
noreply@github.com
3a2a41c97f3ff0ffa74f10c5e3b09764161f825f
d8c141ea5af9bb7e418c899ccc22b9f8c6ee0ba3
/src/edu/uta/tdj/controller/Controller.java
58c26680641f48a74acf6b4f3b457ce024c2a93c
[]
no_license
swethakiledar/CSE6324_TouchDevelop
c8003e302a42dda239729fa3c7b2348440fbd776
d517742f5e9fa8c81490b7ab83ffe90da8668b8b
refs/heads/master
2016-09-05T17:12:46.715214
2015-03-01T21:29:46
2015-03-01T21:29:46
30,781,365
0
1
null
null
null
null
UTF-8
Java
false
false
69
java
package edu.uta.tdj.controller; public class Controller { }
[ "zhangke3012@163.com" ]
zhangke3012@163.com
6fbbfa05f7355304e6546283937d301bbfe4971b
db2c84c26c779e8ef0f06983e89d94d51f81efd0
/Readable.java
f8a01a927ce904782d1fdbf3fdee985643c72ffd
[]
no_license
javariusphelps/theLibraryExercise
31828c1d102d4a64910b8c7990891aecee4d2454
c801572c7ebbe634d6dcb4c6e62ae1decff94b0a
refs/heads/master
2022-08-20T20:44:39.806211
2020-05-22T04:25:29
2020-05-22T04:25:29
265,681,913
0
0
null
null
null
null
UTF-8
Java
false
false
72
java
interface Readable { final String x = "JP"; void display(); }
[ "javariusphelps@gmail.com" ]
javariusphelps@gmail.com
e02ac0e39d43b72c3e9d8d9390d7bd2989679114
9935aae1bbaa893a6d56de469df7016099904f23
/Supermercado/src/com/company/Sucursal.java
56025e17e3479001fd44013788e92c26252448cf
[]
no_license
RafaelMellado/INF2241-ProgramacionOrientadaAObjetos
c55d9c1160ae8d733927179d8d6ffed94455fd31
25d5aa8519af1c80eb0009b603f9dc08248ec301
refs/heads/master
2021-09-08T21:58:42.750215
2021-08-29T17:40:16
2021-08-29T17:40:16
83,449,294
0
0
null
null
null
null
UTF-8
Java
false
false
1,038
java
package com.company; public class Sucursal { private int id; private String nombre; private Cliente clientes[]; public Sucursal(int id, String nombre, int cantidadClientes) { this.id = id; this.nombre = nombre; this.clientes = new Cliente[cantidadClientes]; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public int getSumatoriaCupos() { int sumatoria=0; for(int i=0; i<clientes.length; i++) { if(clientes[i]!=null) sumatoria+=clientes[i].getCupo(); } return sumatoria; } public void eliminarCliente(int idCliente) { for(int i=0; i<clientes.length; i++) { if(clientes[i]!=null && clientes[i].getId()==idCliente) clientes[i]=null; } } }
[ "noreply@github.com" ]
noreply@github.com
11cee6cd372df9ecc21d2566d9f1db10f16b40e7
1b2f6424d8c5b7f6f8fee7d57d651fa89948304d
/GetToken/src/Nodo.java
99070389ce59d6066a08770a6abee7608cb11186
[]
no_license
amaldonadoec/GetToken
0987288f1687a7b8e116ced4209f52dbd8755a4a
b74d409b83fb86372233e5bd8c754c3103f98f62
refs/heads/master
2021-05-28T08:32:17.513452
2015-02-04T20:51:31
2015-02-04T20:51:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
980
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. */ /** * * @author ArmandoPC */ public class Nodo { private String valor; private int descripcion; public Nodo(String valor, int descripcion) { this.valor = valor; this.descripcion = descripcion; } /** * @return the valor */ public String getValor() { return valor; } /** * @param valor the valor to set */ public void setValor(String valor) { this.valor = valor; } /** * @return the descripcion */ public Integer getDescripcion() { return descripcion; } /** * @param descripcion the descripcion to set */ public void setDescripcion(int descripcion) { this.descripcion = descripcion; } }
[ "armand1live@gmail.com" ]
armand1live@gmail.com
df869be31ff34d01dcdfa64b762aa518cf3e699b
dda4c37d8dfefd912c0c576083ab896de7575c62
/app/src/main/java/iso/piotrowski/marek/nyndro/FragmentsFactory/IFragmentParams.java
4e0f0b4239719de2a23a14c0971d1e62b3d5373c
[]
no_license
marekpiotrowskimp/nyndro_remote
cbcd1d952abd6bb35597595360f9fc5cc9bbc67f
b7d05ef3abebcf5ef6792eb04c5cff74a627019c
refs/heads/master
2021-01-18T16:16:23.994140
2017-10-05T17:49:26
2017-10-05T17:49:26
86,732,277
0
0
null
null
null
null
UTF-8
Java
false
false
455
java
package iso.piotrowski.marek.nyndro.FragmentsFactory; import iso.piotrowski.marek.nyndro.PracticeMain.PracticeMainContract; /** * Created by marek.piotrowski on 22/08/2017. */ public interface IFragmentParams { String getFragmentName(); FragmentsFactory.TypeOfFragment getTypeOf(); boolean isButtonVisible(); boolean isButtonToolBarVisible(); PracticeMainContract.TypeOfBoomButton getTypeOfBoomButton(); void refreshData(); }
[ "marek.piotrowski.mp@gmail.com" ]
marek.piotrowski.mp@gmail.com
e1eac786bf91b31bea8f598c99f78d237293593e
012f4407ecca40564436fb6f59959ff9a0c98731
/app/src/main/java/com/unnyweather/android/logic/dao/PlaceDao.java
52c1a9fbd4309d2d08b1a38b3bf4cd70c81a2b35
[ "Apache-2.0" ]
permissive
yuanyuanyuani/SunnyWeather
023d0de7821a6b1a691b2fb6d60496a7c36668c4
e3da797ef9097ab3840f26188f92ca5b58ac9674
refs/heads/main
2023-02-14T14:07:05.685261
2021-01-12T00:53:30
2021-01-12T00:53:30
328,831,906
0
0
Apache-2.0
2021-01-12T00:53:42
2021-01-12T00:53:42
null
UTF-8
Java
false
false
883
java
package com.unnyweather.android.logic.dao; import android.content.Context; import android.content.SharedPreferences; import com.google.gson.Gson; import com.unnyweather.android.SunnyWeatherApplication; import com.unnyweather.android.logic.model.Place; public class PlaceDao { public static void savePlace(Place place) { sharedPreferences().edit().putString("place",new Gson().toJson(place)).commit(); } public static Place getSavedPlace(){ String place = sharedPreferences().getString("place", ""); return new Gson().fromJson(place,Place.class); } public static boolean isPlacesSaved(){ return sharedPreferences().contains("place"); } private static SharedPreferences sharedPreferences(){ return SunnyWeatherApplication.context.getSharedPreferences("sunny_weather", Context.MODE_PRIVATE); } }
[ "1768913313@qq.com" ]
1768913313@qq.com
fe591f2d3d4f23954d0c667769bc07dae324c2e6
1e463192e90e47393bcc50a2eedc5c17cb31fd22
/gateway-service/src/main/java/com/biubiu/GatewayApplication.java
0dbade56f555232961c68e3ef63af08a21e420f5
[]
no_license
wuzuilanhai/book
790ac7272b0a955e43285920b7357f1171a62e94
a9d9ce14f4f380114e758fb7dc28c3f0531907d3
refs/heads/master
2020-05-02T11:44:00.564970
2019-03-30T11:00:19
2019-03-30T11:00:19
177,937,786
2
0
null
null
null
null
UTF-8
Java
false
false
667
java
package com.biubiu; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.feign.EnableFeignClients; /** * Created by Haibiao.Zhang on 2019-03-27 12:04 */ @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) @EnableEurekaClient @EnableFeignClients public class GatewayApplication { public static void main(String[] args) { SpringApplication.run(GatewayApplication.class); } }
[ "1473209216@qq.com" ]
1473209216@qq.com
2994f76e460c5f57f5394d3806ca7a024f628191
784cb2df31eac5520b1fe5b2dedad4584398d1b8
/JavaProgramming/src/ch12/exam05/YieldExample.java
14c634f8bcd81d6b4983255fb133e2a4cd910492
[]
no_license
kdh24/MyRepository
07e7706bd8048bc9c63f89581807b894f2d904cd
34f8e1603ecbd76574b3acc7fd674bbc122e36a8
refs/heads/master
2020-04-12T06:44:17.904549
2017-03-27T01:35:28
2017-03-27T01:35:28
65,808,579
0
0
null
null
null
null
UTF-8
Java
false
false
528
java
package ch12.exam05; import java.awt.Toolkit; public class YieldExample { public static void main(String[] args) { ThreadA threadA = new ThreadA(); ThreadB threadB = new ThreadB(); threadA.start(); threadB.start(); try { Thread.sleep(3000); } catch (InterruptedException e) {} threadA.work = false; try { Thread.sleep(3000); } catch (InterruptedException e) {} threadA.work = true; try { Thread.sleep(3000); } catch (InterruptedException e) {} threadA.stop = true; threadB.stop = true; } }
[ "ehdgus24@nate.com" ]
ehdgus24@nate.com
c1aaf634920f7de62d7fe452fa638111921a586b
867165fc7a4c87968a1082b1947229597505bbd6
/app/src/main/java/com/gongyunhaoyyy/wustweschool/yuanlai/yuanlai/element_item.java
3aa3a035373721b6ab20df23eeeb56c9504fbf9b
[]
no_license
Doris1003/WUSTWeSchool
89135ac4f4fefaa587ba5b48f3a6b4bf9ddc5763
72b7d043ef9b7b78995179d4ecd4ce3fe3eb10ba
refs/heads/master
2021-07-17T16:59:59.532855
2017-10-25T11:45:49
2017-10-25T11:45:49
107,744,225
0
0
null
2017-10-21T02:13:02
2017-10-21T02:13:01
null
UTF-8
Java
false
false
529
java
package com.gongyunhaoyyy.wustweschool.yuanlai.yuanlai; import java.util.UUID; /** * Created by 99460 on 2017/10/14. */ public class element_item { private String element_item; private UUID mId; public UUID getId(){ return mId; } public String toString(){ return element_item; } public void setElement_item(String element_item){ this.element_item = element_item; } public element_item(String element_item){ this.element_item = element_item; } }
[ "994600653@qq.com" ]
994600653@qq.com
204adce4be0ca8cdcffcd7b15f64a04640cea157
b00c54389a95d81a22e361fa9f8bdf5a2edc93e3
/external/apache-harmony/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/MethodsDebuggee.java
433bace6f5c24d51a37a2b71142a0d5264e55e1d
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
mirek190/x86-android-5.0
9d1756fa7ff2f423887aa22694bd737eb634ef23
eb1029956682072bb7404192a80214189f0dc73b
refs/heads/master
2020-05-27T01:09:51.830208
2015-10-07T22:47:36
2015-10-07T22:47:36
41,942,802
15
20
null
2020-03-09T00:21:03
2015-09-05T00:11:19
null
UTF-8
Java
false
false
1,630
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author Anatoly F. Bondarenko */ /** * Created on 18.02.2005 */ package org.apache.harmony.jpda.tests.jdwp.ReferenceType; import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer; import org.apache.harmony.jpda.tests.share.SyncDebuggee; public class MethodsDebuggee extends SyncDebuggee { static int staticTestMethod(long longParam) { return 1; } Object objectTestMethod(Object objectParam) { return null; } public void run() { synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY); logWriter.println("--> Debuggee: MethodsDebuggee..."); synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE); } public static void main(String [] args) { runDebuggee(MethodsDebuggee.class); } }
[ "mirek190@gmail.com" ]
mirek190@gmail.com
0a9111340987aeb7125e2d452fad52d410dbe783
71448a10cc2b1acaca2fc3c9bc13e63019983b5b
/app/src/main/java/uam/krul/vetul/dark/MainActivity.java
a3d00fb4f4bc862ee8316ca79624f5597ec23eb2
[]
no_license
kaspychala/DARK
366f266eec9671971136fefca3badde53bd3e970
71c7351b59d703139d65d861d59ab7478211b4a3
refs/heads/master
2021-01-21T14:34:06.989182
2017-06-25T14:27:16
2017-06-25T14:27:16
95,306,504
0
0
null
null
null
null
UTF-8
Java
false
false
43,610
java
package uam.krul.vetul.dark; import android.content.DialogInterface; import android.graphics.Color; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import org.w3c.dom.Text; import java.util.Random; public class MainActivity extends AppCompatActivity { private Button A; private TextView questionA; private Button B; private TextView questionB; private Button C; private TextView questionC; private Button D; private TextView questionD; private Button start; private TextView question; private int maxQuestionNumber = 47; private String questions[][] = new String[maxQuestionNumber][6]; private Random generator = new Random(); private int random = generator.nextInt(maxQuestionNumber); private String answer = ""; private float score = 0; private boolean started=false; private float questionNumber = 1; private ImageView image; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); fillQuestions(); A = (Button) findViewById(R.id.A); A.setEnabled(false); questionA = (TextView) findViewById(R.id.questionA); B = (Button) findViewById(R.id.B); B.setEnabled(false); questionB = (TextView) findViewById(R.id.questionB); C = (Button) findViewById(R.id.C); C.setEnabled(false); questionC = (TextView) findViewById(R.id.questionC); D = (Button) findViewById(R.id.D); D.setEnabled(false); questionD = (TextView) findViewById(R.id.questionD); start = (Button) findViewById(R.id.start); question = (TextView) findViewById(R.id.question); image = (ImageView) findViewById(R.id.reactions); start.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(!started) { A.setEnabled(true); B.setEnabled(true); C.setEnabled(true); D.setEnabled(true); question.setTextColor(Color.BLACK); questionA.setTextColor(Color.BLACK); questionB.setTextColor(Color.BLACK); questionC.setTextColor(Color.BLACK); questionD.setTextColor(Color.BLACK); question.setText(questions[random][0]); questionA.setText(questions[random][1]); questionB.setText(questions[random][2]); questionC.setText(questions[random][3]); questionD.setText(questions[random][4]); start.setEnabled(false); start.setText("Następne pytanie"); image.setImageResource(R.drawable.blank); started = true; } else{ if(questionNumber>15){ AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create(); alertDialog.setTitle("Czy Vetul będzie zadowolony?"); alertDialog.setMessage("Twój wynik to: "+(score/(15))*100+"%"); alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); alertDialog.show(); started=false; questionNumber = 1 ; score = 0; image.setImageResource(R.drawable.blank); A.setEnabled(false); B.setEnabled(false); C.setEnabled(false); D.setEnabled(false); start.setText("Rozpocznij test!"); } else{ question.setTextColor(Color.BLACK); questionA.setTextColor(Color.BLACK); questionB.setTextColor(Color.BLACK); questionC.setTextColor(Color.BLACK); questionD.setTextColor(Color.BLACK); question.setText(questions[random][0]); questionA.setText(questions[random][1]); questionB.setText(questions[random][2]); questionC.setText(questions[random][3]); questionD.setText(questions[random][4]); A.setEnabled(true); B.setEnabled(true); C.setEnabled(true); D.setEnabled(true); start.setEnabled(false); image.setImageResource(R.drawable.blank); } } } }); A.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { answer="a"; check(); } }); B.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { answer="b"; check(); } }); C.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { answer="c"; check(); } }); D.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { answer="d"; check(); } }); } public void check(){ if(questions[random][5].equals(answer)){ score++; image.setImageResource(R.drawable.happy); question.setText("DOBRZE!"); question.setTextColor(Color.GREEN); } else{ image.setImageResource(R.drawable.sad); question.setText("ŹLE!"); question.setTextColor(Color.RED); } if(questions[random][5].equals("a")){ questionA.setTextColor(Color.GREEN); questionB.setTextColor(Color.RED); questionC.setTextColor(Color.RED); questionD.setTextColor(Color.RED); } if(questions[random][5].equals("b")){ questionA.setTextColor(Color.RED); questionB.setTextColor(Color.GREEN); questionC.setTextColor(Color.RED); questionD.setTextColor(Color.RED); } if(questions[random][5].equals("c")){ questionA.setTextColor(Color.RED); questionB.setTextColor(Color.RED); questionC.setTextColor(Color.GREEN); questionD.setTextColor(Color.RED); } if(questions[random][5].equals("d")){ questionA.setTextColor(Color.RED); questionB.setTextColor(Color.RED); questionC.setTextColor(Color.RED); questionD.setTextColor(Color.GREEN); } random = generator.nextInt(maxQuestionNumber); start.setEnabled(true); questionNumber++; if(questionNumber>15){ start.setText("Zakończ i podaj wynik"); } A.setEnabled(false); B.setEnabled(false); C.setEnabled(false); D.setEnabled(false); } public void fillQuestions(){ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 1 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[0][0] = "Ile bajtów w pamięci programu mikrokontrolera 8051 zajmuje rozkaz MOV R5, A ?"; questions[0][1] = "a. 1"; questions[0][2] = "b. 2"; questions[0][3] = "c. 3"; questions[0][4] = "d. 4"; questions[0][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 2 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[1][0] = "Architektura pamięci mikrokontrolera 8051 to tzw. architektura mieszana. Oznacza to: "; questions[1][1] = "a. Wspólną pamięć dla danych i programu oraz wspólną magistralę dla danych i adresów. "; questions[1][2] = "b. Wspólną pamięć dla danych i programu, ale oddzielne magistrale danych i adresową."; questions[1][3] = "c. Oddzielne pamięci danych i programu, ale wspólną magistralę danych i adresową. "; questions[1][4] = "d. Oddzielne pamięci danych i programu oraz oddzielne magistrale danych i adresową."; questions[1][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 3 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[2][0] = "Jak należy ustawić starszy (TH) i młodszy (TL) bajt timera T0, aby pracując w trybie 1 zliczył 256impulsów? "; questions[2][1] = "a. TH = 0, TL = 0 "; questions[2][2] = "b. TH = 255, TL = 0 "; questions[2][3] = "c. TH = 0, TL = 255"; questions[2][4] = "d. TH = 255, TL = 255"; questions[2][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 4 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[3][0] = "Sygnał ALE mikrokontrolera 8051, to sygnał sterujący: "; questions[3][1] = "a. zapisem do zewnętrznej pamięci programu "; questions[3][2] = "b. odczytem z zewnętrznej pamięci programu "; questions[3][3] = "c. zatrzaskiem (buforem) adresowym"; questions[3][4] = "d. przekierowaniem sygnałów WR i RD do pamięci danych lub programu"; questions[3][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 5 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[4][0] = "W systemie DSM-51 wpisanie liczby 00000110B do rejestru CSDB spowoduje: "; questions[4][1] = "a. wyświetlenie cyfry 1 na wybranych wskaźnikach wyświetlacza siedmiosegmentowego "; questions[4][2] = "b. wybranie wskaźników 1 i 2 wyświetlacza siedmiosegmentowego "; questions[4][3] = "c. możliwość odczytu klawiszy oraz ESC klawiatury przeglądanej sekwencyjnie "; questions[4][4] = "d. możliwość odczytu klawiszy 1 oraz 2 klawiatury matrycowej "; questions[4][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 6 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[5][0] = "Dane są następujące instrukcje asemblera ARM mov r1, #17 mov r2, #2048- mov r3, r2, ASR r1. Rejestr r3 zawiera wynik"; questions[5][1] = "a. Dzielenia r2 przez 2^r1 "; questions[5][2] = "b. Arytmetycznego przesunięcia w prawo o 17 bitów w rejestrze r2 "; questions[5][3] = "c. Dzielenia r2 przez 2 "; questions[5][4] = "d. Mnożenia r2 przez 217 "; questions[5][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 7 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[6][0] = "Procesor ARM jest zbudowany wg modelu "; questions[6][1] = "a. Architektury von Neumana "; questions[6][2] = "b. Architektury harwardzkiej "; questions[6][3] = "c. Architektury mieszanej, noszącej cechy architektury von Neumana i harwardzkiej "; questions[6][4] = "d. Innej niż w punktach a-c "; questions[6][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 8 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[7][0] = "Instrukcja Add r0, r1, r1, LSL #5 wykonywana jest przez CPU ARM na"; questions[7][1] = "a. Pięciu operandach"; questions[7][2] = "b. Czterech operandach"; questions[7][3] = "c. Trzech operandach (drugi wykład Snape’a) "; questions[7][4] = "d. Dwóch operandach "; questions[7][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 9 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[8][0] = "Dane są instrukcje (procesor ARM): cmp r1,r2 blt procedura add r0, r1,r2 b dalej procedura: bl FUNKCJA dalej: .... Wywołanie funkcji nastąpi jeśli w rejestrze CPSR "; questions[8][1] = "a. Wartość znacznika N=1"; questions[8][2] = "b. Wartość znacznika C=1"; questions[8][3] = "c. Wartość znacznika Z=1"; questions[8][4] = "d. Wartość znacznika V=1"; questions[8][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 10 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[9][0] = "Licznik rozkazów (PC) mikrokontrolera 8051 zawiera"; questions[9][1] = "a. adres bajtu w pamięci programu kolejnego do pobrania"; questions[9][2] = "b. numer rozkazu (kod operacji) kolejnego do wykonania"; questions[9][3] = "c. ilość rozkazów wykonanych w trakcie działania programu "; questions[9][4] = "d. ilość rozkazów dostępnych dla danego typu mikrokontrolera"; questions[9][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 11 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[10][0] = "Termin ‘multipleksowanie’ w odniesieniu do magistrali oznacza"; questions[10][1] = "a. wykorzystanie tych samych linii do przesyłania danych oraz adresów "; questions[10][2] = "b. wykorzystanie tych samych linii do przesyłania informacji pomiędzy więcej niż dwoma urządzeniami"; questions[10][3] = "c. podział magistrali na magistralę danych, magistralę adresową oraz linie sterujące "; questions[10][4] = "d. podział urządzeń korzystających z magistrali na urządzenia typu ‘master’ oraz ‘slave’"; questions[10][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 12 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[11][0] = "Sterownik transmisji szeregowej mikrokontrolera 8051 pracuje w trybie 1 (transmisja asynchroniczna) z prędkością 240 bodów. Ile bajtów danych w ciągu jednej sekundy nadaje (odbiera)?"; questions[11][1] = "a. 240"; questions[11][2] = "b. 120"; questions[11][3] = "c. 30"; questions[11][4] = "d. 24"; questions[11][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 13 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[12][0] = "Dekoder adresów zastosowany w systemie DSM-51 umożliwia pobieranie rozkazów (kodu programu) z pamięci danych. Jest to możliwe dzięki"; questions[12][1] = "a. przekierowaniu sygnałów sterujących odczytem i zapisem danych (RD, WR) do pamięci programu (zamiast RAM) "; questions[12][2] = "b. przekierowaniu sygnału odczytu z pamięci programu (PSEN) do pamięci danych (zamiast ROM)"; questions[12][3] = "c. zastosowaniu zatrzasku (bufora) adresowego umożliwiającego multipleksowanie magistrali"; questions[12][4] = "d. żadne z powyższych"; questions[12][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 14 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[13][0] = "Pod adresem 102H w pamięci programu mikrokontrolera 8051 znajduje się rozkaz SJMP 0FEH. Spod jakiego adresu zostanie pobrany następny rozkaz wykonywany w trakcie działania tego programu?"; questions[13][1] = "a. 100H"; questions[13][2] = "b. 102H"; questions[13][3] = "c. 200H"; questions[13][4] = "d. 202H"; questions[13][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 15 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[14][0] = "Architektura pamięci typu von Neumana charakteryzuje się: "; questions[14][1] = "a. oddzielnymi magistralami dla danych i adresów "; questions[14][2] = "b. wspólną magistralą dla danych i adresów oraz wspólną pamięcią dla danych i programu "; questions[14][3] = "c. rozdzieleniem pamięci danych i pamięci programu "; questions[14][4] = "d. 16-bitowym dostępem do pamięci programu"; questions[14][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 16 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[15][0] = "Mnożenia przez 2^n, 2^n-1 i 2^n+1 można generować w procesorze ARM dzięki użyciu "; questions[15][1] = "a. 32-bitowego sumatora i cyklicznego rejestru przesuwnego "; questions[15][2] = "b. Cyklicznego rejestru przesuwneg"; questions[15][3] = "c. Macierzy mnożników i 32- bitowego sumatora "; questions[15][4] = "d. 32-bitowego sumatora i cyklicznego rejestru przesuwnego lub macierzy mnożników "; questions[15][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 17 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[16][0] = "Cykliczny rejestr przesuwny w procesorze ARM umożliwia: "; questions[16][1] = "a. Mnożenie argumentów nie będących potęgami 2"; questions[16][2] = "b. Mnożenie argumentów będących potęgami 3"; questions[16][3] = "c. Mnożenie dwóch liczb, z których jedna nie jest potęgą 2"; questions[16][4] = "d. Rotację o n bitów w lewo "; questions[16][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 18 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[17][0] = "Cykliczny rejestr przesuwny w procesorze ARM umożliwia: "; questions[17][1] = "a. Dzielenie przez potęgę dwójki "; questions[17][2] = "b. Rotację o n bitów w lewo "; questions[17][3] = "c. Mnożenie argumentów nie będących potęgami 2 "; questions[17][4] = "d. Mnożenie argumentów będących potęgami 3 "; questions[17][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 19 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[18][0] = "Rozkaz ‘MOV 5, R3’ w pamięci programu mikrokontrolera 8051 zostanie zapisany jako: "; questions[18][1] = "a. wyłącznie kod operacji (numer rozkazu) "; questions[18][2] = "b. kod operacji oraz liczba ‘5’ "; questions[18][3] = "c. kod operacji oraz adres rejestru R3 "; questions[18][4] = "d. kod operacji, liczba ‘5’ oraz adres rejestru R3 "; questions[18][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 20 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[19][0] = "W składni instrukcji as ARM [mnemonik operand1, operand2, operand3] operandy 1, 2 i 3 muszą spełniać następujące warunki: "; questions[19][1] = "a. Operand1 i operand2 muszą być rejestrami operand3 może być wartością skalowania "; questions[19][2] = "b. Operand1 musi być rejestrem, operand2 i operand3 mogą być rejestrami"; questions[19][3] = "c. Operand1, operand2, operand3 muszą być rejestrami "; questions[19][4] = "d. Operand1 i operand3 muszą być rejestrami operand2 może być rejestrem"; questions[19][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 21 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[20][0] = "W składni instrukcji as ARM [mnemonik operand1, operand2, operand3] operandy 1, 2 i 3 muszą spełniać następujące warunki: "; questions[20][1] = "a. Operand1, operand2, operand3 muszą być rejestrami "; questions[20][2] = "b. Operand1 musi być rejestrem, operand2 i operand3 mogą być rejestrami"; questions[20][3] = "c. Operand1 i operand2 muszą być rejestrami operand3 może być rejestrem "; questions[20][4] = "d. Operand1 i operand2 mogą być rejestrami operand3 może być wartością skalowania "; questions[20][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 22 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[21][0] = "Który z poniższych rejestrów mikrokontrolera 8051 jest rejestrem 16-bitowym? "; questions[21][1] = "a. Akumulator (ACC)"; questions[21][2] = "b. Akumulator pomocniczy (B) "; questions[21][3] = "c. Wskaźnik stosu (SP) "; questions[21][4] = "d. Licznik rozkazów (PC) "; questions[21][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 23 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[22][0] = "Który z poniższych rejestrów mikrokontrolera 8051 jest rejestrem 16-bitowym? "; questions[22][1] = "a. Akumulator pomocniczy (B) "; questions[22][2] = "b. Akumulator (ACC) "; questions[22][3] = "c. Wskaźnik danych (DPTR) "; questions[22][4] = "d. Rejestr stanu (PSW) "; questions[22][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 24 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[23][0] = "W którym z poniższych rozkazów mikrokontrolera 8051 zastosowano adresowanie natychmiastowe? "; questions[23][1] = "a. RL A"; questions[23][2] = "b. INC @R0"; questions[23][3] = "c. MOV R1, 16H"; questions[23][4] = "d. MOV ACC, #0"; questions[23][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 25 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[24][0] = "Timer T1 mikrokontrolera 8051 pracując w trybie 0 zlicza: "; questions[24][1] = "a. cykle maszynowe"; questions[24][2] = "b. impulsy zegarowe"; questions[24][3] = "c. cykle rozkazowe"; questions[24][4] = "d. żadne z powyższych"; questions[24][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 26 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[25][0] = "Sterownik transmisji szeregowej mikrokontrolera 8051 pracuje w trybie 1 (transmisja asynchroniczna) z prędkością 240 bodów. Ile bajtów danych w ciągu jednej sekundy nadaje (odbiera)? "; questions[25][1] = "a. 240"; questions[25][2] = "b. 120"; questions[25][3] = "c. 12"; questions[25][4] = "d. 24"; questions[25][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 27 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[26][0] = "Mnożenia przez 2^n, 2^n-1 i 2^n+1 można generować w procesorze ARM dzięki użyciu "; questions[26][1] = "a. Macierzy mnożników i 32- bitowego sumatora"; questions[26][2] = "b. Cyklicznego rejestru przesuwnego"; questions[26][3] = "c. 32-bitowego sumatora i cyklicznego rejestru przesuwnego lub macierzy mnożników"; questions[26][4] = "d. Banku rejestrów i jednostki sterującej"; questions[26][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 28 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[27][0] = "Pod adresem 102H w pamięci programu mikrokontrolera 8051 znajduje się rozkaz SJMP 0FEH. Spod jakiego adresu zostanie pobrany następny rozkaz wykonywany w trakcie działania tego programu? "; questions[27][1] = "a. 102H"; questions[27][2] = "b. 100H"; questions[27][3] = "c. 200H"; questions[27][4] = "d. 202H"; questions[27][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 29 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[28][0] = "Dekoder adresów zastosowany w systemie DSM-51 umożliwia pobieranie rozkazów (kodu rogramu) z pamięci danych. Jest to możliwe dzięki"; questions[28][1] = "a. żadna nie jest poprawna"; questions[28][2] = "b. przekierowaniu sygnałów sterujących odczytem i zapisem danych (RD, WR) do pamięci programu (zamiast RAM)"; questions[28][3] = "c. zastosowaniu zatrzasku (bufora) adresowego umożliwiającego multipleksowanie magistrali"; questions[28][4] = "d. b. przekierowaniu sygnału odczytu z pamięci programu (PSEN) do pamięci danych (zamiast ROM)"; questions[28][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 30 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[29][0] = "Instrukcja sub r0, r1, r1, LSL #5 jest wykonywana w procesorze ARM w"; questions[29][1] = "a. W macierzy mnożników i w ALU"; questions[29][2] = "b. W banku rejestrów, w cyklicznym rejestrze przesuwnym i w ALU"; questions[29][3] = "c. ALU"; questions[29][4] = "d. W cyklicznym rejestrze przesuwnym"; questions[29][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 31 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[30][0] = "Przejście na początek pętli do kolejnej iteracji instrukcji wykonywanych przez procesor ARM jest wykonywane bezpośrednio po"; questions[30][1] = "a. Rozgałęzieniu i złączeniu"; questions[30][2] = "b. Rozgałęzieniu bezwarunkowym "; questions[30][3] = "c. Zignorowaniu rozgałęzienia warunkowego"; questions[30][4] = "d. Zignorowaniu rozgałęzienia i złączenia"; questions[30][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 32 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[31][0] = "Dla procesora ARM"; questions[31][1] = "a. Pojedynczy rozkaz procesora wykonuje kilka operacji."; questions[31][2] = "b. Rozkazy wymagają od kilku do kilkunastu cykli zegara."; questions[31][3] = "c. Wykonywanie rozkazów polega na operowaniu wyłącznie na rejestrach."; questions[31][4] = "d. Rozkazy mogą operować bezpośrednio na pamięci."; questions[31][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 33 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[32][0] = "Rozgałęzienie i złączenie (ARM)"; questions[32][1] = "a. Jest powiązane z umieszczeniem adresu powrotu w liczniku programu (rejestrze PC)."; questions[32][2] = "b. Zmianą w rejestrze CPSR."; questions[32][3] = "c. Oznacza zakończenie wykonania programu."; questions[32][4] = "d. Oznacza wyjście z procedury do programu głównego."; questions[32][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 34 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[33][0] = "Każda modyfikacja rejestru PC w banku rejestrów procesora ARM skutkuje wykonanieminstrukcji przesuniętej względem bieżącego adresu PC"; questions[33][1] = "a. o 1 bajt"; questions[33][2] = "b. o 4 bajt"; questions[33][3] = "c. o 2 bajt"; questions[33][4] = "d. o 8 bajt"; questions[33][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 35 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[34][0] = "W których z poniższych rozkazów mikrokontrolera 8051 zastosowano adresowanie bezpośrednie? "; questions[34][1] = "a. RLC A"; questions[34][2] = "b. DEC @R1"; questions[34][3] = "c. CJNE A, 10H, 16H "; questions[34][4] = "d. XRL A, #5"; questions[34][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 36 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[35][0] = "Dekoder adresów zastosowany w systemie DSM-51 umożliwia pobieranie rozkazów (kodu programu) z pamięci danych. Jest to możliwe dzięki: "; questions[35][1] = "a. przekierowaniu sygnałów sterujących odczytem i zapisem danych (RD, WR) do pamięci programu (zamiast RAM) "; questions[35][2] = "b. przekierowaniu sygnału odczytu z pamięci programu (PSEN) do pamięci danych (zamiast ROM)"; questions[35][3] = "c. zastosowaniu zatrzasku (bufora) adresowego umożliwiającego multipleksowanie magistrali "; questions[35][4] = "d. żadne z powyższych"; questions[35][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 37 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[36][0] = "Liczba jednobajtowa 0FFH interpretowana w kodzie uzupełnieniowym do dwóch oznacza "; questions[36][1] = "a. 0"; questions[36][2] = "b. -1"; questions[36][3] = "c. 255"; questions[36][4] = "d. -255"; questions[36][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 38 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[37][0] = "Ile bajtów w pamięci programu mikrokontrolera 8051 zajmuje rozkaz MOV R5, A ?"; questions[37][1] = "a. 1"; questions[37][2] = "b. 2"; questions[37][3] = "c. 3"; questions[37][4] = "d. 4"; questions[37][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 39 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[38][0] = "Rozkaz ‘MOV 5, R3’ w pamięci programu mikrokontrolera 8051 zostanie zapisany jako: "; questions[38][1] = "a. wyłącznie kod operacji (numer rozkazu) "; questions[38][2] = "b. kod operacji oraz liczba ‘5’ "; questions[38][3] = "c. kod operacji oraz adres rejestru R3 "; questions[38][4] = "d. kod operacji, liczba ‘5’ oraz adres rejestru R3 "; questions[38][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 40 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[39][0] = "Licznik rozkazów (PC) mikrokontrolera 8051 zawiera "; questions[39][1] = "a. adres bajtu w pamięci programu kolejnego do pobrania "; questions[39][2] = "b. numer rozkazu (kod operacji) kolejnego do wykonania "; questions[39][3] = "c. ilość rozkazów wykonanych w trakcie działania programu "; questions[39][4] = "d. ilość rozkazów dostępnych dla danego typu mikrokontrolera "; questions[39][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 41 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[40][0] = "Jak należy ustawić starszy (TH) i młodszy (TL) bajt timera T0, aby pracując w trybie 1 zliczył 256 impulsów? "; questions[40][1] = "a. TH = 0, TL = 0 "; questions[40][2] = "b. TH = 0, TL = 256 "; questions[40][3] = "c. TH = 256, TL = 0 "; questions[40][4] = "d. TH = 256, TL = 256 "; questions[40][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 42 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[41][0] = "Rejestr maski przerwań (IE) zawiera "; questions[41][1] = "a. adres procedury obsługi przerwania, którego żądanie pojawiło się jako ostatnie"; questions[41][2] = "b. adres tablicy wektorów przerwań "; questions[41][3] = "c. zestaw bitów ustawiających priorytet przerwań od poszczególnych urządzeń "; questions[41][4] = "d. zestaw bitów włączających zezwolenia na przerwania od poszczególnych urządzeń "; questions[41][5] = "d"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 43 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[42][0] = "Jaki tryb adresowania jest realizowany w architekturze ARM?"; questions[42][1] = "a. natychmiastowe"; questions[42][2] = "b. bezpośrednie"; questions[42][3] = "c. z przesunięciem "; questions[42][4] = "d. rejestrowe pośrednie "; questions[42][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 44 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[43][0] = "Jaką magistralę danych wykorzystano w architekturze ARM?"; questions[43][1] = "a. Wspólna dla danych i adresów"; questions[43][2] = "b. Wspólna dla danych, adresów i sygnałów"; questions[43][3] = "c. Oddzielna dla danych i adresów"; questions[43][4] = "d. Oddzielna dla danych, adresów i sygnałów"; questions[43][5] = "a"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 45 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[44][0] = "Czego nie ma w mikrokontrolerze(lub mikroprocesor raczej o to chodzi), a jest w mikrokomputerze?"; questions[44][1] = "a. Jednostka ALU"; questions[44][2] = "b. Cykliczny rejestr przesuwny"; questions[44][3] = "c. Urządzenia We-Wy"; questions[44][4] = "d. Operator przerwań"; questions[44][5] = "c"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 46 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[45][0] = "Co umożliwia realizacja polecenia BX [rejestr] w ARM?"; questions[45][1] = "a. Przejście do procedury"; questions[45][2] = "b. Powrót z podprogramu"; questions[45][3] = "c. Zmianę adresu powrotu"; questions[45][4] = "d. Zmianę stanu stosu (coś takiego)"; questions[45][5] = "b"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////QUESTION 47 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// questions[46][0] = "Jaki rozkaz w 8051 umożliwi zapisanie dwóch najmłodszych bitów akumulatora?"; questions[46][1] = "a. Iloczyn logiczny: ANL A, #11111100B"; questions[46][2] = "b. Iloczyn logiczny: ANL A, #00000011B"; questions[46][3] = "c. Suma logiczna: ORL A, #11111100B"; questions[46][4] = "d. Suma logiczna: ORL A, #00000011B"; questions[46][5] = "c"; } }
[ "kaspychala95@gmail.com" ]
kaspychala95@gmail.com
23f41ab75368fded511e97956cbe9017daa48be4
62d47cb9846f48a24a808f240706365fbefa73d7
/src/com/saabgroup/yatta/evaluator/special_forms/LetSpecialForm.java
8b3ed83f2f1229ccdab610e190e71617519a8689
[]
no_license
TommyPersson/Yatta
cb8581bb0673eca47ac081b09e1a955c4f59f916
78b0803ccc15dbf7ce07338203801de20a9c69ff
refs/heads/master
2020-05-18T11:22:23.380868
2013-09-03T14:52:31
2013-09-03T14:52:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,092
java
package com.saabgroup.yatta.evaluator.special_forms; import com.saabgroup.yatta.Symbol; import com.saabgroup.yatta.evaluator.Evaluator; import com.saabgroup.yatta.evaluator.IEnvironment; import java.util.ArrayList; import java.util.List; public class LetSpecialForm implements ISpecialForm { private final Evaluator evaluator; public LetSpecialForm(Evaluator evaluator) { this.evaluator = evaluator; } public Object apply(List args, IEnvironment env) throws Exception { // (let (sym1 val1 // sym2 val2) // body) List bindingList = (List)args.get(0); ArrayList body = new ArrayList(args); body.remove(0); for (int i = 0; i < bindingList.size(); i = i + 2) { String symbolName = ((Symbol)bindingList.get(i)).getName(); Object symbolValue = evaluator.evaluate(bindingList.get(i+1), env); env = env.createChildEnvironment(symbolName, symbolValue); } return new DoSpecialForm(evaluator).apply(body, env); } }
[ "tommy.m.persson@saabgroup.com" ]
tommy.m.persson@saabgroup.com
071bba2e255de98bc621a861548f125c58ce5c04
d38a6e2e08a3e27520c64d254a12966813abe991
/src/GasStationSimulator.java
9f249b39b84d8883f89864f6975037fcbd641552
[]
no_license
adeelpervaiz/GasStationTest
c694fe8be9d54b7713d84f490cf17180b65016e6
1d515e99b01039cde10db1a1cd8f23c217812cb5
refs/heads/master
2022-01-25T19:26:00.083685
2016-08-13T12:54:38
2016-08-13T12:54:38
65,612,657
0
0
null
null
null
null
UTF-8
Java
false
false
5,952
java
import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import main.java.net.bigpoint.assessment.gasstation.GasPump; import main.java.net.bigpoint.assessment.gasstation.GasStation ; import main.java.net.bigpoint.assessment.gasstation.GasType; import main.java.net.bigpoint.assessment.gasstation.exceptions.GasTooExpensiveException; import main.java.net.bigpoint.assessment.gasstation.exceptions.NotEnoughGasException; import main.java.net.bigpoint.assessment.gasstation.exceptions.PumpNotExistException; public class GasStationSimulator implements GasStation { private HashMap<GasType, Double> prices ; Collection<GasPump> pumps ; private double totalRevenue ; private int canellationsOfGasNotAvailable ; private int canellationsOfGasExpensive ; private int canellationsOfPumpNotAvailable ; private int numberOfSales ; GasStationSimulator(){ prices = new HashMap<GasType, Double>(); pumps = new ArrayList<GasPump>(); totalRevenue = 0 ; } /** * @param type * The type of gas the customer wants to buy * @param amountInLiters * The amount of gas the customer wants to buy. Nothing less than this amount is acceptable! * @param maxPricePerLiter * The maximum price the customer is willing to pay per liter */ public void startQueue(GasType type, double amountInLiters, double maxPricePerLiter){ try { this.buyGas(type, amountInLiters, maxPricePerLiter); } catch (NotEnoughGasException e) { System.out.println("Excp : " + e.getLocalizedMessage() + "\n\n"); } catch (GasTooExpensiveException e) { System.out.println("Excp : " + e.getLocalizedMessage() + "\n\n"); } } @Override public String getGasType(GasType type){ if(type == GasType.DIESEL){ return "Diesel" ; } else if(type == GasType.REGULAR){ return "Regular" ; } else if(type == GasType.SUPER){ return "Super" ; } return "Unknown" ; } @Override public void addGasPump(GasPump pump) { for(GasPump addedPump : pumps){ if(addedPump.getGasType().equals(pump.getGasType())){ } } pumps.add(pump); } @Override public Collection<GasPump> getGasPumps() { return pumps; } @Override public double buyGas(GasType type, double amountInLiters, double maxPricePerLiter) throws NotEnoughGasException, GasTooExpensiveException { boolean pumpExist = false ; for(GasPump pump : pumps){ if(pump.getGasType().equals(type)){ pumpExist = true ; System.out.println("Sell Gas Type : " + this.getGasType(type)+ " @ "+getPrice(type)+"/Litre"); System.out.println("Remaing Gas In Amount : " + pump.getRemainingAmount()); System.out.println("Purchasing Gas In Amount : " + amountInLiters); if(maxPricePerLiter < getPrice(type)){ System.out.println("### CANNOT SELL GAS @ "+ maxPricePerLiter +"/Litre : TOO EXPENSIVE ####"); this.setCanellationsOfGasExpensive(this.getCanellationsOfGasExpensive() + 1) ; throw new GasTooExpensiveException("Gas is Expensive"); } else if(pump.getRemainingAmount() < amountInLiters){ System.out.println("### CANNOT SELL : NOT ENOUGH GAS ####"); this.setCanellationsOfGasNotAvailable(this.getCanellationsOfGasNotAvailable() + 1) ; throw new NotEnoughGasException("Gas Not Available"); } else { pump.pumpGas(amountInLiters); this.totalRevenue += amountInLiters ; setNumberOfSales(this.getNumberOfSales() + 1); break ; } } } if(pumpExist==false){ System.out.println("### CANNOT SELL : PUMP NOT EXIST ####"); this.setCanellationsOfPumpNotAvailable(this.getCanellationsOfPumpNotAvailable() + 1) ; try { throw new PumpNotExistException("We don't sell this type of Gas"); } catch (PumpNotExistException e) { System.out.println("Excp : " + e.getLocalizedMessage() + "\n\n"); } } return 0; } @Override public double getRevenue() { return totalRevenue ; } @Override public double getAvailableGas(GasType type){ for(GasPump pump : pumps){ if(pump.getGasType().equals(type)) { return pump.getRemainingAmount() ; } } return 0 ; } @Override public int getNumberOfCancellationsNoGas() { return this.getCanellationsOfGasNotAvailable(); } @Override public int getNumberOfCancellationsTooExpensive() { return this.getCanellationsOfGasExpensive() ; } @Override public double getPrice(GasType type) { return prices.get(type); } @Override public void setPrice(GasType type, double price) { prices.put(type, price); } /** * Get Gas Short Cancellations Count */ public int getCanellationsOfGasNotAvailable() { return canellationsOfGasNotAvailable; } /** * Set Gas Short Cancellations Count * @param canellationsOfGasNotAvailable */ public void setCanellationsOfGasNotAvailable(int canellationsOfGasNotAvailable) { this.canellationsOfGasNotAvailable = canellationsOfGasNotAvailable; } /** * Get Gas Expensive Cancellations Count */ public int getCanellationsOfGasExpensive() { return canellationsOfGasExpensive; } /** * Set Gas Expensive Cancellations Count * @param canellationsOfGasExpensive */ public void setCanellationsOfGasExpensive(int canellationsOfGasExpensive) { this.canellationsOfGasExpensive = canellationsOfGasExpensive; } /** * Get Pump Not available Cancel Count */ public int getCanellationsOfPumpNotAvailable() { return canellationsOfPumpNotAvailable; } /** * Set Pump not available Count * @param canellationsOfPumpNotAvailable */ public void setCanellationsOfPumpNotAvailable(int canellationsOfPumpNotAvailable) { this.canellationsOfPumpNotAvailable = canellationsOfPumpNotAvailable; } @Override public int getNumberOfSales() { return this.numberOfSales; } public void setNumberOfSales(int numberOfSales) { System.out.println("**** GAS SOLD **** \n"); this.numberOfSales = numberOfSales; } }
[ "adeel.pervaiz@amerald.com" ]
adeel.pervaiz@amerald.com
de08d8218d9c2c604ee2caf72bf5c7410382cd44
06224d283517e3cee7ac468310b7723282083466
/Java_8_Lambdas_Streams/src/com/epam/Java_8_Lambdas_Streams/ReferenceToStaticMethod.java
bf69fc5d64298eebc39c180309293c779af80127
[]
no_license
vamsipuppala/Vamsi-Lambadas-And-Streams
9e981cd9c0ef3139f20b7c44647d869c286e6b6f
8810574f14dd3749b572f690dff046a7a90eeac9
refs/heads/master
2022-11-23T12:46:24.000983
2020-07-26T17:16:41
2020-07-26T17:16:41
282,697,219
0
0
null
null
null
null
UTF-8
Java
false
false
1,189
java
package com.epam.Java_8_Lambdas_Streams; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Predicate; public class ReferenceToStaticMethod { public static void main(String[] args) { List<String> a = Arrays.asList("121","1221","12344321","hiih","dad","avdc","abcdef"); List<String> palindromes = ReferenceToStaticMethod.findPal(a, (str) -> ReferenceToStaticMethod.isPal((String) str)); System.out.println("Palindromes are " + palindromes); } public static boolean isPal(String str) { StringBuffer newStr =new StringBuffer(); for(int i = str.length()-1; i >= 0 ; i--) { newStr = newStr.append(str.charAt(i)); } if(str.equalsIgnoreCase(newStr.toString())) { return true; } else { return false; } } public static List<String> findPal(List<String> list, Predicate<String> predicate) { List<String> sortedpal = new ArrayList<String>(); list .stream() .filter((i) -> (predicate.test((String) i))).forEach((i) -> { sortedpal.add((String) i); }); return sortedpal; } }
[ "vamsipuppala4599@gmail.com" ]
vamsipuppala4599@gmail.com
66fd4a02f70bc1eaeb898b2bac5b678d35c70d1c
f5766e8702e4c4415a8eb7c0ce9aabbc0ea31c4a
/src/main/java/com/wigen/insert/InsertionSort.java
748ba785e21e0d7962a95415b09df8b5090cbe2f
[]
no_license
wigennn/sort
592f82bab0ffc59fc116149ce4f569c390400993
f734cf2a4df617f2a73283e05126c70524a839c7
refs/heads/master
2021-01-13T21:38:00.536061
2020-02-26T04:57:43
2020-02-26T04:57:43
242,503,076
0
0
null
2020-10-13T19:46:40
2020-02-23T11:16:56
Java
UTF-8
Java
false
false
701
java
package com.wigen.insert; /** * 后一个与前面排好的数组比 */ public class InsertionSort { public static void insert(int[] arr, int n) { int key = arr[n]; int i = n; while (arr[i -1] > key) { arr[i] = arr[i - 1]; i--; if (i == 0) break; } arr[i] = key; } public static void insertSort(int[] arr, int n) { for (int i = 1; i < n; i++) { insert(arr, i); } } public static void main(String[] args) { int[] arr = {9,3,1,2,8,4,6,5}; insertSort(arr, 8); for (int i = 0; i < 8; i++) { System.out.println(arr[i]); } } }
[ "zett96@163.com" ]
zett96@163.com
88ee3b7976fb254329562b09f8ca892403d6e35b
62fc15190abb551c60f80808dbc8848ddc8238c7
/src/other/Students.java
f2ac65dd65c81cdf477ead30f64454f49ca05717
[]
no_license
Garrett-Thomas/L3_Module_5
906dae4d9490b6c2e811d206d737788bac968741
5321beb8ddd7dbe8c7233cc7f68dad5d4f5f77ea
refs/heads/master
2021-09-07T12:46:34.379067
2018-02-23T04:00:05
2018-02-23T04:00:05
111,050,741
0
0
null
2017-11-17T03:04:43
2017-11-17T03:04:42
null
UTF-8
Java
false
false
803
java
package other; import java.util.ArrayList; public class Students { private String eyeColor; private String name; static ArrayList<Students> pupils = new ArrayList<Students>(); public static void main(String[] args) { pupils.add(new Students("hazel", "Fritz")); pupils.add(new Students("brown", "Aidan")); pupils.add(new Students("brown", "Garrett")); } public Students(String eyeColor, String name) { this.eyeColor = eyeColor; this.name = name; } public String getPopularColor() { int c = 0; for (int i = 0; i < pupils.size(); i++) { if(pupils.get(i).eyeColor == "hazel") { c++; } if(pupils.get(i).eyeColor == "brown") { c--; } } if(c < 0) { System.out.println(1); return "Hazel"; } else { System.out.println(2); return "Brown"; } } }
[ "league@WTS7.attlocal.net" ]
league@WTS7.attlocal.net
fb3a030bfc9e81bb612b683e8763f058f1390fe3
65a40fc0180362c80e126334e16884b8a7b5da1b
/src/main/java/controller/ClubController.java
7886a1265f3cf69725322110b3ce32b8a9e61616
[]
no_license
thaonoucamp/M4-management-football-club
2711924435a96f2cdb5419df9c9964f0ccb534f4
3c7148e5c1c72d3e44ca550ccd4007cfa085f4a9
refs/heads/dev
2023-06-30T13:41:10.753217
2021-07-28T07:43:49
2021-07-28T07:43:49
389,311,443
0
0
null
2021-07-27T09:45:45
2021-07-25T09:40:48
HTML
UTF-8
Java
false
false
2,493
java
package controller; import model.Club; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import service.club.IClubService; @Controller public class ClubController { @Autowired private IClubService clubService; @GetMapping("/create") public ModelAndView showFormCreate(){ ModelAndView modelAndView = new ModelAndView("/club/create"); return modelAndView; } @PostMapping("/create") public ModelAndView create(Club club){ clubService.save(club); ModelAndView modelAndView = new ModelAndView("/club/home"); return modelAndView; } @PostMapping("/save") public String save(Club club) { clubService.save(club); return "redirect:/club/home"; } @GetMapping("/{id}/edit") public String edit(@PathVariable Long id, Model model) { model.addAttribute("club", clubService.findById(id)); return "/club/edit"; } @PostMapping("/update") public String update(Club club) { clubService.save(club); return "redirect:/club/home"; } @GetMapping("/{id}/delete") public String delete(@PathVariable Long id, Model model) { model.addAttribute("club", clubService.findById(id)); return "/club/delete"; } @PostMapping("/delete") public String delete(Club club, RedirectAttributes redirect) { clubService.delete(club.getId()); redirect.addFlashAttribute("success", "Removed club successfully!"); return "redirect:/club/home"; } @GetMapping("/{id}/view") public String view(@PathVariable Long id, Model model) { model.addAttribute("club", clubService.findById(id)); return "/club/view"; } @GetMapping("/search") public String findByName(@RequestParam String name, Model model){ model.addAttribute("club", clubService.findByName(name)); return "/club/home"; } }
[ "duccanhh94@gmail.com" ]
duccanhh94@gmail.com
ee2a748eb910f1a27f1e91167d1ca09be76d4bc5
a74bcf1c0f9e047afd46d4a7b9ad264e27946081
/Java/Android/OpenGLES/source/core/src/loon/core/LObject.java
5d39caf6bdce3092f89fda9ef5f5f2e1a02ed2af
[ "Apache-2.0" ]
permissive
windows10207/LGame
7a260b64dcdac5e1bbde415e5f801691d3bfb9fd
4599507d737a79b27d8f685f7aa542fd9f936cf7
refs/heads/master
2021-01-12T20:15:38.080295
2014-09-22T17:12:08
2014-09-22T17:12:08
24,441,072
1
0
null
null
null
null
UTF-8
Java
false
false
5,876
java
package loon.core; import loon.action.map.Config; import loon.core.geom.RectBox; import loon.core.geom.Vector2f; import loon.utils.MathUtils; /** * Copyright 2008 - 2011 * * 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. * * @project loon * @author cping * @email:javachenpeng@yahoo.com * @version 0.1 */ public abstract class LObject { public Object Tag; public float alpha = 1f; protected RectBox rect; protected String name; protected Vector2f location = new Vector2f(0, 0); protected int layer; protected float rotation; public void setTransparency(int alpha) { setAlpha(alpha / 255f); } public int getTransparency() { return (int) (alpha * 255); } public void setAlpha(float a) { this.alpha = a; } public float getAlpha() { return this.alpha; } public void setRotation(float r) { this.rotation = r; if (rect != null) { rect = MathUtils.getBounds(location.x, location.y, getWidth(), getHeight(), r, rect); } } public float getRotation() { return rotation; } public abstract void update(long elapsedTime); public void centerOnScreen() { LObject.centerOn(this, LSystem.screenRect.width, LSystem.screenRect.height); } public void bottomOnScreen() { LObject.bottomOn(this, LSystem.screenRect.width, LSystem.screenRect.height); } public void leftOnScreen() { LObject.leftOn(this, LSystem.screenRect.width, LSystem.screenRect.height); } public void rightOnScreen() { LObject.rightOn(this, LSystem.screenRect.width, LSystem.screenRect.height); } public void topOnScreen() { LObject.topOn(this, LSystem.screenRect.width, LSystem.screenRect.height); } public RectBox getCollisionArea() { return getRect(getX(), getY(), getWidth(), getHeight()); } protected RectBox getRect(float x, float y, float w, float h) { if (rect == null) { rect = new RectBox(x, y, w, h); } else { rect.setBounds(x, y, w, h); } return rect; } public void setName(String name) { this.name = name; } public String getName() { return name; } public int getLayer() { return layer; } public void setLayer(int layer) { this.layer = layer; } public void move_45D_up() { move_45D_up(1); } public void move_45D_up(int multiples) { location.move_multiples(Config.UP, multiples); } public void move_45D_left() { move_45D_left(1); } public void move_45D_left(int multiples) { location.move_multiples(Config.LEFT, multiples); } public void move_45D_right() { move_45D_right(1); } public void move_45D_right(int multiples) { location.move_multiples(Config.RIGHT, multiples); } public void move_45D_down() { move_45D_down(1); } public void move_45D_down(int multiples) { location.move_multiples(Config.DOWN, multiples); } public void move_up() { move_up(1); } public void move_up(int multiples) { location.move_multiples(Config.TUP, multiples); } public void move_left() { move_left(1); } public void move_left(int multiples) { location.move_multiples(Config.TLEFT, multiples); } public void move_right() { move_right(1); } public void move_right(int multiples) { location.move_multiples(Config.TRIGHT, multiples); } public void move_down() { move_down(1); } public void move_down(int multiples) { location.move_multiples(Config.TDOWN, multiples); } public void move(Vector2f vector2D) { location.move(vector2D); } public void move(float x, float y) { location.move(x, y); } public void setLocation(float x, float y) { location.setLocation(x, y); } public int x() { return (int) location.getX(); } public int y() { return (int) location.getY(); } public float getX() { return location.getX(); } public float getY() { return location.getY(); } public void setX(Integer x) { location.setX(x.intValue()); } public void setX(float x) { location.setX(x); } public void setY(Integer y) { location.setY(y.intValue()); } public void setY(float y) { location.setY(y); } public Vector2f getLocation() { return location; } public void setLocation(Vector2f location) { this.location = location; } public static void centerOn(final LObject object, int w, int h) { object.setLocation(w / 2 - object.getWidth() / 2, h / 2 - object.getHeight() / 2); } public static void topOn(final LObject object, int w, int h) { object.setLocation(w / 2 - h / 2, 0); } public static void leftOn(final LObject object, int w, int h) { object.setLocation(0, h / 2 - object.getHeight() / 2); } public static void rightOn(final LObject object, int w, int h) { object.setLocation(w - object.getWidth(), h / 2 - object.getHeight() / 2); } public static void bottomOn(final LObject object, int w, int h) { object.setLocation(w / 2 - object.getWidth() / 2, h - object.getHeight()); } public void centerOn(final LObject object) { centerOn(object, getWidth(), getHeight()); } public void topOn(final LObject object) { topOn(object, getWidth(), getHeight()); } public void leftOn(final LObject object) { leftOn(object, getWidth(), getHeight()); } public void rightOn(final LObject object) { rightOn(object, getWidth(), getHeight()); } public void bottomOn(final LObject object) { bottomOn(object, getWidth(), getHeight()); } public abstract int getWidth(); public abstract int getHeight(); }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
d32ad81052cb724e7e0b4697f310b3d977dc5f2d
704f35deae55d2ca4b1199822438f86d767c772c
/src/Day_50_inheritence/Ebook.java
19ae378b20e5b0f815b369ce5798d8c86f1bb77c
[]
no_license
raminrocker75/Java-programming
8b7e4a4b12d5cc0e74963d0382e46b6ac03c7baa
f23be32a8a2a8a11b747c20c78a68273d3ea9f8a
refs/heads/master
2023-06-25T20:51:00.406073
2021-07-27T00:06:12
2021-07-27T00:06:12
369,878,351
0
0
null
2021-07-27T00:06:13
2021-05-22T18:19:42
Java
UTF-8
Java
false
false
367
java
package Day_50_inheritence; public class Ebook extends Book { double size; int pages; public void readBook(){ System.out.println("Reading book: "); System.out.println("Title :" + title); System.out.println("Author :" + author); System.out.println("Size : " + size); System.out.println("Pages :" + pages); } }
[ "raminrocker75@gmail.com" ]
raminrocker75@gmail.com
5275e508fcf08c083cb8fe991af91856c01b23f1
9982f08b1fb5630d580a2fc84cb6d49cfbe01939
/cloud-gateway-gateway9527/src/main/java/com/panhu/springcloud/filter/MyLogGatewayFilter.java
f1d34e80bfafc1560f3ee7f6e01fd395f5cf90d5
[]
no_license
huzhiqin888/springcloudstudy
fac4f5eebf848b2a818dc67a08c9174a3e1d5d1e
ea2e58cc7dfa7a3226df1011fa977fa9f701d601
refs/heads/master
2023-02-13T13:02:03.089630
2021-01-14T06:50:40
2021-01-14T06:50:40
328,915,056
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
package com.panhu.springcloud.filter; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.gateway.filter.GatewayFilterChain; import org.springframework.cloud.gateway.filter.GlobalFilter; import org.springframework.core.Ordered; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Mono; import java.util.Date; @Component @Slf4j public class MyLogGatewayFilter implements GlobalFilter, Ordered { @Override public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { log.info("*************come in MyLogGatewayFilter"+new Date()); String uname=exchange.getRequest().getQueryParams().getFirst("uname"); if (uname==null){ log.info("*********用户名为空,非法用户"); exchange.getResponse().setStatusCode(HttpStatus.NOT_ACCEPTABLE); return exchange.getResponse().setComplete(); } return chain.filter(exchange); } @Override public int getOrder() { return 0; } }
[ "1497767287@qq.com" ]
1497767287@qq.com
f1270db9648ba1b53e93bb20b645e93a93bceb3b
e172dbf0b6ec029aabd3bed05f6776bff508308e
/src/main/java/com/laidongs/sba/gateway/config/AsyncConfiguration.java
1c109d5ae4ed8176054c142465a8f9b294282c55
[]
no_license
woyaowoyao/openshift-myGate01
da6d79531ba4892c10b70a35b79569f203f178f2
f87f84a2aa3b279437c6dac313894a5b34f285b1
refs/heads/master
2022-12-24T22:34:01.280486
2020-02-05T04:21:36
2020-02-05T04:21:36
238,365,127
0
0
null
2022-12-16T04:41:16
2020-02-05T04:08:18
Java
UTF-8
Java
false
false
2,008
java
package com.laidongs.sba.gateway.config; import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; import org.springframework.boot.autoconfigure.task.TaskExecutionProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.concurrent.Executor; @Configuration @EnableAsync @EnableScheduling public class AsyncConfiguration implements AsyncConfigurer { private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); private final TaskExecutionProperties taskExecutionProperties; public AsyncConfiguration(TaskExecutionProperties taskExecutionProperties) { this.taskExecutionProperties = taskExecutionProperties; } @Override @Bean(name = "taskExecutor") public Executor getAsyncExecutor() { log.debug("Creating Async Task Executor"); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(taskExecutionProperties.getPool().getCoreSize()); executor.setMaxPoolSize(taskExecutionProperties.getPool().getMaxSize()); executor.setQueueCapacity(taskExecutionProperties.getPool().getQueueCapacity()); executor.setThreadNamePrefix(taskExecutionProperties.getThreadNamePrefix()); return new ExceptionHandlingAsyncTaskExecutor(executor); } @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return new SimpleAsyncUncaughtExceptionHandler(); } }
[ "laidongs@cn.ibm.com" ]
laidongs@cn.ibm.com
ac0ead17b76e60b2185b7c32c1389f95bcb597c5
409550c719b0c0d6314962816ed2326c764040bd
/src/main/java/org/tiernolan/nervous/network/connection/ChannelHandler.java
456c7e4b7aa18dbe87440ebcbb225ccdf47e6ef4
[]
no_license
TierNolan/NervousNetwork
7aa96276d2474f931db581e04b7c921efb3a3818
4b8cecc0471499e823fc222e99202a4e00bb650b
refs/heads/master
2016-09-06T01:01:57.437081
2013-07-06T21:57:11
2013-07-06T21:57:11
9,584,247
0
1
null
null
null
null
UTF-8
Java
false
false
5,323
java
package org.tiernolan.nervous.network.connection; import java.io.IOException; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; import java.util.TimerTask; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import org.tiernolan.nervous.network.api.NetworkManager; import org.tiernolan.nervous.network.api.connection.Connection; import org.tiernolan.nervous.network.queue.PacketWrapper; import org.tiernolan.nervous.network.queue.StripedQueue; public class ChannelHandler<C extends Connection<C>> implements ChannelControl { private final static AtomicInteger hashCount = new AtomicInteger(0); @SuppressWarnings("unused") private final NetworkManager<C> manager; private final Serdes<C> serdes; private final SelectorHandler<C> selectorHandler; private final SocketChannel channel; private final int hash; private final SelectionKey key; private final AtomicBoolean writePending = new AtomicBoolean(false); private final AtomicBoolean closePending = new AtomicBoolean(false); private final AtomicBoolean syncPending = new AtomicBoolean(false); private final AtomicReference<HandlerState> inProgress = new AtomicReference<HandlerState>(HandlerState.IDLE); private boolean write = false; private final Runnable readRunnable; private final Runnable writeRunnable; public ChannelHandler(final NetworkManager<C> manager, final SocketChannel channel, final SelectorHandler<C> selectorHandler, StripedQueue<PacketWrapper<C>> queue) throws IOException { readRunnable = new Runnable() { public void run() { try { serdes.read(channel); } catch (IOException e) { close(); } catch (Throwable t) { manager.getLogger().info("Channel read threw " + t); close(); } finally { if (!inProgress.compareAndSet(HandlerState.RUNNING, HandlerState.IDLE)) { throw new IllegalStateException("Channel Handler was not in RUNNING state"); } restoreOps(); } } }; writeRunnable = new Runnable() { public void run() { try { serdes.write(channel); } catch (IOException e) { close(); } catch (Throwable t) { manager.getLogger().info("Channel write threw " + t); close(); } finally { if (!inProgress.compareAndSet(HandlerState.RUNNING, HandlerState.IDLE)) { throw new IllegalStateException("Channel Handler was not in RUNNING state"); } restoreOps(); } } }; this.serdes = new SerdesImpl<C>(manager, this, queue); this.hash = hashCount.incrementAndGet(); this.manager = manager; this.channel = channel; this.selectorHandler = selectorHandler; try { channel.configureBlocking(false); this.key = selectorHandler.register(channel, this); if (key == null) { throw new IOException("SelectorHandler is not running"); } } catch (IOException e) { close(); throw e; } } public void clearWriteRequest() { write = false; } public void setWriteRequest() { if (writePending.compareAndSet(false, true)) { if (inProgress.compareAndSet(HandlerState.IDLE, HandlerState.WRITE_PENDING)) { queueForSync(); } } } public void shutdown(long timeout) { serdes.shutdown(); if (timeout > 0) { selectorHandler.getTimer().schedule(new TimerTask() { @Override public void run() { asyncClose(); } }, timeout); } } public void asyncClose() { if (closePending.compareAndSet(false, true)) { queueForSync(); } } public void close() { try { if (key != null) { key.cancel(); } try { channel.close(); } catch (IOException e) { } } finally { selectorHandler.notifyClosed(this); } } public void queueForSync() { if (syncPending.compareAndSet(false, true)) { selectorHandler.queueForSync(this); } } public void sync() { if (!syncPending.compareAndSet(true, false)) { throw new IllegalStateException("Sync flag was false when syncing"); } if (inProgress.compareAndSet(HandlerState.WRITE_PENDING, HandlerState.IDLE)) { restoreOps(); } if (closePending.get()) { close(); } } private void restoreOps() { if (writePending.compareAndSet(true, false)) { write = true; } if (write) { selectorHandler.setReadWrite(key); } else { selectorHandler.setReadOnly(key); } } public Runnable getReadRunnable() { setInProgress(); return readRunnable; } public Runnable getWriteRunnable() { setInProgress(); return writeRunnable; } private void setInProgress() { if (!inProgress.compareAndSet(HandlerState.IDLE, HandlerState.RUNNING) && !inProgress.compareAndSet(HandlerState.WRITE_PENDING, HandlerState.RUNNING)) { throw new IllegalStateException("Channel Handler was not in IDLE or WRITE_PENDING state"); } key.interestOps(0); } protected Serdes<C> getSerdes() { return serdes; } @Override public boolean equals(Object o) { return o == this; } @Override public int hashCode() { return hash; } private static enum HandlerState { IDLE, WRITE_PENDING, RUNNING; } }
[ "tiernolan" ]
tiernolan
a9c7ebfc69d662191912e2ed866d5ec7da14c81c
65d35a695caf9a8c09b427cd19c236d278c21199
/spendash-api/src/main/java/com/api/spendash/model/User.java
e8759054036a09be9dd842087ebbf2e7605060d2
[]
no_license
Jayamith/Procurement-Management-System
115d460b48f0773fe8a3938a77aff436ef2d7fa7
7f2608dbac567d491cb244fd96a710d7590a5a9b
refs/heads/main
2023-08-14T00:03:08.471665
2021-10-15T19:39:11
2021-10-15T19:39:11
417,160,355
0
0
null
2021-10-15T11:06:17
2021-10-14T14:22:48
JavaScript
UTF-8
Java
false
false
378
java
package com.api.spendash.model; import lombok.*; import javax.persistence.Entity; import javax.persistence.Id; @AllArgsConstructor @NoArgsConstructor @Setter @Getter @ToString @Entity public class User { @Id private String userName; private String name; private String address; private int contact; private String role; private String password; }
[ "jayamith@leapstitch.com" ]
jayamith@leapstitch.com
e69d0141d601e56bdda3026eb17f8eee0bc433d4
32c20ff5d5522759aa9fcea6a302119f47e20e3f
/Final Check/FinalCheck_1 - AbstractPattern/src/FurnitureProduct.java
e53c85cbdba0e7e88bc9be6b8d776573352ac4d0
[]
no_license
RevathiCogni/DesignPrinciples
cb30d60087e580a8d1995ee93f48634b34376598
6d66113d10180dd92b1d9358f099bff822d64f12
refs/heads/master
2023-03-28T15:07:36.317999
2021-03-22T15:41:16
2021-03-22T15:41:16
350,397,915
0
0
null
null
null
null
UTF-8
Java
false
false
332
java
public class FurnitureProduct extends Order{ public FurnitureProduct(Channel channel) { // TODO Auto-generated constructor stub super(channel, ProductType.FURNITURE); processOrder(); } @Override void processOrder() { // TODO Auto-generated method stub System.out.println("Processing furniture product order"); } }
[ "895218@cognizant.com" ]
895218@cognizant.com
8df3a95a25d3cc7734c6dd34852afb0ce91c0355
2e9ce48043464fc77007f3c6215d19615cb9337c
/Advanced/myfirstpager/src/com/example/myfirstpager/SimpleFragment.java
863cd7cff2a71e3cc07d2a5f66647d85ca7204dc
[]
no_license
terenzio/Android
d2007ee368a01e2badb17347a7c8bc64ace8e945
21972a2f94f67a19547578840cc7d8e2eecab39d
refs/heads/master
2021-01-10T20:49:15.697572
2013-10-01T06:48:17
2013-10-01T06:48:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package com.example.myfirstpager; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class SimpleFragment extends Fragment { public Fragment newInstance(String content){ SimpleFragment fragment = new SimpleFragment(); fragment.setContent(content); } public void setContent(Sting content) { this.content = content } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub return super.onCreateView(inflater, container, savedInstanceState); } }
[ "terenzio@gmail.com" ]
terenzio@gmail.com
e33647d80461c256c83f9851f2a5f9c575e17c90
f37a623836fa278e64c5d91027d4bbf5aa02b35f
/HelloWorld/src/com/example/helloWorld/InterviewQuestions/DP/DiceThrow.java
75e77a9fa502b755f2ec71ca5cf923d04baec884
[]
no_license
BoredCoder123/CodingPractice
ee6436bb3c43524f304d60f7f4c308329435d9b3
ff358009ceb3d3c8f42378aa6a30c44ea41b5ac3
refs/heads/main
2023-06-16T16:56:15.470938
2021-07-13T09:36:47
2021-07-13T09:36:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,164
java
package com.example.helloWorld.InterviewQuestions.DP; public class DiceThrow { public static void main(String[] args) { System.out.println(diceThrow(4,2,1)); System.out.println(diceThrow(2,2,3)); System.out.println(diceThrow(6,3,8)); System.out.println(diceThrow(4,2,5)); System.out.println(diceThrow(4,3,5)); } private static int diceThrow(int m, int n, int x) { if(n*m<x) return -1; else if(n>x) return -1; int[][] dp = new int[n+1][x+1]; int i, j, k; for(i=0;i<=n;i++) { for (j = 0; j <= x; j++) { dp[i][j]=0; } } for(j = 1; j <= m && j <= x; j++) dp[1][j] = 1; for (i = 2; i <= n; i++) { for (j = 1; j <= x; j++) { for (k = 1; k <= m && k < j; k++) { dp[i][j] += dp[i - 1][j - k]; } } } // for(i=0;i<=n;i++){ // for(j=0;j<=x;j++) // System.out.print(dp[i][j]+" "); // System.out.println(" "); // } return dp[n][x]; } }
[ "ankitkathait28@gmail.com" ]
ankitkathait28@gmail.com
56222421c2b025a89763eff13d06faa9b8e69d34
8b71a4281911aae310f5fd691d1a163e4f3dcdbd
/hedera-mirror-test/src/test/java/com/hedera/mirror/test/e2e/acceptance/props/MirrorTokenTransfer.java
1504616fdef6d839f6985f7b1abdac87dd6db625
[ "Apache-2.0" ]
permissive
rustyShacklefurd/hedera-mirror-node
52999d483deff19639b07427132dc255447b4083
31e882df7fba97179a0f131ae3e0f3c8bd4afa63
refs/heads/main
2023-07-17T00:10:57.689235
2021-08-19T16:44:27
2021-08-19T16:44:27
385,747,243
0
0
Apache-2.0
2021-07-13T22:09:54
2021-07-13T22:09:53
null
UTF-8
Java
false
false
835
java
package com.hedera.mirror.test.e2e.acceptance.props; /*- * ‌ * Hedera Mirror Node * ​ * Copyright (C) 2019 - 2021 Hedera Hashgraph, LLC * ​ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ‍ */ import lombok.Data; @Data public class MirrorTokenTransfer extends MirrorTransfer { private String tokenId; }
[ "noreply@github.com" ]
noreply@github.com
956f6b0e05370fda2c1b4263d843ca355f8731c0
2162c39506413b2b5dc0f0a5d328b57f04aed23c
/app/src/main/java/com/shubham/samplevideoconference/User_Model.java
649572b7f9de882d768c2d3d1e0cdd7b36a952bd
[]
no_license
shubhamgarg2677/Sample_video_conference
9fbd532708504fc0fa4e882047dc2535a27852a4
a6e26e21112c4cc867ce1346a52a30688315c3d8
refs/heads/master
2022-04-23T01:16:03.416900
2020-04-24T12:48:48
2020-04-24T12:48:48
258,510,714
0
1
null
null
null
null
UTF-8
Java
false
false
617
java
package com.shubham.samplevideoconference; public class User_Model { private String user_name,user_email,user_image; public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getUser_email() { return user_email; } public void setUser_email(String user_email) { this.user_email = user_email; } public String getUser_image() { return user_image; } public void setUser_image(String user_image) { this.user_image = user_image; } }
[ "shubhamgarg@Shubhams-MacBook-Pro.local" ]
shubhamgarg@Shubhams-MacBook-Pro.local
7f8a4408d344ede6e132046ba6c95dbe7304217b
94fff910b6ed266f736bd5ca9ccd773f84e327f7
/doctormanager/src/java/cn/yunji/doctormanager/controller/HighRiskRtandardController.java
eed9eb1885b24928d98c26181935f0de14f256b2
[]
no_license
1emanresu/doctorManager
a11b6414cad1f2295ab38810b50218957ac09bb0
3046a98be2a90d95581f275027cecc7af0b8c34b
refs/heads/master
2020-03-28T17:31:24.040211
2018-09-15T02:20:56
2018-09-15T02:20:56
148,797,869
0
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
package cn.yunji.doctormanager.controller; import javax.annotation.Resource; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import cn.yunji.doctormanager.entity.HighRiskRtandard; import cn.yunji.doctormanager.service.HighRiskRtandardService; import cn.yunji.doctormanager.util.JsonResult; @Controller @RequestMapping("/highRiskRtandard") public class HighRiskRtandardController { @Resource private HighRiskRtandardService highRiskRtandardService; @RequestMapping("/queryById.do") @ResponseBody //查询高危分数 public JsonResult queryById(String hid,int cid){ return new JsonResult(highRiskRtandardService.queryById(hid, cid)); } //根据检查信息编号获取高危参数--wuwj @ResponseBody @RequestMapping("/getHighRiskStandard") public HighRiskRtandard getHighRiskStandard(int cid) { HighRiskRtandard highRiskRtandard = highRiskRtandardService.getHisgRiskStandardbycid(cid); return highRiskRtandard; } }
[ "13549349203@163.com" ]
13549349203@163.com