blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
cc355f08680ad73a4787d4ef3bdcb9a873cdd580
f737d34684afee17aceab731431d98672026654a
/JAVA/day07_oop/src/Interface_test/Tran.java
0ced0d1c2270aae56ed9a233e6190828fb21b2a9
[]
no_license
kimmjen/ION_KOSA
8b5009d479dc9d6d0c04c937220837416a080a37
fca21d2d52a8b22ba5d512a4a4a7b44463914bfe
refs/heads/master
2023-08-23T06:58:45.292631
2021-10-15T08:00:58
2021-10-15T08:00:58
399,995,833
0
0
null
null
null
null
UTF-8
Java
false
false
94
java
package Interface_test; public interface Tran { public void start(); public void stop(); }
0c2e729188ce2c9b6d44d8c23a772cf9d2ef1d6a
9a8d19c141cc270596c3a64fc69c30a324d87e3a
/solr/src/test/java/com/example/solr/SolrApplicationTests.java
5ba5278aab27e3422acd896ac0673f8a341d4d8a
[]
no_license
lzdn/SpringBoot-2
a2395f80b3f122ad8a616796fa5cf701ce7f17cd
6ccb4c396d0b922b5e4aff92d7cc0f9d2375af4f
refs/heads/master
2020-03-17T21:46:46.281623
2018-05-18T09:25:51
2018-05-18T09:25:51
133,975,216
1
0
null
2018-05-18T15:52:57
2018-05-18T15:52:57
null
UTF-8
Java
false
false
331
java
package com.example.solr; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class SolrApplicationTests { @Test public void contextLoads() { } }
948d363670164beafe957f4baba6386900021289
89a75323b70514b7a5eaac58523ebed767f23624
/LibraryProject/src/main/java/com/cognixia/jump/model/BookCheckout.java
88a09fc5b9f9c7cfe3ac9252e6359444468bbbff
[]
no_license
FatihErkayiran/LibraryProject
836f91007a8cb50307f2cdd0d180dba4cad3b5a7
81689fbdf075545c4748377f6509a81d82924eb8
refs/heads/master
2022-11-14T10:09:54.700901
2020-07-02T14:44:20
2020-07-02T14:44:20
276,444,174
0
0
null
2020-07-01T17:39:26
2020-07-01T17:39:26
null
UTF-8
Java
false
false
1,787
java
package com.cognixia.jump.model; import java.sql.Date; public class BookCheckout { private int checkoutId; private int patronId; private String isbn; private String bookTitle; private Date checkedout; private Date dueDate; private Date returnDate; public BookCheckout(int checkoutId, int patronId, String isbn, String bookTitle, Date checkedout, Date dueDate, Date returnDate) { super(); this.checkoutId = checkoutId; this.patronId = patronId; this.isbn = isbn; this.bookTitle = bookTitle; this.checkedout = checkedout; this.dueDate = dueDate; this.returnDate = returnDate; } public int getCheckoutId() { return checkoutId; } public void setCheckoutId(int checkoutId) { this.checkoutId = checkoutId; } public int getPatronId() { return patronId; } public void setPatronId(int patronId) { this.patronId = patronId; } public String getIsbn() { return isbn; } public void setIsbn(String isbn) { this.isbn = isbn; } public String getBookTitle() { return bookTitle; } public void setBookTitle(String bookTitle) { this.bookTitle = bookTitle; } public Date getCheckedout() { return checkedout; } public void setCheckedout(Date checkedout) { this.checkedout = checkedout; } public Date getDueDate() { return dueDate; } public void setDueDate(Date dueDate) { this.dueDate = dueDate; } public Date getReturnDate() { return returnDate; } public void setReturnDate(Date returnDate) { this.returnDate = returnDate; } @Override public String toString() { return "BookCheckout [checkoutId=" + checkoutId + ", patronId=" + patronId + ", isbn=" + isbn + ", bookTitle=" + bookTitle + ", checkedout=" + checkedout + ", dueDate=" + dueDate + ", returnDate=" + returnDate + "]"; } }
ba260cdf60e54efe0c9766429ccf5d12ee8f1829
ebb10cfcb0c5d3033de14f3a8eab6c5557839170
/DAS/app/src/main/java/com/example/rizwan444/das/LogINActivity.java
b23b002dd701edaea368fd6dfe483a2bc81ba77d
[]
no_license
rizwan444/New
d78a567aecb56634dec66eacd015ffc686b06a2b
cc1162babcc6a832f52c4bae158d0b17a90c4408
refs/heads/master
2021-01-11T19:09:00.723515
2017-01-19T10:56:51
2017-01-19T10:56:51
79,326,761
0
0
null
null
null
null
UTF-8
Java
false
false
1,999
java
package com.example.rizwan444.das; import android.database.Cursor; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class LogINActivity extends AppCompatActivity { DataBase dataBase; EditText Userid; EditText Password; TextView V; String userid,password; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_log_in); dataBase = new DataBase(this); V=(TextView) findViewById(R.id.txtV_Msg); Userid=(EditText) findViewById(R.id.editTxt_UserID); Password=(EditText) findViewById(R.id.editTxt_Password); userid= Userid.getText().toString(); password= Password.getText().toString(); Button btn= (Button) findViewById(R.id.btn_LogIn); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Cursor cursor; cursor=dataBase.list_all(userid,password); if(cursor.getCount()!=0){ Toast.makeText(LogINActivity.this,"Welcome", Toast.LENGTH_LONG).show(); } /* StringBuffer buffer= new StringBuffer(); while(cursor.moveToNext()){ buffer.append("ID :"+cursor.getString(0)+"\n"); buffer.append("ID :"+cursor.getString(1)+"\n"); buffer.append("ID :"+cursor.getString(2)+"\n"); buffer.append("ID :"+cursor.getString(3)+"\n"); buffer.append("ID :"+cursor.getString(4)+"\n"); buffer.append("ID :"+cursor.getString(5)+"\n\n"); } V.setText(buffer);*/ } }); } }
d0bc3fd57a337e2bddc28a783248a0df8f21109a
97bbe0e6cdccfa06d4ef279190d7c430b67d4fef
/viikko3/LoginCucumber/src/main/java/ohtu/services/AuthenticationService.java
08516cd5899e52aa971b4ca6df2cf196e4d03a07
[]
no_license
skoskipaa/ohtu-tehtavat
9e9b3a498a78906cd03cd749c83ccbb3b70c897f
7f0d90e555a8a857d03361dbede9eb34bb47aec7
refs/heads/master
2020-08-31T01:11:42.274416
2019-12-07T12:34:01
2019-12-07T12:34:01
218,542,794
0
0
null
null
null
null
UTF-8
Java
false
false
1,523
java
package ohtu.services; import ohtu.domain.User; import java.util.ArrayList; import java.util.List; import ohtu.data_access.UserDao; public class AuthenticationService { private UserDao userDao; public AuthenticationService(UserDao userDao) { this.userDao = userDao; } public boolean logIn(String username, String password) { for (User user : userDao.listAll()) { if (user.getUsername().equals(username) && user.getPassword().equals(password)) { return true; } } return false; } public boolean createUser(String username, String password) { if (userDao.findByName(username) != null) { return false; } if (invalid(username, password)) { return false; } userDao.add(new User(username, password)); return true; } private boolean invalid(String username, String password) { // validity check of username and password if (username.length() < 3 || !username.matches("[a-z]+") || password.length() < 8) { return true; } return checkIfPasswordContainsOnlyLetters(password); } private boolean checkIfPasswordContainsOnlyLetters(String password) { for (int i = 0; i < password.length(); i++) { if (Character.isLetter(password.charAt(i)) == false) { return false; } } return true; } }
a6aeb3c86a84ef59bbadca72b2d9d4fe6e409588
5d00b27e4022698c2dc56ebbc63263f3c44eea83
/src/com/ah/bo/performance/AhMaxClientsCount.java
de78fae44fd50670656a13940932284425c87930
[]
no_license
Aliing/WindManager
ac5b8927124f992e5736e34b1b5ebb4df566770a
f66959dcaecd74696ae8bc764371c9a2aa421f42
refs/heads/master
2020-12-27T23:57:43.988113
2014-07-28T17:58:46
2014-07-28T17:58:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,549
java
package com.ah.bo.performance; import java.sql.Timestamp; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Transient; import javax.persistence.Version; import org.hibernate.annotations.Index; import com.ah.bo.HmBo; import com.ah.bo.admin.HmDomain; @Entity @Table(name = "max_clients_count") @org.hibernate.annotations.Table(appliesTo = "max_clients_count", indexes = { @Index(name = "MAX_CLIENTS_COUNT_OWNER", columnNames = { "OWNER" }), @Index(name = "MAX_CLIENTS_COUNT_TIME", columnNames = { "timeStamp" }) }) public class AhMaxClientsCount implements HmBo { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private int maxClientCount = 0; private int currentClientCount = 0; private long client24Count; private long client5Count; private long clientwiredCount; private long totalCount; private boolean globalFlg; private long timeStamp = System.currentTimeMillis(); @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "OWNER", nullable = false) private HmDomain owner; @Version private Timestamp version; @Override public Long getId() { return this.id; } @Override public Timestamp getVersion() { return version; } @Override public String getLabel() { return "maxclientcount"; } @Transient private boolean selected; @Override public boolean isSelected() { return this.selected; } @Override public void setSelected(boolean selected) { this.selected = selected; } @Override public void setId(Long id) { this.id = id; } @Override public void setVersion(Timestamp version) { } @Override public HmDomain getOwner() { return owner; } @Override public void setOwner(HmDomain owner) { this.owner = owner; } public int getMaxClientCount() { return maxClientCount; } public void setMaxClientCount(int maxClientCount) { this.maxClientCount = maxClientCount; } public long getTimeStamp() { return timeStamp; } public void setTimeStamp(long timeStamp) { this.timeStamp = timeStamp; } public int getCurrentClientCount() { return currentClientCount; } public void setCurrentClientCount(int currentClientCount) { this.currentClientCount = currentClientCount; } /** * @return the globalFlg */ public boolean getGlobalFlg() { return globalFlg; } /** * @param globalFlg the globalFlg to set */ public void setGlobalFlg(boolean globalFlg) { this.globalFlg = globalFlg; } public long getClient24Count() { return client24Count; } public void setClient24Count(long client24Count) { this.client24Count = client24Count; } public long getClient5Count() { return client5Count; } public void setClient5Count(long client5Count) { this.client5Count = client5Count; } public long getClientwiredCount() { return clientwiredCount; } public void setClientwiredCount(long clientwiredCount) { this.clientwiredCount = clientwiredCount; } public long getTotalCount() { return totalCount; } public void setTotalCount(long totalCount) { this.totalCount = totalCount; } }
d4926b63d31f0d6b02c58d601dd2579c7848b933
e65b3071c77a201596c602d4ccff4b08071f404b
/src/main/java/koschei/models/Egg6.java
28683893a17d180890672fe992a3eae21427e312
[]
no_license
rustamg070619/spring214
62b19d417d51fa5b9d69eb73a669dc6f685054f8
70cfc5bec644d951d51a127eee27286b98d19099
refs/heads/master
2021-04-13T23:21:04.180738
2020-03-22T13:50:01
2020-03-22T13:50:01
249,193,577
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package koschei.models; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class Egg6 { Needle7 needle; @Autowired public void setNeedle(Needle7 needle) { this.needle = needle; } @Override public String toString() { return ", в яйце иголка " + needle.toString(); } }
92c1796fb9b64fa09b805a8fcbdc149420548f73
95d20c83d8aff34e314c56a3ecb2b87c9fa9fc86
/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/type/OneMethodMsType.java
e4220260e55822ad21c463d5e2f70f412060b5dd
[ "GPL-1.0-or-later", "GPL-3.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
NationalSecurityAgency/ghidra
969fe0d2ca25cb8ac72f66f0f90fc7fb2dbfa68d
7cc135eb6bfabd166cbc23f7951dae09a7e03c39
refs/heads/master
2023-08-31T21:20:23.376055
2023-08-29T23:08:54
2023-08-29T23:08:54
173,228,436
45,212
6,204
Apache-2.0
2023-09-14T18:00:39
2019-03-01T03:27:48
Java
UTF-8
Java
false
false
1,449
java
/* ### * IP: GHIDRA * * 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 ghidra.app.util.bin.format.pdb2.pdbreader.type; import ghidra.app.util.bin.format.pdb2.pdbreader.*; /** * This class represents the <B>MsType</B> flavor of One Method type. * <P> * Note: we do not necessarily understand each of these data type classes. Refer to the * base class for more information. */ public class OneMethodMsType extends AbstractOneMethodMsType { public static final int PDB_ID = 0x1511; /** * Constructor for this type. * @param pdb {@link AbstractPdb} to which this type belongs. * @param reader {@link PdbByteReader} from which this type is deserialized. * @throws PdbException upon error parsing a field. */ public OneMethodMsType(AbstractPdb pdb, PdbByteReader reader) throws PdbException { super(pdb, reader, 32, StringParseType.StringNt); } @Override public int getPdbId() { return PDB_ID; } }
226985970e631177dffb1eec9928eeebcd35a7b9
8ca40e66c6dc621a26fe49497086470fca4394ad
/src/main/java/com/fh/controller/TypeController.java
049e9ec9c57218ae137c438b61796b6cf8bb93d6
[]
no_license
lhh86/springBootTest
9df3097fecb1b9fdd7dc810d74a2baca3d9cb7ca
d5f9df6d51ba85156c98a17c7561b8995d5c5adc
refs/heads/master
2022-11-28T00:52:07.932608
2020-08-06T04:01:08
2020-08-06T04:01:08
285,461,860
0
0
null
null
null
null
UTF-8
Java
false
false
1,333
java
package com.fh.controller; import com.alibaba.fastjson.JSONObject; import com.fh.common.jsonDate; import com.fh.model.Type; import com.fh.service.TypeService; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.data.redis.RedisProperties; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import redis.clients.jedis.Jedis; import java.util.List; @RestController @RequestMapping("TypeController") public class TypeController { @Autowired private TypeService typeService; @RequestMapping("queryTypeAll") @CrossOrigin public jsonDate queryTypeAll(){ Jedis jedis = new Jedis("192.168.116.135"); return jsonDate.getJsonSuccess(jedis.get("type_json_lsc")); } @RequestMapping("reflusRedis") public jsonDate reflusRedis(){ List<Type> types = typeService.queryTypeAll(); String jsonString = JSONObject.toJSONString(types); //放入到redis中 Jedis jedis = new Jedis("192.168.116.135"); jedis.set("type_json_lsc",jsonString); jedis.close(); return jsonDate.getJsonSuccess("redis刷新成功"); } }
8e26bcf99751e220eddfee257ee1dd76ac8265fd
e88cceb2c05f4872f9b1659c66612b88bcfc4a68
/spring/spring9-validated/src/main/java/com/xhx/spring/validator/IsMobileValidate.java
ea5dbb77102f7579a27a2b34e9f1d061db38f502
[]
no_license
jinlulin0814/myDocument
9223eafca6e501cf23809aa31cfee389436f2f53
7e1b6ab872c27e25cd6ea3ed5761098cbd1cf7f5
refs/heads/master
2020-05-31T13:28:04.965823
2019-06-03T06:52:24
2019-06-03T06:52:24
190,304,672
1
0
null
2019-06-05T01:25:30
2019-06-05T01:25:30
null
UTF-8
Java
false
false
754
java
package com.xhx.spring.validator; import com.xhx.spring.utils.ValidatorUtil; import org.springframework.util.StringUtils; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; public class IsMobileValidate implements ConstraintValidator<IsMobile, String> { private boolean required = true; @Override public void initialize(IsMobile constraint) { this.required = constraint.required(); } @Override public boolean isValid(String value, ConstraintValidatorContext context) { if(required){ return ValidatorUtil.isMobile(value); }else { if(!StringUtils.isEmpty(value)){ return ValidatorUtil.isMobile(value); } } return true; } }
3f9ba53e97b9e54c518f8e424524432c1002d344
8e79206ad92e035b188ebc50f537330d98b8d746
/ProyectoSQLite/src/dao/LibroDaoSql.java
2b702d01b46ee0d7dd75fcf5a49bf4888ce87638
[]
no_license
JCLancho/BibliotecaSQLite
4b2bb50ff96282c055967c4311cd9992582324e6
e44f00f33b3b092b0d47061ed284fa350546b7a2
refs/heads/master
2020-09-08T08:43:20.488381
2019-11-11T22:30:43
2019-11-11T22:30:43
221,082,166
0
0
null
null
null
null
UTF-8
Java
false
false
1,145
java
package dao; public abstract class LibroDaoSql { public static final String TABLA = "LIBRO"; public static final String SELECT = "SELECT" + " ISBN," + " TITULO," + " AUTOR," + " EDITORIAL," + " ASIGNATURA," + " ESTADO"; public static final String DELETE = "DELETE"; public static final String UPDATE = "UPDATE "; public static final String INSERT = "INSERT INTO "; public static final String FROM = " FROM " + TABLA; public static final String WHERE_ALL = " WHERE 1 = 1"; public static final String WHERE_ISBN = " WHERE ISBN = UPPER(?)"; public static final String VALUES = " (ISBN, TITULO, AUTOR, EDITORIAL, ASIGNATURA, ESTADO) VALUES (?,?,?,?,?,?)"; public static final String SET = " SET TITULO = ?, AUTOR = ?, EDITORIAL = ?, ASIGNATURA = ?, ESTADO = ?"; public static final String FIND = SELECT + FROM + WHERE_ISBN; public static final String FIND_ALL = SELECT + FROM + WHERE_ALL; public static final String DELETE_WHERE = DELETE + FROM + WHERE_ISBN; public static final String UPDATE_SET = UPDATE + TABLA + SET + WHERE_ISBN; public static final String INSERT_INTO = INSERT + TABLA + VALUES; }
5a3a7978f59dd57ffa16271e9b31b79d0b1e6685
42c8e8a0412205927846d2db1a937052b0104374
/common/src/main/java/de/uni_potsdam/hpi/loddp/common/printing/LogicalPlanPrinter.java
769c651fba80763d24af8f3e4ba33c0a8d15f51b
[]
no_license
chenyaqiang/lodop
7edf331dd71b9ec6b5117ed907853bdb33497570
8c54a9f9f075613671638bfd7407d6d7c6f9f0ca
refs/heads/master
2020-11-25T07:40:05.146844
2014-02-18T19:21:21
2014-02-18T19:21:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
16,715
java
package de.uni_potsdam.hpi.loddp.common.printing; import org.apache.pig.impl.util.MultiMap; import org.apache.pig.newplan.BaseOperatorPlan; import org.apache.pig.newplan.Operator; import org.apache.pig.newplan.PlanDumper; import org.apache.pig.newplan.logical.expression.LogicalExpressionPlan; import org.apache.pig.newplan.logical.expression.ProjectExpression; import org.apache.pig.newplan.logical.relational.*; import java.io.PrintStream; import java.util.*; /** * Print logical plans as DOT graph graphs. * * Large portions of this class are more or less identical to code from {@link org.apache.pig.newplan.DotPlanDumper} and * {@link org.apache.pig.newplan.logical.DotLOPrinter}, which unfortunately are not very extensible. * * Different to {@link org.apache.pig.newplan.logical.DotLOPrinter}, this class also prints soft links (dashed). */ public class LogicalPlanPrinter extends PlanDumper { public static String ANNOTATION_OPERATOR_HIGHLIGHT = "operator.highlight"; protected Set<Operator> mSubgraphs; protected Set<Operator> mMultiInputSubgraphs; protected Set<Operator> mMultiOutputSubgraphs; protected boolean isSubGraph = false; public LogicalPlanPrinter(BaseOperatorPlan plan, PrintStream ps) { this(plan, ps, false, new HashSet<Operator>(), new HashSet<Operator>(), new HashSet<Operator>()); } protected LogicalPlanPrinter(BaseOperatorPlan plan, PrintStream ps, boolean isSubGraph, Set<Operator> mSubgraphs, Set<Operator> mMultiOutputSubgraphs, Set<Operator> mMultiInputSubgraphs) { super(plan, ps); this.mSubgraphs = mSubgraphs; this.isSubGraph = isSubGraph; this.mMultiOutputSubgraphs = mMultiOutputSubgraphs; this.mMultiInputSubgraphs = mMultiInputSubgraphs; } @Override protected PlanDumper makeDumper(BaseOperatorPlan plan, PrintStream ps) { return new LogicalPlanPrinter(plan, ps, true, mSubgraphs, mMultiInputSubgraphs, mMultiOutputSubgraphs); } @Override public void dump() { if (!isSubGraph) { ps.println("digraph plan {"); ps.println("compound=true;"); //ps.println("ratio=auto;"); ps.println("rankdir=LR;"); ps.println("forcelabels=true;"); ps.println("node [shape=rect];"); } super.dump(); dumpSoftLinks(); if (!isSubGraph) { ps.println("}"); } } @Override protected MultiMap<Operator, BaseOperatorPlan> getMultiInputNestedPlans(Operator op) { if (op instanceof LOCogroup) { MultiMap<Operator, BaseOperatorPlan> planMap = new MultiMap<Operator, BaseOperatorPlan>(); for (Integer i : ((LOCogroup) op).getExpressionPlans().keySet()) { List<BaseOperatorPlan> plans = new ArrayList<BaseOperatorPlan>(); plans.addAll(((LOCogroup) op).getExpressionPlans().get(i)); Operator pred = plan.getPredecessors(op).get(i); planMap.put(pred, plans); //pred = plan.getSoftLinkPredecessors(op).get(i); //planMap.put(pred, plans); } return planMap; } else if (op instanceof LOJoin) { MultiMap<Operator, BaseOperatorPlan> planMap = new MultiMap<Operator, BaseOperatorPlan>(); for (Integer i : ((LOJoin) op).getExpressionPlans().keySet()) { List<BaseOperatorPlan> plans = new ArrayList<BaseOperatorPlan>(); plans.addAll(((LOJoin) op).getExpressionPlans().get(i)); Operator pred = plan.getPredecessors(op).get(i); planMap.put(pred, plans); //pred = plan.getSoftLinkPredecessors(op).get(i); //planMap.put(pred, plans); } return planMap; } return new MultiMap<Operator, BaseOperatorPlan>(); } @Override protected Collection<BaseOperatorPlan> getNestedPlans(Operator op) { Collection<BaseOperatorPlan> plans = new LinkedList<BaseOperatorPlan>(); if (op instanceof LOFilter) { plans.add(((LOFilter) op).getFilterPlan()); } else if (op instanceof LOLimit) { plans.add(((LOLimit) op).getLimitPlan()); } else if (op instanceof LOForEach) { plans.add(((LOForEach) op).getInnerPlan()); } else if (op instanceof LOGenerate) { plans.addAll(((LOGenerate) op).getOutputPlans()); } else if (op instanceof LOSort) { plans.addAll(((LOSort) op).getSortColPlans()); } else if (op instanceof LOSplitOutput) { plans.add(((LOSplitOutput) op).getFilterPlan()); } return plans; } protected boolean reverse(BaseOperatorPlan plan) { if (plan instanceof LogicalExpressionPlan) return true; return false; } @Override protected void dumpMultiInputNestedOperator(Operator op, MultiMap<Operator, BaseOperatorPlan> plans) { dumpInvisibleOutput(op); ps.print("subgraph "); ps.print(getClusterID(op)); ps.println(" {"); ps.print(attributesToString(getAttributes(op), "; ")); ps.println("; labelloc=b;"); mMultiInputSubgraphs.add(op); for (Operator o : plans.keySet()) { ps.print("subgraph "); ps.print(getClusterID(op, o)); ps.println(" {"); ps.println("label=\"\";"); dumpInvisibleInput(op, o); for (BaseOperatorPlan plan : plans.get(o)) { PlanDumper dumper = makeDumper(plan, ps); dumper.dump(); connectInvisibleInput(op, o, plan); } ps.println("};"); } ps.println("};"); for (Operator o : plans.keySet()) { for (BaseOperatorPlan plan : plans.get(o)) { connectInvisibleOutput(op, plan); } } } @Override protected void dumpMultiOutputNestedOperator(Operator op, Collection<BaseOperatorPlan> plans) { super.dumpMultiOutputNestedOperator(op, plans); mMultiOutputSubgraphs.add(op); dumpInvisibleOutput(op); for (BaseOperatorPlan plan : plans) { connectInvisibleOutput(op, plan); } } @Override protected void dumpNestedOperator(Operator op, Collection<BaseOperatorPlan> plans) { dumpInvisibleOperators(op); ps.print("subgraph "); ps.print(getClusterID(op)); ps.println(" {"); ps.print(attributesToString(getAttributes(op), "; ")); ps.println("; labelloc=b;"); mSubgraphs.add(op); for (BaseOperatorPlan plan : plans) { PlanDumper dumper = makeDumper(plan, ps); dumper.dump(); connectInvisibleInput(op, plan); } ps.println("};"); for (BaseOperatorPlan plan : plans) { connectInvisibleOutput(op, plan); } } @Override protected void dumpOperator(Operator op) { ps.print(getID(op)); ps.print(" ["); ps.print(attributesToString(getAttributes(op), ", ")); ps.println("];"); } @Override protected void dumpEdge(Operator op, Operator suc) { String in = getID(op); String out = getID(suc); Map<String, String> attributes = getEdgeAttributes(op, suc); if (mMultiInputSubgraphs.contains(op) || mSubgraphs.contains(op) || mMultiOutputSubgraphs.contains(op)) { in = getSubgraphID(op, false); } if (mMultiInputSubgraphs.contains(suc)) { out = getSubgraphID(suc, op, true); attributes.put("lhead", getClusterID(suc, op)); } if (mSubgraphs.contains(suc)) { out = getSubgraphID(suc, true); attributes.put("lhead", getClusterID(suc)); } if (reverse(plan)) { ps.print(out); ps.print(" -> "); ps.print(in); } else { ps.print(in); ps.print(" -> "); ps.print(out); } ps.println(" [" + attributesToString(attributes) + "]"); } private void connectInvisibleInput(Operator op1, Operator op2, BaseOperatorPlan plan) { String in = getSubgraphID(op1, op2, true); List<Operator> sources; if (reverse(plan)) sources = plan.getSinks(); else sources = plan.getSources(); for (Operator l : sources) { dumpInvisibleEdge(in, getID(l)); } } private void connectInvisibleInput(Operator op, BaseOperatorPlan plan) { String in = getSubgraphID(op, true); List<Operator> sources; if (reverse(plan)) sources = plan.getSinks(); else sources = plan.getSources(); for (Operator l : sources) { String out; if (mSubgraphs.contains(l) || mMultiInputSubgraphs.contains(l)) { out = getSubgraphID(l, true); } else { out = getID(l); } dumpInvisibleEdge(in, out); } } private void connectInvisibleOutput(Operator op, BaseOperatorPlan plan) { String out = getSubgraphID(op, false); List<Operator> sinks; if (reverse(plan)) sinks = plan.getSources(); else sinks = plan.getSinks(); for (Operator l : sinks) { String in; if (mSubgraphs.contains(l) || mMultiInputSubgraphs.contains(l) || mMultiOutputSubgraphs.contains(l)) { in = getSubgraphID(l, false); } else { in = getID(l); } dumpInvisibleEdge(in, out); } } private void connectInvisible(Operator op, BaseOperatorPlan plan) { connectInvisibleInput(op, plan); connectInvisibleOutput(op, plan); } private void dumpInvisibleInput(Operator op1, Operator op2) { ps.print(getSubgraphID(op1, op2, true)); ps.print(" "); ps.print(getInvisibleAttributes(op1)); ps.println(";"); } private void dumpInvisibleInput(Operator op) { ps.print(getSubgraphID(op, true)); ps.print(" "); ps.print(getInvisibleAttributes(op)); ps.println(";"); } private void dumpInvisibleOutput(Operator op) { ps.print(getSubgraphID(op, false)); ps.print(" "); ps.print(getInvisibleAttributes(op)); ps.println(";"); } protected void dumpInvisibleOperators(Operator op) { dumpInvisibleInput(op); dumpInvisibleOutput(op); } private String getClusterID(Operator op1, Operator op2) { return getClusterID(op1) + "_" + getID(op2); } private String getClusterID(Operator op) { return "cluster_" + getID(op); } private String getSubgraphID(Operator op1, Operator op2, boolean in) { String id = "s" + getID(op1) + "_" + getID(op2); if (in) { id += "_in"; } else { id += "_out"; } return id; } private String getSubgraphID(Operator op, boolean in) { String id = "s" + getID(op); if (in) { id += "_in"; } else { id += "_out"; } return id; } private String getID(Operator op) { return "" + Math.abs(op.hashCode()); } private String getInvisibleAttributes(Operator op) { return "[shape=point, margin=0, label=\"\", style=invis, height=0, width=0]"; } private void dumpInvisibleEdge(String op, String suc) { ps.print(op); ps.print(" -> "); ps.print(suc); ps.println(" [style=invis];"); } protected void dumpSoftLinks() { Iterator<Operator> iterator = plan.getOperators(); while (iterator.hasNext()) { Operator op = iterator.next(); Collection<Operator> successors = plan.getSoftLinkSuccessors(op); if (successors != null) { for (Operator suc : successors) { dumpSoftLink(op, suc); } } } } protected void dumpSoftLink(Operator op, Operator suc) { String in = getID(op); String out = getID(suc); Map<String, String> attributes = getSoftLinkAttributes(op, suc); if (mMultiInputSubgraphs.contains(op) || mSubgraphs.contains(op) || mMultiOutputSubgraphs.contains(op)) { in = getSubgraphID(op, false); } if (mMultiInputSubgraphs.contains(suc)) { out = getSubgraphID(suc, op, true); attributes.put("lhead", getClusterID(suc, op)); } if (mSubgraphs.contains(suc)) { out = getSubgraphID(suc, true); attributes.put("lhead", getClusterID(suc)); } if (reverse(plan)) { ps.print(out); ps.print(" -> "); ps.print(in); } else { ps.print(in); ps.print(" -> "); ps.print(out); } ps.println(" [" + attributesToString(attributes) + "]"); } /** * Used to generate the label for an operator. * * @param op operator to dump */ protected String getName(Operator op) { StringBuffer sb = new StringBuffer(op.getName()); if (op instanceof ProjectExpression) { ProjectExpression pr = (ProjectExpression) op; sb.append(pr.getInputNum()); sb.append(":"); if (pr.isProjectStar()) sb.append("(*)"); else if (pr.isRangeProject()) sb.append("[").append(pr.getStartCol()).append(" .. ").append(pr.getEndCol()).append("]"); else sb.append(pr.getColNum()); } else if (op instanceof LOInnerLoad) { sb.append("\\n").append(getName(((LOInnerLoad) op).getProjection())); } if (op instanceof LogicalRelationalOperator) { LogicalRelationalOperator operator = (LogicalRelationalOperator) op; if (operator.getAlias() != null) { sb.append("\\n(").append(operator.getAlias()).append(")"); } } return sb.toString(); } /** * Generate attributes for a node. */ protected Map<String, String> getAttributes(Operator op) { Map<String, String> attributes = new HashMap<String, String>(); attributes.put("style", "filled"); attributes.put("fillcolor", "#F5F5F5"); String label = getName(op); if (op instanceof LOStore || op instanceof LOLoad) { label.replace(":", ",\\n"); attributes.put("fillcolor", "gray"); } String highlightColor = (String) op.getAnnotation(ANNOTATION_OPERATOR_HIGHLIGHT); if (highlightColor != null && !highlightColor.isEmpty()) { attributes.put("fillcolor", highlightColor); } attributes.put("label", label); return attributes; } /** * Generate attributes for an edge. */ protected Map<String, String> getEdgeAttributes(Operator pred, Operator suc) { Map<String, String> attributes = new HashMap<String, String>(); return attributes; } /** * Generate attributes for a soft link. */ protected Map<String, String> getSoftLinkAttributes(Operator pred, Operator suc) { Map<String, String> attributes = new HashMap<String, String>(); attributes.put("style", "dashed"); return attributes; } /** * Convert an attributes map to a comma-separated string. */ protected String attributesToString(Map<String, String> attributes) { return attributesToString(attributes, ", "); } /** * Convert an attributes map to a comma-separated string. */ protected String attributesToString(Map<String, String> attributes, String separator) { StringBuffer sb = new StringBuffer(); for (Map.Entry<String, String> entry : attributes.entrySet()) { if (sb.length() > 0) sb.append(separator); sb.append(entry.getKey()).append("=").append(quote(entry.getValue())); } return sb.toString(); } /** * Adds quotes around the given string value. Also makes sure that the contained string does not contain quotes * itself. */ protected String quote(String value) { return "\"" + value.replace('"', '\'') + "\""; } }
d22e4753b698766c6bab93c46274728e9aef3646
3e82f76ab0550812386422fe23799c5dcefa169d
/src/main/java/Main.java
845becdf0b3f0b5fc0aea46dd876dd7c3c1928cd
[]
no_license
maria-99/Store
0ad357494f1797832eff23fca224c2a3e6ca1943
8206f1c895ae621ed204c6b5799f55f9e75cba06
refs/heads/master
2023-07-10T19:18:35.577345
2021-08-08T17:11:29
2021-08-08T17:11:29
394,017,250
0
0
null
null
null
null
UTF-8
Java
false
false
1,419
java
import Exceptions.*; import Products.*; import Stores.Store; import Stores.StoreBuilder; public class Main { public static void main(String[] args) { //проверка правильности работы //Book b1 = new Book("book 1", 25, 3); //Book b2 = new Book("book", 12, 7); Book b3 = new Book("strawberry ice-cream cake recipe", 12, 7); Soap s1 = new Soap("strawberry soap", 7, 6); Cake c1 = new Cake("strawberry ice-cream cake", 9, 8, 7); Cake c2 = new Cake("strawberry vanilla cake", 4, 4, 2); Cake c3 = new Cake("chocolate cake", 16, 2, 5); Store store = new StoreBuilder().setMaxSize(8).setName("Maria's").build(); try { //store.addProduct(b1); //store.addProduct(b2); store.addProduct(b3); store.addProduct(s1); store.addProduct(c1); store.addProduct(c2); store.addProduct(c3); } catch (StoreFullException e) { System.out.println(e.getMessage()); } System.out.println("books: " + store.bookProducts()); System.out.println("soaps: " + store.soapProducts()); System.out.println("cakes: " + store.cakeProducts()); System.out.println("Product List: " + store.getProductSet()); System.out.println("Products like " + c1 + " are: " + store.findProductsLike(c1)); } }
8d5315f16b1608f993fabe8a71428145e4bfafe6
2960329986ec321745042cb893236a2fcfe7cf2f
/Homeworks/E-CommerceDemo/src/eCommerceDemo/dataAccess/abstracts/UserDao.java
7768980876b2cc96a3b4eb7c120ea18714887e5e
[]
no_license
ikranergiz/Java-React-Software-Developer-Training-Camp
51f9fad9a050d77ade4786d8f4fb19330a6ca7b0
50a46f9536be4c658241b55c2335ca609ffc7b75
refs/heads/main
2023-04-22T07:21:37.589168
2021-05-11T16:41:49
2021-05-11T16:41:49
363,734,992
6
0
null
null
null
null
UTF-8
Java
false
false
155
java
package eCommerceDemo.dataAccess.abstracts; import eCommerceDemo.entities.concretes.User; public interface UserDao { boolean addToSystem(User user); }
2ae6c8f9b6b59266d6e41e62663ab02ae106b175
e58e4962be5eb452be80673b88b697c33649f64d
/Java 1 course/src/lab3.java
cac86d10aaf3a6818c14016298c891a2a7fe914d
[ "MIT" ]
permissive
apletea/MMF_Labs
372c80f8b1b696792147a7099d42c80d31a8fcfc
bed898865d62e7f797e383e086a217654871afbd
refs/heads/master
2021-06-03T18:50:48.999690
2020-09-14T18:03:44
2020-09-14T18:03:44
89,533,315
6
1
MIT
2020-10-13T02:58:03
2017-04-26T22:48:28
C++
UTF-8
Java
false
false
1,114
java
import java.time.ZonedDateTime; import java.util.Date; import java.util.Scanner; /** * Created by apletea on 11.3.17. */ /** * @author Kamarouski Dzmitry * */ /*Найти число, цифры в котором идут в строгом порядке возрастания. Если таких чисел несколько, найти первое из них*/ public class lab3 { public static void main(String ... args){ Scanner sc = new Scanner(System.in); while (true){ int a = sc.nextInt(); if (isSatisfied(a)) { System.out.println(a); Date d = new Date(); System.out.println("Комаровский Дмитрий " + ZonedDateTime.now()); return; } } } private static boolean isSatisfied(int a){ int n = a%10; a /= 10; while(a!=0){ if (a%10 != n-1) return false; n = a%10; a /= 10; } return true; } }
32ca14cf4d0e7fc62a316e621dc725d04b3a8eac
a14e897f14ffcf369245cb483724b0858eec247b
/utils/src/main/java/com/ez/utils/model/BZipVO.java
542813b182030cd5d3e539dc7c194768eef76213
[]
no_license
irunmyway/AndroidBaseUtil
e50aa9061176b955949d7115e3f3437c6455cbbd
bc495aaceae110c2edf8ce2ea21754735cee502e
refs/heads/master
2022-11-27T12:34:54.448183
2020-06-22T14:48:09
2020-06-22T14:48:09
273,848,196
2
1
null
null
null
null
UTF-8
Java
false
false
128
java
package com.ez.utils.model; public class BZipVO { public int count; public int total; public String entryName; }
b83bf435a954c7323aedeebbc4e7772da7ceddce
c31df1eb05bc577cfbfae08d0d14096efef0f699
/CocheFantasticoBT/app/src/test/java/com/feriafp/cochebluetooth/cochefantasticobt/ExampleUnitTest.java
1b7ebc25546157655044a7cc6a784fe65df10eaa
[]
no_license
Trosydman/CocheFantasticoBT
5180f0f30bf75f1a2b605b374a0abfa32d89c3fc
e540b17542248ebc5e14805f645cdfb9f9374e05
refs/heads/master
2021-01-22T09:16:37.754520
2017-02-20T23:56:30
2017-02-20T23:56:30
81,942,995
0
0
null
null
null
null
UTF-8
Java
false
false
422
java
package com.feriafp.cochebluetooth.cochefantasticobt; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
31d62c199593b001707607e7a00161a471572bd5
fe2ef5d33ed920aef5fc5bdd50daf5e69aa00ed4
/callcenterj_sy/src/et/test/jdk15/DoCallStuff.java
3d8825cc482cb1ca0c6c57f17d116ec9f962eefe
[]
no_license
sensui74/legacy-project
4502d094edbf8964f6bb9805be88f869bae8e588
ff8156ae963a5c61575ff34612c908c4ccfc219b
refs/heads/master
2020-03-17T06:28:16.650878
2016-01-08T03:46:00
2016-01-08T03:46:00
null
0
0
null
null
null
null
GB18030
Java
false
false
710
java
/** * 沈阳卓越科技有限公司 * 2008-4-30 */ package et.test.jdk15; import java.util.concurrent.Callable; /** * @author zhang feng * */ public class DoCallStuff implements Callable { private int aInt; public DoCallStuff(int aInt) { this.aInt = aInt; } public String call() throws Exception { // *2 boolean resultOk = false; if (aInt == 0) { resultOk = true; } else if (aInt == 1) { while (true) { // infinite loop System.out.println("looping...."); Thread.sleep(3000); } } else { throw new Exception("Callable terminated with Exception!"); // *3 } if (resultOk) { return "Task done."; } else { return "Task failed"; } } }
8a347bd2b9337072cf9120017a1e29531bc1678f
6b09043b97fb379aebd4363ff07d4cc53e8ec0b9
/Day_1/00-DailyFlash_Solutions/13_Jan_Solution_Three/Java/program1.java
edcc3026c5891dafbcda4ebc97e1f9f6118ec15e
[]
no_license
Aadesh-Shigavan/Python_Daily_Flash
6a4bdd73a33f533f3b121fae9eef973e10bf3945
b118beeca3f4c97de54ae1a610f83da81157009a
refs/heads/master
2022-11-28T13:03:17.573906
2020-08-06T15:36:36
2020-08-06T15:36:36
276,581,310
0
0
null
null
null
null
UTF-8
Java
false
false
397
java
import java.io.*; class Program { public static void main(String [] kbd) throws IOException { int a, b; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter Numbers :"); a = Integer.parseInt(br.readLine()); b = Integer.parseInt(br.readLine()); System.out.println(((a >= b)? a : b) + " is max Number among " + a + " and " + b ); } }
eed83af2488912403b7a4689b6fc87c40b0eacde
71b1300d51ac6dcde1089287ece9adc61c148aa5
/webfx-kit/webfx-kit-javafxgraphics-emul/src/main/java/javafx/scene/layout/PreferenceResizableNode.java
a3d054c7534acd32a5eb6f8645825f315f250707
[ "Apache-2.0" ]
permissive
webfx-project/webfx
0ab7631a69501eced95bc3c65fb9caea76965d8e
a104df9917bb0e4571f726cd28494b099d0f017a
refs/heads/main
2023-08-24T17:55:59.102296
2023-08-13T10:55:08
2023-08-21T13:27:17
44,308,813
249
20
Apache-2.0
2023-08-06T18:05:58
2015-10-15T09:52:32
Java
UTF-8
Java
false
false
1,778
java
package javafx.scene.layout; import javafx.scene.INode; import dev.webfx.kit.mapper.peers.javafxgraphics.markers.*; /** * @author Bruno Salmon */ public interface PreferenceResizableNode extends INode, HasWidthProperty, HasMinWidthProperty, HasPrefWidthProperty, HasMaxWidthProperty, HasHeightProperty, HasMinHeightProperty, HasPrefHeightProperty, HasMaxHeightProperty { default boolean isResizable() { return true; } /** * Sentinel value which can be passed to a region's * {@link #setMinWidth(Double) setMinWidth}, * {@link #setMinHeight(Double) setMinHeight}, * {@link #setMaxWidth(Double) setMaxWidth} or * {@link #setMaxHeight(Double) setMaxHeight} * methods to indicate that the preferred dimension should be used for that max and/or min constraint. */ double USE_PREF_SIZE = Double.NEGATIVE_INFINITY; /** * Sentinel value which can be passed to a region's * {@link #setMinWidth(Double) setMinWidth}, * {@link #setMinHeight(Double) setMinHeight}, * {@link #setPrefWidth(Double) setPrefWidth}, * {@link #setPrefHeight(Double) setPrefHeight}, * {@link #setMaxWidth(Double) setMaxWidth}, * {@link #setMaxHeight(Double) setMaxHeight} methods * to reset the region's size constraint back to it's intrinsic size returned * by {@link #computeMinWidth(Double) computeMinWidth}, {@link #computeMinHeight(double) computeMinHeight}, * {@link #computePrefWidth(double) computePrefWidth}, {@link #computePrefHeight(double) computePrefHeight}, * {@link #computeMaxWidth(double) computeMaxWidth}, or {@link #computeMaxHeight(double) computeMaxHeight}. */ double USE_COMPUTED_SIZE = -1; }
d9a312dc19c297fed522ccdb0273c4a3365b00fd
ddcca3852c714d7b2794c4ee3dc66b7c436069f7
/weadmin/src/main/java/com/wang/weadmin/service/impl/OuterUserServiceImpl.java
84222e23804f6363b2153f36f979444dc348b4f2
[]
no_license
WangYG3022/java-study
09de815a9165a8f559ae3e967dcf5748d658b2df
46ba5231971c79aedcd5a7ed2a9e0c8a256de8ec
refs/heads/master
2022-06-25T17:56:48.302608
2020-06-19T11:40:51
2020-06-19T11:40:51
229,410,595
0
0
null
2020-05-29T11:19:18
2019-12-21T10:18:51
Java
UTF-8
Java
false
false
19,077
java
package com.wang.weadmin.service.impl; import com.wang.weadmin.entity.pojo.User1; import com.wang.weadmin.entity.pojo.User2; import com.wang.weadmin.service.OuterUserService; import com.wang.weadmin.service.User1Service; import com.wang.weadmin.service.User2Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; /** * @description: * @author: WANG Y.G. * @time: 2020/04/30 15:44 * @version: V1.0 */ @Service public class OuterUserServiceImpl implements OuterUserService { @Autowired private User1Service user1Service; @Autowired private User2Service user2Service; @Override public void requiredNoTransactionAndOuterException() { /* 张三正常、李四正常 外部方法未开启事务,插入“张三”、“李四”的操作在自己的事务中独立运行,不受外部方法异常干扰 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.required(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.required(user2); throw new RuntimeException("外部方法抛出异常"); } @Override public void requiredNoTransactionAndInnerException() { /* 张三正常、李四回滚 外部方法未开启事务,插入“张三”、“李四”的操作在自己的事务中独立运行,所以“李四”方法中抛出异常回滚,“张三”不受影响 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.required(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.requiredWithException(user2); } @Transactional(rollbackFor = Exception.class) @Override public void requiredWithTransactionAndOuterException() { /* 张三回滚、李四回滚 外部方法开启事务,内部方法加入外部的事务,外部方法抛出异常回滚,内部也跟着回滚 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.required(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.required(user2); throw new RuntimeException("外部方法抛出异常"); } @Transactional(rollbackFor = Exception.class) @Override public void requiredWithTransactionAndInnerException() { /* 张三回滚、李四回滚 外部方法开启事务,内部方法加入外部的事务,内部方法抛出异常,外部方法感知到异常导致整体回滚 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.required(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.requiredWithException(user2); } @Transactional(rollbackFor = Exception.class) @Override public void requiredWithTransactionAndTryInnerException() { /* 张三回滚、李四回滚 外部方法开启事务,内部方法加入外部的事务,内部方法抛出异常,即使异常被捕获不被外部方法感知,整个事务依然回滚 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.required(user1); User2 user2 = new User2(); user2.setUserName("李四"); try { user2Service.requiredWithException(user2); } catch (Exception e) { System.out.println(e.getMessage()); } } @Override public void requiresNewNoTransactionAndOuterException() { /* 张三正常、李四正常 外部方法未开启事务,插入“张三”、“李四”的操作在自己的事务中独立运行,不受外部方法异常干扰 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.requiresNew(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.requiresNew(user2); throw new RuntimeException("外部方法抛出异常"); } @Override public void requiresNewNoTransactionAndInnerException() { /* 张三正常、李四回滚 外部方法未开启事务,插入“张三”、“李四”的操作在自己的事务中独立运行,所以“李四”方法中抛出异常回滚,“张三”不受影响 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.requiresNew(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.requiresNewWithException(user2); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void requiresNewWithTransactionAndOuterException() { /* 张三回滚、李四正常、王五正常 外部方法开启事务,张三和外部方法时同一事务,李四和王五分别在独立的新建事务中,当外围方法抛出异常时只回滚 和外部方法同一事务的方法,故张三回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.required(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.requiresNew(user2); User2 user3 = new User2(); user3.setUserName("王五"); user2Service.requiresNew(user3); throw new RuntimeException("外部方法抛出异常"); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void requiresNewWithTransactionAndInnerException() { /* 张三回滚、李四正常、王五回滚 外部方法开启事务,张三和外部方法时同一事务,李四和王五分别在独立的新建事务中,王五发生异常导致回滚时,外部方法感知异常导致回滚, 因此张三也回滚 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.required(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.requiresNew(user2); User2 user3 = new User2(); user3.setUserName("王五"); user2Service.requiresNewWithException(user3); } @Override public void requiresNewWithTransactionAndTryInnerException() { /* 张三正常、李四正常、王五回滚 外部方法开启事务,张三和外部方法时同一事务,李四和王五分别在独立的新建事务中,王五发生异常导致回滚,但异常被catch不会被 外部方法感知,外部事务不回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.required(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.requiresNew(user2); User2 user3 = new User2(); user3.setUserName("王五"); try { user2Service.requiresNewWithException(user3); } catch (Exception e) { System.out.println(e.getMessage()); } } @Override public void nestedNoTransactionAndOuterException() { /* 张三正常、李四正常 外部方法未开启事务,张三、李四在自己的事务中独立运行,外部方法的异常不会影响内部事务。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.nested(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.nested(user2); throw new RuntimeException("外部方法抛出异常"); } @Override public void nestedNoTransactionAndInnerException() { /* 张三正常、李四回滚 外部方法未开启事务,张三、李四在自己的事务中独立运行,因此李四抛出异常时只回滚李四,张三不受影响。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.nested(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.nestedWithException(user2); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void nestedWithTransactionAndOuterException() { /* 张三回滚、李四回滚 外部方法开启事务,内部事务为外部事务的子事务,故当外部事务回滚时内务事务也需回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.nested(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.nested(user2); throw new RuntimeException("外部方法抛出异常"); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void nestedWithTransactionAndInnerException() { /* 张三回滚、李四回滚 外部方法开启事务,内部事务为外部事务的子事务,内部方法抛出异常回滚,且外部方法感知到异常导致整体事务回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.nested(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.nestedWithException(user2); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void nestedWithTransactionAndTryInnerException() { /* 张三正常、李四回滚 外部方法开启事务,内部事务为外部事务的子事务,李四内部异常,外部事务可以对子事务单独回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.nested(user1); User2 user2 = new User2(); user2.setUserName("李四"); try { user2Service.nestedWithException(user2); } catch (Exception e) { System.out.println(e.getMessage()); } } @Override public void supportsNoTransactionAndOuterException() { /* 张三正常、李四正常 外部方法未开启事务,内部方法张三、李四也未开启事务,因为不存在事务所以无论外部方法或者内部方法抛出异常都不会回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.supports(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.supports(user2); throw new RuntimeException("外部方法抛出异常"); } @Override public void supportsNoTransactionAndInnerException() { /* 张三正常、李四正常 外部方法未开启事务,内部方法张三、李四也未开启事务,因为不存在事务所以无论外部方法或者内部方法抛出异常都不会回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.supports(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.supportsWithException(user2); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void supportsWithTransactionAndOuterException() { /* 张三回滚、李四回滚 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.supports(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.supports(user2); throw new RuntimeException("外部方法抛出异常"); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void supportsWithTransactionAndInnerException() { /* 张三回滚、李四回滚 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.supports(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.supportsWithException(user2); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void supportsWithTransactionAndTryInnerException() { /* 张三回滚、李四回滚 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.supports(user1); User2 user2 = new User2(); user2.setUserName("李四"); try { user2Service.supportsWithException(user2); } catch (Exception e) { System.out.println(e.getMessage()); } } @Override public void notSupportedNoTransactionAndOuterException() { /* 张三正常、李四正常 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.notSupported(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.notSupported(user2); throw new RuntimeException("外部方法抛出异常"); } @Override public void notSupportedNoTransactionAndInnerException() { /* 张三正常、李四正常 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.notSupported(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.notSupportedWithException(user2); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void notSupportedWithTransactionAndOuterException() { /* 张三正常、李四正常 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.notSupported(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.notSupported(user2); throw new RuntimeException("外部方法抛出异常"); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void notSupportedWithTransactionAndInnerException() { /* 张三正常、李四正常 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.notSupported(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.notSupportedWithException(user2); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void notSupportedWithTransactionAndTryInnerException() { /* 张三正常、李四正常 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.notSupported(user1); User2 user2 = new User2(); user2.setUserName("李四"); try { user2Service.notSupportedWithException(user2); } catch (Exception e) { System.out.println(e.getMessage()); } } @Override public void mandatoryNoTransaction() { /* 抛出异常: org.springframework.transaction.IllegalTransactionStateException: No existing transaction found for transaction marked with propagation 'mandatory' 外部方法未开启事务,导致内部张三方法执行时因为没有事务而直接抛出异常,内部方法没有机会执行。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.mandatory(user1); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void mandatoryWithTransactionAndOuterException() { /* 张三回滚、李四回滚 外部方法开启事务,张三和李四方法都加入外部事务。外部方法抛出异常,整个事务回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.mandatory(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.mandatory(user2); throw new RuntimeException("外部方法抛出异常"); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void mandatoryWithTransactionAndInnerException() { /* 张三回滚、李四回滚 外部方法开启事务,张三和李四方法都加入外部事务。内部方法抛出异常,整个事务回滚。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.mandatory(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.mandatoryWithException(user2); } @Override public void neverNoTransactionAndOuterException() { /* 张三正常、李四正常 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.never(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.never(user2); throw new RuntimeException("外部方法抛出异常"); } @Override public void neverNoTransactionAndInnerException() { /* 张三正常、李四正常 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.never(user1); User2 user2 = new User2(); user2.setUserName("李四"); user2Service.neverWithException(user2); } @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) @Override public void neverWithTransaction() { /* 抛出异常: org.springframework.transaction.IllegalTransactionStateException: Existing transaction found for transaction marked with propagation 'never' 外部方法开启了事务。内部插入“张三”方法执行时,由于存在事务而直接抛出异常,插入方法没有机会执行。 */ User1 user1 = new User1(); user1.setUserName("张三"); user1Service.never(user1); } }
42689d6c5bfe1812ce26d4a0a6a56ab310224603
fbce9ccf073aab02e0c7b3e58e444c1dda95f745
/19장-GUI프로그래밍/src/GUI/WindowExample8.java
0b57302112d054d01c7bad16a942209fc72ca8ca
[]
no_license
HoJun-Seo/Java-Study
5fc5e85d6f1bd41cd76da732fcc395b7e0e6f7ba
2350ee236b90eb64878f0395257b186c5258be25
refs/heads/master
2022-01-31T06:27:21.696178
2022-01-21T08:29:36
2022-01-21T08:29:36
241,072,710
0
0
null
null
null
null
UTF-8
Java
false
false
3,458
java
package GUI; import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.table.DefaultTableModel; /* * 테이블에 행을 추가하고 삭제하기 * 테이블을 통해 보이는 데이터는 테이블이 아니라 그와 별도로 존재하는 모델 안에 저장된다. 그렇기 때문에 테이블에 새로운 데이터를 추가하거나 삭제하는 일은 모두 모델을 가지고 해야 한다. * 하지만 테이블이 생성될 때 자동으로 생성되는 모델은 아주 간단한 모델이기 때문에 행을 추가하거나 삭제하는 기능이 없다. * 그렇기 때문에 행의 추가와 삭제를 하기 위해서는 프로그래머가 직접 그런 기능을 갖는 모델 객체를 만들어야 한다. * 행의 추가와 삭제가 가능한 모델은 jdk 라이브러리에 있는 javax.swing.table.DefaultTableModel class 를 이용해서 만들 수 있다. * 이렇게 생성된 모델을 JTable class 의 생성자 파라미터로 넘겨주면, 그 모델에 데이터를 저장하는 테이블이 생성된다. * 하지만 이 모델에는 아직 아무 데이터도 없기 때문에 데이터를 추가하는 일은 별도로 해야 한다. 그런 일은 DefaultTableModel class 의 addRow method 와 insertRow method 를 호출해서 할 수 있다. * 이 메소드는 둘 다 테이블에 행을 추가하는 메소드인데, addRow method 는 테이블의 마지막 행을 추가하고 insertRow method 는 지정된 위치에 행을 추가한다.(AddActionListener class 참조) * 테이블에 있는 특정 행을 삭제하기 위해서는 DefaultTableModel class 의 removeRow method 를 사용하면 된다. - model.remove(3); : 테이블의 3번째 위치에 있는 행을 삭제한다. */ public class WindowExample8 { public static void main(String[] args) { JFrame frame = new JFrame("참가자 명단 프로그램"); frame.setPreferredSize(new Dimension(400, 200)); frame.setLocation(500, 400); Container contentPane = frame.getContentPane(); //테이블을 생성해서 content pane 에 추가한다. String colNames[] = {"이름", "나이", "성별"}; DefaultTableModel model = new DefaultTableModel(colNames, 0); //colNames : 컬럼 이름이 있는 1차원 배열, 0 : 행의 수 JTable table = new JTable(model); //테이블을 생성해서 content pane 에 추가한다. contentPane.add(new JScrollPane(table), BorderLayout.CENTER); JPanel panel = new JPanel(); JTextField text1 = new JTextField(6); JTextField text2 = new JTextField(3); JTextField text3 = new JTextField(2); JButton button1 = new JButton("추가"); JButton button2 = new JButton("삭제"); panel.add(new JLabel("이름")); panel.add(text1); panel.add(new JLabel("나이")); panel.add(text2); panel.add(new JLabel("성별")); panel.add(text3); panel.add(button1); panel.add(button2); contentPane.add(panel, BorderLayout.SOUTH); button1.addActionListener(new AddActionListener(table, text1, text2, text3)); button2.addActionListener(new RemoveActionListener(table)); //추가, 삭제 버튼에 대한 리스너를 등록 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); } }
41848a31148140b5b76d9aa6e404a0423e4f042e
b7df447f32345ac58d9a50a47dbfde4eb15a17f4
/Udleveret Materiale/X1/src/x1/shooters/Hunter.java
aa872971e27a02766be084311a5ae723bde5ba5e
[]
no_license
cph-mn521/BatlleShipBot
f2df353c4e2fad4f3e88cd16ad5fd92329bb4660
345b278b7611c3febe0ade2adcaad8db7f701503
refs/heads/master
2020-04-09T23:57:34.128234
2018-12-14T02:13:35
2018-12-14T02:13:35
160,671,772
0
0
null
null
null
null
UTF-8
Java
false
false
5,039
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 x1.shooters; import battleship.interfaces.Fleet; import battleship.interfaces.Position; import battleship.interfaces.Ship; import java.util.ArrayList; import java.util.List; import java.util.Random; import x1.maps.IntMap; /** * * @author Tobias Grundtvig */ public class Hunter { private final Random rnd; private final IntMap shots; private final IntMap shipDist; private final List<Position> hits; private Position lastShot; private int numHits; private int startFleetSum; public Hunter(IntMap shots, Random rnd) { this.rnd = rnd; this.shots = shots; this.shipDist = new IntMap(shots.getXSize(), shots.getYSize()); this.hits = new ArrayList<>(); } public void startHunt(Position pos, Fleet fleet) { numHits = 1; startFleetSum = fleetSum(fleet); hits.clear(); hits.add(pos); } public Position getFireCoordinates(Fleet enemyShips) { generateShipDistribution(enemyShips); List<Position> bestCoordinates = shipDist.getHighest(); lastShot = bestCoordinates.get(rnd.nextInt(bestCoordinates.size())); return lastShot; } //Returns true if hunt is still on... public boolean hitFeedback(boolean hit, Fleet enemyShips) { shots.set(lastShot.x, lastShot.y, hit ? 1 : -1); if(hit) { ++numHits; hits.add(lastShot); int curFleetSum = fleetSum(enemyShips); if(curFleetSum < startFleetSum) { //Ship down... numHits -= startFleetSum - curFleetSum; if(numHits == 0) { //All hits are accounted for //Mark hits for(Position p : hits) { shots.set(p.x, p.y, -2); } return false; } startFleetSum = curFleetSum; } } return true; } private int fleetSum(Fleet fleet) { int res = 0; for(Ship s : fleet) { res += s.size(); } return res; } private void generateShipDistribution(Fleet enemyShips) { shipDist.clear(); for (Ship s : enemyShips) { //Horizontal int maxX = shipDist.getXSize() - s.size(); int maxY = shipDist.getYSize() - 1; for (int y = 0; y <= maxY; ++y) { for (int x = 0; x <= maxX; ++x) { boolean canPlace = true; int hitCount = 0; for (int i = 0; i < s.size(); ++i) { int val = shots.get(x + i, y); if(val < 0) { canPlace = false; break; } if(val > 0) { ++hitCount; } } if (canPlace) { for (int i = 0; i < s.size(); ++i) { int val = shots.get(x + i, y); if(val == 0) { shipDist.add(x + i, y, hitCount); } } } } } //Horizontal maxX = shipDist.getXSize() - 1; maxY = shipDist.getYSize() - s.size(); for (int y = 0; y <= maxY; ++y) { for (int x = 0; x <= maxX; ++x) { boolean canPlace = true; int hitCount = 0; for (int i = 0; i < s.size(); ++i) { int val = shots.get(x, y + i); if(val < 0) { canPlace = false; break; } if(val > 0) { ++hitCount; } } if (canPlace) { for (int i = 0; i < s.size(); ++i) { int val = shots.get(x, y + i); if(val == 0) { shipDist.add(x, y + i, hitCount); } } } } } } } }
b5c3129a6306469ed6177e148b75136945a255db
e510dfb28994ae4972edcfc31e5b57e8d98681cb
/core/java/com/android/internal/util/aosp/DUSystemReceiver.java
e6babdf4d7d6821f89144027c8ecd661c5629e13
[ "LicenseRef-scancode-unicode", "Apache-2.0" ]
permissive
MZO9400/platform_frameworks_base
299f611a95e9cd196fea44888056dbbdb8e0ed78
a974ef4575c826f530feb9b38e212a97eb3933c8
refs/heads/aosp-6.0-test-caf
2021-09-30T13:52:36.004297
2017-01-16T18:49:55
2017-04-11T16:36:03
82,053,095
0
0
null
2017-02-15T11:24:17
2017-02-15T11:24:17
null
UTF-8
Java
false
false
2,325
java
/* * Copyright (C) 2015-2016 The TeamEos Project * * Author: Randall Rushing <[email protected]> * * 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. * * A BroadcastReceiver that filters out broadcasts from non-system * related processes. Subclasses can allow additional broadcasting * packages by overriding onExemptBroadcast(Context context, String packageName) */ package com.android.internal.util.aosp; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public abstract class DUSystemReceiver extends BroadcastReceiver { protected abstract void onSecureReceive(Context context, Intent intent); protected boolean onExemptBroadcast(Context context, String packageName) { return false; } @Override public final void onReceive(Context context, Intent intent) { if (context == null || intent == null) { return; } if (isBroadcastFromSystem(context)) { onSecureReceive(context, intent); } } private boolean isBroadcastFromSystem(Context context) { String packageName = context.getPackageName(); if (packageName == null && android.os.Process.SYSTEM_UID == context.getApplicationInfo().uid) { packageName = "android"; } if (packageName == null) { return false; } if (packageName.equals("com.android.systemui") || (packageName.equals("com.android.keyguard") || (packageName.equals("android") || (context.getApplicationInfo().uid == android.os.Process.SYSTEM_UID)))) { return true; } if (onExemptBroadcast(context, packageName)) { return true; } return false; } }
e639ef42a10aff2f3a99c39ad14c4f81392f1304
52edb66b2d55c615009920781d89eee4251501ac
/app/src/test/java/com/kiarra/homeworkroom/ExampleUnitTest.java
39a366553a6c8ba7618c8187b5ad978fed8a0de3
[]
no_license
KeeksMcGee/HomeworkRoom
a85373f09edbb28d2179334fd7b11fa941bd4aa2
45cc12fbc2d4bd559e4a0cf1b8d6f0b3b3001859
refs/heads/master
2022-05-24T09:43:42.423306
2020-04-29T17:42:36
2020-04-29T17:42:36
259,998,227
0
0
null
null
null
null
UTF-8
Java
false
false
384
java
package com.kiarra.homeworkroom; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
ddb7c71e7e2790036bde82b3903424b27b87613b
fd4939653e516ad6a48df572e52aaf496ede189b
/src/exam_mgmt_ams/StudentHome.java
066738fe5b99a14af25913b4fc151a4727d7a9c9
[]
no_license
aadarsha10/QuizApp_Java
7031524ebcc76ad421910f6dea04113fac502157
fd07aaa81474b250b8b40303d78c3627bf98fca2
refs/heads/master
2023-04-20T06:44:59.913136
2021-05-09T13:19:25
2021-05-09T13:19:25
365,757,087
0
0
null
null
null
null
UTF-8
Java
false
false
18,155
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 exam_mgmt_ams; import java.awt.*; import java.awt.event.*; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.sql.*; import java.util.ArrayList; import java.util.Enumeration; import java.util.Random; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; import javax.swing.*; import org.w3c.dom.events.EventListener; public class StudentHome extends JFrame implements ActionListener { private final JTextField stdNameText; JButton startBtn, viewResultbtn, btnNext, btnPrev; Database db; Connection cn; PreparedStatement pstmt; Statement st; String Qry, examName, ans; ResultSet rs; JComboBox<String> examCombo; int timecounter = 19, ss = 60, current = -1, currentQno = 1; long idg, eidg, qidg; JLabel timeLabel, questionLabel, Tcounter; Random random; JRadioButton radio_ans[] = new JRadioButton[5]; long score = 0, questionAttempted = 0, correctAttempts = 0, wrongAttempts = 0, totalMarks = 0, achievedMarks = 0, correctAns = 0; long totalQuestions, negtiveMarks, marksForEach; ButtonGroup Rdgroup; Timer timer; boolean chk = false, rchk = false; public StudentHome() { BufferedImage img = null; try { img = ImageIO.read(new File("D:\\Java projects\\Exam_Mgmt_AMS\\src\\exam_mgmt_ams\\IMG_2243.JPG")); } catch (IOException e) { // e.printStackTrace(); } Image dimg = img.getScaledInstance(1075, 777, Image.SCALE_SMOOTH); ImageIcon imageIcon = new ImageIcon(dimg); setContentPane(new JLabel(imageIcon)); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // setExtendedState(JFrame.MAXIMIZED_BOTH); setSize(1075, 777); setLayout(null); setTitle("Softwarica Exam Management System. "); JLabel examLabel = new JLabel("Exam Name: "); examLabel.setFont(new Font("Arial", Font.PLAIN, 15)); examLabel.setBounds(10, 25, 162, 30); add(examLabel); examCombo = new JComboBox<>(); examCombo.setBounds(210, 25, 238, 30); add(examCombo); JLabel stdNameLabel = new JLabel("UserName: "); stdNameLabel.setFont(new Font("Arial", Font.PLAIN, 15)); stdNameLabel.setBounds(10, 65, 163, 30); add(stdNameLabel); // stdNameText = new JTextField(); stdNameText.setColumns(10); stdNameText.setBounds(214, 65, 238, 29); add(stdNameText); // startBtn = new JButton("Start Test"); startBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { current=0; current++; loadTest(); startTime(); } }); startBtn.setFont(new Font("Arial", Font.PLAIN, 12)); startBtn.setBounds(203, 120, 126, 40); add(startBtn); // display questions and answers radio buttons questionLabel = new JLabel("Question:"); questionLabel.setFont(new Font("Arial", Font.PLAIN, 15)); questionLabel.setBounds(11, 165, 617, 30); add(questionLabel); //radio buttons for answers Rdgroup = new ButtonGroup(); for (int i = 0; i < 5; i++) { radio_ans[i] = new JRadioButton(); add(radio_ans[i]); Rdgroup.add(radio_ans[i]); } btnNext = new JButton("Next"); btnNext.addActionListener(this); btnNext.setFont(new Font("Arial", Font.PLAIN, 12)); btnNext.setBounds(230, 350, 120, 40); add(btnNext); btnPrev = new JButton("Prev"); btnPrev.addActionListener(this); btnPrev.setFont(new Font("Arial", Font.PLAIN, 12)); btnPrev.setBounds(70, 350, 120, 40); add(btnPrev); timeLabel = new JLabel("Time Remaining: " + "mm:ss"); timeLabel.setFont(new Font("Arial", Font.PLAIN, 15)); timeLabel.setBounds(650, 53, 190, 30); add(timeLabel); viewResultbtn = new JButton("View Result"); viewResultbtn.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { finalResults(); new ResultView().setVisible(true); close(); } } }); viewResultbtn.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { finalResults(); new ResultView().setVisible(true); close(); } }); viewResultbtn.setFont(new Font("Arial", Font.PLAIN, 12)); viewResultbtn.setEnabled(true); viewResultbtn.setBounds(400, 395, 112, 30); add(viewResultbtn); random = new Random(); fload(); } //form load for test public final void fload() { //form load// score = questionAttempted = correctAttempts = wrongAttempts = totalMarks = achievedMarks = 0; correctAns = 0; totalQuestions = negtiveMarks = marksForEach = 0; currentQno = 1; ss = 60; chk = false; int mid=0; try { db = new Database(); cn = db.getConnection(); pstmt = cn.prepareStatement("select module_name from module order by module_name"); rs = pstmt.executeQuery(); examCombo.removeAllItems(); examCombo.addItem(""); while (rs.next()) { examCombo.addItem(rs.getString(1)); //mid= rs.getInt("m_id"); } } catch (SQLException ex) { System.err.println(ex.getMessage()); } //return mid; } void loadTest() //function to set next/previous question { radio_ans[4].setSelected(true); try { Database d = new Database(); ArrayList<String> arr = new ArrayList<>(); // pstmt = d.conn.prepareStatement("select * from qanda where (moduleN=?) order by rand()"); // pstmt.setString(1,((examCombo.getSelectedItem()).toString()) ); // pstmt.executeQuery(); if (current==0) { pstmt = d.conn.prepareStatement("select * from qanda where (moduleN=?) order by rand()"); pstmt.setString(1, ((examCombo.getSelectedItem()).toString())); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { arr.add(rs.getString("question")); arr.add(rs.getString("opt_1")); arr.add(rs.getString("opt_2")); arr.add(rs.getString("opt_3")); arr.add(rs.getString("opt_4")); arr.add(rs.getString("ans_value")); } questionLabel.setText(currentQno + "." + arr.get(0)); radio_ans[0].setText(arr.get(1)); radio_ans[1].setText(arr.get(2)); radio_ans[2].setText(arr.get(3)); radio_ans[3].setText(arr.get(4)); progress(); //viewResultbtn.setVisible(true); } if (current == 1) { pstmt = d.conn.prepareStatement("select * from qanda where (moduleN=?) order by rand()"); pstmt.setString(1, ((examCombo.getSelectedItem()).toString())); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { arr.add(rs.getString("question")); arr.add(rs.getString("opt_1")); arr.add(rs.getString("opt_2")); arr.add(rs.getString("opt_3")); arr.add(rs.getString("opt_4")); arr.add(rs.getString("ans_value")); } questionLabel.setText(currentQno + "." + arr.get(0)); radio_ans[0].setText(arr.get(1)); radio_ans[1].setText(arr.get(2)); radio_ans[2].setText(arr.get(3)); radio_ans[3].setText(arr.get(4)); progress(); } if (current == 2) { pstmt = d.conn.prepareStatement("select * from qanda where (moduleN=?) order by rand()"); //String sql = "select * from qanda where q_id=1"; pstmt.setString(1, ((examCombo.getSelectedItem()).toString())); //pstmt = d.conn.prepareStatement(sql); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { arr.add(rs.getString("question")); arr.add(rs.getString("opt_1")); arr.add(rs.getString("opt_2")); arr.add(rs.getString("opt_3")); arr.add(rs.getString("opt_4")); arr.add(rs.getString("ans_value")); } questionLabel.setText(currentQno + "." + arr.get(0)); radio_ans[0].setText(arr.get(1)); radio_ans[1].setText(arr.get(2)); radio_ans[2].setText(arr.get(3)); radio_ans[3].setText(arr.get(4)); progress(); } if (current == 3) { pstmt = d.conn.prepareStatement("select * from qanda where (moduleN=?) order by rand()"); //String sql = "select * from qanda where q_id=1"; pstmt.setString(1, ((examCombo.getSelectedItem()).toString())); //pstmt = d.conn.prepareStatement(sql); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { arr.add(rs.getString("question")); arr.add(rs.getString("opt_1")); arr.add(rs.getString("opt_2")); arr.add(rs.getString("opt_3")); arr.add(rs.getString("opt_4")); arr.add(rs.getString("ans_value")); } questionLabel.setText(currentQno + "." + arr.get(0)); radio_ans[0].setText(arr.get(1)); radio_ans[1].setText(arr.get(2)); radio_ans[2].setText(arr.get(3)); radio_ans[3].setText(arr.get(4)); progress(); } if (current == 4) { pstmt = d.conn.prepareStatement("select * from qanda where (moduleN=?) order by rand()"); //String sql = "select * from qanda where q_id=1"; pstmt.setString(1, ((examCombo.getSelectedItem()).toString())); //pstmt = d.conn.prepareStatement(sql); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { arr.add(rs.getString("question")); arr.add(rs.getString("opt_1")); arr.add(rs.getString("opt_2")); arr.add(rs.getString("opt_3")); arr.add(rs.getString("opt_4")); arr.add(rs.getString("ans_value")); } questionLabel.setText(currentQno + "." + arr.get(0)); radio_ans[0].setText(arr.get(1)); radio_ans[1].setText(arr.get(2)); radio_ans[2].setText(arr.get(3)); radio_ans[3].setText(arr.get(4)); if (current>4) { finalResults(); } progress(); btnNext.setEnabled(false); viewResultbtn.setVisible(true); } for (int i = 200, j = 0; i <= 310; i += 30, j++) { radio_ans[j].setBounds(20, i, 535, 25); } } catch (Exception e) { System.out.println("setnext\n" + e); } } //timer start and keep track public void startTime() { timecounter = 19; ActionListener timerListener = (ActionEvent e) -> { if (timecounter > 0 || ss > 0) { if (ss > 0) { ss--; } else { ss = 60; timecounter--; } } else { ss = 0; if (!chk) { JOptionPane.showMessageDialog(null, "Time up!!"); finalResults(); } else { finalResults(); } timer.stop(); } String s = Integer.toString(timecounter); String p = Integer.toString(ss); timeLabel.setText(s + ":" + p); }; timer = new Timer(1000, timerListener); //timer from the util package to setup the timer timer.setInitialDelay(0); timer.start(); } //calculating marks public void progress()//radio_Ans1, radio_Ans2, radio_Ans3, radio_Ans4;ans { negtiveMarks = 1; try { String ansQry = "select ans_value from qanda where (moduleN='?') and q_id="+(current)+""; pstmt.setString(1,((examCombo.getSelectedItem()).toString()) ); pstmt = db.conn.prepareStatement(ansQry); rs = pstmt.executeQuery(ansQry); if(rs.next()){ correctAns=rs.getInt("ans_value"); if (radio_ans[0].isSelected() && correctAns == 1) { score = score + 1; correctAttempts++; System.out.println(" ans 1"); } else if (radio_ans[1].isSelected() && correctAns == 2) { score = score + 1; correctAttempts++; System.out.println(" ans 2"); } else if (radio_ans[2].isSelected() && correctAns == 3) { score = score + 1; correctAttempts++; System.out.println(" ans 3"); } else if (radio_ans[3].isSelected() && correctAns == 4) { score = score + 1; correctAttempts++; System.out.println(" ans 4"); } else { wrongAttempts++; score = score - 1; } System.out.println(" Current score =" + score); questionAttempted++; } } catch (Exception ex) { System.err.println(ex.getMessage()); } } //displaying Final results public void finalResults() { String msg = "Result!\n 1.score=" + score + "\n 2.questions attempted=" + questionAttempted + "\n 3.correctly attempted=" + correctAttempts + "\n 4.wrong attempts=" + wrongAttempts + "\nb5.total marks=" + totalMarks + ""; JOptionPane.showMessageDialog(null, msg); System.out.print(msg); // try { // Qry = "update student SET(examName,questions_attempted,correctAttempts,wrong_attempts,total_marks ,final_marks ) " // + "values(" + examCombo.getSelectedItem().toString().toLowerCase() + "'," + questionAttempted + "," + correctAttempts + "," + wrongAttempts + "," + totalMarks + "," + score + " " // + "where username='" + stdNameText.getText().toLowerCase() + ")"; // st.executeUpdate(Qry); // // } catch (SQLException ex) { //// System.err.print("Exception: "); // System.err.println(ex.getMessage()); // } } public ArrayList getAns_value() { ArrayList<Integer> C_ans = new ArrayList<Integer>(); try { Database db = new Database(); String ansQry; ansQry = "select ans_value from qanda where moduleN='java' and q_id="+currentQno+""; pstmt = db.conn.prepareStatement(ansQry); rs = pstmt.executeQuery(ansQry); while (rs.next()) { C_ans.add(rs.getInt("ans_value")); } } catch (Exception e) { } return C_ans; } public void close() { this.dispose(); } public static void main(String[] args) { new StudentHome().setVisible(true); } public void actionPerformed(ActionEvent ae) { // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. if (ae.getSource() == btnNext) { current++; currentQno += 1; loadTest(); // progress(); } if (ae.getSource() == btnPrev) { current--; currentQno -= 1; loadTest(); } } } //} //*******// //Test form loading // public void loadTest() { // try { // int totalRec = 0; // int randomNumber = 0; // if (firstIncheck) { // firstIncheck = false; // System.out.println("first call"); // } else { // rchk = false; // if (radio_Ans1.isSelected()) { // rchk = true; // } // if (radio_Ans2.isSelected()) { // rchk = true; // } // if (radio_Ans3.isSelected()) { // rchk = true; // } // if (radio_Ans4.isSelected()) { // rchk = true; // } // if (!rchk) { // JOptionPane.showMessageDialog(null, "Please select an answer...!"); // return; // } // }
f49bda9266297e96ef9131457a40582ae61a2db6
3f12ee1ed8799150b91ca889317d4e4641cdb495
/app/src/main/java/com/gank/chen/adapter/MainArticleAdapter.java
77258672381416566e6f13a2945003c9814bae09
[]
no_license
7399385/WanAndroid
0988adf305e6588cdc824f7fdd5c5641933466f3
1aaf2a78004c0da16484da52dd9cfbd90aafcec0
refs/heads/master
2020-04-28T08:30:10.219732
2018-11-16T10:13:18
2018-11-16T10:13:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,146
java
package com.gank.chen.adapter; import android.text.Html; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.gank.chen.R; import com.gank.chen.mvp.model.ArticleListModel; import com.gank.chen.util.CommenUtil; import java.util.List; /** * @author chenbo */ public class MainArticleAdapter extends BaseQuickAdapter<ArticleListModel, BaseViewHolder> { public MainArticleAdapter(List<ArticleListModel> data) { super(R.layout.item_home_artical_list, data); } @Override protected void convert(BaseViewHolder helper, ArticleListModel item) { helper.setText(R.id.tv_title, Html.fromHtml(item.getTitle())) .setText(R.id.tv_user_name, item.getAuthor()) .setText(R.id.tv_type, item.getNiceDate()) .setVisible(R.id.iv_new, item.isFresh()) .addOnClickListener(R.id.iv_like); if (item.isCollect()) { helper.setImageResource(R.id.iv_like, R.mipmap.icon_like); } else { helper.setImageResource(R.id.iv_like, R.mipmap.icon_unlike); } } }
6b4ea332c95e3ea55711e8b990f84c021a3d7c5f
1f466e1f7edc54a55802461cf36003942cdbb315
/src/test/java/com/yuanfy/demo/concurrent/CopyOnWriteArrayListTest.java
20d1d0300d2d4329f0fa286a33538877607cf90c
[]
no_license
YuanFY/learning-demo
703e4af32c8e9620389192703140e1649c043d54
949d3a928006e3907e7f2bbe16f9feea0d6342ba
refs/heads/master
2021-06-16T23:57:43.105655
2021-04-05T13:31:38
2021-04-05T13:31:38
183,239,875
0
0
null
null
null
null
UTF-8
Java
false
false
1,272
java
package com.yuanfy.demo.concurrent; import org.junit.Test; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import static org.hamcrest.CoreMatchers.hasItem; import static org.junit.Assert.*; /** * @author maple.yuan * @date 2020-04-12 15:59 */ public class CopyOnWriteArrayListTest { @Test public void test() { CopyOnWriteArrayList<Integer> numbers = new CopyOnWriteArrayList<>(new Integer[]{1, 3, 5, 78}); Iterator<Integer> iterator = numbers.iterator(); numbers.add(100); List<Integer> result = new LinkedList<>(); iterator.forEachRemaining(result::add); System.out.println(result); Iterator<Integer> iterator2 = numbers.iterator(); numbers.remove(3); List<Integer> result2 = new LinkedList<>(); iterator2.forEachRemaining(result2::add); System.out.println(result2); } @Test public void test_remove(){ CopyOnWriteArrayList<Integer> numbers = new CopyOnWriteArrayList<>(new Integer[]{1, 3, 5, 78}); Iterator<Integer> integerIterator = numbers.iterator(); while (integerIterator.hasNext()) { integerIterator.remove(); } } }
529cccc440a5d7bc2d03ab6b35c9b9a674d0b1f7
0c460ed8539a546da595abb630280e3bade9ee73
/src/main/java/me/skylerlayne/controller/MessageController.java
29fe1291daf3a44e2cfc1a2e5366e0f6f727058e
[ "Apache-2.0" ]
permissive
skylerto/apache-camel-kafka
3091319bf9de996ee721aadf7525f91b23d0ee73
5be411c25674957c3a89a047cec7f3f7ddf99e94
refs/heads/master
2021-01-13T09:42:32.173363
2018-03-06T13:30:14
2018-03-06T13:30:14
69,769,649
4
3
null
2018-03-06T13:30:15
2016-10-01T23:42:57
Java
UTF-8
Java
false
false
2,670
java
package me.skylerlayne.controller; import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.camel.CamelContext; import org.apache.camel.ConsumerTemplate; import org.apache.camel.EndpointInject; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.RouteBuilder; import org.codehaus.jackson.map.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; 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 me.skylerlayne.model.Notification; @Controller @ResponseBody @RequestMapping("/message") public class MessageController { ObjectMapper mapper = new ObjectMapper(); @Autowired CamelContext camelContext; @Autowired @Qualifier("KafkaRouteProducer") RouteBuilder kafkaRouteProducer; @Autowired @Qualifier("KafkaRouteConsumer") RouteBuilder kafkaRouteConsumer; @EndpointInject(uri = "direct:kafkaRoute") ProducerTemplate kafkaProducer; ConsumerTemplate kafkaConsumer; @PostConstruct public void setup() { try { camelContext.addRoutes(kafkaRouteProducer); camelContext.addRoutes(kafkaRouteConsumer); } catch (Exception e) { e.printStackTrace(); } } /** * GET to produce a message for Kafaka. * * @param request * the {@link HttpServletRequest} object. * @param response * the {@link HttpServletResponse} object. */ @RequestMapping(method = RequestMethod.GET) public void get(HttpServletRequest request, HttpServletResponse response) { try { kafkaProducer.sendBody("direct:kafkaRoute", "This is a message from the /message route!"); } catch (Exception exception) { exception.printStackTrace(); } } /** * POST a notification, send it as a message to Kafka. * * @param request * the {@link HttpServletRequest} object. * @param response * the {@link HttpServletResponse} object. * @param notification * the {@link Notification} to be posted. */ @RequestMapping(method = RequestMethod.POST) public void post(HttpServletRequest request, HttpServletResponse response, @RequestBody Notification notification) { try { kafkaProducer.sendBody("direct:kafkaRoute", mapper.writeValueAsString(notification)); } catch (Exception exception) { exception.printStackTrace(); } } }
1771318118f8e840582dda33e095e9b83eed2302
9e813a0872e330fa9a60e822763b708ef4dd8a94
/app-server/app-promotion/src/test/java/com/nisum/promotion/test/controller/DiscountControllerTest.java
23574aef9b5e1711002b057593c73f5bd271f9f6
[]
no_license
atanveer-nisum-com/current_integration
91dd34b1d263cedb6d9a9ca0d7a99736e284e3a3
3ff86ba840165da6fc3b104e80059028baf6f9cd
refs/heads/master
2021-05-02T09:55:27.609575
2018-02-08T16:21:22
2018-02-08T16:21:22
120,785,029
0
0
null
null
null
null
UTF-8
Java
false
false
10,076
java
/** * */ package com.nisum.promotion.test.controller; import com.nisum.common.exception.rest.RestException; import com.nisum.promotion.controller.DiscountController; import com.nisum.promotion.dto.CategoryPromotion; import com.nisum.promotion.dto.ProductCategoryPromotion; import com.nisum.promotion.dto.ProductPromotion; import com.nisum.promotion.service.CategoryDiscountService; import com.nisum.promotion.service.OrderDiscountService; import com.nisum.promotion.service.ProductDiscountService; import com.nisum.promotion.test.dataProvider.DiscountCategoryControllerDataProviderTest; import com.nisum.promotion.test.dataProvider.DiscountControllerDataProviderTest; import com.nisum.promotion.test.mock.models.MockModelsFactory; import org.junit.Test; import org.mockito.Matchers; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.RequestBuilder; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import java.util.Arrays; import java.util.List; import java.util.Set; import static org.hamcrest.Matchers.instanceOf; import static org.junit.Assert.*; import static org.mockito.Matchers.anyDouble; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.asyncDispatch; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * @author Nisum Pakistan * * Test Case for Mock Service Product Discount * */ @WebMvcTest(value = DiscountController.class, secure = false) public class DiscountControllerTest extends BaseControllerTest { @MockBean private OrderDiscountService orderDiscountService; @MockBean private ProductDiscountService productDiscountService; @MockBean private CategoryDiscountService categoryDiscountService; private static final String GET_PRODUCTS_PROMOTIONS_URL = DiscountControllerDataProviderTest.getPromotion_URL(); private static final String[] ProductIDs=DiscountControllerDataProviderTest.getProductIDs(); private static final String GET_CATEGORY_PROMOTIONS_URL = DiscountCategoryControllerDataProviderTest.getPromotion_URL(); private static final String GET_ORDER_DISCOUNT_URL = DiscountControllerDataProviderTest.getOrder_discount_url(); private static final String[] CATEGORIES_NAME = DiscountCategoryControllerDataProviderTest.getCategoriesName(); private static final String GET_CATEGORIES_PRODUCTS_PROMOTIONS_URL = DiscountControllerDataProviderTest.getCategories_product_promotion_URL(); @Test public void ShouldReturnProductPromotions() { //Get list of Product Promotions objects return to MockRequest List<ProductPromotion> ListProductPromotion= MockModelsFactory.getListPromotionProducts(); assertNotNull(ListProductPromotion); //Test when any String array come should return Products when(productDiscountService.getDiscountByProducts(Matchers.<String[]>any())).thenReturn(ListProductPromotion); RequestBuilder requestBuilder = MockMvcRequestBuilders .get(GET_PRODUCTS_PROMOTIONS_URL+ProductIDs) .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON); //Perform mock Spring MVC test. MvcResult result; try { result = mvc.perform(requestBuilder).andExpect(request().asyncStarted()).andReturn(); mvc.perform(asyncDispatch(result)).andExpect(status().isOk()) .andExpect(jsonPath(DiscountControllerDataProviderTest.getJsonPathAttribute()) .value(DiscountControllerDataProviderTest.getJsonPathVerifyValue())).andReturn(); } catch (Exception e) { e.printStackTrace(); } } @Test public void shouldThrowExceptionWhenNoProductsPromotionFound() { when(productDiscountService.getDiscountByProducts(Matchers.<String[]>any())) .thenThrow(new EmptyResultDataAccessException(1)); MvcResult result = null; try { result = mvc.perform(MockMvcRequestBuilders .get(GET_PRODUCTS_PROMOTIONS_URL + Arrays.toString(ProductIDs)) .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)) .andExpect(request().asyncStarted()) .andExpect(request().asyncResult(instanceOf(RestException.class))) .andReturn(); mvc.perform(asyncDispatch(result)).andExpect(status().isNotFound()); } catch (Exception e) { if (e.getCause() instanceof RestException) { assertEquals(((RestException) e.getCause()).getHttpStatus(), HttpStatus.NOT_FOUND); } } } @Test public void ShouldReturnCategoryProductPromotions() throws Exception { //Get list of Category Promotions objects return to MockRequest List<CategoryPromotion> listCategoryPromotion= MockModelsFactory.getListPromotionCategory(); assertNotNull(listCategoryPromotion); //Test when any String array come should return Category default discount when(categoryDiscountService.getDiscountByCategories(Matchers.<Set<String>>any())).thenReturn(listCategoryPromotion); RequestBuilder requestBuilder = MockMvcRequestBuilders .get(GET_CATEGORY_PROMOTIONS_URL+CATEGORIES_NAME) .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON); //Perform mock Spring MVC test. MvcResult result =mvc.perform(requestBuilder).andReturn(); mvc.perform(asyncDispatch(result)) .andExpect(status().isOk()) .andExpect(jsonPath(DiscountCategoryControllerDataProviderTest.getJsonPathAttribute()).value(DiscountCategoryControllerDataProviderTest.getJsonPathVerifyValue())); } @Test public void shouldThrowExceptionWhenNoCategoryPromotionFound() { when(categoryDiscountService.getDiscountByCategories(Matchers.<Set<String>>any())) .thenThrow(new EmptyResultDataAccessException(1)); try { MvcResult result = mvc.perform(MockMvcRequestBuilders .get(GET_CATEGORY_PROMOTIONS_URL + Arrays.toString(CATEGORIES_NAME)) .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON)).andExpect(request().asyncStarted()).andReturn(); mvc.perform(asyncDispatch(result)).andExpect(status().isNotFound()); } catch (Exception e) { if (e.getCause() instanceof RestException) { assertEquals(((RestException) e.getCause()).getHttpStatus(), HttpStatus.NOT_FOUND); } } } @Test public void ShouldReturnOrderDiscount() throws Exception { //Test when any Double array come should return Category discount amount when(orderDiscountService.getOrderDiscount(anyDouble())).thenReturn(DiscountControllerDataProviderTest.getOrderDisount()); RequestBuilder requestBuilder = MockMvcRequestBuilders .get(GET_ORDER_DISCOUNT_URL) .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON); //Perform mock Spring MVC test. MvcResult result = mvc.perform(requestBuilder).andReturn(); mvc.perform(asyncDispatch(result)) .andExpect(status().isOk()); Double a = DiscountControllerDataProviderTest.getOrderDisount(); Boolean Returncondition= Double.parseDouble(result.getAsyncResult().toString())==DiscountControllerDataProviderTest.getOrderDisount(); assertTrue(Returncondition); } @Test public void shouldThrowExceptionWhenNoOrderDiscountFound() { when(orderDiscountService.getOrderDiscount(anyDouble())).thenThrow(new EmptyResultDataAccessException(1)); MvcResult result = null; try { result = mvc.perform(MockMvcRequestBuilders.get(GET_ORDER_DISCOUNT_URL) .accept(MediaType.APPLICATION_JSON).contentType(MediaType.APPLICATION_JSON)).andReturn(); mvc.perform(asyncDispatch(result)).andExpect(status().isNotFound()); } catch (Exception e) { if (e.getCause() instanceof RestException) { assertEquals(((RestException) e.getCause()).getHttpStatus(), HttpStatus.NOT_FOUND); } } } @Test public void ShouldReturnPromotionsByProductAndCategory() throws Exception { //Get list of Product Promotions objects return to MockRequest List<ProductCategoryPromotion> ListCategoriesProductPromotion= MockModelsFactory.getListPromotionCategoriesProducts(); assertNotNull(ListCategoriesProductPromotion); //Test when any String array come should return Products when(productDiscountService.getDiscountByProductAndCategories(Matchers.<String[]>any())).thenReturn(ListCategoriesProductPromotion); RequestBuilder requestBuilder = MockMvcRequestBuilders .get(GET_CATEGORIES_PRODUCTS_PROMOTIONS_URL+ProductIDs) .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON); //Perform mock Spring MVC test. MvcResult result = mvc.perform(requestBuilder).andReturn(); mvc.perform(asyncDispatch(result)) .andExpect(status().isOk()) .andExpect(jsonPath(DiscountControllerDataProviderTest.getJsonPathAttribute()).value(DiscountControllerDataProviderTest.getJsonPathVerifyValue())); } @Test public void shouldThrowExceptionWhenNoPromotionByProductAndCategoryFound() { when(productDiscountService.getDiscountByProductAndCategories(Matchers.<String[]>any())) .thenThrow(new EmptyResultDataAccessException(1)); try { MvcResult result = mvc.perform(MockMvcRequestBuilders .get(GET_CATEGORIES_PRODUCTS_PROMOTIONS_URL + Arrays.toString(ProductIDs)) .accept(MediaType.APPLICATION_JSON).contentType(MediaType.APPLICATION_JSON)).andReturn(); mvc.perform(asyncDispatch(result)).andExpect(status().isNotFound()); } catch (Exception e) { if (e.getCause() instanceof RestException) { assertEquals(((RestException) e.getCause()).getHttpStatus(), HttpStatus.NOT_FOUND); } } } }
a51c0a0db7c086ef45a75ea34db7f738550732b9
97fd02f71b45aa235f917e79dd68b61c62b56c1c
/src/main/java/com/tencentcloudapi/ess/v20201111/models/DeleteStaffsResult.java
9cb5d8df450cd3b030760d01a13019465a44d0f0
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-java
7df922f7c5826732e35edeab3320035e0cdfba05
09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec
refs/heads/master
2023-09-04T10:51:57.854153
2023-09-01T03:21:09
2023-09-01T03:21:09
129,837,505
537
317
Apache-2.0
2023-09-13T02:42:03
2018-04-17T02:58:16
Java
UTF-8
Java
false
false
4,247
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.ess.v20201111.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class DeleteStaffsResult extends AbstractModel{ /** * 删除员工的成功数据 注意:此字段可能返回 null,表示取不到有效值。 */ @SerializedName("SuccessEmployeeData") @Expose private SuccessDeleteStaffData [] SuccessEmployeeData; /** * 删除员工的失败数据 注意:此字段可能返回 null,表示取不到有效值。 */ @SerializedName("FailedEmployeeData") @Expose private FailedDeleteStaffData [] FailedEmployeeData; /** * Get 删除员工的成功数据 注意:此字段可能返回 null,表示取不到有效值。 * @return SuccessEmployeeData 删除员工的成功数据 注意:此字段可能返回 null,表示取不到有效值。 */ public SuccessDeleteStaffData [] getSuccessEmployeeData() { return this.SuccessEmployeeData; } /** * Set 删除员工的成功数据 注意:此字段可能返回 null,表示取不到有效值。 * @param SuccessEmployeeData 删除员工的成功数据 注意:此字段可能返回 null,表示取不到有效值。 */ public void setSuccessEmployeeData(SuccessDeleteStaffData [] SuccessEmployeeData) { this.SuccessEmployeeData = SuccessEmployeeData; } /** * Get 删除员工的失败数据 注意:此字段可能返回 null,表示取不到有效值。 * @return FailedEmployeeData 删除员工的失败数据 注意:此字段可能返回 null,表示取不到有效值。 */ public FailedDeleteStaffData [] getFailedEmployeeData() { return this.FailedEmployeeData; } /** * Set 删除员工的失败数据 注意:此字段可能返回 null,表示取不到有效值。 * @param FailedEmployeeData 删除员工的失败数据 注意:此字段可能返回 null,表示取不到有效值。 */ public void setFailedEmployeeData(FailedDeleteStaffData [] FailedEmployeeData) { this.FailedEmployeeData = FailedEmployeeData; } public DeleteStaffsResult() { } /** * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, * and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. */ public DeleteStaffsResult(DeleteStaffsResult source) { if (source.SuccessEmployeeData != null) { this.SuccessEmployeeData = new SuccessDeleteStaffData[source.SuccessEmployeeData.length]; for (int i = 0; i < source.SuccessEmployeeData.length; i++) { this.SuccessEmployeeData[i] = new SuccessDeleteStaffData(source.SuccessEmployeeData[i]); } } if (source.FailedEmployeeData != null) { this.FailedEmployeeData = new FailedDeleteStaffData[source.FailedEmployeeData.length]; for (int i = 0; i < source.FailedEmployeeData.length; i++) { this.FailedEmployeeData[i] = new FailedDeleteStaffData(source.FailedEmployeeData[i]); } } } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamArrayObj(map, prefix + "SuccessEmployeeData.", this.SuccessEmployeeData); this.setParamArrayObj(map, prefix + "FailedEmployeeData.", this.FailedEmployeeData); } }
be28d13a7247a79f68033855ea38ecc43846ba96
f6c572fcbd37075d87d5b7f0ad77508e74cee2bc
/src/main/java/com/bootdo/work/controller/PlanController.java
ec38c6b27cd2377913e61c7da0eaeb6fa846b548
[]
no_license
sunzq071/JAVANewProgram
b64578a37dc9b327d1cb0cfccd28eeb85276047f
7870358ef894724a08bffb15ff0a3b4d45470f89
refs/heads/master
2020-04-01T13:02:23.065448
2018-10-16T07:56:42
2018-10-16T07:57:57
153,234,399
0
0
null
null
null
null
UTF-8
Java
false
false
2,549
java
package com.bootdo.work.controller; import com.bootdo.common.annotation.Log; import com.bootdo.common.config.Constant; import com.bootdo.common.controller.BaseController; import com.bootdo.common.utils.R; import com.bootdo.work.domain.WorkPlanDO; import com.bootdo.work.service.WorkPlanService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; import java.util.List; /** * description: * Created By: TomSun * Date: 2018/9/17 15:51 */ @RequestMapping("/work/plan") @Controller public class PlanController extends BaseController{ String prefix = "work/plan"; @Autowired WorkPlanService workPlanService; @RequiresPermissions("work:plan:plan") @GetMapping() String plan() { return prefix + "/plan"; } @RequiresPermissions("work:plan:plan") @GetMapping("/list") @ResponseBody() List<WorkPlanDO> list() { List<WorkPlanDO> plans = workPlanService.list(); return plans; } @Log("添加工作计划") @RequiresPermissions("work:plan:add") @GetMapping("/add/{id}") String add(Model model,@PathVariable("id") Long indx) { WorkPlanDO workPlanDO = workPlanService.getPlanByIndx(indx); model.addAttribute("plan", workPlanDO); return prefix + "/add"; } @Log("保存工作计划") @RequiresPermissions("work:plan:add") @PostMapping("/save") @ResponseBody() R save(WorkPlanDO workPlan) { // if (Constant.DEMO_ACCOUNT.equals(getUsername())) { // return R.error(1, "演示系统不允许修改,完整体验请部署程序"); // } if(null==workPlan.getIndx()||workPlan.getIndx()==0L) { if (workPlanService.save(workPlan) > 0) { return R.ok(); } else { return R.error(1, "保存失败"); } } else { if (workPlanService.update(workPlan) > 0) { return R.ok(); } else { return R.error(1, "保存失败"); } } } @Log("删除工作计划") @RequiresPermissions("work:plan:remove") @PostMapping("/remove") @ResponseBody() R remove(Long id){ if (workPlanService.remove(id) > 0) { return R.ok(); } return R.error(); } }
1aaf8453bd74bc366273c8f134a5b946e5e4e24e
064fe0e0f56b14c8aea108638068f5b72e233b98
/app/src/main/java/com/akashapps/shoottospace/CustomParticles.java
94be106ceb822b008433e8a3b19d39811b002f0d
[]
no_license
akashd50/shoottospace
e59a0089399bb8c545f8830ec2ebf08167096ea6
c4efec1429cc9d4e13106ffc37a035f5f755ac4f
refs/heads/master
2020-04-20T22:00:27.677624
2019-10-27T15:33:13
2019-10-27T15:33:13
169,125,544
1
0
null
null
null
null
UTF-8
Java
false
false
28,091
java
package com.akashapps.shoottospace; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.opengl.GLES20; import android.opengl.GLES32; import android.opengl.GLUtils; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import static android.opengl.GLES20.GL_BLEND; import static android.opengl.GLES20.GL_ONE; import static android.opengl.GLES20.GL_ONE_MINUS_SRC_ALPHA; import static android.opengl.GLES20.GL_POINTS; import static android.opengl.GLES20.GL_SRC_ALPHA; public class CustomParticles { public float initialVelX, initialVelY; public float tempVelX, tempVelY, tempX, tempY; public TexturedPlane particle, tail; private static Context context; public int lifetime; int timeCounter; public float distance; boolean active; private boolean unlimited; public static int LIGHT_BLEND = 1; public static int VN_BLEND = 2; public int BLEND_TYPE; private static final int POSITION_COMPONENT_COUNT = 3; private static final int COLOR_COMPONENT_COUNT = 3; private static final int VECTOR_COMPONENT_COUNT = 3; private static final int PARTICLE_START_TIME_COMPONENT_COUNT = 1; private static final int BYTES_PER_FLOAT = 4; private static final int TOTAL_COMPONENT_COUNT = POSITION_COMPONENT_COUNT + COLOR_COMPONENT_COUNT + VECTOR_COMPONENT_COUNT + PARTICLE_START_TIME_COMPONENT_COUNT; private static final int STRIDE = TOTAL_COMPONENT_COUNT * BYTES_PER_FLOAT; private String PVTXSHADER; private String PFRAGSHADER; /*private static final String U_TIME = "u_Time"; private static final String A_DIRFECTIONVECTOR = "u_Time"; private static final String U_TIME = "u_Time";*/ private int uMatrixLocation,uTimeLocation, aPositionLocation, aColorLocation, aDirectionVectorLocation,aParticleStartTimeLocation, mProgram, uTextureLocation, texture, resID; private float[] particles, colors, vectors, times, alphas; private FloatBuffer vertexBuffer, colorBuffer, vectorBuffer, timeBuffer, alphaBuffer; private int maxParticleCount, currentParticleCount, nextParticle; private long lastParticleAdded, timeCurrent; private float pointSize, timeOnScreen; public CustomParticles(int maxParticleCount, float pointer, int blendType, int resID, float alphaFactor, float gravity){ this.BLEND_TYPE = blendType; this.resID = resID; pointSize = pointer; lastParticleAdded = 0; timeCurrent = 0; float g = gravity/100; this.timeOnScreen = 3.0f; if(resID!=0) { PVTXSHADER = "uniform mat4 u_Matrix;" + "uniform float u_Time;" + //"uniform float u_PointSize"+//--------------- "uniform float u_PointerAlpha;"+ "varying float v_PointerAlpha;"+ "attribute vec3 a_Position;" + "attribute vec3 a_Color;" + "attribute vec3 a_DirectionVector;" + "attribute float a_ParticleStartTime;" + "varying vec3 v_Color;" + "varying float v_ElapsedTime;" + "void main(){" + "v_PointerAlpha = u_PointerAlpha;"+ "v_Color = a_Color;" + "v_ElapsedTime = u_Time - a_ParticleStartTime;" + "vec3 currentPosition = a_Position +(a_DirectionVector * v_ElapsedTime);" + "float gravityFactor = v_ElapsedTime *"+g+";"+ "currentPosition.y-= a_DirectionVector.y*gravityFactor;"+ "gl_Position = u_Matrix * vec4(currentPosition, 1.0);" + // "float subPt = v_ElapsedTime * 0.05"+ "gl_PointSize = " + pointer +" - v_ElapsedTime*0.5;" + "}"; PFRAGSHADER = "precision mediump float;" + "uniform sampler2D u_TextureUnit;"+ "varying vec3 v_Color;" + "varying float v_PointerAlpha;"+ "varying float v_ElapsedTime;" + "void main(){" + "float alphaR = "+alphaFactor+";"+ "float alpha = 0.0;"+ //"if(alphaR==0.0)"+ // "{"+ // "alpha = v_PointerAlpha;"+ // "}else{"+ // "alpha = 1.0-(v_ElapsedTime*alphaR);"+ // "}"+ "if(v_ElapsedTime<3.0){"+ "gl_FragColor = vec4(v_Color/v_ElapsedTime,1.0) * texture2D(u_TextureUnit, gl_PointCoord);" + "}" + //"gl_FragColor = vec4(v_Color/v_ElapsedTime * texture2D(u_TextureUnit, gl_PointCoord), 1.0/(v_ElapsedTime*alphaR));" + //"if(alpha>=0){alpha-=alphaR;}"+ "}"; }else{ PVTXSHADER = "uniform mat4 u_Matrix;" + "uniform float u_Time;" + "attribute vec3 a_Position;" + "attribute vec3 a_Color;" + "attribute vec3 a_DirectionVector;" + "attribute float a_ParticleStartTime;" + "varying vec3 v_Color;" + "varying float v_ElapsedTime;" + "void main(){" + "v_Color = a_Color;" + "v_ElapsedTime = u_Time - a_ParticleStartTime;" + "vec3 currentPosition = a_Position +(a_DirectionVector * v_ElapsedTime);" + //"float gravityFactor = v_ElapsedTime * v_ElapsedTime / "+gravity+";"+ "float gravityFactor = v_ElapsedTime *"+g+";"+ "currentPosition.y-=gravityFactor;"+ "gl_Position = u_Matrix * vec4(currentPosition, 1.0);" + // "float subPt = v_ElapsedTime * 0.05"+ "gl_PointSize = " + pointer + " - v_ElapsedTime*0.5;" + "}"; PFRAGSHADER = "precision mediump float;" + // "uniform sampler2D u_TextureUnit;"+ "varying vec3 v_Color;" + "varying float v_ElapsedTime;" + "void main(){" + "float alphaR = "+alphaFactor+";"+ "if(v_ElapsedTime<3.0){"+ "gl_FragColor = vec4(v_Color/v_ElapsedTime,1.0/(alphaR*v_ElapsedTime));" + "}" + //"gl_FragColor = vec4(v_Color/v_ElapsedTime,1.0/(alphaR*v_ElapsedTime));" + "}"; } this.maxParticleCount = maxParticleCount; currentParticleCount = 0; nextParticle = 0; particles = new float[maxParticleCount*POSITION_COMPONENT_COUNT]; colors = new float[maxParticleCount*COLOR_COMPONENT_COUNT]; vectors = new float[maxParticleCount*VECTOR_COMPONENT_COUNT]; times = new float[maxParticleCount*PARTICLE_START_TIME_COMPONENT_COUNT]; ByteBuffer bb = ByteBuffer.allocateDirect(particles.length * BYTES_PER_FLOAT); if(bb!=null) { // (number of coordinate values * 4 bytes per float) // use the device hardware's native byte order bb.order(ByteOrder.nativeOrder()); // create a floating point buffer from the ByteBuffer vertexBuffer = bb.asFloatBuffer(); // add the coordinates to the FloatBuffer vertexBuffer.put(particles); // set the buffer to read the first coordinate vertexBuffer.position(0); } ByteBuffer cb = ByteBuffer.allocateDirect(colors.length*BYTES_PER_FLOAT); if(cb!=null){ cb.order(ByteOrder.nativeOrder()); colorBuffer = cb.asFloatBuffer(); colorBuffer.put(colors); colorBuffer.position(0); } ByteBuffer vb = ByteBuffer.allocateDirect(vectors.length*BYTES_PER_FLOAT); if(vb!=null){ vb.order(ByteOrder.nativeOrder()); vectorBuffer = vb.asFloatBuffer(); vectorBuffer.put(vectors); vectorBuffer.position(0); } ByteBuffer tb = ByteBuffer.allocateDirect(times.length*BYTES_PER_FLOAT); if(tb!=null){ tb.order(ByteOrder.nativeOrder()); timeBuffer = tb.asFloatBuffer(); timeBuffer.put(times); timeBuffer.position(0); } generateProgram(); uMatrixLocation = GLES20.glGetUniformLocation(mProgram, "u_Matrix"); uTimeLocation = GLES20.glGetUniformLocation(mProgram, "u_Time"); aPositionLocation = GLES20.glGetAttribLocation(mProgram, "a_Position"); aColorLocation = GLES20.glGetAttribLocation(mProgram, "a_Color"); aDirectionVectorLocation = GLES20.glGetAttribLocation(mProgram, "a_DirectionVector"); aParticleStartTimeLocation = GLES20.glGetAttribLocation(mProgram, "a_ParticleStartTime"); if(resID!=0) { uTextureLocation = GLES20.glGetUniformLocation(mProgram, "u_TextureUnit"); texture = loadTexture(SpaceGameRenderer.context, resID); } } public CustomParticles(int maxParticleCount, float gravity, float pointer, int blendType, int resID, float timeOnScreen){ this.BLEND_TYPE = blendType; this.resID = resID; pointSize = pointer; lastParticleAdded = 0; timeCurrent = 0; this.timeOnScreen = timeOnScreen; float g = gravity; if(resID!=0) { PVTXSHADER = "uniform mat4 u_Matrix;" + "uniform float u_Time;" + // "uniform float u_PointSize"+//--------------- "attribute vec3 a_Position;" + "attribute vec3 a_Color;" + "attribute vec3 a_DirectionVector;" + "attribute float a_ParticleStartTime;" + "varying vec3 v_Color;" + "varying float v_ElapsedTime;" + "void main(){" + //"glEnable(GL_PROGRAM_POINT_SIZE);"+ "v_Color = a_Color;" + "v_ElapsedTime = u_Time - a_ParticleStartTime;" + "vec3 currentPosition = a_Position +(a_DirectionVector * v_ElapsedTime);" + "float gravityFactor = v_ElapsedTime/"+g+";"+ "currentPosition.y-= gravityFactor;"+ "gl_Position = u_Matrix * vec4(currentPosition, 1.0);" + "float subPt = "+pointSize+" - 0.5*v_ElapsedTime;"+ "gl_PointSize = subPt;" + "}"; PFRAGSHADER = "precision mediump float;" + "uniform sampler2D u_TextureUnit;"+ "varying vec3 v_Color;" + "varying float v_ElapsedTime;" + "void main(){" + //"if(alphaR==0.0)"+ // "{"+ // "alpha = v_PointerAlpha;"+ // "}else{"+ // "alpha = 1.0-(v_ElapsedTime*alphaR);"+ // "}"+ "if(v_ElapsedTime<"+this.timeOnScreen+"){"+ "float alphaR = "+this.timeOnScreen+"- v_ElapsedTime;"+ "float alpha = alphaR/"+this.timeOnScreen+";"+ "gl_FragColor = vec4(v_Color,alpha) * texture2D(u_TextureUnit, gl_PointCoord);" + "}" + //"gl_FragColor = vec4(v_Color/v_ElapsedTime * texture2D(u_TextureUnit, gl_PointCoord), 1.0/(v_ElapsedTime*alphaR));" + //"if(alpha>=0){alpha-=alphaR;}"+ "}"; } this.maxParticleCount = maxParticleCount; currentParticleCount = 0; nextParticle = 0; particles = new float[maxParticleCount*POSITION_COMPONENT_COUNT]; colors = new float[maxParticleCount*COLOR_COMPONENT_COUNT]; vectors = new float[maxParticleCount*VECTOR_COMPONENT_COUNT]; times = new float[maxParticleCount*PARTICLE_START_TIME_COMPONENT_COUNT]; alphas = new float[maxParticleCount]; ByteBuffer bb = ByteBuffer.allocateDirect(particles.length * BYTES_PER_FLOAT); if(bb!=null) { // (number of coordinate values * 4 bytes per float) // use the device hardware's native byte order bb.order(ByteOrder.nativeOrder()); // create a floating point buffer from the ByteBuffer vertexBuffer = bb.asFloatBuffer(); // add the coordinates to the FloatBuffer vertexBuffer.put(particles); // set the buffer to read the first coordinate vertexBuffer.position(0); } ByteBuffer cb = ByteBuffer.allocateDirect(colors.length*BYTES_PER_FLOAT); if(cb!=null){ cb.order(ByteOrder.nativeOrder()); colorBuffer = cb.asFloatBuffer(); colorBuffer.put(colors); colorBuffer.position(0); } ByteBuffer vb = ByteBuffer.allocateDirect(vectors.length*BYTES_PER_FLOAT); if(vb!=null){ vb.order(ByteOrder.nativeOrder()); vectorBuffer = vb.asFloatBuffer(); vectorBuffer.put(vectors); vectorBuffer.position(0); } ByteBuffer tb = ByteBuffer.allocateDirect(times.length*BYTES_PER_FLOAT); if(tb!=null){ tb.order(ByteOrder.nativeOrder()); timeBuffer = tb.asFloatBuffer(); timeBuffer.put(times); timeBuffer.position(0); } generateProgram(); uMatrixLocation = GLES20.glGetUniformLocation(mProgram, "u_Matrix"); uTimeLocation = GLES20.glGetUniformLocation(mProgram, "u_Time"); aPositionLocation = GLES20.glGetAttribLocation(mProgram, "a_Position"); aColorLocation = GLES20.glGetAttribLocation(mProgram, "a_Color"); aDirectionVectorLocation = GLES20.glGetAttribLocation(mProgram, "a_DirectionVector"); aParticleStartTimeLocation = GLES20.glGetAttribLocation(mProgram, "a_ParticleStartTime"); if(resID!=0) { uTextureLocation = GLES20.glGetUniformLocation(mProgram, "u_TextureUnit"); texture = loadTexture(SpaceGameRenderer.context, resID); } } public void updateBuffer(float[] vertexData, int start, int count) { vertexBuffer.position(start); vertexBuffer.put(vertexData, start, count); vertexBuffer.position(0); } public void addParticle(SimpleVector position, int color, SimpleVector direction, float particleStartTime) { final int particleOffset = nextParticle * POSITION_COMPONENT_COUNT; int currentOffset = particleOffset; final int fcoff = nextParticle*COLOR_COMPONENT_COUNT; int colorOffset = fcoff; final int fvoff = nextParticle*VECTOR_COMPONENT_COUNT; int vectorOffset = fvoff; final int ftoff = nextParticle* PARTICLE_START_TIME_COMPONENT_COUNT; int timeOffset = ftoff; nextParticle++; if (currentParticleCount < maxParticleCount) { currentParticleCount++; } if (nextParticle == maxParticleCount) { nextParticle = 0; } particles[currentOffset++] = position.x; particles[currentOffset++] = position.y; particles[currentOffset++] = position.z; vertexBuffer.position(particleOffset); vertexBuffer.put(particles, particleOffset, POSITION_COMPONENT_COUNT); vertexBuffer.position(0); colors[colorOffset++] = Color.red(color) / 255f; colors[colorOffset++] = Color.green(color) / 255f; colors[colorOffset++] = Color.blue(color) / 255f; colorBuffer.position(fcoff); colorBuffer.put(colors, fcoff, COLOR_COMPONENT_COUNT); colorBuffer.position(0); vectors[vectorOffset++] = direction.x; vectors[vectorOffset++] = direction.y; vectors[vectorOffset++] = direction.z; vectorBuffer.position(fvoff); vectorBuffer.put(vectors, fvoff, VECTOR_COMPONENT_COUNT); vectorBuffer.position(0); times[timeOffset++] = particleStartTime; timeBuffer.position(ftoff); timeBuffer.put(times, ftoff, PARTICLE_START_TIME_COMPONENT_COUNT); timeBuffer.position(0); lastParticleAdded = System.nanoTime(); } public void cleanBuffer(int num){ int start = nextParticle - particles.length; } public void setUniforms(float[] mMVPMatrix, float elapsedTime){ uMatrixLocation = GLES20.glGetUniformLocation(mProgram, "u_Matrix"); uTimeLocation = GLES20.glGetUniformLocation(mProgram, "u_Time"); GLES20.glUniformMatrix4fv(uMatrixLocation, 1, false, mMVPMatrix,0); GLES20.glUniform1f(uTimeLocation,elapsedTime); } private void generateProgram() { // if(mProgram==0) { int vertexShad = GLRenderer.loadShader(GLES20.GL_VERTEX_SHADER, PVTXSHADER); int fragmentShad = GLRenderer.loadShader(GLES20.GL_FRAGMENT_SHADER, PFRAGSHADER); // create empty OpenGL ES Program mProgram = GLES20.glCreateProgram(); // add the vertex shader to program GLES20.glAttachShader(mProgram, vertexShad); // add the fragment shader to program GLES20.glAttachShader(mProgram, fragmentShad); // creates OpenGL ES program executables GLES20.glLinkProgram(mProgram); // } } public void onDrawFrame(float[] mMVPMatrix, float elapsedTime, float alpha){ timeCurrent = System.nanoTime(); if((timeCurrent - lastParticleAdded)/1000000000 < this.timeOnScreen && lastParticleAdded!=0) { GLES20.glUseProgram(mProgram); //int dataOffset = 0; uMatrixLocation = GLES20.glGetUniformLocation(mProgram, "u_Matrix"); GLES20.glUniformMatrix4fv(uMatrixLocation, 1, false, mMVPMatrix, 0); uTimeLocation = GLES20.glGetUniformLocation(mProgram, "u_Time"); GLES20.glUniform1f(uTimeLocation, elapsedTime); if (resID != 0) { uTextureLocation = GLES20.glGetUniformLocation(mProgram, "u_TextureUnit"); GLES20.glActiveTexture(GLES20.GL_TEXTURE0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture); GLES20.glUniform1i(uTextureLocation, 0); int pointerAlpha = GLES20.glGetUniformLocation(mProgram, "u_PointerAlpha"); GLES20.glUniform1f(pointerAlpha, alpha); GLES20.glEnable(GLES20.GL_POINTS); //int pt = GLES20.glGetAttribLocation(mProgram, "gl_PointSize"); //GLES20.glEnable(GL_POINTS); } aPositionLocation = GLES20.glGetAttribLocation(mProgram, "a_Position"); aColorLocation = GLES20.glGetAttribLocation(mProgram, "a_Color"); aDirectionVectorLocation = GLES20.glGetAttribLocation(mProgram, "a_DirectionVector"); aParticleStartTimeLocation = GLES20.glGetAttribLocation(mProgram, "a_ParticleStartTime"); vertexBuffer.position(0); // this.setUniforms(mMVPMatrix, 10); // change time GLES20.glVertexAttribPointer(aPositionLocation, POSITION_COMPONENT_COUNT, GLES20.GL_FLOAT, false, POSITION_COMPONENT_COUNT * BYTES_PER_FLOAT, vertexBuffer); GLES20.glEnableVertexAttribArray(aPositionLocation); //vertexBuffer.position(0); //dataOffset+=POSITION_COMPONENT_COUNT; colorBuffer.position(0); //vertexBuffer.position(dataOffset); GLES20.glVertexAttribPointer(aColorLocation, COLOR_COMPONENT_COUNT, GLES20.GL_FLOAT, false, COLOR_COMPONENT_COUNT * BYTES_PER_FLOAT, colorBuffer); //dataOffset+=COLOR_COMPONENT_COUNT; GLES20.glEnableVertexAttribArray(aColorLocation); vectorBuffer.position(0); //vertexBuffer.position(dataOffset); GLES20.glVertexAttribPointer(aDirectionVectorLocation, VECTOR_COMPONENT_COUNT, GLES20.GL_FLOAT, false, VECTOR_COMPONENT_COUNT * BYTES_PER_FLOAT, vectorBuffer); // dataOffset+=VECTOR_COMPONENT_COUNT; GLES20.glEnableVertexAttribArray(aDirectionVectorLocation); timeBuffer.position(0); //vertexBuffer.position(dataOffset); GLES20.glVertexAttribPointer(aParticleStartTimeLocation, PARTICLE_START_TIME_COMPONENT_COUNT, GLES20.GL_FLOAT, false, PARTICLE_START_TIME_COMPONENT_COUNT * BYTES_PER_FLOAT, timeBuffer); GLES20.glEnableVertexAttribArray(aParticleStartTimeLocation); //.position(0); GLES20.glEnable(GL_BLEND); if (BLEND_TYPE == VN_BLEND) { GLES20.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else if (BLEND_TYPE == LIGHT_BLEND) { GLES20.glBlendFunc(GL_ONE, GL_ONE); } else { GLES20.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } GLES20.glDrawArrays(GLES20.GL_POINTS, 0, currentParticleCount); GLES20.glDisableVertexAttribArray(aPositionLocation); GLES20.glDisableVertexAttribArray(aDirectionVectorLocation); GLES20.glDisableVertexAttribArray(aColorLocation); GLES20.glDisableVertexAttribArray(aDirectionVectorLocation); GLES20.glDisableVertexAttribArray(aParticleStartTimeLocation); } } public void onDrawFrame(float[] mMVPMatrix, float elapsedTime, float alpha, int start, int end){ GLES20.glUseProgram(mProgram); //int dataOffset = 0; uMatrixLocation = GLES20.glGetUniformLocation(mProgram, "u_Matrix"); GLES20.glUniformMatrix4fv(uMatrixLocation, 1, false, mMVPMatrix,0); uTimeLocation = GLES20.glGetUniformLocation(mProgram, "u_Time"); GLES20.glUniform1f(uTimeLocation,elapsedTime); if(resID!=0) { uTextureLocation = GLES20.glGetUniformLocation(mProgram, "u_TextureUnit"); GLES20.glActiveTexture(GLES20.GL_TEXTURE0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture); GLES20.glUniform1i(uTextureLocation, 0); int pointerAlpha = GLES20.glGetUniformLocation(mProgram, "u_PointerAlpha"); GLES20.glUniform1f(pointerAlpha,alpha); } aPositionLocation = GLES20.glGetAttribLocation(mProgram, "a_Position"); aColorLocation = GLES20.glGetAttribLocation(mProgram, "a_Color"); aDirectionVectorLocation = GLES20.glGetAttribLocation(mProgram, "a_DirectionVector"); aParticleStartTimeLocation = GLES20.glGetAttribLocation(mProgram, "a_ParticleStartTime"); vertexBuffer.position(start*POSITION_COMPONENT_COUNT*BYTES_PER_FLOAT); // this.setUniforms(mMVPMatrix, 10); // change time GLES20.glVertexAttribPointer(aPositionLocation, POSITION_COMPONENT_COUNT, GLES20.GL_FLOAT, false, POSITION_COMPONENT_COUNT*BYTES_PER_FLOAT, vertexBuffer); GLES20.glEnableVertexAttribArray(aPositionLocation); //vertexBuffer.position(0); //dataOffset+=POSITION_COMPONENT_COUNT; colorBuffer.position(start*POSITION_COMPONENT_COUNT*BYTES_PER_FLOAT); //vertexBuffer.position(dataOffset); GLES20.glVertexAttribPointer(aColorLocation, COLOR_COMPONENT_COUNT, GLES20.GL_FLOAT,false, COLOR_COMPONENT_COUNT*BYTES_PER_FLOAT, colorBuffer); //dataOffset+=COLOR_COMPONENT_COUNT; GLES20.glEnableVertexAttribArray(aColorLocation); vectorBuffer.position(start*POSITION_COMPONENT_COUNT*BYTES_PER_FLOAT); //vertexBuffer.position(dataOffset); GLES20.glVertexAttribPointer(aDirectionVectorLocation, VECTOR_COMPONENT_COUNT, GLES20.GL_FLOAT, false, VECTOR_COMPONENT_COUNT*BYTES_PER_FLOAT, vectorBuffer); // dataOffset+=VECTOR_COMPONENT_COUNT; GLES20.glEnableVertexAttribArray(aDirectionVectorLocation); timeBuffer.position(start*POSITION_COMPONENT_COUNT*BYTES_PER_FLOAT); //vertexBuffer.position(dataOffset); GLES20.glVertexAttribPointer(aParticleStartTimeLocation, PARTICLE_START_TIME_COMPONENT_COUNT, GLES20.GL_FLOAT, false, PARTICLE_START_TIME_COMPONENT_COUNT*BYTES_PER_FLOAT, timeBuffer); GLES20.glEnableVertexAttribArray(aParticleStartTimeLocation); //.position(0); GLES20.glEnable( GL_BLEND ); if(BLEND_TYPE == VN_BLEND) { GLES20.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); }else if(BLEND_TYPE == LIGHT_BLEND) { GLES20.glBlendFunc( GL_ONE, GL_ONE ); }else{ GLES20.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } GLES20.glDrawArrays(GLES20.GL_POINTS,0, end); GLES20.glDisableVertexAttribArray(aPositionLocation); GLES20.glDisableVertexAttribArray(aDirectionVectorLocation); GLES20.glDisableVertexAttribArray(aColorLocation); GLES20.glDisableVertexAttribArray(aDirectionVectorLocation); GLES20.glDisableVertexAttribArray(aParticleStartTimeLocation); } private int loadTexture(Context context, int resID){ int[] textures = new int[1]; GLES20.glGenTextures(1, textures, 0); final BitmapFactory.Options options = new BitmapFactory.Options(); options.inScaled = false; Bitmap bitmap = BitmapFactory.decodeResource( context.getResources(), resID, options); /*= BitmapFactory.decodeResource( context.getResources(), resID, options);*/ GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textures[0]); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D,GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR_MIPMAP_LINEAR); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR); GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); bitmap.recycle(); GLES20.glGenerateMipmap(GLES20.GL_TEXTURE_2D); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); return textures[0]; } public int getPositionAttributeLocation() { return aPositionLocation; } public int getColorAttributeLocation() { return aColorLocation; } public int getDirectionVectorAttributeLocation() { return aDirectionVectorLocation; } public int getParticleStartTimeAttributeLocation() { return aParticleStartTimeLocation; } }
852dd8ad9330b9c47fecc11d34d9b6abc82e0ca6
86f5f333be246bf443d408a9638687b6402cba38
/mars-console/src/main/java/com/rdpk/mars/console/Tuple.java
efc9f6c5c6f447915edb4d313bb9e8eedc5e236d
[]
no_license
rodolfodpk/mars
c99ddb1d06794d0e03193070a0cc471e153bd64a
0e0f5901ac5ce538a7b2525eebf1098987c6c248
refs/heads/master
2020-12-24T21:36:37.019026
2019-01-31T02:34:04
2019-01-31T02:34:04
57,267,215
0
0
null
2019-01-14T08:35:42
2016-04-28T03:16:55
Java
UTF-8
Java
false
false
780
java
package com.rdpk.mars.console; /** * A Tuple data type * @param <L> * @param <R> */ class Tuple<L,R> { private final L left; private final R right; public Tuple(L left, R right) { this.left = left; this.right = right; } public L getLeft() { return left; } public R getRight() { return right; } @Override public int hashCode() { return left.hashCode() ^ right.hashCode(); } @Override public boolean equals(Object o) { if (!(o instanceof Tuple)) return false; Tuple pairo = (Tuple) o; return this.left.equals(pairo.getLeft()) && this.right.equals(pairo.getRight()); } @Override public String toString() { return "Tuple{" + "left=" + left + ", right=" + right + '}'; } }
2f28fae314bb3db74eb62e73bb1b9689a2c6dcbd
f0326b9e0d7e23f503991bb9d899cb15ec1b395a
/src/main/java/me/saksonov/jhipster/uaa/security/DomainUserDetailsService.java
b3125795b499b0af08e22d54d4575a1fa9bd3307
[]
no_license
andreysaksonov/jhipster-uaa
fada3a0cb2d81f30f88356f27d44cf3afb65d019
93fc694621ec0a2ff5c18c02d43f4f6a20a38127
refs/heads/master
2020-03-26T03:19:10.035734
2018-08-12T08:19:49
2018-08-12T08:19:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,810
java
package me.saksonov.jhipster.uaa.security; import me.saksonov.jhipster.uaa.domain.User; import me.saksonov.jhipster.uaa.repository.UserRepository; import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import java.util.*; import java.util.stream.Collectors; /** * Authenticate a user from the database. */ @Component("userDetailsService") public class DomainUserDetailsService implements UserDetailsService { private final Logger log = LoggerFactory.getLogger(DomainUserDetailsService.class); private final UserRepository userRepository; public DomainUserDetailsService(UserRepository userRepository) { this.userRepository = userRepository; } @Override @Transactional public UserDetails loadUserByUsername(final String login) { log.debug("Authenticating {}", login); if (new EmailValidator().isValid(login, null)) { Optional<User> userByEmailFromDatabase = userRepository.findOneWithAuthoritiesByEmail(login); return userByEmailFromDatabase.map(user -> createSpringSecurityUser(login, user)) .orElseThrow(() -> new UsernameNotFoundException("User with email " + login + " was not found in the database")); } String lowercaseLogin = login.toLowerCase(Locale.ENGLISH); Optional<User> userByLoginFromDatabase = userRepository.findOneWithAuthoritiesByLogin(lowercaseLogin); return userByLoginFromDatabase.map(user -> createSpringSecurityUser(lowercaseLogin, user)) .orElseThrow(() -> new UsernameNotFoundException("User " + lowercaseLogin + " was not found in the database")); } private org.springframework.security.core.userdetails.User createSpringSecurityUser(String lowercaseLogin, User user) { if (!user.getActivated()) { throw new UserNotActivatedException("User " + lowercaseLogin + " was not activated"); } List<GrantedAuthority> grantedAuthorities = user.getAuthorities().stream() .map(authority -> new SimpleGrantedAuthority(authority.getName())) .collect(Collectors.toList()); return new org.springframework.security.core.userdetails.User(user.getLogin(), user.getPassword(), grantedAuthorities); } }
ed33c894fb00e4b493f827bfbf1fb6f365253a42
0c8efde31c41884886aae0f4a655093d19f3a3f0
/ttreeMaven/src/main/java/com/ttree/ttree/domain/repository/FairFileRepository.java
ab66e19008b0bdddf1b8d33da858b8775fb86fd4
[]
no_license
kyurimki/T-Tree
2ebd8d1c3a8290d59f7c76511135e9ac1db843c6
383cee91f98ed05c655679234414c20dc752b419
refs/heads/main
2023-06-25T19:36:07.664708
2021-08-04T09:51:42
2021-08-04T09:51:42
327,633,158
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package com.ttree.ttree.domain.repository; import com.ttree.ttree.domain.entity.FairFile; import org.springframework.data.jpa.repository.JpaRepository; public interface FairFileRepository extends JpaRepository<FairFile, Long> { }
d5677eb3f213f3d1c1f5eb8530cef41f5b8a1d33
5a31dd133a92a46a15541bea635baebd09209104
/src/main/java/com/test/slack/common/model/RestExceptionHandler.java
6c75cc31309e73620f6d31674a5188f14c06d082
[]
no_license
scorpionrao/slack-app
ef2ad17bf349ca4375544a39b0702de86cf43c2e
2898af3517ed12cd3ca4e1302c2ac222e5c19b63
refs/heads/master
2021-05-12T01:01:36.477534
2018-01-15T19:16:49
2018-01-15T19:16:49
117,548,469
0
0
null
null
null
null
UTF-8
Java
false
false
820
java
package com.test.slack.common.model; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import java.util.Arrays; @ControllerAdvice public class RestExceptionHandler { @ExceptionHandler(value = { Throwable.class }) protected ResponseEntity<String> handleAnyException(Throwable exception) { HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.put("Content-Type", Arrays.asList(MediaType.APPLICATION_JSON_VALUE)); return new ResponseEntity<>(exception.getMessage(), httpHeaders, HttpStatus.INTERNAL_SERVER_ERROR); } }
89ce61c6c54cc079d4e0ae34017e75aa9848c0b7
92e6e503ee71345c945eb8d3828e267e13d8f262
/src/cn/edu/seu/pay/Picker.java
e99f84b5a53b02d731d96a2606f2ce5e95b92b79
[]
no_license
honkawf/hk
d19b15f635c2d634d0d6986e26df4ceb0eba87c1
e66c84378489ab5d977c2fdf7a95d3d2a874f6bf
refs/heads/master
2020-05-19T12:20:59.280777
2013-09-06T13:06:59
2013-09-06T13:06:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,897
java
package cn.edu.seu.pay; import cn.edu.seu.main.R; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; public class Picker extends LinearLayout{ private Button plus,minus; private TextView textView; public Picker(Context context) { super(context); // TODO Auto-generated constructor stub } public Picker(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater inflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.picker, this); plus=(Button)findViewById(R.id.plus); /* plus.setOnClickListener(new Button.OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Integer quantity=Integer.parseInt(textView.getText().toString())+1; textView.setText(Integer.toString(quantity)); } });*/ minus=(Button)findViewById(R.id.minus); /*minus.setOnClickListener(new Button.OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Integer quantity=Integer.parseInt(textView.getText().toString()); if(quantity>=1) { quantity--; textView.setText(Integer.toString(quantity)); } } });*/ textView=(TextView)findViewById(R.id.quantity); } public Button getButtonPlus() { return plus; } public Button getButtonMinus() { return minus; } public void setText(String text) { textView.setText(text); } public String getText() { return textView.getText().toString(); } }
[ "hp-2@hp-27" ]
hp-2@hp-27
0589a08270612e7b9c29b45032657000b5bb2608
04fb41ca4af2daae94d76cb7bedff51acea10eb7
/src/test/java/jp/ac/tsukuba/cs/mdl/dnn4j/layers/FullyConnectTest.java
9eb5a6686b56747a56e86e9d1c5a1410ccffd586
[ "MIT" ]
permissive
kuri8ive/dnn4j
32e004a677dc859dc4851f92437d4f67dadc9e07
cfc05c040dd56c1dfebb6ffdc5e44de320cffd2d
refs/heads/master
2021-09-06T16:15:26.252008
2018-02-08T13:26:05
2018-02-08T13:26:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,549
java
package jp.ac.tsukuba.cs.mdl.dnn4j.layers; import jp.ac.tsukuba.cs.mdl.numj.core.NdArray; import jp.ac.tsukuba.cs.mdl.numj.core.NumJ; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class FullyConnectTest { NdArray weight; NdArray bias; FullyConnect fullyConnect; @Before public void init() { weight = NumJ.create(new double[]{-1, -2, -3, -4, -5, -6, -7, -8, -9}, 3, 3); bias = NumJ.create(new double[]{0.5, 0.6, 0.7}, 1, 3); fullyConnect = new FullyConnect(weight, bias); } @Test public void forward() throws Exception { NdArray input = NumJ.create(new double[]{1., 2., 3.}, 1, 3); NdArray result = NumJ.create(new double[]{-29.5, -35.4, -41.3}, 1, 3); assertTrue(result.sub(fullyConnect.forward(input)).elementwise(Math::abs).sum() < 1e-10); assertArrayEquals(new int[]{1, 3}, fullyConnect.forward(input).shape()); } @Test public void backward() throws Exception { forward(); NdArray dout = NumJ.ones(1, 3); NdArray dx = NumJ.create(new double[]{-6., -15., -24}, 1, 3); assertEquals(dx.toString(), fullyConnect.backward(dout).toString()); assertArrayEquals(new int[]{1, 3}, fullyConnect.backward(dout).shape()); NdArray dW = NumJ.create(new double[]{1., 1., 1., 2., 2., 2., 3., 3., 3.,}, 3, 3); assertEquals(dW.toString(), fullyConnect.getWeightGrad().toString()); assertArrayEquals(dW.shape(), fullyConnect.getWeightGrad().shape()); assertEquals(dout.toString(), fullyConnect.getBiasGrad().toString()); /*forward(); NdArray dout = NumJ.ones(1, 3); NdArray dx = NumJ.create(new double[]{-6., -15., -24}, 1, 3); assertTrue(dx.sub(fullyConnect.backward(dout)).elementwise(Math::abs).sum() < 1e-10); assertArrayEquals(new int[]{1, 3}, fullyConnect.backward(dout).shape()); NdArray dW = NumJ.create(new double[]{1., 1., 1., 2., 2., 2., 3., 3., 3.,}, 3, 3); assertTrue(fullyConnect.getWeightGrad().sub(dW).elementwise(Math::abs).sum() < 1e-10); assertArrayEquals(dW.shape(), fullyConnect.getWeightGrad().shape()); assertTrue(fullyConnect.getBiasGrad().sub(dout).elementwise(Math::abs).sum() < 1e-10); assertArrayEquals(new int[]{1, 3}, fullyConnect.getBiasGrad().shape());*/ } }
697fc7650120e9a011f0aecf6bb9b9092b894c63
4c708e308f391d724c7b968a93a0505b45a28a7a
/SDS/GTL/src/com/zurich/sds/ipa/module/T7961.java
44e14dd159bb5f026743a5efa0b7cbcacedbc962
[]
no_license
omagas/SFTP_BatchJob
f324bb324381a0d026954576fc629c6df6d3d6b6
8725feb5c20103fcb884583916afc6fdff9eb03c
refs/heads/master
2020-12-24T16:33:13.361839
2016-04-20T13:04:54
2016-04-20T13:04:54
31,701,794
0
0
null
null
null
null
UTF-8
Java
false
false
6,220
java
/* 1: */ package com.zurich.sds.ipa.module; /* 2: */ /* 3: */ import com.zurich.sds.utils.AS400Element; /* 4: */ import java.util.Date; /* 5: */ /* 6: */ public class T7961 /* 7: */ { /* 8: */ @AS400Element(length=5, ordinalPosition=1) /* 9: */ private String table; /* 10: */ @AS400Element(length=8, ordinalPosition=2) /* 11: */ private String item; /* 12: */ @AS400Element(length=1, ordinalPosition=3) /* 13: */ private String flag; /* 14: */ @AS400Element(length=30, ordinalPosition=4) /* 15: */ private String longDesc; /* 16: */ @AS400Element(length=8, ordinalPosition=5) /* 17: */ private Date dateEff; /* 18: */ @AS400Element(length=8, ordinalPosition=6) /* 19: */ private Date dateEnd; /* 20: */ @AS400Element(length=9, ordinalPosition=7, riskId="C18") /* 21: */ private Integer insuranceCoverage01; /* 22: */ @AS400Element(length=9, ordinalPosition=8, riskId="C19") /* 23: */ private Integer insuranceCoverage02; /* 24: */ @AS400Element(length=9, ordinalPosition=9, riskId="C20") /* 25: */ private Integer insuranceCoverage03; /* 26: */ @AS400Element(length=9, ordinalPosition=10, riskId="C21") /* 27: */ private Integer insuranceCoverage04; /* 28: */ @AS400Element(length=9, ordinalPosition=11, riskId="C22") /* 29: */ private Integer insuranceCoverage05; /* 30: */ @AS400Element(length=9, ordinalPosition=12, riskId="C23") /* 31: */ private Integer insuranceCoverage06; /* 32: */ @AS400Element(length=9, ordinalPosition=13, riskId="C24") /* 33: */ private Integer insuranceCoverage07; /* 34: */ /* 35: */ public String getTable() /* 36: */ { /* 37: 61 */ return this.table; /* 38: */ } /* 39: */ /* 40: */ public void setTable(String table) /* 41: */ { /* 42: 65 */ this.table = table; /* 43: */ } /* 44: */ /* 45: */ public String getItem() /* 46: */ { /* 47: 69 */ return this.item; /* 48: */ } /* 49: */ /* 50: */ public void setItem(String item) /* 51: */ { /* 52: 73 */ this.item = item; /* 53: */ } /* 54: */ /* 55: */ public String getFlag() /* 56: */ { /* 57: 77 */ return this.flag; /* 58: */ } /* 59: */ /* 60: */ public void setFlag(String flag) /* 61: */ { /* 62: 81 */ this.flag = flag; /* 63: */ } /* 64: */ /* 65: */ public String getLongDesc() /* 66: */ { /* 67: 85 */ return this.longDesc; /* 68: */ } /* 69: */ /* 70: */ public void setLongDesc(String longDesc) /* 71: */ { /* 72: 89 */ this.longDesc = longDesc; /* 73: */ } /* 74: */ /* 75: */ public Date getDateEff() /* 76: */ { /* 77: 93 */ return this.dateEff; /* 78: */ } /* 79: */ /* 80: */ public void setDateEff(Date dateEff) /* 81: */ { /* 82: 97 */ this.dateEff = dateEff; /* 83: */ } /* 84: */ /* 85: */ public Date getDateEnd() /* 86: */ { /* 87:101 */ return this.dateEnd; /* 88: */ } /* 89: */ /* 90: */ public void setDateEnd(Date dateEnd) /* 91: */ { /* 92:105 */ this.dateEnd = dateEnd; /* 93: */ } /* 94: */ /* 95: */ public Integer getInsuranceCoverage01() /* 96: */ { /* 97:109 */ return this.insuranceCoverage01; /* 98: */ } /* 99: */ /* 100: */ public void setInsuranceCoverage01(Integer insuranceCoverage01) /* 101: */ { /* 102:113 */ this.insuranceCoverage01 = insuranceCoverage01; /* 103: */ } /* 104: */ /* 105: */ public Integer getInsuranceCoverage02() /* 106: */ { /* 107:117 */ return this.insuranceCoverage02; /* 108: */ } /* 109: */ /* 110: */ public void setInsuranceCoverage02(Integer insuranceCoverage02) /* 111: */ { /* 112:121 */ this.insuranceCoverage02 = insuranceCoverage02; /* 113: */ } /* 114: */ /* 115: */ public Integer getInsuranceCoverage03() /* 116: */ { /* 117:125 */ return this.insuranceCoverage03; /* 118: */ } /* 119: */ /* 120: */ public void setInsuranceCoverage03(Integer insuranceCoverage03) /* 121: */ { /* 122:129 */ this.insuranceCoverage03 = insuranceCoverage03; /* 123: */ } /* 124: */ /* 125: */ public Integer getInsuranceCoverage04() /* 126: */ { /* 127:133 */ return this.insuranceCoverage04; /* 128: */ } /* 129: */ /* 130: */ public void setInsuranceCoverage04(Integer insuranceCoverage04) /* 131: */ { /* 132:137 */ this.insuranceCoverage04 = insuranceCoverage04; /* 133: */ } /* 134: */ /* 135: */ public Integer getInsuranceCoverage05() /* 136: */ { /* 137:141 */ return this.insuranceCoverage05; /* 138: */ } /* 139: */ /* 140: */ public void setInsuranceCoverage05(Integer insuranceCoverage05) /* 141: */ { /* 142:145 */ this.insuranceCoverage05 = insuranceCoverage05; /* 143: */ } /* 144: */ /* 145: */ public Integer getInsuranceCoverage06() /* 146: */ { /* 147:149 */ return this.insuranceCoverage06; /* 148: */ } /* 149: */ /* 150: */ public void setInsuranceCoverage06(Integer insuranceCoverage06) /* 151: */ { /* 152:153 */ this.insuranceCoverage06 = insuranceCoverage06; /* 153: */ } /* 154: */ /* 155: */ public Integer getInsuranceCoverage07() /* 156: */ { /* 157:157 */ return this.insuranceCoverage07; /* 158: */ } /* 159: */ /* 160: */ public void setInsuranceCoverage07(Integer insuranceCoverage07) /* 161: */ { /* 162:161 */ this.insuranceCoverage07 = insuranceCoverage07; /* 163: */ } /* 164: */ } /* Location: D:\00_Louie\Zoomin\SFTP_BatchJob\SDS\GTL\SDS_JOB.jar * Qualified Name: com.zurich.sds.ipa.module.T7961 * JD-Core Version: 0.7.0.1 */
b691f9087f60c2ed51704beacda1f3f2b2cb9d96
56c8e5c6062237fefb3a1d6c19bf60bb9bd49990
/PharmacyApp/app/src/main/java/com/medikeen/pharmacy/LoginActivity.java
c7a8ce95ad979bbd2af4d3dfa2d3bcb7d91bc58c
[]
no_license
MediKeen/PharmacyApp
92cce67c0abf72e3f87e9b40363522df18b04211
bd727281f11ec2208eb6017119545b83d62865b8
refs/heads/master
2016-08-12T17:19:17.652030
2016-03-08T10:31:21
2016-03-08T10:31:21
52,726,553
0
0
null
null
null
null
UTF-8
Java
false
false
7,573
java
package com.medikeen.pharmacy; import android.app.ProgressDialog; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.medikeen.pharmacy.fragments.HomeFragment; import com.medikeen.pharmacy.utils.ConnectionDetector; import com.medikeen.pharmacy.utils.Constants; import com.medikeen.pharmacy.utils.SessionManager; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONStringer; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; public class LoginActivity extends AppCompatActivity { Button submit; EditText username, password; InputStream inputStream; StringBuilder stringBuilder; String jsonResponseString; ProgressDialog progressDialog; SessionManager sessionManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); username = (EditText) findViewById(R.id.username); password = (EditText) findViewById(R.id.password); submit = (Button) findViewById(R.id.submit); sessionManager = new SessionManager(LoginActivity.this); submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String emailStr = username.getText().toString(); String passwordStr = password.getText().toString(); ConnectionDetector conn = new ConnectionDetector(); conn.execute(); if (conn.isInternetConnected() == true) { new LoginAsync().execute(); } else { Toast.makeText(LoginActivity.this, "Please check your internet connection", Toast.LENGTH_SHORT).show(); } } }); } class LoginAsync extends AsyncTask<Void, Void, Void> { @Override protected void onPreExecute() { super.onPreExecute(); progressDialog = new ProgressDialog(LoginActivity.this); progressDialog.show(); progressDialog.setCancelable(false); progressDialog.setCanceledOnTouchOutside(false); } @Override protected Void doInBackground(Void... params) { JSONStringer userProfileJsonStringer = new JSONStringer(); try { URL url = new URL(Constants.LOGIN_URL); HttpURLConnection conn = (HttpURLConnection) url .openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setRequestProperty("Accept", "application/json"); conn.setRequestProperty("Content-type", "application/json"); userProfileJsonStringer.object().key("email") .value("[email protected]") .key("password") .value("nighojuk").endObject(); OutputStream os = conn.getOutputStream(); BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(os, "UTF-8")); writer.write(userProfileJsonStringer.toString()); writer.flush(); writer.close(); os.close(); inputStream = conn.getErrorStream(); if (inputStream == null) { inputStream = conn.getInputStream(); } BufferedReader reader = new BufferedReader( new InputStreamReader(inputStream), 1000); stringBuilder = new StringBuilder(); stringBuilder.append(reader.readLine() + "\n"); String line = "0"; while ((line = reader.readLine()) != null) { stringBuilder.append(line + "\n"); } inputStream.close(); jsonResponseString = stringBuilder.toString(); } catch (Exception e) { Log.e("STRING BUILDER ERROR: ", "STRING BUILDER ERROR: " + e); } return null; } @Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); if (jsonResponseString != null) { try { JSONObject jsonObject = new JSONObject(jsonResponseString); String success = jsonObject.getString("success"); String error = jsonObject.getString("error"); if (success.equalsIgnoreCase("true")) { JSONObject pharmacyUserJsonObject = jsonObject.getJSONObject("parmacyUser"); long pharmacyUserId = pharmacyUserJsonObject.getLong("pharmacy_user_id"); String pharmacyUserFirstName = pharmacyUserJsonObject.getString("first_name"); String pharmacyUserLastName = pharmacyUserJsonObject.getString("last_name"); String pharmacyUserEmailAddress = pharmacyUserJsonObject.getString("email_address"); String pharmacyUserIsActive = pharmacyUserJsonObject.getString("is_active"); String pharmacyUserSessionId = pharmacyUserJsonObject.getString("authentication_session_id"); JSONObject pharmacyProfileJsonObject = jsonObject.getJSONObject("pharmacyProfile"); long pharmacyProfileId = pharmacyProfileJsonObject.getLong("pharmacy_profile_id"); String pharmacyProfileName = pharmacyProfileJsonObject.getString("pharmacy_name"); String pharmacyProfileEmailAddress = pharmacyProfileJsonObject.getString("pharmacy_email_address"); String pharmacyProfileIsActive = pharmacyProfileJsonObject.getString("pharmacy_address"); String pharmacyProfileAddress = pharmacyProfileJsonObject.getString("pharmacy_phone_number"); String pharmacyProfilePhone = pharmacyProfileJsonObject.getString("is_active"); sessionManager.createLoginSession(true, pharmacyUserId, pharmacyUserFirstName, pharmacyUserLastName, pharmacyUserEmailAddress, pharmacyUserIsActive, pharmacyUserSessionId, pharmacyProfileId, pharmacyProfileName, pharmacyProfileEmailAddress, pharmacyProfileIsActive, pharmacyProfileAddress, pharmacyProfilePhone); Intent intent = new Intent(LoginActivity.this, MainActivity.class); startActivity(intent); finish(); } else { Toast.makeText(LoginActivity.this, "Something went wrong", Toast.LENGTH_SHORT).show(); } } catch (JSONException e) { e.printStackTrace(); } } else { Toast.makeText(LoginActivity.this, "Something went wrong", Toast.LENGTH_SHORT).show(); } progressDialog.dismiss(); } } }
928917fa57b639c5504b3623b29bc014db49c582
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
/tags/2008-07-03/seasar2-2.4.26/s2jdbc-gen/s2jdbc-gen-core/src/main/java/org/seasar/extension/jdbc/gen/desc/TableDescFactoryImpl.java
272fab8d138bcb022e889ad040fb366d1338523e
[]
no_license
svn2github/s2container
54ca27cf0c1200a93e1cb88884eb8226a9be677d
625adc6c4e1396654a7297d00ec206c077a78696
refs/heads/master
2020-06-04T17:15:02.140847
2013-08-09T09:38:15
2013-08-09T09:38:15
10,850,644
0
1
null
null
null
null
UTF-8
Java
false
false
8,885
java
/* * Copyright 2004-2008 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.seasar.extension.jdbc.gen.desc; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import javax.persistence.Table; import javax.persistence.UniqueConstraint; import org.seasar.extension.jdbc.EntityMeta; import org.seasar.extension.jdbc.PropertyMeta; import org.seasar.extension.jdbc.TableMeta; import org.seasar.extension.jdbc.gen.ColumnDesc; import org.seasar.extension.jdbc.gen.ColumnDescFactory; import org.seasar.extension.jdbc.gen.ForeignKeyDesc; import org.seasar.extension.jdbc.gen.ForeignKeyDescFactory; import org.seasar.extension.jdbc.gen.PrimaryKeyDesc; import org.seasar.extension.jdbc.gen.PrimaryKeyDescFactory; import org.seasar.extension.jdbc.gen.TableDesc; import org.seasar.extension.jdbc.gen.TableDescFactory; import org.seasar.extension.jdbc.gen.UniqueKeyDesc; import org.seasar.extension.jdbc.gen.UniqueKeyDescFactory; /** * {@link TableDescFactory}の実装クラスです。 * * @author taedium */ public class TableDescFactoryImpl implements TableDescFactory { /** デフォルトの{@link Table}を取得可能にするためのクラス */ @Table protected static class Helper { } /** デフォルトのテーブル */ protected static Table DEFAULT_TABLE = Helper.class .getAnnotation(Table.class); /** テーブルの完全修飾名をキー、テーブル記述を値とするマップ */ protected ConcurrentMap<String, TableDesc> tableDescMap = new ConcurrentHashMap<String, TableDesc>( 200); /** カラム記述のファクトリ */ protected ColumnDescFactory columnDescFactory; /** 主キー記述のファクトリ */ protected PrimaryKeyDescFactory primaryKeyDescFactory; /** 外部キー記述のファクトリ */ protected ForeignKeyDescFactory foreignKeyDescFactory; /** 一意キー記述のファクトリ */ protected UniqueKeyDescFactory uniqueKeyDescFactory; /** * インスタンスを構築します。 * * @param columnDescFactory * カラム記述のファクトリ * @param primaryKeyDescFactory * 主キー記述のファクトリ * @param foreignKeyDescFactory * 外部キー記述のファクトリ * @param uniqueKeyDescFactory * 一意キー記述のファクトリ */ public TableDescFactoryImpl(ColumnDescFactory columnDescFactory, PrimaryKeyDescFactory primaryKeyDescFactory, ForeignKeyDescFactory foreignKeyDescFactory, UniqueKeyDescFactory uniqueKeyDescFactory) { this.columnDescFactory = columnDescFactory; this.primaryKeyDescFactory = primaryKeyDescFactory; this.foreignKeyDescFactory = foreignKeyDescFactory; this.uniqueKeyDescFactory = uniqueKeyDescFactory; } public TableDesc getTableDesc(EntityMeta entityMeta) { String tableFullName = entityMeta.getTableMeta().getFullName(); TableDesc tableDesc = tableDescMap.get(tableFullName); if (tableDesc != null) { return tableDesc; } tableDesc = createTableDesc(entityMeta); TableDesc tableDesc2 = tableDescMap.putIfAbsent(tableFullName, tableDesc); return tableDesc2 != null ? tableDesc2 : tableDesc; } /** * テーブル記述を作成します。 * * @param entityMeta * エンティティメタデータ * @return テーブル記述 */ protected TableDesc createTableDesc(EntityMeta entityMeta) { Table table = getTable(entityMeta); TableDesc tableDesc = new TableDesc(); doName(entityMeta, tableDesc, table); doColumnDesc(entityMeta, tableDesc, table); doPrimaryKeyDesc(entityMeta, tableDesc, table); doForeignKeyDesc(entityMeta, tableDesc, table); doUniqueKeyDesc(entityMeta, tableDesc, table); return tableDesc; } /** * 名前を処理します。 * * @param entityMeta * エンティティメタデータ * @param tableDesc * テーブル記述 * @param table * テーブル */ protected void doName(EntityMeta entityMeta, TableDesc tableDesc, Table table) { TableMeta tableMeta = entityMeta.getTableMeta(); tableDesc.setCatalogName(tableMeta.getCatalog()); tableDesc.setSchemaName(tableMeta.getSchema()); tableDesc.setName(tableMeta.getName()); } /** * カラム記述を処理します。 * * @param entityMeta * エンティティメタデータ * @param tableDesc * テーブル記述 * @param table * テーブル */ protected void doColumnDesc(EntityMeta entityMeta, TableDesc tableDesc, Table table) { for (int i = 0; i < entityMeta.getColumnPropertyMetaSize(); i++) { PropertyMeta propertyMeta = entityMeta.getColumnPropertyMeta(i); ColumnDesc columnDesc = columnDescFactory .getColumnDesc(propertyMeta); if (columnDesc != null) { tableDesc.addColumnDesc(columnDesc); } } } /** * 主キー記述を処理します。 * * @param entityMeta * エンティティメタデータ * @param tableDesc * テーブル記述 * @param table * テーブル */ protected void doPrimaryKeyDesc(EntityMeta entityMeta, TableDesc tableDesc, Table table) { PrimaryKeyDesc primaryKeyDesc = primaryKeyDescFactory .getPrimaryKeyDesc(entityMeta); if (primaryKeyDesc != null) { tableDesc.setPrimaryKeyDesc(primaryKeyDesc); } } /** * 外部キー記述を処理します。 * * @param entityMeta * エンティティメタデータ * @param tableDesc * テーブル記述 * @param table * テーブル */ protected void doForeignKeyDesc(EntityMeta entityMeta, TableDesc tableDesc, Table table) { for (int i = 0; i < entityMeta.getPropertyMetaSize(); i++) { PropertyMeta propertyMeta = entityMeta.getPropertyMeta(i); ForeignKeyDesc foreignKeyDesc = foreignKeyDescFactory .getForeignKeyDesc(propertyMeta); if (foreignKeyDesc != null) { tableDesc.addForeigneKeyDesc(foreignKeyDesc); } } } /** * 一意キー記述を処理します。 * * @param entityMeta * エンティティメタデータ * @param tableDesc * テーブル記述 * @param table * テーブル */ protected void doUniqueKeyDesc(EntityMeta entityMeta, TableDesc tableDesc, Table table) { for (ColumnDesc columnDesc : tableDesc.getColumnDescList()) { UniqueKeyDesc uniqueKeyDesc = uniqueKeyDescFactory .getSingleUniqueKey(columnDesc); if (uniqueKeyDesc != null) { tableDesc.addUniqueKeyDesc(uniqueKeyDesc); } } for (UniqueConstraint uc : table.uniqueConstraints()) { UniqueKeyDesc uniqueKeyDesc = uniqueKeyDescFactory .getCompositeUniqueKey(uc); if (uniqueKeyDesc != null) { tableDesc.addUniqueKeyDesc(uniqueKeyDesc); } } } /** * テーブルを取得します。 * * @param entityMeta * エンティティメタデータ * @return テーブル */ protected Table getTable(EntityMeta entityMeta) { Class<?> clazz = entityMeta.getEntityClass(); Table table = clazz.getAnnotation(Table.class); return table != null ? table : DEFAULT_TABLE; } }
[ "koichik@319488c0-e101-0410-93bc-b5e51f62721a" ]
koichik@319488c0-e101-0410-93bc-b5e51f62721a
201680da0f72754a95185752c07360891523e15b
13e43e0b33e009d445c44719a5a088003636de7e
/src/test/java/sqlit/cli/ClientTest.java
663d3ae942b4f0f4ea8a1ba24eb3d35ed1121964
[]
no_license
seabornlee/sqlit
a840278312d98ac39ccf4f91ac798de819a6f5d1
c4a98fa2cf0199bba35bb3bac078aa23fe2cefff
refs/heads/master
2022-12-10T07:02:43.628528
2020-09-03T03:59:36
2020-09-03T03:59:36
291,438,214
0
0
null
null
null
null
UTF-8
Java
false
false
1,360
java
package sqlit.cli; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import sqlit.runner.SqlitRunner; import java.io.IOException; import java.net.ConnectException; import static org.assertj.core.api.Assertions.assertThat; class ClientTest { @Test void should_connect_to_running_instance() throws ConnectException { SqlitRunner server = new SqlitRunner(); server.run(); Client client = new Client("localhost", 3000); client.connect(); assertThat(client.isConnected()).isTrue(); server.shutdown(); } @Test void should_show_tables() throws IOException { SqlitRunner server = new SqlitRunner(); server.run(); Client client = new Client("localhost", 3000); client.connect(); String result = client.exec("show tables;"); assertThat(result).isEqualTo("No table found."); server.shutdown(); } @Test void should_got_exception_when_instance_not_running() { Client client = new Client("localhost", 3000); ConnectException exception = Assertions.assertThrows(ConnectException.class, client::connect); assertThat(exception.getMessage()).isEqualTo("Cannot connect to [localhost:3000]. Probably server not running."); assertThat(client.isConnected()).isFalse(); } }
d9a0491e526fcabc770863e88a6f6241208d1025
c1a3f8746acfd70d5117cc8954b34e3f92fc0a2a
/app/src/main/java/com/linktech/gft/view/DisallowClickTabLayout.java
d738eb2c493fd5bf97c90206d7852154b9e735a5
[]
no_license
mnlin0905/GFT
00e62b8166623aacf11c17babd91aa714eea22b8
6db4f8b8d1d70933d2be743ce2a7ccb74c67058c
refs/heads/master
2023-04-12T07:44:48.956080
2023-03-24T12:53:56
2023-03-24T12:53:56
209,274,398
0
1
null
null
null
null
UTF-8
Java
false
false
1,561
java
package com.linktech.gft.view; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import com.linktech.gft.skin.MySkinMaterialTabLayout; /** * Created on 2018/1/24 * function : 可以禁止点击事件的tabLayout * * @author LinkTech */ public class DisallowClickTabLayout extends MySkinMaterialTabLayout { private ManageClickInterface manageClickInterface; public DisallowClickTabLayout(Context context) { super(context); } public DisallowClickTabLayout(Context context, AttributeSet attrs) { super(context, attrs); } public DisallowClickTabLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (manageClickInterface != null && ev.getAction() == MotionEvent.ACTION_UP && !manageClickInterface.currentCanClick()) { //当手指抬起时,拦截掉事件,之后不做任何处理 return true; } //如果前面条件不满足,则默认会采取拦截点击事件处理 return super.onInterceptTouchEvent(ev); } public void setManageClickInterface(ManageClickInterface manageClickInterface) { this.manageClickInterface = manageClickInterface; } /** * 控制接口 */ public interface ManageClickInterface { /** * @return true表示当前不拦截任何事件 */ boolean currentCanClick(); } }
c7324a5d7117b118b8d7f7329f491054f3110277
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-422-11-3-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/wikimodel/impl/InternalWikiScannerContext_ESTest_scaffolding.java
f1ba81aff505e6e5e41785736a8fb51c8937a67e
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
465
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Apr 07 00:00:09 UTC 2020 */ package org.xwiki.rendering.wikimodel.impl; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class InternalWikiScannerContext_ESTest_scaffolding { // Empty scaffolding for empty test suite }
849b4292b3f328cc6832dbadfcfe0f3603b7e529
7962858de1404492bdd34b6b55ed1601d0af7d06
/src/main/java/com/cf/TradingAPIClient.java
c38055bbdd8e62d8ab4e107c244710b239a8229f
[ "MIT" ]
permissive
aikidistas/poloniex-java-client
ca037758449002332c94a81b744e3267acb7f718
456e3925070d46ce7cfd615c6ebebbd968503890
refs/heads/master
2022-12-26T20:14:27.302392
2018-06-13T09:08:23
2018-06-13T09:08:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,164
java
package com.cf; import java.math.BigDecimal; /** * * @author David */ public interface TradingAPIClient { public String returnBalances(); public String returnCompleteBalances(); public String returnFeeInfo(); public String returnOpenOrders(String currencyPair); public String returnTradeHistory(String currencyPair); public String cancelOrder(String orderNumber); public String moveOrder(String orderNumber, BigDecimal rate); public String sell(String currencyPair, BigDecimal buyPrice, BigDecimal amount, boolean fillOrKill, boolean immediateOrCancel, boolean postOnly); public String buy(String currencyPair, BigDecimal buyPrice, BigDecimal amount, boolean fillOrKill, boolean immediateOrCancel, boolean postOnly); // Lending APIs public String returnActiveLoans(); public String returnLendingHistory(int hours, int limit); public String createLoanOffer(String currency, BigDecimal amount, BigDecimal lendingRate, int duration, boolean autoRenew); public String cancelLoanOffer(String orderNumber); public String returnOpenLoanOffers(); public String toggleAutoRenew(String orderNumber); }
ff82171acdccd6999c2ff213f2a6e9170334ba0b
3f02d9819888d93c9d4e6dd97b4d10fe58edca5b
/basex-core/src/main/java/org/basex/io/random/DataAccess.java
293416ed8e6a2a095de85f80947527fc048de56d
[ "BSD-3-Clause" ]
permissive
mingarao/basex
41bace7b9e3a28fb86c5ee6dc617fab1e466f905
386a7a2295d2c523c396f6c05f91740a9410b3cc
refs/heads/master
2021-01-15T12:16:04.348358
2014-02-15T15:28:56
2014-02-15T15:28:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,720
java
package org.basex.io.random; import java.io.*; import org.basex.io.*; import org.basex.util.*; /** * This class allows positional read and write access to a database file. * * @author BaseX Team 2005-14, BSD License * @author Christian Gruen */ public final class DataAccess { /** Buffer manager. */ private final Buffers bm = new Buffers(); /** Reference to the data input stream. */ private final RandomAccessFile file; /** File length. */ private long len; /** Changed flag. */ private boolean changed; /** Offset. */ private int off; /** * Constructor, initializing the file reader. * @param fl the file to be read * @throws IOException I/O Exception */ public DataAccess(final IOFile fl) throws IOException { RandomAccessFile f = null; try { f = new RandomAccessFile(fl.file(), "rw"); len = f.length(); } catch(final IOException ex) { if(f != null) f.close(); throw ex; } file = f; cursor(0); } /** * Flushes the buffered data. */ public synchronized void flush() { try { for(final Buffer b : bm.all()) if(b.dirty) writeBlock(b); if(changed) { file.setLength(len); changed = false; } } catch(final IOException ex) { Util.stack(ex); } } /** * Closes the data access. */ public synchronized void close() { flush(); try { file.close(); } catch(final IOException ex) { Util.stack(ex); } } /** * Returns the current file position. * @return position in the file */ public long cursor() { return buffer(false).pos + off; } /** * Sets the file length. * @param l file length */ synchronized void length(final long l) { changed |= l != len; len = l; } /** * Returns the file length. * @return file length */ public long length() { return len; } /** * Checks if more bytes can be read. * @return result of check */ public boolean more() { return cursor() < len; } /** * Reads the next byte. * @return next byte */ public int read() { final Buffer bf = buffer(off == IO.BLOCKSIZE); return bf.data[off++] & 0xFF; } /** * Reads a byte value from the specified position. * @param p position * @return integer value */ public synchronized byte read1(final long p) { cursor(p); return read1(); } /** * Reads a byte value. * @return integer value */ public synchronized byte read1() { return (byte) read(); } /** * Reads an integer value from the specified position. * @param p position * @return integer value */ public synchronized int read4(final long p) { cursor(p); return read4(); } /** * Reads an integer value. * @return integer value */ public synchronized int read4() { return (read() << 24) + (read() << 16) + (read() << 8) + read(); } /** * Reads a 5-byte value from the specified file offset. * @param p position * @return long value */ public synchronized long read5(final long p) { cursor(p); return read5(); } /** * Reads a 5-byte value. * @return long value */ public synchronized long read5() { return ((long) read() << 32) + ((long) read() << 24) + (read() << 16) + (read() << 8) + read(); } /** * Reads a {@link Num} value from disk. * @param p text position * @return read num */ public synchronized int readNum(final long p) { cursor(p); return readNum(); } /** * Reads a token from disk. * @param p text position * @return text as byte array */ public synchronized byte[] readToken(final long p) { cursor(p); return readToken(); } /** * Reads the next token from disk. * @return text as byte array */ public synchronized byte[] readToken() { final int l = readNum(); return readBytes(l); } /** * Reads a number of bytes from the specified offset. * @param p position * @param l length * @return byte array */ public synchronized byte[] readBytes(final long p, final int l) { cursor(p); return readBytes(l); } /** * Reads a number of bytes. * @param n length * @return byte array */ public synchronized byte[] readBytes(final int n) { int l = n; int ll = IO.BLOCKSIZE - off; final byte[] b = new byte[l]; System.arraycopy(buffer(false).data, off, b, 0, Math.min(l, ll)); if(l > ll) { l -= ll; while(l > IO.BLOCKSIZE) { System.arraycopy(buffer(true).data, 0, b, ll, IO.BLOCKSIZE); ll += IO.BLOCKSIZE; l -= IO.BLOCKSIZE; } System.arraycopy(buffer(true).data, 0, b, ll, l); } off += l; return b; } /** * Sets the disk cursor. * @param p read position */ public void cursor(final long p) { off = (int) (p & IO.BLOCKSIZE - 1); final long b = p - off; if(!bm.cursor(b)) return; final Buffer bf = bm.current(); try { if(bf.dirty) writeBlock(bf); bf.pos = b; file.seek(bf.pos); if(bf.pos < file.length()) file.readFully(bf.data, 0, (int) Math.min(len - bf.pos, IO.BLOCKSIZE)); } catch(final IOException ex) { Util.stack(ex); } } /** * Reads the next compressed number and returns it as integer. * @return next integer */ public synchronized int readNum() { final int v = read(); switch(v & 0xC0) { case 0: return v; case 0x40: return (v - 0x40 << 8) + read(); case 0x80: return (v - 0x80 << 24) + (read() << 16) + (read() << 8) + read(); default: return (read() << 24) + (read() << 16) + (read() << 8) + read(); } } /** * Writes the next byte. * @param b byte to be written */ public void write(final int b) { final Buffer bf = buffer(off == IO.BLOCKSIZE); bf.dirty = true; bf.data[off++] = (byte) b; final long nl = bf.pos + off; if(nl > len) length(nl); } /** * Writes a 5-byte value to the specified position. * @param p position in the file * @param v value to be written */ public void write5(final long p, final long v) { cursor(p); write((byte) (v >>> 32)); write((byte) (v >>> 24)); write((byte) (v >>> 16)); write((byte) (v >>> 8)); write((byte) v); } /** * Writes an integer value to the specified position. * @param p write position * @param v byte array to be appended */ public void write4(final long p, final int v) { cursor(p); write4(v); } /** * Writes an integer value to the current position. * @param v value to be written */ public void write4(final int v) { write(v >>> 24); write(v >>> 16); write(v >>> 8); write(v); } /** * Write a value to the file. * @param p write position * @param v value to be written */ public void writeNum(final long p, final int v) { cursor(p); writeNum(v); } /** * Writes integers to the file in compressed form. * @param p write position * @param v integer values */ public void writeNums(final long p, final int[] v) { cursor(p); writeNum(v.length); for(final int n : v) writeNum(n); } /** * Appends integers to the file in compressed form. * @param v integer values * @return the position in the file where the values have been written */ public long appendNums(final int[] v) { final long end = len; writeNums(end, v); return end; } /** * Appends a value to the file and return it's offset. * @param p write position * @param v byte array to be appended */ public void writeToken(final long p, final byte[] v) { cursor(p); writeToken(v, 0, v.length); } /** * Write a token to the file. * @param buf buffer containing the token * @param offset offset in the buffer where the token starts * @param length token length */ void writeToken(final byte[] buf, final int offset, final int length) { writeNum(length); final int last = offset + length; int o = offset; while(o < last) { final Buffer bf = buffer(off == IO.BLOCKSIZE); final int l = Math.min(last - o, IO.BLOCKSIZE - off); System.arraycopy(buf, o, bf.data, off, l); bf.dirty = true; off += l; o += l; } // adjust file size if needed final long nl = bm.current().pos + off; if(nl > len) length(nl); } /** * Appends a value to the file and return it's offset. * @param v number to be appended */ private void writeNum(final int v) { if(v < 0 || v > 0x3FFFFFFF) { write(0xC0); write(v >>> 24); write(v >>> 16); write(v >>> 8); write(v); } else if(v > 0x3FFF) { write(v >>> 24 | 0x80); write(v >>> 16); write(v >>> 8); write(v); } else if(v > 0x3F) { write(v >>> 8 | 0x40); write(v); } else { write(v); } } /** * Returns the offset to a free slot for writing an entry with the * specified length. Fills the original space with 0xFF to facilitate * future write operations. * @param pos original offset * @param size size of new text entry * @return new offset to store text */ public long free(final long pos, final int size) { // old text size (available space) int os = readNum(pos) + (int) (cursor() - pos); // extend available space by subsequent zero-bytes cursor(pos + os); for(; pos + os < len && os < size && read() == 0xFF; os++); long o = pos; if(pos + os == len) { // entry is placed last: reset file length (discard last entry) length(pos); } else { int t = size; if(os < size) { // gap is too small for new entry... // reset cursor to overwrite entry with zero-bytes cursor(pos); t = 0; // place new entry after last entry o = len; } else { // gap is large enough: set cursor to overwrite remaining bytes cursor(pos + size); } // fill gap with 0xFF for future updates while(t++ < os) write(0xFF); } return o; } // PRIVATE METHODS ========================================================== /** * Writes the specified block to disk. * @param bf buffer to write * @throws IOException I/O exception */ private void writeBlock(final Buffer bf) throws IOException { file.seek(bf.pos); file.write(bf.data); bf.dirty = false; } /** * Returns the current or next buffer. * @param next next block * @return buffer */ private Buffer buffer(final boolean next) { if(next) cursor(bm.current().pos + IO.BLOCKSIZE); return bm.current(); } }
d2b57e1f71d4b9ddcc85a1c810ef5cf6bcbf8889
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_0f65a0f23995f31851c056b56ddd46e9527c22b1/EvalTag/2_0f65a0f23995f31851c056b56ddd46e9527c22b1_EvalTag_s.java
68dfa9a4fd8b31413acca15eb4b543b922a541f0
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,979
java
/* * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.web.servlet.tags; import java.io.IOException; import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; import org.springframework.beans.BeansException; import org.springframework.core.convert.ConversionService; import org.springframework.expression.AccessException; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; import org.springframework.expression.ExpressionParser; import org.springframework.expression.PropertyAccessor; import org.springframework.expression.TypedValue; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.expression.spel.support.StandardTypeConverter; import org.springframework.web.util.ExpressionEvaluationUtils; import org.springframework.web.util.HtmlUtils; import org.springframework.web.util.JavaScriptUtils; import org.springframework.web.util.TagUtils; /** * JSP tag for evaluating expressions with the Spring Expression Language (SpEL). * Supports the standard JSP evaluation context consisting of implicit variables and scoped attributes. * * @author Keith Donald * @since 3.0.1 */ public class EvalTag extends HtmlEscapingAwareTag { private ExpressionParser expressionParser; private String expression; private String var; private int scope = PageContext.PAGE_SCOPE; private boolean javaScriptEscape = false; /** * Set the expression to evaluate. */ public void setExpression(String expression) { this.expression = expression; } /** * Set the variable name to expose the evaluation result under. * Defaults to rendering the result to the current JspWriter */ public void setVar(String var) { this.var = var; } /** * Set the scope to export the evaluation result to. * This attribute has no meaning unless var is also defined. */ public void setScope(String scope) { this.scope = TagUtils.getScope(scope); } /** * Set JavaScript escaping for this tag, as boolean value. * Default is "false". */ public void setJavaScriptEscape(String javaScriptEscape) throws JspException { this.javaScriptEscape = ExpressionEvaluationUtils.evaluateBoolean("javaScriptEscape", javaScriptEscape, this.pageContext); } @Override public int doStartTagInternal() throws JspException { this.expressionParser = new SpelExpressionParser(); return EVAL_BODY_INCLUDE; } @Override public int doEndTag() throws JspException { Expression expression = this.expressionParser.parseExpression(this.expression); EvaluationContext context = createEvaluationContext(); if (this.var == null) { try { String result = expression.getValue(context, String.class); result = isHtmlEscape() ? HtmlUtils.htmlEscape(result) : result; result = this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(result) : result; pageContext.getOut().print(result); } catch (IOException e) { throw new JspException(e); } } else { pageContext.setAttribute(var, expression.getValue(context), scope); } return EVAL_PAGE; } private EvaluationContext createEvaluationContext() { StandardEvaluationContext context = new StandardEvaluationContext(); context.addPropertyAccessor(new JspPropertyAccessor(this.pageContext)); ConversionService conversionService = getConversionService(); if (conversionService != null) { context.setTypeConverter(new StandardTypeConverter()); } return context; } private ConversionService getConversionService() { try { return (ConversionService) this.pageContext.getRequest().getAttribute("org.springframework.core.convert.ConversionService"); } catch (BeansException e) { return null; } } private static class JspPropertyAccessor implements PropertyAccessor { private PageContext pageContext; public JspPropertyAccessor(PageContext pageContext) { this.pageContext = pageContext; } public Class<?>[] getSpecificTargetClasses() { return null; } public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException { if (name.equals("pageContext")) { return true; } // TODO support all other JSP implicit variables defined at http://java.sun.com/javaee/6/docs/api/javax/servlet/jsp/el/ImplicitObjectELResolver.html return this.pageContext.findAttribute(name) != null; } public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { if (name.equals("pageContext")) { return new TypedValue(this.pageContext); } // TODO support all other JSP implicit variables defined at http://java.sun.com/javaee/6/docs/api/javax/servlet/jsp/el/ImplicitObjectELResolver.html return new TypedValue(this.pageContext.findAttribute(name)); } public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException { return false; } public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException { throw new UnsupportedOperationException(); } } }
43ab7d32b75180ec7b181006501b6b717c087306
10186b7d128e5e61f6baf491e0947db76b0dadbc
/c/a/c/b/k.java
62c56139022072bbe876b44b697d393b030836a9
[ "SMLNJ", "Apache-1.1", "Apache-2.0", "BSD-2-Clause" ]
permissive
MewX/contendo-viewer-v1.6.3
7aa1021e8290378315a480ede6640fd1ef5fdfd7
69fba3cea4f9a43e48f43148774cfa61b388e7de
refs/heads/main
2022-07-30T04:51:40.637912
2021-03-28T05:06:26
2021-03-28T05:06:26
351,630,911
2
0
Apache-2.0
2021-10-12T22:24:53
2021-03-26T01:53:24
Java
UTF-8
Java
false
false
156,631
java
/* */ package c.a.c.b; /* */ /* */ import c.a.c.c; /* */ import c.a.c.f; /* */ import c.a.g; /* */ import c.a.i.c; /* */ import c.a.i.l; /* */ import c.a.j.a.g; /* */ import java.awt.Point; /* */ import java.util.Stack; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class k /* */ extends g /* */ implements f /* */ { /* */ private static final boolean A = false; /* */ private long[] B; /* */ public static final String c = "jj2000.j2k.entropy.encoder.StdEntropyCoder.nthreads"; /* */ public static final String d = "0"; /* */ public static final int e = 0; /* */ private l C; /* */ private Stack D; /* */ private Stack[] E; /* */ private int[] F; /* */ private boolean[] G; /* */ private i[] H; /* */ private a[] I; /* */ private b[] J; /* */ private c.a.c.a K; /* */ private c L; /* */ public g f; /* */ public g g; /* */ public g h; /* */ public g i; /* */ public g j; /* */ public g y; /* */ public g z; /* */ private int[][] M; /* */ private int[][] N; /* */ private int[][] O; /* */ private static final int P = 8; /* 220 */ private static final int[] Q = new int[256]; /* */ /* */ /* 223 */ private static final int[] R = new int[256]; /* */ /* */ /* 226 */ private static final int[] S = new int[256]; /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static final int T = 9; /* */ /* */ /* */ /* */ /* */ /* */ /* 240 */ private static final int[] U = new int[512]; /* */ /* */ /* */ /* */ private static final int V = 15; /* */ /* */ /* */ private static final int W = 31; /* */ /* */ /* */ private static final int X = -2147483648; /* */ /* */ /* */ private static final int Y = 9; /* */ /* */ /* 256 */ private static final int[] Z = new int[512]; /* */ /* */ /* */ /* */ private static final int aa = 19; /* */ /* */ /* */ private static final int ab = 1; /* */ /* */ /* */ private static final int ac = 0; /* */ /* */ /* 269 */ private static final int[] ad = new int[] { 46, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* */ /* */ /* */ /* 273 */ private static final int[] ae = new int[] { 1, 0, 1, 0 }; /* */ /* */ /* */ /* 277 */ private static final int[] af = new int[] { 0, 0, 0, 0 }; /* */ /* */ /* */ /* */ /* */ private int[][] ag; /* */ /* */ /* */ /* */ /* */ private static final int ah = 16; /* */ /* */ /* */ /* */ /* */ private static final int ai = 32768; /* */ /* */ /* */ /* */ /* */ private static final int aj = 16384; /* */ /* */ /* */ /* */ /* */ private static final int ak = 8192; /* */ /* */ /* */ /* */ /* */ private static final int al = 4096; /* */ /* */ /* */ /* */ /* */ private static final int am = 2048; /* */ /* */ /* */ /* */ /* */ private static final int an = 1024; /* */ /* */ /* */ /* */ /* */ private static final int ao = 512; /* */ /* */ /* */ /* */ /* */ private static final int ap = 256; /* */ /* */ /* */ /* */ /* */ private static final int aq = 128; /* */ /* */ /* */ /* */ /* */ private static final int ar = 64; /* */ /* */ /* */ /* */ /* */ private static final int as = 32; /* */ /* */ /* */ /* */ /* */ private static final int at = 16; /* */ /* */ /* */ /* */ /* */ private static final int au = 8; /* */ /* */ /* */ /* */ /* */ private static final int av = 4; /* */ /* */ /* */ /* */ /* */ private static final int aw = 2; /* */ /* */ /* */ /* */ /* */ private static final int ax = 1; /* */ /* */ /* */ /* */ /* */ private static final int ay = -2147483648; /* */ /* */ /* */ /* */ /* */ private static final int az = 1073741824; /* */ /* */ /* */ /* */ /* */ private static final int aA = 536870912; /* */ /* */ /* */ /* */ /* */ private static final int aB = 268435456; /* */ /* */ /* */ /* */ /* */ private static final int aC = 134217728; /* */ /* */ /* */ /* */ /* */ private static final int aD = 67108864; /* */ /* */ /* */ /* */ /* */ private static final int aE = 33554432; /* */ /* */ /* */ /* */ /* */ private static final int aF = 16777216; /* */ /* */ /* */ /* */ /* */ private static final int aG = 8388608; /* */ /* */ /* */ /* */ /* */ private static final int aH = 4194304; /* */ /* */ /* */ /* */ /* */ private static final int aI = 2097152; /* */ /* */ /* */ /* */ /* */ private static final int aJ = 1048576; /* */ /* */ /* */ /* */ /* */ private static final int aK = 524288; /* */ /* */ /* */ /* */ /* */ private static final int aL = 262144; /* */ /* */ /* */ /* */ /* */ private static final int aM = 131072; /* */ /* */ /* */ /* */ /* */ private static final int aN = 65536; /* */ /* */ /* */ /* */ /* */ private static final int aO = -2147450880; /* */ /* */ /* */ /* */ /* */ private static final int aP = 1073758208; /* */ /* */ /* */ /* */ /* */ private static final int aQ = -536813568; /* */ /* */ /* */ /* */ private static final int aR = 255; /* */ /* */ /* */ /* */ private static final int aS = 4; /* */ /* */ /* */ /* */ private static final int aT = 20; /* */ /* */ /* */ /* */ private static final int aU = 511; /* */ /* */ /* */ /* */ private static final int aV = 511; /* */ /* */ /* */ /* */ private static final int aW = 7; /* */ /* */ /* */ /* */ private static final int aX = 13; /* */ /* */ /* */ /* 494 */ private static final int[] aY = new int[64]; /* */ /* */ /* */ /* 498 */ private static final int[] aZ = new int[128]; /* */ /* */ /* */ /* */ /* */ /* 504 */ private static final int[] ba = new int[64]; /* */ /* */ /* */ /* */ /* */ /* */ /* 511 */ private static final int[] bb = new int[128]; /* */ /* */ /* */ /* */ /* */ private double[][] bc; /* */ /* */ /* */ /* */ /* */ private int[][] bd; /* */ /* */ /* */ /* */ /* */ private boolean[][] be; /* */ /* */ /* */ /* */ /* */ private g[] bf; /* */ /* */ /* */ /* */ /* */ private int[][] bg; /* */ /* */ /* */ /* */ /* */ private int[][] bh; /* */ /* */ /* */ /* */ /* */ private boolean[][] bi; /* */ /* */ /* */ /* */ /* */ private class a /* */ implements Runnable /* */ { /* */ private final int h; /* */ /* */ /* */ /* */ c a; /* */ /* */ /* */ /* */ int b; /* */ /* */ /* */ /* */ int c; /* */ /* */ /* */ /* */ boolean d; /* */ /* */ /* */ /* */ int e; /* */ /* */ /* */ /* */ int f; /* */ /* */ /* */ /* */ private long[] i; /* */ /* */ /* */ /* */ /* */ a(k this$0, int idx) { /* 588 */ this.h = idx; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void run() { /* */ try { /* 602 */ long stime = 0L; /* */ /* 604 */ k.a(this.b, this.a, k.a(this.g)[this.h], k.b(this.g)[this.h], k.c(this.g)[this.h], /* 605 */ k.d(this.g)[this.h], k.e(this.g)[this.h], k.f(this.g)[this.h], /* 606 */ k.g(this.g)[this.h], k.h(this.g)[this.h], /* 607 */ k.i(this.g)[this.h], k.j(this.g)[this.h], this.c, this.d, this.e, this.f); /* */ /* */ /* */ } /* */ finally { /* */ /* */ /* 614 */ k.k(this.g)[this.b].push(this); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ synchronized long a(int i) { /* 633 */ return 0L; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int a() { /* 643 */ return this.h; /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ static { /* 661 */ Q[0] = 2; /* */ /* */ int m; /* 664 */ for (m = 1; m < 16; m++) { /* 665 */ Q[m] = 4; /* */ } /* 667 */ for (m = 0; m < 4; m++) { /* 668 */ Q[1 << m] = 3; /* */ } /* */ /* 671 */ for (m = 0; m < 16; m++) { /* */ /* 673 */ Q[0x20 | m] = 5; /* 674 */ Q[0x10 | m] = 5; /* */ /* 676 */ Q[0x30 | m] = 6; /* */ } /* */ /* 679 */ Q[128] = 7; /* 680 */ Q[64] = 7; /* */ /* */ /* 683 */ for (m = 1; m < 16; m++) { /* 684 */ Q[0x80 | m] = 8; /* 685 */ Q[0x40 | m] = 8; /* */ } /* */ /* */ /* 689 */ for (m = 1; m < 4; m++) { /* 690 */ for (int n = 0; n < 16; n++) { /* 691 */ Q[0x80 | m << 4 | n] = 9; /* 692 */ Q[0x40 | m << 4 | n] = 9; /* */ } /* */ } /* */ /* 696 */ for (m = 0; m < 64; m++) { /* 697 */ Q[0xC0 | m] = 10; /* */ } /* */ /* */ /* */ /* */ /* 703 */ R[0] = 2; /* */ /* 705 */ for (m = 1; m < 16; m++) { /* 706 */ R[m] = 4; /* */ } /* 708 */ for (m = 0; m < 4; m++) { /* 709 */ R[1 << m] = 3; /* */ } /* */ /* 712 */ for (m = 0; m < 16; m++) { /* */ /* 714 */ R[0x80 | m] = 5; /* 715 */ R[0x40 | m] = 5; /* */ /* 717 */ R[0xC0 | m] = 6; /* */ } /* */ /* 720 */ R[32] = 7; /* 721 */ R[16] = 7; /* */ /* */ /* 724 */ for (m = 1; m < 16; m++) { /* 725 */ R[0x20 | m] = 8; /* 726 */ R[0x10 | m] = 8; /* */ } /* */ /* */ /* 730 */ for (m = 1; m < 4; m++) { /* 731 */ for (int n = 0; n < 16; n++) { /* 732 */ R[m << 6 | 0x20 | n] = 9; /* 733 */ R[m << 6 | 0x10 | n] = 9; /* */ } /* */ } /* */ /* 737 */ for (m = 0; m < 4; m++) { /* 738 */ for (int n = 0; n < 16; n++) { /* 739 */ R[m << 6 | 0x20 | 0x10 | n] = 10; /* */ } /* */ } /* */ /* */ /* 744 */ int[] twoBits = { 3, 5, 6, 9, 10, 12 }; /* */ /* */ /* 747 */ int[] oneBit = { 1, 2, 4, 8 }; /* */ /* */ /* 750 */ int[] twoLeast = { 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15 }; /* */ /* */ /* */ /* 754 */ int[] threeLeast = { 7, 11, 13, 14, 15 }; /* */ /* */ /* */ /* */ /* 759 */ S[0] = 2; /* */ /* */ /* 762 */ for (m = 0; m < oneBit.length; m++) { /* 763 */ S[oneBit[m] << 4] = 3; /* */ } /* */ /* 766 */ for (m = 0; m < twoLeast.length; m++) { /* 767 */ S[twoLeast[m] << 4] = 4; /* */ } /* */ /* 770 */ for (m = 0; m < oneBit.length; m++) { /* 771 */ S[oneBit[m]] = 5; /* */ } /* */ /* 774 */ for (m = 0; m < oneBit.length; m++) { /* 775 */ for (int n = 0; n < oneBit.length; n++) { /* 776 */ S[oneBit[m] << 4 | oneBit[n]] = 6; /* */ } /* */ } /* 779 */ for (m = 0; m < twoLeast.length; m++) { /* 780 */ for (int n = 0; n < oneBit.length; n++) { /* 781 */ S[twoLeast[m] << 4 | oneBit[n]] = 7; /* */ } /* */ } /* 784 */ for (m = 0; m < twoBits.length; m++) { /* 785 */ S[twoBits[m]] = 8; /* */ } /* */ int j; /* 788 */ for (j = 0; j < twoBits.length; j++) { /* 789 */ for (m = 1; m < 16; m++) { /* 790 */ S[m << 4 | twoBits[j]] = 9; /* */ } /* */ } /* 793 */ for (m = 0; m < 16; m++) { /* 794 */ for (j = 0; j < threeLeast.length; j++) { /* 795 */ S[m << 4 | threeLeast[j]] = 10; /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* 803 */ int[] inter_sc_lut = new int[36]; /* 804 */ inter_sc_lut[18] = 15; /* 805 */ inter_sc_lut[17] = 14; /* 806 */ inter_sc_lut[16] = 13; /* 807 */ inter_sc_lut[10] = 12; /* 808 */ inter_sc_lut[9] = 11; /* 809 */ inter_sc_lut[8] = -2147483636; /* 810 */ inter_sc_lut[2] = -2147483635; /* 811 */ inter_sc_lut[1] = -2147483634; /* 812 */ inter_sc_lut[0] = -2147483633; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 821 */ for (m = 0; m < 511; m++) { /* 822 */ int ds = m & 0x1; /* 823 */ int us = m >> 1 & 0x1; /* 824 */ int rs = m >> 2 & 0x1; /* 825 */ int ls = m >> 3 & 0x1; /* 826 */ int dsgn = m >> 5 & 0x1; /* 827 */ int usgn = m >> 6 & 0x1; /* 828 */ int rsgn = m >> 7 & 0x1; /* 829 */ int lsgn = m >> 8 & 0x1; /* */ /* 831 */ int h = ls * (1 - 2 * lsgn) + rs * (1 - 2 * rsgn); /* 832 */ h = (h >= -1) ? h : -1; /* 833 */ h = (h <= 1) ? h : 1; /* 834 */ int v = us * (1 - 2 * usgn) + ds * (1 - 2 * dsgn); /* 835 */ v = (v >= -1) ? v : -1; /* 836 */ v = (v <= 1) ? v : 1; /* */ /* 838 */ U[m] = inter_sc_lut[h + 1 << 3 | v + 1]; /* */ } /* 840 */ inter_sc_lut = null; /* */ /* */ /* */ /* */ /* 845 */ Z[0] = 16; /* */ /* 847 */ for (m = 1; m < 256; m++) { /* 848 */ Z[m] = 17; /* */ } /* */ /* 851 */ for (; m < 512; m++) { /* 852 */ Z[m] = 18; /* */ } /* */ /* */ /* */ /* */ /* 858 */ for (m = 0; m < 64; m++) { /* */ /* 860 */ double val = m / 64.0D + 1.0D; /* 861 */ double deltaMSE = val * val; /* 862 */ ba[m] = /* 863 */ (int)Math.floor(deltaMSE * 8192.0D + 0.5D); /* */ /* 865 */ val -= 1.5D; /* 866 */ deltaMSE -= val * val; /* 867 */ aY[m] = /* 868 */ (int)Math.floor(deltaMSE * 8192.0D + 0.5D); /* */ } /* */ /* */ /* */ /* 873 */ for (m = 0; m < 128; m++) { /* 874 */ double val = m / 64.0D; /* 875 */ double deltaMSE = (val - 1.0D) * (val - 1.0D); /* 876 */ bb[m] = /* 877 */ (int)Math.floor(deltaMSE * 8192.0D + 0.5D); /* */ /* 879 */ val -= (m < 64) ? 0.5D : 1.5D; /* 880 */ deltaMSE -= val * val; /* 881 */ aZ[m] = /* 882 */ (int)Math.floor(deltaMSE * 8192.0D + 0.5D); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public k(c.a.g.b.a src, c.a.c.a cblks, c pss, g bms, g mqrs, g rts, g css, g sss, g lcs, g tts) { /* 921 */ super(src); int nt, tsl; this.M = (int[][])null; this.N = (int[][])null; this.O = (int[][])null; /* 922 */ this.K = cblks; /* 923 */ this.L = pss; /* 924 */ this.f = bms; /* 925 */ this.g = mqrs; /* 926 */ this.h = rts; /* 927 */ this.i = css; /* 928 */ this.j = sss; /* 929 */ this.y = lcs; /* 930 */ this.z = tts; /* */ /* */ /* */ /* */ /* */ /* */ /* 937 */ int maxCBlkWidth = cblks.a(); /* 938 */ int maxCBlkHeight = cblks.b(); /* */ /* */ /* */ try { /* */ try { /* 943 */ nt = Integer.parseInt(System.getProperty("jj2000.j2k.entropy.encoder.StdEntropyCoder.nthreads", "0")); /* */ } /* 945 */ catch (SecurityException se) { /* */ /* 947 */ nt = Integer.parseInt("0"); /* */ } /* 949 */ if (nt < 0) throw new NumberFormatException(); /* 950 */ } catch (NumberFormatException e) { /* 951 */ throw new IllegalArgumentException("Invalid number of threads for entropy coding in property jj2000.j2k.entropy.encoder.StdEntropyCoder.nthreads"); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 965 */ if (nt > 0) { /* 966 */ c.b() /* 967 */ .printmsg(1, "Using multithreaded entropy coder with " + nt + " compressor threads."); /* */ /* */ /* 970 */ tsl = nt; /* 971 */ this.C = new l(nt, Thread.currentThread().getPriority() + 0, "StdEntropyCoder"); /* */ /* 973 */ this.D = new Stack(); /* 974 */ this.E = new Stack[src.getNumComps()]; /* 975 */ this.F = new int[src.getNumComps()]; /* 976 */ this.G = new boolean[src.getNumComps()]; int n; /* 977 */ for (n = src.getNumComps() - 1; n >= 0; n--) { /* 978 */ this.E[n] = new Stack(); /* */ } /* 980 */ for (n = 0; n < nt; n++) { /* 981 */ this.D.push(new a(this, n)); /* */ } /* */ } else { /* */ /* 985 */ tsl = 1; /* 986 */ this.C = null; /* 987 */ this.D = null; /* 988 */ this.E = null; /* 989 */ this.F = null; /* 990 */ this.G = null; /* */ } /* */ /* */ /* 994 */ this.J = new b[tsl]; /* 995 */ this.H = new i[tsl]; /* 996 */ this.I = new a[tsl]; /* 997 */ this.ag = new int[tsl][(maxCBlkWidth + 2) * ((maxCBlkHeight + 1) / 2 + 2)]; /* 998 */ this.bg = new int[tsl][maxCBlkWidth * 10]; /* 999 */ this.bh = new int[tsl][maxCBlkWidth * 10]; /* 1000 */ this.bc = new double[tsl][96]; /* 1001 */ this.bd = new int[tsl][96]; /* 1002 */ this.be = new boolean[tsl][96]; /* 1003 */ this.bf = new g[tsl]; /* 1004 */ for (int j = 0; j < tsl; j++) { /* 1005 */ this.J[j] = new b(); /* 1006 */ this.H[j] = new i(this.J[j], 19, ad); /* */ } /* 1008 */ this.bi = new boolean[src.getNumComps()][src.getNumTiles()]; /* */ /* */ /* 1011 */ Point numTiles = src.getNumTiles(null); /* */ /* 1013 */ int nc = getNumComps(); /* 1014 */ f(getNumTiles(), nc); /* */ /* 1016 */ for (int m = 0; m < nc; m++) { /* 1017 */ for (int tY = 0; tY < numTiles.y; tY++) { /* 1018 */ for (int tX = 0; tX < numTiles.x; tX++) { /* 1019 */ this.bi[m][this.k] = false; /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void finalize() throws Throwable { /* 1079 */ super.finalize(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int b(int t, int j) { /* 1092 */ return this.K.a((byte)3, t, j); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int c(int t, int j) { /* 1105 */ return this.K.b((byte)3, t, j); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public c a(int j, c ccb) { /* 1139 */ long stime = 0L; /* 1140 */ if (this.C == null) { /* */ /* 1142 */ this.bf[0] = this.b.b(j, this.bf[0]); /* */ /* */ /* 1145 */ if (this.bf[0] == null) { /* 1146 */ return null; /* */ } /* */ /* 1149 */ if ((this.M[this.k][j] & 0x1) != 0 && this.I[0] == null) { /* 1150 */ this.I[0] = new a(this.J[0]); /* */ } /* */ /* 1153 */ if (ccb == null) { /* 1154 */ ccb = new c(); /* */ } /* */ /* 1157 */ b(j, ccb, this.bf[0], this.H[0], this.I[0], this.J[0], this.ag[0], this.bc[0], this.bd[0], this.be[0], this.bg[0], this.bh[0], this.M[this.k][j], /* */ /* */ /* 1160 */ d(this.k, j), this.N[this.k][j], this.O[this.k][j]); /* */ /* */ /* */ /* 1164 */ return ccb; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* 1172 */ while (!this.G[j] && !this.D.empty()) { /* */ /* 1174 */ a compr = this.D.pop(); /* 1175 */ int cIdx = compr.a(); /* */ /* */ /* 1178 */ this.bf[cIdx] = this.b.b(j, this.bf[cIdx]); /* */ /* 1180 */ if (this.bf[cIdx] != null) { /* */ /* 1182 */ if ((this.M[this.k][j] & 0x1) != 0 && this.I[cIdx] == null) { /* 1183 */ this.I[cIdx] = new a(this.J[cIdx]); /* */ } /* */ /* 1186 */ if (ccb == null) ccb = new c(); /* 1187 */ compr.a = ccb; /* 1188 */ compr.b = j; /* 1189 */ compr.c = this.M[this.k][j]; /* 1190 */ compr.d = d(this.k, j); /* 1191 */ compr.e = this.N[this.k][j]; /* 1192 */ compr.f = this.O[this.k][j]; /* 1193 */ this.F[j] = this.F[j] + 1; /* 1194 */ ccb = null; /* */ /* 1196 */ this.C.a(compr, this.E[j]); /* */ /* */ continue; /* */ } /* */ /* 1201 */ this.D.push(compr); /* 1202 */ this.G[j] = true; /* */ } /* */ /* */ /* */ /* 1207 */ if (this.F[j] > 0) { /* 1208 */ synchronized (this.E[j]) { /* */ /* 1210 */ if (this.E[j].empty()) { /* */ /* */ try { /* */ /* */ /* 1215 */ this.E[j].wait(); /* */ /* */ /* */ } /* 1219 */ catch (InterruptedException interruptedException) {} /* */ } /* */ /* */ /* */ /* 1224 */ a compr = this.E[j].pop(); /* 1225 */ int cIdx = compr.a(); /* 1226 */ this.F[j] = this.F[j] - 1; /* 1227 */ this.D.push(compr); /* */ /* 1229 */ this.C.b(); /* */ /* */ /* 1232 */ return compr.a; /* */ } /* */ } /* */ /* */ /* 1237 */ this.C.b(); /* */ /* */ /* */ /* 1241 */ return null; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void setTile(int x, int y) { /* 1259 */ super.setTile(x, y); /* */ /* 1261 */ if (this.G != null) { /* 1262 */ for (int j = this.b.getNumComps() - 1; j >= 0; j--) { /* 1263 */ this.G[j] = false; /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void nextTile() { /* 1278 */ if (this.G != null) { /* 1279 */ for (int j = this.b.getNumComps() - 1; j >= 0; j--) { /* 1280 */ this.G[j] = false; /* */ } /* */ } /* 1283 */ super.nextTile(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static void b(int j, c ccb, g srcblk, i mq, a bout, b out, int[] state, double[] distbuf, int[] ratebuf, boolean[] istermbuf, int[] symbuf, int[] ctxtbuf, int options, boolean rev, int lcType, int tType) { /* */ int[] zc_lut; /* 1360 */ if ((options & 0x10) != 0 && tType != 3) { /* 1361 */ throw new IllegalArgumentException("Embedded error-resilient info in MQ termination option specified but incorrect MQ termination policy specified"); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* 1369 */ mq.a(lcType); /* 1370 */ mq.b(tType); /* */ /* 1372 */ int lmb = 30 - srcblk.j + 1; /* */ /* */ /* 1375 */ lmb = (lmb < 0) ? 0 : lmb; /* */ /* */ /* 1378 */ c.a.i.a.a(state, 0); /* */ /* */ /* 1381 */ int skipbp = a(srcblk, lmb); /* */ /* */ /* 1384 */ ccb.b = srcblk.d; /* 1385 */ ccb.a = srcblk.c; /* 1386 */ ccb.e = srcblk.e; /* 1387 */ ccb.m = srcblk.n; /* 1388 */ ccb.c = skipbp; /* 1389 */ if (ccb.m != 0) { /* 1390 */ ccb.n = 3 * (srcblk.o - skipbp - 1) + 1; /* */ } else { /* 1392 */ ccb.n = 0; /* */ } /* */ /* */ /* 1396 */ switch (srcblk.e.f) { /* */ case 1: /* 1398 */ zc_lut = R; /* */ break; /* */ case 0: /* */ case 2: /* 1402 */ zc_lut = Q; /* */ break; /* */ case 3: /* 1405 */ zc_lut = S; /* */ break; /* */ default: /* 1408 */ throw new Error("JJ2000 internal error"); /* */ } /* */ /* */ /* 1412 */ int curbp = 30 - skipbp; /* 1413 */ int[] fs = aY; /* 1414 */ int[] fm = aZ; /* 1415 */ double msew = Math.pow(2.0D, ((curbp - lmb << 1) - 13)) * srcblk.e.B * srcblk.k; /* */ /* 1417 */ double totdist = 0.0D; /* 1418 */ int npass = 0; /* 1419 */ int ltpidx = -1; /* */ /* 1421 */ if (curbp >= lmb) { /* */ /* 1423 */ if (rev && curbp == lmb) { /* 1424 */ fs = bb; /* */ } /* */ /* */ /* 1428 */ istermbuf[npass] = ((options & 0x4) != 0 || curbp == lmb || ((options & 0x1) != 0 && 27 - skipbp >= curbp)); /* */ /* */ /* 1431 */ totdist += b(srcblk, mq, istermbuf[npass], curbp, state, fs, zc_lut, symbuf, ctxtbuf, ratebuf, npass, ltpidx, options) * msew; /* */ /* */ /* 1434 */ distbuf[npass] = totdist; /* 1435 */ if (istermbuf[npass]) ltpidx = npass; /* 1436 */ npass++; /* 1437 */ msew *= 0.25D; /* 1438 */ curbp--; /* */ } /* */ /* 1441 */ while (curbp >= lmb) { /* */ /* 1443 */ if (rev && curbp == lmb) { /* 1444 */ fs = ba; /* 1445 */ fm = bb; /* */ } /* */ /* */ /* */ /* 1450 */ istermbuf[npass] = ((options & 0x4) != 0); /* 1451 */ if ((options & 0x1) == 0 || 27 - skipbp <= curbp) { /* */ /* 1453 */ totdist += a(srcblk, mq, istermbuf[npass], curbp, state, fs, zc_lut, symbuf, ctxtbuf, ratebuf, npass, ltpidx, options) * msew; /* */ /* */ } /* */ else { /* */ /* */ /* 1459 */ bout.a(((options & 0x10) != 0)); /* 1460 */ totdist += a(srcblk, bout, istermbuf[npass], curbp, state, fs, ratebuf, npass, ltpidx, options) * msew; /* */ } /* */ /* */ /* 1464 */ distbuf[npass] = totdist; /* 1465 */ if (istermbuf[npass]) ltpidx = npass; /* 1466 */ npass++; /* */ /* */ /* */ /* 1470 */ istermbuf[npass] = ((options & 0x4) != 0 || ((options & 0x1) != 0 && 27 - skipbp > curbp)); /* */ /* */ /* 1473 */ if ((options & 0x1) == 0 || 27 - skipbp <= curbp) { /* */ /* 1475 */ totdist += a(srcblk, mq, istermbuf[npass], curbp, state, fm, symbuf, ctxtbuf, ratebuf, npass, ltpidx, options) * msew; /* */ /* */ } /* */ else { /* */ /* 1480 */ bout.a(((options & 0x10) != 0)); /* 1481 */ totdist += b(srcblk, bout, istermbuf[npass], curbp, state, fm, ratebuf, npass, ltpidx, options) * msew; /* */ } /* */ /* */ /* 1485 */ distbuf[npass] = totdist; /* 1486 */ if (istermbuf[npass]) ltpidx = npass; /* 1487 */ npass++; /* */ /* */ /* */ /* */ /* 1492 */ istermbuf[npass] = ((options & 0x4) != 0 || curbp == lmb || ((options & 0x1) != 0 && 27 - skipbp >= curbp)); /* */ /* */ /* 1495 */ totdist += b(srcblk, mq, istermbuf[npass], curbp, state, fs, zc_lut, symbuf, ctxtbuf, ratebuf, npass, ltpidx, options) * msew; /* */ /* */ /* 1498 */ distbuf[npass] = totdist; /* 1499 */ if (istermbuf[npass]) ltpidx = npass; /* 1500 */ npass++; /* */ /* */ /* 1503 */ msew *= 0.25D; /* 1504 */ curbp--; /* */ } /* */ /* */ /* 1508 */ ccb.d = new byte[out.a()]; /* 1509 */ out.a(0, out.a(), ccb.d, 0); /* 1510 */ a(ccb.d, ratebuf, istermbuf, npass); /* 1511 */ ccb.a(ratebuf, distbuf, ((options & 0x5) != 0) ? istermbuf : null, npass, rev); /* */ /* */ /* */ /* */ /* 1516 */ mq.e(); /* 1517 */ if (bout != null) bout.c(); /* */ /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static int a(g cblk, int lmb) { /* 1543 */ int[] data = (int[])cblk.b(); /* 1544 */ int w = cblk.f; /* 1545 */ int h = cblk.g; /* */ /* */ /* 1548 */ int maxmag = 0; /* */ /* 1550 */ int mask = Integer.MAX_VALUE & ((1 << lmb) - 1 ^ 0xFFFFFFFF); /* 1551 */ for (int m = h - 1, j = cblk.h; m >= 0; m--) { /* 1552 */ for (int kmax = j + w; j < kmax; j++) { /* 1553 */ int mag = data[j] & mask; /* 1554 */ if (mag > maxmag) maxmag = mag; /* */ } /* 1556 */ j += cblk.i - w; /* */ } /* */ /* */ /* 1560 */ int msbp = 30; /* */ /* */ do { /* 1563 */ msbp--; /* 1564 */ } while ((1 << msbp & maxmag) == 0 && msbp >= lmb); /* */ /* */ /* 1567 */ return 30 - msbp; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static int a(g srcblk, i mq, boolean doterm, int bp, int[] state, int[] fs, int[] zc_lut, int[] symbuf, int[] ctxtbuf, int[] ratebuf, int pidx, int ltpidx, int options) { /* */ // Byte code: /* */ // 0: aload_0 /* */ // 1: getfield i : I /* */ // 4: istore #18 /* */ // 6: aload_0 /* */ // 7: getfield f : I /* */ // 10: iconst_2 /* */ // 11: iadd /* */ // 12: istore #19 /* */ // 14: iload #19 /* */ // 16: iconst_4 /* */ // 17: imul /* */ // 18: iconst_2 /* */ // 19: idiv /* */ // 20: aload_0 /* */ // 21: getfield f : I /* */ // 24: isub /* */ // 25: istore #20 /* */ // 27: iload #18 /* */ // 29: iconst_4 /* */ // 30: imul /* */ // 31: aload_0 /* */ // 32: getfield f : I /* */ // 35: isub /* */ // 36: istore #21 /* */ // 38: iconst_1 /* */ // 39: iload_3 /* */ // 40: ishl /* */ // 41: istore #24 /* */ // 43: aload_0 /* */ // 44: invokevirtual b : ()Ljava/lang/Object; /* */ // 47: checkcast [I /* */ // 50: checkcast [I /* */ // 53: astore #27 /* */ // 55: aload_0 /* */ // 56: getfield g : I /* */ // 59: iconst_4 /* */ // 60: iadd /* */ // 61: iconst_1 /* */ // 62: isub /* */ // 63: iconst_4 /* */ // 64: idiv /* */ // 65: istore #35 /* */ // 67: iconst_0 /* */ // 68: istore #28 /* */ // 70: iload_3 /* */ // 71: bipush #6 /* */ // 73: isub /* */ // 74: istore #29 /* */ // 76: iload #29 /* */ // 78: iflt -> 85 /* */ // 81: iconst_0 /* */ // 82: goto -> 88 /* */ // 85: iload #29 /* */ // 87: ineg /* */ // 88: istore #30 /* */ // 90: iload #29 /* */ // 92: ifgt -> 99 /* */ // 95: iconst_0 /* */ // 96: goto -> 101 /* */ // 99: iload #29 /* */ // 101: istore #31 /* */ // 103: iload #12 /* */ // 105: bipush #8 /* */ // 107: iand /* */ // 108: ifeq -> 115 /* */ // 111: iconst_1 /* */ // 112: goto -> 116 /* */ // 115: iconst_0 /* */ // 116: istore #34 /* */ // 118: iload #19 /* */ // 120: ineg /* */ // 121: iconst_1 /* */ // 122: isub /* */ // 123: istore #37 /* */ // 125: iload #19 /* */ // 127: ineg /* */ // 128: iconst_1 /* */ // 129: iadd /* */ // 130: istore #38 /* */ // 132: iload #19 /* */ // 134: iconst_1 /* */ // 135: iadd /* */ // 136: istore #39 /* */ // 138: iload #19 /* */ // 140: iconst_1 /* */ // 141: isub /* */ // 142: istore #40 /* */ // 144: aload_0 /* */ // 145: getfield h : I /* */ // 148: istore #16 /* */ // 150: iload #19 /* */ // 152: iconst_1 /* */ // 153: iadd /* */ // 154: istore #14 /* */ // 156: iload #35 /* */ // 158: iconst_1 /* */ // 159: isub /* */ // 160: istore #33 /* */ // 162: iload #33 /* */ // 164: iflt -> 1435 /* */ // 167: iload #33 /* */ // 169: ifeq -> 176 /* */ // 172: iconst_4 /* */ // 173: goto -> 187 /* */ // 176: aload_0 /* */ // 177: getfield g : I /* */ // 180: iload #35 /* */ // 182: iconst_1 /* */ // 183: isub /* */ // 184: iconst_4 /* */ // 185: imul /* */ // 186: isub /* */ // 187: istore #36 /* */ // 189: iload #16 /* */ // 191: aload_0 /* */ // 192: getfield f : I /* */ // 195: iadd /* */ // 196: istore #22 /* */ // 198: iconst_0 /* */ // 199: istore #17 /* */ // 201: iload #16 /* */ // 203: iload #22 /* */ // 205: if_icmpge -> 1405 /* */ // 208: iload #14 /* */ // 210: istore #13 /* */ // 212: aload #4 /* */ // 214: iload #13 /* */ // 216: iaload /* */ // 217: istore #23 /* */ // 219: iload #23 /* */ // 221: iconst_m1 /* */ // 222: ixor /* */ // 223: iload #23 /* */ // 225: iconst_2 /* */ // 226: ishl /* */ // 227: iand /* */ // 228: ldc -2147450880 /* */ // 230: iand /* */ // 231: ifeq -> 801 /* */ // 234: iload #16 /* */ // 236: istore #15 /* */ // 238: iload #23 /* */ // 240: ldc 40960 /* */ // 242: iand /* */ // 243: sipush #8192 /* */ // 246: if_icmpne -> 509 /* */ // 249: aload #8 /* */ // 251: iload #17 /* */ // 253: aload #6 /* */ // 255: iload #23 /* */ // 257: sipush #255 /* */ // 260: iand /* */ // 261: iaload /* */ // 262: iastore /* */ // 263: aload #7 /* */ // 265: iload #17 /* */ // 267: iinc #17, 1 /* */ // 270: aload #27 /* */ // 272: iload #15 /* */ // 274: iaload /* */ // 275: iload #24 /* */ // 277: iand /* */ // 278: iload_3 /* */ // 279: iushr /* */ // 280: dup_x2 /* */ // 281: iastore /* */ // 282: ifeq -> 501 /* */ // 285: aload #27 /* */ // 287: iload #15 /* */ // 289: iaload /* */ // 290: bipush #31 /* */ // 292: iushr /* */ // 293: istore #25 /* */ // 295: getstatic c/a/c/b/k.U : [I /* */ // 298: iload #23 /* */ // 300: iconst_4 /* */ // 301: iushr /* */ // 302: sipush #511 /* */ // 305: iand /* */ // 306: iaload /* */ // 307: istore #26 /* */ // 309: aload #7 /* */ // 311: iload #17 /* */ // 313: iload #25 /* */ // 315: iload #26 /* */ // 317: bipush #31 /* */ // 319: iushr /* */ // 320: ixor /* */ // 321: iastore /* */ // 322: aload #8 /* */ // 324: iload #17 /* */ // 326: iinc #17, 1 /* */ // 329: iload #26 /* */ // 331: bipush #15 /* */ // 333: iand /* */ // 334: iastore /* */ // 335: iload #34 /* */ // 337: ifne -> 366 /* */ // 340: aload #4 /* */ // 342: iload #13 /* */ // 344: iload #37 /* */ // 346: iadd /* */ // 347: dup2 /* */ // 348: iaload /* */ // 349: ldc 536936448 /* */ // 351: ior /* */ // 352: iastore /* */ // 353: aload #4 /* */ // 355: iload #13 /* */ // 357: iload #38 /* */ // 359: iadd /* */ // 360: dup2 /* */ // 361: iaload /* */ // 362: ldc 537001984 /* */ // 364: ior /* */ // 365: iastore /* */ // 366: iload #25 /* */ // 368: ifeq -> 423 /* */ // 371: iload #23 /* */ // 373: ldc 606126080 /* */ // 375: ior /* */ // 376: istore #23 /* */ // 378: iload #34 /* */ // 380: ifne -> 396 /* */ // 383: aload #4 /* */ // 385: iload #13 /* */ // 387: iload #19 /* */ // 389: isub /* */ // 390: dup2 /* */ // 391: iaload /* */ // 392: ldc 571473920 /* */ // 394: ior /* */ // 395: iastore /* */ // 396: aload #4 /* */ // 398: iload #13 /* */ // 400: iconst_1 /* */ // 401: iadd /* */ // 402: dup2 /* */ // 403: iaload /* */ // 404: ldc 537407616 /* */ // 406: ior /* */ // 407: iastore /* */ // 408: aload #4 /* */ // 410: iload #13 /* */ // 412: iconst_1 /* */ // 413: isub /* */ // 414: dup2 /* */ // 415: iaload /* */ // 416: ldc 537143360 /* */ // 418: ior /* */ // 419: iastore /* */ // 420: goto -> 472 /* */ // 423: iload #23 /* */ // 425: ldc 539017216 /* */ // 427: ior /* */ // 428: istore #23 /* */ // 430: iload #34 /* */ // 432: ifne -> 448 /* */ // 435: aload #4 /* */ // 437: iload #13 /* */ // 439: iload #19 /* */ // 441: isub /* */ // 442: dup2 /* */ // 443: iaload /* */ // 444: ldc 537919488 /* */ // 446: ior /* */ // 447: iastore /* */ // 448: aload #4 /* */ // 450: iload #13 /* */ // 452: iconst_1 /* */ // 453: iadd /* */ // 454: dup2 /* */ // 455: iaload /* */ // 456: ldc 537403520 /* */ // 458: ior /* */ // 459: iastore /* */ // 460: aload #4 /* */ // 462: iload #13 /* */ // 464: iconst_1 /* */ // 465: isub /* */ // 466: dup2 /* */ // 467: iaload /* */ // 468: ldc 537141312 /* */ // 470: ior /* */ // 471: iastore /* */ // 472: aload #27 /* */ // 474: iload #15 /* */ // 476: iaload /* */ // 477: iload #31 /* */ // 479: ishr /* */ // 480: iload #30 /* */ // 482: ishl /* */ // 483: istore #32 /* */ // 485: iload #28 /* */ // 487: aload #5 /* */ // 489: iload #32 /* */ // 491: bipush #63 /* */ // 493: iand /* */ // 494: iaload /* */ // 495: iadd /* */ // 496: istore #28 /* */ // 498: goto -> 509 /* */ // 501: iload #23 /* */ // 503: sipush #16384 /* */ // 506: ior /* */ // 507: istore #23 /* */ // 509: iload #36 /* */ // 511: iconst_2 /* */ // 512: if_icmpge -> 525 /* */ // 515: aload #4 /* */ // 517: iload #13 /* */ // 519: iload #23 /* */ // 521: iastore /* */ // 522: goto -> 1396 /* */ // 525: iload #23 /* */ // 527: ldc -1610612736 /* */ // 529: iand /* */ // 530: ldc 536870912 /* */ // 532: if_icmpne -> 794 /* */ // 535: iload #15 /* */ // 537: iload #18 /* */ // 539: iadd /* */ // 540: istore #15 /* */ // 542: aload #8 /* */ // 544: iload #17 /* */ // 546: aload #6 /* */ // 548: iload #23 /* */ // 550: bipush #16 /* */ // 552: iushr /* */ // 553: sipush #255 /* */ // 556: iand /* */ // 557: iaload /* */ // 558: iastore /* */ // 559: aload #7 /* */ // 561: iload #17 /* */ // 563: iinc #17, 1 /* */ // 566: aload #27 /* */ // 568: iload #15 /* */ // 570: iaload /* */ // 571: iload #24 /* */ // 573: iand /* */ // 574: iload_3 /* */ // 575: iushr /* */ // 576: dup_x2 /* */ // 577: iastore /* */ // 578: ifeq -> 787 /* */ // 581: aload #27 /* */ // 583: iload #15 /* */ // 585: iaload /* */ // 586: bipush #31 /* */ // 588: iushr /* */ // 589: istore #25 /* */ // 591: getstatic c/a/c/b/k.U : [I /* */ // 594: iload #23 /* */ // 596: bipush #20 /* */ // 598: iushr /* */ // 599: sipush #511 /* */ // 602: iand /* */ // 603: iaload /* */ // 604: istore #26 /* */ // 606: aload #7 /* */ // 608: iload #17 /* */ // 610: iload #25 /* */ // 612: iload #26 /* */ // 614: bipush #31 /* */ // 616: iushr /* */ // 617: ixor /* */ // 618: iastore /* */ // 619: aload #8 /* */ // 621: iload #17 /* */ // 623: iinc #17, 1 /* */ // 626: iload #26 /* */ // 628: bipush #15 /* */ // 630: iand /* */ // 631: iastore /* */ // 632: aload #4 /* */ // 634: iload #13 /* */ // 636: iload #40 /* */ // 638: iadd /* */ // 639: dup2 /* */ // 640: iaload /* */ // 641: sipush #8196 /* */ // 644: ior /* */ // 645: iastore /* */ // 646: aload #4 /* */ // 648: iload #13 /* */ // 650: iload #39 /* */ // 652: iadd /* */ // 653: dup2 /* */ // 654: iaload /* */ // 655: sipush #8200 /* */ // 658: ior /* */ // 659: iastore /* */ // 660: iload #25 /* */ // 662: ifeq -> 713 /* */ // 665: iload #23 /* */ // 667: ldc -1073733104 /* */ // 669: ior /* */ // 670: istore #23 /* */ // 672: aload #4 /* */ // 674: iload #13 /* */ // 676: iload #19 /* */ // 678: iadd /* */ // 679: dup2 /* */ // 680: iaload /* */ // 681: sipush #9248 /* */ // 684: ior /* */ // 685: iastore /* */ // 686: aload #4 /* */ // 688: iload #13 /* */ // 690: iconst_1 /* */ // 691: iadd /* */ // 692: dup2 /* */ // 693: iaload /* */ // 694: ldc 813703170 /* */ // 696: ior /* */ // 697: iastore /* */ // 698: aload #4 /* */ // 700: iload #13 /* */ // 702: iconst_1 /* */ // 703: isub /* */ // 704: dup2 /* */ // 705: iaload /* */ // 706: ldc 675291137 /* */ // 708: ior /* */ // 709: iastore /* */ // 710: goto -> 758 /* */ // 713: iload #23 /* */ // 715: ldc -1073733616 /* */ // 717: ior /* */ // 718: istore #23 /* */ // 720: aload #4 /* */ // 722: iload #13 /* */ // 724: iload #19 /* */ // 726: iadd /* */ // 727: dup2 /* */ // 728: iaload /* */ // 729: sipush #8224 /* */ // 732: ior /* */ // 733: iastore /* */ // 734: aload #4 /* */ // 736: iload #13 /* */ // 738: iconst_1 /* */ // 739: iadd /* */ // 740: dup2 /* */ // 741: iaload /* */ // 742: ldc 545267714 /* */ // 744: ior /* */ // 745: iastore /* */ // 746: aload #4 /* */ // 748: iload #13 /* */ // 750: iconst_1 /* */ // 751: isub /* */ // 752: dup2 /* */ // 753: iaload /* */ // 754: ldc 541073409 /* */ // 756: ior /* */ // 757: iastore /* */ // 758: aload #27 /* */ // 760: iload #15 /* */ // 762: iaload /* */ // 763: iload #31 /* */ // 765: ishr /* */ // 766: iload #30 /* */ // 768: ishl /* */ // 769: istore #32 /* */ // 771: iload #28 /* */ // 773: aload #5 /* */ // 775: iload #32 /* */ // 777: bipush #63 /* */ // 779: iand /* */ // 780: iaload /* */ // 781: iadd /* */ // 782: istore #28 /* */ // 784: goto -> 794 /* */ // 787: iload #23 /* */ // 789: ldc 1073741824 /* */ // 791: ior /* */ // 792: istore #23 /* */ // 794: aload #4 /* */ // 796: iload #13 /* */ // 798: iload #23 /* */ // 800: iastore /* */ // 801: iload #36 /* */ // 803: iconst_3 /* */ // 804: if_icmpge -> 810 /* */ // 807: goto -> 1396 /* */ // 810: iload #13 /* */ // 812: iload #19 /* */ // 814: iadd /* */ // 815: istore #13 /* */ // 817: aload #4 /* */ // 819: iload #13 /* */ // 821: iaload /* */ // 822: istore #23 /* */ // 824: iload #23 /* */ // 826: iconst_m1 /* */ // 827: ixor /* */ // 828: iload #23 /* */ // 830: iconst_2 /* */ // 831: ishl /* */ // 832: iand /* */ // 833: ldc -2147450880 /* */ // 835: iand /* */ // 836: ifeq -> 1396 /* */ // 839: iload #16 /* */ // 841: iload #18 /* */ // 843: iconst_1 /* */ // 844: ishl /* */ // 845: iadd /* */ // 846: istore #15 /* */ // 848: iload #23 /* */ // 850: ldc 40960 /* */ // 852: iand /* */ // 853: sipush #8192 /* */ // 856: if_icmpne -> 1104 /* */ // 859: aload #8 /* */ // 861: iload #17 /* */ // 863: aload #6 /* */ // 865: iload #23 /* */ // 867: sipush #255 /* */ // 870: iand /* */ // 871: iaload /* */ // 872: iastore /* */ // 873: aload #7 /* */ // 875: iload #17 /* */ // 877: iinc #17, 1 /* */ // 880: aload #27 /* */ // 882: iload #15 /* */ // 884: iaload /* */ // 885: iload #24 /* */ // 887: iand /* */ // 888: iload_3 /* */ // 889: iushr /* */ // 890: dup_x2 /* */ // 891: iastore /* */ // 892: ifeq -> 1096 /* */ // 895: aload #27 /* */ // 897: iload #15 /* */ // 899: iaload /* */ // 900: bipush #31 /* */ // 902: iushr /* */ // 903: istore #25 /* */ // 905: getstatic c/a/c/b/k.U : [I /* */ // 908: iload #23 /* */ // 910: iconst_4 /* */ // 911: iushr /* */ // 912: sipush #511 /* */ // 915: iand /* */ // 916: iaload /* */ // 917: istore #26 /* */ // 919: aload #7 /* */ // 921: iload #17 /* */ // 923: iload #25 /* */ // 925: iload #26 /* */ // 927: bipush #31 /* */ // 929: iushr /* */ // 930: ixor /* */ // 931: iastore /* */ // 932: aload #8 /* */ // 934: iload #17 /* */ // 936: iinc #17, 1 /* */ // 939: iload #26 /* */ // 941: bipush #15 /* */ // 943: iand /* */ // 944: iastore /* */ // 945: aload #4 /* */ // 947: iload #13 /* */ // 949: iload #37 /* */ // 951: iadd /* */ // 952: dup2 /* */ // 953: iaload /* */ // 954: ldc 536936448 /* */ // 956: ior /* */ // 957: iastore /* */ // 958: aload #4 /* */ // 960: iload #13 /* */ // 962: iload #38 /* */ // 964: iadd /* */ // 965: dup2 /* */ // 966: iaload /* */ // 967: ldc 537001984 /* */ // 969: ior /* */ // 970: iastore /* */ // 971: iload #25 /* */ // 973: ifeq -> 1023 /* */ // 976: iload #23 /* */ // 978: ldc 606126080 /* */ // 980: ior /* */ // 981: istore #23 /* */ // 983: aload #4 /* */ // 985: iload #13 /* */ // 987: iload #19 /* */ // 989: isub /* */ // 990: dup2 /* */ // 991: iaload /* */ // 992: ldc 571473920 /* */ // 994: ior /* */ // 995: iastore /* */ // 996: aload #4 /* */ // 998: iload #13 /* */ // 1000: iconst_1 /* */ // 1001: iadd /* */ // 1002: dup2 /* */ // 1003: iaload /* */ // 1004: ldc 537407616 /* */ // 1006: ior /* */ // 1007: iastore /* */ // 1008: aload #4 /* */ // 1010: iload #13 /* */ // 1012: iconst_1 /* */ // 1013: isub /* */ // 1014: dup2 /* */ // 1015: iaload /* */ // 1016: ldc 537143360 /* */ // 1018: ior /* */ // 1019: iastore /* */ // 1020: goto -> 1067 /* */ // 1023: iload #23 /* */ // 1025: ldc 539017216 /* */ // 1027: ior /* */ // 1028: istore #23 /* */ // 1030: aload #4 /* */ // 1032: iload #13 /* */ // 1034: iload #19 /* */ // 1036: isub /* */ // 1037: dup2 /* */ // 1038: iaload /* */ // 1039: ldc 537919488 /* */ // 1041: ior /* */ // 1042: iastore /* */ // 1043: aload #4 /* */ // 1045: iload #13 /* */ // 1047: iconst_1 /* */ // 1048: iadd /* */ // 1049: dup2 /* */ // 1050: iaload /* */ // 1051: ldc 537403520 /* */ // 1053: ior /* */ // 1054: iastore /* */ // 1055: aload #4 /* */ // 1057: iload #13 /* */ // 1059: iconst_1 /* */ // 1060: isub /* */ // 1061: dup2 /* */ // 1062: iaload /* */ // 1063: ldc 537141312 /* */ // 1065: ior /* */ // 1066: iastore /* */ // 1067: aload #27 /* */ // 1069: iload #15 /* */ // 1071: iaload /* */ // 1072: iload #31 /* */ // 1074: ishr /* */ // 1075: iload #30 /* */ // 1077: ishl /* */ // 1078: istore #32 /* */ // 1080: iload #28 /* */ // 1082: aload #5 /* */ // 1084: iload #32 /* */ // 1086: bipush #63 /* */ // 1088: iand /* */ // 1089: iaload /* */ // 1090: iadd /* */ // 1091: istore #28 /* */ // 1093: goto -> 1104 /* */ // 1096: iload #23 /* */ // 1098: sipush #16384 /* */ // 1101: ior /* */ // 1102: istore #23 /* */ // 1104: iload #36 /* */ // 1106: iconst_4 /* */ // 1107: if_icmpge -> 1120 /* */ // 1110: aload #4 /* */ // 1112: iload #13 /* */ // 1114: iload #23 /* */ // 1116: iastore /* */ // 1117: goto -> 1396 /* */ // 1120: iload #23 /* */ // 1122: ldc -1610612736 /* */ // 1124: iand /* */ // 1125: ldc 536870912 /* */ // 1127: if_icmpne -> 1389 /* */ // 1130: iload #15 /* */ // 1132: iload #18 /* */ // 1134: iadd /* */ // 1135: istore #15 /* */ // 1137: aload #8 /* */ // 1139: iload #17 /* */ // 1141: aload #6 /* */ // 1143: iload #23 /* */ // 1145: bipush #16 /* */ // 1147: iushr /* */ // 1148: sipush #255 /* */ // 1151: iand /* */ // 1152: iaload /* */ // 1153: iastore /* */ // 1154: aload #7 /* */ // 1156: iload #17 /* */ // 1158: iinc #17, 1 /* */ // 1161: aload #27 /* */ // 1163: iload #15 /* */ // 1165: iaload /* */ // 1166: iload #24 /* */ // 1168: iand /* */ // 1169: iload_3 /* */ // 1170: iushr /* */ // 1171: dup_x2 /* */ // 1172: iastore /* */ // 1173: ifeq -> 1382 /* */ // 1176: aload #27 /* */ // 1178: iload #15 /* */ // 1180: iaload /* */ // 1181: bipush #31 /* */ // 1183: iushr /* */ // 1184: istore #25 /* */ // 1186: getstatic c/a/c/b/k.U : [I /* */ // 1189: iload #23 /* */ // 1191: bipush #20 /* */ // 1193: iushr /* */ // 1194: sipush #511 /* */ // 1197: iand /* */ // 1198: iaload /* */ // 1199: istore #26 /* */ // 1201: aload #7 /* */ // 1203: iload #17 /* */ // 1205: iload #25 /* */ // 1207: iload #26 /* */ // 1209: bipush #31 /* */ // 1211: iushr /* */ // 1212: ixor /* */ // 1213: iastore /* */ // 1214: aload #8 /* */ // 1216: iload #17 /* */ // 1218: iinc #17, 1 /* */ // 1221: iload #26 /* */ // 1223: bipush #15 /* */ // 1225: iand /* */ // 1226: iastore /* */ // 1227: aload #4 /* */ // 1229: iload #13 /* */ // 1231: iload #40 /* */ // 1233: iadd /* */ // 1234: dup2 /* */ // 1235: iaload /* */ // 1236: sipush #8196 /* */ // 1239: ior /* */ // 1240: iastore /* */ // 1241: aload #4 /* */ // 1243: iload #13 /* */ // 1245: iload #39 /* */ // 1247: iadd /* */ // 1248: dup2 /* */ // 1249: iaload /* */ // 1250: sipush #8200 /* */ // 1253: ior /* */ // 1254: iastore /* */ // 1255: iload #25 /* */ // 1257: ifeq -> 1308 /* */ // 1260: iload #23 /* */ // 1262: ldc -1073733104 /* */ // 1264: ior /* */ // 1265: istore #23 /* */ // 1267: aload #4 /* */ // 1269: iload #13 /* */ // 1271: iload #19 /* */ // 1273: iadd /* */ // 1274: dup2 /* */ // 1275: iaload /* */ // 1276: sipush #9248 /* */ // 1279: ior /* */ // 1280: iastore /* */ // 1281: aload #4 /* */ // 1283: iload #13 /* */ // 1285: iconst_1 /* */ // 1286: iadd /* */ // 1287: dup2 /* */ // 1288: iaload /* */ // 1289: ldc 813703170 /* */ // 1291: ior /* */ // 1292: iastore /* */ // 1293: aload #4 /* */ // 1295: iload #13 /* */ // 1297: iconst_1 /* */ // 1298: isub /* */ // 1299: dup2 /* */ // 1300: iaload /* */ // 1301: ldc 675291137 /* */ // 1303: ior /* */ // 1304: iastore /* */ // 1305: goto -> 1353 /* */ // 1308: iload #23 /* */ // 1310: ldc -1073733616 /* */ // 1312: ior /* */ // 1313: istore #23 /* */ // 1315: aload #4 /* */ // 1317: iload #13 /* */ // 1319: iload #19 /* */ // 1321: iadd /* */ // 1322: dup2 /* */ // 1323: iaload /* */ // 1324: sipush #8224 /* */ // 1327: ior /* */ // 1328: iastore /* */ // 1329: aload #4 /* */ // 1331: iload #13 /* */ // 1333: iconst_1 /* */ // 1334: iadd /* */ // 1335: dup2 /* */ // 1336: iaload /* */ // 1337: ldc 545267714 /* */ // 1339: ior /* */ // 1340: iastore /* */ // 1341: aload #4 /* */ // 1343: iload #13 /* */ // 1345: iconst_1 /* */ // 1346: isub /* */ // 1347: dup2 /* */ // 1348: iaload /* */ // 1349: ldc 541073409 /* */ // 1351: ior /* */ // 1352: iastore /* */ // 1353: aload #27 /* */ // 1355: iload #15 /* */ // 1357: iaload /* */ // 1358: iload #31 /* */ // 1360: ishr /* */ // 1361: iload #30 /* */ // 1363: ishl /* */ // 1364: istore #32 /* */ // 1366: iload #28 /* */ // 1368: aload #5 /* */ // 1370: iload #32 /* */ // 1372: bipush #63 /* */ // 1374: iand /* */ // 1375: iaload /* */ // 1376: iadd /* */ // 1377: istore #28 /* */ // 1379: goto -> 1389 /* */ // 1382: iload #23 /* */ // 1384: ldc 1073741824 /* */ // 1386: ior /* */ // 1387: istore #23 /* */ // 1389: aload #4 /* */ // 1391: iload #13 /* */ // 1393: iload #23 /* */ // 1395: iastore /* */ // 1396: iinc #16, 1 /* */ // 1399: iinc #14, 1 /* */ // 1402: goto -> 201 /* */ // 1405: aload_1 /* */ // 1406: aload #7 /* */ // 1408: aload #8 /* */ // 1410: iload #17 /* */ // 1412: invokevirtual a : ([I[II)V /* */ // 1415: iinc #33, -1 /* */ // 1418: iload #16 /* */ // 1420: iload #21 /* */ // 1422: iadd /* */ // 1423: istore #16 /* */ // 1425: iload #14 /* */ // 1427: iload #20 /* */ // 1429: iadd /* */ // 1430: istore #14 /* */ // 1432: goto -> 162 /* */ // 1435: iload #12 /* */ // 1437: iconst_2 /* */ // 1438: iand /* */ // 1439: ifeq -> 1446 /* */ // 1442: aload_1 /* */ // 1443: invokevirtual c : ()V /* */ // 1446: iload_2 /* */ // 1447: ifeq -> 1462 /* */ // 1450: aload #9 /* */ // 1452: iload #10 /* */ // 1454: aload_1 /* */ // 1455: invokevirtual a : ()I /* */ // 1458: iastore /* */ // 1459: goto -> 1471 /* */ // 1462: aload #9 /* */ // 1464: iload #10 /* */ // 1466: aload_1 /* */ // 1467: invokevirtual d : ()I /* */ // 1470: iastore /* */ // 1471: iload #11 /* */ // 1473: iflt -> 1489 /* */ // 1476: aload #9 /* */ // 1478: iload #10 /* */ // 1480: dup2 /* */ // 1481: iaload /* */ // 1482: aload #9 /* */ // 1484: iload #11 /* */ // 1486: iaload /* */ // 1487: iadd /* */ // 1488: iastore /* */ // 1489: iload_2 /* */ // 1490: ifeq -> 1501 /* */ // 1493: aload_1 /* */ // 1494: aload #9 /* */ // 1496: iload #10 /* */ // 1498: invokevirtual a : ([II)V /* */ // 1501: iload #28 /* */ // 1503: ireturn /* */ // Line number table: /* */ // Java source line number -> byte code offset /* */ // #1644 -> 0 /* */ // #1645 -> 6 /* */ // #1646 -> 14 /* */ // #1647 -> 27 /* */ // #1648 -> 38 /* */ // #1649 -> 43 /* */ // #1650 -> 55 /* */ // #1651 -> 67 /* */ // #1654 -> 70 /* */ // #1655 -> 76 /* */ // #1656 -> 90 /* */ // #1657 -> 103 /* */ // #1660 -> 118 /* */ // #1661 -> 125 /* */ // #1662 -> 132 /* */ // #1663 -> 138 /* */ // #1666 -> 144 /* */ // #1667 -> 150 /* */ // #1668 -> 156 /* */ // #1669 -> 167 /* */ // #1671 -> 189 /* */ // #1673 -> 198 /* */ // #1675 -> 208 /* */ // #1676 -> 212 /* */ // #1680 -> 219 /* */ // #1681 -> 234 /* */ // #1683 -> 238 /* */ // #1686 -> 249 /* */ // #1687 -> 263 /* */ // #1690 -> 285 /* */ // #1691 -> 295 /* */ // #1692 -> 309 /* */ // #1693 -> 322 /* */ // #1698 -> 335 /* */ // #1701 -> 340 /* */ // #1703 -> 353 /* */ // #1707 -> 366 /* */ // #1708 -> 371 /* */ // #1711 -> 378 /* */ // #1714 -> 383 /* */ // #1717 -> 396 /* */ // #1721 -> 408 /* */ // #1727 -> 423 /* */ // #1729 -> 430 /* */ // #1732 -> 435 /* */ // #1735 -> 448 /* */ // #1738 -> 460 /* */ // #1743 -> 472 /* */ // #1744 -> 485 /* */ // #1747 -> 501 /* */ // #1750 -> 509 /* */ // #1751 -> 515 /* */ // #1752 -> 522 /* */ // #1755 -> 525 /* */ // #1757 -> 535 /* */ // #1759 -> 542 /* */ // #1760 -> 559 /* */ // #1763 -> 581 /* */ // #1764 -> 591 /* */ // #1765 -> 606 /* */ // #1766 -> 619 /* */ // #1771 -> 632 /* */ // #1772 -> 646 /* */ // #1774 -> 660 /* */ // #1775 -> 665 /* */ // #1778 -> 672 /* */ // #1780 -> 686 /* */ // #1784 -> 698 /* */ // #1790 -> 713 /* */ // #1792 -> 720 /* */ // #1794 -> 734 /* */ // #1797 -> 746 /* */ // #1802 -> 758 /* */ // #1803 -> 771 /* */ // #1806 -> 787 /* */ // #1809 -> 794 /* */ // #1812 -> 801 /* */ // #1813 -> 810 /* */ // #1814 -> 817 /* */ // #1818 -> 824 /* */ // #1819 -> 839 /* */ // #1821 -> 848 /* */ // #1824 -> 859 /* */ // #1825 -> 873 /* */ // #1828 -> 895 /* */ // #1829 -> 905 /* */ // #1830 -> 919 /* */ // #1831 -> 932 /* */ // #1836 -> 945 /* */ // #1837 -> 958 /* */ // #1839 -> 971 /* */ // #1840 -> 976 /* */ // #1843 -> 983 /* */ // #1845 -> 996 /* */ // #1849 -> 1008 /* */ // #1855 -> 1023 /* */ // #1857 -> 1030 /* */ // #1859 -> 1043 /* */ // #1862 -> 1055 /* */ // #1867 -> 1067 /* */ // #1868 -> 1080 /* */ // #1871 -> 1096 /* */ // #1874 -> 1104 /* */ // #1875 -> 1110 /* */ // #1876 -> 1117 /* */ // #1879 -> 1120 /* */ // #1881 -> 1130 /* */ // #1883 -> 1137 /* */ // #1884 -> 1154 /* */ // #1887 -> 1176 /* */ // #1888 -> 1186 /* */ // #1889 -> 1201 /* */ // #1890 -> 1214 /* */ // #1895 -> 1227 /* */ // #1896 -> 1241 /* */ // #1898 -> 1255 /* */ // #1899 -> 1260 /* */ // #1902 -> 1267 /* */ // #1904 -> 1281 /* */ // #1908 -> 1293 /* */ // #1914 -> 1308 /* */ // #1916 -> 1315 /* */ // #1918 -> 1329 /* */ // #1921 -> 1341 /* */ // #1926 -> 1353 /* */ // #1927 -> 1366 /* */ // #1930 -> 1382 /* */ // #1933 -> 1389 /* */ // #1673 -> 1396 /* */ // #1937 -> 1405 /* */ // #1668 -> 1415 /* */ // #1941 -> 1435 /* */ // #1942 -> 1442 /* */ // #1946 -> 1446 /* */ // #1947 -> 1450 /* */ // #1950 -> 1462 /* */ // #1953 -> 1471 /* */ // #1954 -> 1476 /* */ // #1957 -> 1489 /* */ // #1958 -> 1493 /* */ // #1962 -> 1501 /* */ // Local variable table: /* */ // start length slot name descriptor /* */ // 0 1504 0 srcblk Lc/a/j/a/g; /* */ // 0 1504 1 mq Lc/a/c/b/i; /* */ // 0 1504 2 doterm Z /* */ // 0 1504 3 bp I /* */ // 0 1504 4 state [I /* */ // 0 1504 5 fs [I /* */ // 0 1504 6 zc_lut [I /* */ // 0 1504 7 symbuf [I /* */ // 0 1504 8 ctxtbuf [I /* */ // 0 1504 9 ratebuf [I /* */ // 0 1504 10 pidx I /* */ // 0 1504 11 ltpidx I /* */ // 0 1504 12 options I /* */ // 6 1498 18 dscanw I /* */ // 14 1490 19 sscanw I /* */ // 27 1477 20 jstep I /* */ // 38 1466 21 kstep I /* */ // 43 1461 24 mask I /* */ // 55 1449 27 data [I /* */ // 67 1437 35 nstripes I /* */ // 70 1434 28 dist I /* */ // 76 1428 29 shift I /* */ // 90 1414 30 upshift I /* */ // 103 1401 31 downshift I /* */ // 118 1386 34 causal Z /* */ // 125 1379 37 off_ul I /* */ // 132 1372 38 off_ur I /* */ // 138 1366 39 off_dr I /* */ // 144 1360 40 off_dl I /* */ // 150 1354 16 sk I /* */ // 156 1348 14 sj I /* */ // 162 1342 33 s I /* */ // 189 1243 36 sheight I /* */ // 198 1234 22 stopsk I /* */ // 201 1231 17 nsym I /* */ // 212 1190 13 j I /* */ // 219 1183 23 csj I /* */ // 238 563 15 k I /* */ // 295 206 25 sym I /* */ // 309 192 26 ctxt I /* */ // 485 16 32 normval I /* */ // 591 196 25 sym I /* */ // 606 181 26 ctxt I /* */ // 771 16 32 normval I /* */ // 848 548 15 k I /* */ // 905 191 25 sym I /* */ // 919 177 26 ctxt I /* */ // 1080 16 32 normval I /* */ // 1186 196 25 sym I /* */ // 1201 181 26 ctxt I /* */ // 1366 16 32 normval I /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static int a(g srcblk, a bout, boolean doterm, int bp, int[] state, int[] fs, int[] ratebuf, int pidx, int ltpidx, int options) { /* */ // Byte code: /* */ // 0: iconst_0 /* */ // 1: istore #21 /* */ // 3: aload_0 /* */ // 4: getfield i : I /* */ // 7: istore #14 /* */ // 9: aload_0 /* */ // 10: getfield f : I /* */ // 13: iconst_2 /* */ // 14: iadd /* */ // 15: istore #15 /* */ // 17: iload #15 /* */ // 19: iconst_4 /* */ // 20: imul /* */ // 21: iconst_2 /* */ // 22: idiv /* */ // 23: aload_0 /* */ // 24: getfield f : I /* */ // 27: isub /* */ // 28: istore #16 /* */ // 30: iload #14 /* */ // 32: iconst_4 /* */ // 33: imul /* */ // 34: aload_0 /* */ // 35: getfield f : I /* */ // 38: isub /* */ // 39: istore #17 /* */ // 41: iconst_1 /* */ // 42: iload_3 /* */ // 43: ishl /* */ // 44: istore #20 /* */ // 46: aload_0 /* */ // 47: invokevirtual b : ()Ljava/lang/Object; /* */ // 50: checkcast [I /* */ // 53: checkcast [I /* */ // 56: astore #23 /* */ // 58: aload_0 /* */ // 59: getfield g : I /* */ // 62: iconst_4 /* */ // 63: iadd /* */ // 64: iconst_1 /* */ // 65: isub /* */ // 66: iconst_4 /* */ // 67: idiv /* */ // 68: istore #31 /* */ // 70: iconst_0 /* */ // 71: istore #24 /* */ // 73: iload_3 /* */ // 74: bipush #6 /* */ // 76: isub /* */ // 77: istore #25 /* */ // 79: iload #25 /* */ // 81: iflt -> 88 /* */ // 84: iconst_0 /* */ // 85: goto -> 91 /* */ // 88: iload #25 /* */ // 90: ineg /* */ // 91: istore #26 /* */ // 93: iload #25 /* */ // 95: ifgt -> 102 /* */ // 98: iconst_0 /* */ // 99: goto -> 104 /* */ // 102: iload #25 /* */ // 104: istore #27 /* */ // 106: iload #9 /* */ // 108: bipush #8 /* */ // 110: iand /* */ // 111: ifeq -> 118 /* */ // 114: iconst_1 /* */ // 115: goto -> 119 /* */ // 118: iconst_0 /* */ // 119: istore #30 /* */ // 121: iload #15 /* */ // 123: ineg /* */ // 124: iconst_1 /* */ // 125: isub /* */ // 126: istore #33 /* */ // 128: iload #15 /* */ // 130: ineg /* */ // 131: iconst_1 /* */ // 132: iadd /* */ // 133: istore #34 /* */ // 135: iload #15 /* */ // 137: iconst_1 /* */ // 138: iadd /* */ // 139: istore #35 /* */ // 141: iload #15 /* */ // 143: iconst_1 /* */ // 144: isub /* */ // 145: istore #36 /* */ // 147: aload_0 /* */ // 148: getfield h : I /* */ // 151: istore #13 /* */ // 153: iload #15 /* */ // 155: iconst_1 /* */ // 156: iadd /* */ // 157: istore #11 /* */ // 159: iload #31 /* */ // 161: iconst_1 /* */ // 162: isub /* */ // 163: istore #29 /* */ // 165: iload #29 /* */ // 167: iflt -> 1253 /* */ // 170: iload #29 /* */ // 172: ifeq -> 179 /* */ // 175: iconst_4 /* */ // 176: goto -> 190 /* */ // 179: aload_0 /* */ // 180: getfield g : I /* */ // 183: iload #31 /* */ // 185: iconst_1 /* */ // 186: isub /* */ // 187: iconst_4 /* */ // 188: imul /* */ // 189: isub /* */ // 190: istore #32 /* */ // 192: iload #13 /* */ // 194: aload_0 /* */ // 195: getfield f : I /* */ // 198: iadd /* */ // 199: istore #18 /* */ // 201: iload #13 /* */ // 203: iload #18 /* */ // 205: if_icmpge -> 1233 /* */ // 208: iload #11 /* */ // 210: istore #10 /* */ // 212: aload #4 /* */ // 214: iload #10 /* */ // 216: iaload /* */ // 217: istore #19 /* */ // 219: iload #19 /* */ // 221: iconst_m1 /* */ // 222: ixor /* */ // 223: iload #19 /* */ // 225: iconst_2 /* */ // 226: ishl /* */ // 227: iand /* */ // 228: ldc -2147450880 /* */ // 230: iand /* */ // 231: ifeq -> 715 /* */ // 234: iload #13 /* */ // 236: istore #12 /* */ // 238: iload #19 /* */ // 240: ldc 40960 /* */ // 242: iand /* */ // 243: sipush #8192 /* */ // 246: if_icmpne -> 468 /* */ // 249: aload #23 /* */ // 251: iload #12 /* */ // 253: iaload /* */ // 254: iload #20 /* */ // 256: iand /* */ // 257: iload_3 /* */ // 258: iushr /* */ // 259: istore #22 /* */ // 261: aload_1 /* */ // 262: iload #22 /* */ // 264: invokevirtual a : (I)V /* */ // 267: iinc #21, 1 /* */ // 270: iload #22 /* */ // 272: ifeq -> 460 /* */ // 275: aload #23 /* */ // 277: iload #12 /* */ // 279: iaload /* */ // 280: bipush #31 /* */ // 282: iushr /* */ // 283: istore #22 /* */ // 285: aload_1 /* */ // 286: iload #22 /* */ // 288: invokevirtual a : (I)V /* */ // 291: iinc #21, 1 /* */ // 294: iload #30 /* */ // 296: ifne -> 325 /* */ // 299: aload #4 /* */ // 301: iload #10 /* */ // 303: iload #33 /* */ // 305: iadd /* */ // 306: dup2 /* */ // 307: iaload /* */ // 308: ldc 536936448 /* */ // 310: ior /* */ // 311: iastore /* */ // 312: aload #4 /* */ // 314: iload #10 /* */ // 316: iload #34 /* */ // 318: iadd /* */ // 319: dup2 /* */ // 320: iaload /* */ // 321: ldc 537001984 /* */ // 323: ior /* */ // 324: iastore /* */ // 325: iload #22 /* */ // 327: ifeq -> 382 /* */ // 330: iload #19 /* */ // 332: ldc 606126080 /* */ // 334: ior /* */ // 335: istore #19 /* */ // 337: iload #30 /* */ // 339: ifne -> 355 /* */ // 342: aload #4 /* */ // 344: iload #10 /* */ // 346: iload #15 /* */ // 348: isub /* */ // 349: dup2 /* */ // 350: iaload /* */ // 351: ldc 571473920 /* */ // 353: ior /* */ // 354: iastore /* */ // 355: aload #4 /* */ // 357: iload #10 /* */ // 359: iconst_1 /* */ // 360: iadd /* */ // 361: dup2 /* */ // 362: iaload /* */ // 363: ldc 537407616 /* */ // 365: ior /* */ // 366: iastore /* */ // 367: aload #4 /* */ // 369: iload #10 /* */ // 371: iconst_1 /* */ // 372: isub /* */ // 373: dup2 /* */ // 374: iaload /* */ // 375: ldc 537143360 /* */ // 377: ior /* */ // 378: iastore /* */ // 379: goto -> 431 /* */ // 382: iload #19 /* */ // 384: ldc 539017216 /* */ // 386: ior /* */ // 387: istore #19 /* */ // 389: iload #30 /* */ // 391: ifne -> 407 /* */ // 394: aload #4 /* */ // 396: iload #10 /* */ // 398: iload #15 /* */ // 400: isub /* */ // 401: dup2 /* */ // 402: iaload /* */ // 403: ldc 537919488 /* */ // 405: ior /* */ // 406: iastore /* */ // 407: aload #4 /* */ // 409: iload #10 /* */ // 411: iconst_1 /* */ // 412: iadd /* */ // 413: dup2 /* */ // 414: iaload /* */ // 415: ldc 537403520 /* */ // 417: ior /* */ // 418: iastore /* */ // 419: aload #4 /* */ // 421: iload #10 /* */ // 423: iconst_1 /* */ // 424: isub /* */ // 425: dup2 /* */ // 426: iaload /* */ // 427: ldc 537141312 /* */ // 429: ior /* */ // 430: iastore /* */ // 431: aload #23 /* */ // 433: iload #12 /* */ // 435: iaload /* */ // 436: iload #27 /* */ // 438: ishr /* */ // 439: iload #26 /* */ // 441: ishl /* */ // 442: istore #28 /* */ // 444: iload #24 /* */ // 446: aload #5 /* */ // 448: iload #28 /* */ // 450: bipush #63 /* */ // 452: iand /* */ // 453: iaload /* */ // 454: iadd /* */ // 455: istore #24 /* */ // 457: goto -> 468 /* */ // 460: iload #19 /* */ // 462: sipush #16384 /* */ // 465: ior /* */ // 466: istore #19 /* */ // 468: iload #32 /* */ // 470: iconst_2 /* */ // 471: if_icmpge -> 484 /* */ // 474: aload #4 /* */ // 476: iload #10 /* */ // 478: iload #19 /* */ // 480: iastore /* */ // 481: goto -> 1224 /* */ // 484: iload #19 /* */ // 486: ldc -1610612736 /* */ // 488: iand /* */ // 489: ldc 536870912 /* */ // 491: if_icmpne -> 708 /* */ // 494: iload #12 /* */ // 496: iload #14 /* */ // 498: iadd /* */ // 499: istore #12 /* */ // 501: aload #23 /* */ // 503: iload #12 /* */ // 505: iaload /* */ // 506: iload #20 /* */ // 508: iand /* */ // 509: iload_3 /* */ // 510: iushr /* */ // 511: istore #22 /* */ // 513: aload_1 /* */ // 514: iload #22 /* */ // 516: invokevirtual a : (I)V /* */ // 519: iinc #21, 1 /* */ // 522: iload #22 /* */ // 524: ifeq -> 701 /* */ // 527: aload #23 /* */ // 529: iload #12 /* */ // 531: iaload /* */ // 532: bipush #31 /* */ // 534: iushr /* */ // 535: istore #22 /* */ // 537: aload_1 /* */ // 538: iload #22 /* */ // 540: invokevirtual a : (I)V /* */ // 543: iinc #21, 1 /* */ // 546: aload #4 /* */ // 548: iload #10 /* */ // 550: iload #36 /* */ // 552: iadd /* */ // 553: dup2 /* */ // 554: iaload /* */ // 555: sipush #8196 /* */ // 558: ior /* */ // 559: iastore /* */ // 560: aload #4 /* */ // 562: iload #10 /* */ // 564: iload #35 /* */ // 566: iadd /* */ // 567: dup2 /* */ // 568: iaload /* */ // 569: sipush #8200 /* */ // 572: ior /* */ // 573: iastore /* */ // 574: iload #22 /* */ // 576: ifeq -> 627 /* */ // 579: iload #19 /* */ // 581: ldc -1073733104 /* */ // 583: ior /* */ // 584: istore #19 /* */ // 586: aload #4 /* */ // 588: iload #10 /* */ // 590: iload #15 /* */ // 592: iadd /* */ // 593: dup2 /* */ // 594: iaload /* */ // 595: sipush #9248 /* */ // 598: ior /* */ // 599: iastore /* */ // 600: aload #4 /* */ // 602: iload #10 /* */ // 604: iconst_1 /* */ // 605: iadd /* */ // 606: dup2 /* */ // 607: iaload /* */ // 608: ldc 813703170 /* */ // 610: ior /* */ // 611: iastore /* */ // 612: aload #4 /* */ // 614: iload #10 /* */ // 616: iconst_1 /* */ // 617: isub /* */ // 618: dup2 /* */ // 619: iaload /* */ // 620: ldc 675291137 /* */ // 622: ior /* */ // 623: iastore /* */ // 624: goto -> 672 /* */ // 627: iload #19 /* */ // 629: ldc -1073733616 /* */ // 631: ior /* */ // 632: istore #19 /* */ // 634: aload #4 /* */ // 636: iload #10 /* */ // 638: iload #15 /* */ // 640: iadd /* */ // 641: dup2 /* */ // 642: iaload /* */ // 643: sipush #8224 /* */ // 646: ior /* */ // 647: iastore /* */ // 648: aload #4 /* */ // 650: iload #10 /* */ // 652: iconst_1 /* */ // 653: iadd /* */ // 654: dup2 /* */ // 655: iaload /* */ // 656: ldc 545267714 /* */ // 658: ior /* */ // 659: iastore /* */ // 660: aload #4 /* */ // 662: iload #10 /* */ // 664: iconst_1 /* */ // 665: isub /* */ // 666: dup2 /* */ // 667: iaload /* */ // 668: ldc 541073409 /* */ // 670: ior /* */ // 671: iastore /* */ // 672: aload #23 /* */ // 674: iload #12 /* */ // 676: iaload /* */ // 677: iload #27 /* */ // 679: ishr /* */ // 680: iload #26 /* */ // 682: ishl /* */ // 683: istore #28 /* */ // 685: iload #24 /* */ // 687: aload #5 /* */ // 689: iload #28 /* */ // 691: bipush #63 /* */ // 693: iand /* */ // 694: iaload /* */ // 695: iadd /* */ // 696: istore #24 /* */ // 698: goto -> 708 /* */ // 701: iload #19 /* */ // 703: ldc 1073741824 /* */ // 705: ior /* */ // 706: istore #19 /* */ // 708: aload #4 /* */ // 710: iload #10 /* */ // 712: iload #19 /* */ // 714: iastore /* */ // 715: iload #32 /* */ // 717: iconst_3 /* */ // 718: if_icmpge -> 724 /* */ // 721: goto -> 1224 /* */ // 724: iload #10 /* */ // 726: iload #15 /* */ // 728: iadd /* */ // 729: istore #10 /* */ // 731: aload #4 /* */ // 733: iload #10 /* */ // 735: iaload /* */ // 736: istore #19 /* */ // 738: iload #19 /* */ // 740: iconst_m1 /* */ // 741: ixor /* */ // 742: iload #19 /* */ // 744: iconst_2 /* */ // 745: ishl /* */ // 746: iand /* */ // 747: ldc -2147450880 /* */ // 749: iand /* */ // 750: ifeq -> 1224 /* */ // 753: iload #13 /* */ // 755: iload #14 /* */ // 757: iconst_1 /* */ // 758: ishl /* */ // 759: iadd /* */ // 760: istore #12 /* */ // 762: iload #19 /* */ // 764: ldc 40960 /* */ // 766: iand /* */ // 767: sipush #8192 /* */ // 770: if_icmpne -> 977 /* */ // 773: aload #23 /* */ // 775: iload #12 /* */ // 777: iaload /* */ // 778: iload #20 /* */ // 780: iand /* */ // 781: iload_3 /* */ // 782: iushr /* */ // 783: istore #22 /* */ // 785: aload_1 /* */ // 786: iload #22 /* */ // 788: invokevirtual a : (I)V /* */ // 791: iinc #21, 1 /* */ // 794: iload #22 /* */ // 796: ifeq -> 969 /* */ // 799: aload #23 /* */ // 801: iload #12 /* */ // 803: iaload /* */ // 804: bipush #31 /* */ // 806: iushr /* */ // 807: istore #22 /* */ // 809: aload_1 /* */ // 810: iload #22 /* */ // 812: invokevirtual a : (I)V /* */ // 815: iinc #21, 1 /* */ // 818: aload #4 /* */ // 820: iload #10 /* */ // 822: iload #33 /* */ // 824: iadd /* */ // 825: dup2 /* */ // 826: iaload /* */ // 827: ldc 536936448 /* */ // 829: ior /* */ // 830: iastore /* */ // 831: aload #4 /* */ // 833: iload #10 /* */ // 835: iload #34 /* */ // 837: iadd /* */ // 838: dup2 /* */ // 839: iaload /* */ // 840: ldc 537001984 /* */ // 842: ior /* */ // 843: iastore /* */ // 844: iload #22 /* */ // 846: ifeq -> 896 /* */ // 849: iload #19 /* */ // 851: ldc 606126080 /* */ // 853: ior /* */ // 854: istore #19 /* */ // 856: aload #4 /* */ // 858: iload #10 /* */ // 860: iload #15 /* */ // 862: isub /* */ // 863: dup2 /* */ // 864: iaload /* */ // 865: ldc 571473920 /* */ // 867: ior /* */ // 868: iastore /* */ // 869: aload #4 /* */ // 871: iload #10 /* */ // 873: iconst_1 /* */ // 874: iadd /* */ // 875: dup2 /* */ // 876: iaload /* */ // 877: ldc 537407616 /* */ // 879: ior /* */ // 880: iastore /* */ // 881: aload #4 /* */ // 883: iload #10 /* */ // 885: iconst_1 /* */ // 886: isub /* */ // 887: dup2 /* */ // 888: iaload /* */ // 889: ldc 537143360 /* */ // 891: ior /* */ // 892: iastore /* */ // 893: goto -> 940 /* */ // 896: iload #19 /* */ // 898: ldc 539017216 /* */ // 900: ior /* */ // 901: istore #19 /* */ // 903: aload #4 /* */ // 905: iload #10 /* */ // 907: iload #15 /* */ // 909: isub /* */ // 910: dup2 /* */ // 911: iaload /* */ // 912: ldc 537919488 /* */ // 914: ior /* */ // 915: iastore /* */ // 916: aload #4 /* */ // 918: iload #10 /* */ // 920: iconst_1 /* */ // 921: iadd /* */ // 922: dup2 /* */ // 923: iaload /* */ // 924: ldc 537403520 /* */ // 926: ior /* */ // 927: iastore /* */ // 928: aload #4 /* */ // 930: iload #10 /* */ // 932: iconst_1 /* */ // 933: isub /* */ // 934: dup2 /* */ // 935: iaload /* */ // 936: ldc 537141312 /* */ // 938: ior /* */ // 939: iastore /* */ // 940: aload #23 /* */ // 942: iload #12 /* */ // 944: iaload /* */ // 945: iload #27 /* */ // 947: ishr /* */ // 948: iload #26 /* */ // 950: ishl /* */ // 951: istore #28 /* */ // 953: iload #24 /* */ // 955: aload #5 /* */ // 957: iload #28 /* */ // 959: bipush #63 /* */ // 961: iand /* */ // 962: iaload /* */ // 963: iadd /* */ // 964: istore #24 /* */ // 966: goto -> 977 /* */ // 969: iload #19 /* */ // 971: sipush #16384 /* */ // 974: ior /* */ // 975: istore #19 /* */ // 977: iload #32 /* */ // 979: iconst_4 /* */ // 980: if_icmpge -> 993 /* */ // 983: aload #4 /* */ // 985: iload #10 /* */ // 987: iload #19 /* */ // 989: iastore /* */ // 990: goto -> 1224 /* */ // 993: iload #19 /* */ // 995: ldc -1610612736 /* */ // 997: iand /* */ // 998: ldc 536870912 /* */ // 1000: if_icmpne -> 1217 /* */ // 1003: iload #12 /* */ // 1005: iload #14 /* */ // 1007: iadd /* */ // 1008: istore #12 /* */ // 1010: aload #23 /* */ // 1012: iload #12 /* */ // 1014: iaload /* */ // 1015: iload #20 /* */ // 1017: iand /* */ // 1018: iload_3 /* */ // 1019: iushr /* */ // 1020: istore #22 /* */ // 1022: aload_1 /* */ // 1023: iload #22 /* */ // 1025: invokevirtual a : (I)V /* */ // 1028: iinc #21, 1 /* */ // 1031: iload #22 /* */ // 1033: ifeq -> 1210 /* */ // 1036: aload #23 /* */ // 1038: iload #12 /* */ // 1040: iaload /* */ // 1041: bipush #31 /* */ // 1043: iushr /* */ // 1044: istore #22 /* */ // 1046: aload_1 /* */ // 1047: iload #22 /* */ // 1049: invokevirtual a : (I)V /* */ // 1052: iinc #21, 1 /* */ // 1055: aload #4 /* */ // 1057: iload #10 /* */ // 1059: iload #36 /* */ // 1061: iadd /* */ // 1062: dup2 /* */ // 1063: iaload /* */ // 1064: sipush #8196 /* */ // 1067: ior /* */ // 1068: iastore /* */ // 1069: aload #4 /* */ // 1071: iload #10 /* */ // 1073: iload #35 /* */ // 1075: iadd /* */ // 1076: dup2 /* */ // 1077: iaload /* */ // 1078: sipush #8200 /* */ // 1081: ior /* */ // 1082: iastore /* */ // 1083: iload #22 /* */ // 1085: ifeq -> 1136 /* */ // 1088: iload #19 /* */ // 1090: ldc -1073733104 /* */ // 1092: ior /* */ // 1093: istore #19 /* */ // 1095: aload #4 /* */ // 1097: iload #10 /* */ // 1099: iload #15 /* */ // 1101: iadd /* */ // 1102: dup2 /* */ // 1103: iaload /* */ // 1104: sipush #9248 /* */ // 1107: ior /* */ // 1108: iastore /* */ // 1109: aload #4 /* */ // 1111: iload #10 /* */ // 1113: iconst_1 /* */ // 1114: iadd /* */ // 1115: dup2 /* */ // 1116: iaload /* */ // 1117: ldc 813703170 /* */ // 1119: ior /* */ // 1120: iastore /* */ // 1121: aload #4 /* */ // 1123: iload #10 /* */ // 1125: iconst_1 /* */ // 1126: isub /* */ // 1127: dup2 /* */ // 1128: iaload /* */ // 1129: ldc 675291137 /* */ // 1131: ior /* */ // 1132: iastore /* */ // 1133: goto -> 1181 /* */ // 1136: iload #19 /* */ // 1138: ldc -1073733616 /* */ // 1140: ior /* */ // 1141: istore #19 /* */ // 1143: aload #4 /* */ // 1145: iload #10 /* */ // 1147: iload #15 /* */ // 1149: iadd /* */ // 1150: dup2 /* */ // 1151: iaload /* */ // 1152: sipush #8224 /* */ // 1155: ior /* */ // 1156: iastore /* */ // 1157: aload #4 /* */ // 1159: iload #10 /* */ // 1161: iconst_1 /* */ // 1162: iadd /* */ // 1163: dup2 /* */ // 1164: iaload /* */ // 1165: ldc 545267714 /* */ // 1167: ior /* */ // 1168: iastore /* */ // 1169: aload #4 /* */ // 1171: iload #10 /* */ // 1173: iconst_1 /* */ // 1174: isub /* */ // 1175: dup2 /* */ // 1176: iaload /* */ // 1177: ldc 541073409 /* */ // 1179: ior /* */ // 1180: iastore /* */ // 1181: aload #23 /* */ // 1183: iload #12 /* */ // 1185: iaload /* */ // 1186: iload #27 /* */ // 1188: ishr /* */ // 1189: iload #26 /* */ // 1191: ishl /* */ // 1192: istore #28 /* */ // 1194: iload #24 /* */ // 1196: aload #5 /* */ // 1198: iload #28 /* */ // 1200: bipush #63 /* */ // 1202: iand /* */ // 1203: iaload /* */ // 1204: iadd /* */ // 1205: istore #24 /* */ // 1207: goto -> 1217 /* */ // 1210: iload #19 /* */ // 1212: ldc 1073741824 /* */ // 1214: ior /* */ // 1215: istore #19 /* */ // 1217: aload #4 /* */ // 1219: iload #10 /* */ // 1221: iload #19 /* */ // 1223: iastore /* */ // 1224: iinc #13, 1 /* */ // 1227: iinc #11, 1 /* */ // 1230: goto -> 201 /* */ // 1233: iinc #29, -1 /* */ // 1236: iload #13 /* */ // 1238: iload #17 /* */ // 1240: iadd /* */ // 1241: istore #13 /* */ // 1243: iload #11 /* */ // 1245: iload #16 /* */ // 1247: iadd /* */ // 1248: istore #11 /* */ // 1250: goto -> 165 /* */ // 1253: iload_2 /* */ // 1254: ifeq -> 1269 /* */ // 1257: aload #6 /* */ // 1259: iload #7 /* */ // 1261: aload_1 /* */ // 1262: invokevirtual b : ()I /* */ // 1265: iastore /* */ // 1266: goto -> 1278 /* */ // 1269: aload #6 /* */ // 1271: iload #7 /* */ // 1273: aload_1 /* */ // 1274: invokevirtual d : ()I /* */ // 1277: iastore /* */ // 1278: iload #8 /* */ // 1280: iflt -> 1296 /* */ // 1283: aload #6 /* */ // 1285: iload #7 /* */ // 1287: dup2 /* */ // 1288: iaload /* */ // 1289: aload #6 /* */ // 1291: iload #8 /* */ // 1293: iaload /* */ // 1294: iadd /* */ // 1295: iastore /* */ // 1296: iload #24 /* */ // 1298: ireturn /* */ // Line number table: /* */ // Java source line number -> byte code offset /* */ // #2018 -> 0 /* */ // #2034 -> 3 /* */ // #2035 -> 9 /* */ // #2036 -> 17 /* */ // #2037 -> 30 /* */ // #2038 -> 41 /* */ // #2039 -> 46 /* */ // #2040 -> 58 /* */ // #2041 -> 70 /* */ // #2044 -> 73 /* */ // #2045 -> 79 /* */ // #2046 -> 93 /* */ // #2047 -> 106 /* */ // #2050 -> 121 /* */ // #2051 -> 128 /* */ // #2052 -> 135 /* */ // #2053 -> 141 /* */ // #2056 -> 147 /* */ // #2057 -> 153 /* */ // #2058 -> 159 /* */ // #2059 -> 170 /* */ // #2061 -> 192 /* */ // #2063 -> 201 /* */ // #2065 -> 208 /* */ // #2066 -> 212 /* */ // #2070 -> 219 /* */ // #2071 -> 234 /* */ // #2073 -> 238 /* */ // #2076 -> 249 /* */ // #2077 -> 261 /* */ // #2078 -> 267 /* */ // #2080 -> 270 /* */ // #2083 -> 275 /* */ // #2084 -> 285 /* */ // #2085 -> 291 /* */ // #2091 -> 294 /* */ // #2094 -> 299 /* */ // #2096 -> 312 /* */ // #2100 -> 325 /* */ // #2101 -> 330 /* */ // #2104 -> 337 /* */ // #2107 -> 342 /* */ // #2110 -> 355 /* */ // #2114 -> 367 /* */ // #2120 -> 382 /* */ // #2122 -> 389 /* */ // #2125 -> 394 /* */ // #2128 -> 407 /* */ // #2131 -> 419 /* */ // #2136 -> 431 /* */ // #2137 -> 444 /* */ // #2140 -> 460 /* */ // #2143 -> 468 /* */ // #2144 -> 474 /* */ // #2145 -> 481 /* */ // #2148 -> 484 /* */ // #2150 -> 494 /* */ // #2152 -> 501 /* */ // #2153 -> 513 /* */ // #2154 -> 519 /* */ // #2155 -> 522 /* */ // #2158 -> 527 /* */ // #2159 -> 537 /* */ // #2160 -> 543 /* */ // #2165 -> 546 /* */ // #2166 -> 560 /* */ // #2168 -> 574 /* */ // #2169 -> 579 /* */ // #2172 -> 586 /* */ // #2174 -> 600 /* */ // #2178 -> 612 /* */ // #2184 -> 627 /* */ // #2186 -> 634 /* */ // #2188 -> 648 /* */ // #2191 -> 660 /* */ // #2196 -> 672 /* */ // #2197 -> 685 /* */ // #2200 -> 701 /* */ // #2203 -> 708 /* */ // #2206 -> 715 /* */ // #2207 -> 724 /* */ // #2208 -> 731 /* */ // #2212 -> 738 /* */ // #2213 -> 753 /* */ // #2215 -> 762 /* */ // #2217 -> 773 /* */ // #2218 -> 785 /* */ // #2219 -> 791 /* */ // #2220 -> 794 /* */ // #2223 -> 799 /* */ // #2224 -> 809 /* */ // #2225 -> 815 /* */ // #2230 -> 818 /* */ // #2231 -> 831 /* */ // #2233 -> 844 /* */ // #2234 -> 849 /* */ // #2237 -> 856 /* */ // #2239 -> 869 /* */ // #2243 -> 881 /* */ // #2249 -> 896 /* */ // #2251 -> 903 /* */ // #2253 -> 916 /* */ // #2256 -> 928 /* */ // #2261 -> 940 /* */ // #2262 -> 953 /* */ // #2265 -> 969 /* */ // #2268 -> 977 /* */ // #2269 -> 983 /* */ // #2270 -> 990 /* */ // #2272 -> 993 /* */ // #2274 -> 1003 /* */ // #2276 -> 1010 /* */ // #2277 -> 1022 /* */ // #2278 -> 1028 /* */ // #2279 -> 1031 /* */ // #2282 -> 1036 /* */ // #2283 -> 1046 /* */ // #2284 -> 1052 /* */ // #2289 -> 1055 /* */ // #2290 -> 1069 /* */ // #2292 -> 1083 /* */ // #2293 -> 1088 /* */ // #2296 -> 1095 /* */ // #2298 -> 1109 /* */ // #2302 -> 1121 /* */ // #2308 -> 1136 /* */ // #2310 -> 1143 /* */ // #2312 -> 1157 /* */ // #2315 -> 1169 /* */ // #2320 -> 1181 /* */ // #2321 -> 1194 /* */ // #2324 -> 1210 /* */ // #2327 -> 1217 /* */ // #2063 -> 1224 /* */ // #2058 -> 1233 /* */ // #2333 -> 1253 /* */ // #2334 -> 1257 /* */ // #2336 -> 1269 /* */ // #2339 -> 1278 /* */ // #2340 -> 1283 /* */ // #2344 -> 1296 /* */ // Local variable table: /* */ // start length slot name descriptor /* */ // 0 1299 0 srcblk Lc/a/j/a/g; /* */ // 0 1299 1 bout Lc/a/c/b/a; /* */ // 0 1299 2 doterm Z /* */ // 0 1299 3 bp I /* */ // 0 1299 4 state [I /* */ // 0 1299 5 fs [I /* */ // 0 1299 6 ratebuf [I /* */ // 0 1299 7 pidx I /* */ // 0 1299 8 ltpidx I /* */ // 0 1299 9 options I /* */ // 3 1296 21 nsym I /* */ // 9 1290 14 dscanw I /* */ // 17 1282 15 sscanw I /* */ // 30 1269 16 jstep I /* */ // 41 1258 17 kstep I /* */ // 46 1253 20 mask I /* */ // 58 1241 23 data [I /* */ // 70 1229 31 nstripes I /* */ // 73 1226 24 dist I /* */ // 79 1220 25 shift I /* */ // 93 1206 26 upshift I /* */ // 106 1193 27 downshift I /* */ // 121 1178 30 causal Z /* */ // 128 1171 33 off_ul I /* */ // 135 1164 34 off_ur I /* */ // 141 1158 35 off_dr I /* */ // 147 1152 36 off_dl I /* */ // 153 1146 13 sk I /* */ // 159 1140 11 sj I /* */ // 165 1134 29 s I /* */ // 192 1058 32 sheight I /* */ // 201 1049 18 stopsk I /* */ // 212 1018 10 j I /* */ // 219 1011 19 csj I /* */ // 238 477 12 k I /* */ // 261 207 22 sym I /* */ // 444 16 28 normval I /* */ // 513 195 22 sym I /* */ // 685 16 28 normval I /* */ // 762 462 12 k I /* */ // 785 192 22 sym I /* */ // 953 16 28 normval I /* */ // 1022 195 22 sym I /* */ // 1194 16 28 normval I /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static int a(g srcblk, i mq, boolean doterm, int bp, int[] state, int[] fm, int[] symbuf, int[] ctxtbuf, int[] ratebuf, int pidx, int ltpidx, int options) { /* */ // Byte code: /* */ // 0: iconst_0 /* */ // 1: istore #16 /* */ // 3: aload_0 /* */ // 4: getfield i : I /* */ // 7: istore #17 /* */ // 9: aload_0 /* */ // 10: getfield f : I /* */ // 13: iconst_2 /* */ // 14: iadd /* */ // 15: istore #18 /* */ // 17: iload #18 /* */ // 19: iconst_4 /* */ // 20: imul /* */ // 21: iconst_2 /* */ // 22: idiv /* */ // 23: aload_0 /* */ // 24: getfield f : I /* */ // 27: isub /* */ // 28: istore #19 /* */ // 30: iload #17 /* */ // 32: iconst_4 /* */ // 33: imul /* */ // 34: aload_0 /* */ // 35: getfield f : I /* */ // 38: isub /* */ // 39: istore #20 /* */ // 41: iconst_1 /* */ // 42: iload_3 /* */ // 43: ishl /* */ // 44: istore #23 /* */ // 46: aload_0 /* */ // 47: invokevirtual b : ()Ljava/lang/Object; /* */ // 50: checkcast [I /* */ // 53: checkcast [I /* */ // 56: astore #24 /* */ // 58: aload_0 /* */ // 59: getfield g : I /* */ // 62: iconst_4 /* */ // 63: iadd /* */ // 64: iconst_1 /* */ // 65: isub /* */ // 66: iconst_4 /* */ // 67: idiv /* */ // 68: istore #31 /* */ // 70: iconst_0 /* */ // 71: istore #25 /* */ // 73: iload_3 /* */ // 74: bipush #6 /* */ // 76: isub /* */ // 77: istore #26 /* */ // 79: iload #26 /* */ // 81: iflt -> 88 /* */ // 84: iconst_0 /* */ // 85: goto -> 91 /* */ // 88: iload #26 /* */ // 90: ineg /* */ // 91: istore #27 /* */ // 93: iload #26 /* */ // 95: ifgt -> 102 /* */ // 98: iconst_0 /* */ // 99: goto -> 104 /* */ // 102: iload #26 /* */ // 104: istore #28 /* */ // 106: aload_0 /* */ // 107: getfield h : I /* */ // 110: istore #15 /* */ // 112: iload #18 /* */ // 114: iconst_1 /* */ // 115: iadd /* */ // 116: istore #13 /* */ // 118: iload #31 /* */ // 120: iconst_1 /* */ // 121: isub /* */ // 122: istore #30 /* */ // 124: iload #30 /* */ // 126: iflt -> 666 /* */ // 129: iload #30 /* */ // 131: ifeq -> 138 /* */ // 134: iconst_4 /* */ // 135: goto -> 149 /* */ // 138: aload_0 /* */ // 139: getfield g : I /* */ // 142: iload #31 /* */ // 144: iconst_1 /* */ // 145: isub /* */ // 146: iconst_4 /* */ // 147: imul /* */ // 148: isub /* */ // 149: istore #32 /* */ // 151: iload #15 /* */ // 153: aload_0 /* */ // 154: getfield f : I /* */ // 157: iadd /* */ // 158: istore #21 /* */ // 160: iconst_0 /* */ // 161: istore #16 /* */ // 163: iload #15 /* */ // 165: iload #21 /* */ // 167: if_icmpge -> 631 /* */ // 170: iload #13 /* */ // 172: istore #12 /* */ // 174: aload #4 /* */ // 176: iload #12 /* */ // 178: iaload /* */ // 179: istore #22 /* */ // 181: iload #22 /* */ // 183: iconst_1 /* */ // 184: iushr /* */ // 185: iload #22 /* */ // 187: iconst_m1 /* */ // 188: ixor /* */ // 189: iand /* */ // 190: ldc 1073758208 /* */ // 192: iand /* */ // 193: ifeq -> 386 /* */ // 196: iload #15 /* */ // 198: istore #14 /* */ // 200: iload #22 /* */ // 202: ldc 49152 /* */ // 204: iand /* */ // 205: ldc 32768 /* */ // 207: if_icmpne -> 277 /* */ // 210: aload #6 /* */ // 212: iload #16 /* */ // 214: aload #24 /* */ // 216: iload #14 /* */ // 218: iaload /* */ // 219: iload #23 /* */ // 221: iand /* */ // 222: iload_3 /* */ // 223: iushr /* */ // 224: iastore /* */ // 225: aload #7 /* */ // 227: iload #16 /* */ // 229: iinc #16, 1 /* */ // 232: getstatic c/a/c/b/k.Z : [I /* */ // 235: iload #22 /* */ // 237: sipush #511 /* */ // 240: iand /* */ // 241: iaload /* */ // 242: iastore /* */ // 243: iload #22 /* */ // 245: sipush #256 /* */ // 248: ior /* */ // 249: istore #22 /* */ // 251: aload #24 /* */ // 253: iload #14 /* */ // 255: iaload /* */ // 256: iload #28 /* */ // 258: ishr /* */ // 259: iload #27 /* */ // 261: ishl /* */ // 262: istore #29 /* */ // 264: iload #25 /* */ // 266: aload #5 /* */ // 268: iload #29 /* */ // 270: bipush #127 /* */ // 272: iand /* */ // 273: iaload /* */ // 274: iadd /* */ // 275: istore #25 /* */ // 277: iload #32 /* */ // 279: iconst_2 /* */ // 280: if_icmpge -> 293 /* */ // 283: aload #4 /* */ // 285: iload #12 /* */ // 287: iload #22 /* */ // 289: iastore /* */ // 290: goto -> 622 /* */ // 293: iload #22 /* */ // 295: ldc -1073741824 /* */ // 297: iand /* */ // 298: ldc -2147483648 /* */ // 300: if_icmpne -> 379 /* */ // 303: iload #14 /* */ // 305: iload #17 /* */ // 307: iadd /* */ // 308: istore #14 /* */ // 310: aload #6 /* */ // 312: iload #16 /* */ // 314: aload #24 /* */ // 316: iload #14 /* */ // 318: iaload /* */ // 319: iload #23 /* */ // 321: iand /* */ // 322: iload_3 /* */ // 323: iushr /* */ // 324: iastore /* */ // 325: aload #7 /* */ // 327: iload #16 /* */ // 329: iinc #16, 1 /* */ // 332: getstatic c/a/c/b/k.Z : [I /* */ // 335: iload #22 /* */ // 337: bipush #16 /* */ // 339: iushr /* */ // 340: sipush #511 /* */ // 343: iand /* */ // 344: iaload /* */ // 345: iastore /* */ // 346: iload #22 /* */ // 348: ldc 16777216 /* */ // 350: ior /* */ // 351: istore #22 /* */ // 353: aload #24 /* */ // 355: iload #14 /* */ // 357: iaload /* */ // 358: iload #28 /* */ // 360: ishr /* */ // 361: iload #27 /* */ // 363: ishl /* */ // 364: istore #29 /* */ // 366: iload #25 /* */ // 368: aload #5 /* */ // 370: iload #29 /* */ // 372: bipush #127 /* */ // 374: iand /* */ // 375: iaload /* */ // 376: iadd /* */ // 377: istore #25 /* */ // 379: aload #4 /* */ // 381: iload #12 /* */ // 383: iload #22 /* */ // 385: iastore /* */ // 386: iload #32 /* */ // 388: iconst_3 /* */ // 389: if_icmpge -> 395 /* */ // 392: goto -> 622 /* */ // 395: iload #12 /* */ // 397: iload #18 /* */ // 399: iadd /* */ // 400: istore #12 /* */ // 402: aload #4 /* */ // 404: iload #12 /* */ // 406: iaload /* */ // 407: istore #22 /* */ // 409: iload #22 /* */ // 411: iconst_1 /* */ // 412: iushr /* */ // 413: iload #22 /* */ // 415: iconst_m1 /* */ // 416: ixor /* */ // 417: iand /* */ // 418: ldc 1073758208 /* */ // 420: iand /* */ // 421: ifeq -> 622 /* */ // 424: iload #15 /* */ // 426: iload #17 /* */ // 428: iconst_1 /* */ // 429: ishl /* */ // 430: iadd /* */ // 431: istore #14 /* */ // 433: iload #22 /* */ // 435: ldc 49152 /* */ // 437: iand /* */ // 438: ldc 32768 /* */ // 440: if_icmpne -> 510 /* */ // 443: aload #6 /* */ // 445: iload #16 /* */ // 447: aload #24 /* */ // 449: iload #14 /* */ // 451: iaload /* */ // 452: iload #23 /* */ // 454: iand /* */ // 455: iload_3 /* */ // 456: iushr /* */ // 457: iastore /* */ // 458: aload #7 /* */ // 460: iload #16 /* */ // 462: iinc #16, 1 /* */ // 465: getstatic c/a/c/b/k.Z : [I /* */ // 468: iload #22 /* */ // 470: sipush #511 /* */ // 473: iand /* */ // 474: iaload /* */ // 475: iastore /* */ // 476: iload #22 /* */ // 478: sipush #256 /* */ // 481: ior /* */ // 482: istore #22 /* */ // 484: aload #24 /* */ // 486: iload #14 /* */ // 488: iaload /* */ // 489: iload #28 /* */ // 491: ishr /* */ // 492: iload #27 /* */ // 494: ishl /* */ // 495: istore #29 /* */ // 497: iload #25 /* */ // 499: aload #5 /* */ // 501: iload #29 /* */ // 503: bipush #127 /* */ // 505: iand /* */ // 506: iaload /* */ // 507: iadd /* */ // 508: istore #25 /* */ // 510: iload #32 /* */ // 512: iconst_4 /* */ // 513: if_icmpge -> 526 /* */ // 516: aload #4 /* */ // 518: iload #12 /* */ // 520: iload #22 /* */ // 522: iastore /* */ // 523: goto -> 622 /* */ // 526: aload #4 /* */ // 528: iload #12 /* */ // 530: iaload /* */ // 531: ldc -1073741824 /* */ // 533: iand /* */ // 534: ldc -2147483648 /* */ // 536: if_icmpne -> 615 /* */ // 539: iload #14 /* */ // 541: iload #17 /* */ // 543: iadd /* */ // 544: istore #14 /* */ // 546: aload #6 /* */ // 548: iload #16 /* */ // 550: aload #24 /* */ // 552: iload #14 /* */ // 554: iaload /* */ // 555: iload #23 /* */ // 557: iand /* */ // 558: iload_3 /* */ // 559: iushr /* */ // 560: iastore /* */ // 561: aload #7 /* */ // 563: iload #16 /* */ // 565: iinc #16, 1 /* */ // 568: getstatic c/a/c/b/k.Z : [I /* */ // 571: iload #22 /* */ // 573: bipush #16 /* */ // 575: iushr /* */ // 576: sipush #511 /* */ // 579: iand /* */ // 580: iaload /* */ // 581: iastore /* */ // 582: iload #22 /* */ // 584: ldc 16777216 /* */ // 586: ior /* */ // 587: istore #22 /* */ // 589: aload #24 /* */ // 591: iload #14 /* */ // 593: iaload /* */ // 594: iload #28 /* */ // 596: ishr /* */ // 597: iload #27 /* */ // 599: ishl /* */ // 600: istore #29 /* */ // 602: iload #25 /* */ // 604: aload #5 /* */ // 606: iload #29 /* */ // 608: bipush #127 /* */ // 610: iand /* */ // 611: iaload /* */ // 612: iadd /* */ // 613: istore #25 /* */ // 615: aload #4 /* */ // 617: iload #12 /* */ // 619: iload #22 /* */ // 621: iastore /* */ // 622: iinc #15, 1 /* */ // 625: iinc #13, 1 /* */ // 628: goto -> 163 /* */ // 631: iload #16 /* */ // 633: ifle -> 646 /* */ // 636: aload_1 /* */ // 637: aload #6 /* */ // 639: aload #7 /* */ // 641: iload #16 /* */ // 643: invokevirtual a : ([I[II)V /* */ // 646: iinc #30, -1 /* */ // 649: iload #15 /* */ // 651: iload #20 /* */ // 653: iadd /* */ // 654: istore #15 /* */ // 656: iload #13 /* */ // 658: iload #19 /* */ // 660: iadd /* */ // 661: istore #13 /* */ // 663: goto -> 124 /* */ // 666: iload #11 /* */ // 668: iconst_2 /* */ // 669: iand /* */ // 670: ifeq -> 677 /* */ // 673: aload_1 /* */ // 674: invokevirtual c : ()V /* */ // 677: iload_2 /* */ // 678: ifeq -> 693 /* */ // 681: aload #8 /* */ // 683: iload #9 /* */ // 685: aload_1 /* */ // 686: invokevirtual a : ()I /* */ // 689: iastore /* */ // 690: goto -> 702 /* */ // 693: aload #8 /* */ // 695: iload #9 /* */ // 697: aload_1 /* */ // 698: invokevirtual d : ()I /* */ // 701: iastore /* */ // 702: iload #10 /* */ // 704: iflt -> 720 /* */ // 707: aload #8 /* */ // 709: iload #9 /* */ // 711: dup2 /* */ // 712: iaload /* */ // 713: aload #8 /* */ // 715: iload #10 /* */ // 717: iaload /* */ // 718: iadd /* */ // 719: iastore /* */ // 720: iload_2 /* */ // 721: ifeq -> 732 /* */ // 724: aload_1 /* */ // 725: aload #8 /* */ // 727: iload #9 /* */ // 729: invokevirtual a : ([II)V /* */ // 732: iload #25 /* */ // 734: ireturn /* */ // Line number table: /* */ // Java source line number -> byte code offset /* */ // #2392 -> 0 /* */ // #2411 -> 3 /* */ // #2412 -> 9 /* */ // #2413 -> 17 /* */ // #2414 -> 30 /* */ // #2415 -> 41 /* */ // #2416 -> 46 /* */ // #2417 -> 58 /* */ // #2418 -> 70 /* */ // #2421 -> 73 /* */ // #2422 -> 79 /* */ // #2423 -> 93 /* */ // #2426 -> 106 /* */ // #2427 -> 112 /* */ // #2428 -> 118 /* */ // #2429 -> 129 /* */ // #2431 -> 151 /* */ // #2433 -> 160 /* */ // #2435 -> 170 /* */ // #2436 -> 174 /* */ // #2439 -> 181 /* */ // #2440 -> 196 /* */ // #2442 -> 200 /* */ // #2445 -> 210 /* */ // #2446 -> 225 /* */ // #2448 -> 243 /* */ // #2450 -> 251 /* */ // #2451 -> 264 /* */ // #2453 -> 277 /* */ // #2454 -> 283 /* */ // #2455 -> 290 /* */ // #2458 -> 293 /* */ // #2460 -> 303 /* */ // #2462 -> 310 /* */ // #2463 -> 325 /* */ // #2465 -> 346 /* */ // #2467 -> 353 /* */ // #2468 -> 366 /* */ // #2470 -> 379 /* */ // #2473 -> 386 /* */ // #2474 -> 395 /* */ // #2475 -> 402 /* */ // #2478 -> 409 /* */ // #2479 -> 424 /* */ // #2481 -> 433 /* */ // #2484 -> 443 /* */ // #2485 -> 458 /* */ // #2487 -> 476 /* */ // #2489 -> 484 /* */ // #2490 -> 497 /* */ // #2492 -> 510 /* */ // #2493 -> 516 /* */ // #2494 -> 523 /* */ // #2497 -> 526 /* */ // #2499 -> 539 /* */ // #2501 -> 546 /* */ // #2502 -> 561 /* */ // #2504 -> 582 /* */ // #2506 -> 589 /* */ // #2507 -> 602 /* */ // #2509 -> 615 /* */ // #2433 -> 622 /* */ // #2513 -> 631 /* */ // #2428 -> 646 /* */ // #2517 -> 666 /* */ // #2518 -> 673 /* */ // #2522 -> 677 /* */ // #2523 -> 681 /* */ // #2526 -> 693 /* */ // #2529 -> 702 /* */ // #2530 -> 707 /* */ // #2533 -> 720 /* */ // #2534 -> 724 /* */ // #2538 -> 732 /* */ // Local variable table: /* */ // start length slot name descriptor /* */ // 0 735 0 srcblk Lc/a/j/a/g; /* */ // 0 735 1 mq Lc/a/c/b/i; /* */ // 0 735 2 doterm Z /* */ // 0 735 3 bp I /* */ // 0 735 4 state [I /* */ // 0 735 5 fm [I /* */ // 0 735 6 symbuf [I /* */ // 0 735 7 ctxtbuf [I /* */ // 0 735 8 ratebuf [I /* */ // 0 735 9 pidx I /* */ // 0 735 10 ltpidx I /* */ // 0 735 11 options I /* */ // 3 732 16 nsym I /* */ // 9 726 17 dscanw I /* */ // 17 718 18 sscanw I /* */ // 30 705 19 jstep I /* */ // 41 694 20 kstep I /* */ // 46 689 23 mask I /* */ // 58 677 24 data [I /* */ // 70 665 31 nstripes I /* */ // 73 662 25 dist I /* */ // 79 656 26 shift I /* */ // 93 642 27 upshift I /* */ // 106 629 28 downshift I /* */ // 112 623 15 sk I /* */ // 118 617 13 sj I /* */ // 124 611 30 s I /* */ // 151 512 32 sheight I /* */ // 160 503 21 stopsk I /* */ // 174 454 12 j I /* */ // 181 447 22 csj I /* */ // 200 186 14 k I /* */ // 264 13 29 normval I /* */ // 366 13 29 normval I /* */ // 433 189 14 k I /* */ // 497 13 29 normval I /* */ // 602 13 29 normval I /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static int b(g srcblk, a bout, boolean doterm, int bp, int[] state, int[] fm, int[] ratebuf, int pidx, int ltpidx, int options) { /* 2605 */ int nsym = 0; /* */ /* */ /* 2608 */ int dscanw = srcblk.i; /* 2609 */ int sscanw = srcblk.f + 2; /* 2610 */ int jstep = sscanw * 4 / 2 - srcblk.f; /* 2611 */ int kstep = dscanw * 4 - srcblk.f; /* 2612 */ int mask = 1 << bp; /* 2613 */ int[] data = (int[])srcblk.b(); /* 2614 */ int nstripes = (srcblk.g + 4 - 1) / 4; /* 2615 */ int dist = 0; /* */ /* */ /* 2618 */ int shift = bp - 6; /* 2619 */ int upshift = (shift >= 0) ? 0 : -shift; /* 2620 */ int downshift = (shift <= 0) ? 0 : shift; /* */ /* */ /* 2623 */ int sk = srcblk.h; /* 2624 */ int sj = sscanw + 1; /* 2625 */ for (int s = nstripes - 1; s >= 0; s--, sk += kstep, sj += jstep) { /* 2626 */ int sheight = (s != 0) ? 4 : (srcblk.g - (nstripes - 1) * 4); /* */ /* 2628 */ int stopsk = sk + srcblk.f; /* */ /* 2630 */ for (; sk < stopsk; sk++, sj++) { /* */ /* 2632 */ int j = sj; /* 2633 */ int csj = state[j]; /* */ /* */ /* 2636 */ if ((csj >>> 1 & (csj ^ 0xFFFFFFFF) & 0x40004000) != 0) { /* 2637 */ int m = sk; /* */ /* 2639 */ if ((csj & 0xC000) == 32768) { /* */ /* */ /* 2642 */ bout.a((data[m] & mask) >>> bp); /* 2643 */ nsym++; /* */ /* */ /* */ /* 2647 */ int normval = data[m] >> downshift << upshift; /* 2648 */ dist += fm[normval & 0x7F]; /* */ } /* 2650 */ if (sheight < 2) /* */ continue; /* 2652 */ if ((csj & 0xC0000000) == Integer.MIN_VALUE) { /* */ /* 2654 */ m += dscanw; /* */ /* 2656 */ bout.a((data[m] & mask) >>> bp); /* 2657 */ nsym++; /* */ /* */ /* */ /* 2661 */ int normval = data[m] >> downshift << upshift; /* 2662 */ dist += fm[normval & 0x7F]; /* */ } /* */ } /* */ /* 2666 */ if (sheight >= 3) { /* 2667 */ j += sscanw; /* 2668 */ csj = state[j]; /* */ /* */ /* 2671 */ if ((csj >>> 1 & (csj ^ 0xFFFFFFFF) & 0x40004000) != 0) { /* 2672 */ int m = sk + (dscanw << 1); /* */ /* 2674 */ if ((csj & 0xC000) == 32768) { /* */ /* */ /* 2677 */ bout.a((data[m] & mask) >>> bp); /* 2678 */ nsym++; /* */ /* */ /* */ /* 2682 */ int normval = data[m] >> downshift << upshift; /* 2683 */ dist += fm[normval & 0x7F]; /* */ } /* 2685 */ if (sheight >= 4) /* */ { /* 2687 */ if ((state[j] & 0xC0000000) == Integer.MIN_VALUE) { /* */ /* 2689 */ m += dscanw; /* */ /* 2691 */ bout.a((data[m] & mask) >>> bp); /* 2692 */ nsym++; /* */ /* */ /* */ /* 2696 */ int normval = data[m] >> downshift << upshift; /* 2697 */ dist += fm[normval & 0x7F]; /* */ } } /* */ } /* */ } /* */ continue; /* */ } /* */ } /* 2704 */ if (doterm) { /* 2705 */ ratebuf[pidx] = bout.b(); /* */ } else { /* 2707 */ ratebuf[pidx] = bout.d(); /* */ } /* */ /* */ /* 2711 */ if (ltpidx >= 0) { /* 2712 */ ratebuf[pidx] = ratebuf[pidx] + ratebuf[ltpidx]; /* */ } /* */ /* */ /* 2716 */ return dist; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static int b(g srcblk, i mq, boolean doterm, int bp, int[] state, int[] fs, int[] zc_lut, int[] symbuf, int[] ctxtbuf, int[] ratebuf, int pidx, int ltpidx, int options) { /* 2772 */ int nsym = 0; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 2797 */ int dscanw = srcblk.i; /* 2798 */ int sscanw = srcblk.f + 2; /* 2799 */ int jstep = sscanw * 4 / 2 - srcblk.f; /* 2800 */ int kstep = dscanw * 4 - srcblk.f; /* 2801 */ int mask = 1 << bp; /* 2802 */ int[] data = (int[])srcblk.b(); /* 2803 */ int nstripes = (srcblk.g + 4 - 1) / 4; /* 2804 */ int dist = 0; /* */ /* */ /* 2807 */ int shift = bp - 6; /* 2808 */ int upshift = (shift >= 0) ? 0 : -shift; /* 2809 */ int downshift = (shift <= 0) ? 0 : shift; /* 2810 */ boolean causal = ((options & 0x8) != 0); /* */ /* */ /* 2813 */ int off_ul = -sscanw - 1; /* 2814 */ int off_ur = -sscanw + 1; /* 2815 */ int off_dr = sscanw + 1; /* 2816 */ int off_dl = sscanw - 1; /* */ /* */ /* 2819 */ int sk = srcblk.h; /* 2820 */ int sj = sscanw + 1; /* 2821 */ for (int s = nstripes - 1; s >= 0; s--, sk += kstep, sj += jstep) { /* 2822 */ int sheight = (s != 0) ? 4 : (srcblk.g - (nstripes - 1) * 4); /* */ /* 2824 */ int stopsk = sk + srcblk.f; /* */ /* 2826 */ nsym = 0; while (true) { sk++; sj++; } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 3249 */ if (nsym > 0) mq.a(symbuf, ctxtbuf, nsym); /* */ /* */ continue; /* */ } /* 3253 */ if ((options & 0x20) != 0) { /* 3254 */ mq.a(ae, af, ae.length); /* */ } /* */ /* */ /* 3258 */ if ((options & 0x2) != 0) { /* 3259 */ mq.c(); /* */ } /* */ /* */ /* 3263 */ if (doterm) { /* 3264 */ ratebuf[pidx] = mq.a(); /* */ } else { /* */ /* 3267 */ ratebuf[pidx] = mq.d(); /* */ } /* */ /* 3270 */ if (ltpidx >= 0) { /* 3271 */ ratebuf[pidx] = ratebuf[pidx] + ratebuf[ltpidx]; /* */ } /* */ /* 3274 */ if (doterm) { /* 3275 */ mq.a(ratebuf, pidx); /* */ } /* */ /* */ /* 3279 */ return dist; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static void a(byte[] data, int[] rates, boolean[] isterm, int n) { /* 3323 */ if (isterm == null) { /* 3324 */ for (; --n >= 0; n--) { /* 3325 */ int dp = rates[n] - 1; /* 3326 */ if (dp >= 0 && data[dp] == -1) { /* 3327 */ rates[n] = rates[n] - 1; /* */ } /* */ } /* */ } else { /* */ /* 3332 */ for (; --n >= 0; n--) { /* 3333 */ if (!isterm[n]) { /* 3334 */ int dp = rates[n] - 1; /* 3335 */ if (dp >= 0 && data[dp] == -1) { /* 3336 */ rates[n] = rates[n] - 1; /* */ } /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void f(int nt, int nc) { /* 3353 */ this.M = new int[nt][nc]; /* 3354 */ this.N = new int[nt][nc]; /* 3355 */ this.O = new int[nt][nc]; /* */ /* 3357 */ for (int t = 0; t < nt; t++) { /* 3358 */ for (int j = 0; j < nc; j++) { /* 3359 */ this.M[t][j] = 0; /* */ /* */ /* 3362 */ if (((String)this.f.a(t, j)) /* 3363 */ .equalsIgnoreCase("true")) { /* 3364 */ this.M[t][j] = this.M[t][j] | 0x1; /* */ } /* */ /* 3367 */ if (((String)this.g.a(t, j)) /* 3368 */ .equalsIgnoreCase("true")) { /* 3369 */ this.M[t][j] = this.M[t][j] | 0x2; /* */ } /* */ /* 3372 */ if (((String)this.h.a(t, j)) /* 3373 */ .equalsIgnoreCase("true")) { /* 3374 */ this.M[t][j] = this.M[t][j] | 0x4; /* */ } /* */ /* 3377 */ if (((String)this.i.a(t, j)) /* 3378 */ .equalsIgnoreCase("true")) { /* 3379 */ this.M[t][j] = this.M[t][j] | 0x8; /* */ } /* */ /* 3382 */ if (((String)this.j.a(t, j)) /* 3383 */ .equalsIgnoreCase("true")) { /* 3384 */ this.M[t][j] = this.M[t][j] | 0x20; /* */ } /* */ /* */ /* 3388 */ String lCalcType = (String)this.y.a(t, j); /* 3389 */ if (lCalcType.equals("near_opt")) { /* 3390 */ this.N[t][j] = 2; /* */ } /* 3392 */ else if (lCalcType.equals("lazy_good")) { /* 3393 */ this.N[t][j] = 1; /* */ } /* 3395 */ else if (lCalcType.equals("lazy")) { /* 3396 */ this.N[t][j] = 0; /* */ } else { /* */ /* 3399 */ throw new IllegalArgumentException("Unrecognized or unsupported MQ length calculation."); /* */ } /* */ /* */ /* */ /* */ /* 3405 */ String termType = (String)this.z.a(t, j); /* 3406 */ if (termType.equalsIgnoreCase("easy")) { /* 3407 */ this.O[t][j] = 2; /* */ } /* 3409 */ else if (termType.equalsIgnoreCase("full")) { /* 3410 */ this.O[t][j] = 0; /* */ } /* 3412 */ else if (termType.equalsIgnoreCase("near_opt")) { /* 3413 */ this.O[t][j] = 1; /* */ } /* 3415 */ else if (termType.equalsIgnoreCase("predict")) { /* 3416 */ this.O[t][j] = 3; /* 3417 */ this.M[t][j] = this.M[t][j] | 0x10; /* 3418 */ if ((this.M[t][j] & 0x5) == 0) { /* 3419 */ c.b() /* 3420 */ .printmsg(1, "Using error resilient MQ termination, but terminating only at the end of code-blocks. The error protection offered by this option will be very weak. Specify the 'Creg_term' and/or 'Cbypass' option for increased error resilience."); /* */ /* */ /* */ } /* */ /* */ /* */ } /* */ else { /* */ /* */ /* 3430 */ throw new IllegalArgumentException("Unrecognized or unsupported MQ coder termination."); /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int a(int t, int j, int rl) { /* 3453 */ return this.L.a(t, j, rl); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int b(int t, int j, int rl) { /* 3470 */ return this.L.b(t, j, rl); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean a(int j, int t) { /* 3485 */ return this.bi[j][t]; /* */ } /* */ } /* Location: /mnt/r/ConTenDoViewer.jar!/c/a/c/b/k.class * Java compiler version: 5 (49.0) * JD-Core Version: 1.1.3 */
1f14bfb2319bcd78937f337c52f34d23f93c0b4e
4a62e4257fa5fa5d023a65b2161012f90f201ec1
/javaweb12UpadteBook/src/com/book/FindServlet.java
680ee7342ffee842f4f28317d1b7a6b54e661361
[ "Apache-2.0" ]
permissive
lBetterManl/Java-Web-Study-Demo
5dca20bec7e37007d5b0c26f61007e8b0c216a7f
b873044034f183b3505dc04cb870dbf91a59eaff
refs/heads/master
2020-03-08T15:14:16.148005
2018-04-17T02:22:27
2018-04-17T02:22:27
128,206,312
3
1
null
null
null
null
GB18030
Java
false
false
1,957
java
package com.book; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class FindServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Class.forName("com.mysql.jdbc.Driver");//加载数据库驱动,注册驱动到驱动管理 //数据库连接字符串 String url = "jdbc:mysql://localhost:3306/db_book"; String username = "root"; //数据库用户名 String password = "root";//数据库密码 //创建Connection连接 Connection conn = DriverManager.getConnection(url,username,password); Statement stmt = conn.createStatement(); String sql = "select * from t_book"; ResultSet rs = stmt.executeQuery(sql); List<BookBean> list = new ArrayList<BookBean>(); while(rs.next()){ BookBean book = new BookBean(); book.setBid(rs.getInt("bid")); book.setBname(rs.getString("bname")); book.setAuthor(rs.getString("author")); book.setPrice(rs.getDouble("price")); list.add(book); } request.setAttribute("list", list); rs.close(); stmt.close(); conn.close(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } request.getRequestDispatcher("bookList.jsp").forward(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
dfaf1ca6f0b4b931fa248d1d5755e97bc98ebe1a
8ff419b3c99f20a3e1db687123fb776613844da9
/src/com/liu/ssm/service/impl/EmployeeServiceImpl.java
7f4ac745b1751624671aeb7d02f771e07e03beaa
[]
no_license
Wind0Rises/Hotel
3c7e1547a2aed43750bf663bb58a39735a2d0df5
2ead81b85b7666a2afdfc7c9c28aee625d7dd629
refs/heads/master
2021-01-01T18:58:45.570497
2017-11-24T10:34:02
2017-11-24T10:34:02
98,477,411
0
0
null
null
null
null
UTF-8
Java
false
false
1,470
java
package com.liu.ssm.service.impl; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.liu.ssm.mapper.EmployeeMapper; import com.liu.ssm.pojo.Employee; import com.liu.ssm.service.EmployeeService; @Component("employeeService") public class EmployeeServiceImpl implements EmployeeService{ @Autowired private EmployeeMapper employeeMapper; public void add(Employee object) { employeeMapper.add(object); } public void delete(Object id) { employeeMapper.delete(id); } public void update(Employee object) { employeeMapper.update(object); } public Employee getById(Object id) { return employeeMapper.getById(id); } public List<Employee> getPage(String employeeName, String date, int pageNo, int pageSize) { Map<String, Object> map = new HashMap<String, Object>(); map.put("employeeName", employeeName); map.put("date", date); map.put("pageSize", pageSize); map.put("startNo", (pageNo - 1)* pageSize); return employeeMapper.getPage(map); } @Override public int totalNumber(String employeeName, String date) { Map<String, Object> map = new HashMap<String, Object>(); map.put("employeeName", employeeName); map.put("date", date); return employeeMapper.totalNumber(map); } @Override public List<Map<String, Integer>> distributed() { return employeeMapper.distributed(); } }
8d1b4fe5828c4a9805db54af01bb3ab6d857084e
796d44ee259fa35f5a9a5e96c24cfd2003cc07bf
/src/com/kamilu/kompozytor/propenums/Instrument.java
adb683fb471463dcb0a33a8299126423b4067097
[]
no_license
Posejdon23/kompozytor
be6e3408ef5b1accc3c33527f8adc9cc32c2dc52
4892d957a2fecd864f39df49b05a50a32e21eaf0
refs/heads/master
2016-09-05T09:05:17.847873
2014-10-05T10:14:16
2014-10-05T10:16:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
255
java
package com.kamilu.kompozytor.propenums; public enum Instrument { Trabka, Kornet, Waltornia, Klarnet, Saksofon_sopranowy, Saksofon_altowy, // Saksofon_tenorowy, Saksofon_basowy, Perkusja, Tenor, Sakshorn_tenorowy, // Puzon, Flet, Tuba, Bas, Helikon; }
[ "Kamil@Komputer" ]
Kamil@Komputer
33a84c03e4d4a6602e416c52370fc4a1d9e241ee
85782b862786c5e90565053da06b245ba5be54ec
/src/main/java/com/demo/ssos/config/AuthServerConfig.java
26367048565135d2f73686409a0fb24d27ad3be7
[]
no_license
sfarias051/sso_spring_boot_oauth2_server
e9c0dfdf456ad6107a938cbe2177f9a59ef6e46b
26f1b84dd89d15cb4ed97335cd2768c763ccca5a
refs/heads/master
2020-05-16T05:09:30.915113
2019-04-22T15:15:39
2019-04-22T15:15:39
182,806,986
1
0
null
null
null
null
UTF-8
Java
false
false
1,780
java
package com.demo.ssos.config; import com.demo.ssos.utils.Constants; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer; @Configuration @EnableAuthorizationServer public class AuthServerConfig extends AuthorizationServerConfigurerAdapter { @Autowired private BCryptPasswordEncoder passwordEncoder; @Override public void configure( AuthorizationServerSecurityConfigurer oauthServer) throws Exception { oauthServer.tokenKeyAccess("permitAll()") .checkTokenAccess("isAuthenticated()"); } @Override public void configure(ClientDetailsServiceConfigurer clients) throws Exception { clients.inMemory() .withClient(Constants.AUTHORIZATION_CLIENT_ID) .secret(passwordEncoder.encode(Constants.AUTHORIZATION_SECRET)) .authorizedGrantTypes( Constants.GRANT_AUTHORIZATION_CODE, Constants.GRANT_REFRESH_TOKEN, Constants.GRANT_CLIENT_CREDENTIALS ) .scopes("user_info") .autoApprove(true) .redirectUris( Constants.REDIRECT_CLIENT_1, Constants.REDIRECT_CLIENT_2 ); } }
d5f6fe0b25b96096ea7cb6b2cf9d93eabba8266c
c5a306b409c77fecda770e20f48dc47abc5d8a63
/RabbitMQ-1/src/main/java/com/example/demo/service/RabbitMQSender.java
185ba76362e2320b69c3a7f997631f3b87b28809
[]
no_license
Vaishnavi-k-l/Springboot-Projects
01e34b7287983fef55479535b18a1cdea0217ba3
1f9a2081533169ae2f146afdcf6cf945ccdd4d44
refs/heads/master
2023-04-26T14:43:17.953314
2019-11-21T09:40:49
2019-11-21T09:40:49
223,139,382
0
0
null
2023-04-14T17:55:36
2019-11-21T09:40:42
JavaScript
UTF-8
Java
false
false
723
java
package com.example.demo.service; import org.springframework.amqp.core.AmqpTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.example.demo.model.Employee; @Service public class RabbitMQSender { @Autowired private AmqpTemplate amqpTemplate; @Value("${foo.rabbitmq.exchange}") private String exchange; @Value("${foo.rabbitmq.routingkey}") private String routingkey; //String kafkaTopic = "java_in_use_topic"; public void send(Employee company) { amqpTemplate.convertAndSend(exchange, routingkey, company); System.out.println("Send msg = " + company); } }
596b8dc17c6e71ff8953bf48ea8d164c720cd20f
17f37526dc0f6c5db2937a17a063b5977116ef89
/hotel_reservation/src/test/java/com/hotel/hotel_reservation/HotelReservationApplicationTests.java
a12b1c01be12be272e17ae51a42b2c573998636b
[]
no_license
ahuynh996/HotelReservation
c6fd8fd3d6e6b6edc1204bb62fa7cc68351a1768
e64df7c90b7a1c199a06f027bf7aaf8aac9f320b
refs/heads/master
2021-08-23T13:57:08.688583
2017-12-05T04:48:32
2017-12-05T04:48:32
112,785,309
0
0
null
2017-12-03T23:58:03
2017-12-01T20:47:55
JavaScript
UTF-8
Java
false
false
354
java
package com.hotel.hotel_reservation; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class HotelReservationApplicationTests { @Test public void contextLoads() { } }
10ebf23f52c98d14d9a97ccc9b2f8aebeb788e3b
2ce9d9320181e5ee24d2d121d946b892cc2c04bd
/ExampleChart.java
d9b7df3797a52ae9d3e45658b46536f2a6d67bb7
[]
no_license
EhabIbrahim758/java..WuzzufDataTask
88f9128fd1e63a12c31db0cc10a9ea04321ca0c1
9c319fc336a1d95dfb7a252916dd0d962041b820
refs/heads/main
2023-05-06T16:14:59.181575
2021-05-22T16:19:23
2021-05-22T16:19:23
369,853,674
0
0
null
null
null
null
UTF-8
Java
false
false
166
java
import org.knowm.xchart.internal.chartpart.Chart; public interface ExampleChart<C extends Chart<?, ?>> { C getChart(); String getExampleChartName(); }
85dcfebeba8c6a6fba813b451bc1a541e1d76cd3
be200fa25382b56ee0cb39d1eb6dfc182a6712f8
/10 - Inheritance/src/whatdoesthefoxsay/exercise/RunLyrics.java
4d04aec3645f95c2bd740c2e0ba83cb7315c0f70
[]
no_license
ht450/programming-module-eclipse-workspace
0c810429a13984b84109fbac4c39d9ee18eac2d7
7a3252ea0dd5086520856f8f1364061f6e952373
refs/heads/main
2023-03-20T16:52:29.219676
2021-03-08T11:59:42
2021-03-08T11:59:42
345,641,062
1
0
null
null
null
null
UTF-8
Java
false
false
1,265
java
/** * */ package whatdoesthefoxsay.exercise; /** * @author Hugh * */ public class RunLyrics { /** * @param args */ public static void main(String[] args) { Animal dog = new Animal("Dog", "Woof"); Animal cat = new Animal("Cat","Meow"); Animal bird = new Animal("Bird", "Tweet"); Animal mouse = new Animal("Mouse","Squeak"); Animal fox = new Animal("Fox", "???", "BLUE", "POINTY", "TINY", "RED"); // song lyrics dog.makeNoise(); cat.makeNoise(); bird.makeNoise(); mouse.makeNoise(); System.out.println("But there's one sound that no one knows..."); ringDingBit(); System.out.println("Big "+fox.getEyeColor()+" eyes"); System.out.println(fox.getNoseType()+" nose"); System.out.println(fox.getPawSize()+" paws"); System.out.println("your fur is "+fox.getFurColour()); ringDingBit(); } /** * method that prints the repetitive ring-ding part of the song that starts with "What does the fox say?" */ private static void ringDingBit() { System.out.println("WHAT DOES THE FOX SAY?"); System.out.println("Ring-ding-ding-ding-dingeringeding!"); System.out.println("Ring-ding-ding-ding-dingeringeding!"); System.out.println("Ring-ding-ding-ding-dingeringeding!"); System.out.println(); } }//class
072534c5b9c3777638145d0e7fa80d59de86f005
e7f2bba9c9dbde8ba3af105dd482165da46cab00
/src/day2/Task1.java
4ef9c0ecea53d66e7b329d287fa0ded6a10391ed
[]
no_license
Sadamchik/JavaMarathon2020
5af25bfca9c48012ca8b2e0c2c7d71b5ae8f9214
15d06536ac0c3b89f3bcd0376a63042954acbbbd
refs/heads/master
2022-12-07T18:42:25.996069
2020-09-05T16:46:05
2020-09-05T16:46:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
597
java
package day2; import java.util.Scanner; public class Task1 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); if (a >= 1 && a <= 4) { System.out.println("Малоэтажный дом"); } else if (a >= 5 && a <= 8) { System.out.println("Среднеэтажный дом"); } else if (a >= 9) { System.out.println("Многоэтажный дом"); } else { System.out.println("Ввод не корректен"); } } }
2b52be2d5e7c9581a5d23392247cfa4907f23277
12a7ca3203a8b479bfe5a3b598463d2d63ee0fe9
/scanner/Scanner.java
b8f7d6fa89224783811629e1e13831f09a8003f0
[]
no_license
muneebGH/Force
377af15182c965de35a6cf247484a3d40787e9b8
deb8aaa6cd52a10fdc2c7e48ddab44294ed6a64e
refs/heads/main
2023-02-04T04:16:41.035992
2020-12-27T07:08:29
2020-12-27T07:08:29
324,690,100
0
0
null
null
null
null
UTF-8
Java
false
false
7,352
java
package scanner; import Driver.Force; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import static scanner.TokenType.*; public class Scanner { private final String sourceCode; //source code of program private int line=1; //to check which line we are on private int start=0; //to mark the start of lexeme (for substring purpose) private int current=0; // will point to character being scanned in the whole code private List<Token> tokens=new ArrayList<>(); //store fot all the tokens in source code private static final Map<String, TokenType> keywords; //for reserved keywords static { keywords = new HashMap<>(); keywords.put("and", AND); keywords.put("class", CLASS); keywords.put("else", ELSE); keywords.put("false", FALSE); keywords.put("for", FOR); keywords.put("fun", FUN); keywords.put("if", IF); keywords.put("nil", NIL); keywords.put("or", OR); keywords.put("print", PRINT); keywords.put("return", RETURN); keywords.put("super", SUPER); keywords.put("this", THIS); keywords.put("true", TRUE); keywords.put("var", VAR); keywords.put("while", WHILE); } public Scanner(String sourceCode) { this.sourceCode = sourceCode; } public List<Token> scanTokens(){ //check if program any source code is yet to be scanned while(!isAtEnd()){ //mark the start of lexeme equal to current character index being pointed start=current; //scan token starting from start and add it in list scanToken(); } //add eof token at the end of list of tokens. tokens.add(new Token(EOF,line,"",null)); return tokens; } private boolean isAtEnd(){ //return false if the current value have reached higher or equal to total length of source code. return current>=sourceCode.length(); } private void scanToken(){ //get the next character (start of this lexeme) char c=advance(); switch (c){ //one char lexemes case '(':addToken(LEFT_PAREN);break; case ')':addToken(RIGHT_PAREN);break; case '{': addToken(LEFT_BRACE);break; case '}': addToken(RIGHT_BRACE);break; case ',':addToken(COMMA);break; case '.':addToken(DOT);break; case '-':addToken(MINUS);break; case '+':addToken(PLUS);break; case ';':addToken(SEMICOLON);break; case '*':addToken(STAR);break; //two character maybe lexemes case '!':addToken(match('=')?BANG_EQUAL:BANG);break; case '=':addToken(match('=')?EQUAL_EQUAL:EQUAL);break; case '>':addToken(match('=')?GREATER_EQUAL:GREATER);break; case '<':addToken(match('=')?LESS_EQUAL:LESS);break; //comment or slash lexeme case '/':{ if(match('/')){ //its a comment so keep moving until its the end of program or a new line while(peek()!='\n' && !isAtEnd()){ advance(); } }else{ //it is just a slash operator addToken(SLASH); } break; } //whitespaces : ignore these case ' ': case '\t': case '\r': break; //new line: increment line counter case '\n': line++; break; //string lexeme case '"':string();break; default: if(isDigit(c)){ //digit lexeme number(); }else if(isAlpha(c)){ //it is an identifier or a keywork : choose by maximal munch identifier(); }else{ //koi pta nai Force.error(line,"Unexpected character dude");break; } } } private void identifier(){ //go ahead until it is an alphanumeric while (isAlphaNumeric(peek())) advance(); //extract the lexeme String text=sourceCode.substring(start,current); //check if it is a keyword TokenType type=keywords.get(text); if(type==null)type=IDENTIFIER; addToken(type); } private void string(){ //move until other " comes or program ends while(peek()!='"' && !isAtEnd()){ if(peek()=='\n'){ line++; } advance(); } //if loop ends before program ends that means string havent terminated yet if(isAtEnd()){ Force.error(line,"Unterminated string"); } advance(); //add token string by removing " and " from it. addToken(STRING,sourceCode.substring(start+1,current-1)); } private void number(){ //go ahead until we get digits while(isDigit(peek()))advance(); //if the current digit is . and next is some number if(peek()=='.' && isDigit(peekNext())){ advance(); //skip . //go ahead until this ends while(isDigit(peek()))advance(); } //add this as a double object addToken(NUMBER,Double.parseDouble(sourceCode.substring(start,current))); } private char advance(){ //return the next character from current character and inc current current++; return sourceCode.charAt(current-1); } private void addToken(TokenType type){ //add token with literal null if there is not literal addToken(type,null); } private void addToken(TokenType type,Object literal){ //add token in the list of tokens //take substring (lexeme from start of lexeme to current char) String lexeme=sourceCode.substring(start,current); //add it in list tokens.add(new Token(type,line,lexeme,literal)); } private boolean match(char expected){ //conditional advance //if the expected char is current pointed char then inc current and return true otherwise false if(isAtEnd())return false; //get the pointed char char next=sourceCode.charAt(current); //if it is expected return true with inc current if(next==expected){ current++; return true; } //return false if char didnt match return false; } private char peek(){ //one char lookahead if(isAtEnd())return '\0'; return sourceCode.charAt(current); } private boolean isDigit(char c){ return c>='0' && c<='9'; } private char peekNext(){ //two chars lookahead if(current+1>=sourceCode.length()){ return '\0'; } return sourceCode.charAt(current+1); } private boolean isAlpha(char c){ //check whether the char is a alpha char return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c=='_'); } private boolean isAlphaNumeric(char c){ return isAlpha(c)|| isDigit(c); } }
ef81aa2ff552069bb6f463914f242332c3d4fe73
af9707a25ebcc9598d865aa0e91bc195a50d5c3b
/src/main/java/com/ykjzone/mapper/GroupMapper.java
83ba967ec7d5c91a632902a639201f33b63d8a60
[]
no_license
ShiXianchen-1998/xiaoshuo_SSM
c537f780464fb4eef296b575538764353c923c22
3d4f58bf477455139fdc56a791f1114f39f6ddb4
refs/heads/master
2022-11-18T04:05:14.483696
2020-06-29T04:22:30
2020-06-29T04:22:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
460
java
package com.ykjzone.mapper; import com.ykjzone.pojo.Group; import com.ykjzone.pojo.GroupExample; import java.util.List; public interface GroupMapper { int deleteByPrimaryKey(Integer id); int insert(Group record); int insertSelective(Group record); List<Group> selectByExample(GroupExample example); Group selectByPrimaryKey(Integer id); int updateByPrimaryKeySelective(Group record); int updateByPrimaryKey(Group record); }
4b8da16b35fda35fea38d2a00922a49a86d1b45e
8863f7904fa6807f8a98cb095ecb30699de86c03
/test0716/backend/src/main/java/com/example/backend/BackendApplication.java
54740699492ad7edd42d0e05f9affa0b81ab2139
[]
no_license
MinhoChoi-a/ReactTest
15238e58f48c640777b1e966bc2933f2741b8b6f
b034aa6a3d1fc2585f6c9280c6cf9820f5d3ba9c
refs/heads/master
2023-06-19T00:38:05.254887
2021-07-17T00:36:45
2021-07-17T00:36:45
385,044,539
0
0
null
null
null
null
UTF-8
Java
false
false
811
java
package com.example.backend; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @SpringBootApplication public class BackendApplication { public static void main(String[] args) { SpringApplication.run(BackendApplication.class, args); } //release CORS setting @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**"); } }; } }
2640aeabbd7aca6034ea77b7fecdaa5d88f5cad1
8c98559757a54bd1243216192d84e48c53318265
/mybatis-spring/src/main/java/entity/Emp2.java
622f261800ef0991e657c69ca61262ae1fbea106
[]
no_license
koronto11/java-spring
9666aaf8f86080da4059835e82722d18280eea61
52ea3baca16d92619da24a975d35caa7d2ba9d3f
refs/heads/master
2021-05-11T01:20:32.107390
2018-01-21T10:38:47
2018-01-21T10:38:47
118,326,634
0
0
null
null
null
null
UTF-8
Java
false
false
550
java
package entity; public class Emp2 { private Integer empNo; private String ename; private Integer age; public Integer getEmpNo() { return empNo; } public void setEmpNo(Integer empNo) { this.empNo = empNo; } public String getEname() { return ename; } public void setEname(String ename) { this.ename = ename; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } @Override public String toString() { return "Emp2 [empNo=" + empNo + ", ename=" + ename + ", age=" + age + "]"; } }
691344d7fbc335250ab31df8dc5a2a76195388b9
2d9957f2c7a6883004b1a801f97eab3b033d9c08
/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PublishRateLimiterDisableTest.java
8dfed77814b35f1d8b5fcaa0ba8c889fe6492e1e
[ "Apache-2.0", "LicenseRef-scancode-unknown", "LicenseRef-scancode-protobuf" ]
permissive
apache/pulsar
ca729cfb8d2c031312d30096e13431b2e29fb9bf
843b8307f44cd5e3a2d59ab93cc6b766f0c4ce0f
refs/heads/master
2023-08-31T23:53:41.323458
2023-08-31T18:37:00
2023-08-31T18:37:00
62,117,812
11,865
3,546
Apache-2.0
2023-09-14T12:13:23
2016-06-28T07:00:03
Java
UTF-8
Java
false
false
1,246
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.pulsar.broker.service; import static org.testng.Assert.assertTrue; import org.testng.annotations.Test; public class PublishRateLimiterDisableTest { // GH issue #10603 @Test void shouldAlwaysAllowAcquire() { PublishRateLimiterDisable publishRateLimiter = PublishRateLimiterDisable.DISABLED_RATE_LIMITER; assertTrue(publishRateLimiter.tryAcquire(Integer.MAX_VALUE, Long.MAX_VALUE)); } }
b65194729fc9d7ce2e2095e55e2e7853b8491021
da4cdb2a7be7ba4a0b44e2251fde90803b7b1868
/queries/src/main/java/pe/facturacion/fel/queries/entities/Coded.java
d24a7ba93159312994ade2dfa79831f7410f1971
[]
no_license
egcarlos/fel
a838da589e52115c0a31f65afe984bc08ae856d1
2e92c49da98df959651dd141692a2553733381bf
refs/heads/master
2020-04-12T17:00:37.711201
2016-02-02T16:15:54
2016-02-02T16:15:54
50,934,388
0
0
null
null
null
null
UTF-8
Java
false
false
247
java
/* * Producto elaborado para Alignet S.A.C. * */ package pe.facturacion.fel.queries.entities; /** * Clase Coded. * * @author Labtech S.R.L. ([email protected]) */ public interface Coded { String getCode(); void setCode(String code); }
8ceaf1d0464da2c0b93e50312605873dfeaffad2
1bdf8fba41e645ce25487af299572f31a5941f91
/src/main/java/br/gov/servicos/cms/Genero.java
2e8f19df93b7915fddc78d5f561dbcc9c3f9bb70
[ "MIT" ]
permissive
mauriciomelo/guia-de-servicos
a18d086194fcb4aa672ad7f81210d1a74065d99d
bb931c89dd74ef6abe424b73aa020b6a64769f99
refs/heads/master
2021-01-15T23:35:59.727683
2015-03-21T21:31:47
2015-03-21T21:31:47
32,694,172
0
1
null
2015-07-31T02:36:58
2015-03-22T20:34:55
Ruby
UTF-8
Java
false
false
641
java
package br.gov.servicos.cms; import org.springframework.stereotype.Component; import java.util.Arrays; import java.util.List; @Component public class Genero { private static final List<String> FEMININOS = Arrays.asList( "comissao", "defensoria", "empresa", "fundacao", "receita", "receital", "secretaria" ); public String de(String id) { return FEMININOS.stream().anyMatch(id::startsWith) ? "da" : "do"; } public String per(String id) { return FEMININOS.stream().anyMatch(id::startsWith) ? "pela" : "pelo"; } }
b45bfe81950da49c823c1fb8ba6484dbb941ba74
9c7e8d56e870538789f7ec7af58d03111e44db0a
/src/HeNan/JiYuan.java
8aea250d9aaf3420722a8fdd151de7b481e312a8
[]
no_license
wujialiang1/java
b45f0b4585679c16b27d7ced78e57a38d3f52288
b0dff4ae0e83252c670b48e30832057f7b1f3986
refs/heads/master
2021-09-19T06:24:19.050721
2018-07-24T08:31:51
2018-07-24T08:31:51
null
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
3,495
java
package HeNan; import java.io.IOException; import java.net.URL; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.Map.Entry; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import com.lowagie.tools.concat_pdf; public class JiYuan { public static void main(String[] args) { // TODO Auto-generated method stub HashMap<String, Integer>L = new HashMap<String, Integer>(); // http://wjw.jiyuan.gov.cn/gzdt/index.html // http://wjw.jiyuan.gov.cn/gzdt/index_1.html L.put("http://wjw.jiyuan.gov.cn/gzdt/index", 24); L.put("http://wjw.jiyuan.gov.cn/tzgg/index", 9); L.put("http://wjw.jiyuan.gov.cn/zhgl/index", 6); L.put("http://wjw.jiyuan.gov.cn/szyy/index", 8); L.put("http://wjw.jiyuan.gov.cn/szyy/index", 8); for(Entry<String, Integer> entry : L.entrySet()){ int cnt=0; while(cnt<=entry.getValue()){ String url=entry.getKey(); if(cnt==0){ url+=".html"; }else{ url+="_"+cnt+".html"; } System.out.println("page = "+url); cnt++; Document doc1=null; for (int j = 0; j < 10; j++) { try { doc1=Jsoup .connect(url) .header("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0") .get();//.parse(new URL(url).openStream(), "GBK", url);//Jsoup.connect(url).timeout(500000).get(); /*try { Thread.sleep(5000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); }*/ } catch (IOException e) { // TODO Auto-generated catch block System.out.println(e.getMessage());//e.getMessage();//.printStackTrace(); break; } if(doc1!=null)break; } Elements Lists=null; try { Lists=doc1.select("ul.list-text li"); } catch (Exception e) { System.out.println(e.getMessage());continue; // TODO: handle exception } if(Lists==null)continue; for (Element list : Lists) { if(!list.hasText())continue; String titleurl=list.select("a").attr("abs:href"); System.out.println("titleurl = "+ titleurl); String date=list.select("span").text(); System.out.println("date = "+date); if(!titleurl.endsWith(".html"))continue; Document doc2=null; for (int j = 0; j < 10; j++) { try { doc2=Jsoup.connect(titleurl).get(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(doc2!=null)break; } System.out.println("doc2 = "+doc2); if(doc2==null)continue; String title=doc2.select("div.panel-body h3").text(); System.out.println("title = "+ title); String txt=doc2.select("div.panel-body").text(); String doc=doc2.select("div.panel-body").html(); System.out.println("txt = "+txt); //System.out.println("html = "+doc); /*String source=doc2.select(".text").first().text(); System.out.println("source = "+source); source=source.substring(source.indexOf("£º")+1, source.indexOf("·¢"));*/ Object parms[]={title,titleurl,date,txt,doc}; try { SqlHelper.insertInfo(parms); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } } }
50473038e51ee91b94b71397b6b13451046aa6ac
8cd01526f0e84cf36bc27515876eda9bcc52f49a
/code/vim_android/office/src/main/java/com/wxiwei/office/macro/MacroCustomDialog.java
c1fbc7d81362f951b4c4965889a399792268b429
[]
no_license
liyawei7711/shenlun
a0baa859cec59b9d46825c8b1797173bd56d4d3f
602b103d90df98c100ce55efee132596b0100445
refs/heads/master
2021-01-09T12:52:18.359146
2020-06-29T08:21:20
2020-06-29T08:21:20
242,304,879
1
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
/* * 文件名称: MarcoCustomDialog.java * * 编译器: android2.2 * 时间: 下午12:49:58 */ package com.wxiwei.office.macro; import com.wxiwei.office.common.ICustomDialog; /** * TODO: 文件注释 * <p> * <p> * Read版本: Read V1.0 * <p> * 作者: ljj8494 * <p> * 日期: 2012-12-21 * <p> * 负责人: ljj8494 * <p> * 负责小组: * <p> * <p> */ public class MacroCustomDialog implements ICustomDialog { /** * * */ protected MacroCustomDialog(DialogListener listener) { this.dailogListener = listener; } /** * * */ public void showDialog(byte type) { if (dailogListener != null) { dailogListener.showDialog(type); } } /** * * */ public void dismissDialog(byte type) { if (dailogListener != null) { dailogListener.dismissDialog(type); } } public void dispose() { dailogListener = null; } // private DialogListener dailogListener; }
ed83e956d0231bc82da89c44080bc3bbf0d7ecee
7fb051fd3cfc3f00a74b664ae506a77b86726c10
/PracticalTest02/app/src/main/java/practicaltest02/eim/systems/cs/pub/ro/practicaltest02/ClientThread.java
67c1a57bcc200d85181e5baa1110fbe24581c380
[ "Apache-2.0" ]
permissive
AreAllUsernamesTaken/PracticalTest02
ba6ac7ff543bb1864d0873b316aec53f524178b0
8b30955fa2af7e1d050a8da40abf2abc280a1e84
refs/heads/master
2020-12-30T13:39:17.748184
2017-05-18T12:51:02
2017-05-18T12:51:02
91,237,477
0
0
null
null
null
null
UTF-8
Java
false
false
2,703
java
package practicaltest02.eim.systems.cs.pub.ro.practicaltest02; import android.util.Log; import android.widget.TextView; import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; import java.net.Socket; class ClientThread extends Thread{ private String address; private int port; private String city; private String informationType; private TextView weatherForecastTextView; private Socket socket; public ClientThread(String address, int port, String city, String informationType, TextView weatherForecastTextView) { this.address = address; this.port = port; this.city = city; this.informationType = informationType; this.weatherForecastTextView = weatherForecastTextView; } @Override public void run() { try { socket = new Socket(address, port); if (socket == null) { Log.e(Constants.TAG, "[CLIENT THREAD] Could not create socket!"); return; } BufferedReader bufferedReader = Utilities.getReader(socket); PrintWriter printWriter = Utilities.getWriter(socket); if (bufferedReader == null || printWriter == null) { Log.e(Constants.TAG, "[CLIENT THREAD] Buffered Reader / Print Writer are null!"); return; } printWriter.println(city); printWriter.flush(); printWriter.println(informationType); printWriter.flush(); String weatherInformation; while ((weatherInformation = bufferedReader.readLine()) != null) { final String finalizedWeateherInformation = weatherInformation; weatherForecastTextView.post(new Runnable() { @Override public void run() { weatherForecastTextView.setText(finalizedWeateherInformation); } }); } } catch (IOException ioException) { Log.e(Constants.TAG, "[CLIENT THREAD] An exception has occurred: " + ioException.getMessage()); if (Constants.DEBUG) { ioException.printStackTrace(); } } finally { if (socket != null) { try { socket.close(); } catch (IOException ioException) { Log.e(Constants.TAG, "[CLIENT THREAD] An exception has occurred: " + ioException.getMessage()); if (Constants.DEBUG) { ioException.printStackTrace(); } } } } } }
3482deffa50f215f83fed68ff06d4ea8e6fd8c78
df3d0bec469808454f88861674f3909b042ef87c
/src/test/java/com/weborders/step_definitions/LoginStepDefinitions.java
7bbde8b664ac21d693aaafbe70c62910c973e77f
[]
no_license
IssB20/WebOrdersAutomationSummer2020
ac06ae90769f491bcb493bf21dc595323039f475
59f522670e158bf7370b06ffc73095f482a1dea6
refs/heads/main
2023-01-05T04:40:42.400828
2020-10-25T02:43:40
2020-10-25T02:43:40
306,918,929
0
0
null
null
null
null
UTF-8
Java
false
false
952
java
package com.weborders.step_definitions; import com.weborders.pages.HomePage; import com.weborders.pages.LoginPage; import com.weborders.utilities.ConfigurationReader; import com.weborders.utilities.Driver; import io.cucumber.java.en.Given; import io.cucumber.java.en.Then; import io.cucumber.java.en.When; import org.junit.Assert; public class LoginStepDefinitions { LoginPage loginPage = new LoginPage(); HomePage homePage = new HomePage(); @Given("user in on the landing page") public void user_in_on_the_landing_page() { Driver.getDriver().get(ConfigurationReader.getProperties("url")); } @When("user logs in") public void user_logs_in() { loginPage.login(); } @Then("user should see see {string} page title") public void user_should_see_see_page_title(String string) { String actualTitle = homePage.getHomePageText(); Assert.assertEquals(string, actualTitle); } }
0da08013419e3509534a39dd9c297cc66e50a815
1e6b3d81890c5bb65539edc37b45822d5b6cabc9
/src/main/java/history/back/Security/JWT/JwtConfigurer.java
d73d6e2e1f193ff20e2f2ba2591176b05df6c7eb
[]
no_license
medhedho/history_backend
0b4a4a7349180e3b83fe3f1f94562f0989fc4d38
dcabccc0a04f2b54b32d65b867191131f1ab160d
refs/heads/master
2022-01-28T08:47:34.853353
2020-01-15T10:58:34
2020-01-15T10:58:34
181,164,839
0
0
null
2022-01-21T23:35:21
2019-04-13T12:03:13
Java
UTF-8
Java
false
false
883
java
package history.back.Security.JWT; import org.springframework.security.config.annotation.SecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; public class JwtConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> { private JwtTokenProvider jwtTokenProvider; public JwtConfigurer(JwtTokenProvider jwtTokenProvider) { this.jwtTokenProvider = jwtTokenProvider; } @Override public void configure(HttpSecurity http) throws Exception { JwtTokenFilter customFilter = new JwtTokenFilter(jwtTokenProvider); http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class); } }
bfbd038c20049715492bcacd94a9cf3d26834074
a6f522669a187a597b42246eaddfb0a07d577adf
/Project/src/controller/RegistrationServlet.java
5a916a9842168fc66633cb7cf0819f37b033e319
[]
no_license
TonosakiRikiya/WebProgramming
189e8ef95e1fbde08202077f96b748995420d6f3
8165dc0db89a941264f56941cc03d654664abe58
refs/heads/master
2020-03-27T01:10:19.955421
2018-08-23T01:19:32
2018-08-23T01:19:32
145,688,480
0
0
null
null
null
null
UTF-8
Java
false
false
3,423
java
package controller; import java.io.IOException; import java.sql.Date; import java.text.ParseException; import java.text.SimpleDateFormat; import javax.servlet.RequestDispatcher; 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 dao.UserDao; import model.User; /** * Servlet implementation class RegistrationServlet */ @WebServlet("/RegistrationServlet") public class RegistrationServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public RegistrationServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub if(request.getSession().getAttribute("userInfo") == null) { response.sendRedirect("LoginServlet"); return; } RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/jsp/registration.jsp"); dispatcher.forward(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub request.setCharacterEncoding("UTF-8"); String login_id = request.getParameter("login_id"); String password = request.getParameter("password"); String password2 = request.getParameter("password2"); String name = request.getParameter("name"); String birth_date_str = request.getParameter("birth_date"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date birth_date = null; try { birth_date = new Date(format.parse(birth_date_str).getTime()); } catch (ParseException e) { e.printStackTrace(); } SimpleDateFormat formatDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String now = formatDate.format(new java.util.Date()); UserDao userDao = new UserDao(); if(login_id.isEmpty() || password.isEmpty() ||name.isEmpty() ||birth_date_str.isEmpty()) { request.setAttribute("errmsg", "入力された値は正しくありません"); RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/jsp/registration.jsp"); dispatcher.forward(request, response); return; } if(!(password.equals(password2))) { request.setAttribute("errmsg", "入力された値は正しくありません"); RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/jsp/registration.jsp"); dispatcher.forward(request, response); return; } User user=userDao.findByLogin_idInfo(login_id); String login_Id = request.getParameter("login_id"); if(login_id !=login_Id) { request.setAttribute("errmsg", "入力された値は正しくありません"); RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/jsp/registration.jsp"); dispatcher.forward(request, response); return; } userDao.findByRegistrationInfo(login_id, password, name, birth_date, now, now); response.sendRedirect("UserListServlet"); } }
ee54db1da6fc5bc5dd1eac9278a152381529044f
06cbee736f5610df466fdf30de297006b7d0127a
/tms-qms/src/main/java/edu/baylor/ecs/qms/repository/CategoryRepository.java
2b128724b8c561c2195555a9b9bbe58da425da4b
[]
no_license
cloudhubs/tms-testbed
e1773a4946f322244dc103718ed4d4a907fa375f
3cdcefe63f6887180d62c38888402bd82725e7bc
refs/heads/master
2022-12-15T19:05:11.157814
2020-09-11T01:30:17
2020-09-11T01:30:17
294,550,690
0
1
null
2020-09-11T01:30:18
2020-09-11T00:09:42
Java
UTF-8
Java
false
false
638
java
package edu.baylor.ecs.qms.repository; import edu.baylor.ecs.qms.model.Category; import edu.baylor.ecs.qms.model.dto.QuestionCountDto; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface CategoryRepository extends JpaRepository<Category, Long> { @Query(name = Category.FIND_NAMES_BY_QUESTION_ID) List<String> getNamesByQuestionId(Long id); @Query(name = Category.FIND_QUESTION_COUNT_DTO_BY_ID) List<QuestionCountDto> getQuestionCountDtoById(Long id); }
910b1c319f9241d01ab1dbf40e8c0b418f1464a7
ed7e8aab63bec7e674d8e360ca831b76ee41f1a2
/src/main/java/com/marcsystem/spike/persistence/HolidaysHybrid.java
c7f0d0ba275704b514606839139a8e28fe35fa20
[]
no_license
marmartins/spikes
6a68306e455cafc561db09dcd68a2e83ea331686
d0d3852d70537e82a775b050c07b71b19f0d23c5
refs/heads/main
2023-03-14T02:37:57.874461
2021-03-08T14:20:22
2021-03-08T14:20:22
345,646,501
1
0
null
null
null
null
UTF-8
Java
false
false
1,257
java
package com.marcsystem.spike.persistence; import com.vladmihalcea.hibernate.type.array.IntArrayType; import com.vladmihalcea.hibernate.type.array.StringArrayType; import com.vladmihalcea.hibernate.type.json.JsonBinaryType; import com.vladmihalcea.hibernate.type.json.JsonStringType; import lombok.Data; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; import javax.persistence.*; import java.io.Serializable; import java.time.LocalDate; @Data @Entity(name = "holidays_hybrid") @TypeDefs({ @TypeDef(name = "string-array", typeClass = StringArrayType.class), @TypeDef(name = "int-array", typeClass = IntArrayType.class), @TypeDef(name = "json", typeClass = JsonStringType.class), @TypeDef(name = "jsonb", typeClass = JsonBinaryType.class) }) public class HolidaysHybrid implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String country; private String province; private int year; @Type(type = "jsonb") @Column(columnDefinition = "jsonb") private String json; }
f693ce543489a209e940d23313ceb78ae5832bac
3850a13a808fe1fe918a0a6d2f396f15ab750de6
/cms_jd1911/src/main/java/com/example/demo/bean/extend/UserVM.java
6001f654b07e9f21a37f1972934292e369c2e1ec
[]
no_license
moth-orchid/moth
ffe2dc2e0e0a3d8e2e574ff5c918b804f77b8c53
bcb4dd6ad1d2241328d999dd86f7389e640d2ba7
refs/heads/master
2022-06-22T16:02:11.779740
2019-11-19T01:59:09
2019-11-19T01:59:09
221,856,791
2
0
null
2022-06-21T02:15:44
2019-11-15T06:14:25
Java
UTF-8
Java
false
false
375
java
package com.example.demo.bean.extend; public class UserVM { private String username; private String password; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
13101a203377de01b0b9c0cb78c61692220e6bd5
1c63e06951421b5869720fb2f7763317d8272c04
/androidzxing/src/main/java/com/google/zxing/client/android/camera/CameraManager.java
49ae17cb5b5e247972e2a642b7084bcaf2e00a6c
[]
no_license
hub-zjy1024/CustomDialog2
0fd124f8384c56dbe6e5096eda66caa1a06981d4
f6aaadcb1ff7ecc9a39fc8d44adb0d238a8112ee
refs/heads/master
2020-07-21T06:03:22.965664
2020-01-18T12:47:34
2020-01-18T12:47:34
206,766,477
0
0
null
null
null
null
UTF-8
Java
false
false
12,559
java
/* * Copyright (C) 2008 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.zxing.client.android.camera; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.hardware.Camera; import android.os.Handler; import android.util.Log; import android.view.SurfaceHolder; import com.google.zxing.PlanarYUVLuminanceSource; import com.google.zxing.client.android.camera.open.OpenCamera; import com.google.zxing.client.android.camera.open.OpenCameraInterface; import java.io.IOException; /** * This object wraps the Camera service object and expects to be the only one talking to it. The * implementation encapsulates the steps needed to take preview-sized images, which are used for * both preview and decoding. * * @author [email protected] (Daniel Switkin) */ @SuppressWarnings("deprecation") // camera APIs public final class CameraManager { private static final String TAG = CameraManager.class.getSimpleName(); private static final int MIN_FRAME_WIDTH = 240; private static final int MIN_FRAME_HEIGHT = 240; private static final int MAX_FRAME_WIDTH = 1200; // = 5/8 * 1920 private static final int MAX_FRAME_HEIGHT = 675; // = 5/8 * 1080 private final Context context; private final CameraConfigurationManager configManager; private OpenCamera camera; private AutoFocusManager autoFocusManager; private Rect framingRect; private Rect framingRectInPreview; private boolean initialized; private boolean previewing; private int requestedCameraId = OpenCameraInterface.NO_REQUESTED_CAMERA; private int requestedFramingRectWidth; private int requestedFramingRectHeight; /** * Preview frames are delivered here, which we pass on to the registered handler. Make sure to * clear the handler so it will only receive one message. */ private final PreviewCallback previewCallback; public CameraManager(Context context) { this.context = context; this.configManager = new CameraConfigurationManager(context); previewCallback = new PreviewCallback(configManager); } /** * Opens the camera driver and initializes the hardware parameters. * * @param holder The surface object which the camera will draw preview frames into. * @throws IOException Indicates the camera driver failed to open. */ public synchronized void openDriver(SurfaceHolder holder) throws IOException { OpenCamera theCamera = camera; if (theCamera == null) { theCamera = OpenCameraInterface.open(requestedCameraId); if (theCamera == null) { throw new IOException("Camera.open() failed to return object from driver"); } camera = theCamera; } if (!initialized) { initialized = true; configManager.initFromCameraParameters(theCamera); if (requestedFramingRectWidth > 0 && requestedFramingRectHeight > 0) { setManualFramingRect(requestedFramingRectWidth, requestedFramingRectHeight); requestedFramingRectWidth = 0; requestedFramingRectHeight = 0; } } Camera cameraObject = theCamera.getCamera(); Camera.Parameters parameters = cameraObject.getParameters(); String parametersFlattened = parameters == null ? null : parameters.flatten(); // Save these, temporarily try { configManager.setDesiredCameraParameters(theCamera, false); } catch (RuntimeException re) { // Driver failed Log.w(TAG, "Camera rejected parameters. Setting only minimal safe-mode parameters"); Log.i(TAG, "Resetting to saved camera params: " + parametersFlattened); // Reset: if (parametersFlattened != null) { parameters = cameraObject.getParameters(); parameters.unflatten(parametersFlattened); try { cameraObject.setParameters(parameters); configManager.setDesiredCameraParameters(theCamera, true); } catch (RuntimeException re2) { // Well, darn. Give up Log.w(TAG, "Camera rejected even safe-mode parameters! No configuration"); } } } cameraObject.setPreviewDisplay(holder); } public synchronized boolean isOpen() { return camera != null; } /** * Closes the camera driver if still in use. */ public synchronized void closeDriver() { if (camera != null) { camera.getCamera().release(); camera = null; // Make sure to clear these each time we close the camera, so that any scanning rect // requested by intent is forgotten. framingRect = null; framingRectInPreview = null; } } /** * Asks the camera hardware to begin drawing preview frames to the screen. */ public synchronized void startPreview() { OpenCamera theCamera = camera; if (theCamera != null && !previewing) { theCamera.getCamera().startPreview(); previewing = true; autoFocusManager = new AutoFocusManager(context, theCamera.getCamera()); } } /** * Tells the camera to stop drawing preview frames. */ public synchronized void stopPreview() { if (autoFocusManager != null) { autoFocusManager.stop(); autoFocusManager = null; } if (camera != null && previewing) { camera.getCamera().stopPreview(); previewCallback.setHandler(null, 0); previewing = false; } } /** * Convenience method for {@link com.google.zxing.client.android.CaptureActivity} * * @param newSetting if {@code true}, light should be turned on if currently off. And vice versa. */ public synchronized void setTorch(boolean newSetting) { OpenCamera theCamera = camera; if (theCamera != null && newSetting != configManager.getTorchState(theCamera.getCamera())) { boolean wasAutoFocusManager = autoFocusManager != null; if (wasAutoFocusManager) { autoFocusManager.stop(); autoFocusManager = null; } configManager.setTorch(theCamera.getCamera(), newSetting); if (wasAutoFocusManager) { autoFocusManager = new AutoFocusManager(context, theCamera.getCamera()); autoFocusManager.start(); } } } /** * A single preview frame will be returned to the handler supplied. The data will arrive as byte[] * in the message.obj field, with width and height encoded as message.arg1 and message.arg2, * respectively. * * @param handler The handler to send the message to. * @param message The what field of the message to be sent. */ public synchronized void requestPreviewFrame(Handler handler, int message) { OpenCamera theCamera = camera; if (theCamera != null && previewing) { previewCallback.setHandler(handler, message); theCamera.getCamera().setOneShotPreviewCallback(previewCallback); } } /** * Calculates the framing rect which the UI should draw to show the user where to place the * barcode. This target helps with alignment as well as forces the user to hold the device * far enough away to ensure the image will be in focus. * * @return The rectangle to draw on screen in window coordinates. */ public synchronized Rect getFramingRect() { if (framingRect == null) { if (camera == null) { return null; } Point screenResolution = configManager.getScreenResolution(); if (screenResolution == null) { // Called early, before init even finished return null; } int width = findDesiredDimensionInRange(screenResolution.x, MIN_FRAME_WIDTH, MAX_FRAME_WIDTH); int height = findDesiredDimensionInRange(screenResolution.y, MIN_FRAME_HEIGHT, MAX_FRAME_HEIGHT); Log.e("zjy", "CameraManager->getFramingRect(): x-y==" + screenResolution.x+"\t"+ screenResolution.y); Log.e("zjy", "CameraManager->getFramingRect(): width==" + width + "\t" + height); int leftOffset = (screenResolution.x - width) / 2; int topOffset = (screenResolution.y - height) / 2; framingRect = new Rect(leftOffset, topOffset, leftOffset + width, topOffset + height); Log.d(TAG, "Calculated framing rect: " + framingRect); } return framingRect; } private static int findDesiredDimensionInRange(int resolution, int hardMin, int hardMax) { int dim = 5 * resolution / 8; // Target 5/8 of each dimension if (dim < hardMin) { return hardMin; } if (dim > hardMax) { return hardMax; } return dim; } /** * Like {@link #getFramingRect} but coordinates are in terms of the preview frame, * not UI / screen. * * @return {@link Rect} expressing barcode scan area in terms of the preview size */ public synchronized Rect getFramingRectInPreview() { if (framingRectInPreview == null) { Rect framingRect = getFramingRect(); if (framingRect == null) { return null; } Rect rect = new Rect(framingRect); Log.e("zjy", "CameraManager->getFramingRectInPreview(): framingRect==" + rect .toString()); Point cameraResolution = configManager.getCameraResolution(); Point screenResolution = configManager.getScreenResolution(); Log.e("zjy", "CameraManager->getFramingRectInPreview(): cameraX-cameraY==" + cameraResolution.x+"\t"+cameraResolution.y); if (cameraResolution == null || screenResolution == null) { // Called early, before init even finished return null; } rect.left = rect.left * cameraResolution.x / screenResolution.x; rect.right = rect.right * cameraResolution.x / screenResolution.x; rect.top = rect.top * cameraResolution.y / screenResolution.y; rect.bottom = rect.bottom * cameraResolution.y / screenResolution.y; framingRectInPreview = rect; } return framingRectInPreview; } /** * Allows third party apps to specify the camera ID, rather than determine * it automatically based on available cameras and their orientation. * * @param cameraId camera ID of the camera to use. A negative value means "no preference". */ public synchronized void setManualCameraId(int cameraId) { requestedCameraId = cameraId; } /** * Allows third party apps to specify the scanning rectangle dimensions, rather than determine * them automatically based on screen resolution. * * @param width The width in pixels to scan. * @param height The height in pixels to scan. */ public synchronized void setManualFramingRect(int width, int height) { if (initialized) { Point screenResolution = configManager.getScreenResolution(); if (width > screenResolution.x) { width = screenResolution.x; } if (height > screenResolution.y) { height = screenResolution.y; } int leftOffset = (screenResolution.x - width) / 2; int topOffset = (screenResolution.y - height) / 2; framingRect = new Rect(leftOffset, topOffset, leftOffset + width, topOffset + height); Log.d(TAG, "Calculated manual framing rect: " + framingRect); framingRectInPreview = null; } else { requestedFramingRectWidth = width; requestedFramingRectHeight = height; } } /** * A factory method to build the appropriate LuminanceSource object based on the format * of the preview buffers, as described by Camera.Parameters. * * @param data A preview frame. * @param width The width of the image. * @param height The height of the image. * @return A PlanarYUVLuminanceSource instance. */ public PlanarYUVLuminanceSource buildLuminanceSource(byte[] data, int width, int height) { // Rect rect = getFramingRectInPreview(); Rect rect = getFramingRect(); Log.e("zjy", "CameraManager->buildLuminanceSource(): left top right bottom=="+rect.toString()); if (rect == null) { return null; } // Go ahead and assume it's YUV rather than die. return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top, rect.width(), rect.height(), false); } }
06cc78ea46517a5cd505567cc4a545a3185cd16a
425fe82c4a64d9b169db69daa48a5f89c05abb95
/src/main/java/leetCode/LinkedList/LinkedListCycle1/Main.java
7c39d676b49d863b6dfd758f41b086b938acab6c
[]
no_license
Abhisinghrulz/DS
2cf10f2b2529c76f6c43347d0cc761b1dfde960c
9633d45d5332fd64a0b1279c83462639bbefc1fe
refs/heads/master
2023-03-31T00:31:43.485744
2021-03-31T21:03:32
2021-03-31T21:03:32
294,037,079
0
0
null
null
null
null
UTF-8
Java
false
false
1,387
java
package leetCode.LinkedList.LinkedListCycle1; import leetCode.LinkedList.ListNode; import leetCode.LinkedList.removeDuplicates.removeDuplicates2.RemoveDuplicates2; import leetCode.LinkedList.reverseLLUsingStack.ReverseList; public class Main { public static void main(String[] args) { ListNode listNode0 = new ListNode(1); ListNode listNode1 = new ListNode(2); ListNode listNode2 = new ListNode(3); ListNode listNode3 = new ListNode(3); ListNode listNode4 = new ListNode(4); ListNode listNode5 = new ListNode(4); ListNode listNode6 = new ListNode(5); listNode0.next = listNode1; listNode1.next = listNode2; listNode2.next = listNode3; listNode3.next = listNode4; listNode4.next = listNode5; listNode5.next = listNode6; RemoveDuplicates2 removeDuplicates2 = new RemoveDuplicates2(); //ListNode listNodeReturn = removeDuplicates2.deleteDuplicates2(listNode0); Main main = new Main(); //main.showAll(listNodeReturn); ReverseList reverseList = new ReverseList(); ListNode listNode = reverseList.reverseList(listNode0); main.showAll(listNode); } public void showAll(ListNode head) { while(head!=null) { System.out.println(head.val); head = head.next; } } }
005e7ba89bb5b99f979de6e58cf781e3a091fdcd
78c28c858c4bcd5415b81b9e4e4359e543b2eb2b
/microservicecloud-provider-dept-8001/src/main/java/com/wangxb/springcloud/controller/DeptController.java
5478c073247372f57d8bdfefa8b024de909e79df
[]
no_license
wxb2019/micservicecloud
38688d7869f5f46b1f0de28f6ddc4327ccde295e
dc1dbc966c01b7be27958e7df4d332e6a533d6a4
refs/heads/master
2023-08-08T07:04:26.942689
2019-09-19T16:36:27
2019-09-19T16:36:27
206,269,383
0
0
null
2023-07-22T15:17:40
2019-09-04T08:24:53
Java
UTF-8
Java
false
false
902
java
package com.wangxb.springcloud.controller; import com.wangxb.springcloud.entity.Dept; import com.wangxb.springcloud.service.DeptService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * @author wangpd * @version 1.0 * @date 2019-09-03 16:45 **/ @RestController public class DeptController { @Autowired private DeptService deptService; @RequestMapping(value = "/dept/add") public boolean add(@RequestBody Dept dept) { return deptService.addDept(dept); } @RequestMapping(value = "dept/get/{id}", method = RequestMethod.GET) public Dept get(@PathVariable("id") Long id) { return deptService.findById(id); } @RequestMapping(value = "/dept/list", method = RequestMethod.GET) public List<Dept> list() { return deptService.findAll(); } }
cc997784fb3ae468799a8fa0bd061d251cf4092a
d740101c2b56fde3b678e97d88d83f8fe2dd3c7d
/rain-console/src/main/java/com/stylesmile/console/system/controller/SysMenuController.java
8ee9155a11141972ed7c02d8bf8417506ffb14a0
[]
no_license
stylesmile/rain
b43b67b3fae2d5262c323bf76a795c55d3a4753b
097e06ff5f2c2908ab813bfb263547e6df4ffb8b
refs/heads/master
2020-05-20T17:30:40.887424
2020-04-19T12:02:22
2020-04-19T12:02:22
185,689,345
5
0
null
null
null
null
UTF-8
Java
false
false
2,961
java
//package com.stylesmile.console.system.controller; // //import com.stylesmile.console.system.entity.SysMenuEntity; //import com.stylesmile.console.system.service.SysMenuService; //import com.stylesmile.util.Result; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.web.bind.annotation.GetMapping; //import org.springframework.web.bind.annotation.PostMapping; //import org.springframework.web.bind.annotation.ResponseBody; //import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.servlet.ModelAndView; // //import java.util.List; // ///** // * 菜单管理 // * // * @author chenye // * @date 2018/11/24 // */ //@RestController //public class SysMenuController { // private final String BASE_URL_PATH = "/menu"; // private final String BASE_HTML_PATH = "/system/sysMenu"; // @Autowired // private SysMenuService sysMenuService; // // /** // * 菜单首页 // */ // @GetMapping(BASE_URL_PATH + "/index.html") // public ModelAndView index() { // ModelAndView view = new ModelAndView(BASE_HTML_PATH + "/menu"); // return view; // } // // /** // * 首页数据 // * // * @return List // */ // @GetMapping(BASE_URL_PATH + "/list.json") // @ResponseBody // public Result<List<SysMenuEntity>> list() { // return Result.success(sysMenuService.getList()); // } // // /** // * 进入新增菜单页面 // */ // @GetMapping(BASE_URL_PATH + "/add.html") // public ModelAndView add(String parentId) { // ModelAndView view = new ModelAndView(BASE_HTML_PATH + "/menu_add"); // view.addObject("parentId", parentId); // return view; // } // // /** // * 新增菜单 // * // * @param menu 菜单信息 // * @return Result // */ // @PostMapping(BASE_URL_PATH + "/add.json") // @ResponseBody // public Result add(SysMenuEntity menu) { // return Result.bool(sysMenuService.saveEntity(menu)); // } // // /** // * 进入编辑菜单页面 // * // * @param id 主键 // */ // @GetMapping(BASE_URL_PATH + "/edit.html") // public ModelAndView edit(Long id) { // ModelAndView view = new ModelAndView(BASE_HTML_PATH + "/menu_edit"); // SysMenuEntity menu = sysMenuService.getById(id); // view.addObject("menu", menu); // return view; // } // // /** // * 编辑菜单 // * // * @param sysMenu 菜单 // */ // @PostMapping(BASE_URL_PATH + "/edit.json") // @ResponseBody // public Result edit(SysMenuEntity sysMenu) { // return Result.bool(sysMenuService.saveEntity(sysMenu)); // } // // /** // * 删除菜单 // * // * @param id 主键 // */ // @PostMapping(BASE_URL_PATH + "/delete.json") // @ResponseBody // public Result delete(String id) { // return Result.bool(sysMenuService.deleteMenu(id)); // } //}
fc83aa20595e2bcdc580a986484caf9901409bca
f8689a1740a2e264fc04935b6554183ab790be00
/Actividad_Final-SofiaGallardo-IgnacioLopez/src/main/java/com/codenotfound/model/Profesores.java
a219e051a4e3b9a30e98d1657d2dce1337c42e0f
[]
no_license
sofia-gallardo/-metodologia2019
60f35e5148d4ec00dac5d1636cfc62c98007e9c2
f58d7e36b5ad7a887f7810a39eb671d4c07873b9
refs/heads/master
2020-06-17T23:08:30.436901
2019-07-14T16:11:50
2019-07-14T16:11:50
196,094,105
0
0
null
null
null
null
UTF-8
Java
false
false
265
java
package com.codenotfound.model; public class Profesores { private String nombre; public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre.toUpperCase(); } }
aeeef29025d6e06ff9210f5ef969a31e2bd65ae9
79207189c9b7df336103dd5c2606b066c52c7f1d
/XXApp/app/src/main/java/com/xxapp/Entities/Result.java
4e3ed06976848267a4cf6ae150e43ff967533f4f
[]
no_license
rh1314/ADApp
0c89a09c3e841b2390bb5372d843fe0b4eb7e37b
e710e860145914d05b5fed44e7c21a79efe84c9e
refs/heads/master
2021-01-12T18:27:02.108300
2016-10-23T17:10:54
2016-10-23T17:10:54
71,379,596
0
0
null
null
null
null
UTF-8
Java
false
false
261
java
package com.xxapp.Entities; /** * Created by Administrator on 2016/10/14. */ public class Result<T> { public static final int STATE_SUCCESS=1; public static final int STATE_ERROR=2; public int state; public String descr; public T data; }
0536d041da24facbc904452acbaf9f8ac89b51ac
c827bfebbde82906e6b14a3f77d8f17830ea35da
/Development3.0/TeevraServer/extensions/generic/tfp/src/main/java/com/tfp/properties/MCH.java
0076aa8782d68a30683a8313ea21887cacb55132
[]
no_license
GiovanniPucariello/TeevraCore
13ccf7995c116267de5c403b962f1dc524ac1af7
9d755cc9ca91fb3ebc5b227d9de6bcf98a02c7b7
refs/heads/master
2021-05-29T18:12:29.174279
2013-04-22T07:44:28
2013-04-22T07:44:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,992
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2010.03.03 at 03:05:55 PM EST // package com.tfp.properties; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="CDS" type="{}CDSConfigType" minOccurs="0"/> * &lt;element name="TDS" type="{}TDSConfigType" minOccurs="0"/> * &lt;element name="TFP" type="{}TFPConfigType" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "cds", "tds", "tfp" }) @XmlRootElement(name = "MCH") public class MCH { @XmlElement(name = "CDS") protected CDSConfigType cds; @XmlElement(name = "TDS") protected TDSConfigType tds; @XmlElement(name = "TFP") protected TFPConfigType tfp; /** * Gets the value of the cds property. * * @return * possible object is * {@link CDSConfigType } * */ public CDSConfigType getCDS() { return cds; } /** * Sets the value of the cds property. * * @param value * allowed object is * {@link CDSConfigType } * */ public void setCDS(CDSConfigType value) { this.cds = value; } /** * Gets the value of the tds property. * * @return * possible object is * {@link TDSConfigType } * */ public TDSConfigType getTDS() { return tds; } /** * Sets the value of the tds property. * * @param value * allowed object is * {@link TDSConfigType } * */ public void setTDS(TDSConfigType value) { this.tds = value; } /** * Gets the value of the tfp property. * * @return * possible object is * {@link TFPConfigType } * */ public TFPConfigType getTFP() { return tfp; } /** * Sets the value of the tfp property. * * @param value * allowed object is * {@link TFPConfigType } * */ public void setTFP(TFPConfigType value) { this.tfp = value; } }
94a81f8048c57d41edfe64e758bfd34b32528c97
0e9699d72135bc6e89b2e609bf5d1ba726a68190
/EspressioniMatematiche/src/Espressione.java
7f8718708da7934ca0147bf9c965f20dcb43d92f
[]
no_license
francescopioscognamiglio/metodologie_scognamiglio.1801156
76de135c8513f5987763f75f4481177ad99393da
47bf4b170e54610e12f2ffcab1e355bcc938f290
refs/heads/master
2023-06-08T20:59:55.324411
2020-02-13T20:25:15
2020-02-13T20:25:15
176,898,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,108
java
/** * Esercizio: Espressioni matematiche * * Progettare una serie di classi che modellino le espressioni matematiche secondo la seguente definizione: * - Una costante di tipo double è un’espressione * - Una variabile con nome di tipo stringa e valore double è un’espressione * - Se e1 è un’espressione, allora -e1 è un’espressione * - Se e1 , e2 sono espressioni, allora e1 op e2 è un’espressione dove op può essere l’operatore +, -, *, /, % * * Ogni tipo di espressione (costante, variabile, espressioni composte) deve essere modellata mediante una classe separata * * Ogni espressione dispone del metodo getValore() che restituisce il valore che quell’espressione possiede in quel momento * * Costruire quindi l’espressione –(5+(3/2)-2)*x e calcolarne il valore quando la variabile x vale 3 e quando la variabile x vale 6 * * @author francescopioscognamiglio * */ abstract public class Espressione { /** * metodo astratto che restituisce il valore dell'espressione * @return il valore dell'espressione */ abstract public double getValore(); }
82cda459f40bc717e9d30cf473cf470341f97d87
ac1768b715e9fe56be8b340bc1e4bc7f917c094a
/ant_tasks/tags/release/11.02.x/11.02.1/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java
2752ec4294fa21a3fe07aa8df848b3b4b34817de
[ "Apache-2.0" ]
permissive
kykrueger/openbis
2c4d72cb4b150a2854df4edfef325f79ca429c94
1b589a9656d95e343a3747c86014fa6c9d299b8d
refs/heads/master
2023-05-11T23:03:57.567608
2021-05-21T11:54:58
2021-05-21T11:54:58
364,558,858
0
0
Apache-2.0
2021-06-04T10:08:32
2021-05-05T11:48:20
Java
UTF-8
Java
false
false
8,151
java
/* * Copyright 2007 ETH Zuerich, CISD * * 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 ch.systemsx.cisd.common.collections; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; import org.apache.commons.lang.builder.ToStringBuilder; /** * A table of rows of type <code>E</code> with random access via a key of type <code>K</code>. * * @author Franz-Josef Elmer */ public class TableMap<K, E> implements Iterable<E> { /** Strategy on how to handle unique key constraint violations. */ public enum UniqueKeyViolationStrategy { KEEP_FIRST, KEEP_LAST, ERROR } /** * Exception indicating a violation of the unique key constraint. */ public static class UniqueKeyViolationException extends RuntimeException { private static final long serialVersionUID = 1L; private final Object/* <K> */invalidKey; // NOTE: exceptions cannot be generic in java UniqueKeyViolationException(Object/* <K> */invalidKey) { super("Key '" + invalidKey.toString() + "' already in the map."); this.invalidKey = invalidKey; } public Object/* <K> */getInvalidKey() { return invalidKey; } } private final Map<K, E> map = new LinkedHashMap<K, E>(); private final IKeyExtractor<K, E> extractor; private final UniqueKeyViolationStrategy uniqueKeyViolationStrategy; /** * Creates a new instance for specified key extractor. * * @param extractor Strategy to extract a key of type <code>E</code> for an object of type * <code>E</code>. */ public TableMap(final IKeyExtractor<K, E> extractor) { this(null, extractor, UniqueKeyViolationStrategy.ERROR); } /** * Creates a new instance for the specified rows and key extractor. * * @param extractor Strategy to extract a key of type <code>E</code> for an object of type * <code>E</code>. * @param uniqueKeyViolationStrategy Strategy to react on unique key violations. */ public TableMap(final IKeyExtractor<K, E> extractor, final UniqueKeyViolationStrategy uniqueKeyViolationStrategy) { this(null, extractor, uniqueKeyViolationStrategy); } /** * Creates a new instance for the specified rows and key extractor. * * @param rows Collection of rows of type <code>E</code>. * @param extractor Strategy to extract a key of type <code>E</code> for an object of type * <code>E</code>. * @throws UniqueKeyViolationException If the keys of <var>rows</var> are not unique and a * <var>uniqueKeyViolationStrategy</var> of <code>ERROR</code> has been chosen. */ public TableMap(final Iterable<E> rows, final IKeyExtractor<K, E> extractor) { this(rows, extractor, UniqueKeyViolationStrategy.ERROR); } /** * Creates a new instance for the specified rows and key extractor. * * @param rowsOrNull Collection of rows of type <code>E</code>. * @param extractor Strategy to extract a key of type <code>E</code> for an object of type * <code>E</code>. * @param uniqueKeyViolationStrategy Strategy to react on unique key violations. * @throws UniqueKeyViolationException If the keys of <var>rows</var> are not unique and a * <var>uniqueKeyViolationStrategy</var> of <code>ERROR</code> has been chosen. */ public TableMap(final Iterable<E> rowsOrNull, final IKeyExtractor<K, E> extractor, final UniqueKeyViolationStrategy uniqueKeyViolationStrategy) { assert extractor != null : "Unspecified key extractor."; assert uniqueKeyViolationStrategy != null : "Unspecified unique key violation strategy."; this.extractor = extractor; this.uniqueKeyViolationStrategy = uniqueKeyViolationStrategy; if (rowsOrNull != null) { for (final E row : rowsOrNull) { add(row); } } } /** * Adds the specified row to this table. What the method will do when a row is provided with a * key that is already in the map, depends on the unique key violation strategy as given to the * constructor: * <ul> * <li>For {@link UniqueKeyViolationStrategy#KEEP_FIRST} the first inserted row with this key * will be kept and all later ones will be ignored.</li> * <li>For {@link UniqueKeyViolationStrategy#KEEP_LAST} the last inserted row with a given key * will replace all the others.</li> * <li>For {@link UniqueKeyViolationStrategy#ERROR} a {@link UniqueKeyViolationException} will * be thrown when trying to insert a row with a key that is already in the map. <i>This is the * default.</i>.</li> * </ul> * * @throws UniqueKeyViolationException If the key of <var>row</var> is already in the map and a * unique key violation strategy of {@link UniqueKeyViolationStrategy#ERROR} has * been chosen. */ public final void add(final E row) throws UniqueKeyViolationException { final K key = extractor.getKey(row); if (uniqueKeyViolationStrategy == UniqueKeyViolationStrategy.KEEP_LAST || map.get(key) == null) { map.put(key, row); } else if (uniqueKeyViolationStrategy == UniqueKeyViolationStrategy.ERROR) { throw new UniqueKeyViolationException(key); } } /** * Gets the row for the specified key or <code>null</code> if not found. */ public final E tryGet(final K key) { return map.get(key); } /** * Returns a collection view of the values contained in the internal map. * <p> * The returned collection is unmodifiable. * </p> */ public final Collection<E> values() { return Collections.unmodifiableCollection(map.values()); } /** * Returns a set view of the keys contained in the internal map. * <p> * The returned set is unmodifiable. * </p> */ public final Set<K> keySet() { return Collections.unmodifiableSet(map.keySet()); } /** * Removes and returns the row for the specified key. * * @return stored row. */ public E remove(K key) { E row = map.remove(key); if (row == null) { throw new IllegalArgumentException("Couldn't remove row for key '" + key + "' because there was no row."); } return row; } // // Object // @Override public final String toString() { return ToStringBuilder.reflectionToString(this); } /** * Creates an iterator of the rows in the order they have been added. Removing is not supported. */ public final Iterator<E> iterator() { return new Iterator<E>() { private Iterator<Map.Entry<K, E>> iterator = map.entrySet().iterator(); public boolean hasNext() { return iterator.hasNext(); } public E next() { return iterator.next().getValue(); } public void remove() { throw new UnsupportedOperationException("Can not remove an element."); } }; } }
[ "fedoreno" ]
fedoreno
f12b1179da867da6384b3f25af9b8e244a7047fa
74f67709172fd617737e06269e0aeeb6103b3116
/src/main/java/com/github/jeffrey/spring/boot/model/big2/game/Player.java
a305724a0e8704b7cb265ac3ddaed384374f11e0
[]
no_license
jeffreymzd/springboot
b576fe46274cf4ed136502d50a7f9b7d2246004a
54a9cd2447aaed76f8170401d2a08af11697de6e
refs/heads/master
2020-03-21T11:45:48.822205
2018-08-11T01:29:29
2018-08-11T01:29:29
138,520,744
0
0
null
null
null
null
UTF-8
Java
false
false
1,538
java
package com.github.jeffrey.spring.boot.model.big2.game; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.util.Objects; @Entity public class Player { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; public String getName() { return name; } public int getGainOrLoss() { return gainOrLoss; } private String name; private int cardsLost; private int gainOrLoss; public Player() {} public Player(String name, int lost) { this.name = name; this.cardsLost = lost; } public int getId() { return id; } public int getCardsLost() { return cardsLost; } public int calculateWinCount(int lostOfCounterparty) { return lostOfCounterparty - cardsLost; } public void setGainOrLoss(int gainOrLoss) { this.gainOrLoss += gainOrLoss; } @Override public String toString() { return "Player" + id + "{" + "name='" + name + '\'' + ", cardsLost=" + cardsLost + ", gainOrLoss=" + gainOrLoss + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Player)) return false; Player player = (Player) o; return id == player.id; } @Override public int hashCode() { return Objects.hash(id); } }
76a7dce3ffd14e032d77f8131c25b9cfe2bb3020
dea89aaf5d7358ff847043d1fd67c55403476a19
/week7-week7_04.ThingSuitcaseAndContainer/src/Main.java
8ecaee7e59e93a488df49a3b85fca5c2bbdb9034
[]
no_license
Milosh87/MOOC-Java-Part-2
4bb3500bd6c9f6df9ebbeac56cdc4d8f2859d6fa
fc21197d23b2820e9725a546e06346b45e469ca1
refs/heads/master
2020-09-12T21:54:43.961858
2019-11-19T00:23:38
2019-11-19T00:23:38
222,570,433
0
0
null
null
null
null
UTF-8
Java
false
false
605
java
public class Main { public static void main(String[] args) { // use this main class to test your program!Thing book = new Thing("Happiness in Three Steps", 2); Container container = new Container(1000); addSuitcasesFullOfBricks(container); System.out.println(container); } public static void addSuitcasesFullOfBricks(Container container){ for(int i=1; i<=100; i++) { Suitcase se = new Suitcase(1000); se.addThing(new Thing("brick", i)); container.addSuitcase(se); } } }
67e315bbfb6d1f0c9b827045d7644e747fdfc27c
02c1bfb3e187b573d814e9972c417bfafff39b21
/ch17-event/src/ItemEventEx01.java
f7a297c1ae5288cd9c36e4ea5a89355cfa1e6265
[]
no_license
kuno2582/java
de8a4db48c82633ff8c42bc848cc7a12760d56b8
980761ca044fb2e75fd0cfa2683cbfa57560b696
refs/heads/master
2020-05-22T19:53:19.900758
2017-03-12T11:13:03
2017-03-12T11:13:03
84,719,146
0
0
null
null
null
null
UHC
Java
false
false
1,631
java
//두 개의 이벤트 처리 import java.awt.*; //Frame, Button, TextArea, Checkbox, Panel, BorderLayout; import java.awt.event.*;//ItemEvent, ItemListener, ActionEvent, ActionListener; public class ItemEventEx01 extends Frame implements ActionListener, ItemListener{ Panel p1 = new Panel(); Panel p2 = new Panel(); TextArea ta = new TextArea(5, 20); //5행 20열 Button exit = new Button("종료"); Checkbox cb1 = new Checkbox("축구"); Checkbox cb2 = new Checkbox("농구"); Checkbox cb3 = new Checkbox("야구"); Checkbox cb4 = new Checkbox("족구"); Checkbox cb5 = new Checkbox("배구"); Checkbox cb6 = new Checkbox("수영"); public ItemEventEx01(){ super("ItemEvent test"); p1.add(cb1); p1.add(cb2); p1.add(cb3); p1.add(cb4); p1.add(cb5); p1.add(cb6); p2.add(exit); add(p1, BorderLayout.NORTH); add(p2, BorderLayout.SOUTH); add(ta, BorderLayout.CENTER); exit.addActionListener(this); cb1.addItemListener(this); cb2.addItemListener(this); cb3.addItemListener(this); cb4.addItemListener(this); cb5.addItemListener(this); cb6.addItemListener(this); setBounds(300, 300, 300, 300);//x좌표, y좌표, 너비, 높이 setVisible(true); } @Override public void actionPerformed(ActionEvent e){ System.exit(0); } @Override public void itemStateChanged(ItemEvent e){ if(e.getStateChange() == ItemEvent.SELECTED){ ta.append(e.getItem() + "을 선택\n"); }else if(e.getStateChange() == ItemEvent.DESELECTED){ ta.append(e.getItem() + "을 취소\n"); } } public static void main(String[] args) { new ItemEventEx01(); } }
fa280208442f757cf3ca02d37b889dd673ff9359
6fa9eda692cf4fe6d48f2d40600db59c20803577
/platform-db/src/test/java/com/softicar/platform/db/structure/mysql/parser/DbMysqlCreateTableStatementParserComplexTest.java
039ecebad2da0c1de59bc15e76c57645a64b98b1
[ "MIT" ]
permissive
softicar/platform
a5cbfcfe0e6097feae7f42d3058e716836c9f592
a6dad805156fc230a47eb7406959f29c59f2d1c2
refs/heads/main
2023-09-01T12:16:01.370646
2023-08-29T08:50:46
2023-08-29T08:50:46
408,834,598
4
2
MIT
2023-08-08T12:40:04
2021-09-21T13:38:04
Java
UTF-8
Java
false
false
2,781
java
package com.softicar.platform.db.structure.mysql.parser; import com.softicar.platform.common.testing.AbstractTest; import com.softicar.platform.db.structure.column.IDbColumnStructure; import com.softicar.platform.db.structure.key.IDbKeyStructure; import com.softicar.platform.db.structure.table.IDbTableStructure; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import org.junit.Test; public class DbMysqlCreateTableStatementParserComplexTest extends AbstractTest { private static final String CREATE_TABLE_STATEMENT = new StringBuilder()// .append("CREATE TABLE `db`.`Foo` (") .append(" `id` int NOT NULL AUTO_INCREMENT,") .append(" `bar` int COMMENT '@ignore@',") .append(" `baz` int,") .append(" PRIMARY KEY (`id`),") .append(" KEY `bar` (`bar`),") .append(" KEY `baz` (`baz`),") .append(" KEY `barbaz` (`bar`, `baz`),") .append(" CONSTRAINT `bar` FOREIGN KEY (`bar`) REFERENCES `Bar` (`id`),") .append(" CONSTRAINT `baz` FOREIGN KEY (`baz`) REFERENCES `Baz` (`id`)") .append(" CONSTRAINT `barbaz` FOREIGN KEY (`bar`, `baz`) REFERENCES `Baz` (`a`, `b`)") .append(")") .toString(); @Test public void testWithIgnoredColumns() { IDbTableStructure tableStructure = new DbMysqlCreateTableStatementParser(CREATE_TABLE_STATEMENT).parse(); assertColumns(tableStructure, "id", "bar", "baz"); assertKeys(tableStructure, null, "bar", "baz", "barbaz"); assertKeyColumns(tableStructure.getKeys().get(3), "bar", "baz"); assertForeignKeys(tableStructure, "bar", "baz", "barbaz"); } private void assertColumns(IDbTableStructure tableStructure, String...expectedColumns) { List<String> columnNames = tableStructure// .getColumns() .stream() .map(IDbColumnStructure::getNameOrThrow) .collect(Collectors.toList()); assertEquals(Arrays.asList(expectedColumns), columnNames); } private void assertKeys(IDbTableStructure tableStructure, String...expectedKeys) { List<String> columnNames = tableStructure// .getKeys() .stream() .map(key -> key.getName().orElse(null)) .collect(Collectors.toList()); assertEquals(Arrays.asList(expectedKeys), columnNames); } private void assertKeyColumns(IDbKeyStructure keyStructure, String...expectedColumns) { List<String> columnNames = keyStructure// .getColumns() .stream() .map(IDbColumnStructure::getNameOrThrow) .collect(Collectors.toList()); assertEquals(Arrays.asList(expectedColumns), columnNames); } private void assertForeignKeys(IDbTableStructure tableStructure, String...expectedNames) { List<String> actualNames = tableStructure// .getForeignKeys() .stream() .map(key -> key.getName().orElse(null)) .collect(Collectors.toList()); assertEquals(Arrays.asList(expectedNames), actualNames); } }
e6622adfbad3f001f0a333444ce9490a381048e0
13cbb329807224bd736ff0ac38fd731eb6739389
/javax/xml/bind/Binder.java
98136a6561251ce95b4120c9efdaf779047b711c
[]
no_license
ZhipingLi/rt-source
5e2537ed5f25d9ba9a0f8009ff8eeca33930564c
1a70a036a07b2c6b8a2aac6f71964192c89aae3c
refs/heads/master
2023-07-14T15:00:33.100256
2021-09-01T04:49:04
2021-09-01T04:49:04
401,933,858
0
0
null
null
null
null
UTF-8
Java
false
false
1,464
java
package javax.xml.bind; import javax.xml.validation.Schema; public abstract class Binder<XmlNode> extends Object { public abstract Object unmarshal(XmlNode paramXmlNode) throws JAXBException; public abstract <T> JAXBElement<T> unmarshal(XmlNode paramXmlNode, Class<T> paramClass) throws JAXBException; public abstract void marshal(Object paramObject, XmlNode paramXmlNode) throws JAXBException; public abstract XmlNode getXMLNode(Object paramObject); public abstract Object getJAXBNode(XmlNode paramXmlNode) throws JAXBException; public abstract XmlNode updateXML(Object paramObject); public abstract XmlNode updateXML(Object paramObject, XmlNode paramXmlNode) throws JAXBException; public abstract Object updateJAXB(XmlNode paramXmlNode) throws JAXBException; public abstract void setSchema(Schema paramSchema); public abstract Schema getSchema(); public abstract void setEventHandler(ValidationEventHandler paramValidationEventHandler) throws JAXBException; public abstract ValidationEventHandler getEventHandler() throws JAXBException; public abstract void setProperty(String paramString, Object paramObject) throws PropertyException; public abstract Object getProperty(String paramString) throws PropertyException; } /* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\javax\xml\bind\Binder.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.0.7 */
572b1f25ca3d734b74dde4e6cf0712f1a0ec0a04
110e5a5785699820e7a1a88e8701e9642e117302
/common/src/main/java/com/saturday/common/utils/Validator.java
97b6c11f58a7513ea7222f865eae4a74d9494ad8
[]
no_license
Yes-Saturday/server
04b408fcc8b515b60c120924f871e680e28af056
6136ab5b1869868502564a221c52aa965fd2b83e
refs/heads/master
2022-11-25T09:04:36.410507
2019-07-28T06:24:06
2019-07-28T06:24:06
157,547,218
2
1
null
2022-11-16T11:37:35
2018-11-14T12:42:52
Java
UTF-8
Java
false
false
5,914
java
package com.saturday.common.utils; import com.saturday.common.annotation.Verify; import com.saturday.common.annotation.Verify.Length; import com.saturday.common.annotation.Verify.Name; import com.saturday.common.annotation.Verify.NotEmpty; import com.saturday.common.annotation.Verify.NotNull; import com.saturday.common.annotation.Verify.Pattern; import com.saturday.common.annotation.Verify.Size; import com.saturday.common.exception.AssertException; import org.springframework.core.annotation.AnnotationUtils; import java.lang.reflect.Field; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; public class Validator { private final Map<Object, Set<Class<?>>> visited = new HashMap<>(); public final void verify(Object object) throws AssertException { try { Assert.isNotNull(object, "校验参数为空"); doVerify(object, visited); } finally { if (visited != null) visited.clear(); } } public final static void staticVerify(Object object) throws AssertException { Assert.isNotNull(object, "校验参数为空"); doVerify(object, new HashMap<>()); } private final static void doVerify(Object object, Map<Object, Set<Class<?>>> visited) throws AssertException { doVerify(object, object.getClass(), visited); } private final static void doVerify(Object object, Class<?> clazz, Map<Object, Set<Class<?>>> visited) throws AssertException { if (isVerified(object, clazz, visited)) return; if (clazz.getSuperclass() != null && !clazz.getSuperclass().equals(Object.class)) doVerify(object, clazz.getSuperclass(), visited); for (var field : clazz.getDeclaredFields()) { String name = field.getAnnotation(Name.class) == null ? field.getName() : field.getAnnotation(Name.class).value(); Object value = null; try { value = object.getClass().getMethod("get" + StringUtil.toUpperCase(field.getName())).invoke(object); } catch (Exception e) { } // do verify vvVerify(field, value, name); if (field.isAnnotationPresent(Verify.class)) { if (field.getType().isArray()) { if (value != null) for (var item : (Object[]) value) doVerify(item, field.getType().getComponentType(), visited); } else if (value instanceof Collection) { for (var item : (Collection<?>) value) doVerify(item, field.getType().getComponentType(), visited); } else doVerify(value, field.getType(), visited); } } } private final static boolean isVerified(Object object, Class<?> clazz, Map<Object, Set<Class<?>>> visited) { var temp = visited.get(object); if (temp == null) { visited.put(object, new HashSet<>() {{ add(clazz); }}); return false; } return !temp.add(clazz); } private final static void vvVerify(Field field, Object value, String name) { verifyNotNull(field, value, name); verifySize(field, value, name); verifyNotEmpty(field, value, name); verifyPattern(field, value, name); verifyLength(field, value, name); } private final static void verifyNotNull(Field field, Object value, String name) { if (field.isAnnotationPresent(NotNull.class)) Assert.isNotNull(value, "{" + name + "}字段不能为空"); } private final static void verifyNotEmpty(Field field, Object value, String name) { if (field.isAnnotationPresent(NotEmpty.class)) Assert.isNotEmpty(value, "{" + name + "}字段不能为空"); } private final static void verifyPattern(Field field, Object value, String name) { if (value == null) return; var pattern = AnnotationFinder.getAnnotation(field, Pattern.class); AnnotationUtils.findAnnotation(field, Pattern.class); if (pattern == null) return; Assert.isTrue(RegexUtils.isMatch(pattern.value(), value.toString()), "{" + name + "}字段不为正确格式"); } private final static void verifyLength(Field field, Object value, String name) { if (value == null) return; var length = field.getAnnotation(Length.class); if (length == null) return; if (length.value() > 0) Assert.isTrue(value.toString().length() == length.value(), "{" + name + "}字段长度不正确"); if (length.max() > 0) Assert.isFalse(value.toString().length() > length.max(), "{" + name + "}字段超长"); if (length.min() > 0) Assert.isFalse(value.toString().length() < length.min(), "{" + name + "}字段过短"); } private final static void verifySize(Field field, Object value, String name) { if (value == null) return; var size = field.getAnnotation(Size.class); if (size == null) return; var length = -1; if (value.getClass().isArray()) length = ((Object[]) value).length; else if (value instanceof Collection) length = ((Collection) value).size(); else if (value instanceof Map) length = ((Map) value).size(); if (size.value() > 0) Assert.isTrue(length == size.value(), "{" + name + "}字段大小不正确"); if (size.max() > 0) Assert.isFalse(length > size.max(), "{" + name + "}字段过大"); if (size.min() > 0) Assert.isFalse(length < size.min(), "{" + name + "}字段过小"); } }
11d2eeabb7e52408275254153c4e87dedb9e2e94
03ef7e915b78b5c34367d52280e39fabca2fb6ce
/product/src/main/java/site/javaee/mall/product/controller/AttrController.java
6716c9d3e4fca1f35b6780644c3a9d186abb0ca2
[]
no_license
WalkerDogW/mall
ef73e369ea8766fd947c64b50a641276e26e19b1
9b1e8df6f11d438d0ddc1b4e7fb1cef67695936d
refs/heads/master
2023-01-02T12:08:19.743881
2020-10-24T08:59:38
2020-10-24T08:59:38
283,060,411
0
0
null
null
null
null
UTF-8
Java
false
false
3,074
java
package site.javaee.mall.product.controller; import java.util.Arrays; import java.util.Map; //import org.apache.shiro.authz.annotation.RequiresPermissions; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; import site.javaee.mall.product.entity.AttrEntity; import site.javaee.mall.product.service.AttrService; import site.javaee.mall.common.utils.PageUtils; import site.javaee.mall.common.utils.R; import site.javaee.mall.product.vo.AttrRespVo; import site.javaee.mall.product.vo.AttrVo; /** * 商品属性 * * @author WalkerDogW * @email [email protected] * @date 2020-07-31 11:00:50 */ @RestController @RequestMapping("product/attr") public class AttrController { @Autowired private AttrService attrService; /** * 列表 */ @RequestMapping("/list") //@RequiresPermissions("product:attr:list") public R list(@RequestParam Map<String, Object> params) { PageUtils page = attrService.queryPage(params); return R.ok().put("page", page); } @RequestMapping("/{attrType}/list/{catelogId}") public R catelogList(@RequestParam Map<String, Object> params, @PathVariable("catelogId") Long catelogId, @PathVariable("attrType") String attrType) { PageUtils page = attrService.queryBaseAttr(params, catelogId,attrType); return R.ok().put("page", page); } /** * 信息 */ @RequestMapping("/info/{attrId}") //@RequiresPermissions("product:attr:info") public R info(@PathVariable("attrId") Long attrId) { // AttrEntity attr = attrService.getById(attrId); AttrRespVo attrRespVo = attrService.getAttrInfo(attrId); return R.ok().put("attr", attrRespVo); } /** * 保存 */ // @RequestMapping("/save") // //@RequiresPermissions("product:attr:save") // public R save(@RequestBody AttrEntity attr) { // attrService.save(attr); // // return R.ok(); // } @RequestMapping("/save") //@RequiresPermissions("product:attr:update") public R save(@RequestBody AttrVo attrVo) { attrService.saveAttr(attrVo); return R.ok(); } /** * 修改 */ @RequestMapping("/update") //@RequiresPermissions("product:attr:update") // public R update(@RequestBody AttrEntity attr) { public R update(@RequestBody AttrVo attrVo) { // attrService.updateById(attrVo); attrService.updateAttr(attrVo); return R.ok(); } /** * 删除 */ @RequestMapping("/delete") //@RequiresPermissions("product:attr:delete") public R delete(@RequestBody Long[] attrIds) { attrService.removeByIds(Arrays.asList(attrIds)); return R.ok(); } }
e6590a03f33988f04a991d376cb59437419e4fe6
ae7d9fe3abf5d1cf3e8ebbb3196e8d1df0256adc
/leetcodepractice/String/com/leetcode/algors/IsomorphicStrings/Solution.java
fc5513ad10fb885b5932b4c35d91be079888a2ab
[]
no_license
pivovarovanatol/leetcodepractice
a51c1a726db29cab248d661e74356dfbec85bf4d
545557789ea5df1373419a6a268501696227dc7f
refs/heads/master
2021-08-08T20:33:24.697990
2020-06-28T19:32:02
2020-06-28T19:32:02
196,134,299
1
0
null
null
null
null
UTF-8
Java
false
false
1,866
java
package com.leetcode.algors.IsomorphicStrings; //https://leetcode.com/problems/isomorphic-strings/ import java.util.ArrayList; import java.util.LinkedHashMap; class Solution { public boolean isIsomorphic(String s1, String s2) { char[] sc1 = s1.toCharArray(); char[] sc2 = s2.toCharArray(); LinkedHashMap firstStrig = new LinkedHashMap(); LinkedHashMap secondString = new LinkedHashMap(); if(sc1.length == sc2.length){ for(int i=0; i<sc1.length; i++){ firstStrig.put(sc1[i], i); secondString.put(sc2[i], i); } if(new ArrayList<>( firstStrig.values() ).equals(new ArrayList<>( secondString.values() ))){ return true; } } return false; } public boolean isIsomorphic2(String s, String t) { int len = s.length(); char[] chars1 = s.toCharArray(); char[] chars2 = t.toCharArray(); int[] arr1 = new int[len]; int[] arr2 = new int[len]; char prev1 = 0; char prev2 = 0; int index1 = -1; int index2 = -1; for (int i=0;i<len;i++){ if (chars1[i]==prev1){ arr1[index1]++; } else { prev1 = chars1[i]; index1++; arr1[index1]++; } if (chars2[i]==prev2){ arr2[index2]++; } else { prev2 = chars2[i]; index2++; arr2[index2]++; } } for (int i=0;i<len;i++){ if (arr1[i]!=arr2[i]){ return false; } } return true; } }
18f30a3f722ff88260cbef92dcab0449ff70a31d
851394187a0c17fde9effa8d4d68523e7b9f65d3
/src/main/java/com/nchu/anti_japan_history/webpage/entity/SpecialTopic.java
3d5e6c63856048d52aed7a130c10f3f68a86981f
[]
no_license
RCQBDYS/AntiJapanHistory
56cc5e42ef5190ab4765191dec91c8f60a961ece
e784d64f2c61219ac1ecae4a0b3917b626f73b2e
refs/heads/master
2022-07-02T19:06:29.220917
2020-09-04T01:16:00
2020-09-04T01:16:00
251,535,145
0
0
null
2022-06-21T03:14:40
2020-03-31T07:50:20
HTML
UTF-8
Java
false
false
345
java
package com.nchu.anti_japan_history.webpage.entity; import lombok.Data; import java.io.Serializable; /** *@Author: wangshen *@Date: 2020/4/6 *@Description: 导航栏实体类 */ @Data public class SpecialTopic implements Serializable { private Integer specialTopicId; //导航栏id private String topic; //导航栏标题 }
c8e72df4f4d2f9e4e737ceb69f02bc91df84086d
c75e6df08eb4065ab80fcc1dcc1cb38ac1256f72
/web/plugins/com.seekon.nextbi.palo.gwt.core/src/com/tensegrity/palo/gwt/core/server/services/cubeview/AxisHierarchyUpdater.java
8ba93a372722df1baf61af62c42bc6a845be6db6
[]
no_license
jerome-nexedi/nextbi
7b219c1ec64b21bebf4ccf77c730e15a8ad1c6de
0179b30bf6a86ae6a070434a3161d7935f166b42
refs/heads/master
2021-01-10T09:06:15.838199
2012-11-14T11:59:53
2012-11-14T11:59:53
36,644,370
0
0
null
null
null
null
UTF-8
Java
false
false
9,377
java
/* * * @file AxisHierarchyUpdater.java * * Copyright (C) 2006-2009 Tensegrity Software GmbH * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as published * by the Free Software Foundation at http://www.gnu.org/copyleft/gpl.html. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * If you are developing and distributing open source applications under the * GPL License, then you are free to use JPalo Modules under the GPL License. For OEMs, * ISVs, and VARs who distribute JPalo Modules with their products, and do not license * and distribute their source code under the GPL, Tensegrity provides a flexible * OEM Commercial License. * * @author Philipp Bouillon <[email protected]> * * @version $Id: AxisHierarchyUpdater.java,v 1.20 2010/04/15 09:54:49 PhilippBouillon Exp $ * */ /* * (c) Tensegrity Software 2009 * All rights reserved */ package com.tensegrity.palo.gwt.core.server.services.cubeview; import org.palo.api.Attribute; import org.palo.api.Element; import org.palo.api.ElementNode; import org.palo.api.Hierarchy; import org.palo.api.subsets.Subset2; import org.palo.api.subsets.SubsetHandler; import org.palo.viewapi.AxisHierarchy; import org.palo.viewapi.LocalFilter; import org.palo.viewapi.Property; import org.palo.viewapi.internal.LocalFilterImpl; import org.palo.viewapi.internal.VirtualElementImpl; import com.tensegrity.palo.gwt.core.client.models.cubeviews.XAlias; import com.tensegrity.palo.gwt.core.client.models.cubeviews.XAxisHierarchy; import com.tensegrity.palo.gwt.core.client.models.palo.XElement; import com.tensegrity.palo.gwt.core.client.models.palo.XElementNode; import com.tensegrity.palo.gwt.core.client.models.palo.XElementType; import com.tensegrity.palo.gwt.core.client.models.subsets.XSubset; import com.tensegrity.palo.gwt.core.client.models.subsets.XSubsetType; /** * <code>AxisHierarchyUpdater</code> TODO DOCUMENT ME * * @version $Id: AxisHierarchyUpdater.java,v 1.20 2010/04/15 09:54:49 * PhilippBouillon Exp $ **/ public class AxisHierarchyUpdater { static XElement update(AxisHierarchy axisHierarchy, XAxisHierarchy xAxisHierarchy) { updateAlias(axisHierarchy, xAxisHierarchy.getActiveAlias()); updateSubset(axisHierarchy, xAxisHierarchy.getActiveSubset()); updateLocalFilter(axisHierarchy, xAxisHierarchy.getVisibleElements()); if (xAxisHierarchy.getSelectedElement() == null) { ElementNode[] nodes = axisHierarchy.getRootNodes(); if (nodes != null && nodes.length > 0 && nodes[0] != null) { axisHierarchy.clearSelectedElements(); axisHierarchy.addSelectedElement(nodes[0].getElement()); XElement x = new XElement(nodes[0].getElement().getId(), nodes[0] .getElement().getName(), XElementType.fromString(nodes[0].getElement() .getTypeAsString())); xAxisHierarchy.setSelectedElement(x); } } updateSelectedElement(axisHierarchy, xAxisHierarchy.getSelectedElement()); updateNativeProperties(axisHierarchy, xAxisHierarchy); XElement elem = setAliasForSelectedElement(axisHierarchy, xAxisHierarchy .getSelectedElement()); return elem; } private static final void updateAlias(AxisHierarchy hierarchy, XAlias xAlias) { Property<?> aliasProperty = hierarchy.getProperty(AxisHierarchy.USE_ALIAS); if (xAlias != null) { // get the alias attribute: Attribute alias = hierarchy.getHierarchy().getAttribute(xAlias.getId()); if (alias != null) { aliasProperty = new Property<Attribute>(AxisHierarchy.USE_ALIAS, alias); hierarchy.addProperty(aliasProperty); } } else if (aliasProperty != null) hierarchy.removeProperty(aliasProperty); } private static void updateSubset(AxisHierarchy hierarchy, XSubset subset) { if (subset != null) { SubsetHandler subsetHandler = hierarchy.getHierarchy().getSubsetHandler(); int type = subset.getSubsetType() == XSubsetType.LOCAL ? Subset2.TYPE_LOCAL : Subset2.TYPE_GLOBAL; Subset2 nativeSubset = subsetHandler.getSubset(subset.getId(), type); hierarchy.setSubset(nativeSubset); } else hierarchy.setSubset(null); } private static final void updateLocalFilter(AxisHierarchy axisHierarchy, XElementNode[] visibleElements) { if (visibleElements == null) axisHierarchy.setLocalFilter(null); else { Hierarchy hierarchy = axisHierarchy.getHierarchy(); LocalFilter filter = new LocalFilterImpl(); for (XElementNode xElement : visibleElements) { ElementNode elementNode = createElementNode(xElement, hierarchy); filter.addVisibleElement(elementNode); } axisHierarchy.setLocalFilter(filter); } } private static final ElementNode createElementNode(XElementNode xElNode, Hierarchy hierarchy) { Element element = null; XElement xElement = xElNode.getElement(); if (xElement.getElementType().equals(XElementType.VIRTUAL)) { element = new VirtualElementImpl(xElement.getName(), hierarchy); } else element = hierarchy.getElementById(xElNode.getElement().getId()); ElementNode node = new ElementNode(element); addChildren(node, xElNode, hierarchy); return node; } private static final void addChildren(ElementNode parent, XElementNode xParent, Hierarchy hierarchy) { for (XElementNode xElNode : xParent.getChildren()) { ElementNode node = createElementNode(xElNode, hierarchy); parent.forceAddChild(node); } } private static final String findElementName(ElementNode[] roots, String id) { if (roots == null) { return null; } for (ElementNode n : roots) { if (n.getElement() != null && n.getElement().getId().equals(id)) { return n.getName(); } String res = findElementName(n.getChildren(), id); if (res != null) { return res; } } return null; } private static final void updateSelectedElement(AxisHierarchy hierarchy, XElement selectedElement) { Element element = selectedElement == null ? null : hierarchy.getHierarchy() .getElementById(selectedElement.getId()); if (element == null || !hierarchy.contains(element)) element = resetSelectedElement(hierarchy); hierarchy.clearSelectedElements(); hierarchy.addSelectedElement(element); } private static final XElement setAliasForSelectedElement(AxisHierarchy hierarchy, XElement element) { if (element != null) { String name = hierarchy.getElementNameFor(element.getId()); // findElementName(hierarchy.getRootNodes(), element.getId()); Property p = hierarchy.getProperty("aliasFormat"); if (p == null || p.getValue() == null) { if (name != null) { element.setName(name); } } else { String format = p.getValue().toString(); String result = hierarchy.getHierarchy().getElementById(element.getId()) .getName(); if (name != null) { if (format.equals("aliasFormat")) { result = name; } else if (format.equals("elementName")) { // result already is element name; } else if (format.equals("elementNameDashAlias")) { result = result + " - " + name; } else if (format.equals("aliasDashElementName")) { result = name + " - " + result; } else if (format.equals("elementNameParenAlias")) { result = result + " (" + name + ")"; } else if (format.equals("aliasParenElementName")) { result = name + " (" + result + ")"; } else if (format.equals("elementNameAlias")) { result = result + " " + name; } else if (format.equals("aliasElementName")) { result = name + " " + result; } } element.setName(result); } } return element; } private static final Element resetSelectedElement(AxisHierarchy hierarchy) { ElementNode[] roots = hierarchy.getRootNodes(); if (roots.length > 0) return roots[0].getElement(); return null; } private static final void updateNativeProperties(AxisHierarchy axis, XAxisHierarchy xAxis) { for (Property prop : axis.getProperties()) { if (!prop.getId().equals(AxisHierarchy.USE_ALIAS)) { axis.removeProperty(prop); } } for (String id : xAxis.getPropertyIDs()) { if (!id.equals(AxisHierarchy.USE_ALIAS)) { String propValue = xAxis.getProperty(id); Property<String> property = new Property<String>(id, propValue); axis.addProperty(property); } } } }
4a4273e1ab02851e303868bc30aaf64bd70b6d81
13b888b379bb4327f58ee90e30c3b40dab063d49
/Trunk/src/org/judgeos/gwt/client/model/Account.java
cc472f44f6657dc29a73d4028f2697bdcc398db8
[]
no_license
dlazerka/judgeos
e5f9a9266a5d375d25985ddc32f0fb61ce4b1236
1b2120d815925e5c5dd75756bda594ef9a7aae4b
refs/heads/master
2020-04-25T11:19:17.054275
2008-04-27T13:21:23
2008-04-27T13:21:23
32,124,423
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
package org.judgeos.gwt.client.model; import java.io.Serializable; /** * Account is a user who deals with the whole project, not the one contest. */ public class Account implements Serializable { private int id; private String email; private String fullName; public Account() {} public int getId() { return id; } public void setId(int id) { this.id = id; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } }
[ "dlazerka@62febc4b-c030-0410-aadf-9b72ef142954" ]
dlazerka@62febc4b-c030-0410-aadf-9b72ef142954
137f55feffb4d9b6c58da027c43813e27872abc5
931da3fbda725412ce631773b9953247996b712d
/chapter2-geoquiz-challenges/app/src/main/java/com/olerass/pfexample/android/geoquiz/domain/question/QuestionModel.java
b0033870531d9b0c19f65c19a1e591858f65d9a7
[ "Apache-2.0" ]
permissive
olerass/presenter-first-android
eda2d2995e99b5784591ec03c7b10153deae90b8
c29bd6c905989540e582b00f0f031cee9d02505c
refs/heads/master
2021-01-10T05:53:55.918324
2016-01-25T20:38:54
2016-01-25T20:38:54
49,235,392
20
6
null
null
null
null
UTF-8
Java
false
false
369
java
package com.olerass.pfexample.android.geoquiz.domain.question; import com.olerass.pfexample.android.geoquiz.domain.event.EventListener; public interface QuestionModel { String getQuestionText(); boolean isCorrectAnswer(boolean answer); void gotoNextQuestion(); void gotoPreviousQuestion(); void whenQuestionTextChanged(EventListener listener); }
5fc985c54a98626d715142285cf65f07629fe10a
d71e879b3517cf4fccde29f7bf82cff69856cfcd
/ExtractedJars/Shopkick_com.shopkick.app/javafiles/com/google/android/gms/internal/measurement/zztn.java
4673af57f75d9ca6a789f8c418e3d14b91528170
[ "MIT" ]
permissive
Andreas237/AndroidPolicyAutomation
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
refs/heads/master
2020-04-10T02:14:08.789751
2019-05-16T19:29:11
2019-05-16T19:29:11
160,739,088
5
1
null
null
null
null
UTF-8
Java
false
false
529
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) annotate safe package com.google.android.gms.internal.measurement; // Referenced classes of package com.google.android.gms.internal.measurement: // zzte abstract class zztn extends zzte { zztn() { // 0 0:aload_0 // 1 1:invokespecial #8 <Method void zzte()> // 2 4:return } abstract boolean zza(zzte zzte1, int i, int j); }
32e0710d2464694d49136ac385e4972b4b3aac58
32a39535f2f4b39e6e3b9753828297758eb721fc
/src/main/java/com/kikakeyboard/waveform/utils/JSONResult.java
6aa6c5d800b153b2c6eb5a7806a018cc495b6207
[]
no_license
kika-maowei/mark-waveform-platform
d8ce2ebb8cd7d3220088f80c1b94e0612733c685
84d77f72e5162a11a1960a33d7c66f6dedf2c748
refs/heads/master
2021-07-03T21:51:07.014753
2017-09-22T03:44:09
2017-09-22T03:44:09
103,238,101
0
0
null
null
null
null
UTF-8
Java
false
false
2,336
java
package com.kikakeyboard.waveform.utils; import com.alibaba.fastjson.JSONObject; import lombok.AllArgsConstructor; import lombok.Data; import java.util.HashMap; import java.util.Map; /** * @Author 毛伟 * @Email [email protected] * @Date 16/12/16 下午3:40 */ @AllArgsConstructor @Data public class JSONResult { public static final int CODE_SUCCESS = 0; public static final int CODE_INVALID_SIGN = 30001; public static final int CODE_INVALID_REQUEST_PARAM = 30005; public static final int CODE_SERVICE_FATAL_ERROR = 30006; public static final int CODE_NO_DATA = 40001; public static final String CODE_SUCCESS_MSG = "ok"; public static final String CODE_INVALID_SIGN_MSG = "invalid interface sign"; public static final String CODE_INVALID_REQUEST_PARAM_MSG = "invalid request parameter"; public static final String CODE_SERVICE_FATAL_ERROR_MSG = "service fatal error"; public static final String CODE_NO_DATA_MSG = "no data"; public static final Map<Integer, String> ErrorMap = new HashMap<>(); static { ErrorMap.put(CODE_SUCCESS, CODE_SUCCESS_MSG); ErrorMap.put(CODE_INVALID_SIGN, CODE_INVALID_SIGN_MSG); ErrorMap.put(CODE_INVALID_REQUEST_PARAM, CODE_INVALID_REQUEST_PARAM_MSG); ErrorMap.put(CODE_SERVICE_FATAL_ERROR, CODE_SERVICE_FATAL_ERROR_MSG); ErrorMap.put(CODE_NO_DATA, CODE_NO_DATA_MSG); } public static final JSONResult INVALID_SIGN = new JSONResult(CODE_INVALID_SIGN, CODE_INVALID_SIGN_MSG, null); public static final JSONResult INVALID_REQUEST_PARAM = new JSONResult(CODE_INVALID_REQUEST_PARAM, CODE_INVALID_REQUEST_PARAM_MSG, null); public static final JSONResult SERVICE_FATAL_ERROR = new JSONResult(CODE_SERVICE_FATAL_ERROR, CODE_SERVICE_FATAL_ERROR_MSG, null); public static final JSONResult NO_DATA = new JSONResult(CODE_NO_DATA, CODE_NO_DATA_MSG, null); private Integer errorCode; private String errorMsg; private JSONObject data; public static JSONResult getSuccessWithDataJSONResult(JSONObject data) { return new JSONResult(CODE_SUCCESS, CODE_SUCCESS_MSG, data); } public static JSONResult getErrorResult(int code, JSONObject data) { return new JSONResult(code, ErrorMap.getOrDefault(code, ""), data); } }
0a5468d9c2d06f258f12fd9e0be78fb4b47babaf
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/10/10_9ed7bff6d138561751c6a01f1d973103d6b4b1cf/InputNormalizer/10_9ed7bff6d138561751c6a01f1d973103d6b4b1cf_InputNormalizer_s.java
6b46c9bb888f6faf1168f5bff7c53195e60c2b4f
[]
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
6,939
java
/* * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.aitools.programd.util; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.ListIterator; /** * <code>InputNormalizer</code> replaces <code>Substituter</code> as the * utility class for performing various stages of <a * href="http://aitools.org/aiml/TR/2001/WD-aiml/#section-input-normalization">input * normalization </a>. Substitutions of other types are now handled * independently by their respective processors. * * @since 4.1.3 */ public class InputNormalizer { // Convenience constants. /** An empty string. */ private static final String EMPTY_STRING = ""; /** * Splits an input into sentences, as defined by the * <code>sentenceSplitters</code>. * * @param sentenceSplitters the sentence splitters to use * @param input the input to split * @return the input split into sentences */ public static List<String> sentenceSplit(List<String> sentenceSplitters, String input) { List<String> result = Collections.checkedList(new ArrayList<String>(), String.class); int inputLength = input.length(); if (inputLength == 0) { result.add(EMPTY_STRING); return result; } // This will hold the indices of all splitters in the input. ArrayList<Integer> splitterIndices = new ArrayList<Integer>(); // Iterate over all the splitters. for (String splitter : sentenceSplitters) { // Look for it in the input. int index = input.indexOf(splitter); // As long as it exists, while (index != -1) { // add its index to the list of indices. splitterIndices.add(new Integer(index)); // and look for it again starting just after the discovered // index. index = input.indexOf(splitter, index + 1); } } if (splitterIndices.size() == 0) { result.add(input); return result; } // Sort the list of indices. Collections.sort(splitterIndices); // Iterate through the indices and remove (all previous of) consecutive // values. ListIterator indices = splitterIndices.listIterator(); int previousIndex = ((Integer) indices.next()).intValue(); while (indices.hasNext()) { int nextIndex = ((Integer) indices.next()).intValue(); if (nextIndex == previousIndex + 1) { indices.previous(); indices.previous(); indices.remove(); } previousIndex = nextIndex; } // Now iterate through the remaining indices and split sentences. indices = splitterIndices.listIterator(); int startIndex = 0; int endIndex = inputLength - 1; while (indices.hasNext()) { endIndex = ((Integer) indices.next()).intValue(); result.add(input.substring(startIndex, endIndex + 1).trim()); startIndex = endIndex + 1; } // Add whatever remains. if (startIndex < inputLength - 1) { result.add(input.substring(startIndex).trim()); } return result; } /** * <p> * Performs <a * href="http://aitools.org/aiml/TR/2001/WD-aiml/#section-pattern-fitting-normalizations">pattern-fitting * </a> normalization on an input. * </p> * <p> * This is best used to produce a caseless representation of the effective * match string when presenting match results to a user; however, if used * when actually performing the match it will result in the case of * wildcard-captured values being lost. Some amendment of the specification * is probably in order. * </p> * * @param input the string to pattern-fit * @return the pattern-fitted input */ public static String patternFit(String input) { // Remove all tags. input = XMLKit.removeMarkup(input); StringCharacterIterator iterator = new StringCharacterIterator(input); StringBuffer result = new StringBuffer(input.length()); // Iterate over the input. for (char aChar = iterator.first(); aChar != CharacterIterator.DONE; aChar = iterator.next()) { // Replace non-letters/digits with a space. if (!Character.isLetterOrDigit(aChar) && aChar != '*' && aChar != '_') { result.append(' '); } else { result.append(Character.toUpperCase(aChar)); } } return XMLKit.filterWhitespace(result.toString()); } /** * <p> * Performs a partial <a * href="http://aitools.org/aiml/TR/2001/WD-aiml/#section-pattern-fitting-normalizations">pattern-fitting * </a> normalization on an input -- partial because it does <i>not </i> * convert letters to uppercase. * </p> * <p> * This is used when sending patterns to the Graphmaster so that wildcard * contents can be captured and case retained. Some amendment of the * specification is probably in order. * </p> * * @param input the string to pattern-fit * @return the pattern-fitted input */ public static String patternFitIgnoreCase(String input) { // Remove all tags. input = XMLKit.removeMarkup(input); StringCharacterIterator iterator = new StringCharacterIterator(input); StringBuffer result = new StringBuffer(input.length()); // Iterate over the input. for (char aChar = iterator.first(); aChar != CharacterIterator.DONE; aChar = iterator.next()) { // Replace non-letters/digits with a space. if (!Character.isLetterOrDigit(aChar)) { result.append(' '); } else { result.append(aChar); } } return XMLKit.filterWhitespace(result.toString()); } }
804ed4ca4b20883b0bfd5b7b0632816cbf64b7e4
f0fd665e04acfc5cabc0f1d26891d036e02857d4
/src/main/java/com/br/booktdddio/repository/BookRepository.java
c3068493b8b4450410f204f6e3bc8fc6ba58ff81
[]
no_license
netodeolino/book-tdd-dio
66468fbca32a0b96bf36cfcc6c9cf15caab8ceb5
33358f553e54f0c776adeabda3003e6e7364c049
refs/heads/master
2023-03-11T15:45:06.676268
2021-02-27T00:36:03
2021-02-27T00:36:03
342,385,743
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package com.br.booktdddio.repository; import com.br.booktdddio.entity.Book; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; @Repository public interface BookRepository extends JpaRepository<Book, Long> { Optional<Book> findByName(String name); List<Book> listByAuthoName(String authoName); }
ce8815de402b945947b57aaf9ac47b4c07ac4915
1f6de4522be954c733d7c7f08097c4589452278c
/b.java
354a5987e85998840c0fce7f8485f3455411dab1
[]
no_license
git-thebit/a
4efbf615563038f4c8eb3735e4a7201d66a5dbae
842ceb99b2f4e9fc1902e4e719c62ec9d3b5fb05
refs/heads/master
2020-05-27T10:01:44.541857
2019-05-26T13:54:40
2019-05-26T13:54:40
188,575,844
0
0
null
null
null
null
UTF-8
Java
false
false
541
java
import java.util.*; class Source1{ public static void main(String args[]){ int array[]; Scanner input = new Scanner(System.in); int count = input.nextInt(); for (int i = 1; i <= count; i++) { array[i] = input.nextInt(); } int key = input.nextInt(); input.close(); int in=1; for(int i=count;i>0;i--) { if(key==array[i]){ System.out.println(in); } in++; } //write your code here } }