blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
4d8994c4e695872ff9f5e0f5fdd65daba9b262df
cfe621e8c36e6ac5053a2c4f7129a13ea9f9f66b
/AndroidApplications/com.andymstone.accuratecompass-14/src/com/andymstone/compasslib/ab.java
98144b1a4c4fa4dcd82da307e4fed77ee44b6388
[]
no_license
linux86/AndoirdSecurity
3165de73b37f53070cd6b435e180a2cb58d6f672
1e72a3c1f7a72ea9cd12048d9874a8651e0aede7
refs/heads/master
2021-01-11T01:20:58.986651
2016-04-05T17:14:26
2016-04-05T17:14:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
114
java
package com.andymstone.compasslib; interface ab { void a(float[] fArr); float[] a(); boolean b(); }
[ "jack.luo@mail.utoronto.ca" ]
jack.luo@mail.utoronto.ca
bee3d0e52ea3316ce9370847e58d5f379539cf91
c2acd716992c13c598f69a994c07e569038c3253
/ListenerTest/src/SessionAttributeListener.java
c234555c1fa024b84d04a71b79eb375b1fd5b965
[]
no_license
Tansir93/how2j_Java_Intermediate
8498d0c7ae8e0a4c537c217716fafcdb25c2b50e
c83e76b9de9879c76b0a1a8a73893d9f537c8257
refs/heads/master
2022-07-04T10:44:43.358144
2019-06-01T15:44:36
2019-06-01T15:44:36
189,698,102
0
0
null
2020-07-01T23:19:13
2019-06-01T06:20:48
Java
UTF-8
Java
false
false
585
java
import javax.servlet.http.HttpSessionAttributeListener; import javax.servlet.http.HttpSessionBindingEvent; public class SessionAttributeListener implements HttpSessionAttributeListener { @Override public void attributeAdded(HttpSessionBindingEvent event) { System.out.println("sessionadd"); } @Override public void attributeRemoved(HttpSessionBindingEvent event) { System.out.println("sessionremoved"); } @Override public void attributeReplaced(HttpSessionBindingEvent event) { System.out.println("sessionreplaced"); } }
[ "405318813@qq.com" ]
405318813@qq.com
d932b69ad3f0b00ba1549a72645b1ec51b6310d8
3edc3cecb2cd413326e4d8a83bc0be37f4f6c76c
/src/p1/Test4.java
6918ae34fb656dd5da0822ad9c31d1e9aea89cfb
[]
no_license
ID44977/Exp
28a8135c09a6172e33b197bbbb8761ff58792285
78372fd4dc6b8ccc7a284c46d6591ea2ab2cd3dd
refs/heads/master
2020-04-07T15:50:27.605515
2018-12-01T04:57:43
2018-12-01T04:57:43
158,503,385
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package p1; import java.util.HashSet; public class Test4 { public static void main(String[] args) { //社团A HashSet<String> hsA = new HashSet<>(); hsA.add("张三"); hsA.add("李四"); hsA.add("陈六"); //社团B HashSet<String> hsB = new HashSet<>(); hsB.add("王五"); hsB.add("李四"); hsB.add("蔡九"); System.out.print("参加A社团的人有:"); traverse(hsA); System.out.print("\n参加B社团的人有:"); traverse(hsB); System.out.print("\n同时参加AB社团的人有:"); bothAB(hsA, hsB); System.out.print("\n只参加A社团的人有:"); onlyOne(hsA, hsB); System.out.print("\n只参加B社团的人有:"); onlyOne(hsB, hsA); } private static void onlyOne(HashSet<String> hsA, HashSet<String> hsB) { for (String string : hsA) { if (!hsB.contains(string)) { System.out.print(string + " "); } } } public static void traverse(HashSet<String> hs) { for (String string : hs) { System.out.print(string + " "); } } public static void bothAB(HashSet<String> hsA, HashSet<String> hsB) { for (String string : hsB) { if (hsA.contains(string)) { System.out.print(string + " "); } } } }
[ "760305100@qq.com" ]
760305100@qq.com
4c3327c7229664e81d8b260f1f58a7d228f5e0f6
f08cf851c12aa855084e41cc817583b4012bda2b
/baselib/src/main/java/com/zhengyuan/baselib/xmpp/util/XmppReliableListener.java
3aaaaa59fcac32635e3db766d2a7d915429ebcad
[]
no_license
shanghaif/EasyMessagerPro
75e11ed069a485b5c1b76a1cdfee1bceeb7cc3a7
2abac071cc8a494a71f84fd1a7a5d371210ecdb0
refs/heads/master
2022-05-20T14:06:43.620373
2019-05-07T12:11:02
2019-05-07T12:11:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
378
java
package com.zhengyuan.baselib.xmpp.util; import org.jivesoftware.smack.packet.Message; /* * 发送状态回调函数 * * @author 徐兵 */ //在应用层实例化,并重写方法 //在Xmpp协议层调用,以返回是否发送成功的状态 public abstract class XmppReliableListener { public abstract void sendStatusListener(boolean status,Message message); }
[ "349698837@qq.com" ]
349698837@qq.com
021f8644607ac9ba8cf4ff4add79ae43ca0825de
dab275f0b73510c16c8ad572adf180af37ae1520
/src/main/java/com/imooc/o2o/entity/LocalAuth.java
5062bdc1c70a7268c4da5fe382c1ab22ecd86365
[]
no_license
zgl92/o2o
1bf7b1db00af233c3569ee31c949927bc53c1a77
06d49bd403f43a7f822d42a1ff7079c84ec86a8e
refs/heads/master
2022-12-22T16:10:24.693423
2019-06-12T23:30:00
2019-06-12T23:30:00
191,388,139
0
0
null
2022-12-16T11:34:27
2019-06-11T14:25:04
Java
UTF-8
Java
false
false
1,246
java
package com.imooc.o2o.entity; import java.util.Date; public class LocalAuth { private long LocalAuthId; private String username; private String password; private Date createTime; private Date lastEditTime; private PersonInfo personInfo; public long getLocalAuthId() { return LocalAuthId; } public void setLocalAuthId(long localAuthId) { LocalAuthId = localAuthId; } 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; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getLastEditTime() { return lastEditTime; } public void setLastEditTime(Date lastEditTime) { this.lastEditTime = lastEditTime; } public PersonInfo getPersonInfo() { return personInfo; } public void setPersonInfo(PersonInfo personInfo) { this.personInfo = personInfo; } }
[ "Alan920302" ]
Alan920302
0fe4d84fe864cc1ddbb66506514fc147fea76081
5c3d398e1eb97e584f2c10b31f9665c38bacd5fb
/spring-framework/ch05_spring-hibernate/src/main/java/bnymellon/training/spring/framework/model/ColoredShape.java
9d64f928d8f97833d373d56beb6c8e70358f0449
[ "Apache-2.0" ]
permissive
donraab/spring-kata
95ab78aa2edd8f962a876bc06cf1fd2c932fbfcb
ca1ec563a5a3f774304b7a2a194b8c5adf3e125d
refs/heads/main
2023-08-18T18:58:51.855499
2021-10-10T01:28:58
2021-10-10T01:31:21
415,457,103
0
0
Apache-2.0
2021-10-10T01:13:08
2021-10-10T01:13:08
null
UTF-8
Java
false
false
3,013
java
/* * Copyright 2021 The Bank of New York Mellon. * * 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 bnymellon.training.spring.framework.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; @Entity @Table(name = "COLORED_SHAPE") public class ColoredShape implements Serializable { private static final long serialVersionUID = 4784487603905008443L; private Long id; // default color protected String color = "green"; // default shape protected String shape = "circle"; public ColoredShape() { } public ColoredShape(final String color, final String shape) { if (color != null) { this.color = color; } if (shape != null) { this.shape = shape; } } public ColoredShape(final Long id, final String color, final String shape) { this.id = id; this.color = color; this.shape = shape; } @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", unique = true, nullable = false) public Long getId() { return id; } public void setId(final Long id) { this.id = id; } public String getColor() { return color; } public void setColor(final String color) { this.color = color; } public String getShape() { return shape; } public void setShape(final String type) { this.shape = type; } public String toString() { return "ID: [" + id + "]: Color: [" + color + "], Shape: [" + shape +"]"; } @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ColoredShape that = (ColoredShape) o; if (id != null ? !id.equals(that.id) : that.id != null) return false; if (color != null ? !color.equals(that.color) : that.color != null) return false; return shape != null ? shape.equals(that.shape) : that.shape == null; } @Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (color != null ? color.hashCode() : 0); result = 31 * result + (shape != null ? shape.hashCode() : 0); return result; } }
[ "chandra.guntur@bnymellon.com" ]
chandra.guntur@bnymellon.com
0a815a07e98dd4c5617622d9037b88d816f68493
f74dccc19529131273724543221afed2370dba04
/Osszead/src/osszead/Osszead.java
53c47ed9234ef8a47d83e14ddf8bdd773ef39f87
[]
no_license
stevefoldy/java
7e153b91d5b63124fd4980e3b196c367553ee565
e816ad2d58677221266d1ce117b1fcc06aacf53b
refs/heads/master
2022-08-20T09:29:17.330191
2020-05-29T16:47:41
2020-05-29T16:47:41
264,846,504
0
0
null
null
null
null
UTF-8
Java
false
false
678
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 osszead; /** * * @author foldyistvan */ public class Osszead { /** * @param args the command line arguments */ private static int z; public static void main(String[] args) { int x = 6; int y = 13; System.out.println("x=" + x); System.out.println("y=" + y); z = sum(x,y); System.out.println("Az összeg: " + z); } private static int sum(int x, int y) { z = x + y; return z; } }
[ "istvan.foldy@innonic.com" ]
istvan.foldy@innonic.com
1dfc91c4fe3eaecbbd12a2774e25838cf96cdea4
39e1ecc579ccf2ac64dda1e5174b6d45811dbf23
/Builder Pattern/src/com/items/VegBurger.java
9dfbaf9e4969849046da81d3a9ecc9f89600ecd5
[]
no_license
codhar/designPatterns
110c912e4a4b3f3dab46e0ac0de7524d47127f0c
77fadff043b32a955728cc23dbc5c07592d0a57f
refs/heads/master
2023-02-13T13:58:25.946025
2023-02-07T06:47:13
2023-02-07T06:47:13
66,203,008
0
0
null
null
null
null
UTF-8
Java
false
false
305
java
package com.items; import com.ItemTypes.Burger; public class VegBurger extends Burger { @Override public String name() { // TODO Auto-generated method stub return "Veg Burger"; } @Override public float price() { // TODO Auto-generated method stub return 20.00f; } }
[ "u433538@DTCVDI-SSU-0280.ent.wfb.bank.corp" ]
u433538@DTCVDI-SSU-0280.ent.wfb.bank.corp
9fcbae64d6225925f0aa6f8160997efb0a873135
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_91f309296f431277f2f5eb4abfcaeb59c0b57f79/KortathjonustanCreditCardClient/2_91f309296f431277f2f5eb4abfcaeb59c0b57f79_KortathjonustanCreditCardClient_s.java
ab2adde5cb8ab6bb191a7ed6bcc4ac86a3f8706a
[]
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
35,805
java
package com.idega.block.creditcard.business; /* * Q&D java demo for communicating with kortathjonustan's RPCS * * Gunnar Mar Gunnarsson 9. Dec 2003 */ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Collection; import java.util.Hashtable; import java.util.Iterator; import java.util.Set; import java.util.Vector; import java.util.logging.FileHandler; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; import javax.ejb.CreateException; import com.idega.block.creditcard.data.CreditCardMerchant; import com.idega.block.creditcard.data.KortathjonustanAuthorisationEntries; import com.idega.block.creditcard.data.KortathjonustanAuthorisationEntriesHome; import com.idega.data.IDOLookup; import com.idega.data.IDOLookupException; import com.idega.idegaweb.IWApplicationContext; import com.idega.idegaweb.IWBundle; import com.idega.util.FileUtil; import com.idega.util.IWTimestamp; public class KortathjonustanCreditCardClient implements CreditCardClient { private final static String IW_BUNDLE_IDENTIFIER = "com.idega.block.creditcard"; private String HOST_NAME;// = "test.kortathjonustan.is"; private int HOST_PORT;// = 8443; String strKeystore;// = "/demoFolder/testkeys.jks"; String strKeystorePass;// = "changeit"; private String PROPERTY_USER = "user"; private String PROPERTY_PASSWORD = "pwd"; private String PROPERTY_SITE = "site"; // private String PROPERTY_MERCHANT_LANGUAGE = "mlang"; // valid = en, is (default = en) // private String PROPERTY_CLIENT_LANGUAGE = "clang"; // valid = en, is (default = en) // // private String PROPERTY_CLIENT_IP = "cip"; private String PROPERTY_CARDHOLDER_NAME = "d2name"; private String PROPERTY_CC_NUMBER = "d2"; private String PROPERTY_AMOUNT = "d4"; private String PROPERTY_CURRENCY_EXPONENT = "de4"; private String PROPERTY_CURRENT_DATE = "d12"; private String PROPERTY_CC_EXPIRE = "d14"; private String PROPERTY_REFERENCE_ID = "d31"; private String PROPERTY_APPROVAL_CODE = "d38"; // gotten from response private String PROPERTY_ACTION_CODE = "d39"; // gotten from response private String PROPERTY_ACCEPTOR_TERM_ID = "d41"; private String PROPERTY_ACCEPTOR_IDENT = "d42"; private String PROPERTY_CC_VERIFY_CODE = "d47"; private String PROPERTY_CURRENCY_CODE = "d49"; private String PROPERTY_ORIGINAL_DATA_ELEMENT = "d56"; // gotten from response private String PROPERTY_AMOUNT_ECHO = "o4"; // Echo from d4 private String PROPERTY_CURRENT_DATE_ECHO = "o12"; // Echo from d12 private String PROPERTY_APPROVAL_CODE_ECHO = "o38"; // Echo from d38 private String PROPERTY_ACTION_CODE_ECHO = "o39"; // Echo from d39 // private String PROPERTY_SHIPPING_ADDRESS = "d2saddr"; // private String PROPERTY_SHIPPING_CITY = "d2scity"; // private String PROPERTY_SHIPPING_ZIP = "d2szip"; // private String PROPERTY_SHIPPING_COUNTRY = "d2sctr"; private String PROPERTY_CARD_BRAND_NAME = "d2brand"; private String PROPERTY_TOTAL_RESPONSE = "totalResponse"; // private String PROPERTY_SETTLEMENT_REFERENCE_NUMBER = "d37"; private String PROPERTY_ACTION_CODE_TEXT = "d39text"; private String PROPERTY_ERROR_CODE = "error"; private String PROPERTY_ERROR_TEXT = "errortext"; private static String REQUEST_TYPE_AUTHORIZATION = "/rpc/RequestAuthorisation"; private static String REQUEST_TYPE_CAPTURE = "/rpc/RequestCapture"; private static String REQUEST_TYPE_REVERSAL = "/rpc/RequestReversal"; private static String CODE_AUTHORIZATOIN_APPROVED = "000"; // private static String CODE_AUTHORIZATOIN_DECLINED = "100"; // private static String CODE_SYSTEM_FAILURE_RETRY = "946"; // private static String CODE_SYSTEM_FAILURE_ERROR = "909"; private String SITE = null;//"22"; private String USER = null;//"idega"; private String PASSWORD = null;//"zde83af"; private String ACCEPTOR_TERM_ID = null;//"90000022"; private String ACCEPTOR_IDENTIFICATION = null;//"8180001"; // tmp values private String strCCNumber = null;//"5413033024823099"; private String strCCExpire = null;//"0504"; private String strCCVerify = null;//"150"; private String strAmount = null;//"2"; // 1 aur //private String strAmount = "3000"; private String strName = null; //"Grimur"; private String strCurrentDate = null;//"031216113900"; private String strCurrencyCode = null; //"352"; // ISK, check Appendix A, page 20 private String strCurrencyExponent = null; private String strReferenceNumber = null;//Integer.toString((int) // (Math.random() * // 43200)); // private Hashtable returnedProperties = null; // // Test indicator // private boolean bTestServer = false; // private CreditCardTransaction cct = null; private CreditCardMerchant ccMerchant = null; private IWBundle bundle = null; public KortathjonustanCreditCardClient(IWApplicationContext iwc, String host, int port, String keystoreLocation, String keystorePass, CreditCardMerchant merchant) { //this(iwc, host, port, keystoreLocation, keystorePass, // merchant.getLocation(), merchant.getUser(), merchant.getPassword(), // merchant.getTerminalID(), merchant.getMerchantID()); //} //private KortathjonustanCreditCardClient(IWApplicationContext iwc, String // host, int port, String keystoreLocation, String keystorePass, String // site, String user, String password, String acceptorTerminalID, String // acceptorIdentification) { HOST_NAME = host; HOST_PORT = port; strKeystore = keystoreLocation; strKeystorePass = keystorePass; ccMerchant = merchant; SITE = merchant.getLocation(); USER = merchant.getUser(); PASSWORD = merchant.getPassword(); ACCEPTOR_TERM_ID = merchant.getTerminalID(); ACCEPTOR_IDENTIFICATION = merchant.getMerchantID(); init(iwc); } private void init(IWApplicationContext iwc) { bundle = iwc.getIWMainApplication().getBundle(getBundleIdentifier()); } private void log(String msg) { Handler fh = null; try { Logger logger = Logger.getLogger(this.getClass().getName()); fh = new FileHandler(bundle.getPropertiesRealPath() + FileUtil.getFileSeparator() + "kortathjonustan.log"); logger.addHandler(fh); logger.setLevel(Level.ALL); logger.info(msg); fh.close(); } catch (Exception e) { e.printStackTrace(); } finally { if (fh != null) { fh.close(); } } } public String getBundleIdentifier() { return (IW_BUNDLE_IDENTIFIER); } private int getAmountWithExponents(double amount) { int amountMultiplier = (int) Math.pow(10, Double.parseDouble(strCurrencyExponent)); return (int) amount * amountMultiplier; } private String getCurrencyAbbreviation(String currencyCode) { if (currencyCode.equals("352")) { return "ISK"; } else if (currencyCode.equals("840")) { return "USD"; } else if (currencyCode.equals("826")) { return "GBP"; } else if (currencyCode.equals("208")) { return "DDK"; } else if (currencyCode.equals("978")) { return "EUR"; } return currencyCode; } private void setCurrencyAndAmount(String currency, double amount) throws CreditCardAuthorizationException { if (currency != null) { int amountMultiplier = 100; if (currency.equalsIgnoreCase("ISK")) { strCurrencyCode = "352"; strCurrencyExponent = "2"; amountMultiplier = (int) Math.pow(10, Double.parseDouble(strCurrencyExponent)); } else if (currency.equalsIgnoreCase("USD")) { strCurrencyCode = "840"; strCurrencyExponent = "2"; amountMultiplier = (int) Math.pow(10, Double.parseDouble(strCurrencyExponent)); } else if (currency.equalsIgnoreCase("GBP")) { strCurrencyCode = "826"; strCurrencyExponent = "2"; amountMultiplier = (int) Math.pow(10, Double.parseDouble(strCurrencyExponent)); } else if (currency.equalsIgnoreCase("DKK")) { strCurrencyCode = "208"; strCurrencyExponent = "2"; amountMultiplier = (int) Math.pow(10, Double.parseDouble(strCurrencyExponent)); } else if (currency.equalsIgnoreCase("EUR")) { strCurrencyCode = "978"; strCurrencyExponent = "2"; amountMultiplier = (int) Math.pow(10, Double.parseDouble(strCurrencyExponent)); } else { throw new CreditCardAuthorizationException("Unsupported currency (" + currency + ")"); } /* Setting amount with correct */ strAmount = Integer.toString((int) amount * amountMultiplier); } else { throw new CreditCardAuthorizationException("Currency is missing"); } } protected String convertStringToNumbers(String string) { if (string != null) { int length = string.length(); StringBuffer str = new StringBuffer(); for (int i = 0; i < length; i++) { str.append(Character.getNumericValue(string.charAt(i))); } return str.toString(); } return string; } public String creditcardAuthorization(String nameOnCard, String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, String referenceNumber) throws CreditCardAuthorizationException{ IWTimestamp stamp = IWTimestamp.RightNow(); strName = nameOnCard; strCCNumber = cardnumber; strCCExpire = yearExpires + monthExpires; strCCVerify = ccVerifyNumber; setCurrencyAndAmount(currency, amount); strCurrentDate = getDateString(stamp); strReferenceNumber = convertStringToNumbers(referenceNumber); Hashtable returnedProperties = getFirstResponse(); if(returnedProperties != null) { return propertiesToString(returnedProperties); } else { return null; } } public String doSale(String nameOnCard, String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, String referenceNumber) throws CreditCardAuthorizationException { try { IWTimestamp stamp = IWTimestamp.RightNow(); strName = nameOnCard; strCCNumber = cardnumber; strCCExpire = yearExpires + monthExpires; strCCVerify = ccVerifyNumber; setCurrencyAndAmount(currency, amount); strCurrentDate = getDateString(stamp); strReferenceNumber = convertStringToNumbers(referenceNumber); StringBuffer logText = new StringBuffer(); //System.out.println("referenceNumber => " + strReferenceNumber); Hashtable returnedProperties = getFirstResponse(); String authCode = null; if (returnedProperties != null) { logText.append("Authorization successful"); Hashtable returnedCaptureProperties = finishTransaction(returnedProperties); if (returnedCaptureProperties != null && returnedCaptureProperties.get(PROPERTY_APPROVAL_CODE).toString() != null) { //System.out.println("Approval Code = // "+returnedCaptureProperties.get(PROPERTY_APPROVAL_CODE).toString()); authCode = returnedCaptureProperties.get(PROPERTY_APPROVAL_CODE).toString();//returnedCaptureProperties; logText.append("\nCapture successful").append("\nAuthorization Code = " + authCode); logText.append("\nAction Code = " + returnedCaptureProperties.get(PROPERTY_ACTION_CODE).toString()); try { String tmpCardNum = CreditCardBusinessBean.encodeCreditCardNumber(cardnumber); this.storeAuthorizationEntry(tmpCardNum, null, returnedCaptureProperties, KortathjonustanAuthorisationEntries.AUTHORIZATION_TYPE_SALE); log(logText.toString()); } catch (Exception e) { System.err.println("Unable to save entry to database"); throw new CreditCardAuthorizationException(e); } } } return authCode; } catch (CreditCardAuthorizationException e) { StringBuffer logText = new StringBuffer(); logText.append("Authorization FAILED"); logText.append("\nError = " + e.getErrorMessage()); logText.append("\nNumber = " + e.getErrorNumber()); logText.append("\nDisplay error = " + e.getDisplayError()); log(logText.toString()); throw e; } } public String doRefund(String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, Object parentDataPK, String captureProperties) throws CreditCardAuthorizationException { IWTimestamp stamp = IWTimestamp.RightNow(); strCCNumber = cardnumber; strCCExpire = yearExpires + monthExpires; strCCVerify = ccVerifyNumber; setCurrencyAndAmount(currency, amount); strCurrentDate = getDateString(stamp); try { StringBuffer logText = new StringBuffer(); Hashtable capturePropertiesHash = parseResponse(captureProperties); Hashtable properties = doRefund(getAmountWithExponents(amount), capturePropertiesHash, parentDataPK); String authCode = properties.get(PROPERTY_APPROVAL_CODE).toString(); logText.append("\nRefund successful").append("\nAuthorization Code = " + authCode); logText.append("\nAction Code = " + properties.get(PROPERTY_ACTION_CODE).toString()); try { String tmpCardNum = CreditCardBusinessBean.encodeCreditCardNumber(cardnumber); storeAuthorizationEntry(tmpCardNum, parentDataPK, properties, KortathjonustanAuthorisationEntries.AUTHORIZATION_TYPE_REFUND); log(logText.toString()); } catch (Exception e) { System.err.println("Unable to save entry to database"); e.printStackTrace(); if (authCode != null) { return authCode; } else { throw new CreditCardAuthorizationException(e); } } return authCode; } catch (CreditCardAuthorizationException e) { StringBuffer logText = new StringBuffer(); logText.append("Authorization FAILED"); logText.append("\nError = " + e.getErrorMessage()); logText.append("\nNumber = " + e.getErrorNumber()); logText.append("\nDisplay error = " + e.getDisplayError()); log(logText.toString()); throw e; } catch (NullPointerException n) { throw new CreditCardAuthorizationException(n); } } /** * @param cardnumber * @param parentDataPK * @param properties * @throws IDOLookupException * @throws CreateException */ private void storeAuthorizationEntry(String encodedCardnumber, Object parentDataPK, Hashtable properties, String authorizationType) throws IDOLookupException, CreateException { KortathjonustanAuthorisationEntriesHome authHome = (KortathjonustanAuthorisationEntriesHome) IDOLookup.getHome(KortathjonustanAuthorisationEntries.class); KortathjonustanAuthorisationEntries auth = authHome.create(); if (properties.containsKey(PROPERTY_AMOUNT)) auth.setAmount(Double.parseDouble(properties.get(PROPERTY_AMOUNT).toString()));//Double.parseDouble(strAmount)); if (properties.containsKey(PROPERTY_APPROVAL_CODE)) auth.setAuthorizationCode(properties.get(PROPERTY_APPROVAL_CODE).toString());//authCode); if (properties.containsKey(PROPERTY_CARD_BRAND_NAME)) auth.setBrandName(properties.get(PROPERTY_CARD_BRAND_NAME).toString()); if (properties.containsKey(PROPERTY_CC_EXPIRE)) auth.setCardExpires(properties.get(PROPERTY_CC_EXPIRE).toString());//monthExpires+yearExpires); if (properties.containsKey(PROPERTY_CURRENCY_CODE)) auth.setCurrency(getCurrencyAbbreviation(properties.get(PROPERTY_CURRENCY_CODE).toString()));//currency); if (properties.containsKey(PROPERTY_ERROR_CODE)) auth.setErrorNumber(properties.get(PROPERTY_ERROR_CODE).toString()); if (properties.containsKey(PROPERTY_ERROR_TEXT)) auth.setErrorText(properties.get(PROPERTY_ERROR_TEXT).toString()); if (properties.containsKey(PROPERTY_TOTAL_RESPONSE)) auth.setServerResponse(properties.get(PROPERTY_TOTAL_RESPONSE).toString()); auth.setTransactionType(authorizationType); auth.setCardNumber(encodedCardnumber); auth.setDate(IWTimestamp.RightNow().getDate()); if (parentDataPK != null) { try { auth.setParentID(((Integer) parentDataPK).intValue()); } catch (Exception e) { System.out.println("KortathjonustanCCCleint : could not set parentID : " + parentDataPK); } } auth.store(); } private String getDateString(IWTimestamp stamp) { return stamp.getDateString("yyMMddHHmmss"); } /* * public static void main(String[] args) throws Exception { String host = * "test.kortathjonustan.is"; int port = 8443; String SITE = "22"; String USER = * "idega"; String PASSWORD = "zde83af"; String ACCEPTOR_TERM_ID = "90000022"; * String ACCEPTOR_IDENTIFICATION = "8180001"; * * String strCCNumber = "5413033024823099"; String strCCExpire = "0504"; * String strCCVerify = "150"; String strReferenceNumber = * Integer.toString((int) (Math.random() * 43200)); String keystore = * "/Applications/idega/webs/nat/idegaweb/bundles/com.idega.block.creditcard.bundle/resources/demoFolder/testkeys.jks"; * String keystorePass = "changeit"; * * KortathjonustanCreditCardClient client = new * KortathjonustanCreditCardClient(IWContext.getInstance(), host, port, * keystore, keystorePass, SITE, USER, PASSWORD, ACCEPTOR_TERM_ID, * ACCEPTOR_IDENTIFICATION); try { String tmp = client.doSale("Gr�mur Steri", * strCCNumber, strCCExpire.substring(2, 4), strCCExpire.substring(0, 2), * strCCVerify, 1, "ISK", strReferenceNumber ); * * //CreditCardBusiness cBus = (CreditCardBusiness) * IBOLookup.getServiceInstance(IWContext.getInstance(), * CreditCardBusiness.class); //KortathjonustanAuthorisationEntries entry = * (KortathjonustanAuthorisationEntries) cBus.getAuthorizationEntry(supp, * tmp); * * * //String tmp2 = client.doRefund(strCCNumber, strCCExpire.substring(2, 4), * strCCExpire.substring(0, 2), strCCVerify, 1, "ISK", * entry.getResponseString()); System.out.println("AuthorizationNumber = * "+tmp); //System.out.println("RefundAuthNumber = "+tmp2); } catch * (CreditCardAuthorizationException e) { System.out.println(" ---- Exception * ----"); System.out.println("DisplayText = "+e.getDisplayError()); * System.out.println("ErrorText = "+e.getErrorMessage()); * System.out.println("ErrorNum = "+e.getErrorNumber()); System.out.println(" * -----------------------"); e.printStackTrace(System.err); } * } * */ private Hashtable doRefund(int iAmountToRefund, Hashtable captureProperties, Object parentDataPK) throws CreditCardAuthorizationException { // TODO tjekka ef amountToRefund er sama og upphaflega refundi� ... //System.out.println(" ------ REFUND ------"); Hashtable refundProperties = new Hashtable(); try { int iAmount = 0; try { iAmount = Integer.parseInt(captureProperties.get(PROPERTY_AMOUNT).toString()); if (iAmountToRefund > iAmount) { CreditCardAuthorizationException e = new CreditCardAuthorizationException("Amount to refund can not be higher that the original amount"); throw e; } } catch (NumberFormatException e1) { throw new CreditCardAuthorizationException("Amount must be a number"); } StringBuffer strPostData = new StringBuffer(); // "DEFAULT" PROPERTIES appendProperty(strPostData, PROPERTY_USER, USER); appendProperty(strPostData, PROPERTY_PASSWORD, PASSWORD); appendProperty(strPostData, PROPERTY_SITE, SITE); appendProperty(strPostData, PROPERTY_CURRENT_DATE, getDateString(IWTimestamp.RightNow())); // TODO IMPLEMENT //appendProperty(strPostData, PROPERTY_MERCHANT_LANGUAGE) //appendProperty(strPostData, PROPERTY_CLIENT_LANGUAGE) appendProperty(strPostData, PROPERTY_AMOUNT_ECHO, strAmount); appendProperty(strPostData, PROPERTY_AMOUNT, Integer.toString(iAmountToRefund)); if (iAmount > iAmountToRefund) { appendProperty(strPostData, PROPERTY_AMOUNT_ECHO, captureProperties.get(PROPERTY_AMOUNT).toString()); } appendProperty(strPostData, PROPERTY_CURRENCY_EXPONENT, captureProperties.get(PROPERTY_CURRENCY_EXPONENT).toString()); appendProperty(strPostData, PROPERTY_REFERENCE_ID, captureProperties.get(PROPERTY_REFERENCE_ID).toString()); appendProperty(strPostData, PROPERTY_ACCEPTOR_TERM_ID, captureProperties.get(PROPERTY_ACCEPTOR_TERM_ID).toString()); appendProperty(strPostData, PROPERTY_ACCEPTOR_IDENT, captureProperties.get(PROPERTY_ACCEPTOR_IDENT).toString()); appendProperty(strPostData, PROPERTY_CURRENCY_CODE, captureProperties.get(PROPERTY_CURRENCY_CODE).toString()); appendProperty(strPostData, PROPERTY_ORIGINAL_DATA_ELEMENT, captureProperties.get(PROPERTY_ORIGINAL_DATA_ELEMENT).toString()); appendProperty(strPostData, PROPERTY_CURRENT_DATE_ECHO, captureProperties.get(PROPERTY_CURRENT_DATE).toString()); appendProperty(strPostData, PROPERTY_ACTION_CODE_ECHO, captureProperties.get(PROPERTY_ACTION_CODE).toString()); appendProperty(strPostData, PROPERTY_APPROVAL_CODE_ECHO, captureProperties.get(PROPERTY_APPROVAL_CODE).toString()); String strResponse = null; SSLClient client = getSSLClient(); //System.out.println("Request [" + strPostData.toString() + "]"); try { strResponse = client.sendRequest(REQUEST_TYPE_REVERSAL, strPostData.toString()); } catch (Exception e) { CreditCardAuthorizationException cce = new CreditCardAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest failed"); cce.setErrorNumber("-"); cce.setParentException(e); throw cce; } // System.out.println("Response [" + strResponse + "]"); if (strResponse == null) { CreditCardAuthorizationException cce = new CreditCardAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest returned null"); cce.setErrorNumber("-"); throw cce; } else if (!strResponse.startsWith(PROPERTY_ACTION_CODE)) { CreditCardAuthorizationException cce = new CreditCardAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("Invalid response from host, should start with d39 [" + strResponse + "]"); cce.setErrorNumber("-"); throw cce; } else { refundProperties = parseResponse(strResponse); if (CODE_AUTHORIZATOIN_APPROVED.equals(refundProperties.get(PROPERTY_ACTION_CODE))) { return refundProperties; } else { CreditCardAuthorizationException cce = new CreditCardAuthorizationException(); cce.setDisplayError(refundProperties.get(PROPERTY_ACTION_CODE_TEXT).toString()); cce.setErrorMessage(refundProperties.get(PROPERTY_ERROR_TEXT).toString()); cce.setErrorNumber(refundProperties.get(PROPERTY_ACTION_CODE).toString()); throw cce; } } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return refundProperties; } private String propertiesToString(Hashtable properties) { StringBuffer strPostData = new StringBuffer(); try { addProperties(strPostData, properties, false); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return strPostData.toString(); } private String getPostData(Hashtable properties) { StringBuffer strPostData = new StringBuffer(); try { appendProperty(strPostData, PROPERTY_PASSWORD, PASSWORD); addProperties(strPostData, properties, true); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return strPostData.toString(); } public void finishTransaction(String properties) throws KortathjonustanAuthorizationException { Hashtable returnedCaptureProperties = finishTransaction(parseResponse(properties)); try { //String tmpCardNum = CreditCardBusinessBean.encodeCreditCardNumber(cardnumber); this.storeAuthorizationEntry(null, null, returnedCaptureProperties, KortathjonustanAuthorisationEntries.AUTHORIZATION_TYPE_DELAYED_TRANSACTION); } catch (Exception e) { System.err.println("Unable to save entry to database"); e.printStackTrace(); throw new KortathjonustanAuthorizationException(e); } } private Hashtable finishTransaction(Hashtable properties) throws KortathjonustanAuthorizationException { //System.out.println(" ------ CAPTURE ------"); Hashtable captureProperties = new Hashtable(); try { SSLClient client = getSSLClient(); String strResponse = null; //System.out.println("strPostData [ "+strPostData.toString()+" ]"); try { strResponse = client.sendRequest(REQUEST_TYPE_CAPTURE, getPostData(properties)); } catch (Exception e) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest failed"); cce.setErrorNumber("-"); cce.setParentException(e); throw cce; } //System.out.println("Response [ "+strResponse+" ]"); if (strResponse == null) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest returned null"); cce.setErrorNumber("-"); throw cce; } else if (!strResponse.startsWith(PROPERTY_ACTION_CODE)) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("Invalid response from host, should start with d39 [" + strResponse + "]"); cce.setErrorNumber("-"); throw cce; } else { captureProperties = parseResponse(strResponse); captureProperties.put(PROPERTY_CARD_BRAND_NAME, properties.get(PROPERTY_CARD_BRAND_NAME)); if (CODE_AUTHORIZATOIN_APPROVED.equals(captureProperties.get(PROPERTY_ACTION_CODE))) { return captureProperties; } else { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError(captureProperties.get(PROPERTY_ACTION_CODE_TEXT).toString()); cce.setErrorMessage(captureProperties.get(PROPERTY_ERROR_TEXT).toString()); cce.setErrorNumber(captureProperties.get(PROPERTY_ACTION_CODE).toString()); throw cce; } } } catch (Exception e) { e.printStackTrace(); } return captureProperties; } private Hashtable getFirstResponse() throws KortathjonustanAuthorizationException { Hashtable properties = null; //System.out.println(" ------ REQUEST ------"); //long lStartTime = System.currentTimeMillis(); try { SSLClient client = getSSLClient(); StringBuffer strPostData = new StringBuffer(); appendProperty(strPostData, PROPERTY_SITE, SITE);//"site=22" appendProperty(strPostData, PROPERTY_USER, USER); appendProperty(strPostData, PROPERTY_PASSWORD, PASSWORD); appendProperty(strPostData, PROPERTY_ACCEPTOR_TERM_ID, ACCEPTOR_TERM_ID); appendProperty(strPostData, PROPERTY_ACCEPTOR_IDENT, ACCEPTOR_IDENTIFICATION); appendProperty(strPostData, PROPERTY_CC_NUMBER, strCCNumber); appendProperty(strPostData, PROPERTY_CC_EXPIRE, strCCExpire); appendProperty(strPostData, PROPERTY_AMOUNT, strAmount); appendProperty(strPostData, PROPERTY_CURRENCY_CODE, strCurrencyCode); appendProperty(strPostData, PROPERTY_CURRENCY_EXPONENT, strCurrencyExponent); appendProperty(strPostData, PROPERTY_CARDHOLDER_NAME, strName); appendProperty(strPostData, PROPERTY_REFERENCE_ID, strReferenceNumber); appendProperty(strPostData, PROPERTY_CURRENT_DATE, strCurrentDate); appendProperty(strPostData, PROPERTY_CC_VERIFY_CODE, strCCVerify); addDefautProperties(strPostData); String strResponse = null; //System.out.println("Request [" + strPostData.toString() + "]"); try { strResponse = client.sendRequest(REQUEST_TYPE_AUTHORIZATION, strPostData.toString()); //System.out.println("[Korta] strResponse = "+strResponse); } catch (Exception e) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest failed"); cce.setErrorNumber("-"); cce.setParentException(e); e.printStackTrace(); throw cce; } //System.out.println("Response [" + strResponse + "]"); if (strResponse == null) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("SendRequest returned null"); cce.setErrorNumber("-"); throw cce; } else if (!strResponse.startsWith(PROPERTY_ACTION_CODE)) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("Invalid response from host, should start with d39 [" + strResponse + "]"); cce.setErrorNumber("-"); throw cce; } else { properties = parseResponse(strResponse); if (CODE_AUTHORIZATOIN_APPROVED.equals(properties.get(PROPERTY_ACTION_CODE))) { return properties; } else { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); try { cce.setDisplayError(properties.get(PROPERTY_ACTION_CODE_TEXT).toString()); } catch (NullPointerException n) {} try { cce.setErrorMessage(properties.get(PROPERTY_ERROR_TEXT).toString()); } catch (NullPointerException n) {} try { cce.setErrorNumber(properties.get(PROPERTY_ACTION_CODE).toString()); } catch (NullPointerException n) {} throw cce; } } } catch (UnsupportedEncodingException e) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("UnsupportedEncodingException"); cce.setErrorNumber("-"); cce.setParentException(e); throw cce; } } /** * @return @throws * IOException */ private SSLClient getSSLClient() throws KortathjonustanAuthorizationException { SSLClient client; try { String tmp = strKeystore; if (!tmp.startsWith("/")) { // Backwards compatability when this looked like this /home/idegaweb/... (marathon.is) tmp = bundle.getBundleBaseRealPath()+"/"+strKeystore; } client = new SSLClient(HOST_NAME, HOST_PORT, tmp, strKeystorePass, USER, PASSWORD); } catch (IOException e) { KortathjonustanAuthorizationException cce = new KortathjonustanAuthorizationException(); cce.setDisplayError("Cannot connect to Central Payment Server"); cce.setErrorMessage("Cannot get SSLClient instance"); cce.setErrorNumber("-"); cce.setParentException(e); throw cce; } return client; } private void addDefautProperties(StringBuffer strPostData) throws UnsupportedEncodingException { //appendProperty(strPostData, , ); //appendProperty(strPostData, PROPERTY_MERCHANT_LANGUAGE, "is"); //appendProperty(strPostData, PROPERTY_CLIENT_LANGUAGE, "is"); //appendProperty(strPostData, PROPERTY_CLIENT_IP, "80.62.56.56"); } private Hashtable parseResponse(String response) { return parseResponse(response, false); } private Hashtable parseResponse(String response, boolean listOnly) { Hashtable responseElements = new Hashtable(); int index = 0; int tmpIndex = 0; String tmpString; String key, value; responseElements.put(PROPERTY_TOTAL_RESPONSE, response); while (index >= 0) { tmpIndex = response.indexOf("&"); tmpString = response.substring(0, tmpIndex); response = response.substring(tmpIndex + 1, response.length()); index = response.indexOf("&"); if (tmpString.indexOf("=") > -1) { key = tmpString.substring(0, tmpString.indexOf("=")); value = tmpString.substring(tmpString.indexOf("=") + 1, tmpString.length()); if (listOnly) { System.out.println(tmpString + " (" + key + "," + value + ")"); } else { //System.out.println(tmpString+" ("+key+","+value+")"); responseElements.put(key, value); } } } if (response.indexOf("=") > -1) { key = response.substring(0, response.indexOf("=")); value = response.substring(response.indexOf("=") + 1, response.length()); if (listOnly) { System.out.println(response + " (" + key + "," + value + ")"); } else { responseElements.put(key, value); } } return responseElements; } private void addProperties(StringBuffer buffer, Hashtable properties, boolean urlEncode) throws UnsupportedEncodingException { Set keys = properties.keySet(); Iterator iter = keys.iterator(); if (iter != null) { String key; while (iter.hasNext()) { key = iter.next().toString(); appendProperty(buffer, key, properties.get(key).toString(), urlEncode); } } } private void appendProperty(StringBuffer buffer, String propertyName, String propertyValue) throws UnsupportedEncodingException { appendProperty(buffer, propertyName, propertyValue, true); } private void appendProperty(StringBuffer buffer, String propertyName, String propertyValue, boolean urlEncode) throws UnsupportedEncodingException { if (propertyValue != null) { if (urlEncode) { buffer.append("&").append(propertyName).append("=").append(URLEncoder.encode(propertyValue, "ISO-8859-1")); } else { buffer.append("&").append(propertyName).append("=").append(propertyValue); } // buffer.append("&").append(propertyName).append("=").append(URLEncoder.encode(propertyValue, "UTF-8")); } } // private String encodeBase64(String _strData) { // Base64 oB64 = new Base64(); // return oB64.encode(_strData.getBytes()); // } public Collection getValidCardTypes() { Vector tmp = new Vector(); tmp.add(CreditCardBusiness.CARD_TYPE_VISA); tmp.add(CreditCardBusiness.CARD_TYPE_MASTERCARD); tmp.add(CreditCardBusiness.CARD_TYPE_ELECTRON); tmp.add(CreditCardBusiness.CARD_TYPE_DINERS); tmp.add(CreditCardBusiness.CARD_TYPE_JCB); //tmp.add(CreditCardBusiness.CARD_TYPE_DANKORT); // Virkar v�st bara � .dk return tmp; } /* * (non-Javadoc) * * @see com.idega.block.creditcard.business.CreditCardClient#getCreditCardMerchant() */ public CreditCardMerchant getCreditCardMerchant() { return ccMerchant; } /* (non-Javadoc) * @see com.idega.block.creditcard.business.CreditCardClient#supportsDelayedTransactions() */ public boolean supportsDelayedTransactions() { return true; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c309f61c5c63be9bd00afcf4594c4dafe1cc4247
42232a00efcb3c699b7ddf0158ee599532cd5561
/Android_Project/app/src/main/java/com/studytree/view/widget/LoadingView.java
a3b3ac9c5e208964380a70fac31182ea81ee5520
[]
no_license
GGNBNB/Study_WebSite_forHHSY
9d2a178556fd17c03757f46b9186de38a615146e
8415a274a904c92a7f939c4b615676fb78d49268
refs/heads/master
2021-03-01T07:53:04.339547
2020-03-08T07:07:02
2020-03-08T07:07:02
245,766,488
0
0
null
2020-03-08T06:49:59
2020-03-08T06:49:58
null
UTF-8
Java
false
false
3,518
java
package com.studytree.view.widget; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.RectF; import android.support.annotation.FloatRange; import android.util.AttributeSet; import android.view.View; import com.studytree.R; import com.studytree.utils.StudyTreeTools; /** * 加载控件 * Title: LoadingView * @date 2018/7/3 16:18 * @author Freedom0013 */ public class LoadingView extends View { /** 默认大小(dp) */ private static final float DEFAULT_SIZE = 50.0f; /** 外圈大圆度数 */ private static final int OUTER_CIRCLE_ANGLE = 270; /** 内圈圆度数 */ private static final int INTER_CIRCLE_ANGLE = 90; /** 画笔 */ private Paint mStrokePaint; /** 外圈 */ private RectF mOuterCircleRectF; /** 内圈 */ private RectF mInnerCircleRectF; /** 起始位置(动画变量) */ private int mRotateAngle; /** 控件宽度 */ private float mViewWidth; /** 控件高度 */ private float mViewHeight; /** * 使用默认大小构造函数 * @param context Context对象 * @param attrs Xml属性 */ public LoadingView(Context context, AttributeSet attrs) { super(context, attrs); //正方形控件长宽相等 mViewWidth = StudyTreeTools.dip2px(DEFAULT_SIZE); mViewHeight = StudyTreeTools.dip2px(DEFAULT_SIZE); //外圈半径 float outR = StudyTreeTools.dip2px(DEFAULT_SIZE * 0.5f - 10); //内圈半径 float inR = outR * 0.6f; initPaint(inR * 0.4f); mRotateAngle = 0; mOuterCircleRectF = new RectF(); mOuterCircleRectF.set(mViewWidth * 0.5f - outR, mViewHeight * 0.5f - outR, mViewWidth * 0.5f + outR, mViewHeight * 0.5f + outR); mInnerCircleRectF = new RectF(); mInnerCircleRectF.set(mViewWidth * 0.5f - inR, mViewHeight * 0.5f - inR, mViewWidth * 0.5f + inR, mViewHeight * 0.5f + inR); } /** * 初始化画笔 * @param lineWidth 画笔宽度 */ private void initPaint(float lineWidth) { mStrokePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mStrokePaint.setStyle(Paint.Style.STROKE); mStrokePaint.setStrokeWidth(lineWidth); mStrokePaint.setColor(getResources().getColor(R.color.loading_color)); mStrokePaint.setDither(true); mStrokePaint.setFilterBitmap(true); mStrokePaint.setStrokeCap(Paint.Cap.ROUND); mStrokePaint.setStrokeJoin(Paint.Join.ROUND); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.save(); //绘制时由mRotateAngle改变,从而改变初始画笔位置,从而达到旋转动画的目的 canvas.drawArc(mOuterCircleRectF, mRotateAngle % 360, OUTER_CIRCLE_ANGLE, false, mStrokePaint); canvas.drawArc(mInnerCircleRectF, 270 - mRotateAngle % 360, INTER_CIRCLE_ANGLE, false, mStrokePaint); canvas.restore(); } /** * 设置不透明度 * @param alpha 0~255 */ public void setAlpha(int alpha) { mStrokePaint.setAlpha(alpha); } /** * 重绘动画 * @param animatedValue 重绘值 */ public void computeUpdateValue(@FloatRange(from = 0.0, to = 1.0) float animatedValue){ mRotateAngle = (int) (360 * animatedValue); invalidate(); } }
[ "846909723@qq.com" ]
846909723@qq.com
c0e3caaf47f027255b8f9a43b75238010ae4f3e4
fc1e80be0c89bac5575f7cb0e547e3692255be53
/FinalProto/app/src/androidTest/java/com/example/michael/finalproto/ApplicationTest.java
e9c06aa21a3427f1ddc74560f86b3746ab950954
[]
no_license
mfeuerstein/Android-Final
7b4fb6e23aee3a28a98864181e1b8ae3554caa3e
572211f97525fdc3ff317802ccc994fa086171c1
refs/heads/master
2021-01-10T06:34:15.748118
2015-12-25T15:23:15
2015-12-25T15:23:15
48,584,172
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package com.example.michael.finalproto; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "michael.a.feuerstein@gmail.com" ]
michael.a.feuerstein@gmail.com
7e14631d8ec39d66f67cb0992db3f782d9ea0680
cee0b81e31c8a07c1c97dc49abfc3884f9e418fd
/src/test/java/com/github/seratch/jslack/Slack_incomingWebhooks_Test.java
bf705b5485371a63650fde78c8cccd67a182e48f
[ "MIT" ]
permissive
sean-heller/jslack
b60a6d3b32561ad2e568c60ccb0178e483ab41ba
e86dc3acae850a054dd10a62739c040a223b0e72
refs/heads/master
2020-05-17T22:01:49.118763
2019-04-29T01:26:07
2019-04-29T01:26:07
183,988,426
0
0
null
2019-04-29T02:46:26
2019-04-29T02:46:26
null
UTF-8
Java
false
false
4,317
java
package com.github.seratch.jslack; import com.github.seratch.jslack.api.model.Attachment; import com.github.seratch.jslack.api.model.Field; import com.github.seratch.jslack.api.model.block.ActionsBlock; import com.github.seratch.jslack.api.model.block.LayoutBlock; import com.github.seratch.jslack.api.model.block.composition.PlainTextObject; import com.github.seratch.jslack.api.model.block.element.ButtonElement; import com.github.seratch.jslack.api.webhook.Payload; import com.github.seratch.jslack.api.webhook.WebhookResponse; import lombok.extern.slf4j.Slf4j; import org.junit.Test; import testing.SlackTestConfig; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; @Slf4j public class Slack_incomingWebhooks_Test { Slack slack = Slack.getInstance(SlackTestConfig.get()); @Test public void incomingWebhook() throws IOException { // String url = "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"; String url = System.getenv("SLACK_WEBHOOK_TEST_URL"); if (url == null) { throw new IllegalStateException("Environment variable SLACK_WEBHOOK_TEST_URL must be defined"); } Payload payload = Payload.builder() .channel("#random") .text("Hello World!") .iconEmoji(":smile_cat:") .username("jSlack") .attachments(new ArrayList<>()) .build(); Attachment attachment = Attachment.builder() .text("This is an *attachment*.") .authorName("Smiling Imp") .color("#36a64f") .fallback("Required plain-text summary of the attachment.") .title("Slack API Documentation") .titleLink("https://api.slack.com/") .footer("footer") .fields(new ArrayList<>()) .mrkdwnIn(new ArrayList<>()) .build(); attachment.getMrkdwnIn().add("text"); { Field field = Field.builder() .title("Long Title") .value("Long Value........................................................") .valueShortEnough(false).build(); attachment.getFields().add(field); attachment.getFields().add(field); } { Field field = Field.builder() .title("Short Title") .value("Short Value") .valueShortEnough(true).build(); attachment.getFields().add(field); attachment.getFields().add(field); } payload.getAttachments().add(attachment); WebhookResponse response = slack.send(url, payload); log.info(response.toString()); assertThat(response.getBody(), is("ok")); assertThat(response.getMessage(), is("OK")); assertThat(response.getCode(), is(200)); } @Test public void incomingWebhook_BlockKit() throws IOException { // String url = "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"; String url = System.getenv("SLACK_WEBHOOK_TEST_URL"); if (url == null) { throw new IllegalStateException("Environment variable SLACK_WEBHOOK_TEST_URL must be defined"); } Payload payload = Payload.builder() .channel("#random") .text("Hello World!") .iconEmoji(":smile_cat:") .username("jSlack") .blocks(new ArrayList<>()) .build(); ButtonElement button = ButtonElement.builder() .text(PlainTextObject.builder().emoji(true).text("Farmhouse").build()) .value("click_me_123") .build(); LayoutBlock block = ActionsBlock.builder().elements(Arrays.asList(button)).build(); payload.getBlocks().add(block); WebhookResponse response = slack.send(url, payload); log.info(response.toString()); assertThat(response.getBody(), is("ok")); assertThat(response.getMessage(), is("OK")); assertThat(response.getCode(), is(200)); } }
[ "seratch@gmail.com" ]
seratch@gmail.com
6a226d2e29984444eba268ce4e64e2b6c4648629
d480ceaf790db8cd4e599b210d434fb18f811e23
/src/main/java/com/jhipster/adminpanel/config/LiquibaseConfiguration.java
874986391938c2459b674a2f70d038bf9beebc79
[]
no_license
sumeyyeyegen/adminPanel
79b54e86e89d373d9c5039871a5f53ff5b5a55f8
9abc6a6d484aa68d3e240f2495fc2da631113427
refs/heads/main
2023-06-28T01:07:03.681538
2021-08-02T01:53:11
2021-08-02T01:53:11
391,645,017
0
0
null
null
null
null
UTF-8
Java
false
false
3,306
java
package com.jhipster.adminpanel.config; import java.util.concurrent.Executor; import javax.sql.DataSource; import liquibase.integration.spring.SpringLiquibase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.boot.autoconfigure.liquibase.LiquibaseDataSource; import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import org.springframework.core.env.Profiles; import tech.jhipster.config.JHipsterConstants; import tech.jhipster.config.liquibase.SpringLiquibaseUtil; @Configuration public class LiquibaseConfiguration { private final Logger log = LoggerFactory.getLogger(LiquibaseConfiguration.class); private final Environment env; public LiquibaseConfiguration(Environment env) { this.env = env; } @Bean public SpringLiquibase liquibase( @Qualifier("taskExecutor") Executor executor, @LiquibaseDataSource ObjectProvider<DataSource> liquibaseDataSource, LiquibaseProperties liquibaseProperties, ObjectProvider<DataSource> dataSource, DataSourceProperties dataSourceProperties ) { // If you don't want Liquibase to start asynchronously, substitute by this: // SpringLiquibase liquibase = SpringLiquibaseUtil.createSpringLiquibase(liquibaseDataSource.getIfAvailable(), liquibaseProperties, dataSource.getIfUnique(), dataSourceProperties); SpringLiquibase liquibase = SpringLiquibaseUtil.createAsyncSpringLiquibase( this.env, executor, liquibaseDataSource.getIfAvailable(), liquibaseProperties, dataSource.getIfUnique(), dataSourceProperties ); liquibase.setChangeLog("classpath:config/liquibase/master.xml"); liquibase.setContexts(liquibaseProperties.getContexts()); liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema()); liquibase.setLiquibaseSchema(liquibaseProperties.getLiquibaseSchema()); liquibase.setLiquibaseTablespace(liquibaseProperties.getLiquibaseTablespace()); liquibase.setDatabaseChangeLogLockTable(liquibaseProperties.getDatabaseChangeLogLockTable()); liquibase.setDatabaseChangeLogTable(liquibaseProperties.getDatabaseChangeLogTable()); liquibase.setDropFirst(liquibaseProperties.isDropFirst()); liquibase.setLabels(liquibaseProperties.getLabels()); liquibase.setChangeLogParameters(liquibaseProperties.getParameters()); liquibase.setRollbackFile(liquibaseProperties.getRollbackFile()); liquibase.setTestRollbackOnUpdate(liquibaseProperties.isTestRollbackOnUpdate()); if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE))) { liquibase.setShouldRun(false); } else { liquibase.setShouldRun(liquibaseProperties.isEnabled()); log.debug("Configuring Liquibase"); } return liquibase; } }
[ "sumeyyeyegen746@gmail.com" ]
sumeyyeyegen746@gmail.com
0bf7b68db20349deb2f31cfd2b9b108dfc4925c8
768e4aafa5e7174a112ab0769672e690d9a521b5
/app/src/main/java/cz/johnyapps/jecnakvkapse/Prichody/StahniPrichody.java
fa7ce314b444b5487651c063d8547198792bc4e0
[ "MIT" ]
permissive
JohnyDaDeveloper/Jecnakvkapse
06ba6e2e9c448ca1179ec6c87d28a0e6e2801105
0fdf8319e7d217f4b04faa8c096c8948c6ade596
refs/heads/master
2021-07-05T07:06:34.045940
2020-09-10T20:11:53
2020-09-10T20:11:53
172,211,790
2
0
null
null
null
null
UTF-8
Java
false
false
1,068
java
package cz.johnyapps.jecnakvkapse.Prichody; import androidx.annotation.Nullable; import cz.johnyapps.jecnakvkapse.HttpConnection.Connection; import cz.johnyapps.jecnakvkapse.HttpConnection.Request; import cz.johnyapps.jecnakvkapse.HttpConnection.StahniData; /** * Stáhne příchody * @see Connection */ public class StahniPrichody extends StahniData { /** * Inicializace */ public StahniPrichody() { } /** * Stáhne omluvenky přes {@link Connection} * @param obdobi Období které se má stáhnout */ public void stahni(@Nullable String obdobi) { Request request = new Request("absence/passing-student", "GET"); if (obdobi != null) { request.addObdobi(obdobi); } Connection connection = new Connection(); connection.setOnCompleteListener(new Connection.OnCompleteListener() { @Override public void onComplete(String result) { completed(result); } }); connection.execute(request); } }
[ "johnydadeveloper@gmail.com" ]
johnydadeveloper@gmail.com
c52a82083653ac566cef6485efed71e351c5e0e1
43c3e196bf5113ed4167284e8dea45c6a0589337
/lib-gwt-svg/tags/0.5.1/src/main/java/org/vectomatic/dom/svg/OMSVGDescElement.java
b1a9ad9bcb47c4938b0cf8d44cc0d55d0deb3423
[]
no_license
toxic88/vectomatic
1bdec743b7dd4a7c582a792630c5c106db96b418
aa4138b47cf0d080d7a3a4571798114f719ade30
refs/heads/master
2016-09-06T06:16:50.032347
2012-02-07T20:54:46
2012-02-07T20:54:46
33,423,929
0
0
null
null
null
null
UTF-8
Java
false
false
3,276
java
/********************************************** * Copyright (C) 2010 Lukas Laag * This file is part of lib-gwt-svg. * * libgwtsvg is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * libgwtsvg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with libgwtsvg. If not, see http://www.gnu.org/licenses/ **********************************************/ /* * Copyright (c) 2004 World Wide Web Consortium, * * (Massachusetts Institute of Technology, European Research Consortium for * Informatics and Mathematics, Keio University). All Rights Reserved. This * work is distributed under the W3C(r) Software License [1] 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. * * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 */ package org.vectomatic.dom.svg; import org.vectomatic.dom.svg.impl.SVGDescElement; import org.vectomatic.dom.svg.itf.ISVGLangSpace; import org.vectomatic.dom.svg.itf.ISVGStylable; import com.google.gwt.core.client.JavaScriptException; import com.google.gwt.dom.client.TagName; /** * The {@link org.vectomatic.dom.svg.OMSVGDescElement} interface corresponds * to the <a href='http://www.w3.org/TR/SVG11/struct.html#DescElement' title='desc * element specification'>desc</a> element. */ @TagName("desc") public class OMSVGDescElement extends OMSVGElement implements ISVGLangSpace, ISVGStylable { protected OMSVGDescElement(SVGDescElement ot) { super(ot); } // Implementation of the svg::SVGDescElement W3C IDL interface // Implementation of the svg::SVGLangSpace W3C IDL interface /** * Corresponds to attribute <code>xml:lang</code> on the given element. */ public final String getXmllang() { return ((SVGDescElement)ot).getXmllang(); } /** * Corresponds to attribute <code>xml:lang</code> on the given element. * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an attempt * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only * attribute</a>. */ public final void setXmllang(java.lang.String value) throws JavaScriptException { ((SVGDescElement)ot).setXmllang(value); } /** * Corresponds to attribute <code>xml:space</code> on the given element. */ public final String getXmlspace() { return ((SVGDescElement)ot).getXmlspace(); } /** * Corresponds to attribute <code>xml:space</code> on the given element. * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an attempt * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only * attribute</a>. */ public final void setXmlspace(java.lang.String value) throws JavaScriptException { ((SVGDescElement)ot).setXmlspace(value); } }
[ "laaglu@4ed4caa0-1436-11df-ad8c-0f209b884837" ]
laaglu@4ed4caa0-1436-11df-ad8c-0f209b884837
d1c815231a66dfdea04352a6609841ec4efb3e80
e3f7addc42a4adb86b454cf7496eb5b4eff96f0e
/src/main/java/com/learning/ThymeleafSpringSecurity/service/UserService.java
f68aea2eb683cb8354476c369c853385c714e668
[]
no_license
skudu95/springboot-thymeleaf-crud-operation
fd3af5ea862b3d9f74293dfe19c6b704a2318466
59675267a3abce9543eaf08380f2374ec8f69dce
refs/heads/main
2023-02-23T05:26:56.950592
2021-01-24T15:20:03
2021-01-24T15:20:03
332,479,099
0
0
null
null
null
null
UTF-8
Java
false
false
791
java
package com.learning.ThymeleafSpringSecurity.service; import com.learning.ThymeleafSpringSecurity.entity.User; import com.learning.ThymeleafSpringSecurity.model.MyUserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import java.util.List; public interface UserService extends UserDetailsService { public User findByUserName(String userName); // mistakenly called it in the UserRepository // public void save(User user); // for the new user registration public void save (MyUserDetails myUserDetails); public List<User> findAll(); public User findById(Long id); // for updating the registered user public void save(User user); public void deleteById(Long id); public List<User> searchBy(String name); }
[ "44142391+skudu95@users.noreply.github.com" ]
44142391+skudu95@users.noreply.github.com
7ba84566db9c653f84ebca9816487e6db8425d1e
863acb02a064a0fc66811688a67ce3511f1b81af
/sources/p005cm/aptoide/p006pt/view/C5549v.java
fbcede0b2b5438f9efaa9af1839f2f58bdc3b115
[ "MIT" ]
permissive
Game-Designing/Custom-Football-Game
98d33eb0c04ca2c48620aa4a763b91bc9c1b7915
47283462b2066ad5c53b3c901182e7ae62a34fc8
refs/heads/master
2020-08-04T00:02:04.876780
2019-10-06T06:55:08
2019-10-06T06:55:08
211,914,568
1
1
null
null
null
null
UTF-8
Java
false
false
629
java
package p005cm.aptoide.p006pt.view; import p026rx.p027b.C0132p; /* renamed from: cm.aptoide.pt.view.v */ /* compiled from: lambda */ public final /* synthetic */ class C5549v implements C0132p { /* renamed from: a */ private final /* synthetic */ DeepLinkManager f9362a; /* renamed from: b */ private final /* synthetic */ String f9363b; public /* synthetic */ C5549v(DeepLinkManager deepLinkManager, String str) { this.f9362a = deepLinkManager; this.f9363b = str; } public final Object call(Object obj) { return this.f9362a.mo16895a(this.f9363b, (Boolean) obj); } }
[ "tusharchoudhary0003@gmail.com" ]
tusharchoudhary0003@gmail.com
b56d2e1ddab0372dd811bb8af293e9f1864e1ca2
6fee22ba95f0e1742cb0f665db4777025cd0eaac
/hqc_mp/src/main/java/com/hqc/payforparking/ws/GetParkingLotInfo.java
38e91baedf90640a5d0559fd7f263475ed654b48
[]
no_license
Elegant-Smile/hqc_mp
c26f528cd90a821c3612cdfb623e4d0bc9ab2dc3
c8054d66917cd2357cdca108023cfc63117bde81
refs/heads/master
2020-07-31T19:41:08.922565
2019-09-02T01:28:08
2019-09-02T01:28:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,063
java
package com.hqc.payforparking.ws; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>anonymous complex type的 Java 类。 * * <p>以下模式片段指定包含在此类中的预期内容。 * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="appId" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="parkId" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "appId", "key", "parkId" }) @XmlRootElement(name = "GetParkingLotInfo") public class GetParkingLotInfo { protected int appId; protected String key; protected int parkId; /** * 获取appId属性的值。 * */ public int getAppId() { return appId; } /** * 设置appId属性的值。 * */ public void setAppId(int value) { this.appId = value; } /** * 获取key属性的值。 * * @return * possible object is * {@link String } * */ public String getKey() { return key; } /** * 设置key属性的值。 * * @param value * allowed object is * {@link String } * */ public void setKey(String value) { this.key = value; } /** * 获取parkId属性的值。 * */ public int getParkId() { return parkId; } /** * 设置parkId属性的值。 * */ public void setParkId(int value) { this.parkId = value; } }
[ "2434387555@qq.com" ]
2434387555@qq.com
c226c66e0f3aabb567ed23c3473ce7d7fadc1167
e92e7b704b6009c90c6c0025b80a5c151960c596
/egGroup_web/src/com/fooditem/model/FooditemVO.java
09282ac0ff3a6a9542c9d54514a22f683a46c00f
[]
no_license
bluetryit/eggroup
0848fe55eacb79a853bae21cb677d6c8a77dcd1c
67e5f2165ff8a79feeb254f1b3390a6285b3eca1
refs/heads/master
2023-03-28T09:59:43.901910
2021-03-25T14:21:34
2021-03-25T14:21:34
348,545,001
0
0
null
null
null
null
UTF-8
Java
false
false
1,913
java
package com.fooditem.model; import java.io.Serializable; public class FooditemVO implements Serializable { private String fo_no; private String fo_resno; private String fo_name; private Integer fo_price; private byte[] fo_img; private String fo_intro; private String fo_status; private Integer fo_quantity; // for 訂單使用 不存資料庫 public Integer getFo_quantity() { return fo_quantity; } public void setFo_quantity(Integer fo_quantity) { this.fo_quantity = fo_quantity; } public String getFo_no() { return fo_no; } public void setFo_no(String fo_no) { this.fo_no = fo_no; } public String getFo_resno() { return fo_resno; } public void setFo_resno(String fo_resno) { this.fo_resno = fo_resno; } public String getFo_name() { return fo_name; } public void setFo_name(String fo_name) { this.fo_name = fo_name; } public Integer getFo_price() { return fo_price; } public void setFo_price(Integer fo_price) { this.fo_price = fo_price; } public byte[] getFo_img() { return fo_img; } public void setFo_img(byte[] fo_img) { this.fo_img = fo_img; } public String getFo_intro() { return fo_intro; } public void setFo_intro(String fo_intro) { this.fo_intro = fo_intro; } public String getFo_status() { return fo_status; } public void setFo_status(String fo_status) { this.fo_status = fo_status; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((fo_no == null) ? 0 : fo_no.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; FooditemVO other = (FooditemVO) obj; if (fo_no == null) { if (other.fo_no != null) return false; } else if (!fo_no.equals(other.fo_no)) return false; return true; } }
[ "bluetryit@gmail.com" ]
bluetryit@gmail.com
bb39ecbb5d2786776cbc93057036452139ccbb7a
529ad47e9ff1f94c6006da9cf93d5238e6a1c21f
/app/src/main/java/com/me/noteapp/entity/Item.java
8f6fd28ca8f7319456962c955b439a1535c5dc8d
[]
no_license
igor961/NoteApp
93b0aef557e94ae3fcb7032e145c7fc3e91922fb
44bd175d8bcd2b2ec4ce642c0adc19bb91d866e8
refs/heads/master
2020-05-27T15:34:36.007876
2019-05-26T12:50:28
2019-05-26T12:50:28
188,682,716
0
0
null
null
null
null
UTF-8
Java
false
false
920
java
package com.me.noteapp.entity; import com.me.noteapp.annotation.Column; import com.me.noteapp.annotation.Id; import com.me.noteapp.config.DBType; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; public class Item implements Serializable { @Id @Column(type = DBType.INTEGER) private Date dAt; @Column(type = DBType.TEXT) private String content; private transient String date, time; public Item(Date dAt, String content) { this.dAt = dAt; this.content = content; this.time = new SimpleDateFormat("HH:mm").format(dAt); this.date = new SimpleDateFormat("dd/MM/yyyy").format(dAt); } public String getTime() { return time; } public String getDate() { return date; } public Date getdAt() { return dAt; } public String getContent() { return content; } }
[ "igor.shesterikov2017@gmail.com" ]
igor.shesterikov2017@gmail.com
e0b5a7db702fbf09348fe07847fcda1a3e01304e
30122de27bf7c822d84f0e7c2f8f77bf7be03833
/casacodigo/casacodigo/src/main/java/com/br/zup/casacodigo/cliente/ClienteRequest.java
42ee614bc125b40f3e08f41ee3ad8d9c1cfbede9
[ "Apache-2.0" ]
permissive
CaioNovoaAntunes/orange-talents-06-template-casa-do-codigo
ba6872f99d4ad42cc5afc435791270c65ce6d70e
21b7b5ff5797637c977d94b7d377f73b6f06774f
refs/heads/main
2023-06-12T23:49:11.322382
2021-07-05T09:26:53
2021-07-05T09:26:53
381,094,982
0
0
Apache-2.0
2021-06-28T18:35:19
2021-06-28T16:24:35
Java
UTF-8
Java
false
false
4,415
java
package com.br.zup.casacodigo.cliente; import com.br.zup.casacodigo.pais.Pais; import com.br.zup.casacodigo.pais.PaisRepository; import com.br.zup.casacodigo.pais.estado.Estado; import com.br.zup.casacodigo.pais.estado.EstadoRepository; import com.br.zup.casacodigo.validation.CPF_CNPJ; import com.br.zup.casacodigo.validation.CheckIfExist; import com.br.zup.casacodigo.validation.UniqueValue; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Optional; public class ClienteRequest { @NotBlank @UniqueValue(instanceClass = Cliente.class, field = "email") @Email private String email; @NotBlank private String nome; @NotBlank private String sobrenome; @CPF_CNPJ @NotBlank @UniqueValue(instanceClass = Cliente.class, field = "documento") private String documento; @NotNull @NotEmpty private String endereco; @NotNull @NotEmpty private String complemento; @NotNull @NotEmpty private String cidade; @NotNull @CheckIfExist(instanceClass = Pais.class, identityField = "id") private Long pais; @CheckIfExist(instanceClass = Estado.class, identityField = "id") private Long estado; @NotNull @NotEmpty private String telefone; @NotNull @NotEmpty private String cep; public ClienteRequest(){ } public ClienteRequest( @NotNull @NotEmpty @Email String email, @NotNull @NotEmpty String nome, @NotNull @NotEmpty String sobrenome, @NotNull @NotEmpty String documento, @NotNull @NotEmpty String endereco, String complemento, @NotNull @NotEmpty String cidade, @NotNull Long pais, Long estado, @NotNull @NotEmpty String telefone, @NotNull @NotEmpty String cep) { this.email = email; this.nome = nome; this.sobrenome = sobrenome; this.documento = documento; this.endereco = endereco; this.complemento = complemento; this.cidade = cidade; this.pais = pais; this.estado = estado; this.telefone = telefone; this.cep = cep; } public Cliente converter(PaisRepository paisRepository, EstadoRepository estadoRepository) { Optional<Pais> pais = paisRepository.findById(this.pais); Estado estadoInstance = null; if(this.estado != null){ estadoInstance = estadoRepository.findById(this.estado).get(); } return new Cliente(this.email, this.nome, this.sobrenome, this.documento, this.endereco, this.complemento, this.cidade, pais.get(), estadoInstance, this.telefone, this.cep); } public String getEmail() { return email; } public String getNome() { return nome; } public String getSobrenome() { return sobrenome; } public String getDocumento() { return documento; } public String getEndereco() { return endereco; } public String getComplemento() { return complemento; } public String getCidade() { return cidade; } public Long getPais() { return pais; } public Long getEstado() { return estado; } public String getTelefone() { return telefone; } public String getCep() { return cep; } @Override public String toString() { return "ClienteRequest{" + "email='" + email + '\'' + ", nome='" + nome + '\'' + ", sobrenome='" + sobrenome + '\'' + ", documento='" + documento + '\'' + ", endereco='" + endereco + '\'' + ", complemento='" + complemento + '\'' + ", cidade='" + cidade + '\'' + ", pais=" + pais + ", estado=" + estado + ", telefone='" + telefone + '\'' + ", cep='" + cep + '\'' + '}'; } }
[ "caio_novoa_antunes@mail.com" ]
caio_novoa_antunes@mail.com
94186ce536f36e25043118946f653c9088926589
402cb4158bec740601246b87383e5af88f4e9a81
/JavaWeb极客学院/MyBatis-dynamic-SQL_v1/MyBatis-dynamic-SQL/源码/MyBatis动态SQL/JiKeBook/src/jike/book/pojo/JiKeReader.java
44055f9b92ab101ada9dd3f100c399a8e51e9938
[]
no_license
YouXinxing/JavaStudy
0ed748a5d1485d7b7a601876dc074ac82628bfe2
dfd76f52852103a42ad0f4fffd8f7217ff1482ab
refs/heads/master
2020-06-25T03:26:50.616606
2019-01-25T02:29:45
2019-01-25T02:29:45
96,956,527
0
0
null
null
null
null
UTF-8
Java
false
false
546
java
package jike.book.pojo; /** * 读者表 * @author wsdhr * */ public class JiKeReader { private Integer readerID; private JiKeUser jikeUser; private Integer money; public Integer getReaderID() { return readerID; } public void setReaderID(Integer readerID) { this.readerID = readerID; } public JiKeUser getJikeUser() { return jikeUser; } public void setJikeUser(JiKeUser jikeUser) { this.jikeUser = jikeUser; } public Integer getMoney() { return money; } public void setMoney(Integer money) { this.money = money; } }
[ "741463339@qq.com" ]
741463339@qq.com
b21c05ce78b584f0a59b934146d441df581fb12b
8ff904870cb792b7eda5f5eb8a3367223cb4c406
/src/commands/Quotient.java
744b7c5e6bb943d491f3fd8b64ab53f622758144
[ "MIT" ]
permissive
santogrillo/SLogo
5370a4b4199b14b17118b4038404bbae8e5d392c
77024d887fbaee21eac4f21ba24eeba403842db5
refs/heads/master
2021-05-11T07:18:35.764876
2018-01-18T17:33:56
2018-01-18T17:33:56
118,015,372
0
0
null
null
null
null
UTF-8
Java
false
false
892
java
/** * @author Santo Grillo, Ben Welton */ package commands; import errors.ArgumentCountException; import errors.InvalidArgumentException; import errors.InvalidCommandException; import errors.MissingBracketException; import javafx.collections.ObservableList; import var.Variable; public class Quotient extends BasicCommand { public Quotient(String name, ObservableList<Variable> vars, ObservableList<UserCommand> methods) { super(name, vars, methods); setCumalative(true); } @Override public String executeCommand(TurtleDisplay td, CommandList commands, Integer id) throws NumberFormatException, ArgumentCountException, MissingBracketException, InvalidArgumentException, InvalidCommandException { double val = Double.parseDouble(nextCommandValue(td, commands, id)); double rem = Double.parseDouble(nextCommandValue(td, commands, id)); return Double.toString(val/rem); } }
[ "sdg12@duke.edu" ]
sdg12@duke.edu
860b9983e3a04ad6cbf8fe13224d2fd146ebbc16
98c83eb234ad4f0323bbf9c1f9d024a142fbfd3e
/ICS3UV/src/ca/elearningontario/tvdsb/day06/Practice2_7.java
aa4ccb61b874e10b84385c326a0454d5b323a026
[]
no_license
AlbertKang1004/ICS3U1
180947cefeb92b272b30bf8aa556687187ed3e43
c5213fb9519305717def34580538f8d715606709
refs/heads/master
2023-02-03T19:21:17.851655
2020-12-19T00:18:48
2020-12-19T00:18:48
322,732,614
0
0
null
null
null
null
UTF-8
Java
false
false
476
java
package ca.elearningontario.tvdsb.day06; import hsa_ufa.Console; import java.awt.*; public class Practice2_7 { static Console c = new Console(500, 500); public static void main(String[] args) { c.clear(); for (int x = 0, r = 50, g = 0, b = 100; x <= 500; x += 50, g += 10) { c.setColor(new Color(r, g, b)); c.fillRect(x, 0, 50, 50); for (int y = 0 ; y <= 500; y += 50) { c.setColor(new Color(r, g, b)); c.fillRect(x, y, 50, 50); } } } }
[ "gangjihu@localhost" ]
gangjihu@localhost
1e4ebebe2ea8687d01f4a9adb52e6bcad9ad2bf9
26d702d555237809aead3b63d87ce6fe7ca11230
/Challenges/Basic Challenges/src/com/rockkim/Main.java
422af57ca801c121521dcfe14f87080926025e4e
[]
no_license
rponnk/helloJava
28dd5fceb760c141d20cfbb2f0704b7199134e81
e16eb74f7134fdb4108b1a4bdb9ccde185ce39ab
refs/heads/master
2020-04-21T10:43:35.932550
2019-03-20T03:11:54
2019-03-20T03:11:54
169,494,768
0
0
null
null
null
null
UTF-8
Java
false
false
1,808
java
package com.rockkim; public class Main { public static void main(String[] args) { // write your code here // disHiScore("ollie", 4); // System.out.println(shouldWakeUp(true, -1)); // System.out.println(hasTeen(11, 12, 13)); System.out.println(sumDigits(10)); //parsing string as an interger String numberAsString = "2018"; System.out.println(numberAsString); int number = Integer.parseInt(numberAsString); System.out.println(number - 2); //end of parsing of string to int } // public static void disHiScore(String name, int place) { // switch (place) { // case 1: // System.out.println("1st"); // break; // case 2: // System.out.println("2nd"); // break; // case 3: // System.out.println("3rd"); // break; // default: // System.out.println(name + " got " + place + " place, no recognition"); // } // } public static boolean shouldWakeUp(boolean barking, int hourOfDay) { if(barking == true) { if((hourOfDay < 8 || hourOfDay > 22) && (hourOfDay >= 0 && hourOfDay <=23)) { return true; } } return false; } public static boolean hasTeen(int num1, int num2, int num3) { return ((num1 >= 13 && num1 <= 19) || (num2 >= 13 && num2 <= 19) || (num3 >= 13 && num3 <= 19)); } public static int sumDigits(int number) { int sum = 0; if(number >= 10) { for(int i = 10; i <= number; i++) { sum += i; System.out.println(i); } return sum; } return -1; } }
[ "rponnk@users.noreply.github.com" ]
rponnk@users.noreply.github.com
f2cb256931e474f27ef045114fb9ecdc641cf7c6
77c6343f356fe4516c3a96d19dacc0224e34c5b5
/src/com/jhlabs/image/BinaryFilter.java
e51395fd165280811e43177700e7a1c9a658b136
[]
no_license
jimomulloy/eve
00344ed0a585d22fd2885040c79ee6d0eb6acd15
2ff987dfb97e17a0606bf85ced66a341db0b3f95
refs/heads/master
2021-01-02T08:57:50.353412
2015-07-14T09:19:10
2015-07-14T09:19:10
39,065,055
0
0
null
null
null
null
UTF-8
Java
false
false
932
java
/* * Copyright (C) Jerry Huxtable 1998 */ package com.jhlabs.image; import java.awt.*; import java.awt.image.*; import com.jhlabs.math.*; public class BinaryFilter extends WholeImageFilter { protected int newColor = 0xff000000; protected BinaryFunction blackFunction = new BlackFunction(); protected int iterations = 1; protected Colormap colormap; public void setIterations(int iterations) { this.iterations = iterations; } public int getIterations() { return iterations; } public void setColormap(Colormap colormap) { this.colormap = colormap; } public Colormap getColormap() { return colormap; } public void setNewColor(int newColor) { this.newColor = newColor; } public int getNewColor() { return newColor; } public void setBlackFunction(BinaryFunction blackFunction) { this.blackFunction = blackFunction; } public BinaryFunction getBlackFunction() { return blackFunction; } }
[ "jimomulloy@gmail.com" ]
jimomulloy@gmail.com
13ca948c592f5059e1e6fa5add90241ea528077e
0744d73d0d136cbd3690c2aa7cf8f6661d8c72d9
/src/main/java/avarielbuilder/blocks/decoration/fixed/Barrel.java
c2ddec99a96dde388a8c4c1bd2ad5fe211190936
[]
no_license
LegendsOfAvariel/AvarielBuilder
783b7feb94e2c6ae6eda1b1b827ea2ce20a01a4f
e8362c84a4cc83c69284a5dd045601bd1e31400d
refs/heads/master
2021-01-13T16:28:51.165511
2017-07-14T14:18:23
2017-07-14T14:18:23
79,489,983
0
0
null
null
null
null
UTF-8
Java
false
false
476
java
package avarielbuilder.blocks.decoration.fixed; import avarielbuilder.templates.AAvarielDecoFixed; import net.minecraft.block.material.Material; import net.minecraft.item.ItemBlock; public class Barrel extends AAvarielDecoFixed { private final ItemBlock barrelItem; public Barrel() { super("barrel", Material.WOOD); barrelItem = (ItemBlock) new ItemBlock(this).setRegistryName("barrel"); } @Override public ItemBlock getItemBlock() { return barrelItem; } }
[ "roxthewizard@gmail.com" ]
roxthewizard@gmail.com
78a5cae8e04130a9655111fab6f85f1ee06b8153
6b9676c11dff925fa80489b740581762f0cf86cd
/Project/src/main/java/it/polimi/ingsw/server/model/godcards/BooleanRequestAction.java
194c19a94237ed8559bdc105df59f857e817f23f
[]
no_license
BorghettiMatteo/ing-sw-2019-Armillotta-Anese-Borghetti
1b8f05f6119143c2e7a6a4a605383dd0170e5425
8a4d5bf0debd453f02ba9aa27ac46029af9ed097
refs/heads/master
2022-11-22T04:10:10.053642
2020-07-03T21:47:51
2020-07-03T21:47:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
464
java
package it.polimi.ingsw.server.model.godcards; import it.polimi.ingsw.server.controller.Controller; /** * manage boolean requests for particular gods with BooleanRequestActionStrategy */ public interface BooleanRequestAction { /** * * @param controller use controller to execute a particular power * @param booleanChoice contains the reply in Boolean */ void BooleanRequestStrategy(Controller controller,Boolean booleanChoice); }
[ "matteo1.borghetti@mail.polimi.it" ]
matteo1.borghetti@mail.polimi.it
ff1cc5c2855209744c3b07039afc4a11f523cad3
cfcebeeb31b59e85a5bded9749c2df8c6e361daf
/src/main/java/com/pri/messenger/server/DataWaiter.java
febdabdb1ed1c2d7766c988e6ee2edd3e78edbaa
[]
no_license
mikegostev/Commons
f4a4cd6504347c77b83a3689b4a519dff4e0d9e9
5ff70df51258db766d57bcdea0d8ccd5448f346d
refs/heads/master
2021-07-03T16:46:05.941603
2017-04-18T16:05:19
2017-04-18T16:05:19
632,355
1
4
null
2020-10-13T09:40:28
2010-04-27T22:23:54
Java
UTF-8
Java
false
false
1,122
java
package com.pri.messenger.server; public class DataWaiter { private static final long MAX_WAIT_TIME_MSEC=60*1000; private boolean busy; private Object data; private String dest,meth; public DataWaiter() { } public synchronized void waitData() { busy=true; data=null; try { wait(MAX_WAIT_TIME_MSEC); } catch (InterruptedException e) { } busy=false; } public synchronized boolean dataReady( String d, String m, Object o ) { data=o; dest=d; meth=m; if( busy ) notify(); else return false; return true; } public synchronized void releaseWaiter() { if( busy ) notify(); } public synchronized boolean isBusy() { return busy; } public synchronized Object getData() { busy=true; data = null; try { wait(MAX_WAIT_TIME_MSEC); } catch (InterruptedException e) { } busy = false; Object o = data; data = null; return o; } public String getDestination() { return dest; } public String getMethod() { return meth; } }
[ "gostev@ebi.ac.uk" ]
gostev@ebi.ac.uk
735ea18fc21f7b121e97f94f5e6698426de1bc6b
9f4a817f745916a1da9d301a7ebaa924f9594c90
/ex00_Spring/Teacher_190201/spring_mvc/Src_DI_AOP/kosta/MySQLDao.java
a8cc11acd6c9629f5a54a0664254254b3f637e7f
[]
no_license
tncnsfs/kosta_Spring-ex0203
e375fe1826cfbb95049b75ad4900ca0122d49abb
67209fa5247425c7422702e4e580ec56d6ea9e4f
refs/heads/master
2020-04-18T05:49:01.203567
2019-02-15T09:00:25
2019-02-15T09:00:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
256
java
package kosta; import org.springframework.stereotype.Repository; //@Controller, @Service @Repository, @Conponent public class MySQLDao implements Dao { @Override public void insertBoard() { System.out.println("MySQLDao insertBoard()호출"); } }
[ "tncnsfs@gmail.com" ]
tncnsfs@gmail.com
da8ad52b6bd1a0da08b966c5fe1ceabada3b2d4c
d01e5eee9f11028c2207b916df209b1bda4670d1
/app/src/main/java/com/example/hangman/MainActivity.java
350bc8ac25723474143643c23cffcae82d0ddfe3
[]
no_license
ProdanR/HangMan
1e64d071ae54f91a535a015c60736922dfc132b6
49d8663e8d205b5ddb92e00efa3c87f80430b3da
refs/heads/main
2023-04-18T20:54:10.191855
2021-05-04T10:04:08
2021-05-04T10:04:08
356,947,097
0
0
null
null
null
null
UTF-8
Java
false
false
2,318
java
package com.example.hangman; import androidx.appcompat.app.AppCompatActivity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; public class MainActivity extends AppCompatActivity { private EditText name_c,age_c; private Button male_b,female_b; private String name, age; boolean male=false,female=false; private static User user; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); name_c= (EditText) findViewById(R.id.username); age_c= (EditText) findViewById(R.id.age); male_b= (Button) findViewById(R.id.male); female_b= (Button) findViewById(R.id.female); } public void setFemale(View view) { this.male=false; this.female=true; male_b.setBackgroundColor(Color.rgb(86, 128, 233)); female_b.setBackgroundColor(Color.rgb(93, 200, 228)); } public void setMale(View view) { this.male=true; this.female=false; male_b.setBackgroundColor(Color.rgb(93, 200, 228)); female_b.setBackgroundColor(Color.rgb(86, 128, 233)); } public void play(View view) { name = name_c.getText().toString(); age = age_c.getText().toString(); if (name.isEmpty() || age.isEmpty() || (male==false && female==false)) error(); else { user = new User(age, name, male, female); Intent gameIntent = new Intent(MainActivity.this, Game.class); startActivity(gameIntent); } } public void error(){ AlertDialog.Builder error = new AlertDialog.Builder(this); error.setTitle("Date invalide!"); error.setMessage("Completati toate campurile"); error.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); error.create().show(); } public static User getUser() { return user; } }
[ "prodan_raul14@yahoo.com" ]
prodan_raul14@yahoo.com
ca470954c92d20ff97a0836cc810f311143144c4
72f382e7bf69adcb6da9880d24d7bf5b4f6b94e8
/src/client/java/mousio/client/retry/RetryNTimes.java
4570fa05478ac8cd5150719c09cb00c622fc41ed
[ "Apache-2.0" ]
permissive
mcdan/etcd4j
d466ab1ac12db91a88eeca7d6032bd9b109e6a5b
187491f1e6897363dd40fc3caa696f1d37471877
refs/heads/master
2021-01-18T00:17:35.798144
2014-10-17T11:44:54
2014-10-17T11:44:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
606
java
package mousio.client.retry; import mousio.client.ConnectionState; /** * Will retry the command N number of times */ public class RetryNTimes extends RetryPolicy { private final int timesToRetry; /** * Constructor * * @param msBeforeRetry milliseconds before retrying * @param timesToRetry number of times to retry */ public RetryNTimes(int msBeforeRetry, int timesToRetry) { super(msBeforeRetry); this.timesToRetry = timesToRetry; } @Override public boolean shouldRetry(ConnectionState connectionState) { return connectionState.retryCount < timesToRetry; } }
[ "jurmous@jurmo.us" ]
jurmous@jurmo.us
8e4c790c123c28ee2ded85177679418a0fc8ef75
0ebaaf21f0445c571a92915c2b284c1a50cff528
/src/com/example/eduhub/CreateTimeTable.java
b6c49aeea9f00ff8eaa233f88712be2fb0d4c9b3
[]
no_license
nakulshukla/EduHub
b94849ec5854b47fc6016b39236a9fcb2086afb2
268386dda04d37c89e4bbcf94ea367161550a073
HEAD
2016-09-08T01:57:00.922113
2014-02-06T04:05:24
2014-02-06T04:05:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
16,268
java
package com.example.eduhub; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.text.InputType; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.HorizontalScrollView; import android.widget.LinearLayout; import android.widget.ScrollView; import android.widget.TableLayout; import android.widget.TableRow; import android.widget.TableRow.LayoutParams; import android.widget.TextView; public class CreateTimeTable extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_create_time_table); // Get the message from the intent int j; Intent intent = getIntent(); String message = intent.getStringExtra(NewTT.EXTRA_MESSAGE); String message2 = intent.getStringExtra(NewTT.EXTRA_MESSAGE2); int lec = Integer.parseInt(message); int day = Integer.parseInt(message2); ScrollView sv = new ScrollView(this); sv.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT)); TableLayout ll=new TableLayout(this); HorizontalScrollView hsv = new HorizontalScrollView(this); int t=0; if(day==1) {for(int i=0;i<=lec;i++) { TableRow trow=new TableRow(this); if(i==0) { TextView tv1=new TextView(this); TextView tv2=new TextView(this); tv1.setText("TIME"); tv1.setId(101); tv1.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv1); tv2.setText("MONDAY"); tv2.setId(102); tv2.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv2); } else {EditText e1=new EditText(this); e1.setInputType(InputType.TYPE_DATETIME_VARIATION_TIME); e1.setId(t); t++; e1.setBackgroundResource(R.drawable.cell_shape); trow.addView(e1); EditText e2=new EditText(this); e2.setId(t); t++; e2.setBackgroundResource(R.drawable.cell_shape); trow.addView(e2); } ll.addView(trow); View v = new View(this); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 5); v.setLayoutParams(params); v.setBackgroundColor(getResources().getColor(android.R.color.transparent)); ll.addView(v); } } else if(day==2) {for(int i=0;i<=lec;i++) { TableRow trow=new TableRow(this); if(i==0) { TextView tv1=new TextView(this); TextView tv2=new TextView(this); TextView tv3=new TextView(this); tv1.setText("TIME"); tv1.setId(101); tv1.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv1); tv2.setText("MONDAY"); tv2.setId(102); tv2.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv2); tv3.setText("TUESDAY"); tv3.setId(103); tv3.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv3); } else {EditText e1=new EditText(this); e1.setId(t); t++; e1.setBackgroundResource(R.drawable.cell_shape); trow.addView(e1); EditText e2=new EditText(this); e2.setId(t); t++; e2.setBackgroundResource(R.drawable.cell_shape); trow.addView(e2); EditText e3=new EditText(this); e3.setId(t); t++; e3.setBackgroundResource(R.drawable.cell_shape); trow.addView(e3); } ll.addView(trow); View v = new View(this); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 5); v.setLayoutParams(params); v.setBackgroundColor(getResources().getColor(android.R.color.transparent)); ll.addView(v); } } else if(day==3) {for(int i=0;i<=lec;i++) { TableRow trow=new TableRow(this); if(i==0) { TextView tv1=new TextView(this); TextView tv2=new TextView(this); TextView tv3=new TextView(this); TextView tv4=new TextView(this); tv1.setText("TIME"); tv1.setId(101); tv1.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv1); tv2.setText("MONDAY"); tv2.setId(102); tv2.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv2); tv3.setText("TUESDAY"); tv3.setId(103); tv3.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv3); tv4.setText("WEDNESDAY"); tv4.setId(104); tv4.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv4); } else { EditText e1=new EditText(this); e1.setId(t); t++; e1.setBackgroundResource(R.drawable.cell_shape); trow.addView(e1); EditText e2=new EditText(this); e2.setId(t); t++; e2.setBackgroundResource(R.drawable.cell_shape); trow.addView(e2); EditText e3=new EditText(this); e3.setId(t); t++; e3.setBackgroundResource(R.drawable.cell_shape); trow.addView(e3); EditText e4=new EditText(this); e4.setId(t); t++; e4.setBackgroundResource(R.drawable.cell_shape); trow.addView(e4); } ll.addView(trow); View v = new View(this); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 5); v.setLayoutParams(params); v.setBackgroundColor(getResources().getColor(android.R.color.transparent)); ll.addView(v); } } else if(day==4) {for(int i=0;i<=lec;i++) { TableRow trow=new TableRow(this); if(i==0) { TextView tv1=new TextView(this); TextView tv2=new TextView(this); TextView tv3=new TextView(this); TextView tv4=new TextView(this); TextView tv5=new TextView(this); tv1.setText("TIME"); tv1.setId(101); tv1.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv1); tv2.setText("MONDAY"); tv2.setId(102); tv2.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv2); tv3.setText("TUESDAY"); tv3.setId(103); tv3.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv3); tv4.setText("WEDNESDAY"); tv4.setId(104); tv4.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv4); tv5.setText("THURSDAY"); tv5.setId(102); tv5.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv5); } else { EditText e1=new EditText(this); e1.setId(t); t++; e1.setBackgroundResource(R.drawable.cell_shape); trow.addView(e1); EditText e2=new EditText(this); e2.setId(t); t++; e2.setBackgroundResource(R.drawable.cell_shape); trow.addView(e2); EditText e3=new EditText(this); e3.setId(t); t++; e3.setBackgroundResource(R.drawable.cell_shape); trow.addView(e3); EditText e4=new EditText(this); e4.setId(t); t++; e4.setBackgroundResource(R.drawable.cell_shape); trow.addView(e4); EditText e5=new EditText(this); e5.setId(t); t++; e5.setBackgroundResource(R.drawable.cell_shape); trow.addView(e5); } ll.addView(trow); View v = new View(this); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 5); v.setLayoutParams(params); v.setBackgroundColor(getResources().getColor(android.R.color.transparent)); ll.addView(v); } } else if(day==5) {for(int i=0;i<=lec;i++) { TableRow trow=new TableRow(this); if(i==0) { TextView tv1=new TextView(this); TextView tv2=new TextView(this); TextView tv3=new TextView(this); TextView tv4=new TextView(this); TextView tv5=new TextView(this); TextView tv6=new TextView(this); tv1.setText("TIME"); tv1.setId(101); tv1.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv1); tv2.setText("MONDAY"); tv2.setId(102); tv2.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv2); tv3.setText("TUESDAY"); tv3.setId(103); tv3.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv3); tv4.setText("WEDNESDAY"); tv4.setId(104); tv4.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv4); tv5.setText("THURSDAY"); tv5.setId(102); tv5.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv5); tv6.setText("FRIDAY"); tv6.setId(102); tv6.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv6); } else { EditText e1=new EditText(this); e1.setId(t); t++; e1.setBackgroundResource(R.drawable.cell_shape); trow.addView(e1); EditText e2=new EditText(this); e2.setId(t); t++; e2.setBackgroundResource(R.drawable.cell_shape); trow.addView(e2); EditText e3=new EditText(this); e3.setId(t); t++; e3.setBackgroundResource(R.drawable.cell_shape); trow.addView(e3); EditText e4=new EditText(this); e4.setId(t); t++; e4.setBackgroundResource(R.drawable.cell_shape); trow.addView(e4); EditText e5=new EditText(this); e5.setId(t); t++; e5.setBackgroundResource(R.drawable.cell_shape); trow.addView(e5); EditText e6=new EditText(this); e6.setId(t); t++; e6.setBackgroundResource(R.drawable.cell_shape); trow.addView(e6); } ll.addView(trow); View v = new View(this); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 5); v.setLayoutParams(params); v.setBackgroundColor(getResources().getColor(android.R.color.transparent)); ll.addView(v); } } else if(day==6) {for(int i=0;i<=lec;i++) { TableRow trow=new TableRow(this); if(i==0) { TextView tv1=new TextView(this); TextView tv2=new TextView(this); TextView tv3=new TextView(this); TextView tv4=new TextView(this); TextView tv5=new TextView(this); TextView tv6=new TextView(this); TextView tv7=new TextView(this); tv1.setText("TIME"); tv1.setId(101); tv1.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv1); tv2.setText("MONDAY"); tv2.setId(102); tv2.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv2); tv3.setText("TUESDAY"); tv3.setId(103); tv3.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv3); tv4.setText("WEDNESDAY"); tv4.setId(104); tv4.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv4); tv5.setText("THURSDAY"); tv5.setId(102); tv5.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv5); tv6.setText("FRIDAY"); tv6.setId(102); tv6.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv6); tv7.setText("SATURDAY"); tv7.setId(102); tv7.setBackgroundResource(R.drawable.cell_shape); trow.addView(tv7); } else { EditText e1=new EditText(this); e1.setId(t); t++; e1.setBackgroundResource(R.drawable.cell_shape); trow.addView(e1); EditText e2=new EditText(this); e2.setId(t); t++; e2.setBackgroundResource(R.drawable.cell_shape); trow.addView(e2); EditText e3=new EditText(this); e3.setId(t); t++; e3.setBackgroundResource(R.drawable.cell_shape); trow.addView(e3); EditText e4=new EditText(this); e4.setId(t); t++; e4.setBackgroundResource(R.drawable.cell_shape); trow.addView(e4); EditText e5=new EditText(this); e5.setId(t); t++; e5.setBackgroundResource(R.drawable.cell_shape); trow.addView(e5); EditText e6=new EditText(this); e6.setId(t); t++; e6.setBackgroundResource(R.drawable.cell_shape); trow.addView(e6); EditText e7=new EditText(this); e7.setId(t); t++; e7.setBackgroundResource(R.drawable.cell_shape); trow.addView(e7); } ll.addView(trow); View v = new View(this); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 5); v.setLayoutParams(params); v.setBackgroundColor(getResources().getColor(android.R.color.transparent)); ll.addView(v); } } hsv.addView(ll); sv.addView(hsv); setContentView(sv); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.create_time_table, menu); return true; } }
[ "ruchika2405@gmail.com" ]
ruchika2405@gmail.com
45af26e757306d0ed5e4e34ec2ff5f1c86aadcfa
1ade8e4f69d5274455667465e1d27f1b5b224c87
/src/kangyuanquan/src/main/java/com/halfwanybus/service/fhoa/department/impl/DepartmentService.java
acc4beb88a7f3975f3609b4339b3cfa4814d91d0
[]
no_license
HalfwayBus/FlowerTakeout
540819d96175b0e9a1c2ee7f96c4439fa71a97ff
1fc9a8fccd0005df8ab903c0ef06b434a9601821
refs/heads/master
2020-12-24T06:16:27.993843
2016-12-12T02:03:34
2016-12-12T02:03:34
73,482,233
3
1
null
null
null
null
UTF-8
Java
false
false
2,621
java
package com.halfwanybus.service.fhoa.department.impl; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.halfwanybus.dao.DaoSupport; import com.halfwanybus.entity.Page; import com.halfwanybus.entity.system.Department; import com.halfwanybus.util.PageData; import com.halfwanybus.service.fhoa.department.DepartmentManager; /** * 说明: 组织机构 * 创建人:liangzhilin * 创建时间:2015-12-16 * @version */ @Service("departmentService") public class DepartmentService implements DepartmentManager{ @Resource(name = "daoSupport") private DaoSupport dao; /**新增 * @param pd * @throws Exception */ public void save(PageData pd)throws Exception{ dao.save("DepartmentMapper.save", pd); } /**删除 * @param pd * @throws Exception */ public void delete(PageData pd)throws Exception{ dao.delete("DepartmentMapper.delete", pd); } /**修改 * @param pd * @throws Exception */ public void edit(PageData pd)throws Exception{ dao.update("DepartmentMapper.edit", pd); } /**列表 * @param page * @throws Exception */ @SuppressWarnings("unchecked") public List<PageData> list(Page page)throws Exception{ return (List<PageData>)dao.findForList("DepartmentMapper.datalistPage", page); } /**通过id获取数据 * @param pd * @throws Exception */ public PageData findById(PageData pd)throws Exception{ return (PageData)dao.findForObject("DepartmentMapper.findById", pd); } /**通过编码获取数据 * @param pd * @throws Exception */ public PageData findByBianma(PageData pd)throws Exception{ return (PageData)dao.findForObject("DepartmentMapper.findByBianma", pd); } /** * 通过ID获取其子级列表 * @param parentId * @return * @throws Exception */ @SuppressWarnings("unchecked") public List<Department> listSubDepartmentByParentId(String parentId) throws Exception { return (List<Department>) dao.findForList("DepartmentMapper.listSubDepartmentByParentId", parentId); } /** * 获取所有数据并填充每条数据的子级列表(递归处理) * @param MENU_ID * @return * @throws Exception */ public List<Department> listAllDepartment(String parentId) throws Exception { List<Department> departmentList = this.listSubDepartmentByParentId(parentId); for(Department depar : departmentList){ depar.setTreeurl("department/list.do?DEPARTMENT_ID="+depar.getDEPARTMENT_ID()); depar.setSubDepartment(this.listAllDepartment(depar.getDEPARTMENT_ID())); depar.setTarget("treeFrame"); } return departmentList; } }
[ "410486047@qq.com" ]
410486047@qq.com
06a824bc5203461d232e6bd5f0109f7cd6d99c63
e82c1473b49df5114f0332c14781d677f88f363f
/MED-CLOUD/med-service/src/main/java/nta/med/service/ihis/handler/ocso/OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultHandler.java
23621e5434b1251c8f06aa94563169b015a07c2a
[]
no_license
zhiji6/mih
fa1d2279388976c901dc90762bc0b5c30a2325fc
2714d15853162a492db7ea8b953d5b863c3a8000
refs/heads/master
2023-08-16T18:35:19.836018
2017-12-28T09:33:19
2017-12-28T09:33:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,148
java
package nta.med.service.ihis.handler.ocso; import java.util.Date; import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.vertx.java.core.Vertx; import nta.med.core.utils.DateUtil; import nta.med.data.dao.medi.ocs.Ocs0503Repository; import nta.med.core.infrastructure.socket.handler.ScreenHandler; import nta.med.service.ihis.proto.CommonModelProto.LoadConsultEndYNInfo; import nta.med.service.ihis.proto.CommonModelProto.NoConfirmConsultInfo; import nta.med.service.ihis.proto.OcsoServiceProto; @Service @Scope("prototype") public class OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultHandler extends ScreenHandler<OcsoServiceProto.OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultRequest, OcsoServiceProto.OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultResponse> { private static final Log LOGGER = LogFactory.getLog(OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultHandler.class); @Resource private Ocs0503Repository ocs0503Repository; @Override @Transactional(readOnly = true) public OcsoServiceProto.OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultResponse handle(Vertx vertx, String clientId, String sessionId, long contextId, OcsoServiceProto.OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultRequest request) throws Exception { OcsoServiceProto.OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultResponse.Builder response = OcsoServiceProto.OCS1003P01LoadConsultEndYnAndIsNoConfirmConsultResponse.newBuilder(); String hospCode = getHospitalCode(vertx, sessionId); boolean colsultYn = false; LoadConsultEndYNInfo info = request.getItemInfo(); Date maxReqDate = ocs0503Repository.getLoadConsultEndYN(hospCode, info.getBunho(), info.getReqDoctor()); if(maxReqDate != null){ response.setReqDate(DateUtil.toString(maxReqDate, DateUtil.PATTERN_YYMMDD)); } NoConfirmConsultInfo cosultInfo = request.getConfirmConsultInfo(); Date naewonDate = DateUtil.toDate(cosultInfo.getNaewondate(), DateUtil.PATTERN_YYMMDD); String result = ocs0503Repository.getNoConfirmConsult(hospCode, cosultInfo.getBunho(), naewonDate, cosultInfo.getGwa(), cosultInfo.getDoctor(), cosultInfo.getIoGubun()); if("Y".equals(result)){ colsultYn = true; } response.setIsNoReturnConsultYn(colsultYn); return response.build(); } }
[ "duc_nt@nittsusystem-vn.com" ]
duc_nt@nittsusystem-vn.com
cf280a0e3b1bde6a95eb0e3efbdab00ef4264f6e
07dc7c560e59f6680851cc3ae4ea4bc4ddbd7702
/src/main/java/com/greglturnquist/links/DatabaseLoader.java
d0f0e97adf7fa38bce7b47961c8561fe7d43a13b
[]
no_license
avinashsaraogi/spring-data-rest-with-custom-links
b7b4a685ed65b473e9d88fa85da9c4f266534131
e5e69f6946b868b621e7c25ce0462513455e622c
refs/heads/master
2020-04-28T17:48:41.044007
2017-10-03T16:49:43
2017-10-03T16:49:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,116
java
/* * Copyright 2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.greglturnquist.links; import org.springframework.boot.CommandLineRunner; import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; /** * @author Greg Turnquist */ @Component public class DatabaseLoader { @Bean CommandLineRunner initDatabase(EmployeeRepository repository) { return args -> { repository.save(new Employee("Frodo", "Baggins", "ring bearer")); repository.save(new Employee("Bilbo", "Baggins", "burglar")); }; } }
[ "gturnquist@pivotal.io" ]
gturnquist@pivotal.io
9b253ee537083c1e5311290e16dec0da8dea2b1d
83ada9f3ee0cfbed4dc3988dd6185aed69514b66
/src/main/java/gov/goias/agrodefesa/defesaSanitariaVegetal/unidadeProducao/navigation/NavigationUnidadeProducao.java
831dff9f9b3c2bb015e0e590c3341192a0ac5167
[]
no_license
wpsouto/sidago-teste
69d0ac570ef21705f0e5bfc0dd776d2df90272c5
3bab33a8f238c675ce7b475305b6e02faa9198cc
refs/heads/master
2020-12-20T12:44:00.678348
2016-08-08T17:59:43
2016-08-08T17:59:43
54,506,531
0
0
null
null
null
null
UTF-8
Java
false
false
1,900
java
package gov.goias.agrodefesa.defesaSanitariaVegetal.unidadeProducao.navigation; import gov.goias.agrodefesa.admin.navigation.NavegacaoFactory; import gov.goias.agrodefesa.base.annotation.Navigation; import gov.goias.agrodefesa.base.annotation.NavigationDependency; import gov.goias.agrodefesa.base.annotation.NavigationType; import gov.goias.agrodefesa.base.navigation.NavigationBase; import gov.goias.agrodefesa.constants.Action; import gov.goias.agrodefesa.defesaSanitariaVegetal.unidadeProducao.entity.UnidadeProducao; import gov.goias.agrodefesa.defesaSanitariaVegetal.unidadeProducao.view.UnidadeProducaoViewEdit; import gov.goias.agrodefesa.defesaSanitariaVegetal.unidadeProducao.view.UnidadeProducaoViewHome; import gov.goias.agrodefesa.defesaSanitariaVegetal.unidadeProducao.view.UnidadeProducaoViewInsert; import gov.goias.agrodefesa.fiscalizacao.termoFiscalizacao.entity.TermoFiscalizacao; import gov.goias.agrodefesa.fiscalizacao.termoFiscalizacao.navigation.NavigationTermoFiscalizacao; import gov.goias.agrodefesa.utils.NavegacaoType; /** * Created by usuario on 10/03/16. * * */ @Navigation(home = UnidadeProducaoViewHome.class, insert = UnidadeProducaoViewInsert.class, edit = UnidadeProducaoViewEdit.class, entity = UnidadeProducao.class) @NavigationType(label = "Unidade de Produção", modulo = NavegacaoType.DEFESA_SANITARIA_VEGETAL, url = "unidade-producao") @NavigationDependency(dependence = NavigationTermoFiscalizacao.class, actions = {Action.HOME, Action.INSERT, Action.MENSAGEM_INSERT, Action.SEARCH}) public class NavigationUnidadeProducao extends NavigationBase { public UnidadeProducao getEntity() { return (UnidadeProducao) entity; } @Override public void dependency() { super.dependency(); getEntity().setTermoFiscalizacao((TermoFiscalizacao) NavegacaoFactory.getNavigator().getEntity(TermoFiscalizacao.class)); } }
[ "wpsouto@gmail.com" ]
wpsouto@gmail.com
4785bc6320a08daeacc62dd421ece32cf75034b9
bda1a7f1fd2071dce66c2892219cbdc91a00fab4
/src/org/yun/app/servlet/SettlementServlet.java
640720328c3c09a5c3b8ff48633799007837e43e
[]
no_license
HelloIrene/Yun3C
f17a153107b746af9c21cf2a9d93e5fdd8a1b4c4
b1966eba06ec925e2fbba66f00bd205a8a5afee1
refs/heads/master
2021-08-22T22:12:49.148413
2017-12-01T12:20:17
2017-12-01T12:20:17
112,713,478
0
0
null
null
null
null
UTF-8
Java
false
false
3,143
java
package org.yun.app.servlet; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; 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 org.yun.app.dao.CommonDAOImpl; import org.yun.app.entity.CartPage; /** * Servlet implementation class SettlementServlet */ @WebServlet("/order.html") public class SettlementServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String tempStr = request.getParameter("params"); System.out.println(tempStr); if ("".equals(tempStr) || null == tempStr) { request.getRequestDispatcher("/WEB-INF/webPage/cart.jsp").forward(request, response); } else { String[] strs = tempStr.split("abcde");// 拆分参数得到被选中的商品编号 List<CartPage> cartPages = (List<CartPage>) request.getSession().getAttribute("cartPages"); System.out.println(cartPages.toString()); List<CartPage> orderCartItems = new ArrayList<>(); BigDecimal tempSum = new BigDecimal(0); for (int index = 1; index < strs.length; index++) { System.out.println(strs[index]); for (int i = 0; i < cartPages.size(); i++) { int temp = Integer.parseInt(strs[index]); System.out.println("======商品号是否相同======="); System.out.println(temp==cartPages.get(i).getProductId()); if (temp==cartPages.get(i).getProductId()) { BigDecimal tempPrice = cartPages.get(i).getPrice(); int tempNum = cartPages.get(i).getProductNum(); BigDecimal tempMu = tempPrice.multiply(new BigDecimal(tempNum)); System.out.println(tempMu); tempSum = tempSum.add(tempMu); System.out.println(tempSum); orderCartItems.add(cartPages.get(i)); String sql = "DELETE FROM tb_cartitem WHERE cartId=? AND productId=?"; int row = new CommonDAOImpl().updateDataBase(sql, new Object[] { cartPages.get(i).getCartId(), temp}); cartPages.remove(i); System.out.println("============="); System.out.println(row); } } } System.out.println("原来的购物车"); System.out.println(cartPages.toString()); System.out.println(orderCartItems.toString()); request.getSession().setAttribute("tempSum", tempSum); request.getSession().setAttribute("cartPages", cartPages); request.getSession().setAttribute("orderCartItems", orderCartItems); request.getRequestDispatcher("/WEB-INF/webPage/order.jsp").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 doGet(request, response); } }
[ "zyy@email.com" ]
zyy@email.com
edae7aa3be54de255b4b4cbbe7a91abf980fc521
4b8ab5805521148b617846aaf71e3bdc7029842a
/atlas-update/src/main/java/com/taobao/dx/util/IndexMap.java
14050b3c6a4abecc5141cceb3b400b29ef01ac9d
[ "Apache-2.0" ]
permissive
AlanCheen/atlas
8d86b53c609d8a82645166a9e361fda4db3c58f1
eb3ca70c72440f95dbd9a09d5feac8bbd4677f42
refs/heads/master
2020-05-23T21:42:03.908425
2017-03-13T06:52:57
2017-03-13T06:52:57
84,792,897
1
1
null
2017-03-13T06:44:11
2017-03-13T06:44:11
null
UTF-8
Java
false
false
30,764
java
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.taobao.dx.util; import com.taobao.dex.*; import com.taobao.dex.util.ByteInput; import com.taobao.dex.util.ByteOutput; import com.taobao.utils.SparseIntArray; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.BitSet; /** * Created by tangyinsheng on 2016/6/29. */ public class IndexMap { private final SparseIntArray stringIdsMap = new SparseIntArray(); private final SparseIntArray typeIdsMap = new SparseIntArray(); private final SparseIntArray protoIdsMap = new SparseIntArray(); private final SparseIntArray fieldIdsMap = new SparseIntArray(); private final SparseIntArray methodIdsMap = new SparseIntArray(); private final SparseIntArray typeListOffsetsMap = new SparseIntArray(); private final SparseIntArray annotationOffsetsMap = new SparseIntArray(); private final SparseIntArray annotationSetOffsetsMap = new SparseIntArray(); private final SparseIntArray annotationSetRefListOffsetsMap = new SparseIntArray(); private final SparseIntArray annotationsDirectoryOffsetsMap = new SparseIntArray(); private final SparseIntArray staticValuesOffsetsMap = new SparseIntArray(); private final SparseIntArray classDataOffsetsMap = new SparseIntArray(); private final SparseIntArray debugInfoItemOffsetsMap = new SparseIntArray(); private final SparseIntArray codeOffsetsMap = new SparseIntArray(); private final BitSet deletedStringIds = new BitSet(); private final BitSet deletedTypeIds = new BitSet(); private final BitSet deletedProtoIds = new BitSet(); private final BitSet deletedFieldIds = new BitSet(); private final BitSet deletedMethodIds = new BitSet(); private final BitSet deletedTypeListOffsets = new BitSet(); private final BitSet deletedAnnotationOffsets = new BitSet(); private final BitSet deletedAnnotationSetOffsets = new BitSet(); private final BitSet deletedAnnotationSetRefListOffsets = new BitSet(); private final BitSet deletedAnnotationsDirectoryOffsets = new BitSet(); private final BitSet deletedStaticValuesOffsets = new BitSet(); private final BitSet deletedClassDataOffsets = new BitSet(); private final BitSet deletedDebugInfoItemOffsets = new BitSet(); private final BitSet deletedCodeOffsets = new BitSet(); public void mapStringIds(int oldIndex, int newIndex) { stringIdsMap.put(oldIndex, newIndex); } public void markStringIdDeleted(int index) { if (index < 0) return; deletedStringIds.set(index); } public void mapTypeIds(int oldIndex, int newIndex) { typeIdsMap.put(oldIndex, newIndex); } public void markTypeIdDeleted(int index) { if (index < 0) return; deletedTypeIds.set(index); } public void mapProtoIds(int oldIndex, int newIndex) { protoIdsMap.put(oldIndex, newIndex); } public void markProtoIdDeleted(int index) { if (index < 0) return; deletedProtoIds.set(index); } public void mapFieldIds(int oldIndex, int newIndex) { fieldIdsMap.put(oldIndex, newIndex); } public void markFieldIdDeleted(int index) { if (index < 0) return; deletedFieldIds.set(index); } public void mapMethodIds(int oldIndex, int newIndex) { methodIdsMap.put(oldIndex, newIndex); } public void markMethodIdDeleted(int index) { if (index < 0) return; deletedMethodIds.set(index); } public void mapTypeListOffset(int oldOffset, int newOffset) { typeListOffsetsMap.put(oldOffset, newOffset); } public void markTypeListDeleted(int offset) { if (offset < 0) return; deletedTypeListOffsets.set(offset); } public void mapAnnotationOffset(int oldOffset, int newOffset) { annotationOffsetsMap.put(oldOffset, newOffset); } public void markAnnotationDeleted(int offset) { if (offset < 0) return; deletedAnnotationOffsets.set(offset); } public void mapAnnotationSetOffset(int oldOffset, int newOffset) { annotationSetOffsetsMap.put(oldOffset, newOffset); } public void markAnnotationSetDeleted(int offset) { if (offset < 0) return; deletedAnnotationSetOffsets.set(offset); } public void mapAnnotationSetRefListOffset(int oldOffset, int newOffset) { annotationSetRefListOffsetsMap.put(oldOffset, newOffset); } public void markAnnotationSetRefListDeleted(int offset) { if (offset < 0) return; deletedAnnotationSetRefListOffsets.set(offset); } public void mapAnnotationsDirectoryOffset(int oldOffset, int newOffset) { annotationsDirectoryOffsetsMap.put(oldOffset, newOffset); } public void markAnnotationsDirectoryDeleted(int offset) { if (offset < 0) return; deletedAnnotationsDirectoryOffsets.set(offset); } public void mapStaticValuesOffset(int oldOffset, int newOffset) { staticValuesOffsetsMap.put(oldOffset, newOffset); } public void markStaticValuesDeleted(int offset) { if (offset < 0) return; deletedStaticValuesOffsets.set(offset); } public void mapClassDataOffset(int oldOffset, int newOffset) { classDataOffsetsMap.put(oldOffset, newOffset); } public void markClassDataDeleted(int offset) { if (offset < 0) return; deletedClassDataOffsets.set(offset); } public void mapDebugInfoItemOffset(int oldOffset, int newOffset) { debugInfoItemOffsetsMap.put(oldOffset, newOffset); } public void markDebugInfoItemDeleted(int offset) { if (offset < 0) return; deletedDebugInfoItemOffsets.set(offset); } public void mapCodeOffset(int oldOffset, int newOffset) { codeOffsetsMap.put(oldOffset, newOffset); } public void markCodeDeleted(int offset) { if (offset < 0) return; deletedCodeOffsets.set(offset); } public int adjustStringIndex(int stringIndex) { int index = stringIdsMap.indexOfKey(stringIndex); if (index < 0) { return (stringIndex >= 0 && deletedStringIds.get(stringIndex) ? -1 : stringIndex); } else { return stringIdsMap.valueAt(index); } } public int adjustTypeIdIndex(int typeIdIndex) { int index = typeIdsMap.indexOfKey(typeIdIndex); if (index < 0) { return (typeIdIndex >= 0 && deletedTypeIds.get(typeIdIndex) ? -1 : typeIdIndex); } else { return typeIdsMap.valueAt(index); } } public int adjustProtoIdIndex(int protoIndex) { int index = protoIdsMap.indexOfKey(protoIndex); if (index < 0) { return (protoIndex >= 0 && deletedProtoIds.get(protoIndex) ? -1 : protoIndex); } else { return protoIdsMap.valueAt(index); } } public int adjustFieldIdIndex(int fieldIndex) { int index = fieldIdsMap.indexOfKey(fieldIndex); if (index < 0) { return (fieldIndex >= 0 && deletedFieldIds.get(fieldIndex) ? -1 : fieldIndex); } else { return fieldIdsMap.valueAt(index); } } public int adjustMethodIdIndex(int methodIndex) { int index = methodIdsMap.indexOfKey(methodIndex); if (index < 0) { return (methodIndex >= 0 && deletedMethodIds.get(methodIndex) ? -1 : methodIndex); } else { return methodIdsMap.valueAt(index); } } public int adjustTypeListOffset(int typeListOffset) { int index = typeListOffsetsMap.indexOfKey(typeListOffset); if (index < 0) { return (typeListOffset >= 0 && deletedTypeListOffsets.get(typeListOffset) ? -1 : typeListOffset); } else { return typeListOffsetsMap.valueAt(index); } } public int adjustAnnotationOffset(int annotationOffset) { int index = annotationOffsetsMap.indexOfKey(annotationOffset); if (index < 0) { return (annotationOffset >= 0 && deletedAnnotationOffsets.get(annotationOffset) ? -1 : annotationOffset); } else { return annotationOffsetsMap.valueAt(index); } } public int adjustAnnotationSetOffset(int annotationSetOffset) { int index = annotationSetOffsetsMap.indexOfKey(annotationSetOffset); if (index < 0) { return (annotationSetOffset >= 0 && deletedAnnotationSetOffsets.get(annotationSetOffset) ? -1 : annotationSetOffset); } else { return annotationSetOffsetsMap.valueAt(index); } } public int adjustAnnotationSetRefListOffset(int annotationSetRefListOffset) { int index = annotationSetRefListOffsetsMap.indexOfKey(annotationSetRefListOffset); if (index < 0) { return (annotationSetRefListOffset >= 0 && deletedAnnotationSetRefListOffsets.get(annotationSetRefListOffset) ? -1 : annotationSetRefListOffset); } else { return annotationSetRefListOffsetsMap.valueAt(index); } } public int adjustAnnotationsDirectoryOffset(int annotationsDirectoryOffset) { int index = annotationsDirectoryOffsetsMap.indexOfKey(annotationsDirectoryOffset); if (index < 0) { return (annotationsDirectoryOffset >= 0 && deletedAnnotationsDirectoryOffsets.get(annotationsDirectoryOffset) ? -1 : annotationsDirectoryOffset); } else { return annotationsDirectoryOffsetsMap.valueAt(index); } } public int adjustStaticValuesOffset(int staticValuesOffset) { int index = staticValuesOffsetsMap.indexOfKey(staticValuesOffset); if (index < 0) { return (staticValuesOffset >= 0 && deletedStaticValuesOffsets.get(staticValuesOffset) ? -1 : staticValuesOffset); } else { return staticValuesOffsetsMap.valueAt(index); } } public int adjustClassDataOffset(int classDataOffset) { int index = classDataOffsetsMap.indexOfKey(classDataOffset); if (index < 0) { return (classDataOffset >= 0 && deletedClassDataOffsets.get(classDataOffset) ? -1 : classDataOffset); } else { return classDataOffsetsMap.valueAt(index); } } public int adjustDebugInfoItemOffset(int debugInfoItemOffset) { int index = debugInfoItemOffsetsMap.indexOfKey(debugInfoItemOffset); if (index < 0) { return (debugInfoItemOffset >= 0 && deletedDebugInfoItemOffsets.get(debugInfoItemOffset) ? -1 : debugInfoItemOffset); } else { return debugInfoItemOffsetsMap.valueAt(index); } } public int adjustCodeOffset(int codeOffset) { int index = codeOffsetsMap.indexOfKey(codeOffset); if (index < 0) { return (codeOffset >= 0 && deletedCodeOffsets.get(codeOffset) ? -1 : codeOffset); } else { return codeOffsetsMap.valueAt(index); } } public TypeList adjust(TypeList typeList) { if (typeList == TypeList.EMPTY) { return typeList; } short[] types = new short[typeList.types.length]; for (int i = 0; i < types.length; ++i) { types[i] = (short) adjustTypeIdIndex(typeList.types[i]); } return new TypeList(typeList.off, types); } public MethodId adjust(MethodId methodId) { int adjustedDeclaringClassIndex = adjustTypeIdIndex(methodId.declaringClassIndex); int adjustedProtoIndex = adjustProtoIdIndex(methodId.protoIndex); int adjustedNameIndex = adjustStringIndex(methodId.nameIndex); return new MethodId( methodId.off, adjustedDeclaringClassIndex, adjustedProtoIndex, adjustedNameIndex ); } public FieldId adjust(FieldId fieldId) { int adjustedDeclaringClassIndex = adjustTypeIdIndex(fieldId.declaringClassIndex); int adjustedTypeIndex = adjustTypeIdIndex(fieldId.typeIndex); int adjustedNameIndex = adjustStringIndex(fieldId.nameIndex); return new FieldId( fieldId.off, adjustedDeclaringClassIndex, adjustedTypeIndex, adjustedNameIndex ); } public ProtoId adjust(ProtoId protoId) { int adjustedShortyIndex = adjustStringIndex(protoId.shortyIndex); int adjustedReturnTypeIndex = adjustTypeIdIndex(protoId.returnTypeIndex); int adjustedParametersOffset = adjustTypeListOffset(protoId.parametersOffset); return new ProtoId( protoId.off, adjustedShortyIndex, adjustedReturnTypeIndex, adjustedParametersOffset ); } public ClassDef adjust(ClassDef classDef) { int adjustedTypeIndex = adjustTypeIdIndex(classDef.typeIndex); int adjustedSupertypeIndex = adjustTypeIdIndex(classDef.supertypeIndex); int adjustedInterfacesOffset = adjustTypeListOffset(classDef.interfacesOffset); int adjustedSourceFileIndex = adjustStringIndex(classDef.sourceFileIndex); int adjustedAnnotationsOffset = adjustAnnotationsDirectoryOffset(classDef.annotationsOffset); int adjustedClassDataOffset = adjustClassDataOffset(classDef.classDataOffset); int adjustedStaticValuesOffset = adjustStaticValuesOffset(classDef.staticValuesOffset); return new ClassDef( classDef.off, adjustedTypeIndex, classDef.accessFlags, adjustedSupertypeIndex, adjustedInterfacesOffset, adjustedSourceFileIndex, adjustedAnnotationsOffset, adjustedClassDataOffset, adjustedStaticValuesOffset ); } public ClassData adjust(ClassData classData) { ClassData.Field[] adjustedStaticFields = adjustFields(classData.staticFields); ClassData.Field[] adjustedInstanceFields = adjustFields(classData.instanceFields); ClassData.Method[] adjustedDirectMethods = adjustMethods(classData.directMethods); ClassData.Method[] adjustedVirtualMethods = adjustMethods(classData.virtualMethods); return new ClassData( classData.off, adjustedStaticFields, adjustedInstanceFields, adjustedDirectMethods, adjustedVirtualMethods ); } public Code adjust(Code code) { int adjustedDebugInfoOffset = adjustDebugInfoItemOffset(code.debugInfoOffset); short[] adjustedInstructions = adjustInstructions(code.instructions); Code.CatchHandler[] adjustedCatchHandlers = adjustCatchHandlers(code.catchHandlers); return new Code( code.off, code.registersSize, code.insSize, code.outsSize, adjustedDebugInfoOffset, adjustedInstructions, code.tries, adjustedCatchHandlers ); } private short[] adjustInstructions(short[] instructions) { if (instructions == null || instructions.length == 0) { return instructions; } InstructionTransformer insTrans = new InstructionTransformer(this); return insTrans.transform(instructions); } private Code.CatchHandler[] adjustCatchHandlers(Code.CatchHandler[] catchHandlers) { if (catchHandlers == null || catchHandlers.length == 0) { return catchHandlers; } Code.CatchHandler[] adjustedCatchHandlers = new Code.CatchHandler[catchHandlers.length]; for (int i = 0; i < catchHandlers.length; ++i) { Code.CatchHandler catchHandler = catchHandlers[i]; int typeIndexesCount = catchHandler.typeIndexes.length; int[] adjustedTypeIndexes = new int[typeIndexesCount]; for (int j = 0; j < typeIndexesCount; ++j) { adjustedTypeIndexes[j] = adjustTypeIdIndex(catchHandler.typeIndexes[j]); } adjustedCatchHandlers[i] = new Code.CatchHandler( adjustedTypeIndexes, catchHandler.addresses, catchHandler.catchAllAddress, catchHandler.offset ); } return adjustedCatchHandlers; } private ClassData.Field[] adjustFields(ClassData.Field[] fields) { ClassData.Field[] adjustedFields = new ClassData.Field[fields.length]; for (int i = 0; i < fields.length; ++i) { ClassData.Field field = fields[i]; int adjustedFieldIndex = adjustFieldIdIndex(field.fieldIndex); adjustedFields[i] = new ClassData.Field(adjustedFieldIndex, field.accessFlags); } return adjustedFields; } private ClassData.Method[] adjustMethods(ClassData.Method[] methods) { ClassData.Method[] adjustedMethods = new ClassData.Method[methods.length]; for (int i = 0; i < methods.length; ++i) { ClassData.Method method = methods[i]; int adjustedMethodIndex = adjustMethodIdIndex(method.methodIndex); int adjustedCodeOffset = adjustCodeOffset(method.codeOffset); adjustedMethods[i] = new ClassData.Method( adjustedMethodIndex, method.accessFlags, adjustedCodeOffset ); } return adjustedMethods; } public DebugInfoItem adjust(DebugInfoItem debugInfoItem) { int[] parameterNames = adjustParameterNames(debugInfoItem.parameterNames); byte[] infoSTM = adjustDebugInfoItemSTM(debugInfoItem.infoSTM); return new DebugInfoItem( debugInfoItem.off, debugInfoItem.lineStart, parameterNames, infoSTM ); } private int[] adjustParameterNames(int[] parameterNames) { int size = parameterNames.length; int[] adjustedParameterNames = new int[size]; for (int i = 0; i < size; ++i) { adjustedParameterNames[i] = adjustStringIndex(parameterNames[i]); } return adjustedParameterNames; } private byte[] adjustDebugInfoItemSTM(byte[] infoSTM) { ByteArrayInputStream bais = new ByteArrayInputStream(infoSTM); final ByteArrayInputStream baisRef = bais; ByteInput inAdapter = new ByteInput() { @Override public byte readByte() { return (byte) (baisRef.read() & 0xFF); } }; ByteArrayOutputStream baos = new ByteArrayOutputStream(infoSTM.length + 512); final ByteArrayOutputStream baosRef = baos; ByteOutput outAdapter = new ByteOutput() { @Override public void writeByte(int i) { baosRef.write(i); } }; outside_whileloop: while (true) { int opcode = bais.read() & 0xFF; baos.write(opcode); switch (opcode) { case DebugInfoItem.DBG_END_SEQUENCE: { break outside_whileloop; } case DebugInfoItem.DBG_ADVANCE_PC: { int addrDiff = Leb128.readUnsignedLeb128(inAdapter); Leb128.writeUnsignedLeb128(outAdapter, addrDiff); break; } case DebugInfoItem.DBG_ADVANCE_LINE: { int lineDiff = Leb128.readSignedLeb128(inAdapter); Leb128.writeSignedLeb128(outAdapter, lineDiff); break; } case DebugInfoItem.DBG_START_LOCAL: case DebugInfoItem.DBG_START_LOCAL_EXTENDED: { int registerNum = Leb128.readUnsignedLeb128(inAdapter); Leb128.writeUnsignedLeb128(outAdapter, registerNum); int nameIndex = adjustStringIndex(Leb128.readUnsignedLeb128p1(inAdapter)); Leb128.writeUnsignedLeb128p1(outAdapter, nameIndex); int typeIndex = adjustTypeIdIndex(Leb128.readUnsignedLeb128p1(inAdapter)); Leb128.writeUnsignedLeb128p1(outAdapter, typeIndex); if (opcode == DebugInfoItem.DBG_START_LOCAL_EXTENDED) { int sigIndex = adjustStringIndex(Leb128.readUnsignedLeb128p1(inAdapter)); Leb128.writeUnsignedLeb128p1(outAdapter, sigIndex); } break; } case DebugInfoItem.DBG_END_LOCAL: case DebugInfoItem.DBG_RESTART_LOCAL: { int registerNum = Leb128.readUnsignedLeb128(inAdapter); Leb128.writeUnsignedLeb128(outAdapter, registerNum); break; } case DebugInfoItem.DBG_SET_FILE: { int nameIndex = adjustStringIndex(Leb128.readUnsignedLeb128p1(inAdapter)); Leb128.writeUnsignedLeb128p1(outAdapter, nameIndex); break; } case DebugInfoItem.DBG_SET_PROLOGUE_END: case DebugInfoItem.DBG_SET_EPILOGUE_BEGIN: default: { break; } } } return baos.toByteArray(); } public EncodedValue adjust(EncodedValue encodedArray) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(encodedArray.data.length); new EncodedValueTransformer( new ByteOutput() { @Override public void writeByte(int i) { baos.write(i); } } ).transformArray( new EncodedValueReader(encodedArray, EncodedValueReader.ENCODED_ARRAY) ); return new EncodedValue(encodedArray.off, baos.toByteArray()); } public Annotation adjust(Annotation annotation) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(annotation.encodedAnnotation.data.length); new EncodedValueTransformer( new ByteOutput() { @Override public void writeByte(int i) { baos.write(i); } } ).transformAnnotation(annotation.getReader()); return new Annotation( annotation.off, annotation.visibility, new EncodedValue(annotation.encodedAnnotation.off, baos.toByteArray()) ); } public AnnotationSet adjust(AnnotationSet annotationSet) { int size = annotationSet.annotationOffsets.length; int[] adjustedAnnotationOffsets = new int[size]; for (int i = 0; i < size; ++i) { adjustedAnnotationOffsets[i] = adjustAnnotationOffset(annotationSet.annotationOffsets[i]); } return new AnnotationSet(annotationSet.off, adjustedAnnotationOffsets); } public AnnotationSetRefList adjust(AnnotationSetRefList annotationSetRefList) { int size = annotationSetRefList.annotationSetRefItems.length; int[] adjustedAnnotationSetRefItems = new int[size]; for (int i = 0; i < size; ++i) { adjustedAnnotationSetRefItems[i] = adjustAnnotationSetOffset(annotationSetRefList.annotationSetRefItems[i]); } return new AnnotationSetRefList(annotationSetRefList.off, adjustedAnnotationSetRefItems); } public AnnotationsDirectory adjust(AnnotationsDirectory annotationsDirectory) { int adjustedClassAnnotationsOffset = adjustAnnotationSetOffset(annotationsDirectory.classAnnotationsOffset); int[][] adjustedFieldAnnotations = new int[annotationsDirectory.fieldAnnotations.length][2]; for (int i = 0; i < adjustedFieldAnnotations.length; ++i) { adjustedFieldAnnotations[i][0] = adjustFieldIdIndex(annotationsDirectory.fieldAnnotations[i][0]); adjustedFieldAnnotations[i][1] = adjustAnnotationSetOffset(annotationsDirectory.fieldAnnotations[i][1]); } int[][] adjustedMethodAnnotations = new int[annotationsDirectory.methodAnnotations.length][2]; for (int i = 0; i < adjustedMethodAnnotations.length; ++i) { adjustedMethodAnnotations[i][0] = adjustMethodIdIndex(annotationsDirectory.methodAnnotations[i][0]); adjustedMethodAnnotations[i][1] = adjustAnnotationSetOffset(annotationsDirectory.methodAnnotations[i][1]); } int[][] adjustedParameterAnnotations = new int[annotationsDirectory.parameterAnnotations.length][2]; for (int i = 0; i < adjustedParameterAnnotations.length; ++i) { adjustedParameterAnnotations[i][0] = adjustMethodIdIndex(annotationsDirectory.parameterAnnotations[i][0]); adjustedParameterAnnotations[i][1] = adjustAnnotationSetRefListOffset( annotationsDirectory.parameterAnnotations[i][1] ); } return new AnnotationsDirectory( annotationsDirectory.off, adjustedClassAnnotationsOffset, adjustedFieldAnnotations, adjustedMethodAnnotations, adjustedParameterAnnotations ); } /** * Adjust an encoded value or array. */ private final class EncodedValueTransformer { private final ByteOutput out; EncodedValueTransformer(ByteOutput out) { this.out = out; } public void transform(EncodedValueReader reader) { switch (reader.peek()) { case EncodedValueReader.ENCODED_BYTE: EncodedValueCodec.writeSignedIntegralValue(out, EncodedValueReader.ENCODED_BYTE, reader.readByte()); break; case EncodedValueReader.ENCODED_SHORT: EncodedValueCodec.writeSignedIntegralValue(out, EncodedValueReader.ENCODED_SHORT, reader.readShort()); break; case EncodedValueReader.ENCODED_INT: EncodedValueCodec.writeSignedIntegralValue(out, EncodedValueReader.ENCODED_INT, reader.readInt()); break; case EncodedValueReader.ENCODED_LONG: EncodedValueCodec.writeSignedIntegralValue(out, EncodedValueReader.ENCODED_LONG, reader.readLong()); break; case EncodedValueReader.ENCODED_CHAR: EncodedValueCodec.writeUnsignedIntegralValue(out, EncodedValueReader.ENCODED_CHAR, reader.readChar()); break; case EncodedValueReader.ENCODED_FLOAT: // Shift value left 32 so that right-zero-extension works. long longBits = ((long) Float.floatToIntBits(reader.readFloat())) << 32; EncodedValueCodec.writeRightZeroExtendedValue(out, EncodedValueReader.ENCODED_FLOAT, longBits); break; case EncodedValueReader.ENCODED_DOUBLE: EncodedValueCodec.writeRightZeroExtendedValue( out, EncodedValueReader.ENCODED_DOUBLE, Double.doubleToLongBits(reader.readDouble())); break; case EncodedValueReader.ENCODED_STRING: EncodedValueCodec.writeUnsignedIntegralValue( out, EncodedValueReader.ENCODED_STRING, adjustStringIndex(reader.readString())); break; case EncodedValueReader.ENCODED_TYPE: EncodedValueCodec.writeUnsignedIntegralValue( out, EncodedValueReader.ENCODED_TYPE, adjustTypeIdIndex(reader.readType())); break; case EncodedValueReader.ENCODED_FIELD: EncodedValueCodec.writeUnsignedIntegralValue( out, EncodedValueReader.ENCODED_FIELD, adjustFieldIdIndex(reader.readField())); break; case EncodedValueReader.ENCODED_ENUM: EncodedValueCodec.writeUnsignedIntegralValue( out, EncodedValueReader.ENCODED_ENUM, adjustFieldIdIndex(reader.readEnum())); break; case EncodedValueReader.ENCODED_METHOD: EncodedValueCodec.writeUnsignedIntegralValue( out, EncodedValueReader.ENCODED_METHOD, adjustMethodIdIndex(reader.readMethod())); break; case EncodedValueReader.ENCODED_ARRAY: writeTypeAndArg(EncodedValueReader.ENCODED_ARRAY, 0); transformArray(reader); break; case EncodedValueReader.ENCODED_ANNOTATION: writeTypeAndArg(EncodedValueReader.ENCODED_ANNOTATION, 0); transformAnnotation(reader); break; case EncodedValueReader.ENCODED_NULL: reader.readNull(); writeTypeAndArg(EncodedValueReader.ENCODED_NULL, 0); break; case EncodedValueReader.ENCODED_BOOLEAN: boolean value = reader.readBoolean(); writeTypeAndArg(EncodedValueReader.ENCODED_BOOLEAN, value ? 1 : 0); break; default: throw new DexException("Unexpected type: " + Integer.toHexString(reader.peek())); } } private void transformAnnotation(EncodedValueReader reader) { int fieldCount = reader.readAnnotation(); Leb128.writeUnsignedLeb128(out, adjustTypeIdIndex(reader.getAnnotationType())); Leb128.writeUnsignedLeb128(out, fieldCount); for (int i = 0; i < fieldCount; i++) { Leb128.writeUnsignedLeb128(out, adjustStringIndex(reader.readAnnotationName())); transform(reader); } } private void transformArray(EncodedValueReader reader) { int size = reader.readArray(); Leb128.writeUnsignedLeb128(out, size); for (int i = 0; i < size; i++) { transform(reader); } } private void writeTypeAndArg(int type, int arg) { out.writeByte((arg << 5) | type); } } }
[ "guanjie.yjf@taobao.com" ]
guanjie.yjf@taobao.com
6345089752eec7ad63e3a60546e77dec71782777
5ad6afb253b4ffec3be1ec0a8f6b25389e7aef35
/Cxf/src/org/whl/service/SmSrES4PortImpl.java
7985ae1bf876bda46b796dc907055f9d488a05be
[]
no_license
impratikjaiswal/demo
488e51476cd8f768e6e7f8d2a849fafcbac755be
98cfe8400d107449e28642f28c23f43fcde54a8e
refs/heads/master
2022-07-13T01:46:22.658614
2022-06-11T11:58:46
2022-06-11T11:58:46
400,157,208
0
0
null
null
null
null
UTF-8
Java
false
false
6,116
java
/** * Please modify this class to meet your needs * This class is not complete */ package org.whl.service; import java.util.logging.Logger; import org.apache.cxf.annotations.SchemaValidation; /** * This class was generated by Apache CXF 3.1.1 * 2015-07-05T14:40:33.224+08:00 * Generated source version: 3.1.1 * */ @javax.jws.WebService( serviceName = "ES4SmSrService", portName = "SmSrES4Port", targetNamespace = "http://namespaces.gsma.org/esim-messaging/1", wsdlLocation = "wsdl/20150611/ES4_SMSR.wsdl", endpointInterface = "org.whl.service.ES4SmSr") @SchemaValidation public class SmSrES4PortImpl implements ES4SmSr { private static final Logger LOG = Logger.getLogger(SmSrES4PortImpl.class.getName()); /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4PrepareSMSRChange(org.whl.service.ES4PrepareSMSRChangeRequest parameters )* */ @Override public void es4PrepareSMSRChange(ES4PrepareSMSRChangeRequest parameters) { LOG.info("Executing operation es4PrepareSMSRChange"); System.out.println(parameters); try { System.out .println("FunctionCallIdentifier = " + parameters.getFunctionCallIdentifier()); String eid = new String(parameters.getEid()); System.out.println("EID= " + eid); System.out.println("CurrentSmsrId=" + parameters.getCurrentSmsrId()); } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4UpdateSubscriptionAddress(org.whl.service.ES4UpdateSubscriptionAddressRequest parameters )* */ @Override public org.whl.service.ES4UpdateSubscriptionAddressResponse es4UpdateSubscriptionAddress(ES4UpdateSubscriptionAddressRequest parameters) { LOG.info("Executing operation es4UpdateSubscriptionAddress"); System.out.println(parameters); try { org.whl.service.ES4UpdateSubscriptionAddressResponse _return = null; return _return; } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4EnableProfile(org.whl.service.ES4EnableProfileRequest parameters )* */ @Override public void es4EnableProfile(ES4EnableProfileRequest parameters) { LOG.info("Executing operation es4EnableProfile"); System.out.println(parameters); try { } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4UpdatePolicyRules(org.whl.service.ES4UpdatePolicyRulesRequest parameters )* */ @Override public org.whl.service.ES4UpdatePolicyRulesResponse es4UpdatePolicyRules(ES4UpdatePolicyRulesRequest parameters) { LOG.info("Executing operation es4UpdatePolicyRules"); System.out.println(parameters); try { org.whl.service.ES4UpdatePolicyRulesResponse _return = null; return _return; } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4SMSRChange(org.whl.service.ES4SMSRChangeRequest parameters )* */ @Override public void es4SMSRChange(ES4SMSRChangeRequest parameters) { LOG.info("Executing operation es4SMSRChange"); System.out.println(parameters); try { } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4GetEIS(org.whl.service.ES4GetEISRequest parameters )* */ @Override public org.whl.service.ES4GetEISResponse es4GetEIS(ES4GetEISRequest parameters) { LOG.info("Executing operation es4GetEIS"); System.out.println(parameters); try { org.whl.service.ES4GetEISResponse _return = null; return _return; } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4DisableProfile(org.whl.service.ES4DisableProfileRequest parameters )* */ @Override public void es4DisableProfile(ES4DisableProfileRequest parameters) { LOG.info("Executing operation es4DisableProfile"); System.out.println(parameters); try { } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4DeleteProfile(org.whl.service.ES4DeleteProfileRequest parameters )* */ @Override public void es4DeleteProfile(ES4DeleteProfileRequest parameters) { LOG.info("Executing operation es4DeleteProfile"); System.out.println(parameters); try { } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } /* (non-Javadoc) * @see org.whl.service.ES4SmSr#es4AuditEIS(org.whl.service.ES4AuditEISRequest parameters )* */ @Override public void es4AuditEIS(ES4AuditEISRequest parameters) { LOG.info("Executing operation es4AuditEIS"); System.out.println(parameters); try { System.out .println("FunctionCallIdentifier = " + parameters.getFunctionCallIdentifier()); String eid = new String(parameters.getEid()); System.out.println("EID= " + eid); for (String iccid : parameters.getIccid()) { System.out.println("ICCID = " + iccid); } } catch (java.lang.Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } }
[ "huangtudi_007@126.com" ]
huangtudi_007@126.com
b3332bc8b16165041ba239d1c04ce7446d079aab
766c016e6f1445e186bc5b42b6993facdb1d44ff
/app/src/main/java/com/xixicm/de/presentation/view/appwidget/DEAppWidgetProvider51.java
fbabb6a4ff0e2121b9d8d9ed5d6b628f39c732c0
[ "Apache-2.0" ]
permissive
enuoCM/DE-MVP-Clean
c9fc33aa2f9b212321b4f483ef506459fc602cf4
6c3e588b58409e512dbc0f34392a304c09334046
refs/heads/master
2020-09-27T22:16:07.503527
2017-07-01T12:57:57
2017-07-01T12:57:57
66,622,989
23
4
null
null
null
null
UTF-8
Java
false
false
1,114
java
/* * Copyright (C) 2016 mc * * 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.xixicm.de.presentation.view.appwidget; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.Context; /** * @author mc */ public class DEAppWidgetProvider51 extends AppWidgetProvider { @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { super.onUpdate(context, appWidgetManager, appWidgetIds); WidgetManager.getInstance().updateDEAppWidget(WidgetManager.TYPE_5_1); } }
[ "min.chen@myriadgroup.com" ]
min.chen@myriadgroup.com
12f4cd43ab3f68718e2742e0183de3f5fd54f3d0
b051fabcebba4400cbef7fa520ad9a54423b4b95
/src/main/java/ThirdGreatestString.java
6a22d8134a87d14972c9f45f87480e12f0e015d1
[]
no_license
lindaaohara/ThirdGreatestString
edd848aa3bbd3e03ce6ed2dae8c5def6ac0e0927
37836cd8e1a19ade42c5fb9367426e1519dd7686
refs/heads/main
2023-02-21T09:08:41.306158
2021-01-28T03:11:05
2021-01-28T03:11:05
333,630,290
0
0
null
null
null
null
UTF-8
Java
false
false
431
java
import java.util.Arrays; import java.util.Comparator; public class ThirdGreatestString { //String[] strArr = {"ABCD", "AB", "ABCDEFG", "ABC", "A", "ABCDE", "ABCDEF", "ABCDEFGHIJ"}; static String sort(String[]strArr) { Arrays.sort(strArr, Comparator.comparing(String::length).reversed()); System.out.println(strArr[2]); return strArr[2]; } public static void main(String[] args) { } }
[ "lindaaohara@gmail.com" ]
lindaaohara@gmail.com
7a868d35a97233c797a6d105592229d82d57027c
251d7544a566db232277807a7ec491cfb0600b99
/CurrentPlaceDetailsOnMap/app/src/main/java/com/example/currentplacedetailsonmap/MainActivity.java
af13eec18a8dd2b33f9baeb08fc8736e00a58716
[]
no_license
rahul577/hackDTU
aed3f52a57ac9b2f035cdd5812a996022158161f
33c5e86d52e27216420d2662ac372f6ed1721bd8
refs/heads/master
2021-07-14T17:53:01.955255
2017-10-16T02:51:30
2017-10-16T02:51:30
106,879,524
0
1
null
2017-10-14T10:00:49
2017-10-13T22:38:48
Java
UTF-8
Java
false
false
3,264
java
package com.example.currentplacedetailsonmap; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import com.google.gson.Gson; import com.microsoft.projectoxford.vision.VisionServiceClient; import com.microsoft.projectoxford.vision.VisionServiceRestClient; import com.microsoft.projectoxford.vision.contract.AnalysisResult; import com.microsoft.projectoxford.vision.contract.Caption; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; public class MainActivity extends AppCompatActivity { public VisionServiceClient visionServiceClient= new VisionServiceRestClient("0bea8746fa9040179804d782c93172aa","https://westcentralus.api.cognitive.microsoft.com/vision/v1.0"); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Bitmap myBitmap= BitmapFactory.decodeResource(getResources(),R.drawable.krituika); ImageView imageView=(ImageView)findViewById(R.id.imageView); Button button=(Button)findViewById(R.id.button); imageView.setImageBitmap(myBitmap); ByteArrayOutputStream outputStream= new ByteArrayOutputStream(); myBitmap.compress(Bitmap.CompressFormat.JPEG,100,outputStream); final ByteArrayInputStream inputStream=new ByteArrayInputStream(outputStream.toByteArray()); Button btnProcess=(Button)findViewById(R.id.button); btnProcess.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { AsyncTask<InputStream,String,String> visionTask= new AsyncTask<InputStream, String, String>() { @Override protected void onPostExecute(String s) { AnalysisResult result=new Gson().fromJson(s,AnalysisResult.class); TextView textView=(TextView)findViewById(R.id.textView); StringBuilder stringBuilder=new StringBuilder(); for(Caption caption:result.description.captions){ stringBuilder.append(caption.text); } textView.setText(stringBuilder); } @Override protected String doInBackground(InputStream... inputStreams) { try{ String[] features={"Description"}; String[] details={}; AnalysisResult result=visionServiceClient.analyzeImage(inputStreams[0],features,details); String str=new Gson().toJson(result); return str; } catch (Exception e) { return null; } } }; visionTask.execute(inputStream); } }); } }
[ "rahulbafila7@gmail.com" ]
rahulbafila7@gmail.com
c870359b089d1ea4358f157abf3eeb18569c0d68
d39fc8b3c72d7d2585b33104dbd90ee16db3db13
/subprojects/griffon-rt/src/main/groovy/org/codehaus/griffon/runtime/core/NoopEventRouter.java
0582a4bd7fafd1da3e2e7ba9fefc52519a7cae9f
[ "Apache-2.0" ]
permissive
fukkun/griffon
cb3e3f796f7c9cef8fc3df7850351011d139c534
7fb7f20ff1d9a2574672a8f4dc851d95d6694d97
refs/heads/master
2020-12-25T10:41:44.655942
2013-01-10T09:56:26
2013-01-10T09:56:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,314
java
/* * Copyright 2009-2013 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.codehaus.griffon.runtime.core; import griffon.core.EventRouter; import griffon.util.RunnableWithArgs; import groovy.lang.Closure; import java.util.List; import java.util.Map; /** * Implementation of {@code EventRouter} where all operations are ignored. * * @author Andres Almiray * @since 1.2.0 */ public class NoopEventRouter implements EventRouter { @Override public boolean isEnabled() { return false; } @Override public void setEnabled(boolean enabled) { } @Override public void publish(String eventName) { } @Override public void publish(String eventName, List params) { } @Override public void publishOutsideUI(String eventName) { } @Override public void publishOutsideUI(String eventName, List params) { } @Override public void publishAsync(String eventName) { } @Override public void publishAsync(String eventName, List params) { } @Override public void addEventListener(Object listener) { } @Override public void addEventListener(Map<String, Object> listener) { } @Override public void removeEventListener(Object listener) { } @Override public void removeEventListener(Map<String, Object> listener) { } @Override public void addEventListener(String eventName, Closure listener) { } @Override public void addEventListener(String eventName, RunnableWithArgs listener) { } @Override public void removeEventListener(String eventName, Closure listener) { } @Override public void removeEventListener(String eventName, RunnableWithArgs listener) { } }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com
08e9e338bc0cd3298af3b32e917c56bbb5a80e2c
b2cfe7a27580c51eba6500dceaffa85780c99611
/API/src/test/java/practiceRestAssured/FetchDataFromPostsApi.java
ea804a7f67b2caf2d6d24ce7e908b2aa8d10591a
[]
no_license
muthhuSelenium/API
0e2a83190422ec4f888f6cda1801992a82182ce0
2e267d851f870efa38192f207644045ad8ac0855
refs/heads/master
2022-11-08T19:34:53.257896
2020-06-27T10:26:36
2020-06-27T10:26:36
275,332,440
0
0
null
null
null
null
UTF-8
Java
false
false
728
java
package practiceRestAssured; import org.testng.annotations.Test; import io.restassured.RestAssured; import io.restassured.response.Response; public class FetchDataFromPostsApi { @Test public void getDataRequest() { Response resp = RestAssured.get("http://localhost:3000/posts"); int statusCode = resp.getStatusCode(); System.out.println("Status code:" +statusCode); String contentType = resp.getContentType(); System.out.println("The content type is:" +contentType); long time = resp.getTime(); System.out.println("Response time is" +time+"ms"); String asString = resp.asString(); System.out.println("The actual content is :"); System.out.println(asString); } }
[ "64060300+muthu2404@users.noreply.github.com" ]
64060300+muthu2404@users.noreply.github.com
de358511380ab954cac723fbc68fc880ca91b3a2
8ba97549d14e1f2f2fda77362c528a9cc78f1196
/TL_Coding_Challenge/TripleLiftianNumbersTest.java
64c70f911e0b74d9e7fb7a4ce6acaa45f4e90b57
[]
no_license
bcueto1/CodingChallenges
91524f01a23d11bb55e4a92c57c616eafeb25bbd
6352b1595ea11b7b945748bc216dbb033142bba6
refs/heads/master
2021-01-11T15:52:07.931135
2017-11-06T19:42:41
2017-11-06T19:42:41
79,944,512
0
0
null
null
null
null
UTF-8
Java
false
false
1,232
java
/** * Brian Michael Cueto * TripleLiftianNumbers Test Cases */ import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; /** Test class for TripleLiftianNumbers using jUnit. */ public class TripleLiftianNumbersTest { /** The test object. */ private static TripleLiftianNumbers myTest; /** Setup the test. */ @Before public void setupTest() { myTest = new TripleLiftianNumbers(); } /** Test to make sure T0 equals 6. */ @Test public void testZero() { assertEquals("6", myTest.TripleLiftianNumber(0)); } /** Test to make sure T1 equals 7. */ @Test public void testOne() { assertEquals("7", myTest.TripleLiftianNumber(1)); } /** Test to make sure T2 equals 2. */ @Test public void testTwo() { assertEquals("2", myTest.TripleLiftianNumber(2)); } /** Test to make sure 3 is working. */ @Test public void testThree() { assertEquals("-9", myTest.TripleLiftianNumber(3)); } /** Test to make sure 4 is working. */ @Test public void testFour() { assertEquals("-25", myTest.TripleLiftianNumber(4)); } /** Test to make sure 25 is working. */ @Test public void testTwentyFive() { assertEquals("-2575238999", myTest.TripleLiftianNumber(25)); } }
[ "brianmbcueto@gmail.com" ]
brianmbcueto@gmail.com
a4f527e6b148e8e6d19c73ee53fe76862589ca8e
15f806745ef5cca72251254c24618a345fb3eb4c
/fintech-admin/src/main/java/com/qunar/fintech/plat/admin/query/enums/RepayStatusEnum.java
8873551e58a093adc05193e335a75e352916a65a
[]
no_license
GSIL-Monitor/QunarProjectsStave
005f863b178645d8e90a44bdd14c5c0593574734
c455cda3a3aa86c68203e5d9be2545b2e88b47b0
refs/heads/master
2020-04-23T20:52:59.058801
2019-02-19T09:55:38
2019-02-19T09:55:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,240
java
package com.qunar.fintech.plat.admin.query.enums; /** * Created by bob.li on 2015/9/18. */ public enum RepayStatusEnum { NOT_REPAY(0, "未还款"), REPAYING(1, "还款中"), BANK_GOT(2, "银行已受理"), BANK_REPAYED(3, "银行已还款"); private Integer code; private String name; private RepayStatusEnum(Integer code, String name) { this.code = code; this.name = name; } public Integer getCode() { return code; } public void setCode(Integer code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public static RepayStatusEnum toEnum(int code) { switch (code) { case 0: return NOT_REPAY; case 1: return REPAYING; case 2: return BANK_GOT; case 3: return BANK_REPAYED; default: return null; } } @Override public String toString() { return "RepayStatusEnum{" + "code=" + code + ", name='" + name + '\'' + '}'; } }
[ "guijun.qu@quanr.com" ]
guijun.qu@quanr.com
a2460a92243b3ac8dd819ebcb187322d5d8d976b
d139ef1959ce88cf33c4b547a84c64acc06ca370
/src/main/java/meetingapp/dao/IEmployeeDAO.java
d2f2f244fb9ab8654f81572331d5391dd41d1624
[]
no_license
bcicek8/MeetingApp
435b7f11588890ff06cb2f4c033789db3076227b
9e4cedfbff27ddc6c4fbd1c90d42f04cb11cdf63
refs/heads/master
2021-01-25T08:12:57.854812
2017-06-08T09:19:42
2017-06-08T09:19:42
93,728,791
0
0
null
null
null
null
UTF-8
Java
false
false
366
java
package meetingapp.dao; import java.util.List; import meetingapp.entity.Employee; public interface IEmployeeDAO { List<Employee> getAllEmployees(); Employee getEmployeeById(int employeeId); void addEmployee(Employee employee); void updateEmployee(Employee employee); void deleteEmployee(int employeeId); boolean employeeExists(String name); }
[ "burak@burak" ]
burak@burak
924acf77b936a6beb8159ce0f927b55e9b8175f4
745b525c360a2b15b8d73841b36c1e8d6cdc9b03
/jun_java_plugins/jun_javase/src/main/java/com/jun/plugin/javase/winterHomeWork/Exercise9/StringTest2.java
467f91ae5199567a2f061f41d5b3fa78d3e3b175
[]
no_license
wujun728/jun_java_plugin
1f3025204ef5da5ad74f8892adead7ee03f3fe4c
e031bc451c817c6d665707852308fc3b31f47cb2
refs/heads/master
2023-09-04T08:23:52.095971
2023-08-18T06:54:29
2023-08-18T06:54:29
62,047,478
117
42
null
2023-08-21T16:02:15
2016-06-27T10:23:58
Java
UTF-8
Java
false
false
1,046
java
package com.jun.plugin.javase.winterHomeWork.Exercise9; import java.util.Scanner; public class StringTest2 { public static void main(String[] args) { Scanner scan=new Scanner(System.in); System.out.println("��������ĸ��"); String name=scan.next(); checkString(name); } static void checkString(String name) { System.out.println("���������ĸ���ǣ�"+name); String rege="[a-zA-Z]+"; String reget="\\p{Upper}+[a-zA-Z]*"; if(!name.matches(rege)) { System.out.println("����������������ĸ����"); } else if(!name.matches(reget)){ System.out.println("��һ����ĸ���Ǵ�д��ĸ"); } else if(name.matches(rege)&&name.matches(reget)) { char[] arr=name.toCharArray(); int count=0; for(int i=0;i<arr.length;i++) { String temp=String.valueOf(arr[i]); if(temp.matches(reget)) { count++; } } System.out.println("�ַ�����һ����"+count+"����д��ĸ"); } } }
[ "wujun728@163.com" ]
wujun728@163.com
063508b785f500406d4c36cb257a0df345ead3f8
b5fb43cb074fab148cfdb72a46f74ff7b6314f01
/src/BFS_2178.java
ce61dcf6e9745111054b77f71b52a2e135436c16
[]
no_license
chshin33/SW_BOJ
aa7e9989e26d4216ee4b4cf063b71107a0475ea2
2a991266cef5ff1c2bbeb0d28b1f69b676c88cde
refs/heads/master
2020-04-05T14:34:21.722073
2017-07-06T15:32:57
2017-07-06T15:32:57
94,685,103
1
0
null
null
null
null
UTF-8
Java
false
false
1,881
java
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.ArrayDeque; import java.util.StringTokenizer; public class BFS_2178 { public static class Node{ int row, col; public Node(int row, int col){ this.row = row; this.col = col; } } static int N, M; static int[][] input; static int[][] discovered; static int DEBUG=0; static ArrayDeque<Node> queue; public static void main(String[] args) throws Exception { System.setIn(new FileInputStream("sample_BFS_2178.txt")); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.nextToken()); M = Integer.parseInt(st.nextToken()); input = new int[N+1][M+1]; discovered = new int[N+1][M+1]; for(int i=1; i<=N; i++){ String temp = br.readLine(); for(int j=1; j<=M; j++){ input[i][j] = temp.charAt(j-1) - '0'; } } if(DEBUG==1){ for(int i=1; i<=N; i++){ for(int j=1; j<=M; j++){ System.out.print(input[i][j] + "\t"); } System.out.println(); } } int[] dRow = {-1, 0, 1, 0}; int[] dCol = { 0, 1, 0, -1}; queue = new ArrayDeque<Node>(); queue.add(new Node(1,1)); discovered[1][1] = input[1][1]; while(!queue.isEmpty()){ Node now = queue.poll(); int nextRow, nextCol; for(int i=0; i<4;i++){ nextRow = now.row + dRow[i]; nextCol = now.col + dCol[i]; if(nextRow<=0 || nextRow>N || nextCol<=0 || nextCol > M){ continue; } if(input[nextRow][nextCol] ==1 && discovered[nextRow][nextCol]==0){ queue.add(new Node(nextRow, nextCol)); discovered[nextRow][nextCol] = discovered[now.row][now.col] +1; } } } System.out.println(discovered[N][M]); } }
[ "Jeong@DESKTOP-KEER0C2" ]
Jeong@DESKTOP-KEER0C2
5e82c0faa84d8aeb48f20501b38214c6fa74082f
a7717cb09e0a7c89a3409d01a58f62c2c41997e8
/src/main/java/project/conf/resource/ormapper/dao/HpAddressContactD/HpAddressContactDDao.java
0d3bf49a87375ccc745915955bca0783f5959da4
[]
no_license
sawhsong/alpaca
999989c2a06f8923cceb5f6c0432863b725a3e3d
783057130c19163b6b5eb2e901161155aefe10ba
refs/heads/master
2023-08-07T02:38:24.106460
2023-07-30T22:53:27
2023-07-30T22:53:27
143,237,867
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
/************************************************************************************************** * Framework Generated DAO Source * - HP_ADDRESS_CONTACT_D - *************************************************************************************************/ package project.conf.resource.ormapper.dao.HpAddressContactD; import project.conf.resource.ormapper.dto.oracle.HpAddressContactD; import zebra.base.IDao; public interface HpAddressContactDDao extends IDao { public HpAddressContactD getAddressContactByPersonId(String personId) throws Exception; public String getPreferredEmailByPersonId(String personId) throws Exception; }
[ "sawhsong@gmail.com" ]
sawhsong@gmail.com
959b465ba305bf825519cd34631d02b3a85b167b
18c51f87a302787fbfac3d05ecd3ac6c4a0345cb
/Stones/TwoStones.java
faf09a6df7303784522a9ef1f28a9f19ed857113
[]
no_license
weronkagolonka/kattis
080ad6f6d99e62b33ab116a679b900bf0f6315ed
a94075b778f0988d07b22a71d077732a6bf7b97b
refs/heads/main
2023-08-25T01:44:26.275177
2021-10-22T21:16:04
2021-10-22T21:16:04
311,949,946
0
0
null
null
null
null
UTF-8
Java
false
false
264
java
public class TwoStones { int stones; public TwoStones(int stones) { this.stones = stones; } public String winner() { if (stones % 2 == 0) { return "Bob"; } else { return "Alice"; } } }
[ "weronizk@uio.no" ]
weronizk@uio.no
4371824ea7d46267da01221bece0423c5929843e
6f5c85757bb410d39fd29a0599311ca9a499213b
/mybatis_plus_springboot/src/test/java/cn/itcast/MtabtisPlusSpringbootApplicationTests.java
51de83ec1b44777852e7f23f7a46685a87e1c8e5
[]
no_license
badbad001/ssm
8fdf2d55267d9247c2cf6133b1c443b26d44119e
b6c0b81f11bb774b3954934c0dab2d7925763903
refs/heads/master
2022-12-22T11:46:37.304818
2019-10-05T09:30:49
2019-10-05T09:30:49
207,476,606
0
0
null
2022-12-15T23:43:57
2019-09-10T05:57:22
Java
UTF-8
Java
false
false
974
java
package cn.itcast; import cn.itcast.mapper.EmpMapper; import cn.itcast.pojo.Emp; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class MtabtisPlusSpringbootApplicationTests { @Autowired private EmpMapper empMapper; @Test public void contextLoads() { Emp emp = empMapper.selectById(1); System.out.println(emp); } @Test public void demo2() { IPage<Emp> page = empMapper.selectPage(new Page<>(1, 2), null); System.out.println(page.getTotal()); for (Emp emp : page.getRecords()) { System.out.println(emp); } } }
[ "1946408873@qq.com" ]
1946408873@qq.com
b39eeea49353797eb9027de3af836d14958f8661
9355ff50a01587dfd0275bf1f7ce02d3a989e595
/imooc-shiro/shiro-web/src/main/java/com/imooc/filter/RolesOrFilter.java
63be3bc28be2b2ba3b2d87ff7c6fdb1827ffb895
[]
no_license
IndifferentApple/imooc
1391304a79b243a5bbdbcd97b2824152019372d5
3406d3b911f5635b96863a3383083d42983432c4
refs/heads/main
2023-08-15T09:03:10.782100
2021-10-18T13:33:13
2021-10-18T13:33:13
396,853,673
0
0
null
null
null
null
UTF-8
Java
false
false
787
java
package com.imooc.filter; import org.apache.shiro.subject.Subject; import org.apache.shiro.web.filter.authz.AuthorizationFilter; /** * @author :peter * @description:TODO * @date :2021/10/16 16:42 */ public class RolesOrFilter extends AuthorizationFilter { @Override protected boolean isAccessAllowed(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, Object o) throws Exception { Subject subject = getSubject(servletRequest,servletResponse); String[] roles = (String[]) o; if(roles == null || roles.length == 0){ return true; } for(String role:roles){ if(subject.hasRole(role)){ return true; } } return false; } }
[ "30270919@qq.com" ]
30270919@qq.com
96e2aee318b9f6de83399f3c46be4cef3597ae7f
9d8365acee0fcd7ab51094eaa1fe2d413504fb8c
/src/main/java/com/bo/common/dao/LogDao.java
038bc4e36309a65062558e6c2ffe7e22412b66b0
[]
no_license
ysertine/score_manegement
e71873d400228ec48e54215a09f8b0cec2acdfb4
ba8aae80c21b3a9d9ba4cc7eb2b73e97530c515b
refs/heads/master
2021-08-31T12:48:57.376218
2017-12-21T10:20:34
2017-12-21T10:20:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
202
java
package com.bo.common.dao; import com.bo.common.entity.Log; /** * 系统日志DAO接口 * @author DengJinbo. * @Time 2017年9月1日 */ public interface LogDao extends BaseDao<Log> { }
[ "335196272@qq.com" ]
335196272@qq.com
5d164f2945a4335df067265d193580c6b5ef1458
79852243e1dfb080d13a3ea24fa47694167fe68b
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PixyTest.java
f9638132c9bad259eeaacb203c546c303ce520e5
[ "BSD-3-Clause" ]
permissive
lukeboi/ftc_app
337766e9b5aaa32297a89addd75269e92bf6eea7
1f1231c8c7a7f1417f95e557ef0f28f3de37c1ab
refs/heads/master
2021-09-06T09:41:36.600560
2018-02-05T03:07:19
2018-02-05T03:07:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,609
java
package org.firstinspires.ftc.teamcode; import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.hardware.HardwareMap; import com.qualcomm.robotcore.robot.Robot; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.hardware.AnalogSensor; import com.qualcomm.robotcore.hardware.AnalogInput; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import com.qualcomm.robotcore.hardware.DeviceInterfaceModule; import com.qualcomm.robotcore.hardware.DigitalChannel; /* * This is an example LinearOpMode that shows how to use the digital inputs and outputs on the * the Modern Robotics Device Interface Module. In addition, it shows how to use the Red and Blue LED * * This op mode assumes that there is a Device Interface Module attached, named 'dim'. * On this DIM there is a digital input named 'digin' and an output named 'digout' * * To fully exercise this sample, connect pin 3 of the digin connector to pin 3 of the digout. * Note: Pin 1 is indicated by the black stripe, so pin 3 is at the opposite end. * * The X button on the gamepad will be used to activate the digital output pin. * The Red/Blue LED will be used to indicate the state of the digital input pin. * Blue = false (0V), Red = true (5V) * If the two pins are linked, the gamepad will change the LED color. * * Use Android Studio to Copy this Class, and Paste it into your team's code folder with a new name. * Remove or comment out the @Disabled line to add this opmode to the Driver Station OpMode list */ @Autonomous(name = "PixyTesting", group = "Sensor") public class PixyTest extends LinearOpMode { final int BLUE_LED_CHANNEL = 0; final int RED_LED_CHANNEL = 1; @Override public void runOpMode() { Core robot = new Core(); robot.init(hardwareMap, false); // robot.jewel.setPosition() // // get a reference to a Modern Robotics DIM, and IO channels. // dim = hardwareMap.get(DeviceInterfaceModule.class, "dim"); // Use generic form of device mapping // digIn = hardwareMap.get(DigitalChannel.class, "digin"); // Use generic form of device mapping // digOut = hardwareMap.get(DigitalChannel.class, "digout"); // Use generic form of device mapping // digIn.setMode(DigitalChannel.Mode.INPUT); // Set the direction of each channel // digOut.setMode(DigitalChannel.Mode.OUTPUT); // wait for the start button to be pressed. telemetry.addData(">", "Press play, and then user X button to set DigOut"); telemetry.update(); waitForStart(); robot.jewel.setPosition(.35); while (opModeIsActive()) { // outputPin = gamepad1.x ; // Set the output pin based on x button // digOut.setState(outputPin); // inputPin = digIn.getState(); // Read the input pin // // Display input pin state on LEDs // if (inputPin) { // dim.setLED(RED_LED_CHANNEL, true); // dim.setLED(BLUE_LED_CHANNEL, false); // } // else { // dim.setLED(RED_LED_CHANNEL, false); // dim.setLED(BLUE_LED_CHANNEL, true); // } if(robot.pixyb.getVoltage() > 1.65) { telemetry.addData("on the ", "right"); } else { telemetry.addData("on the ", "left"); } telemetry.addData("A:", robot.pixya.getVoltage()); telemetry.addData("B:", robot.pixyb.getVoltage()); telemetry.update(); } robot.jewel.setPosition(1); } }
[ "lukefarritor@gmail.com" ]
lukefarritor@gmail.com
2fff0792390104ffc784cba3811f37ee1547754a
ff373b4ed346a3dea063b692c123524beb67dc29
/designMode/抽象工厂-农场/src/com/think123/farm/NorthernGardener.java
f7c1fb48633650ceb244b283eeadd8bad83ff172
[]
no_license
plzthink123/JavaDesignMode
790deaca74de0026b6fad9c416ae45b14dbaae56
3e46a5e0009fcf1c4ba3ff4a36d6639766531b46
refs/heads/master
2020-05-21T09:03:10.321861
2019-05-10T13:24:16
2019-05-10T13:24:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
package com.think123.farm; public class NorthernGardener implements Gardener { @Override public Fruit createFruit(String name) { return new NorthernFruit(name); } @Override public Veggie createVeggie(String name) { return new NorthernVeggie(name); } }
[ "think123@lizhedeMacBook-Pro.local" ]
think123@lizhedeMacBook-Pro.local
2d30403c8a0ab3f09a02b439fc4bc196478e3502
21d0dc533823e7741b6c1e60b6fe39f76d2c2203
/LingkaranTest.java
c85db56c50b5220c6d0386ce413224deb373d3a7
[]
no_license
aryono3188/BaruBelajar
1a1ba4d68c4b5fe62c0a694336bcd690c6e41db3
374289369a9db62ae22151aad17bcc197b8a7789
refs/heads/master
2020-12-08T12:49:06.020192
2020-01-10T09:16:08
2020-01-10T09:16:08
232,985,312
0
0
null
null
null
null
UTF-8
Java
false
false
2,062
java
package TestLingkaran; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; class LingkaranTest { @Test void setLuasAngkaBulat() { Lingkaran lingkaran = new Lingkaran(); double tes = 3; lingkaran.setLuas(tes); double aktual = lingkaran.luas; double exspektasi = 28.259999999999998; assertEquals(aktual,exspektasi); } @Test void getLuasAngkaBulat() { Lingkaran lingkaran = new Lingkaran(); double tes = 3; lingkaran.setLuas(tes); double aktual = lingkaran.getLuas(); double exspektasi = 28.259999999999998; assertEquals(aktual,exspektasi); } @Test void setLuasAngkaBerkoma() { Lingkaran lingkaran = new Lingkaran(); double tes = 3.5; lingkaran.setLuas(tes); double aktual = lingkaran.luas; double exspektasi = 38.465; assertEquals(aktual,exspektasi); } @Test void getLuasAngkaBerkoma() { Lingkaran lingkaran = new Lingkaran(); double tes = 3.5; lingkaran.setLuas(tes); double aktual = lingkaran.getLuas(); double exspektasi = 38.465; assertEquals(aktual,exspektasi); } @Test void setKelilingBulat() { Lingkaran lingkaran = new Lingkaran(); double tes = 2; lingkaran.setKeliling(tes); double aktual = lingkaran.keliling; double exspektasi = 12.56; assertEquals(aktual,exspektasi); } @Test void getKelilingBulat() { Lingkaran lingkaran = new Lingkaran(); double tes = 2; lingkaran.setKeliling(tes); double aktual = lingkaran.getKeliling(); double exspektasi = 12.56; assertEquals(aktual,exspektasi); } @Test void setKelilingBerkoma() { Lingkaran lingkaran = new Lingkaran(); double tes = 3.5; lingkaran.setKeliling(tes); double aktual = lingkaran.keliling; double exspektasi = 21.98; assertEquals(aktual,exspektasi); } @Test void getKelilingBerkoma() { Lingkaran lingkaran = new Lingkaran(); double tes = 3.5; lingkaran.setKeliling(tes); double aktual = lingkaran.getKeliling(); double exspektasi = 21.98; assertEquals(aktual,exspektasi); } }
[ "aryono3188@gmail.com" ]
aryono3188@gmail.com
db9df5528bdae25aaa22c92c2999576789e010a4
099c7107cdb3b30962fb692656b104778c7aceb6
/src/main/java/life/majiang/community/model/Notification.java
116e43a745b1c75908d0b93ab0239662c4623895
[]
no_license
tiger-guo/community
2281b4d2a2e3da7bf8dbf912bdee73e4f094255a
589f1caab169c2d6fdf8a880213bdd050b60904e
refs/heads/master
2022-07-12T22:47:33.708111
2019-08-29T16:14:29
2019-08-29T16:14:29
202,361,635
0
1
null
2022-06-17T02:24:13
2019-08-14T13:58:18
Java
UTF-8
Java
false
false
6,444
java
package life.majiang.community.model; public class Notification { /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column NOTIFICATION.ID * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ private Long id; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column NOTIFICATION.NOTIFIER * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ private Long notifier; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column NOTIFICATION.RECEIVER * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ private Long receiver; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column NOTIFICATION.OUTERID * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ private Long outerid; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column NOTIFICATION.TYPE * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ private Integer type; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column NOTIFICATION.GMT_CREATE * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ private Long gmtCreate; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column NOTIFICATION.STATUS * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ private Integer status; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column NOTIFICATION.ID * * @return the value of NOTIFICATION.ID * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public Long getId() { return id; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column NOTIFICATION.ID * * @param id the value for NOTIFICATION.ID * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public void setId(Long id) { this.id = id; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column NOTIFICATION.NOTIFIER * * @return the value of NOTIFICATION.NOTIFIER * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public Long getNotifier() { return notifier; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column NOTIFICATION.NOTIFIER * * @param notifier the value for NOTIFICATION.NOTIFIER * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public void setNotifier(Long notifier) { this.notifier = notifier; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column NOTIFICATION.RECEIVER * * @return the value of NOTIFICATION.RECEIVER * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public Long getReceiver() { return receiver; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column NOTIFICATION.RECEIVER * * @param receiver the value for NOTIFICATION.RECEIVER * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public void setReceiver(Long receiver) { this.receiver = receiver; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column NOTIFICATION.OUTERID * * @return the value of NOTIFICATION.OUTERID * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public Long getOuterid() { return outerid; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column NOTIFICATION.OUTERID * * @param outerid the value for NOTIFICATION.OUTERID * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public void setOuterid(Long outerid) { this.outerid = outerid; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column NOTIFICATION.TYPE * * @return the value of NOTIFICATION.TYPE * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public Integer getType() { return type; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column NOTIFICATION.TYPE * * @param type the value for NOTIFICATION.TYPE * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public void setType(Integer type) { this.type = type; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column NOTIFICATION.GMT_CREATE * * @return the value of NOTIFICATION.GMT_CREATE * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public Long getGmtCreate() { return gmtCreate; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column NOTIFICATION.GMT_CREATE * * @param gmtCreate the value for NOTIFICATION.GMT_CREATE * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public void setGmtCreate(Long gmtCreate) { this.gmtCreate = gmtCreate; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column NOTIFICATION.STATUS * * @return the value of NOTIFICATION.STATUS * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public Integer getStatus() { return status; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column NOTIFICATION.STATUS * * @param status the value for NOTIFICATION.STATUS * * @mbg.generated Wed Aug 28 11:38:37 CST 2019 */ public void setStatus(Integer status) { this.status = status; } }
[ "1774687347@qq.com" ]
1774687347@qq.com
038dacb2571ae3a45b9162c77196b97b76d6a8ee
ae91c254d926113d7bb963b216bd9884a0898e2b
/gamedata/d2p/ankama/Map.java
d28d13a296b7d93585621f09abbb2f235f621925
[]
no_license
Cooya/Tobby
7defafc1c69894c4651395fa2b1470372b3a9cac
0e56bc305c9ca9d7da4541ee30cd05f114a783c3
refs/heads/master
2020-03-13T13:42:08.531646
2017-10-03T18:56:06
2017-10-03T18:56:06
131,144,234
8
3
null
null
null
null
UTF-8
Java
false
false
7,257
java
package gamedata.d2p.ankama; import gamedata.d2o.modules.MapPosition; import gamedata.d2p.Cell; import java.util.Vector; import main.FatalError; import utilities.ByteArray; public class Map { public static final int WIDTH = 14; public static final int HEIGHT = 20; // 40 pour l'ancienne version du pathfinder public static final int RIGHT = 0; public static final int DOWN_RIGHT = 1; public static final int DOWN = 2; public static final int DOWN_LEFT = 3; public static final int LEFT = 4; public static final int UP_LEFT = 5; public static final int UP = 6; public static final int UP_RIGHT = 7; private static final String decryptionKey = "649ae451ca33ec53bbcbcc33becf15f4"; public static final int CELLS_COUNT = 560; public Class<Map> mapClass; public int mapVersion; public boolean encrypted; public int encryptionVersion; public int groundCRC; public double zoomScale = 1; public int zoomOffsetX; public int zoomOffsetY; public int groundCacheCurrentlyUsed = 0; public int id; public int relativeId; public int mapType; public int backgroundsCount; public Fixture[] backgroundFixtures; public int foregroundsCount; public Fixture[] foregroundFixtures; public int subareaId; public int shadowBonusOnEntities; public int backgroundColor; public int backgroundRed; public int backgroundGreen; public int backgroundBlue; public int topNeighbourId; public int bottomNeighbourId; public int leftNeighbourId; public int rightNeighbourId; public boolean useLowPassFilter; public boolean useReverb; public int presetId; public int cellsCount; public int layersCount; public boolean isUsingNewMovementSystem = false; public Layer[] layers; public Cell[] cells; public Vector<Integer> topArrowCell; public Vector<Integer> leftArrowCell; public Vector<Integer> bottomArrowCell; public Vector<Integer> rightArrowCell; private boolean _parsed; private boolean _failed; //private Vector<> _gfxList; //private Vector<> _gfxCount; public Map(ByteArray raw) { this.mapClass = Map.class; this.topArrowCell = new Vector<Integer>(); this.bottomArrowCell = new Vector<Integer>(); this.leftArrowCell = new Vector<Integer>(); this.rightArrowCell = new Vector<Integer>(); fromRaw(raw); } public boolean getParsed() { return this._parsed; } public boolean getFailed() { return this._failed; } public void fromRaw(ByteArray raw) { raw.readByte(); // 77 this.mapVersion = raw.readByte(); this.id = raw.readInt(); if(this.mapVersion >= 7) { this.encrypted = raw.readBoolean(); this.encryptionVersion = raw.readByte(); int dataLen = raw.readInt(); if(this.encrypted) { if(decryptionKey == null) throw new FatalError("Map decryption key is empty."); byte[] encryptedData = raw.readBytes(dataLen); int keySize = decryptionKey.length(); for(int i = 0; i < dataLen; ++i) encryptedData[i] = (byte) (encryptedData[i] ^ decryptionKey.charAt(i % keySize)); raw.setArray(encryptedData); } } this.relativeId = raw.readInt(); this.mapType = raw.readByte(); this.subareaId = raw.readInt(); this.topNeighbourId = raw.readInt(); this.bottomNeighbourId = raw.readInt(); this.leftNeighbourId = raw.readInt(); this.rightNeighbourId = raw.readInt(); this.shadowBonusOnEntities = raw.readInt(); if(this.mapVersion >= 3) { this.backgroundRed = raw.readByte(); this.backgroundGreen = raw.readByte(); this.backgroundBlue = raw.readByte(); this.backgroundColor = ((((this.backgroundRed & 0xFF) << 16) | ((this.backgroundGreen & 0xFF) << 8)) | (this.backgroundBlue & 0xFF)); } if(this.mapVersion >= 4) { this.zoomScale = (raw.readShort() / 100); this.zoomOffsetX = raw.readShort(); this.zoomOffsetY = raw.readShort(); if(this.zoomScale < 1) { this.zoomScale = 1; this.zoomOffsetX = (this.zoomOffsetY = 0); } this.useLowPassFilter = (raw.readByte() == 1); this.useReverb = (raw.readByte() == 1); if(this.useReverb) this.presetId = raw.readInt(); else this.presetId = -1; Fixture fixture; this.backgroundsCount = raw.readByte(); this.backgroundFixtures = new Fixture[this.backgroundsCount]; for(int i = 0; i < this.backgroundsCount; ++i) { fixture = new Fixture(this); fixture.fromRaw(raw); this.backgroundFixtures[i] = fixture; } this.foregroundsCount = raw.readByte(); this.foregroundFixtures = new Fixture[this.foregroundsCount]; for(int i = 0; i < this.foregroundsCount; ++i) { fixture = new Fixture(this); fixture.fromRaw(raw); this.foregroundFixtures[i] = fixture; } this.cellsCount = CELLS_COUNT; raw.readInt(); this.groundCRC = raw.readInt(); this.layersCount = raw.readByte(); this.layers = new Layer[this.layersCount]; Layer layer; for(int i = 0; i < layersCount; ++i) { layer = new Layer(this); layer.fromRaw(raw, this.mapVersion); this.layers[i] = layer; } this.cells = new Cell[this.cellsCount]; Cell cell; int _oldMvtSystem = -1; for(int i = 0; i < this.cellsCount; ++i) { cell = new Cell(this, i); cell.fromRaw(raw); if(_oldMvtSystem == -1) _oldMvtSystem = cell.moveZone; if(cell.moveZone != _oldMvtSystem) this.isUsingNewMovementSystem = true; this.cells[i] = cell; } this._parsed = true; } } public int getNeighbourMapFromDirection(int direction) { switch(direction) { case LEFT : return this.leftNeighbourId; case RIGHT : return this.rightNeighbourId; case UP : return this.topNeighbourId; case DOWN : return this.bottomNeighbourId; default : throw new FatalError("Invalid direction for find neighbour map id"); } } public static String directionToString(int direction) { switch(direction) { case RIGHT : return "right"; case DOWN_RIGHT : return "down and right"; case DOWN : return "down"; case DOWN_LEFT : return "down and left"; case LEFT : return "left"; case UP_LEFT : return "up and left"; case UP : return "up"; case UP_RIGHT : return "up and right"; default : throw new FatalError("Invalid direction integer."); } } @Override public String toString() { MapPosition mp = MapPosition.getMapPositionById(this.id); return this.id + " [" + mp.posX + ", " + mp.posY + "]"; } }
[ "nicolas.marcy@etu.u-bordeaux.fr" ]
nicolas.marcy@etu.u-bordeaux.fr
6107ed52896cae6fb5f47be901540489354a5a9f
1bc7239d91b5076eaef085cf2dc61b24e0ceb0d6
/BootstrapServer/src/lk/uom/dc/BootstrapServer.java
5eb6fdd6c4af2d2aac86f021a7f3ebfa031e9f70
[]
no_license
akilaadi/DistributedFileSearch
a2ec7b94c268154a1255bb0587d8bbf8b6c114e0
6859ffb5c168d9770a50e69837097dab253b3c8f
refs/heads/master
2021-09-04T16:03:41.534520
2018-01-20T05:03:54
2018-01-20T05:03:54
106,914,673
0
0
null
null
null
null
UTF-8
Java
false
false
5,346
java
package lk.uom.dc; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.StringTokenizer; public class BootstrapServer { public static void main(String args[]) { DatagramSocket sock = null; String s; List<Neighbour> nodes = new ArrayList<Neighbour>(); try { sock = new DatagramSocket(55555); echo("Bootstrap Server created at 55555. Waiting for incoming data..."); while(true) { byte[] buffer = new byte[65536]; DatagramPacket incoming = new DatagramPacket(buffer, buffer.length); sock.receive(incoming); byte[] data = incoming.getData(); s = new String(data, 0, incoming.getLength()); //echo the details of incoming data - client ip : client port - client message echo(incoming.getAddress().getHostAddress() + " : " + incoming.getPort() + " - " + s); StringTokenizer st = new StringTokenizer(s, " "); String length = st.nextToken(); String command = st.nextToken(); if (command.equals("REG")) { String reply = "REGOK "; String ip = st.nextToken(); int port = Integer.parseInt(st.nextToken()); String username = st.nextToken(); if (nodes.size() == 0) { reply += "0"; nodes.add(new Neighbour(ip, port, username)); } else { boolean isOkay = true; for (int i=0; i<nodes.size(); i++) { if (nodes.get(i).getPort() == port) { if (nodes.get(i).getUsername().equals(username)) { reply += "9998"; } else { reply += "9997"; } isOkay = false; } } if (isOkay) { if (nodes.size() == 1) { reply += "1 " + nodes.get(0).getIp() + " " + nodes.get(0).getPort(); } else if (nodes.size() == 2) { reply += "2 " + nodes.get(0).getIp() + " " + nodes.get(0).getPort() + " " + nodes.get(1).getIp() + " " + nodes.get(1).getPort(); } else { Random r = new Random(); int Low = 0; int High = nodes.size(); int random_1 = r.nextInt(High-Low) + Low; int random_2 = r.nextInt(High-Low) + Low; while (random_1 == random_2) { random_2 = r.nextInt(High-Low) + Low; } echo (random_1 + " " + random_2); reply += "2 " + nodes.get(random_1).getIp() + " " + nodes.get(random_1).getPort() + " " + nodes.get(random_2).getIp() + " " + nodes.get(random_2).getPort(); } nodes.add(new Neighbour(ip, port, username)); } } reply = String.format("%04d", reply.length() + 5) + " " + reply; DatagramPacket dpReply = new DatagramPacket(reply.getBytes() , reply.getBytes().length , incoming.getAddress() , incoming.getPort()); sock.send(dpReply); } else if (command.equals("UNREG")) { String ip = st.nextToken(); int port = Integer.parseInt(st.nextToken()); String username = st.nextToken(); for (int i=0; i<nodes.size(); i++) { if (nodes.get(i).getPort() == port) { nodes.remove(i); String reply = "0012 UNROK 0"; DatagramPacket dpReply = new DatagramPacket(reply.getBytes() , reply.getBytes().length , incoming.getAddress() , incoming.getPort()); sock.send(dpReply); } } } else if (command.equals("ECHO")) { for (int i=0; i<nodes.size(); i++) { echo(nodes.get(i).getIp() + " " + nodes.get(i).getPort() + " " + nodes.get(i).getUsername()); } String reply = "0012 ECHOK 0"; DatagramPacket dpReply = new DatagramPacket(reply.getBytes() , reply.getBytes().length , incoming.getAddress() , incoming.getPort()); sock.send(dpReply); } } } catch(IOException e) { System.err.println("IOException " + e); } } //simple function to echo data to terminal public static void echo(String msg) { System.out.println(msg); } }
[ "akila.adi@gmail.com" ]
akila.adi@gmail.com
fa6c66e62206abf414e006cbf0628830a4f3dc75
f5caa5685ea16358c5bcdf570f7b3ef153887b4c
/app/src/main/java/com/yao/testdemo/toast/ToastTest.java
c047abc307c43b54bf0b71871cd5884cd515243a
[]
no_license
lxyao/Demo
417e3410935a379108dc2d84267cafbc1f62ea44
560231b29e6f9ae315c7f7dadfcdbcd945d96bc0
refs/heads/master
2021-01-10T07:42:36.486835
2016-03-11T11:56:35
2016-03-11T11:56:35
53,376,704
0
0
null
null
null
null
UTF-8
Java
false
false
1,246
java
package com.yao.testdemo.toast; import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.TextView; import com.yao.testdemo.R; import com.yao.testdemo.util.ToastUtil; /** * Created by Yao on 2016/2/23 0023. */ public class ToastTest extends Activity { private static final String TAG = "ToastTest"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_toast_test_layout); } public void onAction1(View v){ switch (v.getId()){ case R.id.system_toast: ToastUtil.systemToast(this, "系统的Toast"); break; case R.id.once_toast: ToastUtil.showOnceToast(this, "多次点击显示一次的Toast"); break; case R.id.view_toast: View view = ToastUtil.showViewToast(this, R.layout.my_toast_layout); if(view != null){ TextView tv = (TextView) view.findViewById(R.id.my_toast_tv_id); tv.setText("View Toast"); tv.setTextColor(Color.RED); view.setBackgroundResource(R.drawable.my_toast_background); } break; case R.id.default_view_toast: ToastUtil.showViewToast(this, "默认view Toast", 0, 0); break; } } }
[ "zhangdingyao@yousi.com" ]
zhangdingyao@yousi.com
a9d3bd2e31a8ae6331612365784292aaf6a9ff5b
387aa9d4e76e677a00a4631661cb7162658556a5
/module2/src/module-info.java
44fbe89a73257bd9d193a960ad2e36667949da03
[]
no_license
wangyu19810820/JDKNewVersion
c1e8632677ac10723e82708e3b26cda39b76d9fd
362e2c538e59892e1eae40b82bb3b9dd1d01da21
refs/heads/master
2022-11-27T11:43:56.486722
2020-08-06T08:15:04
2020-08-06T08:15:04
270,945,817
0
0
null
null
null
null
UTF-8
Java
false
false
109
java
module module2 { requires module1; requires java.logging; requires junit; exports jdk9test; }
[ "gadfly0036_cn@sina.com" ]
gadfly0036_cn@sina.com
569bbc13adcdf2126774dbfdcdff2a3e0a02a643
939bc9b579671de84fb6b5bd047db57b3d186aca
/jdk.internal.vm.compiler/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NarrowingReadTest.java
4ae212e4e456d8138f30ad019c94f36297bdb1f5
[]
no_license
lc274534565/jdk11-rm
509702ceacfe54deca4f688b389d836eb5021a17
1658e7d9e173f34313d2e5766f4f7feef67736e8
refs/heads/main
2023-01-24T07:11:16.084577
2020-11-16T14:21:37
2020-11-16T14:21:37
313,315,578
1
1
null
null
null
null
UTF-8
Java
false
false
1,433
java
/* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * */ package org.graalvm.compiler.core.test; import org.junit.Test; /** * Sometimes it's possible to emit a smaller read from a larger memory location instead reading the * whole thing and truncating it. Make sure it returns the right value. */ public class NarrowingReadTest extends GraalCompilerTest { public byte testNarrowReadSnippetByte(Long l) { return (byte) l.longValue(); } @Test public void testNarrowReadByte() { test("testNarrowReadSnippetByte", Long.valueOf(Byte.MAX_VALUE)); } public short testNarrowReadSnippetShort(Long l) { return (short) l.longValue(); } @Test public void testNarrowReadShort() { test("testNarrowReadSnippetShort", Long.valueOf(Short.MAX_VALUE)); } public int testNarrowReadSnippetInt(Long l) { return (int) l.longValue(); } @Test public void testNarrowReadInt() { test("testNarrowReadSnippetInt", Long.valueOf(Integer.MAX_VALUE)); } public long testNarrowReadSnippetIntToLong(Long l) { return (int) l.longValue(); } @Test public void testNarrowReadIntToLong() { test("testNarrowReadSnippetIntToLong", Long.valueOf(Integer.MAX_VALUE)); } }
[ "274534565@qq.com" ]
274534565@qq.com
0650a88d42a3383ea8dd19b53ce3e48264a8715c
48d9ded7c9dd8e112f1fc387490589f41189c7aa
/realtime-agg/src/main/java/com/rock/analyse/v1/LauncherDriverV1.java
48390143668334512093daaddf4a34d2cb419d73
[]
no_license
jiangqingsong/first_resp
4c54dc79df9e342227370a20cf1294f45114289a
c1c8df96f522be6d8816c0ec4acbd642400234c8
refs/heads/master
2022-07-10T18:37:36.802940
2020-03-26T04:14:16
2020-03-26T04:14:16
244,341,256
0
0
null
2022-06-21T03:02:42
2020-03-02T10:20:32
Scala
UTF-8
Java
false
false
5,188
java
package com.rock.analyse.v1; import com.rock.analyse.MessageTypeKeySelector; import com.rock.analyse.fn.FilterFn; import com.rock.analyse.fn.Kafka2MessageTypeFn; import com.rock.analyse.fn.RockAssignerWithPeriodicWatermarks; import com.rock.analyse.util.RockConstants; import org.apache.flink.api.common.ExecutionConfig; import org.apache.flink.api.common.accumulators.IntCounter; import org.apache.flink.api.common.functions.AbstractRichFunction; import org.apache.flink.api.common.functions.MapFunction; import org.apache.flink.api.common.functions.RichMapFunction; import org.apache.flink.api.common.serialization.SimpleStringSchema; import org.apache.flink.api.java.utils.ParameterTool; import org.apache.flink.streaming.api.TimeCharacteristic; import org.apache.flink.streaming.api.datastream.DataStream; import org.apache.flink.streaming.api.datastream.DataStreamSource; import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; import org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows; import org.apache.flink.streaming.api.windowing.time.Time; import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer; import java.io.InputStream; import java.util.Properties; public class LauncherDriverV1 { public static void main(String[] args) throws Exception { InputStream inputStream = LauncherDriverV1.class.getResourceAsStream("/cfg.properties"); Properties properties = new Properties(); properties.load(inputStream); System.out.println(properties.get("kafka.brokers")); // 默认不做checkpoint final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); ExecutionConfig.GlobalJobParameters globalJobParameters = new ExecutionConfig.GlobalJobParameters(); env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime); env.getConfig().setAutoWatermarkInterval(5000); /** * demo start. */ IntCounter intCounter = new IntCounter(); intCounter.add(1); DataStreamSource<String> textSource = env.readTextFile(""); textSource.map(x -> x.split("\t")).map(x -> x[0]); textSource.map(new RichMapFunction<String, String>() { @Override public String map(String s) throws Exception { return null; } }); SingleOutputStreamOperator<String> map = textSource.map(new MapFunction<String, String>() { @Override public String map(String s) throws Exception { return s + "\"test\""; } }); env.enableCheckpointing(5000);//set checkpoint. // 保存更多的数据可以写磁盘 // StateBackend rocksDBStateBackend = new RocksDBStateBackend("hdfs:/data/data1/", true); // env.setStateBackend(rocksDBStateBackend); env.getConfig().setGlobalJobParameters(globalJobParameters); Properties kafkaPro = new Properties(); kafkaPro.setProperty("bootstrap.servers", properties.getProperty("kafka.brokers")); kafkaPro.setProperty("group.id", properties.getProperty("kafka.group_id")); kafkaPro.setProperty("fetch.min.bytes", "100000"); FlinkKafkaConsumer<String> flinkKafkaConsumer = new FlinkKafkaConsumer<>(properties.getProperty("kafka.topic"), new SimpleStringSchema(), kafkaPro); flinkKafkaConsumer.setStartFromEarliest(); // 添加数据源 DataStreamSource<String> dataStreamSource = env.addSource(flinkKafkaConsumer); // kafka的并行度 SingleOutputStreamOperator<AnalysePojoV1> dataStream = dataStreamSource .map(new Kafka2MessageTypeFn()).uid("kafka->messageType") .filter(new FilterFn()).uid("filter->null") .assignTimestampsAndWatermarks(new RockAssignerWithPeriodicWatermarks()).uid("RockAssignerWithPeriodicWatermarks") .keyBy(new MessageTypeKeySelector()) .timeWindow(Time.milliseconds(3*60*1000)) .aggregate(new MRockAggregateFunction(), new MRockProcessWindowFunction()).uid(""); dataStream.print(); // DataStream<AnalysePojoV1> hourDataStream = dataStream.getSideOutput(RockConstants.HOUR_OUTPUT_TAG); SingleOutputStreamOperator<AnalysePojoV1> dataStream1 = hourDataStream .keyBy(new AnalysePojoSelector()) .timeWindow(Time.milliseconds(6*60*1000)) .aggregate(new HRockAggregateFunction(), new HRockProcessWindowFunction()); DataStream<AnalysePojoV1> dataStream2 = dataStream1.getSideOutput(RockConstants.DAY_OUTPUT_TAG); dataStream2.print(); SingleOutputStreamOperator dataStream3 = dataStream2 .keyBy(new AnalysePojoSelector()) .window(TumblingEventTimeWindows.of(Time.days(1L),Time.hours(-8))) //天有时区问题 .aggregate(new HRockAggregateFunction(), new HRockProcessWindowFunction()); dataStream3.print(); env.execute("test kafka "); } }
[ "565175219@qq.com" ]
565175219@qq.com
d88f3363aecb4ed5de55f8f61f5d0424bf1d1afd
8bd41de25ca9d92057980f6a78eb8f2cc9fa8197
/nomenclature-services/src/main/java/sn/hubschool/nomenclature/repo/INomenclaturePersistance.java
ee593a0cb5b906d2f27420b194c1b3e7c18c3a2c
[]
no_license
laminetop/projet-hubschool
8c367b5122faff2d639e4616ba0c5c0ea04d252e
25da8a8c75439f7dbaec011ba601a883809476fe
refs/heads/master
2020-03-19T15:10:18.876230
2018-06-08T22:37:17
2018-06-08T22:37:17
136,658,718
0
0
null
null
null
null
UTF-8
Java
false
false
2,138
java
package sn.hubschool.nomenclature.repo; import sn.hubschool.nomenclature.domain.vo.Nomenclature; import java.util.List; /** * Interface pour NomenclatureDAO. * */ public interface INomenclaturePersistance { /** * Récupère la liste des nomenclatures existantes. * * @return la liste des nomenclature */ List <Nomenclature> lister(); /** * Récupère la nomenclature <code>codeNomenclature</code>. * * @param codeNomenclature * le code de la nomenclature * @return la nomenclature dont le code est <code>codeNomenclature</code> */ Nomenclature rechercherParCode(String codeNomenclature); /** * Recherche toutes les nomenclatures avec les nomenclatures qui lui sont liées. * * @return l'ensemble des nomenclatures avec les nomenclatures qui lui sont liées */ List < Nomenclature > rechercherNomenclaturesAvecLiens(); /** * Recherche la nomenclature dont le code est <code>codeNomenclature</code> et qui est liée à la nomenclature * <code>codeNomenclature1</code>. * * @param codeNomenclature * la nomenclature à rechercher * @param codeNomenclature1 * le nomenclature reliée * @return la nomenclature dont le code est <code>codeNomenclature</code> et qui est liée à la nomenclature * <code>codeNomenclature1</code>, null sinon */ Nomenclature rechercherNomenclatureParLienNomenclature1(final String codeNomenclature, final String codeNomenclature1); /** * Recherche la nomenclature dont le code est <code>codeNomenclature</code> et qui est liée à la nomenclature * <code>codeNomenclature2</code>. * * @param codeNomenclature * la nomenclature à rechercher * @param codeNomenclature2 * le nomenclature reliée * @return la nomenclature dont le code est <code>codeNomenclature</code> et qui est liée à la nomenclature * <code>codeNomenclature2</code>, null sinon */ Nomenclature rechercherNomenclatureParLienNomenclature2(final String codeNomenclature, final String codeNomenclature2); }
[ "toplamzo10@gmail.com" ]
toplamzo10@gmail.com
2c201d116dc8c85611194ed9d52a2541b850e6d2
5bc90cfcceb0dd598d4bde673c855e76e607303b
/PeekingIterator.java
ae443c0e5cc9fdf003016f54df064b0ee255873f
[]
no_license
yangkklt/leetcode_amazon
2fc86d04c1b30158a768439bc3aa2da545004e92
c09f7694ee834771af8b4667b94b9bd11f9f2426
refs/heads/master
2020-04-18T17:04:11.109611
2015-10-18T05:02:28
2015-10-18T05:02:28
40,576,268
0
0
null
null
null
null
UTF-8
Java
false
false
1,123
java
// Java Iterator interface reference: // https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html import java.util.NoSuchElementException; class PeekingIterator implements Iterator<Integer> { private Integer peek; private final Iterator<Integer> iterator; public PeekingIterator(Iterator<Integer> iterator) { // initialize any member here. this.iterator = iterator; } // Returns the next element in the iteration without advancing the iterator. public Integer peek() { if (!hasNext()) { throw new NoSuchElementException("No Element left"); } return peek; } // hasNext() and next() should behave the same as in the Iterator interface. // Override them if needed. @Override public Integer next() { if (!hasNext()) { throw new NoSuchElementException("No Element left"); } Integer res = peek; peek = null; return res; } @Override public boolean hasNext() { if (peek != null) { return true; } if (iterator.hasNext()) { peek = iterator.next(); } return peek != null; } }
[ "tianyangche@gmail.com" ]
tianyangche@gmail.com
6c4270655fcd4b578badd459e3df51bc0a6f2e02
ed5e9fd5c1c9ca94da00fd505e946c8af48e2fd1
/lab1/HelloNumbers.java
35e1fce65f17f13ac628917ea28fd5176f0aab7e
[]
no_license
tingedudu8/Berkeley-CS61B-sp18
c99cf2705385dcd558cfe70a054c0eb56891441a
eb808ada73f5ecb6a57bd2ad3e70d6a7a49508a5
refs/heads/master
2023-04-12T12:33:11.796426
2021-05-20T07:49:02
2021-05-20T07:49:02
353,977,836
0
0
null
null
null
null
UTF-8
Java
false
false
683
java
/*Revised for Exercise 1.1.2. Modify HelloNumbers so that it prints out the cumulative sum of the integers from 0 to 9. For example, your output should start with 0 1 3 6 10... and should end with 45.*/ public class HelloNumbers { public static void main(String[] args) { int x = 0; int i = 0; while (i <= 9) { x = x + i; i += 1; System.out.print(x + " "); } } } /* 1. All code in Java must be part of a class. 2. We delimit the beginning and end of segments of code using { and }. 3. All statements in Java must end in a semi-colon. 4. For code to run we need public static void main(String[] args) */
[ "2788655279@qq.com" ]
2788655279@qq.com
513c30d06c7492bb2d5b03fd3b0ae8d3d1f645b6
f93f85e8227fd28712305d60afc13a4f7c61c5f3
/spring-boot-rest-api/src/main/java/com/springboot/SpringBootRestApiApp.java
58f4a6039616ff78f4e8e641ca462936142af28b
[]
no_license
snaithm/ruby-cucumber-workshop
fcd640e5e01d61eb9e4be0fbbe44c4feeab3d49f
cede170e33e4a04aa7fdcbc0c49b0de8b3515b82
refs/heads/master
2023-01-09T22:14:02.680150
2019-07-25T07:57:07
2019-07-25T07:57:07
198,594,756
0
0
null
2023-01-03T15:04:05
2019-07-24T08:44:14
Java
UTF-8
Java
false
false
437
java
package com.springboot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication(scanBasePackages={"com.springboot"})// same as @Configuration @EnableAutoConfiguration @ComponentScan combined public class SpringBootRestApiApp { public static void main(String[] args) { SpringApplication.run(SpringBootRestApiApp.class, args); } }
[ "matthew.snaith@dvla.gov.uk" ]
matthew.snaith@dvla.gov.uk
5f42c17513ca2a212a885b2b29a639b5a68a9a0b
ef2defbb5a523d114c32b4824ef29e81334b1604
/src/main/java/cn/liuyiyou/java/thread/JoinTest2.java
ed04d0ea14deb49223d2bdb0957ca97a577bf0aa
[]
no_license
liuyiyou/cn.liuyiyou.java
daf5c37cadf88596d07f7eb13a9a44c5dce9d813
48c71965fb407b201e46c6ff137dc537e34be4c8
refs/heads/master
2022-12-22T06:54:38.492277
2020-05-13T10:11:15
2020-05-13T10:11:15
110,930,489
0
0
null
2022-12-16T04:30:38
2017-11-16T06:07:11
Java
UTF-8
Java
false
false
1,581
java
/** * 所属项目:cn.liuyiyou.java * 文件名称:cn.liuyiyou.java.thread.JoinTest1.java * 日期: 2017年8月9日下午10:57:15 * Copyright (c) 2017, liuyiyou.cn All Rights Reserved. * */ package cn.liuyiyou.java.thread; /** * http://www.mamicode.com/info-detail-517008.html * @author liuyiyou.cn * @date 2017年8月9日 下午10:57:15 * @version */ public class JoinTest2 extends Thread { private String name; public JoinTest2(String name) { super(name); this.name = name; } public void run() { System.out.println(Thread.currentThread().getName() + " 线程运行开始!"); for (int i = 0; i < 5; i++) { System.out.println("子线程" + name + "运行 : " + i); try { sleep((int) Math.random() * 10); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println(Thread.currentThread().getName() + " 线程运行结束!"); } public static void main(String[] args) { System.out.println(Thread.currentThread().getName() + "主线程运行开始!"); Thread mTh1 = new Thread("A"); Thread mTh2 = new Thread("B"); mTh1.start(); mTh2.start(); try { // 这里需要理解的就是该线程是指的主线程等待子线程的终止。也就是在子线程调用了join()方法后面的代码,只有等到子线程结束了才能执行。 mTh1.join(); } catch (InterruptedException e) { e.printStackTrace(); } try { mTh2.join(); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(Thread.currentThread().getName() + "主线程运行结束!"); } }
[ "liuyiyou@daojia.com" ]
liuyiyou@daojia.com
ac97619ccf464fd11ebb313c677ad091143d740f
48f1bca1cd5236162bb924222e1cf28690d52700
/Classification/DataMing_ID3/Client.java
28c6d77f01337bbfca96874fa758bd35f40c8bcc
[]
no_license
wsgan001/DataMiningAlgorithmSet
deb81f3d4c337a352f2c6465a8988cdea796a67b
c626235f0db8bb7b87bfde22df29d6e53ca2242a
refs/heads/master
2022-01-07T21:58:31.564240
2019-02-18T03:12:09
2019-02-18T03:12:09
null
0
0
null
null
null
null
GB18030
Java
false
false
384
java
package DataMing_ID3; /** * ID3决策树分类算法测试场景类 * @author lyq * */ public class Client { public static void main(String[] args){ String filePath = "C:\\Users\\Administrator\\Desktop\\DataMiningAlgorithm-master\\DataMiningAlgorithm\\Classification\\DataMining_ID3\\input.txt"; ID3Tool tool = new ID3Tool(filePath); tool.startBuildingTree(true); } }
[ "masterqkk@outlook.com" ]
masterqkk@outlook.com
4c7c880e19dd9b10da975f1198c3f99126dd8482
744114c1c3769ac9342e8a92d089b96957b4a74a
/app/src/main/java/edu_up_cs301/game/RulesActivity.java
5b10ae6db3a11d40d5b869681e62096a1fe61cb1
[]
no_license
OnlyForObjectOrientednayyar19/Ludocrous-Alpha
5a94805170bcafe054acc20120786891dd5c0a3e
5257cb048bd70d04b6d4ca447a0b3f7fb063546c
refs/heads/master
2020-03-09T23:50:05.071912
2018-04-11T09:17:33
2018-04-11T09:17:33
129,067,553
1
1
null
null
null
null
UTF-8
Java
false
false
333
java
package edu_up_cs301.game; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class RulesActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_rules); } }
[ "randomuser1190@gmail.com" ]
randomuser1190@gmail.com
364c7673a4ea4bc0f6cf31140dba8675e80606d5
1eabf8d99ed1bf70ddb3119b9bc0ec2388a4ae75
/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/CanSubscribeFeature.java
2e0e27b0575154ce63b8dc9c9321aa3589163118
[ "BSD-3-Clause", "LGPL-2.0-or-later", "EPL-1.0", "LicenseRef-scancode-unicode", "LGPL-2.1-or-later", "CDDL-1.0", "MIT", "LicenseRef-scancode-unicode-icu-58", "MPL-1.0", "W3C", "GPL-1.0-or-later", "Apache-2.0", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
CICBA/DSpace
c849eedd4cda37460a9023418d5c26214af48bf5
932845a833c345a2c76aa8b80a53c37ba0b3890a
refs/heads/master
2023-08-18T02:29:20.835964
2023-08-10T17:09:57
2023-08-10T17:09:57
23,224,860
5
8
BSD-3-Clause
2023-08-04T14:49:59
2014-08-22T12:39:27
Java
UTF-8
Java
false
false
2,140
java
/** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ package org.dspace.app.rest.authorization.impl; import static org.dspace.core.Constants.READ; import java.sql.SQLException; import java.util.Objects; import org.dspace.app.rest.authorization.AuthorizationFeature; import org.dspace.app.rest.authorization.AuthorizationFeatureDocumentation; import org.dspace.app.rest.model.BaseObjectRest; import org.dspace.app.rest.model.CollectionRest; import org.dspace.app.rest.model.CommunityRest; import org.dspace.app.rest.utils.Utils; import org.dspace.authorize.service.AuthorizeService; import org.dspace.content.DSpaceObject; import org.dspace.core.Context; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * Checks if the given user can subscribe to a DSpace object * * @author Alba Aliu (alba.aliu at atis.al) */ @Component @AuthorizationFeatureDocumentation(name = CanSubscribeFeature.NAME, description = "Used to verify if the given user can subscribe to a DSpace object") public class CanSubscribeFeature implements AuthorizationFeature { public static final String NAME = "canSubscribeDso"; @Autowired private Utils utils; @Autowired private AuthorizeService authorizeService; @Override @SuppressWarnings("rawtypes") public boolean isAuthorized(Context context, BaseObjectRest object) throws SQLException { if (Objects.isNull(context.getCurrentUser())) { return false; } DSpaceObject dSpaceObject = (DSpaceObject) utils.getDSpaceAPIObjectFromRest(context, object); return authorizeService.authorizeActionBoolean(context, context.getCurrentUser(), dSpaceObject, READ, true); } @Override public String[] getSupportedTypes() { return new String[]{ CommunityRest.CATEGORY + "." + CommunityRest.NAME, CollectionRest.CATEGORY + "." + CollectionRest.NAME }; } }
[ "michele.boychuk@gmail.com" ]
michele.boychuk@gmail.com
1f1aa4e6ca21bae1de43025417bab1a2eb1150d8
9f4d53ff91fc22c9c5a9fd3233a4ddd138e44825
/kodilla-hibernate/src/test/java/com/kodilla/hibernate/tasklist/dao/TaskListDaoTestSuite.java
c00dea1382132b9e96fda60c14e355df9e77999c
[]
no_license
tomasz-piotrowicz/tomasz-piotrowicz-kodilla-java
da0890e587cc2ef71c5961e4c1994bb6a42a781e
7c637a90c1112f2b6029753132e5c5e8086b9a80
refs/heads/master
2021-01-19T17:55:04.143195
2018-01-20T17:45:25
2018-01-20T17:45:25
101,097,154
0
0
null
null
null
null
UTF-8
Java
false
false
2,179
java
package com.kodilla.hibernate.tasklist.dao; import com.kodilla.hibernate.task.Task; import com.kodilla.hibernate.task.TaskFinancialDetails; import com.kodilla.hibernate.tasklist.TaskList; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.math.BigDecimal; import java.util.List; @RunWith(SpringRunner.class) @SpringBootTest public class TaskListDaoTestSuite { @Autowired private TaskListDao taskListDao; private static final String LISTNAME = "Test name of the List"; @Test public void testFindByListName() { //Given TaskList taskList = new TaskList(LISTNAME, "Temporary list description"); taskListDao.save(taskList); String listName = taskList.getListName(); //When List<TaskList> readTasks =taskListDao.findByListName(listName); TaskList readTask = taskListDao.findOne(1); //Then Assert.assertEquals(1, readTasks.size()); Assert.assertEquals(LISTNAME, listName); //CleanUp int id = readTasks.get(0).getId(); taskListDao.delete(id); } @Test public void testTaskListDaoSaveWithTasks() { //Given Task task = new Task("Test: Learn Hibernate", 14); Task task2 = new Task("Test: Write some entities", 3); TaskFinancialDetails tfd = new TaskFinancialDetails(new BigDecimal(20), false); TaskFinancialDetails tfd2 = new TaskFinancialDetails(new BigDecimal(10), false); task.setTaskFinancialDetails(tfd); task2.setTaskFinancialDetails(tfd2); TaskList taskList = new TaskList(LISTNAME, "ToDo tasks"); taskList.getTasks().add(task); taskList.getTasks().add(task2); task.setTaskList(taskList); task2.setTaskList(taskList); //When taskListDao.save(taskList); int id = taskList.getId(); //Then Assert.assertNotEquals(0, id); //CleanUp taskListDao.delete(id); } }
[ "pantomash@gmail.com" ]
pantomash@gmail.com
4119e567e122023a95db7b77eebc2112904645d2
5f632330225761945745b34ad373c2ca7c1ae965
/API/vision-api/src/main/java/com/ktab/vision/api/dao/impl/UserDaoImpl.java
a42766d485659728a2f931a37fb110ea2ddd49ba
[]
no_license
nlory-ma/Vision
260742de570f24d9ac83df943817b4fc37071480
aadcf989c2f9b12a56de1c5af9568f958d336391
refs/heads/master
2020-12-03T02:25:49.112543
2016-03-03T19:05:22
2016-03-03T19:05:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,003
java
package com.ktab.vision.api.dao.impl; import java.util.ArrayList; import java.util.List; import javax.transaction.Transactional; import org.hibernate.SessionFactory; import com.ktab.vision.api.dao.UserDao; import com.ktab.vision.api.dao.model.User; public class UserDaoImpl implements UserDao { private SessionFactory sessionFactory; @Override public User findByEmail(String username) { return findByParameter(username, "email"); } @SuppressWarnings("unchecked") @Transactional private User findByParameter(String value, String parameter) { List<User> users = new ArrayList<User>(); users = getSessionFactory().getCurrentSession().createQuery("from User where " + parameter + "=?").setParameter(0, value).list(); if (users.size() > 0) { return users.get(0); } else { return null; } } public SessionFactory getSessionFactory() { return sessionFactory; } public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } }
[ "me@thomasabraham.in" ]
me@thomasabraham.in
380e3a8bee48480745ec6c8ee6c66ebcd052de12
941356ebacdd74bd1ede956650091b3be1517e70
/src/main/java/com/turlygazhy/dao/impl/CarDao.java
1adb6e239d049d79a4ce590432dfbd6342e00032
[]
no_license
BaldOgr/Ardaiym
626548d893d40fdcf57b5a7f4723b64273583ce6
47c5b33d4b6a15b86dac46b137499ea739b787fe
refs/heads/Ardaiym
2020-12-03T01:51:11.240053
2017-07-25T13:30:50
2017-07-25T13:30:50
95,874,627
0
0
null
2017-07-26T04:16:09
2017-06-30T09:51:46
Java
UTF-8
Java
false
false
1,864
java
package com.turlygazhy.dao.impl; import com.turlygazhy.dao.AbstractDao; import com.turlygazhy.entity.Car; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; /** * Created by daniyar on 03.07.17. */ public class CarDao extends AbstractDao { Connection connection; public CarDao(Connection connection) { this.connection = connection; } public void insertCar(Car car) throws SQLException { PreparedStatement ps = connection.prepareStatement("INSERT INTO CARS (NAME, USER_ID, STOCK_ID) VALUES(?, ?, ?)"); ps.setString(1, car.getName()); ps.setLong(2, car.getUserId()); ps.setInt(3, car.getStockId()); ps.executeUpdate(); ResultSet rs = ps.getGeneratedKeys(); if (rs.next()){ car.setId(rs.getInt(1)); } } public Car getCar(int cars_id) throws SQLException { PreparedStatement ps = connection.prepareStatement("SELECT * FROM CARS WHERE ID = ?"); ps.setInt(1, cars_id); ps.execute(); ResultSet rs = ps.getResultSet(); if (rs.next()) { return parseCar(rs); } return null; } private Car parseCar(ResultSet rs) throws SQLException { Car car = new Car(); car.setId(rs.getInt("ID")); car.setName(rs.getString("NAME")); car.setUserId(rs.getLong("USER_ID")); return car; } public List<Car> getCars() throws SQLException { List<Car> cars = new ArrayList<>(); PreparedStatement ps = connection.prepareStatement("SELECT * FROM CARS"); ps.execute(); ResultSet rs = ps.getResultSet(); while (rs.next()) { cars.add(parseCar(rs)); } return cars; } }
[ "mrtusup@gmail.com" ]
mrtusup@gmail.com
3686c5b91a09d3ffab4cf67b08fe2f11003fe130
7515ff16706d815ab53ddb52df7938c29f9535ad
/app/src/main/java/com/balaji/projects/myweatherapp/utils/UnitConvertor.java
8a982b3cd40aa6dd14b19bb89f9a2f9ee6913a5a
[]
no_license
balajipaulraj/Weather
e5389014ed9231c032539a53d68e9962e93bfac4
d320b318ef6ac431098d9d1e74369df239bcb0a5
refs/heads/master
2020-03-19T01:41:20.940398
2018-05-31T11:00:16
2018-05-31T11:00:16
135,564,427
0
0
null
null
null
null
UTF-8
Java
false
false
4,720
java
package com.balaji.projects.myweatherapp.utils; import android.content.SharedPreferences; import java.util.Locale; public class UnitConvertor { public static float convertTemperature(float temperature, SharedPreferences sp) { if (sp.getString("unit", "°C").equals("°C")) { return UnitConvertor.kelvinToCelsius(temperature); } else if (sp.getString("unit", "°C").equals("°F")) { return UnitConvertor.kelvinToFahrenheit(temperature); } else { return temperature; } } public static float kelvinToCelsius(float kelvinTemp) { return kelvinTemp - 273.15f; } public static float kelvinToFahrenheit(float kelvinTemp) { return (((9 * kelvinToCelsius(kelvinTemp)) / 5) + 32); } public static String getRainString(double rain, SharedPreferences sp) { if (rain > 0) { if (sp.getString("lengthUnit", "mm").equals("mm")) { if (rain < 0.1) { return " (<0.1 mm)"; } else { return String.format(Locale.ENGLISH, " (%.1f %s)", rain, sp.getString("lengthUnit", "mm")); } } else { rain = rain / 25.4; if (rain < 0.01) { return " (<0.01 in)"; } else { return String.format(Locale.ENGLISH, " (%.2f %s)", rain, sp.getString("lengthUnit", "mm")); } } } else { return ""; } } public static float convertPressure(float pressure, SharedPreferences sp) { if (sp.getString("pressureUnit", "hPa").equals("kPa")) { return pressure / 10; } else if (sp.getString("pressureUnit", "hPa").equals("mm Hg")) { return (float) (pressure * 0.750061561303); } else if (sp.getString("pressureUnit", "hPa").equals("in Hg")) { return (float) (pressure * 0.0295299830714); } else { return pressure; } } public static double convertWind(double wind, SharedPreferences sp) { if (sp.getString("speedUnit", "m/s").equals("kph")) { return wind * 3.6; } else if (sp.getString("speedUnit", "m/s").equals("mph")) { return wind * 2.23693629205; } else if (sp.getString("speedUnit", "m/s").equals("kn")) { return wind * 1.943844; } else if (sp.getString("speedUnit", "m/s").equals("bft")) { if(wind < 0.3) { return 0; // Calm } else if (wind < 1.5) { return 1; // Light air } else if (wind < 3.3) { return 2; // Light breeze } else if (wind < 5.5) { return 3; // Gentle breeze } else if (wind < 7.9) { return 4; // Moderate breeze } else if (wind < 10.7) { return 5; // Fresh breeze } else if (wind < 13.8) { return 6; // Strong breeze } else if (wind < 17.1) { return 7; // High wind } else if (wind < 20.7) { return 8; // Gale } else if (wind < 24.4) { return 9; // Strong gale } else if (wind < 28.4) { return 10; // Storm } else if (wind < 32.6) { return 11; // Violent storm } else { return 12; // Hurricane } } else { return wind; } } public static String getBeaufortName(int wind) { if(wind == 0) { return "Calm"; } else if (wind == 1) { return "Light air"; } else if (wind == 2) { return "Light breeze"; } else if (wind == 3) { return "Gentle breeze"; } else if (wind == 4) { return "Moderate breeze"; } else if (wind == 5) { return "Fresh breeze"; } else if (wind == 6) { return "Strong breeze"; } else if (wind == 7) { return "High wind"; } else if (wind == 8) { return "Gale"; } else if (wind == 9) { return "Strong gale"; } else if (wind == 10) { return "Storm"; } else if (wind == 11) { return "Violent storm"; } else { return "Hurricane"; } } }
[ "balaji@coldwatersl.com" ]
balaji@coldwatersl.com
7982b583ced6c97d838d6e2d0f34742d62899d52
b6c72c456a8a33e8fe76c177577686deec2b1202
/restful-web-services/src/main/java/com/bucketdev/rest/webservices/restfulwebservices/exception/ExceptionResponse.java
52f6d58418bd03aea7c70dfc586cca207a42acae
[]
no_license
vanfigo/spring-microservices
83a9d17d7e0aa8956efb16e80d6471faacb5d9f5
ac29e9ace81a08d4d0c76b0032aacea9f999b49c
refs/heads/master
2020-04-11T04:48:40.345921
2019-04-08T20:50:14
2019-04-08T20:50:14
161,526,925
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.bucketdev.rest.webservices.restfulwebservices.exception; import java.util.Date; public class ExceptionResponse { private Date timestamp; private String message; private String detail; public ExceptionResponse(Date timestamp, String message, String detail) { super(); this.timestamp = timestamp; this.message = message; this.detail = detail; } public Date getTimestamp() { return timestamp; } public String getMessage() { return message; } public String getDetail() { return detail; } }
[ "rodrigo.loyola@live.com" ]
rodrigo.loyola@live.com
37932e329ba70e386c2c0f2096dba118d55aacd8
374fa213d13d8739a1f81cd01716b63cf5cd50e7
/common/src/main/java/cn/wu1588/common/adapter/ImChatFacePagerAdapter.java
5b9a887e02b676ca825953de07fae177c3e0829f
[]
no_license
838245284/sbmall
22dea5509df20e77e53fe4e726308e0b0e74c438
cf975886955225cd54f48a69ba98a51ac95100ce
refs/heads/develop
2023-06-11T20:15:46.413200
2021-07-14T15:11:16
2021-07-14T15:11:16
380,426,907
0
0
null
2021-07-14T15:11:17
2021-06-26T06:02:48
Java
UTF-8
Java
false
false
2,678
java
package cn.wu1588.common.adapter; import android.content.Context; import android.support.annotation.Nullable; import android.support.v4.view.PagerAdapter; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; import java.util.List; import cn.wu1588.common.R; import cn.wu1588.common.interfaces.OnFaceClickListener; import cn.wu1588.common.utils.FaceUtil; /** * Created by cxf on 2018/7/11. * 聊天表情的ViewPager Adapter */ public class ImChatFacePagerAdapter extends PagerAdapter { private List<View> mViewList; private static final int FACE_COUNT = 20;//每页20个表情 public ImChatFacePagerAdapter(Context context, OnFaceClickListener onFaceClickListener) { LayoutInflater inflater = LayoutInflater.from(context); mViewList = new ArrayList<>(); List<String> faceList = FaceUtil.getFaceList(); int fromIndex = 0; int size = faceList.size(); int pageCount = size / FACE_COUNT; if (size % FACE_COUNT > 0) { pageCount++; for (int i = 0, count = pageCount * FACE_COUNT - size; i < count; i++) { faceList.add(""); } } for (int i = 0; i < pageCount; i++) { RecyclerView recyclerView = (RecyclerView) inflater.inflate(R.layout.view_chat_face_page, null, false); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new GridLayoutManager(context, 7, GridLayoutManager.VERTICAL, false)); int endIndex = fromIndex + FACE_COUNT; List<String> list = new ArrayList<>(); for (int j = fromIndex; j < endIndex; j++) { list.add(faceList.get(j)); } list.add("<"); recyclerView.setAdapter(new ImChatFaceAdapter(list, inflater, onFaceClickListener)); mViewList.add(recyclerView); fromIndex = endIndex; } } @Override public int getCount() { return mViewList.size(); } @Override public boolean isViewFromObject(@Nullable View view, @Nullable Object object) { return view == object; } @Override public Object instantiateItem(@Nullable ViewGroup container, int position) { View view = mViewList.get(position); container.addView(view); return view; } @Override public void destroyItem(@Nullable ViewGroup container, int position, @Nullable Object object) { container.removeView(mViewList.get(position)); } }
[ "838245284@qq.com" ]
838245284@qq.com
d5d4e828e493d11fc02a7bd9d20a68e935ce4746
83d56024094d15f64e07650dd2b606a38d7ec5f1
/sicc_druida/fuentes/java/PedSubtiPosicListFormatter.java
6fbc3ef24c6b9c2d6c60c83b6eb04b0c9d51fb2f
[]
no_license
cdiglesias/SICC
bdeba6af8f49e8d038ef30b61fcc6371c1083840
72fedb14a03cb4a77f62885bec3226dbbed6a5bb
refs/heads/master
2021-01-19T19:45:14.788800
2016-04-07T16:20:51
2016-04-07T16:20:51
null
0
0
null
null
null
null
ISO-8859-10
Java
false
false
2,903
java
/* INDRA/CAR/mmg $Id: PedSubtiPosicListFormatter.java,v 1.1 2009/12/03 18:42:17 pecbazalar Exp $ DESC */ import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; import es.indra.belcorp.mso.*; import es.indra.druida.DruidaFormatoObjeto; import es.indra.druida.belcorp.MMGDruidaFormatoObjeto; import es.indra.druida.belcorp.MMGDruidaHelper; import es.indra.mare.common.dto.IMareDTO; import java.util.HashMap; import java.text.DecimalFormatSymbols; import es.indra.mare.common.mgu.manager.Property; import es.indra.utils.*; /** * Clase de formateo de objetos "PedSubtiPosic" para Druida * * @author Indra */ public class PedSubtiPosicListFormatter extends MMGDruidaFormatoObjeto { public PedSubtiPosicListFormatter() { } public void formatea(String s, Object obj) throws Exception { IMareDTO dto = (IMareDTO) obj; Vector pedSubtiPosicList = (Vector) dto.getProperty("result"); Vector result = new Vector(); HashMap propiedades = this.getUserProperties(); Property propiedadFecha = (Property)propiedades.get("FormatoFecha"); Property propiedadMiles = (Property)propiedades.get("FormatoNumericoSeparadorMiles"); Property propiedadDecimal = (Property)propiedades.get("FormatoNumericoSeparadorDecimales"); DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setDecimalSeparator(propiedadDecimal.getValue().toString().charAt(0)); symbols.setGroupingSeparator(propiedadMiles.getValue().toString().charAt(0)); for (int i = 0; i < pedSubtiPosicList.size(); i++) { PedSubtiPosicData pedSubtiPosicData = (PedSubtiPosicData) pedSubtiPosicList.elementAt(i); Vector row = new Vector(); // Aņadir la clave Hashtable primaryKey = pedSubtiPosicData.mmgGetPrimaryKey(); Enumeration keys = primaryKey.keys(); while (keys.hasMoreElements()) { Object element = primaryKey.get(keys.nextElement()); row.add((element != null ? element.toString() : "")); } // Aņadir el resto de atributos row.add((pedSubtiPosicData.getCodSubtPosi() != null ? FormatUtils.formatObject(pedSubtiPosicData.getCodSubtPosi(), MMGDruidaHelper.getUserDecimalFormatPattern(this), symbols) : "")); row.add((pedSubtiPosicData.getTposOidTipoPosi() != null ? FormatUtils.formatObject(pedSubtiPosicData.getTposOidTipoPosi(), MMGDruidaHelper.getUserDecimalFormatPattern(this), symbols) : "")); row.add((pedSubtiPosicData.getDescripcion() != null ? FormatUtils.formatObject(pedSubtiPosicData.getDescripcion(), MMGDruidaHelper.getUserDecimalFormatPattern(this), symbols) : "")); // Aņadir el atributo timestamp. Por ahora queda deshabilitado (ponemos un 0) ya que no hay bloqueos.... //row.add(new Long(pedSubtiPosicData.jdoGetTimeStamp()).toString()); row.add(new Long(0).toString()); result.add(row); } setCampo(s, result); } }
[ "hp.vega@hotmail.com" ]
hp.vega@hotmail.com
c8c084b6c5e43dc4ada2aa8a3c7af67da17097d0
4fd6ab270ccd697e1ee804dcea88e27b266a394a
/CS3004-Tutorial-1/src/echoserver.java
00d2b651adaeeead3b5d28ca8d20458ef0084709
[]
no_license
Benveer/cs3004-labs
de32b6dfe04985eb3c0720443712bbfe6419f926
804ecf68b98888cc75c84196944763f5b7421a9d
refs/heads/master
2023-01-29T11:26:39.175536
2020-12-10T00:30:16
2020-12-10T00:30:16
301,444,878
0
0
null
null
null
null
UTF-8
Java
false
false
2,303
java
import java.net.*; import java.io.*; public class echoserver { public static void main(String[] args) throws IOException { //Get the id of the local machine – not critical – included here just to show you how //Declare an object to store your computer's name InetAddress computerAddr = null; //Now store the local computer's name try{ computerAddr = InetAddress.getLocalHost(); } catch(UnknownHostException e){ System.out.println(e); } //Now print it out to the screen //You will need to use this number in your client program System.out.println("The address of this computer is... " + computerAddr.getHostName()); //Now set up the server socket on port 4000-4999 on the local machine //Change the port number 4321 to anything in that range (unlikely there will be another process //running on that port) ServerSocket serverSocket = null; try { serverSocket = new ServerSocket(4321); //Create the welcoming socket } catch (IOException e) { System.err.println("Could not listen on port: 4321."); System.exit(1); } System.out.println("Echo server up and waiting"); //Wait for client connection. When a client connects, make the link and carry on Socket clientSocket = null; try { clientSocket = serverSocket.accept(); //Listen for incoming TCP requests } catch (IOException e) { System.err.println("Server socket failed."); System.exit(1); } // Connect the input and the output to and from the socket PrintWriter echoOutput = new PrintWriter(clientSocket.getOutputStream(), true); BufferedReader echoInput = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); String inputLine, outputLine; //Repeatedly loop getting input from the client and just send it back while ((inputLine = echoInput.readLine()) != null) { //Wait for and read input from socket outputLine = inputLine; echoOutput.println(outputLine); System.out.println(outputLine);//Write output to socket } } }
[ "1729793@brunel.ac.uk" ]
1729793@brunel.ac.uk
d0f1da95aa3a19f9592a1a60e62a6b592b558cf5
a08ff306758d125264c9f7ce7f365316be8e172a
/app/src/main/java/com/cnews/guji/smart/helper/player/util/WindowUtil.java
f13c7c4606c09cc0a138092261d6f9a57651945c
[ "Apache-2.0" ]
permissive
xiamulo/GuJiNews_DayHot_2.0
bbbced3e1776e16ec44d1b00989ec8e588c5e113
4e0c748bc62db8112163d01013c0e524ea20c294
refs/heads/master
2023-07-11T04:09:09.449241
2021-08-25T06:25:45
2021-08-25T06:25:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,910
java
package com.cnews.guji.smart.helper.player.util; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.ContextWrapper; import android.content.res.Resources; import android.graphics.Point; import android.os.Build; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.view.ContextThemeWrapper; import android.util.TypedValue; import android.view.Display; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.view.WindowManager; /** * Window工具类 */ public class WindowUtil { /** * 获取状态栏高度 */ public static double getStatusBarHeight(Context context) { int statusBarHeight = 0; //获取status_bar_height资源的ID int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { //根据资源ID获取响应的尺寸值 statusBarHeight = context.getResources().getDimensionPixelSize(resourceId); } return statusBarHeight; } /** * 获取NavigationBar的高度 */ public static int getNavigationBarHeight(Context context) { if (!hasNavigationBar(context)) { return 0; } Resources resources = context.getResources(); int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); //获取NavigationBar的高度 return resources.getDimensionPixelSize(resourceId); } /** * 是否存在NavigationBar */ public static boolean hasNavigationBar(Context context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { Display display = getWindowManager(context).getDefaultDisplay(); Point size = new Point(); Point realSize = new Point(); display.getSize(size); display.getRealSize(realSize); return realSize.x != size.x || realSize.y != size.y; } else { boolean menu = ViewConfiguration.get(context).hasPermanentMenuKey(); boolean back = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK); return !(menu || back); } } /** * 获取屏幕宽度 */ public static int getScreenWidth(Context context) { return context.getResources().getDisplayMetrics().widthPixels; } /** * 获取屏幕高度 */ public static int getScreenHeight(Context context, boolean isIncludeNav) { if (isIncludeNav) { return context.getResources().getDisplayMetrics().heightPixels + getNavigationBarHeight(context); } else { return context.getResources().getDisplayMetrics().heightPixels; } } /** * 隐藏ActionBar,StatusBar,NavigationBar */ @SuppressLint("RestrictedApi") public static void hideSystemBar(Context context) { AppCompatActivity appCompatActivity = getAppCompActivity(context); if (appCompatActivity != null) { ActionBar ab = appCompatActivity.getSupportActionBar(); if (ab != null) { ab.setShowHideAnimationEnabled(false); ab.hide(); } } scanForActivity(context).getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); hideNavigationBar(context); } /** * 显示ActionBar,StatusBar,NavigationBar */ @SuppressLint("RestrictedApi") public static void showSystemBar(final Context context) { scanForActivity(context).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); showNavigationBar(context); AppCompatActivity appCompatActivity = getAppCompActivity(context); if (appCompatActivity != null) { ActionBar ab = appCompatActivity.getSupportActionBar(); if (ab != null) { ab.setShowHideAnimationEnabled(false); ab.show(); } } } /** * 获取Activity */ public static Activity scanForActivity(Context context) { return context == null ? null : (context instanceof Activity ? (Activity) context : (context instanceof ContextWrapper ? scanForActivity(((ContextWrapper) context).getBaseContext()) : null)); } private static void hideNavigationBar(Context context) { View decorView = scanForActivity(context).getWindow().getDecorView(); decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN); } private static void showNavigationBar(Context context) { View decorView = scanForActivity(context).getWindow().getDecorView(); int systemUiVisibility = decorView.getSystemUiVisibility(); int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN; systemUiVisibility &= ~flags; decorView.setSystemUiVisibility(systemUiVisibility); } /** * Get AppCompatActivity from context */ public static AppCompatActivity getAppCompActivity(Context context) { if (context == null) return null; if (context instanceof AppCompatActivity) { return (AppCompatActivity) context; } else if (context instanceof ContextThemeWrapper) { return getAppCompActivity(((ContextThemeWrapper) context).getBaseContext()); } return null; } /** * dp转为px */ public static int dp2px(Context context, float dpValue) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics()); } /** * sp转为px */ public static int sp2px(Context context, float dpValue) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, dpValue, context.getResources().getDisplayMetrics()); } /** * 如果WindowManager还未创建,则创建一个新的WindowManager返回。否则返回当前已创建的WindowManager。 */ public static WindowManager getWindowManager(Context context) { return (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); } /** * 边缘检测 */ public static boolean isEdge(Context context, MotionEvent e) { int edgeSize = dp2px(context, 50); return e.getRawX() < edgeSize || e.getRawX() > getScreenWidth(context) - edgeSize || e.getRawY() < edgeSize || e.getRawY() > getScreenHeight(context, true) - edgeSize; } }
[ "dincl@jsyl.com.cn" ]
dincl@jsyl.com.cn
4785564ed0316fbb8d5dd85ff22f9215b16d7c64
c0e020e09621a8b8f066f684d2e221ae3f945805
/app/src/test/java/yokastore/youkagames/com/yokastore/ExampleUnitTest.java
0d7e0b681806ef1e0f074fb80c6cc67720a43675
[]
no_license
soondh/ykStoreAndroid
ac5d478594b4ae3e5db9384701314e4b78acd9b8
937caf5f83dd2f036f0b1e8d619980696dbcda64
refs/heads/master
2020-04-30T07:13:27.081243
2019-03-20T07:28:57
2019-03-20T07:28:57
176,677,816
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package yokastore.youkagames.com.yokastore; 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); } }
[ "songdehua110@163.com" ]
songdehua110@163.com
13a5959b80609539824b994196125e13c1d3d25b
47982a1f83b410610196b330ce15a89587462b78
/src/main/java/br/edu/univas/si/lab6/bmi/controller/BMIController.java
af3446b421dfafad2e9da4723b41295a7f178848
[]
no_license
GuilhermeSanches/2015-java-bmi
82890e0652ff56488861bf0c438935994507cba6
cf2522c82fa90b7b0292b7aed7cadbb11c0a4391
refs/heads/master
2020-12-30T09:58:21.851969
2015-09-16T00:55:07
2015-09-16T00:55:07
42,147,367
0
0
null
null
null
null
UTF-8
Java
false
false
1,059
java
package br.edu.univas.si.lab6.bmi.controller; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import br.edu.univas.si.lab6.bmi.service.BMIService; /** * Servlet implementation class BMIController */ public class BMIController extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public BMIController() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Float weight = Float.valueOf(request.getParameter("weight")); Float height = Float.valueOf(request.getParameter("height")); Float bmiIndex = BMIService.getIndex(weight, height); response.getWriter().append(bmiIndex.toString()); } }
[ "guilherme_1993pa@hotmail.com" ]
guilherme_1993pa@hotmail.com
99b527afa7bae4f359ad92328a99e8294182816b
6675ae81570c84e5c5feb7d0f0f91301fe57b311
/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
b900f725bef7c79eaa0cabcfb4acfd4d2cd266f9
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
GeoPlatform/sis
babf402d7239bf285f6a3c80ca1f5bbdda01b5d5
5f24c696d3f54c1dfb5b42342cda2bdb6b80783b
refs/heads/trunk
2021-01-15T14:34:34.887850
2017-01-12T06:01:13
2017-01-12T06:01:13
78,760,242
0
0
null
2017-01-12T15:41:32
2017-01-12T15:41:32
null
UTF-8
Java
false
false
13,445
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.sis.referencing.crs; import java.util.Map; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import org.opengis.referencing.cs.CoordinateSystem; import org.opengis.referencing.crs.EngineeringCRS; import org.opengis.referencing.datum.EngineeringDatum; import org.apache.sis.referencing.cs.*; import org.apache.sis.referencing.AbstractReferenceSystem; import org.apache.sis.internal.metadata.MetadataUtilities; import org.apache.sis.internal.metadata.WKTKeywords; import org.apache.sis.io.wkt.Formatter; import static org.apache.sis.util.ArgumentChecks.ensureNonNull; /** * A 1-, 2- or 3-dimensional contextually local coordinate reference system. * It can be divided into two broad categories: * * <ul> * <li>earth-fixed systems applied to engineering activities on or near the surface of the earth;</li> * <li>CRSs on moving platforms such as road vehicles, vessels, aircraft, or spacecraft.</li> * </ul> * * <p><b>Used with datum type:</b> * {@linkplain org.apache.sis.referencing.datum.DefaultEngineeringDatum Engineering}.<br> * <b>Used with coordinate system types:</b> * {@linkplain org.apache.sis.referencing.cs.DefaultAffineCS Affine}, * {@linkplain org.apache.sis.referencing.cs.DefaultCartesianCS Cartesian}, * {@linkplain org.apache.sis.referencing.cs.DefaultCylindricalCS Cylindrical}, * {@linkplain org.apache.sis.referencing.cs.DefaultLinearCS Linear}. * {@linkplain org.apache.sis.referencing.cs.DefaultPolarCS Polar}, * {@linkplain org.apache.sis.referencing.cs.DefaultSphericalCS Spherical} or * {@linkplain org.apache.sis.referencing.cs.DefaultUserDefinedCS User Defined}. * </p> * * <div class="section">Immutability and thread safety</div> * This class is immutable and thus thread-safe if the property <em>values</em> (not necessarily the map itself), * the coordinate system and the datum instances given to the constructor are also immutable. Unless otherwise noted * in the javadoc, this condition holds if all components were created using only SIS factories and static constants. * * @author Martin Desruisseaux (IRD, Geomatys) * @since 0.4 * @version 0.7 * @module * * @see org.apache.sis.referencing.datum.DefaultEngineeringDatum * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#createEngineeringCRS(String) */ @XmlType(name = "EngineeringCRSType", propOrder = { "coordinateSystem", "datum" }) @XmlRootElement(name = "EngineeringCRS") public class DefaultEngineeringCRS extends AbstractCRS implements EngineeringCRS { /** * Serial number for inter-operability with different versions. */ private static final long serialVersionUID = 6695541732063382701L; /** * The datum. * * <p><b>Consider this field as final!</b> * This field is modified only at unmarshalling time by {@link #setDatum(EngineeringDatum)}</p> * * @see #getDatum() */ private EngineeringDatum datum; /** * Creates a coordinate reference system from the given properties, datum and coordinate system. * The properties given in argument follow the same rules than for the * {@linkplain AbstractReferenceSystem#AbstractReferenceSystem(Map) super-class constructor}. * The following table is a reminder of main (not all) properties: * * <table class="sis"> * <caption>Recognized properties (non exhaustive list)</caption> * <tr> * <th>Property name</th> * <th>Value type</th> * <th>Returned by</th> * </tr> * <tr> * <td>{@value org.opengis.referencing.IdentifiedObject#NAME_KEY}</td> * <td>{@link org.opengis.referencing.ReferenceIdentifier} or {@link String}</td> * <td>{@link #getName()}</td> * </tr> * <tr> * <td>{@value org.opengis.referencing.IdentifiedObject#ALIAS_KEY}</td> * <td>{@link org.opengis.util.GenericName} or {@link CharSequence} (optionally as array)</td> * <td>{@link #getAlias()}</td> * </tr> * <tr> * <td>{@value org.opengis.referencing.IdentifiedObject#IDENTIFIERS_KEY}</td> * <td>{@link org.opengis.referencing.ReferenceIdentifier} (optionally as array)</td> * <td>{@link #getIdentifiers()}</td> * </tr> * <tr> * <td>{@value org.opengis.referencing.IdentifiedObject#REMARKS_KEY}</td> * <td>{@link org.opengis.util.InternationalString} or {@link String}</td> * <td>{@link #getRemarks()}</td> * </tr> * <tr> * <td>{@value org.opengis.referencing.ReferenceSystem#DOMAIN_OF_VALIDITY_KEY}</td> * <td>{@link org.opengis.metadata.extent.Extent}</td> * <td>{@link #getDomainOfValidity()}</td> * </tr> * <tr> * <td>{@value org.opengis.referencing.ReferenceSystem#SCOPE_KEY}</td> * <td>{@link org.opengis.util.InternationalString} or {@link String}</td> * <td>{@link #getScope()}</td> * </tr> * </table> * * @param properties The properties to be given to the coordinate reference system. * @param datum The datum. * @param cs The coordinate system. * * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createEngineeringCRS(Map, EngineeringDatum, CoordinateSystem) */ public DefaultEngineeringCRS(final Map<String,?> properties, final EngineeringDatum datum, final CoordinateSystem cs) { super(properties, cs); ensureNonNull("datum", datum); this.datum = datum; } /** * Constructs a new coordinate reference system with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param crs The coordinate reference system to copy. * * @see #castOrCopy(EngineeringCRS) */ protected DefaultEngineeringCRS(final EngineeringCRS crs) { super(crs); datum = crs.getDatum(); } /** * Returns a SIS coordinate reference system implementation with the same values than the given * arbitrary implementation. If the given object is {@code null}, then this method returns {@code null}. * Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged. * Otherwise a new SIS implementation is created and initialized to the attribute values of the given object. * * @param object The object to get as a SIS implementation, or {@code null} if none. * @return A SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultEngineeringCRS castOrCopy(final EngineeringCRS object) { return (object == null) || (object instanceof DefaultEngineeringCRS) ? (DefaultEngineeringCRS) object : new DefaultEngineeringCRS(object); } /** * Returns the GeoAPI interface implemented by this class. * The SIS implementation returns {@code EngineeringCRS.class}. * * <div class="note"><b>Note for implementors:</b> * Subclasses usually do not need to override this method since GeoAPI does not define {@code EngineeringCRS} * sub-interface. Overriding possibility is left mostly for implementors who wish to extend GeoAPI with their * own set of interfaces.</div> * * @return {@code EngineeringCRS.class} or a user-defined sub-interface. */ @Override public Class<? extends EngineeringCRS> getInterface() { return EngineeringCRS.class; } /** * Returns the datum. * * @return The datum. */ @Override @XmlElement(name = "engineeringDatum", required = true) public EngineeringDatum getDatum() { return datum; } /** * Returns the coordinate system. * * @return The coordinate system. */ @Override @XmlElements({ @XmlElement(name = "cartesianCS", type = DefaultCartesianCS.class), @XmlElement(name = "affineCS", type = DefaultAffineCS.class), @XmlElement(name = "cylindricalCS", type = DefaultCylindricalCS.class), @XmlElement(name = "linearCS", type = DefaultLinearCS.class), @XmlElement(name = "polarCS", type = DefaultPolarCS.class), @XmlElement(name = "sphericalCS", type = DefaultSphericalCS.class), @XmlElement(name = "userDefinedCS", type = DefaultUserDefinedCS.class) }) public CoordinateSystem getCoordinateSystem() { return super.getCoordinateSystem(); } /** * {@inheritDoc} * * @return {@inheritDoc} */ @Override public DefaultEngineeringCRS forConvention(final AxesConvention convention) { return (DefaultEngineeringCRS) super.forConvention(convention); } /** * Returns a coordinate reference system of the same type than this CRS but with different axes. */ @Override final AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem cs) { return new DefaultEngineeringCRS(properties, datum, cs); } /** * Formats this CRS as a <cite>Well Known Text</cite> {@code EngineeringCRS[…]} element. * * @return {@code "EngineeringCRS"} (WKT 2) or {@code "Local_CS"} (WKT 1). * * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#74">WKT 2 specification §11</a> */ @Override protected String formatTo(final Formatter formatter) { super.formatTo(formatter); return (formatter.getConvention().majorVersion() == 1) ? WKTKeywords.Local_CS : isBaseCRS(formatter) ? WKTKeywords.BaseEngCRS : formatter.shortOrLong(WKTKeywords.EngCRS, WKTKeywords.EngineeringCRS); } ////////////////////////////////////////////////////////////////////////////////////////////////// //////// //////// //////// XML support with JAXB //////// //////// //////// //////// The following methods are invoked by JAXB using reflection (even if //////// //////// they are private) or are helpers for other methods invoked by JAXB. //////// //////// Those methods can be safely removed if Geographic Markup Language //////// //////// (GML) support is not needed. //////// //////// //////// ////////////////////////////////////////////////////////////////////////////////////////////////// /** * Constructs a new object in which every attributes are set to a null value. * <strong>This is not a valid object.</strong> This constructor is strictly * reserved to JAXB, which will assign values to the fields using reflexion. */ private DefaultEngineeringCRS() { /* * The datum and the coordinate system are mandatory for SIS working. We do not verify their presence * here because the verification would have to be done in an 'afterMarshal(…)' method and throwing an * exception in that method causes the whole unmarshalling to fail. But the SC_CRS adapter does some * verifications. */ } /** * Invoked by JAXB at unmarshalling time. * * @see #getDatum() */ private void setDatum(final EngineeringDatum value) { if (datum == null) { datum = value; } else { MetadataUtilities.propertyAlreadySet(DefaultEngineeringCRS.class, "setDatum", "engineeringDatum"); } } /** * Used by JAXB only (invoked by reflection). * * @see #getCoordinateSystem() */ private void setCoordinateSystem(final CoordinateSystem cs) { setCoordinateSystem(null, cs); // 'null' here means to infer the XML property name from the cs type. } }
[ "desruisseaux@apache.org" ]
desruisseaux@apache.org
5cbeef903898f2219884daf13a81c430eeeeb30f
41330306af31efbda9742298ac4da79132f699d9
/src/test/java/com/flyway/TestFlyway.java
59d735a411e279c0f877f09d54ad3ca5f40ed481
[]
no_license
Greeeeeeo/flyway-demo
7d3f6dda8dfd06c96d54e9b6bbe36eff797fd4da
c5d5e78de47483d0ce54f11304c84b6cbd6ee959
refs/heads/master
2021-05-18T23:28:29.611322
2018-06-22T02:23:17
2018-06-22T02:23:17
251,477,001
1
0
null
2020-03-31T02:09:39
2020-03-31T02:09:38
null
UTF-8
Java
false
false
476
java
package com.flyway; import org.flywaydb.core.Flyway; import org.junit.Test; public class TestFlyway { @Test public void flyway(){ // Create the Flyway instance Flyway flyway = new Flyway(); // Point it to the database flyway.setDataSource("jdbc:mysql://127.0.0.1:3306/flyway?useLegacyDatetimeCode=false&serverTimezone=Asia/Hong_Kong&useSSL=false", "root", "123456"); // Start the migration flyway.migrate(); } }
[ "523786283@qq.com" ]
523786283@qq.com
1c2ae2c9206707fc3ac20ab936ad63329b73e575
e1a601fcf356ad4002ec92b48d984f31904465af
/Zadania/Java_Zaawansowana_moje_zadania/src/Zad1/Main.java
4d3df5d79b96e842720560ae0a108cc86ba94918
[]
no_license
MateuszKoszewski/kursSDA
61b0b54900fc02a3c80d0ee3ec050f94a74f6ede
a2d59b33064d299a546a4db23b204f791db7e0ad
refs/heads/master
2023-02-07T21:44:46.792607
2020-12-30T11:28:10
2020-12-30T11:28:10
295,408,792
0
0
null
null
null
null
UTF-8
Java
false
false
739
java
package Zad1; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; //Stwórz metodę, która jako parametr przyjmuje listę stringów, następnie zwraca tą listę posortowaną //alfabetycznie od Z do A. public class Main { public static void main(String[] args) { List<String> list = new ArrayList<>(); list.add("Ala"); list.add("ma"); list.add("kota"); list.add("a"); list.add("koty"); list.add("maja"); list.add("Ale"); List<String> sorted = list.stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList()); System.out.println(sorted); } }
[ "mateusz.koszewski@wp.pl" ]
mateusz.koszewski@wp.pl
a88e54958d816654951056b6aa8b6c4a5fab2d33
91108aa0e65325b1b19dbc0798ae425074dfcbc6
/app/src/main/java/vision/genesis/clientapp/ui/ProfileDataView.java
822d939dcbdaea7a82cd7359e131cabe461620a0
[]
no_license
shvyrev/android-client
41fc3295f3d765b4290f346d4b0cdb6c498e81ad
b10f88997de3d8c535b24aedf18c8d1dfbc198ce
refs/heads/master
2020-04-27T16:20:36.440660
2018-11-15T17:36:23
2018-11-15T17:36:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,443
java
package vision.genesis.clientapp.ui; import android.content.Context; import android.graphics.PorterDuff; import android.support.design.widget.TextInputEditText; import android.support.design.widget.TextInputLayout; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.RelativeLayout; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import butterknife.Unbinder; import vision.genesis.clientapp.R; /** * GenesisVisionAndroid * Created by Vitaly on 23/03/2018. */ public class ProfileDataView extends RelativeLayout { @BindView(R.id.text_input_layout) public TextInputLayout textInputLayout; @BindView(R.id.edit_text) public TextInputEditText editText; @BindView(R.id.edit_icon) public View editIcon; private Unbinder unbinder; public ProfileDataView(Context context) { super(context); initView(); } public ProfileDataView(Context context, AttributeSet attrs) { super(context, attrs); initView(); } public ProfileDataView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); initView(); } @OnClick(R.id.edit_icon) public void onEditIconClicked() { editText.requestFocus(); InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); } public void onDestroy() { if (unbinder != null) { unbinder.unbind(); unbinder = null; } } private void initView() { inflate(getContext(), R.layout.view_profile_data, this); unbinder = ButterKnife.bind(this); setEditMode(false); } public void setEditMode(boolean editMode) { textInputLayout.setEnabled(editMode); if (editMode) { editText.getBackground().setColorFilter(ContextCompat.getColor(getContext(), R.color.grey300), PorterDuff.Mode.SRC_IN); editIcon.setVisibility(View.VISIBLE); } else { editText.getBackground().setColorFilter(ContextCompat.getColor(getContext(), android.R.color.transparent), PorterDuff.Mode.SRC_IN); editIcon.setVisibility(View.GONE); } } public void setHint(String hint) { textInputLayout.setHint(hint.toUpperCase()); } public String getText() { return editText.getText().toString(); } public void setText(String text) { editText.setText(text); } }
[ "dev.prus@gmail.com" ]
dev.prus@gmail.com
8482d61ab096081624ee749f255b4ea69923ff1a
a3d6f96c5b591faa53050bd09e3fbd23333433d9
/src/Main/Tools.java
f428d4304772bb324e03b2e1727989eb2d40f9c9
[]
no_license
Mahran-Yacoub/World-Map-Dijkstra
3eaf7e64f3369782a1f0c411b4801d455f074417
04448a3b465d949a957b640e76fb0b1608237fe5
refs/heads/master
2023-06-19T17:02:17.288562
2021-07-19T07:17:10
2021-07-19T07:17:10
387,366,378
1
0
null
null
null
null
UTF-8
Java
false
false
6,508
java
package Main; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; import weigthed.graph.Country; import weigthed.graph.WeightedEdge; import weigthed.graph.WeigthedSparseGraph; public class Tools { /** This constant is used to get distance in KM */ private final double KILO_METERS = 6371; private ArrayList<Country> listOfCountries; private ArrayList<WeightedEdge> listOfEdges; ///////////////////////////////////////////////////////////////////////////////////////////////////// /** * * @param verticesFile File represent list of vertices (Countries) , each line * is considered to be country * * @return list of vertices that contains all of countries from a file * */ public ArrayList<Country> getVerticesList(File verticesFile) { ArrayList<Country> listOfCountries = new ArrayList<Country>(50); try { Scanner scan = new Scanner(verticesFile); while (scan.hasNextLine()) { String line = scan.nextLine(); String[] parts = line.split(" "); String nameOfCountry = parts[0]; double longitude = Double.parseDouble(parts[1]); double latitude = Double.parseDouble(parts[2]); Country newCountry = new Country(nameOfCountry, latitude, longitude); listOfCountries.add(newCountry); } scan.close(); } catch (FileNotFoundException e) { Alert alert = new Alert(AlertType.WARNING); alert.setContentText("Error of reading File"); alert.show(); } return listOfCountries; } /////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////// /** * @param edgesFile File represent list of directed edges (Flights) , each line * is considered to be Flight * * @return list of vertices that contains all of edges from a file * */ public ArrayList<WeightedEdge> getEdgesList(File edgesFile, ArrayList<Country> listOfCountries) { ArrayList<WeightedEdge> listOfFlighs = new ArrayList<WeightedEdge>(70); try { Scanner scan = new Scanner(edgesFile); while (scan.hasNextLine()) { String line = scan.nextLine(); String[] parts = line.split(" "); Country countryFrom = new Country(parts[0].trim()); int vertixFrom = listOfCountries.indexOf(countryFrom); Country countryTo = new Country(parts[1].trim()); int vertixTo = listOfCountries.indexOf(countryTo); double[] c1 = getLatLong(listOfCountries.get(vertixFrom).getLatitude(), listOfCountries.get(vertixFrom).getLongitude()); double[] c2 = getLatLong(listOfCountries.get(vertixTo).getLatitude(), listOfCountries.get(vertixTo).getLongitude()); double weigth = (int) getDistance(c1[0], c1[1], c2[0], c2[1]); WeightedEdge newFligth = new WeightedEdge(vertixFrom, vertixTo, weigth); listOfFlighs.add(newFligth); } scan.close(); } catch (FileNotFoundException e) { Alert alert = new Alert(AlertType.WARNING); alert.setContentText("Error of reading File"); alert.show(); } return listOfFlighs; } /////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////// /** * * @param countries erticesFile File represent list of vertices (Countries) , * each line is considered to be country * * @param flights File represent list of directed edges (Flights) , each line * is considered to be Flight * * @return graph that is build from list of vertices (Countries) and list of * edges (Fligths) * */ public WeigthedSparseGraph<Country> buildGragh(File countries, File flights) { listOfCountries = getVerticesList(countries); listOfEdges = getEdgesList(flights, listOfCountries); WeigthedSparseGraph<Country> worldMapFlights = new WeigthedSparseGraph<Country>(listOfCountries, listOfEdges); return worldMapFlights; } /////////////////////////////////////////////////////////////////////////////////////// public double getDistance(double fromLatitude, double fromLongitude, double toLatitude, double toLongitude) { // Convert latitudes nad longitude to radians fromLatitude = Math.toRadians(fromLatitude); fromLongitude = Math.toRadians(fromLongitude); toLatitude = Math.toRadians(toLatitude); toLongitude = Math.toRadians(toLongitude); // Haversine formula double term1Input = (toLatitude - fromLatitude) / 2; double term1 = Math.pow(Math.sin(term1Input), 2); double term2 = Math.cos(fromLatitude) * Math.cos(toLatitude); double term3Input = (toLongitude - fromLongitude) / 2; double term3 = Math.pow(Math.sin(term3Input), 2); double combineTerms = term1 + term2 * term3; double distance = KILO_METERS * 2 * Math.asin(Math.sqrt(combineTerms)); return distance; } /////////////////////////////////////////////////////////////////////////////////////// public double[] getLatLong(double xCoordinates, double yCoordinates) { int geo_left = -180; int geo_right = 180; int geo_top = 80; int geo_bottom = -80; // dimensions of the canvas int canvas_width = 1097; int canvas_height = 626; // get relative coordinate of pixel, should be on a scale of 0 to 1 double rel_x = yCoordinates / canvas_width; double rel_y = xCoordinates / canvas_height; // linear interpolate to find latitude and longitude double latitude = geo_left + (geo_right - geo_left) * rel_x; double longitude = geo_top + (geo_bottom - geo_top) * rel_y; return new double[] { latitude, longitude }; } /////////////////////////////////////////////////////////////////////////////////////// public ArrayList<Country> getListOfCountries() { return listOfCountries; } public void setListOfCountries(ArrayList<Country> listOfCountries) { this.listOfCountries = listOfCountries; } public ArrayList<WeightedEdge> getListOfEdges() { return listOfEdges; } public void setListOfEdges(ArrayList<WeightedEdge> listOfEdges) { this.listOfEdges = listOfEdges; } public double getKILO_METERS() { return KILO_METERS; } }
[ "mahranyacoub98@gmail.com" ]
mahranyacoub98@gmail.com
68be52f221e027ff8ffb38a4ca89b551be075a38
44f0c2da0324aa3f4bf1fa43168a05b06effcc9e
/24-Kafka/Kafka_twitterstream_demo/src/main/java/com/ixat/kafka/twitterstram/TestProducer.java
5925d34471194dcfd35694c782a9e2b186b99003
[]
no_license
iXat-Training/hadoop102
4b3669087d54313248879d05f55ba8dd1566e801
b58cfe5aa22e47c7c9869122e64b5618bd75bf82
refs/heads/master
2021-01-10T10:16:49.212942
2016-03-17T06:03:50
2016-03-17T06:03:50
50,958,193
2
1
null
2016-03-17T06:03:51
2016-02-02T23:01:50
Java
UTF-8
Java
false
false
856
java
package com.ixat.kafka.twitterstram; import java.util.Properties; import kafka.javaapi.producer.Producer; import kafka.producer.KeyedMessage; import kafka.producer.ProducerConfig; public class TestProducer { public static void main(String args[]) throws Exception { Properties props = new Properties(); props.put("metadata.broker.list","localhost:9092"); props.put("serializer.class", "kafka.serializer.StringEncoder"); props.put("request.required.acks", "1"); ProducerConfig config = new ProducerConfig(props); Producer<String, String> producer = new Producer<String, String>(config); for (int i = 0; i < 100; i++) { String msg = "Producer Test#" + i; KeyedMessage<String, String> data = new KeyedMessage<String, String>( "NEWS", "KEY:" + i, msg); producer.send(data); } System.out.println("Messages sent...."); } }
[ "ixat.training@gmail.com" ]
ixat.training@gmail.com
5ff57d85a58427a13fcfdc792c1b91fff1ee55ec
d072ceab5532064744f983c8eaea03d041ee0873
/springbootangular8crud/src/test/java/com/vd/springbootangular8crud/Springbootangular8crudApplicationTests.java
21a85bc1317449d886dccd07597723e94785b56e
[]
no_license
vsd7/springbootangular8crud
cf980bdcd80ddf56f80fa34f8e7617fb5134486d
e64083ce7592a4a43c6ea194246e2cf887395a11
refs/heads/master
2023-01-08T13:16:45.312168
2021-11-11T13:06:50
2021-11-11T13:06:50
227,809,394
1
0
null
2023-01-01T14:23:25
2019-12-13T10:00:16
TypeScript
UTF-8
Java
false
false
237
java
package com.vd.springbootangular8crud; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class Springbootangular8crudApplicationTests { @Test void contextLoads() { } }
[ "vivek.b.deshmukh@capgemini.com" ]
vivek.b.deshmukh@capgemini.com
4dce7a5e7ef57387685ad754500ef4a47065cfe5
8e4ae270ccff8b6943ca4812526096efdc4a4223
/src/main/java/org/zhangyc/test/thread/SynchronizedTest.java
f2b5633e73895739c583998b0f48c66487e1b5c7
[]
no_license
zhangyicou/test
59d81fa43b58bbce2a9b890897b1d099ee5414e4
50f5087dc89f8d4138110b1c35b33c6a433e7d2e
refs/heads/master
2022-11-27T12:00:57.756057
2019-09-19T06:20:15
2019-09-19T06:20:15
46,244,420
0
0
null
2022-11-16T04:55:56
2015-11-16T01:23:20
Java
UTF-8
Java
false
false
807
java
package org.zhangyc.test.thread; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * @Author: yichu.zhang * @Date: 2019-08-15 18:59 */ public class SynchronizedTest { public static void main(String[] args) { SynchronizedInfo synchronizedInfo = new SynchronizedInfo(); int corePoolSize = Runtime.getRuntime().availableProcessors() * 2; ThreadPoolExecutor poolExecutor = new ThreadPoolExecutor(corePoolSize, corePoolSize, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<>(1000)); for(int i = 1; i < 10000; i++){ final Long userId = i % 2L; final int index = i; poolExecutor.submit(() -> synchronizedInfo.cal(userId, index)); } } }
[ "yichu.zhang" ]
yichu.zhang
58d684915766ea30eecb3109f35fe667d5d89a14
fde2b39c0cc6b118c1cc9bed6a81f7d5e6ab0fc2
/src/main/java/co/com/bancolombia/diandalu/adapter/SubdominioAdapter.java
bb9126ea6bbfde474a339f69998945631972876a
[]
no_license
davidpolaniaac/diandalu
24e9786b87d9b892e18ff2ed3b9b0c891a76952b
11d6652b29b0783ba8180d04b2f73776b340fde8
refs/heads/master
2020-04-19T14:21:07.576428
2017-03-16T22:11:52
2017-03-16T22:11:52
168,242,119
0
0
null
null
null
null
UTF-8
Java
false
false
1,862
java
package co.com.bancolombia.diandalu.adapter; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import co.com.bancolombia.diandalu.dto.SubdominioDTO; import co.com.bancolombia.diandalu.entidades.Subdominio; public class SubdominioAdapter { @Inject private IntegranteAdapter integranteAdapter; public Subdominio subdominioDtoToSubdominio(SubdominioDTO subdominioDTO){ Subdominio subdominio = new Subdominio(); subdominio.setIdSubdominio(subdominioDTO.getIdSubdominio()); subdominio.setNombre(subdominioDTO.getNombre()); subdominio.setDescripcion(subdominioDTO.getDescripcion()); subdominio.setIntegrantes(integranteAdapter.listIntegranteDtoToListIntegrante(subdominioDTO.getIntegrantes())); return subdominio; } public SubdominioDTO subdominioToSubdominioDto(Subdominio subdominio){ SubdominioDTO subdominioDTO = new SubdominioDTO(); subdominioDTO.setIdSubdominio(subdominio.getIdSubdominio()); subdominioDTO.setNombre(subdominio.getNombre()); subdominioDTO.setDescripcion(subdominio.getDescripcion()); subdominioDTO.setIntegrantes(integranteAdapter.listIntegranteToListIntegranteDTO(subdominio.getIntegrantes())); return subdominioDTO; } public List<SubdominioDTO> listSubdominioToListSubdominioDTO(List<Subdominio> listaSubdominio){ List<SubdominioDTO> listaSubdominioDTO = new ArrayList<>(); for (Subdominio subdominio : listaSubdominio) { listaSubdominioDTO.add(subdominioToSubdominioDto(subdominio)); } return listaSubdominioDTO; } public List<Subdominio> listSubdominioDtoToListSubdominio(List<SubdominioDTO> listaSubdominioDTO){ List<Subdominio> listaSubdominio= new ArrayList<>(); for (SubdominioDTO subdominioDTO : listaSubdominioDTO) { listaSubdominio.add(subdominioDtoToSubdominio(subdominioDTO)); } return listaSubdominio; } }
[ "davidpolaniaac@users.noreply.github.com" ]
davidpolaniaac@users.noreply.github.com
044610576ff120650130f63fa60a34388a725a6f
fee773dcb1a932315c9ca25ff2ca58587eb5c8fa
/demo4-statemachine/src/main/java/com/example/statemachine/AppController.java
fec7a9fa9eb3c62480457d3ef84a1697c96ec434
[]
no_license
domahidizoltan/presentation-this-is-not-a-pipe
c3cc687151eb44384dda32871fe679bf41e7f948
720bbc8ff7a9e5edebb19247cf4766fcc8b540ac
refs/heads/master
2020-04-17T05:31:18.654564
2019-03-16T05:55:14
2019-03-16T05:55:14
166,283,117
0
0
null
null
null
null
UTF-8
Java
false
false
2,514
java
package com.example.statemachine; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RestTemplate; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import java.time.Instant; @RestController public class AppController { @Value("${remote-api-url}") private String url; private RestTemplate restTemplate; private JavaMailSender mailSender; AppController(RestTemplate restTemplate, JavaMailSender mailSender) { this.restTemplate = restTemplate; this.mailSender = mailSender; } @PostMapping("/start/{id}") public ResponseEntity<String> start(@PathVariable("id") Integer id, @RequestBody String body) { String startUrl = url + "/start/" + id; return exchangeRequest(startUrl, body); } @PostMapping("/stop/{id}") public ResponseEntity<String> stop(@PathVariable("id") Integer id) { String stopUrl = url + "/stop/" + id; return exchangeRequest(stopUrl, null); } @PostMapping("/send-mail/{id}") public void sendMail(@PathVariable("id") Integer id) throws MessagingException { System.out.println("Sending mail to " + id); MimeMessage message = mailSender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(message); helper.setFrom("machine@mail.com"); helper.setTo(id + "@mail.com"); helper.setText(id + " stopped at " + Instant.now()); mailSender.send(message); } private ResponseEntity<String> exchangeRequest(String url, String body) { try { ResponseEntity<String> response = restTemplate.postForEntity(url, body, String.class); return ResponseEntity .status(response.getStatusCode()) .body(response.getBody()); } catch (HttpClientErrorException ex) { return ResponseEntity .status(ex.getStatusCode()) .body(ex.getResponseBodyAsString()); } } }
[ "domahidizoltan@gmail.com" ]
domahidizoltan@gmail.com
dea6d2056a93737ad9efe6fb1e4db25d6603ad6f
6de7be4b1482a29c703e7d5a60fb86638f6955ae
/src/main/java/com/github/AllenDuke/redisTest/RedisWithReentrantLock.java
d5f0dbdae2c30f4ead44a1ce8257defe406407a7
[]
no_license
AllenDuke/Core
0d228d5ddc611a52844b0a1ccefb15562b2bad66
c7e17ce53095bdfb5e281ae9c122b62fe68afe74
refs/heads/master
2022-06-23T17:58:09.141440
2021-07-26T02:37:39
2021-07-26T02:37:39
248,463,495
0
0
null
null
null
null
UTF-8
Java
false
false
2,046
java
package com.github.AllenDuke.redisTest; import redis.clients.jedis.Jedis; import redis.clients.jedis.params.SetParams; import java.util.HashMap; import java.util.Map; /** * @author 杜科 * @description * @contact AllenDuke@163.com * @date 2020/8/23 */ public class RedisWithReentrantLock { /* 记录当前线程持有的锁及其进入次数 */ private ThreadLocal<Map<String,Integer>> lockers = new ThreadLocal<>(); private Jedis jedis; public RedisWithReentrantLock(Jedis jedis) { this.jedis = jedis; } private boolean lock0(String key) { /** * 为了避免进程在 setnx 和 expire 之间服务器突然挂掉了, expire 得不到执行,造成死锁,所以有了将这二者合二为一的命令。 */ SetParams params = new SetParams(); params.nx(); params.ex(5); return jedis.set(key, "", params) != null; } private void unlock0(String key) { jedis.del(key); } private Map<String, Integer> currentLockers() { Map<String, Integer> refs = lockers.get(); if (refs != null) { return refs; } lockers.set(new HashMap<>()); return lockers.get(); } public boolean lock(String key) { Map refs = currentLockers(); Integer refCnt = (Integer) refs.get(key); if (refCnt != null) { /* 锁重入 */ refs.put(key, refCnt + 1); return true; } boolean ok = this.lock0(key); if (!ok) { return false; } refs.put(key, 1); return true; } public boolean unlock(String key) { Map refs = currentLockers(); if(!refs.containsKey(key)) return false; /* 当前线程并非锁的持有者 */ Integer refCnt = (Integer) refs.get(key); refCnt -= 1; if (refCnt > 0) { refs.put(key, refCnt); } else { refs.remove(key); this.unlock0(key); } return true; } }
[ "1264310546@qq.com" ]
1264310546@qq.com
7cb470e4987f0570048597a658e7c6226a0d7e3c
7e7bb2735dc4a464cfd2c333a44b458b33657489
/ForumGier/src/gameforum/encje/Wpis.java
456c6f12886ea2c3ec4ec9e9e72f27208b8a7372
[]
no_license
bugi353/Training
25fb24015cafe264b268e4a8133e8f2b2755c500
08b2ea0330260e2be14a51047135c8cc93b16c84
refs/heads/master
2020-03-16T18:20:33.955756
2018-05-22T17:03:00
2018-05-22T17:03:00
132,868,833
0
0
null
null
null
null
UTF-8
Java
false
false
1,152
java
package gameforum.encje; import java.sql.Timestamp; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name="wpis") public class Wpis { @Id @GeneratedValue private int id; private Timestamp data; @Lob() private String tresc; @ManyToOne @JoinColumn(name="uzytkownik") private Uzytkownik uzytkownik; @ManyToOne @JoinColumn(name="temat") private Temat temat; public int getId() { return id; } public void setId(int id) { this.id = id; } public Timestamp getData() { return data; } public void setData(Timestamp data) { this.data = data; } public String getTresc() { return tresc; } public void setTresc(String tresc) { this.tresc = tresc; } public Uzytkownik getUzytkownik() { return uzytkownik; } public void setUzytkownik(Uzytkownik uzytkownik) { this.uzytkownik = uzytkownik; } public Temat getTemat() { return temat; } public void setTemat(Temat temat) { this.temat = temat; } }
[ "32601187+bugi353@users.noreply.github.com" ]
32601187+bugi353@users.noreply.github.com
b6871e6dc2a7d1c5201bb183ea2a56b689e6c07d
0615adaaf0c0c565cb8e88fa2b99dea0f9726d81
/src/main/java/edu/csula/datascience/acquisition/TwitterCollector.java
a05da378131124304621c9103b7e74620788506e
[]
no_license
jsoni2/Twitter-Sentiment-Analysis
42d67262098c71f60326e6121a4860ce50dc0abd
b8ecb01e64e878022ec5543c579726bbd013243b
refs/heads/master
2021-05-31T20:16:42.073574
2016-04-25T06:00:06
2016-04-25T06:00:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,388
java
package edu.csula.datascience.acquisition; import com.mongodb.MongoClient; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; import org.bson.Document; import twitter4j.Status; /** * An example of Collector implementation using Twitter4j with MongoDB Java driver */ public class TwitterCollector implements Collector<Status, Status> { MongoClient mongoClient; MongoDatabase database; MongoCollection<Document> collection; public TwitterCollector() { // establish database connection to MongoDB mongoClient = new MongoClient(); // select `Valkyrie-BigData` as database database = mongoClient.getDatabase("Valkyrie-BigData"); // select collection by name `Tweetstreams` collection = database.getCollection("Tweetstreams"); } // MUNGEE implementation @Override public Boolean mungee(String src) { if(src.equals(null)) { return true; } else return false; } // Saving document in MongoDB @Override public void save(String username, String profilelocation, long tweetId, String post) { Document document = new Document(); document.put("TweetId", tweetId); document.put("Username", username); document.put("ProfileLocation", profilelocation); document.put("Content", post); collection.insertOne(document); } }
[ "rahulrapatwar@yahoo.com" ]
rahulrapatwar@yahoo.com
e533728da7460032b601456331a1da9e5310a2bb
e35ec8447606f8539bfc3f7b4129e0469a5ca430
/TEST/src/org/usfirst/frc1719/TEST/subsystems/FishingRod.java
64af630945cf54c24917ff4d5b2ed3f8e335cc5d
[]
no_license
FRCTeam1719/Robotbuilder-Testing
6b85ec617b98d47c9dcba3cbb900363aad33c6eb
e548ab2982aba91e7742cc81ee3821dbf69222d3
refs/heads/master
2021-01-01T19:15:37.863357
2015-01-20T17:12:40
2015-01-20T17:12:40
28,785,088
1
0
null
2015-01-10T16:11:32
2015-01-04T20:27:08
Java
UTF-8
Java
false
false
787
java
package org.usfirst.frc1719.TEST.subsystems; import org.usfirst.frc1719.TEST.Robot; import org.usfirst.frc1719.TEST.RobotMap; import edu.wpi.first.wpilibj.Relay; import edu.wpi.first.wpilibj.command.Subsystem; /** * */ public class FishingRod extends Subsystem { Relay extensionMotor = RobotMap.frExtensionMotor; public void initDefaultCommand() { // Set the default command for a subsystem here. //setDefaultCommand(new MySpecialCommand()); } public boolean getExtended() { return Robot.sensors.getLimitSwitchSpringStringThing(1).get(); } public boolean getRetracted() { return Robot.sensors.getLimitSwitchSpringStringThing(2).get(); } public Relay getExtMotor() { return extensionMotor; } }
[ "dgolddragon28@gmail.com" ]
dgolddragon28@gmail.com
ac2491a179e7827549d7b22262c2c668cb9fa834
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_3/src/j/i/Calc_1_3_984.java
f11e9cfb5a405b2598d1bac7c4cc6dc28aae4e01
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
128
java
package j.i; public class Calc_1_3_984 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
4ca813342003b6e8968189929ca597d44e1a20ff
98587409b208acf68b79598ba4f48668e9af5b36
/src/test/java/runners/Runner.java
f08ef36bcc68337fbde5dec415644d849a5aa5fa
[]
no_license
sengulali/CucumberProje
a04b4e320f536f0a8fd25af0166fd649e1c1285b
9fb68ddd6d060e092bc2cc309fabec0058fd76ef
refs/heads/master
2022-12-26T17:10:44.249754
2020-10-02T20:17:17
2020-10-02T20:17:17
298,388,086
0
0
null
null
null
null
UTF-8
Java
false
false
1,029
java
package runners; import io.cucumber.junit.Cucumber; import io.cucumber.junit.CucumberOptions; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @CucumberOptions( plugin = {"html:target/default-cucumber-reports", "json:target/json-reports/cucumber.json", "junit:target/xml-report/cucumber.xml"}, // rapor oluşturmak için features = "src/test/resources/features", // features klasörünün adresini glue = "stepdefinitions", // testlerinin içerisinde olduğu paketin ismi tags = "@birdenfazlaexample", // seçtiğiniz tag'a ait testler çalıştırılır. dryRun = false // senaryoda oluşturduğumuz anca henüz test methodu yazılmamış // olan adımların(steps) methodlarını consol'da görmek için "dryRun = true" // şeklinde kullanıyoruz. // dryRun = false olursa, testleri çalıştırır. // dryRun = true olursa, eksik olan methodları bulur ve size öneride bulunur. ) public class Runner { }
[ "aslandamla46@gmail.com" ]
aslandamla46@gmail.com