blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
โŒ€
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
1fc048775c7d7f2df9b0714dcc233afe55a8dd8d
2b775219cafd5a8b804d3970006d62ac829ec6ae
/src/test/java/edu/neu/bigdata/AppTest.java
c2088be50ffdbacc6c68f0b445950f43bf4fee9d
[]
no_license
li-jiawei/auto-complete
99d489f9ae56d216cb8f383028fe633355a4fd32
6e4ff9696a837e25f1861d5db0dddb37e5295f52
refs/heads/master
2021-01-22T06:11:16.289883
2017-05-26T16:05:25
2017-05-26T16:05:25
92,527,196
0
0
null
null
null
null
UTF-8
Java
false
false
643
java
package edu.neu.bigdata; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "li.jiawei@husky.neu.edu" ]
li.jiawei@husky.neu.edu
32d987583101b6d275c0aa72d68b989fe4e2fb15
a493a137a0dcf581560a4e3ecef0259e4e583611
/bitcamp-java-application4-server/v56_4/src/main/java/com/eomcs/lms/servlet/LoginServlet.java
f9ce8e91f229f4383db0a2f10e9845d33582cdf6
[]
no_license
EoneTrance/bitcamp-java-20190527
609df28c371809723853058431259326c5d14c71
665da58407b1051c8633b3ee6cb033477e9c9a07
refs/heads/master
2020-06-13T20:16:55.776575
2019-09-30T03:00:17
2019-09-30T03:00:17
194,775,347
1
0
null
2020-04-30T11:49:50
2019-07-02T02:41:02
Java
UTF-8
Java
false
false
2,944
java
package com.eomcs.lms.servlet; import java.io.IOException; import java.io.PrintWriter; import java.util.HashMap; 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.springframework.context.ApplicationContext; import com.eomcs.lms.dao.MemberDao; import com.eomcs.lms.domain.Member; @WebServlet("/auth/login") public class LoginServlet extends HttpServlet{ private static final long serialVersionUID = 1L; private MemberDao memberDao; @Override public void init() throws ServletException { ApplicationContext appCtx = (ApplicationContext)getServletContext().getAttribute("iocContainer"); memberDao = appCtx.getBean(MemberDao.class); } @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); out.println("<html><head><title>๋กœ๊ทธ์ธ ํผ</title>"); out.println("<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' integrity='sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T' crossorigin='anonymous'>"); out.println("<link rel='stylesheet' href='/css/common.css'>"); out.println("</head>"); request.getRequestDispatcher("/header").include(request, response); out.println("<body>"); out.println("<div id='content'>"); out.println("<h1>๋กœ๊ทธ์ธ ํผ</h1>"); out.println("<form action='/auth/login' method='post'>"); out.println("์ด๋ฉ”์ผ: <input type='text' name='email'><br>"); out.println("์•”ํ˜ธ: <input type='text' name='password'><br>"); out.println("<button>๋กœ๊ทธ์ธ</button>"); out.println("</form>"); out.println("</div>"); request.getRequestDispatcher("/footer").include(request, response); out.println("</body></html>"); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { try { HashMap<String,Object> params = new HashMap<>(); params.put("email", request.getParameter("email")); params.put("password", request.getParameter("password")); Member member = memberDao.findByEmailPassword(params); if (member == null) { throw new Exception("์ด๋ฉ”์ผ ๋˜๋Š” ์•”ํ˜ธ๊ฐ€ ๋งž์ง€ ์•Š์Šต๋‹ˆ๋‹ค!"); } response.sendRedirect("/board/list"); } catch (Exception e) { request.setAttribute("message", "๋กœ๊ทธ์ธ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค!"); request.setAttribute("refresh", "/board/list"); request.setAttribute("error", e); request.getRequestDispatcher("/error").forward(request, response);; response.setContentType("text/html;charset=UTF-8"); } } }
[ "karnenis@gmail.com" ]
karnenis@gmail.com
c69d4a80145bac3ab7c8286d74a7fc534d655627
07c783027b29feec68fbe31489a7b4f7cca856f7
/problem/TravelingSalesManSwap.java
b87e49ef68751837fade57713e7e99dc4b71506a
[]
no_license
HCGK/One-Point-Itrarative-Searches
b1d68a1a69c64ae432cb117a9ce564688e431235
b1dc9a2a1ed8cb4110da1679f7e77e8360188cf4
refs/heads/master
2021-01-10T17:43:47.850017
2015-12-15T17:31:55
2015-12-15T17:31:55
43,508,541
0
0
null
null
null
null
UTF-8
Java
false
false
1,374
java
package problem; import java.util.Random; public class TravelingSalesManSwap extends TravelingSalesMan{ //Describing the candidate //Swapping pointA with pointB //with Al being the point be for A and At the point after; public TravelingSalesManSwap(double[][] distances, Random r) { super(distances, r); } public double sugestMove(){ pointAl = R.nextInt(length); pointA = (pointAl+1)%length; pointAt = (pointAl+2)%length; //point A and B non pointBl = (R.nextInt(length - 3)+pointAt)%length; pointB = (pointBl+1)%length; pointBt = (pointBl+2)%length; cost_cadidate = cost_current - distances[route[pointAl]][route[pointA]] - distances[route[pointAt]][route[pointA]] - distances[route[pointBl]][route[pointB]] - distances[route[pointBt]][route[pointB]] + distances[route[pointBl]][route[pointA]] + distances[route[pointBt]][route[pointA]] + distances[route[pointAl]][route[pointB]] + distances[route[pointAt]][route[pointB]]; return cost_cadidate; } public void doMove(){ cost_current = cost_cadidate; int a = route[pointA]; route[pointA] = route[pointB]; route[pointB] = a; } }
[ "-" ]
-
26d9d672adaf7d276ced34b451d2a98d8c093b28
90f17cd659cc96c8fff1d5cfd893cbbe18b1240f
/src/main/java/com/google/firebase/firestore/local/SQLiteMutationQueue$$Lambda$6.java
11c148be10f26c562b18a0d8c3ca1a515f946232
[]
no_license
redpicasso/fluffy-octo-robot
c9b98d2e8745805edc8ddb92e8afc1788ceadd08
b2b62d7344da65af7e35068f40d6aae0cd0835a6
refs/heads/master
2022-11-15T14:43:37.515136
2020-07-01T22:19:16
2020-07-01T22:19:16
276,492,708
0
0
null
null
null
null
UTF-8
Java
false
false
914
java
package com.google.firebase.firestore.local; import android.database.Cursor; import com.google.firebase.firestore.util.Consumer; import java.util.List; /* compiled from: com.google.firebase:firebase-firestore@@19.0.0 */ final /* synthetic */ class SQLiteMutationQueue$$Lambda$6 implements Consumer { private final SQLiteMutationQueue arg$1; private final List arg$2; private SQLiteMutationQueue$$Lambda$6(SQLiteMutationQueue sQLiteMutationQueue, List list) { this.arg$1 = sQLiteMutationQueue; this.arg$2 = list; } public static Consumer lambdaFactory$(SQLiteMutationQueue sQLiteMutationQueue, List list) { return new SQLiteMutationQueue$$Lambda$6(sQLiteMutationQueue, list); } public void accept(Object obj) { this.arg$2.add(this.arg$1.decodeInlineMutationBatch(((Cursor) obj).getInt(0), ((Cursor) obj).getBlob(1))); } }
[ "aaron@goodreturn.org" ]
aaron@goodreturn.org
4382767c4c12e51bc4385cd18ca8fb20dc7e969d
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_3/src/f/a/d/Calc_1_3_5037.java
0b027326af3377a29d4b77b4c1dc0aeb357349fa
[]
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
131
java
package f.a.d; public class Calc_1_3_5037 { /** @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
eaacf02f1f3f19de6658988f55399a95775296ec
be09986e8e8a64dbd0625c17238182e79aebeafe
/backend/grafioschtrader-server/src/main/java/grafioschtrader/exportdelete/MyDataExportDeleteDefinition.java
94bf08af2a5463dd1f504085f2cc267cd3cbbd9c
[ "Apache-2.0" ]
permissive
grafioschtrader/grafioschtrader
eb7cff12436e34f6400f858a0c1f9ef9db3cd82a
e89bf2d8ac50804f7c71fbca22b5de315a0df2d0
refs/heads/master
2023-08-17T04:51:32.131079
2023-08-09T05:16:12
2023-08-09T05:16:12
235,070,488
14
7
Apache-2.0
2023-04-25T20:08:10
2020-01-20T10:01:48
Java
UTF-8
Java
false
false
31,710
java
package grafioschtrader.exportdelete; import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.security.core.context.SecurityContextHolder; import grafioschtrader.entities.AlgoAssetclass; import grafioschtrader.entities.AlgoAssetclassSecurity; import grafioschtrader.entities.AlgoRule; import grafioschtrader.entities.AlgoRuleStrategy; import grafioschtrader.entities.AlgoSecurity; import grafioschtrader.entities.AlgoStrategy; import grafioschtrader.entities.AlgoTop; import grafioschtrader.entities.AlgoTopAssetSecurity; import grafioschtrader.entities.Assetclass; import grafioschtrader.entities.Cashaccount; import grafioschtrader.entities.CorrelationSet; import grafioschtrader.entities.Currencypair; import grafioschtrader.entities.Dividend; import grafioschtrader.entities.Globalparameters; import grafioschtrader.entities.Historyquote; import grafioschtrader.entities.HistoryquotePeriod; import grafioschtrader.entities.ImportTransactionHead; import grafioschtrader.entities.ImportTransactionPlatform; import grafioschtrader.entities.ImportTransactionPos; import grafioschtrader.entities.ImportTransactionPosFailed; import grafioschtrader.entities.ImportTransactionTemplate; import grafioschtrader.entities.MailSettingForward; import grafioschtrader.entities.MultilanguageString; import grafioschtrader.entities.Portfolio; import grafioschtrader.entities.ProposeChangeEntity; import grafioschtrader.entities.ProposeChangeField; import grafioschtrader.entities.ProposeRequest; import grafioschtrader.entities.ProposeUserTask; import grafioschtrader.entities.Role; import grafioschtrader.entities.Security; import grafioschtrader.entities.SecurityDerivedLink; import grafioschtrader.entities.Securityaccount; import grafioschtrader.entities.Securitycashaccount; import grafioschtrader.entities.Securitycurrency; import grafioschtrader.entities.Securitysplit; import grafioschtrader.entities.Stockexchange; import grafioschtrader.entities.Tenant; import grafioschtrader.entities.TradingDaysMinus; import grafioschtrader.entities.TradingDaysPlus; import grafioschtrader.entities.TradingPlatformPlan; import grafioschtrader.entities.Transaction; import grafioschtrader.entities.User; import grafioschtrader.entities.UserEntityChangeCount; import grafioschtrader.entities.UserEntityChangeLimit; import grafioschtrader.entities.Watchlist; /** * Delete the user's data from this database and export his data for later * import into his personal database.</br> * * <ul> * <li>hold_* tables are not exported they should rebuild with import</li> * <li>mail* tables are not exported, they have a relation to others users</li> * <li>{@link grafioschtrader.entities.TaskDataChange} is not exported * </ul> * * */ public class MyDataExportDeleteDefinition { protected static final int EXPORT_USE = 0x01; protected static final int DELETE_USE = 0x02; /** * Shared data of the user to be deleted must be assigned to another user. */ protected static final int CHANGE_USER_ID_FOR_CREATED_BY = 0x04; protected static final int CHANGE_USER_ID = 0x08; private static final String SELECT_STR = "SELECT"; private static final String DELETE_STR = "DELETE"; private static final String UPDATE_STR = "UPDATE"; private static String ALGO_RULE_PARAM_2_DEL = String.format( "ap FROM %s ap JOIN %s ars ON ap.id_algo_rule_strategy = ars.id_algo_rule_strategy WHERE ars.id_tenant = ?", AlgoRule.ALGO_RULE_PARAM2, AlgoRuleStrategy.TABNAME); private static String ALGO_RULE_DEL = String.format( "ar FROM %s ar JOIN %s ars ON ar.id_algo_rule_strategy = ars.id_algo_rule_strategy WHERE ars.id_tenant = ?", AlgoRuleStrategy.TABNAME, AlgoRuleStrategy.TABNAME); private static String ALGO_RULE_STRATEGY_PARAM_DEL = String.format( "ap FROM %s ap JOIN %s ars ON ap.id_algo_rule_strategy = ars.id_algo_rule_strategy WHERE ars.id_tenant = ?", AlgoRuleStrategy.ALGO_RULE_STRATEGY_PARAM, AlgoRuleStrategy.TABNAME); private static String ALGO_STRATEGY_DEL = String.format( "a FROM %s a JOIN %s ars ON a.id_algo_rule_strategy = ars.id_algo_rule_strategy WHERE ars.id_tenant = ?", AlgoStrategy.TABNAME, AlgoRuleStrategy.TABNAME); private static String ALGO_ASSETCLASS_SECURITY_DEL = String.format( "a FROM %s a JOIN %s tas ON a.id_algo_assetclass_security = tas.id_algo_assetclass_security WHERE tas.id_tenant = ?", AlgoAssetclassSecurity.TABNAME, AlgoTopAssetSecurity.TABNAME); private static String ALGO_TOP_DEL = String.format( "a FROM %s a JOIN %s tas ON a.id_algo_assetclass_security = tas.id_algo_assetclass_security WHERE tas.id_tenant = ?", AlgoTop.TABNAME, AlgoTopAssetSecurity.TABNAME); private static String ALGO_SECURITY_DEL = String.format( "s FROM %s s JOIN %s tas ON s.id_algo_assetclass_security = tas.id_algo_assetclass_security WHERE tas.id_tenant = ?", AlgoSecurity.TABNAME, AlgoTopAssetSecurity.TABNAME); private static String ALGO_ASSETCLASS_DEL = String.format( "a FROM %s a JOIN %s tas ON a.id_algo_assetclass_security = tas.id_algo_assetclass_security WHERE tas.id_tenant = ?", AlgoAssetclass.TABNAME, AlgoTopAssetSecurity.TABNAME); private static String CASHACCOUNT_SELDEL = String.format( "c.* FROM %s c, %s sc WHERE sc.id_tenant = ? AND sc.id_securitycash_account = c.id_securitycash_account", Cashaccount.TABNAME, Securitycashaccount.TABNAME); private static String CORRELATION_INSTRUMENT_SELDEL = String.format( "ci.* FROM %s cs, %s ci WHERE cs.id_tenant = ? AND cs.id_correlation_set = ci.id_correlation_set", CorrelationSet.TABNAME, CorrelationSet.TABNAME_CORRELATION_INSTRUMENT); private static String DIVIDEND_SELECT = String.format( """ DISTINCT d.* FROM %s d JOIN %s ws ON ws.id_securitycurrency = d.id_securitycurrency JOIN watchlist w ON w.id_watchlist = ws.id_watchlist WHERE w.id_tenant = ? UNION SELECT d.* FROM dividend d JOIN security s ON d.id_securitycurrency = s.id_securitycurrency WHERE s.id_tenant_private = ? UNION SELECT DISTINCT d.* FROM transaction t JOIN dividend d ON t.id_securitycurrency = d.id_securitycurrency WHERE t.id_tenant = ?""", Dividend.TABNAME, Watchlist.TABNAME_SEC_CUR); private static String DIVIDEND_DELETE = String.format( "d.* FROM %s d JOIN %s s ON d.id_securitycurrency = s.id_securitycurrency WHERE s.id_tenant_private = ?", Dividend.TABNAME, Security.TABNAME); private static String SECURITYACCOUNT_SELDEL = String.format( "sa.* FROM %s sa, %s sc WHERE sc.id_tenant = ? AND sc.id_securitycash_account = sa.id_securitycash_account", Securityaccount.TABNAME, Securitycashaccount.TABNAME); private static String SECURITY_SELECT = """ s.* FROM watchlist w JOIN watchlist_sec_cur ws ON w.id_watchlist = ws.id_watchlist JOIN security s ON s.id_securitycurrency = ws.id_securitycurrency WHERE w.id_tenant = ? UNION SELECT s.* FROM security s WHERE s.id_tenant_private = 7 UNION SELECT DISTINCT s.* FROM transaction t JOIN security s ON t.id_securitycurrency = s.id_securitycurrency WHERE t.id_tenant = ? UNION SELECT DISTINCT s1.* FROM watchlist w JOIN watchlist_sec_cur ws ON w.id_watchlist = ws.id_watchlist JOIN security s ON s.id_securitycurrency = ws.id_securitycurrency JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN security s1 ON s1.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON s1.id_securitycurrency = sc.id_securitycurrency WHERE w.id_tenant = ? AND sc.dtype = 'S' UNION SELECT s1.* FROM security s JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN security s1 ON s1.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON s1.id_securitycurrency = sc.id_securitycurrency WHERE s.id_tenant_private = ? AND sc.dtype = 'S' UNION SELECT DISTINCT s1.* FROM transaction t JOIN security s ON t.id_securitycurrency = s.id_securitycurrency JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN security s1 ON s1.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON s1.id_securitycurrency = sc.id_securitycurrency WHERE t.id_tenant = ? AND sc.dtype = 'S' UNION SELECT s.* FROM correlation_set cs JOIN correlation_instrument ci ON cs.id_correlation_set = ci.id_correlation_set JOIN security s ON ci.id_securitycurrency = s.id_securitycurrency WHERE cs.id_tenant = ?"""; private static String SECURITY_DELETE = String.format("FROM %s WHERE id_tenant_private = ?", Security.TABNAME); private static String SECURITY_DERIVED_LINK = String.format( """ sdl.* FROM %s w JOIN %s wsc ON w.id_watchlist = wsc.id_watchlist JOIN %s s ON wsc.id_securitycurrency = s.id_securitycurrency JOIN security_derived_link sdl ON sdl.id_securitycurrency = s.id_securitycurrency WHERE w.id_tenant = ? UNION SELECT sdl.* FROM security s JOIN securitycurrency sc ON s.id_securitycurrency = sc.id_securitycurrency JOIN security_derived_link sdl ON sdl.id_securitycurrency = s.id_securitycurrency WHERE s.id_tenant_private = ?""", Watchlist.TABNAME, Watchlist.TABNAME_SEC_CUR, Security.TABNAME); private static String SECURITYSPLIT_SELECT = String.format( """ DISTINCT ss.* FROM %s ss JOIN watchlist_sec_cur ws ON ws.id_securitycurrency = ss.id_securitycurrency JOIN %s w ON w.id_watchlist = ws.id_watchlist WHERE w.id_tenant = ? UNION SELECT ss.* FROM %s ss JOIN security s ON ss.id_securitycurrency = s.id_securitycurrency WHERE s.id_tenant_private = ? UNION SELECT DISTINCT ss.* FROM %s t JOIN %s ss ON t.id_securitycurrency = ss.id_securitycurrency WHERE t.id_tenant = ?""", Securitysplit.TABNAME, Watchlist.TABNAME, Securitysplit.TABNAME, Transaction.TABNAME, Securitysplit.TABNAME); private static String SECURITYSPLIT_DELETE = String.format( "ss.* FROM %s s, %s ss WHERE s.id_securitycurrency = ss.id_securitycurrency AND s.id_tenant_private = ?", Security.TABNAME, Securitysplit.TABNAME); private static String SECURITYCURRENCY_S_SELECT = """ sc.* FROM watchlist w JOIN watchlist_sec_cur ws ON w.id_watchlist = ws.id_watchlist JOIN securitycurrency sc ON sc.id_securitycurrency = ws.id_securitycurrency WHERE w.id_tenant = ? AND sc.dtype = 'S' UNION SELECT sc.* FROM security s JOIN securitycurrency sc ON s.id_securitycurrency = sc.id_securitycurrency WHERE s.id_tenant_private = ? UNION SELECT DISTINCT sc.* FROM transaction t JOIN securitycurrency sc ON t.id_securitycurrency = sc.id_securitycurrency WHERE t.id_tenant = ? UNION SELECT DISTINCT sc.* FROM watchlist w JOIN watchlist_sec_cur ws ON w.id_watchlist = ws.id_watchlist JOIN security s ON s.id_securitycurrency = ws.id_securitycurrency JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN security s1 ON s1.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON s1.id_securitycurrency = sc.id_securitycurrency WHERE w.id_tenant = ? AND sc.dtype = 'S' UNION SELECT sc.* FROM security s JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN security s1 ON s1.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON s1.id_securitycurrency = sc.id_securitycurrency WHERE s.id_tenant_private = ? AND sc.dtype = 'S' UNION SELECT DISTINCT sc.* FROM transaction t JOIN security s ON t.id_securitycurrency = s.id_securitycurrency JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN security s1 ON s1.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON s1.id_securitycurrency = sc.id_securitycurrency WHERE t.id_tenant = ? AND sc.dtype = 'S' UNION SELECT sc.* FROM correlation_set cs JOIN correlation_instrument ci ON cs.id_correlation_set = ci.id_correlation_set JOIN securitycurrency sc ON ci.id_securitycurrency = sc.id_securitycurrency WHERE sc.dtype = 'S' AND cs.id_tenant = ?"""; private static String SECURITYCURRENCY_DELETE = String.format( "sc.* FROM %s sc, %s s WHERE sc.id_securitycurrency = s.id_securitycurrency AND id_tenant_private = ?", Securitycurrency.TABNAME, Security.TABNAME); private static String CURRENCYPAIR_SELECT = """ c1.* FROM currencypair c1, securitycurrency sc, (SELECT DISTINCT s.currency as fromcurrency, e.currency as tocurrency FROM tenant e, portfolio p, securitycashaccount sc, transaction t, security s WHERE e.id_tenant = ? AND e.id_tenant = p.id_portfolio AND p.id_portfolio = sc.id_portfolio AND sc.id_securitycash_account = t.id_security_account AND t.id_securitycurrency = s.id_securitycurrency) c2 WHERE c1.from_currency = fromcurrency AND c1.to_currency = tocurrency AND c1.id_securitycurrency = sc.id_securitycurrency UNION SELECT DISTINCT c.* FROM tenant e, currencypair c, portfolio p, cashaccount a, securitycashaccount s, securitycurrency sc WHERE e.id_tenant = ? AND e.id_tenant = p.id_tenant AND c.from_currency = a.currency AND c.to_currency = e.currency AND p.id_portfolio = s.id_portfolio AND a.id_securitycash_account = s.id_securitycash_account AND c.id_securitycurrency = sc.id_securitycurrency UNION SELECT DISTINCT c.* FROM currencypair c, transaction t, portfolio p, securitycashaccount sc, cashaccount ca, securitycurrency s WHERE p.id_tenant = ? AND p.id_portfolio = sc.id_portfolio AND sc.id_securitycash_account = ca.id_securitycash_account AND t.id_cash_account = ca.id_securitycash_account AND t.id_currency_pair = c.id_securitycurrency AND c.id_securitycurrency = s.id_securitycurrency UNION SELECT DISTINCT c.* FROM watchlist w JOIN watchlist_sec_cur ws ON w.id_watchlist = ws.id_watchlist JOIN security s ON s.id_securitycurrency = ws.id_securitycurrency JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN currencypair c ON c.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON c.id_securitycurrency = sc.id_securitycurrency WHERE w.id_tenant = ? AND sc.dtype = 'C' UNION SELECT c.* FROM security s JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN currencypair c ON c.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON c.id_securitycurrency = sc.id_securitycurrency WHERE s.id_tenant_private = ? AND sc.dtype = 'C' UNION SELECT DISTINCT c.* FROM transaction t JOIN security s ON t.id_securitycurrency = s.id_securitycurrency JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN currencypair c ON c.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON c.id_securitycurrency = sc.id_securitycurrency WHERE t.id_tenant = ? AND sc.dtype = 'C' UNION SELECT c.* FROM watchlist w JOIN watchlist_sec_cur ws ON w.id_watchlist = ws.id_watchlist JOIN currencypair c ON c.id_securitycurrency = ws.id_securitycurrency WHERE w.id_tenant = ? UNION SELECT cp.* FROM correlation_set cs JOIN correlation_instrument ci ON cs.id_correlation_set = ci.id_correlation_set JOIN currencypair cp ON ci.id_securitycurrency = cp.id_securitycurrency WHERE cs.id_tenant = ?"""; private static String SECURITYCURRENCY_C_SELECT = """ sc.* FROM currencypair c1, securitycurrency sc, (SELECT DISTINCT s.currency as fromcurrency, e.currency as tocurrency FROM tenant e, portfolio p, securitycashaccount sc, transaction t, security s WHERE e.id_tenant = ? AND e.id_tenant = p.id_portfolio AND p.id_portfolio = sc.id_portfolio AND sc.id_securitycash_account = t.id_security_account AND t.id_securitycurrency = s.id_securitycurrency) c2 WHERE c1.from_currency = fromcurrency AND c1.to_currency = tocurrency AND c1.id_securitycurrency = sc.id_securitycurrency UNION SELECT DISTINCT sc.* FROM tenant e, currencypair c, portfolio p, cashaccount a, securitycashaccount s, securitycurrency sc WHERE e.id_tenant = ? AND e.id_tenant = p.id_tenant AND c.from_currency = a.currency AND c.to_currency = e.currency AND p.id_portfolio = s.id_portfolio AND a.id_securitycash_account = s.id_securitycash_account AND c.id_securitycurrency = sc.id_securitycurrency UNION SELECT DISTINCT s.* FROM currencypair c, transaction t, portfolio p, securitycashaccount sc, cashaccount ca, securitycurrency s WHERE p.id_tenant = ? AND p.id_portfolio = sc.id_portfolio AND sc.id_securitycash_account = ca.id_securitycash_account AND t.id_cash_account = ca.id_securitycash_account AND t.id_currency_pair = c.id_securitycurrency AND c.id_securitycurrency = s.id_securitycurrency UNION SELECT DISTINCT sc.* FROM watchlist w JOIN watchlist_sec_cur ws ON w.id_watchlist = ws.id_watchlist JOIN security s ON s.id_securitycurrency = ws.id_securitycurrency JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN currencypair c ON c.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON c.id_securitycurrency = sc.id_securitycurrency WHERE w.id_tenant = ? AND sc.dtype = 'C' UNION SELECT sc.* FROM security s JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN currencypair c ON c.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON c.id_securitycurrency = sc.id_securitycurrency WHERE s.id_tenant_private = ? AND sc.dtype = 'C' UNION SELECT DISTINCT sc.* FROM transaction t JOIN security s ON t.id_securitycurrency = s.id_securitycurrency JOIN security_derived_link sdl ON s.id_securitycurrency = sdl.id_securitycurrency JOIN currencypair c ON c.id_securitycurrency = sdl.id_link_securitycurrency JOIN securitycurrency sc ON c.id_securitycurrency = sc.id_securitycurrency WHERE t.id_tenant = ? AND sc.dtype = 'C' UNION SELECT sc.* FROM watchlist w JOIN watchlist_sec_cur ws ON w.id_watchlist = ws.id_watchlist JOIN securitycurrency sc ON sc.id_securitycurrency = ws.id_securitycurrency WHERE sc.dtype = 'C' AND w.id_tenant = ? UNION SELECT sc.* FROM correlation_set cs JOIN correlation_instrument ci ON cs.id_correlation_set = ci.id_correlation_set JOIN securitycurrency sc ON ci.id_securitycurrency = sc.id_securitycurrency WHERE sc.dtype = 'C' AND cs.id_tenant = ?"""; private static String HISTORYQUOTE_SELECT = """ DISTINCT h.* FROM transaction t JOIN security s ON t.id_securitycurrency = s.id_securitycurrency JOIN historyquote h ON s.id_securitycurrency = h.id_securitycurrency WHERE t.id_tenant = ? AND s.active_to_date < now() + interval 1 month UNION SELECT DISTINCT h.* FROM transaction t JOIN historyquote h ON h.id_securitycurrency = t.id_currency_pair WHERE t.id_tenant = ? """; private static String HISTORYQUOTEPERIOD_SELECT = """ hp.* FROM historyquote_period hp JOIN security s ON hp.id_securitycurrency = s.id_securitycurrency WHERE s.id_tenant_private = ? UNION SELECT DISTINCT hp.* FROM watchlist w JOIN watchlist_sec_cur wsc ON w.id_watchlist = wsc.id_watchlist JOIN historyquote_period hp ON wsc.id_securitycurrency = hp.id_securitycurrency WHERE w.id_tenant = ? UNION SELECT DISTINCT hp.* FROM transaction t JOIN historyquote_period hp ON t.id_securitycurrency = hp.id_securitycurrency WHERE t.id_tenant = ?"""; private static String HISTORYQUOTEPERIOD_DELETE = String.format( "hp.* FROM %s hp JOIN %s s ON hp.id_securitycurrency = s.id_securitycurrency WHERE s.id_tenant_private = ?", HistoryquotePeriod.TABNAME, Security.TABNAME); private static String WATCHLIST_SEC_CUR_SELDEL = String.format( "ws.* FROM %s w, %s ws WHERE w.id_tenant = ? AND w.id_watchlist = ws.id_watchlist", Watchlist.TABNAME, Watchlist.TABNAME_SEC_CUR); private static String IMPORT_TRANS_FAILED_SELDEL = String.format( "f.* FROM %s f INNER JOIN %s p ON f.id_trans_pos = p.id_trans_pos WHERE p.id_tenant = ?", ImportTransactionPosFailed.TABNAME, ImportTransactionPos.TABNAME); private static String PROPOSE_USER_TASK_SEL = String.format( "t.* FROM %s t JOIN %s r ON t.id_propose_request = r.id_propose_request WHERE r.created_by = ?", ProposeUserTask.TABNAME, ProposeRequest.TABNAME); private static String PROPOSE_CHANGE_ENTITY_SEL = String.format( "e.* FROM %s e JOIN %s r ON e.id_propose_request = r.id_propose_request WHERE r.created_by = ?", ProposeChangeEntity.TABNAME, ProposeRequest.TABNAME); private static String PROPOSE_CHANGE_FIELD_SELDEL = String.format( "f.* FROM %s f INNER JOIN %s r ON f.id_propose_request = r.id_propose_request WHERE r.created_by = ?", ProposeChangeField.TABNAME, ProposeRequest.TABNAME); private static String MAIL_SETTING_FORWARD_REDIRECT_USER_DEL = UPDATE_STR + String .format(" %s SET id_user_redirect = null WHERE id_user_redirect = ?", MailSettingForward.TABNAME); protected JdbcTemplate jdbcTemplate; private int exportOrDelete; protected User user; /* * The order should only be changed carefully. Otherwise, the foreign key * relationships can lead to errors. */ protected ExportDefinition[] exportDefinitions = new ExportDefinition[] { // Export -> it runs with the first element // Delete it runs backwards new ExportDefinition("flyway_schema_history", TENANT_USER.NONE, null, EXPORT_USE), new ExportDefinition(Globalparameters.TABNAME, TENANT_USER.NONE, null, EXPORT_USE), new ExportDefinition(MultilanguageString.TABNAME, TENANT_USER.NONE, null, EXPORT_USE), new ExportDefinition(MultilanguageString.MULTILINGUESTRINGS, TENANT_USER.NONE, null, EXPORT_USE), new ExportDefinition(ImportTransactionPlatform.TABNAME, TENANT_USER.NONE, null, EXPORT_USE | CHANGE_USER_ID_FOR_CREATED_BY), new ExportDefinition(ImportTransactionTemplate.TABNAME, TENANT_USER.NONE, null, EXPORT_USE | CHANGE_USER_ID_FOR_CREATED_BY), new ExportDefinition(TradingPlatformPlan.TABNAME, TENANT_USER.NONE, null, EXPORT_USE | CHANGE_USER_ID_FOR_CREATED_BY), // Stock exchange is fully exported but data owner must be changed too user new ExportDefinition(Stockexchange.TABNAME, TENANT_USER.NONE, null, EXPORT_USE | CHANGE_USER_ID_FOR_CREATED_BY), // Asset classes is fully exported but data owner must be changed too user new ExportDefinition(Assetclass.TABNAME, TENANT_USER.NONE, null, EXPORT_USE | CHANGE_USER_ID_FOR_CREATED_BY), new ExportDefinition(Tenant.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(User.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(Role.TABNAME, TENANT_USER.NONE, null, EXPORT_USE), new ExportDefinition(User.TABNAME_USER_ROLE, TENANT_USER.ID_USER, null, DELETE_USE), new ExportDefinition(Portfolio.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(Securitycashaccount.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(Cashaccount.TABNAME, TENANT_USER.NONE, CASHACCOUNT_SELDEL, EXPORT_USE | DELETE_USE), new ExportDefinition(Securityaccount.TABNAME, TENANT_USER.ID_TENANT, SECURITYACCOUNT_SELDEL, EXPORT_USE | DELETE_USE), new ExportDefinition(Securitycurrency.TABNAME, TENANT_USER.ID_TENANT, SECURITYCURRENCY_C_SELECT, EXPORT_USE), new ExportDefinition(Securitycurrency.TABNAME, TENANT_USER.ID_TENANT, SECURITYCURRENCY_S_SELECT, EXPORT_USE), new ExportDefinition(Securitycurrency.TABNAME, TENANT_USER.ID_TENANT, SECURITYCURRENCY_DELETE, DELETE_USE | CHANGE_USER_ID_FOR_CREATED_BY), new ExportDefinition(Security.TABNAME, TENANT_USER.ID_TENANT, SECURITY_DELETE, DELETE_USE), new ExportDefinition(Security.TABNAME, TENANT_USER.ID_TENANT, SECURITY_SELECT, EXPORT_USE), new ExportDefinition(SecurityDerivedLink.TABNAME, TENANT_USER.ID_TENANT, SECURITY_DERIVED_LINK, EXPORT_USE), new ExportDefinition(Securitysplit.TABNAME, TENANT_USER.ID_TENANT, SECURITYSPLIT_SELECT, EXPORT_USE), new ExportDefinition(Securitysplit.TABNAME, TENANT_USER.ID_TENANT, SECURITYSPLIT_DELETE, DELETE_USE), new ExportDefinition(Dividend.TABNAME, TENANT_USER.ID_TENANT, DIVIDEND_SELECT, EXPORT_USE), new ExportDefinition(Dividend.TABNAME, TENANT_USER.ID_TENANT, DIVIDEND_DELETE, DELETE_USE), new ExportDefinition(HistoryquotePeriod.TABNAME, TENANT_USER.ID_TENANT, HISTORYQUOTEPERIOD_SELECT, EXPORT_USE), new ExportDefinition(HistoryquotePeriod.TABNAME, TENANT_USER.ID_TENANT, HISTORYQUOTEPERIOD_DELETE, DELETE_USE), new ExportDefinition(Currencypair.TABNAME, TENANT_USER.NONE, CURRENCYPAIR_SELECT, EXPORT_USE), new ExportDefinition(Historyquote.TABNAME, TENANT_USER.NONE, HISTORYQUOTE_SELECT, EXPORT_USE), new ExportDefinition(Watchlist.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(Watchlist.TABNAME_SEC_CUR, TENANT_USER.NONE, WATCHLIST_SEC_CUR_SELDEL, EXPORT_USE | DELETE_USE), new ExportDefinition(Transaction.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(ImportTransactionHead.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(ImportTransactionPos.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(ImportTransactionPosFailed.TABNAME, TENANT_USER.NONE, IMPORT_TRANS_FAILED_SELDEL, EXPORT_USE | DELETE_USE), new ExportDefinition(ProposeRequest.TABNAME, TENANT_USER.CREATED_BY, null, EXPORT_USE | DELETE_USE), new ExportDefinition(ProposeUserTask.TABNAME, TENANT_USER.CREATED_BY, PROPOSE_USER_TASK_SEL, EXPORT_USE), new ExportDefinition(ProposeChangeEntity.TABNAME, TENANT_USER.CREATED_BY, PROPOSE_CHANGE_ENTITY_SEL, EXPORT_USE), new ExportDefinition(ProposeChangeField.TABNAME, TENANT_USER.CREATED_BY, PROPOSE_CHANGE_FIELD_SELDEL, EXPORT_USE | DELETE_USE), new ExportDefinition(CorrelationSet.TABNAME, TENANT_USER.ID_TENANT, null, EXPORT_USE | DELETE_USE), new ExportDefinition(CorrelationSet.TABNAME_CORRELATION_INSTRUMENT, TENANT_USER.NONE, CORRELATION_INSTRUMENT_SELDEL, EXPORT_USE | DELETE_USE), // Delete all Change Limits for export user, nothing is exported new ExportDefinition(UserEntityChangeLimit.TABNAME, TENANT_USER.ID_USER, null, DELETE_USE), new ExportDefinition(UserEntityChangeCount.TABNAME, TENANT_USER.ID_USER, null, DELETE_USE), new ExportDefinition(TradingDaysPlus.TABNAME, TENANT_USER.NONE, null, EXPORT_USE), new ExportDefinition(TradingDaysMinus.TABNAME, TENANT_USER.NONE, null, EXPORT_USE), // TODO Delete all Mails of the user, nothing is exported // ... new ExportDefinition(MailSettingForward.TABNAME, TENANT_USER.ID_USER, MAIL_SETTING_FORWARD_REDIRECT_USER_DEL, CHANGE_USER_ID), // TODO Missing Algo export ... new ExportDefinition(AlgoTopAssetSecurity.TABNAME, TENANT_USER.ID_TENANT, null, DELETE_USE), new ExportDefinition(AlgoTop.TABNAME, TENANT_USER.ID_TENANT, ALGO_TOP_DEL, DELETE_USE), new ExportDefinition(AlgoAssetclassSecurity.TABNAME, TENANT_USER.ID_TENANT, ALGO_ASSETCLASS_SECURITY_DEL, DELETE_USE), new ExportDefinition(AlgoAssetclass.TABNAME, TENANT_USER.ID_TENANT, ALGO_ASSETCLASS_DEL, DELETE_USE), new ExportDefinition(AlgoSecurity.TABNAME, TENANT_USER.ID_TENANT, ALGO_SECURITY_DEL, DELETE_USE), new ExportDefinition(AlgoRuleStrategy.TABNAME, TENANT_USER.ID_TENANT, null, DELETE_USE), new ExportDefinition(AlgoStrategy.TABNAME, TENANT_USER.ID_TENANT, ALGO_STRATEGY_DEL, DELETE_USE), new ExportDefinition(AlgoRule.TABNAME, TENANT_USER.ID_TENANT, ALGO_RULE_DEL, DELETE_USE), new ExportDefinition(AlgoRuleStrategy.ALGO_RULE_STRATEGY_PARAM, TENANT_USER.ID_TENANT, ALGO_RULE_STRATEGY_PARAM_DEL, DELETE_USE), new ExportDefinition(AlgoRule.ALGO_RULE_PARAM2, TENANT_USER.ID_TENANT, ALGO_RULE_PARAM_2_DEL, DELETE_USE) }; public MyDataExportDeleteDefinition(JdbcTemplate jdbcTemplate, int exportOrDelete) { this.jdbcTemplate = jdbcTemplate; this.exportOrDelete = exportOrDelete; user = ((User) SecurityContextHolder.getContext().getAuthentication().getDetails()); } protected String getQuery(ExportDefinition exportDefinition) { String query = exportDefinition.sqlStatement; if (exportDefinition.tenantUser == TENANT_USER.ID_USER_DIFFERENT) { return query; } else if (query == null) { switch (exportDefinition.tenantUser) { case ID_TENANT: query = String.format("FROM %s WHERE id_Tenant = %d", exportDefinition.table, user.getIdTenant()); break; case ID_USER: query = String.format("FROM %s WHERE id_USER = %d", exportDefinition.table, user.getIdUser()); break; case CREATED_BY: query = String.format("FROM %s WHERE created_by = %d", exportDefinition.table, user.getIdUser()); break; default: query = String.format("FROM %s", exportDefinition.table); } if ((exportOrDelete & EXPORT_USE) == EXPORT_USE) { query = " * " + query; } } if(query.startsWith(UPDATE_STR + " ")) { return query; } else { return ((exportOrDelete & EXPORT_USE) == EXPORT_USE ? SELECT_STR : DELETE_STR) + " " + query; } } /** * Counts the existing ? in the SQL statement and creates an array with this * number. This array is filled with either IdUser or IdTenant. */ protected Object[] getParamArrayOfStatementForIdTenantOrIdUser(ExportDefinition exportDefinition, String query) { int countIdTenant = 0; Matcher matcher = Pattern.compile("=\\s*\\?(\\s|$)").matcher(query); while (matcher.find()) { countIdTenant++; } Object[] idTenatArray = new Integer[countIdTenant]; Arrays.fill(idTenatArray, exportDefinition.tenantUser == TENANT_USER.ID_USER || exportDefinition.tenantUser == TENANT_USER.CREATED_BY ? user.getIdUser() : user.getIdTenant()); return idTenatArray; } static class ExportDefinition { public String table; public TENANT_USER tenantUser; public String sqlStatement; public int usage; public ExportDefinition(String table, TENANT_USER tenantUser, String sqlStatement, int usage) { this.table = table; this.tenantUser = tenantUser; this.sqlStatement = sqlStatement; this.usage = usage; } public boolean isExport() { return (usage & EXPORT_USE) == EXPORT_USE; } public boolean isDelete() { return (usage & DELETE_USE) == DELETE_USE; } public boolean isChangeUserIdForCreatedBy() { return (usage & CHANGE_USER_ID_FOR_CREATED_BY) == CHANGE_USER_ID_FOR_CREATED_BY; } public boolean isChangeUserId() { return (usage & CHANGE_USER_ID) == CHANGE_USER_ID; } } static enum TENANT_USER { // Use special SQL statement NONE, // Create statement with where clause which uses tenant id for selection ID_TENANT, // Create statement with where clause which uses id_user for selection ID_USER, // Used for shared entities which were created by this user CREATED_BY, // Used for statement where idUser is used but the table field has a different // name ID_USER_DIFFERENT } }
[ "hg@hugograf.com" ]
hg@hugograf.com
b1e38e3d8d15ed5283d2add6865b83d910a11403
9ea4dccb440a34e000e74b472cf4a2ca9e264ae6
/ng-pw-legacy/src/pw-web/java/com/csc/fsg/life/pw/web/controller/IRequest.java
9811135f9c8137acf76adcda118bebb6372304e8
[]
no_license
jasmeet167/PW-NextGen
516473e8d7171b49a832304e76170b3c62ab7261
ea8d9e4de3c8a9dde35bc7b90a6bdba2aee74654
refs/heads/master
2021-01-20T16:21:41.676449
2017-05-09T11:45:40
2017-05-09T11:45:40
90,832,529
0
1
null
null
null
null
UTF-8
Java
false
false
1,446
java
package com.csc.fsg.life.pw.web.controller; import java.io.BufferedReader; import java.util.HashMap; //import com.csc.fsg.life.pw.common.User; /** Modifications V-E190, V-E105, T0106 */ public interface IRequest { public static final int SCOPE_REQUEST = 0; public static final int SCOPE_SESSION = 1; public static final int SCOPE_APPLICATION = 2; public HashMap getRequest(); public void setRequest(HashMap req); // public User getUser(); // public void setUser(User obj); public BufferedReader getReader(); public void setReader(BufferedReader obj); public String getContentType(); public void setContentType(String string); // public void setSession(PWSession map); // public PWSession getSession(); public void setAttribute(String key, Object obj, int scope) throws Exception; public Object getAttribute(String key, int scope) throws Exception; public void removeAttribute(String key, int scope) throws Exception; public String getRemoteAddr(); public void setRemoteAddr(String addr); public String getActionName(); public void setActionName(String string); public String getContextPath(); public void setContextPath(String context); public boolean isIncrementalResponse(); public void setIncrementalResponse(boolean b); // public void setSessionLauncher(SessionLauncher launcher); public void launchNewSession(); }
[ "pzmarlic@csc.com" ]
pzmarlic@csc.com
9f2657d660965e750092232b2cfa0aeb8669ff0e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_2de02f7ed78268e76ccff533f760519f4a6161e6/CreateBranchPage/7_2de02f7ed78268e76ccff533f760519f4a6161e6_CreateBranchPage_s.java
b8967d089ee955e9f269839ab55f8a2499120961
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
9,465
java
/******************************************************************************* * Copyright (c) 2010 SAP AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Mathias Kinzler (SAP AG) - initial implementation *******************************************************************************/ package org.eclipse.egit.ui.internal.repository; import java.io.IOException; import java.util.Map.Entry; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.egit.core.op.BranchOperation; import org.eclipse.egit.ui.UIText; import org.eclipse.egit.ui.internal.ValidationUtils; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IInputValidator; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.RefUpdate; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; /** * Allows to create a new local branch based on another branch or commit. * <p> * If the base is a branch, the source branch can be selected using a drop down. */ class CreateBranchPage extends WizardPage { private final boolean commitMode; private final Repository myRepository; private final IInputValidator myValidator; private final Ref myBaseBranch; private final RevCommit myBaseCommit; private Text nameText; private Button checkout; private Combo branchCombo; /** * Constructs this page. * <p> * If a base branch is provided, the drop down will be selected accordingly * * @param repo * the repository * @param baseBranch * the branch to base the new branch on, may be null */ public CreateBranchPage(Repository repo, Ref baseBranch) { super(CreateBranchPage.class.getName()); commitMode = false; this.myRepository = repo; this.myBaseBranch = baseBranch; this.myBaseCommit = null; this.myValidator = ValidationUtils.getRefNameInputValidator( myRepository, Constants.R_HEADS, true); setTitle(UIText.CreateBranchPage_Title); setMessage(UIText.CreateBranchPage_ChooseBranchAndNameMessage); } /** * Constructs this page. * <p> * If a base branch is provided, the drop down will be selected accordingly * * @param repo * the repository * @param baseCommit * the commit to base the new branch on, must not be null */ public CreateBranchPage(Repository repo, RevCommit baseCommit) { super(CreateBranchPage.class.getName()); commitMode = true; this.myRepository = repo; this.myBaseBranch = null; this.myBaseCommit = baseCommit; this.myValidator = ValidationUtils.getRefNameInputValidator( myRepository, Constants.R_HEADS, true); setTitle(UIText.CreateBranchPage_Title); setMessage(UIText.CreateBranchPage_ChooseNameMessage); } public void createControl(Composite parent) { Composite main = new Composite(parent, SWT.NONE); main.setLayout(new GridLayout(3, false)); Label sourceLabel = new Label(main, SWT.NONE); if (commitMode) { sourceLabel.setText(UIText.CreateBranchPage_SourceCommitLabel); sourceLabel .setToolTipText(UIText.CreateBranchPage_SourceCommitTooltip); } else { sourceLabel.setText(UIText.CreateBranchPage_SourceBranchLabel); sourceLabel .setToolTipText(UIText.CreateBranchPage_SourceBranchTooltip); } this.branchCombo = new Combo(main, SWT.READ_ONLY | SWT.DROP_DOWN); GridDataFactory.fillDefaults().span(2, 1).grab(true, false).applyTo( this.branchCombo); if (commitMode) { this.branchCombo.add(myBaseCommit.name()); this.branchCombo.setText(myBaseCommit.name()); this.branchCombo.setEnabled(false); } else { try { for (Entry<String, Ref> ref : myRepository.getRefDatabase() .getRefs(Constants.R_HEADS).entrySet()) { if (!ref.getValue().isSymbolic()) this.branchCombo.add(ref.getValue().getName()); } for (Entry<String, Ref> ref : myRepository.getRefDatabase() .getRefs(Constants.R_REMOTES).entrySet()) { if (!ref.getValue().isSymbolic()) this.branchCombo.add(ref.getValue().getName()); } for (Entry<String, Ref> ref : myRepository.getRefDatabase() .getRefs(Constants.R_TAGS).entrySet()) { if (!ref.getValue().isSymbolic()) this.branchCombo.add(ref.getValue().getName()); } } catch (IOException e1) { // ignore here } this.branchCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { checkPage(); } }); // select the current branch in the drop down if (myBaseBranch != null) { this.branchCombo.setText(myBaseBranch.getName()); } } Label nameLabel = new Label(main, SWT.NONE); nameLabel.setText(UIText.CreateBranchPage_BranchNameLabel); // we visualize the prefix here Text prefix = new Text(main, SWT.NONE); prefix.setText(Constants.R_HEADS); prefix.setEnabled(false); nameText = new Text(main, SWT.BORDER); // enable testing with SWTBot nameText.setData("org.eclipse.swtbot.widget.key", "BranchName"); //$NON-NLS-1$ //$NON-NLS-2$ GridDataFactory.fillDefaults().grab(true, false).applyTo(nameText); boolean isBare = myRepository.isBare(); checkout = new Button(main, SWT.CHECK); checkout.setText(UIText.CreateBranchPage_CheckoutButton); // most of the time, we probably will check this out // unless we have a bare repository which doesn't allow // check out at all checkout.setSelection(!isBare); checkout.setEnabled(!isBare); checkout.setVisible(!isBare); GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo( checkout); checkout.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { checkPage(); } }); Dialog.applyDialogFont(main); setControl(main); nameText.setFocus(); if (myBaseBranch != null && (myBaseBranch.getName().startsWith(Constants.R_REMOTES) || myBaseBranch .getName().startsWith(Constants.R_TAGS))) { // additional convenience: the last part of the name is suggested // as name for the local branch nameText.setText(myBaseBranch.getName().substring( myBaseBranch.getName().lastIndexOf('/') + 1)); checkPage(); } else { // in any case, we will have to enter the name setPageComplete(false); } // add the listener just now to avoid unneeded checkPage() nameText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { checkPage(); } }); } private void checkPage() { setErrorMessage(null); try { if (branchCombo.getText().length() == 0) { setErrorMessage(UIText.CreateBranchPage_MissingSourceMessage); return; } if (nameText.getText().length() == 0) { setErrorMessage(UIText.CreateBranchPage_ChooseNameMessage); return; } String message = this.myValidator.isValid(nameText.getText()); if (message != null) { setErrorMessage(message); return; } } finally { setPageComplete(getErrorMessage() == null); } } private String getBranchName() { return Constants.R_HEADS + nameText.getText(); } private String getSourceBranchName() { if (commitMode) return myBaseCommit.name(); if (myBaseBranch != null) return myBaseBranch.getName(); else if (this.branchCombo != null) return this.branchCombo.getText(); else return null; } /** * @param monitor * @throws CoreException * @throws IOException */ public void createBranch(IProgressMonitor monitor) throws CoreException, IOException { monitor.beginTask(UIText.CreateBranchPage_CreatingBranchMessage, IProgressMonitor.UNKNOWN); String newRefName = getBranchName(); RefUpdate updateRef = myRepository.updateRef(newRefName); ObjectId startAt; if (commitMode) startAt = myBaseCommit.getId(); else startAt = new RevWalk(myRepository).parseCommit(myRepository .resolve(getSourceBranchName())); updateRef.setNewObjectId(startAt); updateRef.setRefLogMessage( "branch: Created from " + getSourceBranchName(), false); //$NON-NLS-1$ updateRef.update(); if (checkout.getSelection()) { if (monitor.isCanceled()) return; monitor.beginTask(UIText.CreateBranchPage_CheckingOutMessage, IProgressMonitor.UNKNOWN); new BranchOperation(myRepository, getBranchName()).execute(monitor); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2262d24639fec15468188db341d7a6022bd81bf3
66064bd4d036f6d1a9877d78b253ee34bebcd868
/src/Main.java
6fa650a6c896f4c5c77d398c9617b052f4b4d2d6
[]
no_license
Simonaqua/LetsCheerUpBob
7b2b01462ba867b4ea4af69ecadb3d660fb7b53b
0b9fea3300ac9959e00159d67dbf2f2a72a5a4b1
refs/heads/master
2020-09-12T16:15:11.571138
2019-11-18T15:02:32
2019-11-18T15:02:32
222,476,099
0
0
null
null
null
null
UTF-8
Java
false
false
6,159
java
import java.util.*; import java.util.concurrent.LinkedBlockingQueue; public class Main { public static class GameStatus { boolean bobsTurn; Vector<MyMoves> myMoves; char[][] mat; int movNum; public GameStatus(){ mat = new char[3][3]; myMoves = new Vector<MyMoves>(); } public GameStatus(GameStatus gs){ myMoves = new Vector<MyMoves>(); for (int i = 0 ; i<gs.myMoves.size() ; i++){ this.myMoves.add(gs.getMyMoves().elementAt(i)); } mat = new char[3][3]; for(int i = 0 ; i<3 ; i++){ for(int j = 0 ; j <3 ; j++){ mat[i][j] = gs.getMat()[i][j]; } } this.bobsTurn = gs.isBobsTurn(); this.movNum = gs.getMovNum(); } public char[][] getMat() { return mat; } public void setMat(char[][] mat) { this.mat = mat; } public int getMovNum() { return movNum; } public void setMovNum(int movNum) { this.movNum = movNum; } public boolean isBobsTurn() { return bobsTurn; } public void setBobsTurn(boolean bobsTurn) { this.bobsTurn = bobsTurn; } public Vector<MyMoves> getMyMoves() { return myMoves; } public void setMyMoves(Vector<MyMoves> myMoves) { this.myMoves = myMoves; } public void addMoves(int x , int y){ this.myMoves.add(new MyMoves(x,y)); } } public static class MyMoves { public int x; public int y; public MyMoves(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } } public static int whoWins(GameStatus curr){ for(int i = 0 ; i<3 ; i++){ int xCount = 0; int oCount = 0; for( int j = 0; j<3 ; j++){ if(curr.mat[i][j] == 'X'){ xCount++; } if(curr.mat[i][j] == 'O'){ oCount++; } } if(xCount == 3){ return 1; } if(oCount ==3){ return 0; } } for(int j = 0 ; j<3 ; j++){ int xCount = 0; int oCount = 0; for(int i = 0 ; i<3 ; i++){ if(curr.mat[i][j] == 'X'){ xCount++; } if(curr.mat[i][j] == 'O'){ oCount++; } } if(xCount == 3){ return 1; } if(oCount == 3){ return 0; } } int leftDiagO =0; int leftDiagX = 0; int rightDiagX = 0; int rightDiagO = 0; for( int i = 0 ;i<3 ; i++){ if(curr.getMat()[i][i] == 'X'){ leftDiagX++; } if(curr.getMat()[i][i] == 'O'){ leftDiagO++; } if(curr.getMat()[i][2-i] == 'X'){ rightDiagX++; } if(curr.getMat()[i][2-i] == 'O'){ rightDiagO++; } } if(leftDiagX == 3 || rightDiagX == 3){ return 1; } if( leftDiagO ==3 || rightDiagO == 3){ return 0; } return -1; } public static void main(String[] args) { Scanner s = new Scanner(System.in); int[] bobsCols = new int[9]; int[] bobsRows = new int[9]; int i; int j; for(i = 0 ; i<9 ; i++){ bobsRows[i] = s.nextInt(); bobsCols[i] = s.nextInt(); bobsRows[i]--; bobsCols[i]--; } Queue<GameStatus> turnsQueue = new LinkedBlockingQueue<GameStatus>(); GameStatus firstTurn = new GameStatus(); for(i = 0 ; i<3 ; i++){ for(j = 0 ; j<3 ; j++){ firstTurn.getMat()[i][j] = '-'; } } firstTurn.setMovNum(0); firstTurn.setBobsTurn(true); turnsQueue.offer(firstTurn); while (!turnsQueue.isEmpty()){ GameStatus temp = turnsQueue.peek(); turnsQueue.poll(); int winner = whoWins(temp); if(winner == 0) continue; if(winner == 1){ for( i = 0 ; i<temp.myMoves.size() ; i++){ System.out.println((temp.myMoves.get(i).x+1) + " " + (temp.myMoves.get(i).y+1)); } break; } if(temp.bobsTurn){ int lastMove = temp.movNum; boolean possibleMove = false; for(i = lastMove ; i< 9 & !possibleMove ; i++){ int col = bobsCols[i]; int row = bobsRows[i]; if(temp.mat[row][col] == '-'){ temp.mat[row][col] = 'X'; temp.movNum = i+1; temp.bobsTurn = false; possibleMove = true; turnsQueue.offer(temp); } } } else { for( i = 0 ; i<3 ; i++){ for( j = 0 ; j<3 ; j++){ if(temp.mat[i][j] != '-') continue; GameStatus newStatus = new GameStatus(temp); newStatus.mat[i][j] = 'O'; newStatus.setBobsTurn(true); newStatus.addMoves(i,j); turnsQueue.offer(newStatus); } } } } } }
[ "1#6AfT)" ]
1#6AfT)
b63506e45ecefb1a545b94449603d0d4d7a099ca
e1d87c5ae5e3b625c2155a4b43f9243edfabfa36
/bailanglvyou/src/main/java/com/basulvyou/system/wibget/CustomView/JCVideoPlayerStandardFresco.java
ce7f747c7b4966e8cf6c23ed5a5c849dd1a9fc28
[]
no_license
MrZJ/bangelvyou
22a2ba37903b18efb1efb921a39f3153d39f3b3c
d5f9e9e3bd819009be88d6c18c3309b4577bcf21
refs/heads/main
2023-01-10T03:46:21.469892
2020-11-17T07:24:56
2020-11-17T07:24:56
307,940,686
0
0
null
null
null
null
UTF-8
Java
false
false
2,574
java
package com.basulvyou.system.wibget.CustomView; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import com.basulvyou.system.R; import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard; //import com.facebook.drawee.view.SimpleDraweeView; /** * Just replace thumb from ImageView to SimpleDraweeView * Created by Nathen * On 2016/05/01 22:59 */ public class JCVideoPlayerStandardFresco extends JCVideoPlayerStandard { // public SimpleDraweeView thumbImageView; public JCVideoPlayerStandardFresco(Context context) { super(context); } public JCVideoPlayerStandardFresco(Context context, AttributeSet attrs) { super(context, attrs); } @Override public void init(Context context) { super.init(context); bottomProgressBar = (ProgressBar) findViewById(R.id.bottom_progress); titleTextView = (TextView) findViewById(R.id.title); backButton = (ImageView) findViewById(R.id.back); // thumbImageView = (SimpleDraweeView) findViewById(R.id.thumb); loadingProgressBar = (ProgressBar) findViewById(R.id.loading); tinyBackImageView = (ImageView) findViewById(R.id.back_tiny); // thumbImageView.setOnClickListener(this); backButton.setOnClickListener(this); tinyBackImageView.setOnClickListener(this); } @Override public void setUp(String url, int screen, Object... objects) { super.setUp(url, screen, objects); if (objects.length == 0) return; titleTextView.setText(objects[0].toString()); if (currentScreen == SCREEN_WINDOW_FULLSCREEN) { fullscreenButton.setImageResource(R.drawable.jc_shrink); backButton.setVisibility(View.VISIBLE); tinyBackImageView.setVisibility(View.INVISIBLE); } else if (currentScreen == SCREEN_LAYOUT_LIST) { fullscreenButton.setImageResource(R.drawable.jc_enlarge); backButton.setVisibility(View.GONE); tinyBackImageView.setVisibility(View.INVISIBLE); } else if (currentScreen == SCREEN_WINDOW_TINY) { tinyBackImageView.setVisibility(View.VISIBLE); setAllControlsVisible(View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE, View.INVISIBLE); } } @Override public int getLayoutId() { return R.layout.layout_standard_fresco; } }
[ "1176851478@qq.com" ]
1176851478@qq.com
fae2127d52f174857c0dc0ee1257711defbb70de
3e32afbfe125089dd15c3031130113a65689c8ec
/Fluidon Core/src/com/oracle/javafx/scenebuilder/kit/util/control/effectpicker/editors/DoubleTextFieldControl.java
968ff57c00a0501ae9d1787508ab425e616a82f4
[ "Apache-2.0" ]
permissive
jGauravGupta/jFluidon
f3d5b08f21f3d0ecf6d12a6c64b7c9e0581e6720
a523da823bd2f1049a0798cdd05a922f1fce483b
refs/heads/master
2021-01-09T20:39:44.081194
2016-06-17T04:04:25
2016-06-17T04:04:25
61,344,483
0
1
null
null
null
null
UTF-8
Java
false
false
6,497
java
/* * Copyright (c) 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the distribution. * - Neither the name of Oracle Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.oracle.javafx.scenebuilder.kit.util.control.effectpicker.editors; import com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.DoubleField; import com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.EditorUtils; import com.oracle.javafx.scenebuilder.kit.util.control.effectpicker.EffectPickerController; import com.oracle.javafx.scenebuilder.kit.util.control.effectpicker.Utils; import java.io.IOException; import java.io.InputStream; import java.net.URL; import javafx.beans.property.DoubleProperty; import javafx.beans.property.SimpleDoubleProperty; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.control.Label; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.layout.GridPane; public class DoubleTextFieldControl extends GridPane { @FXML private Label editor_label; @FXML private DoubleField editor_textfield; private double mini; private double maxi; private double incDecValue; private final DoubleProperty value = new SimpleDoubleProperty(); private final EffectPickerController effectPickerController; private final int roundingFactor = 100; // 2 decimals rounding public DoubleTextFieldControl( EffectPickerController effectPickerController, String labelString, double min, double max, double initVal, double incDec) { this.effectPickerController = effectPickerController; initialize(labelString, min, max, initVal, incDec); editor_textfield.focusedProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> ov, Boolean oldValue, Boolean newValue) { // Commit the value on focus lost if (newValue == false) { double inputValue = Double.parseDouble(editor_textfield.getText()); // First update the model setValue(inputValue); // Then notify the controller a change occured effectPickerController.incrementRevision(); } } }); } public DoubleProperty valueProperty() { return value; } public double getValue() { return value.get(); } @FXML void textfieldTyped(KeyEvent e) { if (e.getCode() == KeyCode.UP) { // First update the model incOrDecValue(incDecValue); // Then notify the controller a change occured effectPickerController.incrementRevision(); } if (e.getCode() == KeyCode.DOWN) { // First update the model incOrDecValue(-incDecValue); // Then notify the controller a change occured effectPickerController.incrementRevision(); } if (e.getCode() == KeyCode.ENTER) { double inputValue = Double.parseDouble(editor_textfield.getText()); // First update the model setValue(inputValue); // Then notify the controller a change occured effectPickerController.incrementRevision(); editor_textfield.selectAll(); } } private void incOrDecValue(double delta) { setValue(getValue() + delta); // Platform.runLater(new Runnable() { // @Override // public void run() { // // position caret after new value for easy editing // editor_textfield.positionCaret(editor_textfield.getText().length()); // } // }); } private void setValue(double d) { double val = Utils.clamp(mini, d, maxi); double rounded = EditorUtils.round(val, roundingFactor); value.set(rounded); editor_textfield.setText(Double.toString(rounded)); } private void initialize(String labelString, double min, double max, double initVal, double incDec) { final URL layoutURL = DoubleTextFieldControl.class.getResource("NumFieldControl.fxml"); //NOI18N try (InputStream is = layoutURL.openStream()) { FXMLLoader loader = new FXMLLoader(); loader.setController(this); loader.setRoot(this); loader.setLocation(layoutURL); Parent p = (Parent) loader.load(is); assert p == this; } catch (IOException x) { throw new RuntimeException(x); } editor_label.setText(labelString); incDecValue = incDec; mini = min; maxi = max; setValue(initVal); } }
[ "gaurav.gupta.jc@gmail.com" ]
gaurav.gupta.jc@gmail.com
6930713e2121712aee567d52ad1d58a2c15fab6b
792070f6c7714a1ef19c213bb37eb7e6fda8f839
/ApiVmg/target/generated-sources/annotations/vn/vmg/api/server/module/AppModule_RouterFactory.java
ec0bfdf6789dada3467beee74debec5ff0468bd9
[]
no_license
ductbmd/vertx-core-project
6894a98fc47f1e86fba0ce74a6ec41ddd14072a6
b81f4bffad21a0601511d130b1a0de534a0269b6
refs/heads/master
2023-04-03T04:02:29.294421
2021-04-06T04:48:05
2021-04-06T04:48:05
355,057,927
0
0
null
null
null
null
UTF-8
Java
false
false
1,272
java
package vn.vmg.api.server.module; import dagger.internal.Factory; import dagger.internal.Preconditions; import io.vertx.core.Vertx; import io.vertx.ext.web.Router; import javax.annotation.Generated; import javax.inject.Provider; @Generated( value = "dagger.internal.codegen.ComponentProcessor", comments = "https://google.github.io/dagger" ) public final class AppModule_RouterFactory implements Factory<Router> { private final AppModule module; private final Provider<Vertx> vertxProvider; public AppModule_RouterFactory(AppModule module, Provider<Vertx> vertxProvider) { this.module = module; this.vertxProvider = vertxProvider; } @Override public Router get() { return provideInstance(module, vertxProvider); } public static Router provideInstance(AppModule module, Provider<Vertx> vertxProvider) { return proxyRouter(module, vertxProvider.get()); } public static AppModule_RouterFactory create(AppModule module, Provider<Vertx> vertxProvider) { return new AppModule_RouterFactory(module, vertxProvider); } public static Router proxyRouter(AppModule instance, Vertx vertx) { return Preconditions.checkNotNull( instance.Router(vertx), "Cannot return null from a non-@Nullable @Provides method"); } }
[ "minhduc.to@vmgmedia.vn" ]
minhduc.to@vmgmedia.vn
525c14093c728fa8e59709f02bc0702f36ec6419
0a157e139233d5c380bc69d23b1f408e77779ade
/src/main/java/com/onepoint/game/domain/roll/Roll.java
ac8cfe70a535be42843a9617d441681bce7efb78
[]
no_license
lenpartington/bowling
d4e70ad6afbc8dfe795a1af50e7dd830b55f7e10
7976290259339543e22ac6c4a030764cc4b7ce6c
refs/heads/master
2023-06-02T00:32:46.047211
2021-06-20T20:52:54
2021-06-20T20:52:54
378,515,656
0
0
null
null
null
null
UTF-8
Java
false
false
242
java
package com.onepoint.game.domain.roll; public abstract class Roll { private int pin; public int getPin() { return pin; } public void setPin(int pin) { this.pin = pin; } public Roll(int pin) { super(); this.pin = pin; } }
[ "len.ochiai@gmail.com" ]
len.ochiai@gmail.com
637e55ab9a77b47ce19fd2dca621d492d650d451
a89bb0f43b86a0bd7946d31ffbdf1db4337f0ce0
/06. 2. Java-EE-JSP-Exercise/src/main/java/metube/web/servlets/AllTubesServlet.java
4a8b85046ded8e474077e21e54b3e039b0b40af7
[ "MIT" ]
permissive
kostadinlambov/Java-Web-Development-Basics-January-2019
b07a802f85401783a0fb9877765c26f26b6e700b
424c91f7f08558bc09c10cfe6a10a3146f1a4673
refs/heads/master
2020-04-16T19:05:32.252080
2019-02-25T21:38:55
2019-02-25T21:38:55
165,846,511
1
0
null
null
null
null
UTF-8
Java
false
false
977
java
package metube.web.servlets; import metube.domain.models.view.TubeAllViewModel; import metube.services.TubeService; import javax.inject.Inject; 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 java.io.IOException; import java.util.List; @WebServlet("/tubes/all") public class AllTubesServlet extends HttpServlet { private final TubeService tubeService; @Inject public AllTubesServlet(TubeService tubeService) { this.tubeService = tubeService; } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { List<TubeAllViewModel> allTubes = this.tubeService.getAll(); req.setAttribute("tubes", allTubes); req.getRequestDispatcher("/jsps/all-tubes.jsp").forward(req, resp); } }
[ "valchak@abv.bg" ]
valchak@abv.bg
71de878045361627ac15e16a224fb68da1a41bdf
56a339df512c7ff745bc62dc8ecbf0f352ea8ac0
/fpml/src-gen/it/unibo/fPML/PureBlock.java
eb461d3dae432db56246166009a42db308b417f1
[]
no_license
benkio/FPML
d455e0426c38f11e1cbc61d0733e250f9ff48070
84cbb660b68ce105a8c26fd49a5c3074ac9abecc
refs/heads/master
2021-01-12T12:20:29.216194
2017-01-18T12:05:00
2017-01-18T12:05:00
72,444,788
1
0
null
null
null
null
UTF-8
Java
false
false
1,170
java
/** * generated by Xtext 2.10.0 */ package it.unibo.fPML; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Pure Block</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link it.unibo.fPML.PureBlock#getElements <em>Elements</em>}</li> * </ul> * * @see it.unibo.fPML.FPMLPackage#getPureBlock() * @model * @generated */ public interface PureBlock extends EObject { /** * Returns the value of the '<em><b>Elements</b></em>' containment reference list. * The list contents are of type {@link org.eclipse.emf.ecore.EObject}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Elements</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Elements</em>' containment reference list. * @see it.unibo.fPML.FPMLPackage#getPureBlock_Elements() * @model containment="true" * @generated */ EList<EObject> getElements(); } // PureBlock
[ "benkio89@gmail.com" ]
benkio89@gmail.com
119174dbe65f376910bf1234e838ab5402128116
92eef13003d022d2402152ef169ca7831fc252a5
/src/main/java/io/dictanova/connector/api/request/AuthenticationRequest.java
85bb3977ff3b6431d115f43a91acfe6be93ee912
[]
no_license
dictanova-api/bime-connector
437c467c63d7b4c6c188f36cbea82b702f46a8a8
e7b93e15a995c2095a8965279632263becb7b89f
refs/heads/master
2020-04-02T00:03:49.129301
2018-10-19T13:24:00
2018-10-19T13:43:59
153,786,740
0
0
null
null
null
null
UTF-8
Java
false
false
479
java
package io.dictanova.connector.api.request; public class AuthenticationRequest { private String clientId; private String clientSecret; public String getClientId() { return clientId; } public void setClientId(String clientId) { this.clientId = clientId; } public String getClientSecret() { return clientSecret; } public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } }
[ "thomas.clarisse@gmail.com" ]
thomas.clarisse@gmail.com
936140b14e111bb921413e73d3b44c8461d69554
7fc1f9f77837fa713c8bcfa0986598904ce031cd
/2022/D0129_์กฐํ•ฉ_DFS_๊ฒŒ๋ฆฌ๋งจ๋”๋ง.java
c5ac2c2077edde4c5b66c2da06853433af949d8a
[]
no_license
kang-jisu/algorithm
429281cbf5559da43dfd6edac1451a2ca155a1d3
d7c2d9ae72b7db7b419aa5fd6a792a08ce1dd4df
refs/heads/master
2022-04-29T16:02:22.565200
2022-04-19T12:45:36
2022-04-19T12:45:36
249,916,090
0
0
null
null
null
null
UTF-8
Java
false
false
2,853
java
package com.company; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Gerrymandering { static int[] pop; static int N; static ArrayList<Integer>[] graph; static int[] visit; static int min; static int[] checked; static int[] sum; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.nextToken()); pop = new int[N+1]; graph = new ArrayList[N+1]; visit = new int[N+1]; min = Integer.MAX_VALUE; for(int i=0; i<=N; i++){ graph[i] = new ArrayList<>(); } st = new StringTokenizer(br.readLine()); for(int i=1; i<=N; i++){ pop[i] = Integer.parseInt(st.nextToken()); } for(int i=1; i<=N; i++){ st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); for(int j=0; j<n; j++){ int a = Integer.parseInt(st.nextToken()); graph[i].add(a); } } for(int i=1; i<=(N/2)+1; i++){ permutation(1,0,i); } if(min==Integer.MAX_VALUE) System.out.println(-1); else System.out.println(min); } static void permutation(int start, int cnt, int end) { if (cnt == end) { // for(int i=1; i<=N; i++){ // if(visit[i]==1) System.out.print(i+" " ); // } // System.out.println(""); check(); return; } for (int i = start; i <= N; i++) { visit[i] = 1; permutation(i + 1, cnt + 1, end); visit[i] = 0; } } static void check(){ checked = new int[N+1]; sum = new int[2]; for(int i=1; i<=N; i++){ if(visit[i]==0 && checked[i]==0) { gary(i,0); break; } } for(int i=1; i<=N; i++){ if(visit[i]==1 && checked[i]==0) { gary(i,1); break; } } for(int i=1; i<=N; i++){ if(checked[i]==0) return; } min = Math.min(min, Math.abs(sum[0]-sum[1])); } static void gary(int x, int s){ checked[x]=1; sum[s]+= pop[x]; for(int i: graph[x]){ if(visit[i] == visit[x] && checked[i]==0) gary(i,s); } } } /* ๋ฐฑ์ค€ 17471 ๊ฒŒ๋ฆฌ๋งจ๋”๋ง ์กฐํ•ฉ์œผ๋กœ ์ „์ฒด๋ฅผ ๋‘ ๊ตฌ์—ญ์œผ๋กœ ๋‚˜๋ˆˆ ํ›„ ๊ทธ ๊ตฌ์—ญ์— ์†ํ•œ ๋งˆ์„์ด ๋ชจ๋‘ ์ด์–ด์ง€๋Š”์ง€ ํ™•์ธ */
[ "noreply@github.com" ]
kang-jisu.noreply@github.com
b640c9418218711ab479d2fb759bb0640bd57d73
95763d45f1a400cadb8ef2d143b16665bbe917fd
/cardapio/src/main/java/com/alelo/crud/cardapio/cardapio/repository/ProdutoRepository.java
84d5367e77efe76d982e07a05fc11d1c081b0bba
[]
no_license
jaquequeroz/api-java-spring-alelo
6a42ab2bcf300220c72124d6af34f5221f241e24
ba6123d067bd7d3d228e58b0c8fc0cd2081a92b5
refs/heads/main
2023-01-21T14:42:37.007330
2020-12-05T03:22:26
2020-12-05T03:22:26
318,688,553
1
0
null
null
null
null
UTF-8
Java
false
false
310
java
package com.alelo.crud.cardapio.cardapio.repository; import com.alelo.crud.cardapio.cardapio.model.Produto; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface ProdutoRepository extends JpaRepository<Produto,Long>{ }
[ "jaquequeroz@gmail.com" ]
jaquequeroz@gmail.com
974375d82cca5fc36b45a309f459ed3ae685ac0c
98915c44fc7ff72be8714e6ef83c83f504d32433
/src/test/java/com/bbq/task/TestUser.java
685d6bda5b26be928bfd936054c960f8d3fb9947
[]
no_license
starkstar/tasks
efbb9b21f5d2a04d2f17da58c1f4cf522e7eae2a
8536470cb8a49c3b0a5a2fcd6bfa3032c9bc390c
refs/heads/master
2021-01-10T03:43:07.638366
2015-12-20T13:49:33
2015-12-20T13:49:33
48,318,573
0
0
null
null
null
null
UTF-8
Java
false
false
1,753
java
package com.bbq.task; import java.util.Date; import java.util.List; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.bbq.task.model.User; import com.bbq.task.service.UserService; @FixMethodOrder(MethodSorters.DEFAULT) public class TestUser { private ApplicationContext ctx = null; private UserService userService = null; @Before public void init(){ ctx = new ClassPathXmlApplicationContext("beans.xml"); userService = ctx.getBean(UserService.class); } @Test public void testUser(){ User u = new User(); u.setName("kakaxi3"); Date date = new Date(); u.setCreate_at(date.getTime()); u.setUpdate_at(date.getTime()); userService.addUser(u); System.out.println("ๆ–ฐๅขž็”จๆˆทๆˆๅŠŸ"); } @Test public void testUpdateUser(){ User user = userService.getUserByName("kakaxi3"); user.setName("fanqiexi3"); userService.updateUser(user); System.out.println("็ผ–่พ‘็”จๆˆทๆˆๅŠŸ"); } @Test public void testGetUserByName(){ User user = userService.getUserByName("fanqiexi3"); System.out.println("ๆŒ‰็…งid่Žทๅ–็”จๆˆทๆˆๅŠŸ๏ผš" + user); } @Test public void testGetAllUser(){ List<User> users = userService.getAllUser(); System.out.println("่Žทๅ–ๆ‰€ๆœ‰็”จๆˆท"); for (User user : users) { System.out.println(user); } } @Test public void testDelete(){ User user = userService.getUserByName("fanqiexi3"); userService.deleteUser(user.getId()); System.out.println("ๅˆ ้™ค็”จๆˆทๆˆๅŠŸ"); } }
[ "wyhuang1980@gmail.com" ]
wyhuang1980@gmail.com
de542f9547556d21bd9747ca6dd7a27d91d38b88
f7c54c63aee2a2841b76782600bf52d8c6b30691
/angularjs_spring_mvc/src/curso/angular/model/TipoArea.java
d940048f0d659a32ced9d60ed8483a75ae85b910
[]
no_license
rgmichael/gerenciamentoDeContratos
362c9b01895ea749da004e2ed2298ea9d63bfc2b
2b87414109e6b39cc847828f117a3398505d0892
refs/heads/master
2020-03-27T14:43:36.964533
2018-08-30T01:07:54
2018-08-30T01:07:54
146,676,034
0
0
null
null
null
null
UTF-8
Java
false
false
2,960
java
package curso.angular.model; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; /** * Modelo que representa a tabela de tipo de area * @author Francisco * */ @Entity public class TipoArea implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String nome; private String descricao; private String responsavel; private String status; //atributos de auditoria private String data_exclusao; private String data_alteracao; private String data_inclusao; private String usuario_exclusao; private String usuario_alteracao; private String usuario_inclusao; public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public void setNome(String nome) { this.nome = nome; } public String getNome() { return nome; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } public String getResponsavel() { return responsavel; } public void setResponsavel(String responsavel) { this.responsavel = responsavel; } public String getData_exclusao() { return data_exclusao; } public void setData_exclusao(String data_exclusao) { this.data_exclusao = data_exclusao; } public String getData_alteracao() { return data_alteracao; } public void setData_alteracao(String data_alteracao) { this.data_alteracao = data_alteracao; } public String getData_inclusao() { return data_inclusao; } public void setData_inclusao(String data_inclusao) { this.data_inclusao = data_inclusao; } public String getUsuario_exclusao() { return usuario_exclusao; } public void setUsuario_exclusao(String usuario_exclusao) { this.usuario_exclusao = usuario_exclusao; } public String getUsuario_alteracao() { return usuario_alteracao; } public void setUsuario_alteracao(String usuario_alteracao) { this.usuario_alteracao = usuario_alteracao; } public String getUsuario_inclusao() { return usuario_inclusao; } public void setUsuario_inclusao(String usuario_inclusao) { this.usuario_inclusao = usuario_inclusao; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.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; TipoArea other = (TipoArea) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
[ "rgmichael@gmail.com" ]
rgmichael@gmail.com
91e2d8a18fbbc782c5c5c8d9bec3121c10beff7a
a663593e5099e60bbf7c4a56c5b8669d76079cd9
/app/src/main/java/com/xinspace/csevent/shop/activity/ExChangeDetailAct.java
c3c39367befe30a560ca3aa094df0041f3520f72
[]
no_license
cuijiehui/doubao
52fabe5ffe37a76ffd7fd9c335f4e01bc60934c6
91f1e3b068eaa2294165b831c695723f0d996a2b
refs/heads/master
2020-03-17T21:01:41.469553
2018-05-18T10:29:33
2018-05-18T10:29:33
133,939,816
0
1
null
null
null
null
UTF-8
Java
false
false
7,743
java
package com.xinspace.csevent.shop.activity; import android.content.Intent; import android.graphics.Color; import android.net.http.SslError; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Gravity; import android.view.View; import android.webkit.SslErrorHandler; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.LinearLayout; import android.widget.PopupWindow; import android.widget.RelativeLayout; import android.widget.TextView; import com.xinspace.csevent.R; import com.xinspace.csevent.app.weiget.SDPreference; import com.xinspace.csevent.shop.modle.ExGoodsBean; import com.xinspace.csevent.shop.weiget.StandardPop; import com.xinspace.csevent.util.LogUtil; import com.xinspace.csevent.util.StatusBarUtils; import com.xinspace.csevent.util.ToastUtil; import com.xinspace.csevent.ui.activity.BaseActivity; /** * ็งฏๅˆ†ๅ…‘ๆข่ฏฆๆƒ… * Created by Android on 2017/6/16. */ public class ExChangeDetailAct extends BaseActivity{ private Intent intent; private WebView web_convert_detail; private LinearLayout ll_convert_detail_back; private TextView tv_convert; private String gid; private SDPreference preference; private String openId; private ExGoodsBean bean; private String hasoption; private StandardPop standardPop; private int myIntegral; private int goodsIntegral; private RelativeLayout rel_data_load; private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case 200: if (msg.obj != null) { } break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); StatusBarUtils.setWindowStatusBarColor(ExChangeDetailAct.this , R.color.app_bottom_color); setContentView(R.layout.act_exchange_detail); preference = SDPreference.getInstance(); openId = preference.getContent("openid"); intent = getIntent(); if (intent != null){ gid = intent.getStringExtra("id"); bean = (ExGoodsBean) intent.getSerializableExtra("bean"); myIntegral = intent.getIntExtra("integral" , 0); hasoption = bean.getHasoption(); goodsIntegral = Integer.valueOf(bean.getCredit()); } initView(); } private void initView() { ll_convert_detail_back = (LinearLayout) findViewById(R.id.ll_convert_detail_back); ll_convert_detail_back.setOnClickListener(onClickListener); tv_convert = (TextView) findViewById(R.id.tv_convert); tv_convert.setOnClickListener(onClickListener); rel_data_load = (RelativeLayout) findViewById(R.id.rel_data_load); if (myIntegral > goodsIntegral){ tv_convert.setText("็ซ‹ๅณๅ…‘ๆข"); tv_convert.setBackgroundColor(Color.parseColor("#ea5205")); }else{ tv_convert.setText("็งฏๅˆ†ไธ่ถณ"); tv_convert.setBackgroundColor(Color.parseColor("#9f9f9f")); } web_convert_detail = (WebView) findViewById(R.id.web_convert_detail); web_convert_detail.getSettings().setUseWideViewPort(true); web_convert_detail.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); web_convert_detail.getSettings().setLoadWithOverviewMode(true); web_convert_detail.setOverScrollMode(View.SCROLL_AXIS_NONE); web_convert_detail.getSettings().setJavaScriptEnabled(true); web_convert_detail.getSettings().setDomStorageEnabled(true); web_convert_detail.getSettings().setAllowFileAccess(true); web_convert_detail.getSettings().setAppCacheEnabled(true); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ web_convert_detail.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); } web_convert_detail.setWebViewClient(new WebViewClient() { public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { ///handler.cancel(); ้ป˜่ฎค็š„ๅค„็†ๆ–นๅผ๏ผŒWebViewๅ˜ๆˆ็ฉบ็™ฝ้กต handler.proceed(); // ๆŽฅๅ—่ฏไนฆ //handleMessage(Message msg); ๅ…ถไป–ๅค„็† } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); rel_data_load.setVisibility(View.GONE); } }); LogUtil.i("url" + bean.getDetail_url()); web_convert_detail.loadUrl(bean.getDetail_url()); } View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(View v) { switch (v.getId()){ case R.id.ll_convert_detail_back: finish(); break; case R.id.tv_convert://็ซ‹ๅณๅ…‘ๆข if (myIntegral > goodsIntegral){ //1๏ผš่กจ็คบๆœ‰่ง„ๆ ผ้€‰้กน๏ผŒ่ฆ้€‰่ง„ๆ ผ 0๏ผš่กจ็คบไธ็”จ้€‰่ง„ๆ ผ if (hasoption.equals("0")){ Intent intent = new Intent(ExChangeDetailAct.this , BuyExChangeAct.class); intent.putExtra("bean" , bean); startActivity(intent); }else if (hasoption.equals("1")){ LogUtil.i("้€‰่ง„ๆ ผ ้€‰่ง„ๆ ผ"); showBuyGoodsPop(); } }else{ ToastUtil.makeToast("ๆ‚จ็š„็งฏๅˆ†ไธ่ถณ"); return; } break; } } }; private void applyData(){ // GetDataBiz.applyTryData(openId, gid, new HttpRequestListener() { // @Override // public void onHttpRequestFinish(String result) throws JSONException { // LogUtil.i("็”ณ่ฏท่ฏ•็”จ่ฟ”ๅ›ž" + result); // JSONObject jsonObject = new JSONObject(result); // if (jsonObject.getString("message").equals("success")){ // handler.obtainMessage(200).sendToTarget(); // } // JSONObject dataJsonObject = jsonObject.getJSONObject("data"); // } // // @Override // public void onHttpRequestError(String error) { // // } // }); } /** * ไนฐไธœ่ฅฟ้€‰ๆ‹ฉ่ง„ๆ ผ * */ private void showBuyGoodsPop(){ if (standardPop == null) { standardPop = new StandardPop(ExChangeDetailAct.this , bean , openId); standardPop.setOnDismissListener(dismissListener); } if (!standardPop.isShowing()) { standardPop.showAtLocation(tv_convert, Gravity.BOTTOM, 0, 0); standardPop.isShowing(); } else { standardPop.dismiss(); } } PopupWindow.OnDismissListener dismissListener = new PopupWindow.OnDismissListener() { @Override public void onDismiss() { standardPop = null; } }; @Override protected void onDestroy() { onClickListener = null; dismissListener = null; if (standardPop != null){ standardPop.onDestory(); } handler.removeCallbacksAndMessages(null); this.setContentView(R.layout.empty_view); super.onDestroy(); } }
[ "714888928@qq.com" ]
714888928@qq.com
4b83a97e0677b950748fbc576efbe68d0cf53071
d12026e4d843fd24e371c6262b38f88cd943053a
/NewVehicleCW/src/newvehiclecw/DateTime.java
4aee97a4e8d112f0203b25cdd9988cd4310e5f35
[]
no_license
BrorNordstrom/SimpleCarParkManager
6d1e023cfa603c000d73f00278abb68dbb4df3b0
f5ee802d670908dfa5d4957caa899423fd110bd5
refs/heads/master
2020-06-14T00:06:11.133755
2019-07-02T09:27:13
2019-07-02T09:27:13
194,830,648
0
0
null
null
null
null
UTF-8
Java
false
false
1,500
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 newvehiclecw; /** * * @author Andreas Nordstrom */ public class DateTime { private int hours; private int minutes; private int day; private int month; private int year; public DateTime(int d,int w,int z,int h,int m){ //This is in the order of dd/mm/yyyy, hh:mm hours = h; minutes = m; day = d; month = w; year = z; } public int getDay() { return day; } public void setDay(int d) { this.day = d; } public int getMonth() { return month; } public void setMonth(int w) { month = w; } public int getYear() { return year; } public void setYear(int z) { year = z; } public int getHours() { return hours; } public void setHours(int h) { this.hours = h; } public int getMinutes() { return minutes; } public void setMinutes(int m) { this.minutes = m; } public String toString(){ return "Date entered: " + day + ":" + month + ":" + year + " Time Entered: " + hours + ":" + minutes; } // It will retieve the date, in the format, dd/mm/yy, hh:mm }
[ "noreply@github.com" ]
BrorNordstrom.noreply@github.com
68bb12314a8a111e8f9cb8bcebdd5466dd9beafa
b2fb0cab0e3974aa4ae4e870fca5dfcb28b191ee
/src/com/gof/voting/controller/MailController.java
e4f34edb1ed72817228aa0e16ca47f0e1ee8e490
[]
no_license
surajtech003/OnlineVotingSystem
4c530d0ea7cde592664b04586fe9e0cc50762f22
305148d13641031d4a7a7701c71d361cc48de3ec
refs/heads/master
2021-09-11T13:29:48.275270
2018-04-07T22:14:08
2018-04-07T22:14:08
110,460,950
0
0
null
null
null
null
UTF-8
Java
false
false
1,457
java
package com.gof.voting.controller; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.gof.voting.email.SenderMail; import com.gof.voting.service.RestePassService; import com.gof.voting.serviceImpl.ResetPassServiceImpl; /** * Servlet implementation class RegisterController */ public class MailController extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println("inside mail- controller"); String toMail = request.getParameter("senderMail"); RestePassService resetPassService = new ResetPassServiceImpl(); boolean isExistMailId = resetPassService.validateMail(toMail); System.out.println(isExistMailId+"::is existed in database"); //System.out.println(toMail); if (!isExistMailId) { out.println(toMail + "- is not existed in database please try wit correct mail id."); response.setContentType("text/html;charset=UTF-8"); response.getWriter().write("False"); } System.out.println("In side mail controller"); out.close(); } }
[ "surajtech003@gmail.com" ]
surajtech003@gmail.com
5859248d9620af71bbb24416efffd231b30b9c71
07f6597e9f8f72802844298c31c56e862bb89f00
/app/src/main/java/com/stayhome/vendor/Models/User.java
46447f4b9508d49839e6ce4a673348a69072036b
[]
no_license
yasharoraa/stay-home-vendor
08f2ba4da7d2ff659ad5be1dcd5788f6bb1fff25
bc930c3a29b1fd34ee576b4659310b4e22e93174
refs/heads/master
2022-10-23T19:14:53.422721
2020-06-22T06:00:01
2020-06-22T06:00:01
267,236,957
0
0
null
null
null
null
UTF-8
Java
false
false
1,008
java
package com.stayhome.vendor.Models; import androidx.annotation.Keep; import com.google.gson.annotations.SerializedName; @Keep public class User { @SerializedName("_id") private String id; @SerializedName("phone") private String phone; @SerializedName("name") private String name; @SerializedName("address") private String address; @SerializedName("pincode") private Integer pincode; @SerializedName("token") private String token; public String getId() { return id; } public String getPhone() { return phone; } public String getName() { return name; } public String getAddress() { return address; } public Integer getPincode() { return pincode; } public String getToken() { return token; } public User(String name, String address, int pincode) { this.name = name; this.address = address; this.pincode = pincode; } }
[ "yash.arora1704@gmail.com" ]
yash.arora1704@gmail.com
988c06751a84cadc12d0641dbd0792eb858b5b76
3f7e4876c23c4379a4ed65d36a72411d65c08db1
/app/src/androidTest/java/com/ltrix/jk/quiapo/ApplicationTest.java
bab0e607101bff9293847f30e5d5ef6118977e2a
[]
no_license
knightbat/Quiapo
bcfdbfb471380a303e86271ccefc4f0174f3b6fa
6dd92427f2e60e23cb24a61e53219358ade5ef85
refs/heads/master
2021-01-10T08:27:38.038502
2015-11-18T13:30:04
2015-11-18T13:30:04
36,749,518
0
0
null
null
null
null
UTF-8
Java
false
false
350
java
package com.ltrix.jk.quiapo; 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); } }
[ "javajk2537@gmail.com" ]
javajk2537@gmail.com
3d46d5838a8585be969a945bbbb155a21f09c494
ef087c27a6fd63064dd57c7df62a2eddb986ca4a
/ribbon-eureka-consumer7500/src/test/java/com/cn/springcloud/ribboneurekaconsumer7500/RibbonEurekaConsumer7500ApplicationTests.java
a83ba93f3136458ba176235262f60fd6164f03df
[]
no_license
bangbangzhou/SpringCloudAllLearing
ce1eb029e8578b3d97ac3fa6da462634084df52b
cdba4a9d83d014a623a258fd40cd6e303fae54b0
refs/heads/main
2023-04-06T05:12:16.944995
2021-04-22T14:41:19
2021-04-22T14:41:19
360,209,478
0
0
null
null
null
null
UTF-8
Java
false
false
262
java
package com.cn.springcloud.ribboneurekaconsumer7500; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class RibbonEurekaConsumer7500ApplicationTests { @Test void contextLoads() { } }
[ "825505212@qq.com" ]
825505212@qq.com
e46170c7430937effc433ee74b72d7bbcd527fee
d79a70442efc0f7f30e7f9209a436ecc12c39fac
/WebDemo_1811/ConsultingAgency/src/java/main/loginPage.java
6f7fe2b2a64c28d408767fa681fbdfb2357cf2f9
[]
no_license
hungnm580/atwa
d8d13c92c24f57360bf88b3733564c9601384571
0c5fd3b6baf4ecbd177cbccdbdb8138c9378297b
refs/heads/master
2021-01-12T04:12:53.294070
2017-01-12T10:27:33
2017-01-12T10:27:33
77,542,981
0
0
null
null
null
null
UTF-8
Java
false
false
3,581
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package main; import com.jsf.user.model.User; import com.mysql.jdbc.Connection; import com.mysql.jdbc.PreparedStatement; import java.sql.DriverManager; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; /** * * @author KHANHTRINH */ @ManagedBean(name="loginPage") @SessionScoped public class loginPage { private String username; private String password; private String chosenG; public loginPage() { } public loginPage(String username, String password) { this.username = username; this.password = password; } public loginPage(String username, String password, String chosenG) { this.username = username; this.password = password; this.chosenG = chosenG; } public String getChosenG() { return chosenG; } public void setChosenG(String chosenG) { this.chosenG = chosenG; } public String getPassword() { return password; } public String getUsername() { return username; } public void setPassword(String password) { this.password = password; } public void setUsername(String username) { this.username = username; } public String nextPage(){ List<User> list = new ArrayList<User>(); PreparedStatement ps = null; Connection con = null; ResultSet rs = null; boolean flag = false; try { Class.forName("com.mysql.jdbc.Driver"); con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/jsfweb", "root", ""); String sql = "select * from users"; ps= (PreparedStatement) con.prepareStatement(sql); rs= ps.executeQuery(); while (rs.next()) { User usr = new User(); usr.setUser_id(rs.getString("user_id")); usr.setUser_name(rs.getString("user_name")); usr.setUser_acc(rs.getString("user_acc")); usr.setUser_pass(rs.getString("user_pass")); list.add(usr); } } catch(Exception e) { e.printStackTrace(); } finally { try { con.close(); ps.close(); } catch(Exception e) { e.printStackTrace(); } } if (flag){ return "regisSub"; }else { if (username.equals("admin") && password.equals("admin")){ return "UserGUI"; } else if (username.equals("pdt") && password.equals("pdt")){ return "subjGUI"; } } for (int i=0 ; i<list.size() ; i++){ if (username.equals(list.get(i).getUser_acc()) && password.equals(list.get(i).getUser_pass())){ //flag = true; return "regisSub"; } } return "invalidLg"; } public String reset(){ setUsername(""); setPassword(""); return "index"; } public String logOut(){ return "index"; } public String chosenGUI(){ if (chosenG.equals("UserGUI")){ return "UserGUI"; }else{ return "subjGUI"; } } }
[ "hungnm_580@vnu.edu.vn" ]
hungnm_580@vnu.edu.vn
7bc8b019331b34a4a35fba1d51b89619ac98fde2
57b230c5ab76880c8e73788a2fea97f6bdf614c1
/OKNNow/src/pr/util/measures/comparators/DistanceComparator.java
82a1b167938e74244ce060e2c82ef7ce00d62777
[]
no_license
SebastianLukas/greenpatterns
8afc0d89f6fff63d63dfb6ef0dcb80234651cffe
d630a9054470f54c8266a16b7aca5d432aeade48
refs/heads/master
2020-03-09T12:32:46.172275
2018-05-26T17:23:00
2018-05-26T17:23:00
128,788,673
0
0
null
null
null
null
UTF-8
Java
false
false
498
java
package pr.util.measures.comparators; import pr.util.measures.DistanceMeasurement; import java.util.Comparator; /** * Created by Seba on 11/03/2018. */ public class DistanceComparator implements Comparator<DistanceMeasurement> { @Override public int compare(DistanceMeasurement x, DistanceMeasurement y) { if (x.getValue() > y.getValue()) { return -1; } if (x.getValue() < y.getValue()) { return 1; } return 0; } }
[ "sebastian.graf1@students.unibe.ch" ]
sebastian.graf1@students.unibe.ch
6f7d0646094067f5dfb8c38ede10363aaab40aa8
d4b008aa4bd4589d59a64bbff2437144a10a5f9f
/app/src/main/java/com/cneop/rts/Aplication/GlobalParas.java
ed2a887d48235f4abcddfba97e636d83107f01a3
[]
no_license
lifanghui99/RTS
43280f6e2abc0fa4d5b8a7bd66cb203bdf9b563f
79a68895640190adfb656bf6f626d33cdcc64773
refs/heads/master
2021-01-13T02:46:03.783858
2016-12-22T13:51:07
2016-12-22T13:51:07
77,148,215
0
0
null
null
null
null
UTF-8
Java
false
false
1,708
java
package com.cneop.rts.Aplication; import android.app.Application; /** * Created by Administrator on 2016/12/22 0022. */ public class GlobalParas extends Application { private static GlobalParas sAppContext = null; private String userName; // ็”จๆˆทๅ private String userNo; // ็”จๆˆทๅทฅๅท private String version; // ็จ‹ๅบ็‰ˆๆœฌๅท private String deviceId = ""; // ่ฎพๅค‡็ผ–ๅท public static GlobalParas getGlobalParas(){ if (sAppContext == null) { sAppContext = new GlobalParas(); } return sAppContext; } public static GlobalParas getAppContext() { return getGlobalParas(); } /** * @return ่Žทๅพ—็”จๆˆทๅ */ public String getUserName() { return userName; } /** * @param userName ่ฎพ็ฝฎ็”จๆˆทๅ */ public void setUserName(String userName) { this.userName = userName; } /** * @return ่Žทๅพ—็”จๆˆทๅทฅๅท */ public String getUserNo() { return userNo; } /** * @param userNo ่ฎพ็ฝฎ็”จๆˆทๅทฅๅท */ public void setUserNo(String userNo) { this.userNo = userNo; } /** * @return ่Žทๅพ—็จ‹ๅบ็‰ˆๆœฌๅท */ public String getVersion() { return version; } /** ่ฎพ็ฝฎ็จ‹ๅบ็‰ˆๆœฌๅท * @param version ็‰ˆๆœฌๅท */ public void setVersion(String version) { this.version = version; } /** * @return ่Žทๅพ—่ฎพๅค‡IMEI */ public String getDeviceId() { return deviceId; } /** * @param deviceId ่ฎพ็ฝฎ่ฎพๅค‡IMEI */ public void setDeviceId(String deviceId) { this.deviceId = deviceId; } }
[ "admindb@local" ]
admindb@local
2cbd1020a8a2867dcad31972a4c4060190892dbb
19feb7d1445c488dc9551ed9329ab64f98cc8df2
/Theory/Quiz/Quiz03/uniclubz - Copy/app/src/main/java/com/example/quiz3uniclubz/ModelDatabase.java
9877f933ede48d343ca92b91604c3a48242defbb
[]
no_license
NSU-SU21-CSE486-1/1811386_SU21_CSE486_1
effe18f69f18124896b8f582632723a0920a1896
9b699ebc07a6f9789115c7d3990f3b9f56c23779
refs/heads/main
2023-07-31T03:00:06.183695
2021-09-18T11:58:01
2021-09-18T11:58:01
377,802,195
0
0
null
null
null
null
UTF-8
Java
false
false
725
java
package com.example.quiz3uniclubz; import android.content.Context; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; @Database(entities = {Model.class},version = 1) public abstract class ModelDatabase extends RoomDatabase { private static ModelDatabase instance; public abstract ModelDao modelDao(); public static synchronized ModelDatabase getInstance(Context context) { if (instance == null) { instance = Room.databaseBuilder(context.getApplicationContext(), ModelDatabase.class, "model_databas") .fallbackToDestructiveMigration() .build(); } return instance; } }
[ "73934957+ahadulislam3@users.noreply.github.com" ]
73934957+ahadulislam3@users.noreply.github.com
43e95bccd4305cb7e709531aaa4a51f2cd07f592
4c2a0c68e6443e53272370da5cd727474cdeb565
/src/question1/UnScenario.java
e983e2b299b523143b937736dbc7d02a2a9b7cde
[]
no_license
jpsymfony/jms-java
6f40f39857ab748e7d1b3affe61d8e51334f0169
1d8d19f4b070222dc54ff20fa3e2e08f2a04be49
refs/heads/master
2021-06-13T17:27:08.349276
2017-04-17T08:24:57
2017-04-17T08:25:00
80,944,317
0
0
null
null
null
null
UTF-8
Java
false
false
798
java
package question1; /** * The type Un scenario. */ public class UnScenario { /** * The entry point of application. * * @param args the input arguments * @throws Exception the exception */ public static void main(String[] args) throws Exception { Provider provider = null; Consumer consumer = null; try { provider = new Provider("request", "reply"); consumer = new Consumer("request", "reply"); consumer.send("test_envoi"); System.out.print("message recu : "); System.out.println(consumer.receive().toString()); //Thread.sleep(3000); } finally { consumer.close(); provider.close(); } } }
[ "jpsymfony@free.fr" ]
jpsymfony@free.fr
db7c0e00dfb5426082beee0147f179f21a2c86ca
9feb3ea9407ae27d56cd10a0db6d3294953777ad
/ks-common/src/main/java/top/ks/common/util/MD5.java
05d0c4aca8afd0b41cd01ffb1cf3971b70c83b19
[]
no_license
kingandsorrow/ks-parent
3971ad1298d21511674543dcacb9aa0554f73f53
d3eb1eb62b1a09db56f696fe94b4c759a6d9fbdf
refs/heads/master
2022-12-21T07:42:05.409993
2021-04-14T08:41:09
2021-04-14T08:41:09
181,907,700
0
1
null
2022-12-16T04:46:19
2019-04-17T14:23:23
Java
UTF-8
Java
false
false
4,673
java
package top.ks.common.util; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.List; public class MD5 { public static String Md5(String plainText) { try { MessageDigest md = MessageDigest.getInstance("MD5"); try { md.update(plainText.getBytes("gbk")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } byte b[] = md.digest(); int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) i += 256; if (i < 16) buf.append("0"); buf.append(Integer.toHexString(i)); } return buf.toString().substring(8, 24).toUpperCase();// 32 // System.out.println("result: " + buf.toString().substring(8, // 24));// 16 } catch (NoSuchAlgorithmException e) { e.printStackTrace(); return null; } } public static String Md5ForUtf8(String plainText) { try { MessageDigest md = MessageDigest.getInstance("MD5"); try { md.update(plainText.getBytes("utf-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } byte b[] = md.digest(); int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) i += 256; if (i < 16) buf.append("0"); buf.append(Integer.toHexString(i)); } return buf.toString().substring(8, 24).toUpperCase();// 32 // System.out.println("result: " + buf.toString().substring(8, // 24));// 16 } catch (NoSuchAlgorithmException e) { e.printStackTrace(); return null; } } public static String sign32(String preText,String key,String input_charset){ return Md532(preText + key, input_charset); } public static boolean verify32(String presignStr,String sign,String key,String input_charset){ if(sign == null || presignStr == null){ return false; } return sign32(presignStr, key, input_charset).equals(sign); } public static String Md532(String plainText, String charset) { try { MessageDigest md = MessageDigest.getInstance("MD5"); try { md.update(plainText.getBytes(charset)); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } byte b[] = md.digest(); int i; StringBuffer buf = new StringBuffer(""); for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) i += 256; if (i < 16) buf.append("0"); buf.append(Integer.toHexString(i)); } return buf.toString().toUpperCase();// 32 // System.out.println("result: " + buf.toString().substring(8, // 24));// 16 } catch (NoSuchAlgorithmException e) { e.printStackTrace(); return null; } } public static String Md532(String plainText) { return Md532(plainText, "gbk"); } /** * Tests a String to MD5.<br> * Usage: java net.lybbs.util.MD5<br> * or java net.lybbs.util.MD5 "some test String" * * @param args * input a test String, no input string for default value. * @throws UnsupportedEncodingException * @throws NoSuchAlgorithmException */ public static void main(String args[]) throws UnsupportedEncodingException, NoSuchAlgorithmException { // B1DF7F0C51F867CE String sha="104<?xml version=\"1.0\" // encoding=\"utf-8\"?><msg><head transcode=\"104\" // partnerid=\"1001003\" version=\"1.0\" time=\"20100806143006\" // /><body><ticketorder gameid=\"SSQ\" ticketsnum=\"1\" totalmoney=\"2\" // province=\"hn\"><user userid=\"10000008\" /><tickets><ticket // id=\"SSQ_2010024_89A86131\" multiple=\"1\" issue=\"2010024\" // playtype=\"0\" // money=\"2\"><ball>08,12,13,20,32,33:09</ball></ticket></tickets></ticketorder></body></msg>123456"; List<Long> list = new ArrayList<Long>(); list.add(new Long(1)); list.add(new Long(2)); Long[] s = (Long[]) list.toArray(new Long[0]); System.out.println(s[1]); // String ss = "605<?xml version=\"1.0\" // encoding=\"UTF-8\"?>\r\t<msg><head transcode=\"605\" // partnerid=\"008621\" version=\"1.0\" // time=\"201101191726888\"/><body><ticketresult id=\"597921\" // gameid=\"SPF\" palmid=\"27973207\" multiple=\"1\" issue=\"10109\" // playtype=\"6-1\" money=\"2\" statuscode=\"0002\" msg=\"\" // orgserial=\"008054-094843-824062-444150\" // orgcheckcode=\"G0RN6VYN5N124\" // province=\"bj\"/></body></msg>QEZ90CHQ"; // // System.out.println(0x67452301L); // String sss = "123456abc"; // String ssss = "008617ๆทฑๅœณๅธ‚ๅนฟๅคฉๅœฐ็ง‘ๆŠ€ๆœ‰้™ๅ…ฌๅธ168377950-X"; // String pulian = "008616็Ž‹็މไธœ0320101197602251033"; } }
[ "kingandsorrow@gmail.com" ]
kingandsorrow@gmail.com
60be9d3bfb742880b559c0ef7f0fe72105034801
e0f3c1370984cca7cac4542dc8db596127ca817a
/javase็ฌฌไบŒ็ซ /ChineseText.java
a11258634a0cb21a4fea268179eb35888e9995b7
[]
no_license
swf-not-y/my-java
0b17432ae26e93c44348505de8d7908c3fc09ed6
f6570c3735694db002d56fe2b452edcbbcc18ae9
refs/heads/main
2023-07-12T01:13:19.168095
2021-08-20T14:02:53
2021-08-20T14:02:53
350,380,465
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
342
java
public class ChineseText { public static void main(String[] args){ Chinese zhangshang = new Chinese("12344","ร•ร…รˆรฝ"); System.out.println(zhangshang.id + "," + zhangshang.name + "," + Chinese.country); Chinese lisi = new Chinese("12345","ร€รฎร‹ร„"); System.out.println(lisi.id + "," + lisi.name + "," + Chinese.country); } }
[ "1873366265@qq.com" ]
1873366265@qq.com
8257721a6f78eecd66adbb63658cb1799344bd47
bc3eb59a06f2ba1d91d2b8c1fe751ca0ebe162f0
/PMSystemClient/src/main/Main.java
99889092f7a805ed818c4d23cfbf99c67e0f4004
[]
no_license
efigarolam/PMSystem
248bbe301118d2440a6ee42fa83a8ae628324bd9
fe1f83661e37bd589061425620e96efa9f034674
refs/heads/master
2021-01-10T20:20:57.026021
2012-10-19T21:31:46
2012-10-19T21:31:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
643
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package main; import controllers.MainController; import views.SplashView; /** * * @author Eduardo Figarola Mota <eduardofigarola@gmail.com> * @author Eneida Montserrat Sรกnchez Larios <eneida430@gmail.com> * @author Ana Alicia Gonzรกlez Mendieta <anaglezmta@gmail.com> * @author Joel Hernรกndez Gutiรฉrrez <joel.hernandezg@gmail.com> */ public class Main { public static void main(String args[]) { SplashView splash = new SplashView(800); MainController mainController = new MainController(args, true); } }
[ "eduardo.figarola@crowdint.com" ]
eduardo.figarola@crowdint.com
26f63de9ddca5e21b55cec5e1d178ac764f37acb
6e2180e3b506b8de44da12146b9eaa3e2e1c3b9e
/src/mx/sep/mec/web/ws/schemas/CancelaTituloElectronicoRequest.java
9f6afc9f4660f97538c5475ae400b526aa90ac3f
[]
no_license
hberumen/TituloElectronico
6054e24c5066636b5dc47ab8066bbf492c2bfaf5
277b9b347dd481a1024ad641a247fc7cc99c54a8
refs/heads/master
2020-03-29T16:31:04.257792
2018-09-24T14:50:04
2018-09-24T14:50:04
150,116,583
0
0
null
null
null
null
UTF-8
Java
false
false
6,591
java
/** * CancelaTituloElectronicoRequest.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package mx.sep.mec.web.ws.schemas; public class CancelaTituloElectronicoRequest implements java.io.Serializable { private java.lang.String folioControl; private java.lang.String motCancelacion; private mx.sep.mec.web.ws.schemas.AutenticacionType autenticacion; public CancelaTituloElectronicoRequest() { } public CancelaTituloElectronicoRequest( java.lang.String folioControl, java.lang.String motCancelacion, mx.sep.mec.web.ws.schemas.AutenticacionType autenticacion) { this.folioControl = folioControl; this.motCancelacion = motCancelacion; this.autenticacion = autenticacion; } /** * Gets the folioControl value for this CancelaTituloElectronicoRequest. * * @return folioControl */ public java.lang.String getFolioControl() { return folioControl; } /** * Sets the folioControl value for this CancelaTituloElectronicoRequest. * * @param folioControl */ public void setFolioControl(java.lang.String folioControl) { this.folioControl = folioControl; } /** * Gets the motCancelacion value for this CancelaTituloElectronicoRequest. * * @return motCancelacion */ public java.lang.String getMotCancelacion() { return motCancelacion; } /** * Sets the motCancelacion value for this CancelaTituloElectronicoRequest. * * @param motCancelacion */ public void setMotCancelacion(java.lang.String motCancelacion) { this.motCancelacion = motCancelacion; } /** * Gets the autenticacion value for this CancelaTituloElectronicoRequest. * * @return autenticacion */ public mx.sep.mec.web.ws.schemas.AutenticacionType getAutenticacion() { return autenticacion; } /** * Sets the autenticacion value for this CancelaTituloElectronicoRequest. * * @param autenticacion */ public void setAutenticacion(mx.sep.mec.web.ws.schemas.AutenticacionType autenticacion) { this.autenticacion = autenticacion; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof CancelaTituloElectronicoRequest)) return false; CancelaTituloElectronicoRequest other = (CancelaTituloElectronicoRequest) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.folioControl==null && other.getFolioControl()==null) || (this.folioControl!=null && this.folioControl.equals(other.getFolioControl()))) && ((this.motCancelacion==null && other.getMotCancelacion()==null) || (this.motCancelacion!=null && this.motCancelacion.equals(other.getMotCancelacion()))) && ((this.autenticacion==null && other.getAutenticacion()==null) || (this.autenticacion!=null && this.autenticacion.equals(other.getAutenticacion()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getFolioControl() != null) { _hashCode += getFolioControl().hashCode(); } if (getMotCancelacion() != null) { _hashCode += getMotCancelacion().hashCode(); } if (getAutenticacion() != null) { _hashCode += getAutenticacion().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(CancelaTituloElectronicoRequest.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://ws.web.mec.sep.mx/schemas", ">cancelaTituloElectronicoRequest")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("folioControl"); elemField.setXmlName(new javax.xml.namespace.QName("http://ws.web.mec.sep.mx/schemas", "folioControl")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("motCancelacion"); elemField.setXmlName(new javax.xml.namespace.QName("http://ws.web.mec.sep.mx/schemas", "motCancelacion")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("autenticacion"); elemField.setXmlName(new javax.xml.namespace.QName("http://ws.web.mec.sep.mx/schemas", "autenticacion")); elemField.setXmlType(new javax.xml.namespace.QName("http://ws.web.mec.sep.mx/schemas", "autenticacionType")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "hberumen@uaz.edu.mx" ]
hberumen@uaz.edu.mx
e0a535f1c39b062d69b3048632ccc42eda16379e
be082076462510236c217a301bca339b35babbf6
/bundles/ExampleImpl/de.upb.mdse.simulizar.loadbalancer.example/src/nutzungsszenario/impl/Nutzungsszenario.java
caf7241b17d458d15ab9635301d33570bc02fd44
[]
no_license
layornos/Palladio-Analyzer-SimuLizar
98276a92e8f090af78274c979dc423728d37cfea
d5a25f4779025fd7a94ef805b9261acd26f3d136
refs/heads/master
2020-12-22T14:00:22.255264
2020-08-03T11:07:04
2020-08-03T11:07:04
236,810,059
0
1
null
2020-08-03T11:07:06
2020-01-28T18:37:29
Java
UTF-8
Java
false
false
2,902
java
package nutzungsszenario.impl; public class Nutzungsszenario implements java.lang.Runnable { protected static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getRootLogger(); protected defaultrepository.ILastverteiler m_portAngeboten_ILastverteiler = null; public Nutzungsszenario() { { //get the business interface // Wait for system m_portAngeboten_ILastverteiler = (defaultrepository.ILastverteiler)de.uka.ipd.sdq.prototype.framework.registry.RmiRegistry.lookup("ILastverteiler_EntpackerService_"); } //FIXME: why is expRun needed? // expRun = de.uka.ipd.sdq.prototype.framework.AbstractMain.getLatestExperimentRun(); //FIXME: declare and initialise sensors ctx.getStack().createAndPushNewStackFrame(); // de.uka.ipd.sdq.simucomframework.variables.cache.StoExCache // .initialiseStoExCache(new de.uka.ipd.sdq.probfunction.math.impl.DefaultRandomGenerator()); de.uka.ipd.sdq.probfunction.math.IProbabilityFunctionFactory probFunctionFactory = de.uka.ipd.sdq.probfunction.math.impl.ProbabilityFunctionFactoryImpl.getInstance(); probFunctionFactory.setRandomGenerator(new de.uka.ipd.sdq.probfunction.math.impl.DefaultRandomGenerator()); de.uka.ipd.sdq.simucomframework.variables.cache.StoExCache.initialiseStoExCache(probFunctionFactory); } private de.uka.ipd.sdq.simucomframework.variables.StackContext ctx = new de.uka.ipd.sdq.simucomframework.variables.StackContext(); @org.junit.Test public void scenarioRunner() { de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> outerStackframe = ctx.getStack().createAndPushNewStackFrame(); { try { // Start Simulate an external call de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> currentFrame = ctx.getStack().currentStackFrame(); // prepare stackframe de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> stackframe = ctx.getStack().createAndPushNewStackFrame(); stackframe.addValue("datei.BYTESIZE", ctx.evaluate("IntPMF[ (100;0.5) (50;0.5) ]",currentFrame)); de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe<Object> callResult = m_portAngeboten_ILastverteiler.entpacke0 ( ctx ); // Stop the time measurement } catch (java.rmi.RemoteException e) { } finally { ctx.getStack().removeStackFrame(); } // END Simulate an external call } ctx.getStack().removeStackFrame(); } public void run() { scenarioRunner(); } }
[ "steffen.becker@informatik.uni-stuttgart.de" ]
steffen.becker@informatik.uni-stuttgart.de
4f7e9a808655d48c44c0990c2eadf5db798797d4
9500956f1fe1859618b37a968f1663e5ac6f54c7
/src/gnu/trove/TLongIntIterator.java
8ed4be44c82d368f338467babfe5662922540159
[]
no_license
willemw12/apps2org
3a3aec81138fd798dad88c972587ffe8ad43385e
3d1c0b6072bd72e232234f60fb8fa0077ef75334
refs/heads/master
2021-01-17T14:15:58.045455
2013-11-16T14:45:48
2013-11-22T22:23:01
30,958,309
5
3
null
2015-02-18T08:58:46
2015-02-18T08:58:46
null
UTF-8
Java
false
false
5,071
java
/////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2001, Eric D. Friedman All Rights Reserved. // // This library 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 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove; ////////////////////////////////////////////////// // THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // ////////////////////////////////////////////////// /** * Iterator for maps of type long and int. * * <p>The iterator semantics for Trove's primitive maps is slightly different * from those defined in <tt>java.util.Iterator</tt>, but still well within * the scope of the pattern, as defined by Gamma, et al.</p> * * <p>This iterator does <b>not</b> implicitly advance to the next entry when * the value at the current position is retrieved. Rather, you must explicitly * ask the iterator to <tt>advance()</tt> and then retrieve either the <tt>key()</tt>, * the <tt>value()</tt> or both. This is done so that you have the option, but not * the obligation, to retrieve keys and/or values as your application requires, and * without introducing wrapper objects that would carry both. As the iteration is * stateful, access to the key/value parts of the current map entry happens in * constant time.</p> * * <p>In practice, the iterator is akin to a "search finger" that you move from * position to position. Read or write operations affect the current entry only and * do not assume responsibility for moving the finger.</p> * * <p>Here are some sample scenarios for this class of iterator:</p> * * <pre> * // accessing keys/values through an iterator: * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); * } * } * </pre> * * <pre> * // modifying values in-place through iteration: * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); * } * } * </pre> * * <pre> * // deleting entries during iteration: * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); * } * } * </pre> * * <pre> * // faster iteration by avoiding hasNext(): * TLongIntIterator iterator = map.iterator(); * for (int i = map.size(); i-- > 0;) { * iterator.advance(); * doSomethingWithKeyAndValue(iterator.key(), iterator.value()); * } * </pre> * * @author Eric D. Friedman * @version $Id: P2PIterator.template,v 1.1 2006/11/10 23:28:00 robeden Exp $ */ public class TLongIntIterator extends TPrimitiveIterator { /** the collection being iterated over */ private final TLongIntHashMap _map; /** * Creates an iterator over the specified map */ public TLongIntIterator(TLongIntHashMap map) { super(map); this._map = map; } /** * Moves the iterator forward to the next entry in the underlying map. * * @throws java.util.NoSuchElementException if the iterator is already exhausted */ public void advance() { moveToNextIndex(); } /** * Provides access to the key of the mapping at the iterator's position. * Note that you must <tt>advance()</tt> the iterator at least once * before invoking this method. * * @return the key of the entry at the iterator's current position. */ public long key() { return _map._set[_index]; } /** * Provides access to the value of the mapping at the iterator's position. * Note that you must <tt>advance()</tt> the iterator at least once * before invoking this method. * * @return the value of the entry at the iterator's current position. */ public int value() { return _map._values[_index]; } /** * Replace the value of the mapping at the iterator's position with the * specified value. Note that you must <tt>advance()</tt> the iterator at * least once before invoking this method. * * @param val the value to set in the current entry * @return the old value of the entry. */ public int setValue(int val) { int old = value(); _map._values[_index] = val; return old; } }// TLongIntIterator
[ "fabio.collini@19801066-89cc-11de-a519-b78fc8232508" ]
fabio.collini@19801066-89cc-11de-a519-b78fc8232508
d880a60f7c5ab1e2dbc8293f82ddde28f7941a84
c5a6e3d9c37eb701c37239de5309517a3515dacd
/src/main/java/uk/gov/hmcts/reform/divorce/validationservice/rules/divorce/d8/D8PetitionerLastName.java
b44f1c87e980d76aa6d998eddf11f81aa1013a5d
[ "MIT" ]
permissive
hmcts/div-validation-service
406127d1f9d10a8033e8baf3c6ec4f384aee798e
10a94cc2ba74aa24c081f934aa14936dfc5b6cf1
refs/heads/master
2021-01-24T23:24:00.305631
2019-09-30T09:22:55
2019-09-30T09:22:55
123,283,306
1
1
MIT
2019-10-01T13:55:53
2018-02-28T12:41:07
Java
UTF-8
Java
false
false
1,299
java
package uk.gov.hmcts.reform.divorce.validationservice.rules.divorce.d8; import com.deliveredtechnologies.rulebook.annotation.Given; import com.deliveredtechnologies.rulebook.annotation.Result; import com.deliveredtechnologies.rulebook.annotation.Rule; import com.deliveredtechnologies.rulebook.annotation.Then; import com.deliveredtechnologies.rulebook.annotation.When; import lombok.Data; import uk.gov.hmcts.reform.divorce.validationservice.domain.request.CoreCaseData; import java.util.List; import java.util.Optional; @Rule(order = 9) @Data public class D8PetitionerLastName { private static final String BLANK_SPACE = " "; private static final String ACTUAL_DATA = "Actual data is: %s"; private static final String ERROR_MESSAGE = "D8PetitionerLastName can not be null or empty."; @Result public List<String> result; @Given("coreCaseData") public CoreCaseData coreCaseData = new CoreCaseData(); @When public boolean when() { return !Optional.ofNullable(coreCaseData.getD8PetitionerLastName()).isPresent(); } @Then public void then() { result.add(String.join( BLANK_SPACE, // delimiter ERROR_MESSAGE, String.format(ACTUAL_DATA, coreCaseData.getD8PetitionerLastName()) )); } }
[ "tony.chow@hmcts.net" ]
tony.chow@hmcts.net
9673ef41b5010c1176424de4de674688c31610db
9f5fcbf93a1772b4efd5b57bd4735921408b50ad
/runtime/postgresqlsrc/com/exedio/cope/PostgresqlSchemaDialect.java
17f4b52a9305c9b6c2e48fd59c7ce957cd3b47bf
[]
no_license
exedio/persistence
0a99c5f5c6c4bf52e2976fddf533ef3857be5319
1e122e105f3ed3837b09828315525c708e754b95
refs/heads/master
2023-08-18T01:09:07.221399
2023-08-15T10:32:32
2023-08-15T10:32:32
32,997,177
8
2
null
2022-12-08T13:10:29
2015-03-27T16:31:03
Java
UTF-8
Java
false
false
9,678
java
/* * Copyright (C) 2004-2015 exedio GmbH (www.exedio.com) * * This library 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 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package com.exedio.cope; import static com.exedio.cope.Dialect.strip; import com.exedio.dsmf.Dialect; import com.exedio.dsmf.Schema; import com.exedio.dsmf.Sequence; import com.exedio.dsmf.Table; import java.sql.ResultSet; import java.util.regex.Pattern; final class PostgresqlSchemaDialect extends Dialect { PostgresqlSchemaDialect(final String schema) { super(schema); final String digits = "\\d*"; final Replacements cc = adjustExistingCheckConstraintCondition; // TODO do omit outside string literals only cc.add(p("(" + digits + ")")+"::bigint\\b", "$1"); // for DateField precision without native date cc.add(p("'(-?" + digits + "(?:\\." + digits + ")?)'::numeric")+"::double precision\\b", "$1"); cc.add("'(-?" + digits + ")'::(?:integer|bigint)\\b", "$1"); // bug 14296 https://www.postgresql.org/message-id/20160826144958.15674.41360%40wrigleys.postgresql.org cc.add( p("(" + digits + "(?:\\." + digits + ")?)") +"::double precision\\b", "$1"); cc.add("('.*?')::character varying\\b", "$1"); cc.add("('.*?')::\"text\"", "$1"); cc.add(p("(\"\\w*\")")+"::\"text\"", "$1"); cc.add(" (=|<>|>=|<=|>|<) ", "$1"); cc.add("\"char_length\"(\\(\"\\w*\"\\))", "CHAR_LENGTH$1"); cc.add("\"octet_length\"(\\(\"\\w*\"\\))", "OCTET_LENGTH$1"); cc.add("\"floor\"(\\(\"date_part\"\\('SECOND', \"seconds\"\\)\\))", "FLOOR$1"); } private static String p(final String s) { return "\\(" + s + "\\)"; } @Override protected String adjustExistingCheckConstraintCondition(String s) { s = adjustExistingCheckConstraintCondition.apply(s); s = adjustExistingCheckConstraintInCondition(s, checkClauseIn, "IN"); s = adjustExistingCheckConstraintInCondition(s, checkClauseInText, "IN"); s = adjustExistingCheckConstraintInCondition(s, checkClauseNotIn, "NOT IN"); return s; } private static String adjustExistingCheckConstraintInCondition( final String s, final Pattern pattern, final String operator) { return pattern.matcher(s).replaceAll(matchResult -> matchResult.group(1) + ' ' + operator + " (" + checkClauseInnerComma.matcher(matchResult.group(2)).replaceAll(",") + ')'); } private static final Pattern checkClauseIn = Pattern.compile("(\"\\w*\")=ANY "+p(p("ARRAY\\[(.*?)]")+"::\"text\"\\[\\]")); private static final Pattern checkClauseInText = Pattern.compile("(\"\\w*\")=ANY "+p("ARRAY\\[(.*?)]")); private static final Pattern checkClauseNotIn = Pattern.compile("(\"\\w*\")<>ALL "+p(p("ARRAY\\[(.*?)]")+"::\"text\"\\[\\]")); private static final Pattern checkClauseInnerComma = Pattern.compile(", "); private final Replacements adjustExistingCheckConstraintCondition = new Replacements(); @Override protected String getColumnType(final int dataType, final ResultSet resultSet) { throw new RuntimeException(); } @Override protected void verify(final Schema schema) { final String catalog = getCatalogLiteral(schema); final String schemaL = getSchemaLiteral(); verifyTables(schema, //language=SQL "SELECT table_name " + "FROM information_schema.tables " + "WHERE table_catalog=" + catalog + " AND table_schema=" + schemaL + " " + "AND table_type='BASE TABLE' " + "ORDER BY table_name"); // make it deterministic for more than one unused table querySQL(schema, //language=SQL "SELECT " + "table_name, " + // 1 "column_name, " + // 2 "is_nullable, " + // 3 "data_type, " + // 4 "character_maximum_length, " + // 5 "datetime_precision " + // 6 "FROM information_schema.columns " + "WHERE table_catalog=" + catalog + " AND table_schema=" + schemaL + " " + "ORDER BY ordinal_position", // make it deterministic for multiple unused columns in one table resultSet -> { while(resultSet.next()) { final String columnName = resultSet.getString(2); final String dataType = resultSet.getString(4); final StringBuilder type = new StringBuilder(); switch(dataType) { case "character varying": type.append(dataType).append('(').append(resultSet.getInt(5)).append(')'); break; case "timestamp without time zone": type.append("timestamp (").append(resultSet.getInt(6)).append(") without time zone"); break; case "timestamp with time zone": // is never created by cope type.append("timestamp (").append(resultSet.getInt(6)).append(") with time zone"); break; default: type.append(dataType); break; } if(!getBooleanStrict(resultSet, 3, "YES", "NO")) type.append(NOT_NULL); final Table table = getTableStrict(schema, resultSet, 1); notifyExistentColumn(table, columnName, type.toString()); } }); querySQL(schema, //language=SQL "SELECT " + "ut.relname," + // 1 "uc.conname," + // 2 "uc.contype," + // 3 "pg_get_constraintdef(uc.oid) " + // 4 "FROM pg_constraint uc " + "INNER JOIN pg_class ut ON uc.conrelid=ut.oid " + "WHERE ut.relname NOT LIKE 'pg_%' AND ut.relname NOT LIKE 'pga_%' AND uc.contype IN ('c','p')", resultSet -> { while(resultSet.next()) { final Table table = getTableStrict(schema, resultSet, 1); final String constraintName = resultSet.getString(2); //System.out.println("tableName:"+tableName+" constraintName:"+constraintName+" constraintType:>"+constraintType+"<"); if(getBooleanStrict(resultSet, 3, "c", "p")) { final String searchCondition = strip(resultSet.getString(4), "CHECK ((", "))"); //System.out.println("searchCondition:>"+searchCondition+"<"); notifyExistentCheck(table, constraintName, searchCondition); } else notifyExistentPrimaryKey(table, constraintName); //System.out.println("EXISTS:"+tableName); } }); verifyUniqueConstraints(schema, //language=SQL "SELECT tc.table_name, tc.constraint_name, cu.column_name " + "FROM information_schema.table_constraints tc " + "JOIN information_schema.key_column_usage cu " + "ON tc.constraint_name=cu.constraint_name AND tc.table_name=cu.table_name " + "WHERE tc.constraint_type='UNIQUE' " + "AND tc.constraint_catalog=" + catalog + " AND tc.constraint_schema=" + schemaL + " " + "AND tc.table_catalog=" + catalog + " AND tc.table_schema=" + schemaL + " " + "AND cu.constraint_catalog=" + catalog + " AND cu.constraint_schema=" + schemaL + " " + "AND cu.table_catalog=" + catalog + " AND cu.table_schema=" + schemaL + " " + "ORDER BY tc.table_name, tc.constraint_name, cu.ordinal_position"); verifyForeignKeyConstraints(schema, //language=SQL "SELECT " + "rc.constraint_name, " + // 1 "src.table_name, " + // 2 "src.column_name, " + // 3 "tgt.table_name, " + // 4 "tgt.column_name, " + // 5 "rc.delete_rule, " + // 6 "rc.update_rule " + // 7 "FROM information_schema.referential_constraints rc " + "JOIN information_schema.key_column_usage src ON rc.constraint_name=src.constraint_name " + "JOIN information_schema.key_column_usage tgt ON rc.unique_constraint_name=tgt.constraint_name " + "WHERE rc.constraint_catalog=" + catalog + " AND rc.constraint_schema=" + schemaL + " " + "AND src.constraint_catalog=" + catalog + " AND src.constraint_schema=" + schemaL + " " + "AND src.table_catalog=" + catalog + " AND src.table_schema=" + schemaL + " " + "AND tgt.constraint_catalog=" + catalog + " AND tgt.constraint_schema=" + schemaL + " " + "AND tgt.table_catalog=" + catalog + " AND tgt.table_schema=" + schemaL, // https://www.postgresql.org/docs/9.6/sql-createtable.html "NO ACTION", "NO ACTION"); verifySequences(schema, //language=SQL "SELECT sequence_name, maximum_value, start_value " + "FROM information_schema.sequences " + "WHERE sequence_catalog=" + catalog + " AND sequence_schema=" + schemaL); } @Override protected void appendTableCreateStatement(final StringBuilder bf) { bf.append(" WITH (OIDS=FALSE)"); } @Override public String modifyColumn(final String tableName, final String columnName, final String newColumnType) { return "ALTER TABLE " + tableName + " ALTER " + columnName + " TYPE " + newColumnType; } @Override protected void createSequence( final StringBuilder bf, final String sequenceName, final Sequence.Type type, final long start) { bf.append("CREATE SEQUENCE "). append(sequenceName). append( " INCREMENT BY 1" + " START WITH ").append(start).append( " MAXVALUE ").append(type.MAX_VALUE).append( " MINVALUE ").append(start).append( // CACHE 1 disables cache // https://www.postgresql.org/docs/9.6/sql-createsequence.html // BEWARE: // With CACHE enabled com.exedio.cope.PostgresqlDialect#getNextSequence // returns wrong results! " CACHE 1" + " NO CYCLE"); } }
[ "ralf.wiebicke@exedio.com" ]
ralf.wiebicke@exedio.com
f6ebc1f83b6ccd4fba0cc43562c9e9be182b9e92
454c734d4e04c7340983a570cd7d242c4525b5b0
/src/main/java/com/example/demo0727/config/WebMvcConfig.java
c69117e95aece5827816b4fc3082dbe42759141c
[]
no_license
zc888168/demo0727
730a9244bf8d8ae3e00315a0b39146993afd2a10
1ab7ab3d564440136349248da41895d8c9296553
refs/heads/master
2022-07-06T20:22:02.352301
2019-07-27T14:36:45
2019-07-27T14:36:45
199,175,805
0
0
null
2022-06-17T02:18:37
2019-07-27T14:35:07
Java
UTF-8
Java
false
false
702
java
package com.example.demo0727.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; @Configuration public class WebMvcConfig extends WebMvcConfigurationSupport { @Override protected void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/"); } }
[ "passion888168@126.com" ]
passion888168@126.com
f0c3fa91394903949a315dc3a0a7cfa26fe19f55
7d96f2687e9ef3d2e4489f324b3e96e455dbf423
/src/com/ncu/exceptions/NotJsonFileException.java
a77b1a1838d0e38aaf7853110ad304707e342b8b
[]
no_license
KnightLearningSolutions/csvtojsonconverter
3b0d556b7d1125ef1d90991bb99a42a10e467a88
b037317eb320c8eb378a437a2b84dabbd00c16f7
refs/heads/master
2020-04-11T18:18:29.167571
2018-12-26T10:04:15
2018-12-26T10:04:15
161,993,639
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
/** * The NotJsonFileException class which generate * exception if user given file name extension is not json * * @author knight Learning Solutions * @version 1.0 * @since 2018-12-15 */ package com.ncu.exceptions; public class NotJsonFileException extends Exception{ public NotJsonFileException(String s){ super(s); } }
[ "javajiadityapal@gmail.com" ]
javajiadityapal@gmail.com
de764dd310015de3cc0bf454448c0d11777a7449
b823fe4b47a1cc2606bd97dd75a8f156f91cb753
/src/cz/autoclient/github/html/GitHubHtml.java
7fe12db8194a645d2472e064a5163248b71bd440
[]
no_license
chienhao10/auto-client
07d4e910729b6b1395aada6e21ada199c9ec626b
cd9f5553ebbbe94ae945283001d06d6a7e418e58
refs/heads/master
2021-01-15T10:13:05.139364
2016-04-29T05:14:50
2016-04-29T05:14:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
553
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 cz.autoclient.github.html; import cz.autoclient.github.interfaces.GitHub; import cz.autoclient.github.interfaces.Repository; import cz.autoclient.github.interfaces.RepositoryId; /** * * @author Jakub */ public class GitHubHtml implements GitHub { @Override public Repository getRepository(RepositoryId id) { return new RepositoryHtml(id); } }
[ "jmareda@seznam.cz" ]
jmareda@seznam.cz
09eb84c750876368a09431294f610aa8ce34b069
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/35/35_aaf797b5c90958dc8eb12fc0bf503fbc0f21fa49/Router/35_aaf797b5c90958dc8eb12fc0bf503fbc0f21fa49_Router_s.java
bc2ab94bee6502649d61ffef0e86f66a7be0101b
[]
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
20,873
java
package play.mvc; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import jregex.Matcher; import jregex.Pattern; import jregex.REFlags; import play.Logger; import play.Play; import play.Play.Mode; import play.PlayPlugin; import play.vfs.VirtualFile; import play.exceptions.NoRouteFoundException; import play.mvc.results.NotFound; import play.mvc.results.RenderStatic; import play.templates.TemplateLoader; /** * The router matches HTTP requests to action invocations */ public class Router { static Pattern routePattern = new Pattern("^({method}GET|POST|PUT|DELETE|OPTIONS|HEAD|\\*)?\\s+({path}/[^\\s]*)\\s+({action}[^\\s(]+)({params}.+)?$"); /** * Pattern used to locate a method override instruction in request.querystring */ static Pattern methodOverride = new Pattern("^.*x-http-method-override=({method}GET|PUT|POST|DELETE).*$"); public static long lastLoading = -1; public static void load(String prefix) { routes.clear(); parse(Play.routes, prefix); lastLoading = System.currentTimeMillis(); // Plugins for (PlayPlugin plugin : Play.plugins) { plugin.onRoutesLoaded(); } } /** * This one can be called to add new route. Last added is first in the route list. */ public static void addRoute(String method, String path, String action) { prependRoute(method, path, action, null); } /** * This is used internally when reading the route file. The order the routes are added matters and * we want the to append the routes to the list. */ protected static void appendRoute(String method, String path, String action, String params) { routes.add(getRoute(method, path, action, params)); } public static Route getRoute(String method, String path, String action, String params) { Route route = new Route(); route.method = method; route.path = path; route.path = route.path.replace("//", "/"); route.action = action; route.addParams(params); route.compute(); return route; } /** * Add a new route at the beginning of the route list */ private static void prependRoute(String method, String path, String action, String params) { routes.add(0, getRoute(method, path, action, params)); } /** * Parse a route file. * If an action starts with <i>"plugin:name"</i>, replace that route by the ones declared * in the plugin route file denoted by that <i>name</i>, if found. * @param routeFile * @param prefix The prefix that the path of all routes in this route file start with. This prefix should not * end with a '/' character. */ static void parse(VirtualFile routeFile, String prefix) { String content = TemplateLoader.load(routeFile).render(new HashMap<String, Object>()); for (String line : content.split("\n")) { line = line.trim().replaceAll("\\s+", " "); if (line.length() == 0 || line.startsWith("#")) { continue; } Matcher matcher = routePattern.matcher(line); if (matcher.matches()) { String action = matcher.group("action"); // module: if (action.startsWith("module:")) { String moduleName = action.substring("module:".length()); String newPrefix = prefix + matcher.group("path"); if (newPrefix.length() > 1 && newPrefix.endsWith("/")) { newPrefix = newPrefix.substring(0, newPrefix.length() - 1); } if (moduleName.equals("*")) { for (String p : Play.modulesRoutes.keySet()) { parse(Play.modulesRoutes.get(p), newPrefix + p); } } else if (Play.modulesRoutes.containsKey(moduleName)) { parse(Play.modulesRoutes.get(moduleName), newPrefix); } else { Logger.error("Cannot include routes for module %s (not found)", moduleName); } } else { String method = matcher.group("method"); String path = prefix + matcher.group("path"); String params = matcher.group("params"); appendRoute(method, path, action, params); } } else { Logger.error("Invalid route definition : %s", line); } } } public static void detectChanges(String prefix) { if (Play.mode == Mode.PROD && lastLoading > 0) { return; } if (Play.routes.lastModified() > lastLoading) { load(prefix); } else { for (VirtualFile file : Play.modulesRoutes.values()) { if (file.lastModified() > lastLoading) { load(prefix); return; } } } } public static List<Route> routes = new ArrayList<Route>(); public static void routeOnlyStatic(Http.Request request) { for (Route route : routes) { try { if (route.matches(request.method, request.path) != null) { break; } } catch (Throwable t) { if (t instanceof RenderStatic) { throw (RenderStatic) t; } } } } public static void route(Http.Request request) { // request method may be overriden if a x-http-method-override parameter is given if (request.querystring != null && methodOverride.matches(request.querystring)) { Matcher matcher = methodOverride.matcher(request.querystring); if (matcher.matches()) { Logger.trace("request method %s overriden to %s ", request.method, matcher.group("method")); request.method = matcher.group("method"); } } for (Route route : routes) { Map<String, String> args = route.matches(request.method, request.path); if (args != null) { request.routeArgs = args; request.action = route.action; if (args.containsKey("format")) { request.format = args.get("format"); } if (request.action.indexOf("{") > -1) { // more optimization ? for (String arg : request.routeArgs.keySet()) { request.action = request.action.replace("{" + arg + "}", request.routeArgs.get(arg)); } } return; } } throw new NotFound(request.method, request.path); } public static Map<String, String> route(String method, String path) { for (Route route : routes) { Map<String, String> args = route.matches(method, path); if (args != null) { args.put("action", route.action); return args; } } return new HashMap<String, String>(); } public static ActionDefinition reverse(String action) { return reverse(action, new HashMap<String, Object>()); } public static String getFullUrl(String action, Map<String, Object> args) { return Http.Request.current().getBase() + reverse(action, args); } public static String getFullUrl(String action) { return getFullUrl(action, new HashMap<String, Object>()); } public static String reverse(VirtualFile file) { if (file == null || !file.exists()) { throw new NoRouteFoundException("File not found (" + file + ")"); } String path = file.relativePath(); path = path.substring(path.indexOf("}") + 1); for (Route route : routes) { String staticDir = route.staticDir; if (staticDir != null) { if (!staticDir.startsWith("/")) { staticDir = "/" + staticDir; } if (!staticDir.equals("/") && !staticDir.endsWith("/")) { staticDir = staticDir + "/"; } if (path.startsWith(staticDir)) { String to = route.path + path.substring(staticDir.length()); if (to.endsWith("/index.html")) { to = to.substring(0, to.length() - "/index.html".length() + 1); } return to; } } } throw new NoRouteFoundException(file.relativePath()); } public static ActionDefinition reverse(String action, Map<String, Object> args) { if (action.startsWith("controllers.")) { action = action.substring(12); } for (Route route : routes) { if (route.actionPattern != null) { Matcher matcher = route.actionPattern.matcher(action); if (matcher.matches()) { for (String group : route.actionArgs) { String v = matcher.group(group); if (v == null) { continue; } args.put(group, v.toLowerCase()); } List<String> inPathArgs = new ArrayList<String>(); boolean allRequiredArgsAreHere = true; // les noms de parametres matchent ils ? for (Route.Arg arg : route.args) { inPathArgs.add(arg.name); Object value = args.get(arg.name); if (value == null) { allRequiredArgsAreHere = false; break; } else { if (value instanceof List) { value = ((List<Object>) value).get(0); } if (!value.toString().startsWith(":") && !arg.constraint.matches(value.toString())) { allRequiredArgsAreHere = false; break; } } } // les parametres codes en dur dans la route matchent-ils ? for (String staticKey : route.staticArgs.keySet()) { if (staticKey.equals("format")) { if (!Http.Request.current().format.equals(route.staticArgs.get("format"))) { allRequiredArgsAreHere = false; break; } continue; // format is a special key } if (!args.containsKey(staticKey) || args.get(staticKey) == null || !args.get(staticKey).equals(route.staticArgs.get(staticKey))) { allRequiredArgsAreHere = false; break; } } if (allRequiredArgsAreHere) { StringBuilder queryString = new StringBuilder(); String path = route.path; if (path.endsWith("/?")) { path = path.substring(0, path.length() - 2); } for (Map.Entry<String, Object> entry : args.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (inPathArgs.contains(key) && value != null) { if (List.class.isAssignableFrom(value.getClass())) { List<Object> vals = (List<Object>) value; path = path.replaceAll("\\{(<[^>]+>)?" + key + "\\}", vals.get(0) + ""); } else { path = path.replaceAll("\\{(<[^>]+>)?" + key + "\\}", value + ""); } } else if (route.staticArgs.containsKey(key)) { // Do nothing -> The key is static } else if (value != null) { if (List.class.isAssignableFrom(value.getClass())) { List<Object> vals = (List<Object>) value; for (Object object : vals) { try { queryString.append(URLEncoder.encode(key, "utf-8")); queryString.append("="); if (object.toString().startsWith(":")) { queryString.append(object.toString() + ""); } else { queryString.append(URLEncoder.encode(object.toString() + "", "utf-8")); } queryString.append("&"); } catch (UnsupportedEncodingException ex) { } } } else { try { queryString.append(URLEncoder.encode(key, "utf-8")); queryString.append("="); if (value.toString().startsWith(":")) { queryString.append(value.toString() + ""); } else { queryString.append(URLEncoder.encode(value.toString() + "", "utf-8")); } queryString.append("&"); } catch (UnsupportedEncodingException ex) { } } } } String qs = queryString.toString(); if (qs.endsWith("&")) { qs = qs.substring(0, qs.length() - 1); } ActionDefinition actionDefinition = new ActionDefinition(); actionDefinition.url = qs.length() == 0 ? path : path + "?" + qs; actionDefinition.method = route.method == null || route.method.equals("*") ? "GET" : route.method.toUpperCase(); actionDefinition.star = "*".equals(route.method); actionDefinition.action = action; actionDefinition.args = args; return actionDefinition; } } } } throw new NoRouteFoundException(action, args); } public static class ActionDefinition { public String method; public String url; public boolean star; public String action; public Map<String, Object> args; public ActionDefinition add(String key, Object value) { args.put(key, value); return reverse(action, args); } public ActionDefinition remove(String key) { args.remove(key); return reverse(action, args); } @Override public String toString() { return url; } } public static class Route { public String method; public String path; public String action; Pattern actionPattern; List<String> actionArgs = new ArrayList<String>(); String staticDir; Pattern pattern; List<Arg> args = new ArrayList<Arg>(); Map<String, String> staticArgs = new HashMap<String, String>(); static Pattern customRegexPattern = new Pattern("\\{([a-zA-Z_0-9]+)\\}"); static Pattern argsPattern = new Pattern("\\{<([^>]+)>([a-zA-Z_0-9]+)\\}"); static Pattern paramPattern = new Pattern("([a-zA-Z_0-9]+):'(.*)'"); public void compute() { // staticDir if (action.startsWith("staticDir:")) { if (!method.equalsIgnoreCase("*") && !method.equalsIgnoreCase("GET")) { Logger.warn("Static route only support GET method"); return; } if (!this.path.endsWith("/") && !this.path.equals("/")) { Logger.warn("The path for a staticDir route must end with / (%s)", this); this.path += "/"; } this.pattern = new Pattern("^" + path + "({resource}.*)$"); this.staticDir = action.substring("staticDir:".length()); } else { // URL pattern String patternString = path; patternString = customRegexPattern.replacer("\\{<[^/]+>$1\\}").replace(patternString); Matcher matcher = argsPattern.matcher(patternString); while (matcher.find()) { Arg arg = new Arg(); arg.name = matcher.group(2); arg.constraint = new Pattern(matcher.group(1)); args.add(arg); } patternString = argsPattern.replacer("({$2}$1)").replace(patternString); this.pattern = new Pattern(patternString); // Action pattern patternString = action; patternString = patternString.replace(".", "[.]"); for (Arg arg : args) { if (patternString.contains("{" + arg.name + "}")) { patternString = patternString.replace("{" + arg.name + "}", "({" + arg.name + "}" + arg.constraint.toString() + ")"); actionArgs.add(arg.name); } } actionPattern = new Pattern(patternString, REFlags.IGNORE_CASE); } } public void addParams(String params) { if (params == null) { return; } params = params.substring(1, params.length() - 1); for (String param : params.split(",")) { Matcher matcher = paramPattern.matcher(param); if (matcher.matches()) { staticArgs.put(matcher.group(1), matcher.group(2)); } else { Logger.warn("Ignoring %s (static params must be specified as key:'value',...)", params); } } } public Map<String, String> matches(String method, String path) { if (method == null || this.method.equals("*") || method.equalsIgnoreCase(this.method)) { Matcher matcher = pattern.matcher(path); if (matcher.matches()) { // Static dir if (staticDir != null) { throw new RenderStatic(staticDir + "/" + matcher.group("resource")); } else { Map<String, String> localArgs = new HashMap<String, String>(); for (Arg arg : args) { localArgs.put(arg.name, matcher.group(arg.name)); } localArgs.putAll(staticArgs); return localArgs; } } } return null; } static class Arg { String name; Pattern constraint; String defaultValue; Boolean optional = false; } @Override public String toString() { return method + " " + path + " -> " + action; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
32f53ae439bf22829e42659036c938a75ba2553b
63ee2b1cc648e84631a41859e92d2f66ad875d7b
/JavaLessons/src/tetris/Field.java
19fc6357c659be7a057e13d823265bef5f9dadf8
[]
no_license
mrhide/JavaLessons
36e672d860f49a3a91451b623a158bf4e6bdc047
085747b28e6bde58f1afb425473429025bb004cb
refs/heads/master
2020-04-13T22:07:34.032743
2014-07-22T17:11:57
2014-07-22T17:11:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,359
java
package tetris; public class Field { public static final int HEIGHT = 20; public static final int WIDTH = 9; public int[][] box = new int[HEIGHT][WIDTH]; public boolean hasConflictAt(int row, int col, int[][] data) { for (int r = 0; r < data.length; r++) { for (int c = 0; c < data[r].length; c++) { if (data[r][c] == 0) { continue; } int newRow = row + r; int newCol = col + c; if(newRow < 0 || newCol < 0 || newRow >= Field.HEIGHT || newCol >= Field.WIDTH) { return true; } if (box[newRow][newCol] > 0) { return true; } } } return false; } public void paste(int row, int col, int[][] data) { for (int r = 0; r < data.length; r++) { for (int c = 0; c < data[r].length; c++) { if (data[r][c] == 0) { continue; } int newRow = row + r; int newCol = col + c; box[newRow][newCol] = data[r][c]; } } } public void removeFullRows() { int[][] b = new int[box.length][box[0].length]; int pointer = b.length - 1; for (int r = b.length - 1; r >= 0; r--) { if(isFull(box[r])) { continue; } b[pointer--] = box[r]; } box = b; } private boolean isFull(int[] row) { for (int i = 0; i < row.length; i++) { if(row[i] == 0) { return false; } } return true; } }
[ "flexdiez@yandex.ru" ]
flexdiez@yandex.ru
679c98ac3f35299e3552e32d50d20ae1840b82e4
1836c40d8c8e02d9e11a8cdee572e065899a34a1
/app/src/androidTest/java/mikecat/e29a5935_697d_4de8_9db3_c7d96149f5ac/asumikanaviewer/ExampleInstrumentedTest.java
c216497d3c75f6a710d848054838aea6cbd9a5a4
[]
no_license
mikecat/AsumikanaViewer
8704c1e84543562fa9eb3b0b4029c6c5d24dc561
9fc121bfc00bb3e6b3a6d066284f33f8e209fea1
refs/heads/master
2020-03-18T14:56:23.914207
2018-05-25T15:46:55
2018-05-25T15:46:55
134,876,376
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
package mikecat.e29a5935_697d_4de8_9db3_c7d96149f5ac.asumikanaviewer; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("mikecat.e29a5935_697d_4de8_9db3_c7d96149f5ac.asumikanaviewer", appContext.getPackageName()); } }
[ "mikecat@users.noreply.github.com" ]
mikecat@users.noreply.github.com
a9da22bf59dd2c5116ff25f8c1802352e21ca7e3
82164fec25eca032fb0da0689a66d3adb5654034
/src/java/DynamicTable.java
4f8ef23196808991a772eda32399e7fcd49dca9d
[]
no_license
mystica2000/HallAllocationSystem
c48073b0675c3c4f99bc2b1176635630a046577b
b5ecf31827917b25fd6becb34758efa53f9e45d2
refs/heads/master
2022-11-25T03:05:32.124892
2020-08-01T07:09:17
2020-08-01T07:12:19
284,204,161
1
0
null
null
null
null
UTF-8
Java
false
false
3,672
java
import java.io.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import javafx.application.Application; import javafx.beans.property.SimpleStringProperty; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.Scene; import javafx.scene.control.TableColumn; import javafx.scene.control.TableColumn.CellDataFeatures; import javafx.scene.control.TableView; import javafx.stage.Stage; import javafx.util.Callback; /** * * @author Narayan * @Editor SeifAllah */ public class DynamicTable extends Application{ //TABLE VIEW AND DATA private ObservableList<ObservableList> data; private TableView tableview; //MAIN EXECUTOR public static void main(String[] args) { launch(args); } //CONNECTION DATABASE public void buildData(){ Connection c ; data = FXCollections.observableArrayList(); try{ Class.forName("com.mysql.cj.jdbc.Driver"); Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/hall","root","root"); String sql="select * from allocated"; ResultSet rs = con.createStatement().executeQuery(sql); /********************************** * TABLE COLUMN ADDED DYNAMICALLY * **********************************/ for(int i=0 ; i<rs.getMetaData().getColumnCount(); i++){ //We are using non property style for making dynamic table final int j = i; TableColumn col = new TableColumn(rs.getMetaData().getColumnName(i+1)); col.setCellValueFactory(new Callback<CellDataFeatures<ObservableList,String>,ObservableValue<String>>(){ public ObservableValue<String> call(CellDataFeatures<ObservableList, String> param) { return new SimpleStringProperty(param.getValue().get(j).toString()); } }); tableview.getColumns().addAll(col); System.out.println("Column ["+i+"] "); } /******************************** * Data added to ObservableList * ********************************/ while(rs.next()){ //Iterate Row ObservableList<String> row = FXCollections.observableArrayList(); for(int i=1 ; i<=rs.getMetaData().getColumnCount(); i++){ //Iterate Column row.add(rs.getString(i)); } System.out.println("Row [1] added "+row ); data.add(row); } //FINALLY ADDED TO TableView tableview.setItems(data); }catch(Exception e){ e.printStackTrace(); System.out.println("Error on Building Data"); } } @Override public void start(Stage stage) throws Exception { //TableView tableview = new TableView(); buildData(); stage.setWidth(285); // stage.setMaxWidth(285); // stage.setMinWidth(285); stage.setTitle("Java Fx 2.0 DataBase Connection"); stage.setResizable(false); //Main Scene Scene scene = new Scene(tableview); stage.setScene(scene); stage.show(); } }
[ "mysticainf@gmail.com" ]
mysticainf@gmail.com
c023e5b0527c849005320e35bb61bf6bd06e8f3f
04fc9cc7933ad0b387f6deaa30de704fe834e618
/src/tpfo/NN_H90tanhH20tanh.java
8405155eacb7b4064adf492564b5527f825a095f
[]
no_license
csomorb/fouilleTexte
5c46536b20c937aed5b01434f13b8f4ebe47c045
faed5465d27aac012539a32e6be6407f29ab3162
refs/heads/master
2020-12-24T09:23:17.815723
2016-11-09T15:11:04
2016-11-09T15:11:04
73,294,466
0
0
null
null
null
null
UTF-8
Java
false
false
1,880
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 tpfo; import org.encog.engine.network.activation.ActivationFunction; import org.encog.engine.network.activation.ActivationLinear; import org.encog.engine.network.activation.ActivationRamp; import org.encog.engine.network.activation.ActivationSigmoid; import org.encog.engine.network.activation.ActivationSoftMax; import org.encog.engine.network.activation.ActivationTANH; import org.encog.neural.networks.BasicNetwork; import org.encog.neural.networks.layers.BasicLayer; /** * * @author Salah Ait-Mokhtar */ public class NN_H90tanhH20tanh extends NN { public NN_H90tanhH20tanh(int inputSize, int outputSize) { super(inputSize, outputSize); // Crรฉer le RN net = new BasicNetwork(); // Linear activation (ne modifie pas la somme pondรฉrรฉe) ActivationFunction linear = new ActivationLinear(); // Ramp activation ActivationFunction ramp = new ActivationRamp(1, 0, 1, 0); // Sigmoide ActivationFunction sigmoid = new ActivationSigmoid(); // Tanh ActivationFunction tanh = new ActivationTANH(); // softmax ActivationFunction softmax = new ActivationSoftMax(); // input layer net.addLayer(new BasicLayer(null, true, inputSize)); // hidden layer(s) net.addLayer(new BasicLayer(tanh, true, (int) (inputSize * 9))); net.addLayer(new BasicLayer(tanh, true, (int) inputSize*2)); // ouput layer net.addLayer(new BasicLayer(softmax, false, outputSize)); // finaliser la crรฉation du RN net.getStructure().finalizeStructure(); net.reset(seed); } }
[ "csomorbarnabas@yahoo.com" ]
csomorbarnabas@yahoo.com
33e63c8478743ce30b8e74a288ee46ba734f423e
d2948b4a94dbe77d2783964c428a078611187a6d
/src/main/java/main/LoginServlet.java
b0982a8f131e3d874872ae5b7a3e8c715a3f359c
[]
no_license
pasali/ferahti
1ad92197848ae07cbf086173f32dff0f96f79c39
96d0134d6f36e95fcc55f796ca6fcc4354a690fb
refs/heads/master
2021-01-19T10:04:54.420342
2013-06-09T14:26:29
2013-06-09T14:26:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,642
java
package main; import handler.UyelerHandler; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/login") public class LoginServlet extends HttpServlet { private static final long serialVersionUID = 1L; public LoginServlet() { super(); // TODO Auto-generated constructor stub } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { main.Uyeler uye = new Uyeler(request.getParameter("user"), request.getParameter("pass")); String data = "Kullanฤฑcฤฑ bulunamadฤฑ !"; handler.UyelerHandler controller = new UyelerHandler(); int ret = controller.UyeKayitlimi(uye.getAd(), uye.getSifre()); if (ret == 1) { request.getSession().setAttribute("kullanici", uye.getAd()); SimpleDateFormat sdf = new SimpleDateFormat("E yyyy.MM.dd '\n' hh:mm:ss a", new Locale("tr")); String date = sdf.format(new Date()); request.getSession().setAttribute("zaman", date.toString()); request.getRequestDispatcher("index.jsp").forward(request, response); }else { request.setAttribute("data", data); request.getRequestDispatcher("login.jsp").forward(request, response); } } }
[ "mhmtbsl@bil.omu.edu.tr" ]
mhmtbsl@bil.omu.edu.tr
759a5939b15d5aa9932fa14704b237cf26c61b6b
39ef3a7cc8c37214ea5167822365ec8daec0e702
/programcreek/creek_project/src/main/java/binarytree/validatebinarysearchtree/ValidateBinarySearchTree.java
586656765cbe089cadbf3111aa8087afd307d3a0
[]
no_license
neppramod/problems_practice
75449062037282d65896d296f0e1832482869832
764d2e4470d87c66cd1223387b49d3df610bb2a1
refs/heads/master
2022-08-18T19:54:16.370710
2022-08-16T02:54:45
2022-08-16T02:54:45
59,494,037
2
0
null
2021-01-03T18:07:56
2016-05-23T15:26:56
Java
UTF-8
Java
false
false
506
java
package binarytree.validatebinarysearchtree; import binarytree.TreeNode; public class ValidateBinarySearchTree { public boolean isValidBST(TreeNode root) { return isValidBST(root, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY); } boolean isValidBST(TreeNode root, double min, double max) { if (root == null) { return true; } if (root.val <= min || root.val >= max) { return false; } return isValidBST(root.left, min, root.val) && isValidBST(root.right, root.val, max); } }
[ "neppramod@gmail.com" ]
neppramod@gmail.com
c9ad22f954d5c2d2eb93d1e40f4dd7faa07a5c24
cad84a0b50222f584d65a05e7ef0f4111371bba0
/practiceJava/src/lintCode/Q160.java
f228bd8a61e8ee3b9a871d8a09bbc361b3143fd2
[]
no_license
pengshuai2010/practiceJava
cb14348811160789d1a59df69e5c7d7eb1319688
a1e03dc0290ab829e0458db52a406aaf74f54d15
refs/heads/master
2021-03-13T01:55:26.656627
2017-04-29T03:31:15
2017-04-29T03:31:15
38,922,341
2
0
null
null
null
null
UTF-8
Java
false
false
959
java
package lintCode; public class Q160 { public int findMin(int[] num) { /* * num[mid] > num[e] means that pivot is in the right part(not including mid) * num[mid] < num[e] means that right part is ordered, least number must be in * the left part(including mid because num[mid] might be the least number) * Since duplicates can exist, num[mid] == num[e] does not necessarily mean that * right part is ordered, e.g. [3, 4, 5, 1, 5] and mid is 2, e is 4. Nevertheless we can * safely remove e form the region since it is repeated by mid. * */ int s = 0; int e = num.length - 1; int mid = (s + e) / 2; while (s < e) { mid = (s + e) / 2; if (num[mid] > num[e]) s = mid + 1; else if (num[mid] < num[e]) e = mid; else e = e - 1; } return num[s]; } public static void main(String[] args) { int[] num = new int[] {1, 1, -1, 1}; int res = new Q160().findMin(num); System.out.println(res); } }
[ "pengshuai2010@gmail.com" ]
pengshuai2010@gmail.com
6e15974fd83ce7219f098e78fad5ccb9225634ca
857bcdf7afb822e8381422fee5dd9d69c2c73747
/3.String palindrome/src/pkg3/string/palindrome/StringPalindrome.java
84d3f1f64fd0eff08812156daa9aadc605c1a0bf
[]
no_license
vikas62081/Java-exercise
1ada64a1eadb24aee9492d8b8e7ff9ad1b4a8181
d9a1467995936e03e8dcda0446d2812d61428666
refs/heads/master
2022-07-19T11:20:33.470639
2020-05-14T15:29:59
2020-05-14T15:29:59
263,952,815
0
0
null
null
null
null
UTF-8
Java
false
false
573
java
package pkg3.string.palindrome; import java.util.*; public class StringPalindrome { public static void main(String[] args) { Scanner s=new Scanner(System.in); System.out.println("Enter a String : "); String s1=s.nextLine(); String s2=s1.toUpperCase(); StringBuilder ss=new StringBuilder(); ss.append(s2); ss=ss.reverse(); if(s2.compareTo(ss.toString())==0) { System.out.println("Palindrome"); } else { System.out.println("Not palindrome"); } } }
[ "45706086+vikas62081@users.noreply.github.com" ]
45706086+vikas62081@users.noreply.github.com
8202c387760825c41ace3804512f2f9b6e47cc36
c875e2221e102407f2aef4934944e04d00c90e77
/JavaGiaoDien/src/Tuan5.java
b4a3c2ef9723fa6ac78c24bfff7fc0923f12f9ce
[]
no_license
thanhphongits/Java
47e559acef4a11a81c721037b16bcf181dfecd51
a8a405e28969550124fdee2ef7804b17df143658
refs/heads/master
2023-04-04T08:02:48.679648
2021-04-08T00:36:57
2021-04-08T00:36:57
330,622,601
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
import java.awt.Dimension; import javax.swing.JFrame; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Thanh Phong */ public class Tuan5 extends JFrame{ @Override public void setSize(Dimension d) { super.setSize(d); //To change body of generated methods, choose Tools | Templates. } }
[ "thanhphongtran.it@gmail.com" ]
thanhphongtran.it@gmail.com
a1390c85395e16d27456754703737323e590fad7
99d1d757c23f816c920110fd52f19de8ac373cc7
/src/main/java/com/airbus/archivemanager/web/rest/vm/KeyAndPasswordVM.java
760a7e2969cb67a0de5c1cd43ee8b1a454e3c26c
[]
no_license
kkhenissi/mat-dateTime-version
1d807a90a9492ac565af8cedde657d6ffee4835d
0e96777c809e5d354bd44b1143926217dee233a5
refs/heads/master
2023-05-12T04:06:02.871809
2020-01-27T07:07:36
2020-01-27T07:07:36
236,437,173
0
0
null
2023-05-07T20:52:44
2020-01-27T07:10:33
Java
UTF-8
Java
false
false
506
java
package com.airbus.archivemanager.web.rest.vm; /** * View Model object for storing the user's key and password. */ public class KeyAndPasswordVM { private String key; private String newPassword; public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getNewPassword() { return newPassword; } public void setNewPassword(String newPassword) { this.newPassword = newPassword; } }
[ "kkhenissi@yahoo.fr" ]
kkhenissi@yahoo.fr
5183c599c0fc4592f90dabef0d25d7562890fc5b
11bbcb40f71833c2ddd3382e5ac2b15ae2f9e178
/src/engine/RenderLine.java
22d56a1bed63821efe0e0a753b6e8e5ec119875d
[]
no_license
BrandonDyer64/NNFPS
ca298f090bb3545353549b6ff42c389fb4eb3d59
fcde37191894361944752fd6c6c2141e0a54c6d8
refs/heads/master
2021-01-11T01:14:34.019553
2016-10-21T02:40:47
2016-10-21T02:40:47
70,735,200
0
0
null
null
null
null
UTF-8
Java
false
false
709
java
package engine; import java.awt.*; /** * Created by brandon on 9/21/2016. */ public class RenderLine { public float wX, wY, distance; public int x, y, width, height; public Color color; public Camera camera; public RenderLine(float wX, float wY, int x, int y, int width, int height, float distance, Color color, Camera camera) { this.wX = wX; this.wY = wY; this.distance = distance; this.x = x; this.y = y; this.width = width; this.height = height; this.color = color; this.camera = camera; } public void draw(Graphics g) { g.setColor(color); g.fillRect(x, y, width, -height); } }
[ "brandondyer64@gmail.com" ]
brandondyer64@gmail.com
cde8334992c791fce3304ecb1740b48363620ebf
903608d3719856245c5f666c9c2655e6cfd50d46
/src/main/java/com/brokers/invest/model/Usuario.java
dfb25c4e596874b43a9266fc0ab87f9dd9d05a91
[]
no_license
olsmartTech/brokers-invest-backend
777e6003a51c81873fd9a331e9d15f0c1e42a173
b2d40967b3650646699aec8e6021f8412a03ecb9
refs/heads/master
2023-06-18T06:51:06.384445
2021-07-15T04:14:27
2021-07-15T04:14:27
386,158,780
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package com.brokers.invest.model; import lombok.Getter; import lombok.Setter; @Getter @Setter public class Usuario { private String nuDni; private String usrId; private String typeUsr; private String nombres; private String estado; private String apePat; private String apeMat; private String pass; private String flagCtaAct; private long perfilId; private long cuentaId; }
[ "orlandlope@gmail.com" ]
orlandlope@gmail.com
6771648c2dcab1faafcd5f60b4dbf601a1cbd375
fba2092bf9c8df1fb6c053792c4932b6de017ceb
/wms/WEB-INF/src/jp/co/daifuku/wms/handler/util/HandlerSysDefines.java
988071b1bb39c30d98ad36e77532071070b1e1f2
[]
no_license
FlashChenZhi/exercise
419c55c40b2a353e098ce5695377158bd98975d3
51c5f76928e79a4b3e1f0d68fae66ba584681900
refs/heads/master
2020-04-04T03:23:44.912803
2018-11-01T12:36:21
2018-11-01T12:36:21
155,712,318
1
0
null
null
null
null
UTF-8
Java
false
false
3,984
java
// $Id: HandlerSysDefines.java 3153 2009-02-12 07:38:22Z tanaka $ package jp.co.daifuku.wms.handler.util; /* * Copyright(c) 2000-2003 DAIFUKU Co.,Ltd. All Rights Reserved. * * This software is the proprietary information of DAIFUKU Co.,Ltd. * Use is subject to license terms. */ import jp.co.daifuku.common.CommonParam; /** * Handlerใงๅ‚็…งใ•ใ‚Œใ‚‹ใ‚ทใ‚นใƒ†ใƒ ๅฎš็พฉใ‚’่จ˜่ฟฐใ—ใพใ™ใ€‚ * * @version $Revision: 3153 $, $Date: 2009-02-12 16:38:22 +0900 (ๆœจ, 12 2 2009) $ * @author ss * @author Last commit: $Author: tanaka $ */ public class HandlerSysDefines { //------------------------------------------------------------ // fields (upper case only) //------------------------------------------------------------ /** ใ‚ทใƒผใ‚ฑใƒณใ‚ทใƒฃใƒซใƒ•ใ‚กใ‚คใƒซใฎใƒ‡ใƒ•ใ‚ฉใƒซใƒˆไฝ็ฝฎ */ public static final String SEQFILE_DIR = CommonParam.getParam("SEQFILE_DIR"); /** ใƒใƒณใƒ‰ใƒฉๅฎš็พฉใƒ•ใ‚กใ‚คใƒซใฎใƒ‡ใƒ•ใ‚ฉใƒซใƒˆไฝ็ฝฎ */ public static final String DEFINE_DIR = CommonParam.getParam("HANDLER_DEFINE_DIR"); /** ใ‚ทใ‚นใƒ†ใƒ ใฎใƒฏใ‚คใƒซใƒ‰ใ‚ซใƒผใƒ‰ */ public static final String PATTERNMATCHING_CHAR = CommonParam.getParam("PATTERNMATCHING_CHAR"); /** ใƒญใƒƒใ‚ฏๅพ…ใกๆ™‚้–“ (ๅพ…ใกๆ™‚้–“ใชใ—) */ public static final int WAIT_SEC_NOWAIT = -1; /** ใƒญใƒƒใ‚ฏๅพ…ใกๆ™‚้–“ (็„กๆœŸ้™) */ public static final int WAIT_SEC_UNLIMITED = 0; /** ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆใฎใƒญใƒƒใ‚ฏๅพ…ใกๆ™‚้–“ (็ง’ๆ•ฐ) */ public static final int WAIT_SEC_DEFAULT = CommonParam.getIntParam("HANDLER_DB_LOCK_TIMEOUT"); /** ใƒชใ‚นใƒˆใƒœใƒƒใ‚ฏใ‚น็”จๆœ€ๅคงๅ–ๅพ—ไปถๆ•ฐ */ public static final int MAX_NUMBER_OF_DISP_LISTBOX = CommonParam.getIntParam("MAX_NUMBER_OF_DISP_LISTBOX"); //------------------------------------------------------------ // class variables (prefix '$') //------------------------------------------------------------ // private String $classVar ; //------------------------------------------------------------ // properties (prefix 'p_') //------------------------------------------------------------ // private String p_Name ; //------------------------------------------------------------ // instance variables (prefix '_') //------------------------------------------------------------ // private String _instanceVar ; //------------------------------------------------------------ // constructors //------------------------------------------------------------ //------------------------------------------------------------ // public methods // use {@inheritDoc} in the comment, If the method is overridden. //------------------------------------------------------------ //------------------------------------------------------------ // accessor methods // use {@inheritDoc} in the comment, If the method is overridden. //------------------------------------------------------------ //------------------------------------------------------------ // package methods // use {@inheritDoc} in the comment, If the method is overridden. //------------------------------------------------------------ //------------------------------------------------------------ // protected methods // use {@inheritDoc} in the comment, If the method is overridden. //------------------------------------------------------------ //------------------------------------------------------------ // private methods //------------------------------------------------------------ //------------------------------------------------------------ // utility methods //------------------------------------------------------------ /** * ใ“ใฎใ‚ฏใƒฉใ‚นใฎใƒชใƒ“ใ‚ธใƒงใƒณใ‚’่ฟ”ใ—ใพใ™ใ€‚ * @return ใƒชใƒ“ใ‚ธใƒงใƒณๆ–‡ๅญ—ๅˆ—ใ€‚ */ public static String getVersion() { return "$Id: HandlerSysDefines.java 3153 2009-02-12 07:38:22Z tanaka $"; } }
[ "zhangming@worgsoft.com" ]
zhangming@worgsoft.com
1a6da580dd9184f7b0f58e419b697d9deeca3625
2644c0c1881d5488a88af3040645b63e329aabf5
/src/main/java/ru/hokan/controllers/hadnlers/ShowMessageHistoryButtonEventHandler.java
51de5f859e02fb635019396abfbccb9dd68bc669
[]
no_license
Hokan-Ashir/ChitChat
5798dea087110fcf3de6a5f96c4e5f1e948a70e4
43ec7a6e7405cfb598f3b63adeeb24d7c858ac41
refs/heads/master
2021-01-01T05:10:09.524935
2016-05-21T17:49:45
2016-05-21T17:49:45
59,358,407
0
0
null
null
null
null
UTF-8
Java
false
false
1,716
java
package ru.hokan.controllers.hadnlers; import com.tassta.test.chat.MessageHistory; import javafx.event.EventHandler; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.input.MouseEvent; import javafx.stage.Stage; import ru.hokan.controllers.ContactController; import ru.hokan.controllers.MessageHistoryController; import ru.hokan.impl.MessageHistoryModelHolder; import ru.hokan.util.I18N; import ru.hokan.views.ViewsHolder; public class ShowMessageHistoryButtonEventHandler implements EventHandler<MouseEvent> { /** * {@inheritDoc} */ @Override public void handle(MouseEvent event) { showMessageHistoryView(); } private void showMessageHistoryView() { Parent root = ViewsHolder.INSTANCE.getView("messageHistory.fxml"); Stage stage = new Stage(); stage.setTitle(I18N.INSTANCE.getMessage("message.history.window.caption")); Scene scene = root.getScene(); if (scene != null) { stage.setScene(scene); } else { scene = new Scene(root, 450, 450); } stage.setScene(scene); stage.show(); ContactController contactController = ViewsHolder.INSTANCE.getController("contact.fxml"); MessageHistoryController controller = ViewsHolder.INSTANCE.getController("messageHistory.fxml"); MessageHistory messageHistory = MessageHistoryModelHolder.INSTANCE.getModel().getMessageHistory(contactController.getUser()); controller.updateHistoryWithModel(messageHistory); // TODO here you can hide current window and restore, after closing // current dialog, but it will only be nice, if you have per-one-dialog application } }
[ "achkasov.anton.92@gmail.com" ]
achkasov.anton.92@gmail.com
50fe5e320674eb19d082c2f55faab6c64031b483
de01945b0eb01cfcb73ba85883452ab2d309ea88
/reportCore/src/main/java/com/bithealth/reportCore/facade/model/AuditProgressParam.java
fc192b2849d3ff5ba07c0943543398d425a74c4a
[]
no_license
liustefan/secondProject
27df367b28205056fa7add2b63eeb7ceafc70fde
fa083e854737eb50315ad2097a61136fd0d4d458
refs/heads/master
2021-01-23T05:14:19.161634
2017-03-27T03:20:55
2017-03-27T03:20:55
86,282,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,460
java
package com.bithealth.reportCore.facade.model; /** * ็ฑปๅ็งฐ: AuditProgressParam * ๅŠŸ่ƒฝๆ่ฟฐ: ๅฎกๆ ธ่ฟ›ๅบฆ็›ธๅ…ณ่ฏทๆฑ‚ๅ‚ๆ•ฐ * ๆ—ฅๆœŸ: 2016ๅนด7ๆœˆ29ๆ—ฅ ไธ‹ๅˆ3:31:25 * * @author ่ฐข็พŽๅ›ข * @version */ public class AuditProgressParam { /** * ่ฟ›ๅบฆๆตๆฐดๅท */ private Long serialNumber; /** * ๆŠฅๅ‘Šๅ•ๅท */ private Integer reportNo; /** * ๅฎกๆ ธๆ–นๅผ */ private String auditMode; /** * ๅฎกๆ ธๅŒป็”Ÿ */ private Integer docid; /** * ๅฎกๆ ธๆ„่ง */ private String myAdvice; /** * ๅคšไธช ่ฟ›ๅบฆๆตๆฐดๅทserialNumber๏ผŒไธคไธชไน‹้—ดไปฅ้€—ๅท้š”ๅผ€ */ private String ids; public String getIds() { return ids; } public void setIds(String ids) { this.ids = ids; } public Long getSerialNumber() { return serialNumber; } public void setSerialNumber(Long serialNumber) { this.serialNumber = serialNumber; } public Integer getReportNo() { return reportNo; } public void setReportNo(Integer reportNo) { this.reportNo = reportNo; } public String getAuditMode() { return auditMode; } public void setAuditMode(String auditMode) { this.auditMode = auditMode; } public Integer getDocid() { return docid; } public void setDocid(Integer docid) { this.docid = docid; } public String getMyAdvice() { return myAdvice; } public void setMyAdvice(String myAdvice) { this.myAdvice = myAdvice; } }
[ "liustefan@163.com" ]
liustefan@163.com
85ba83260d1db3a8f3a9e4d4be444766235bf24e
2ecec92e45078bd39d162c0a1963eece33c36968
/app/src/main/java/com/mydemo/marketdemo/http/HttpConstant.java
277ceb42a41ce59b75558ba831ce6cf04e7967e3
[]
no_license
longchengithub/MarketDemo
09b890879bba073299a46e15e1f290bbfcea6354
c0339efb41719ff0b92200c3800e95dbf53d3f44
refs/heads/master
2021-01-13T02:58:12.701775
2016-12-22T17:10:25
2016-12-22T17:10:25
77,067,860
0
0
null
null
null
null
UTF-8
Java
false
false
444
java
package com.mydemo.marketdemo.http; /** * Created by chenlong on 2016/12/19. */ public class HttpConstant { /** * ๆœฌๅœฐlocalhost */ public static final String BASE_URL ="http://10.0.2.2:8080/market/"; /** * okHttp็š„็ผ“ๅญ˜ๅœฐๅ€ */ public static final String CACHE_DIR = "marketCache"; /** * okHttp็š„็ผ“ๅญ˜ๅคงๅฐ ้ป˜่ฎค10m */ public static final int CACHE_SIZE = 1024 * 1024 * 10; }
[ "mail_chenlong@163.com" ]
mail_chenlong@163.com
41b3fad031de3057d10f06592bbda255752e24f5
65df98cb2dcf2e45628209b97f6b49b9687589f3
/trunk/zippyzipjp/src/jp/zippyzip/impl/ZenHanHelper.java
d8f981b4c12daefc15c6995d00d0a730569df75c
[ "Apache-2.0" ]
permissive
BGCX261/zippyzipjp-svn-to-git
f4fd8d9c794489bd3eb8d2b2c7bb405c237f5215
182de8e927a42197d085aafb1c69eff59b1795c9
refs/heads/master
2020-07-03T10:03:54.396826
2015-08-25T15:38:50
2015-08-25T15:38:50
41,589,689
0
0
null
null
null
null
UTF-8
Java
false
false
10,837
java
/* * zippyzipjp * * Copyright 2008-2010 Michinobu Maeda. * * 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 jp.zippyzip.impl; import java.util.HashMap; /** * ๅ…จ่ง’ๅŠ่ง’ๅค‰ๆ›ใฎใŸใ‚ใฎใƒ˜ใƒซใƒ‘ใ€‚ * * @author Michinobu Maeda */ public class ZenHanHelper { /** ๅŠ่ง’ๆ•ฐๅญ—ใ‚’ๅ…จ่ง’ๆ•ฐๅญ—ใซๅค‰ๆ›ใ™ใ‚‹ใƒ†ใƒผใƒ–ใƒซ */ private static final HashMap<String, String> hanZenTable = new HashMap<String, String>(); static { hanZenTable.put("0", "๏ผ"); hanZenTable.put("1", "๏ผ‘"); hanZenTable.put("2", "๏ผ’"); hanZenTable.put("3", "๏ผ“"); hanZenTable.put("4", "๏ผ”"); hanZenTable.put("5", "๏ผ•"); hanZenTable.put("6", "๏ผ–"); hanZenTable.put("7", "๏ผ—"); hanZenTable.put("8", "๏ผ˜"); hanZenTable.put("9", "๏ผ™"); } /** ๅŠ่ง’ใ‚ซใƒŠใ‚’ใฒใ‚‰ใŒใชใซๅค‰ๆ›ใ™ใ‚‹ใƒ†ใƒผใƒ–ใƒซ */ private static final HashMap<String, String> kanaTable = new HashMap<String, String>(); static { kanaTable.put("๏ฝฑ", "ใ‚"); kanaTable.put("๏ฝฒ", "ใ„"); kanaTable.put("๏ฝณ", "ใ†"); kanaTable.put("๏ฝด", "ใˆ"); kanaTable.put("๏ฝต", "ใŠ"); kanaTable.put("๏ฝถ", "ใ‹"); kanaTable.put("๏ฝท", "ใ"); kanaTable.put("๏ฝธ", "ใ"); kanaTable.put("๏ฝน", "ใ‘"); kanaTable.put("๏ฝบ", "ใ“"); kanaTable.put("๏ฝป", "ใ•"); kanaTable.put("๏ฝผ", "ใ—"); kanaTable.put("๏ฝฝ", "ใ™"); kanaTable.put("๏ฝพ", "ใ›"); kanaTable.put("๏ฝฟ", "ใ"); kanaTable.put("๏พ€", "ใŸ"); kanaTable.put("๏พ", "ใก"); kanaTable.put("๏พ‚", "ใค"); kanaTable.put("๏พƒ", "ใฆ"); kanaTable.put("๏พ„", "ใจ"); kanaTable.put("๏พ…", "ใช"); kanaTable.put("๏พ†", "ใซ"); kanaTable.put("๏พ‡", "ใฌ"); kanaTable.put("๏พˆ", "ใญ"); kanaTable.put("๏พ‰", "ใฎ"); kanaTable.put("๏พŠ", "ใฏ"); kanaTable.put("๏พ‹", "ใฒ"); kanaTable.put("๏พŒ", "ใต"); kanaTable.put("๏พ", "ใธ"); kanaTable.put("๏พŽ", "ใป"); kanaTable.put("๏พ", "ใพ"); kanaTable.put("๏พ", "ใฟ"); kanaTable.put("๏พ‘", "ใ‚€"); kanaTable.put("๏พ’", "ใ‚"); kanaTable.put("๏พ“", "ใ‚‚"); kanaTable.put("๏พ”", "ใ‚„"); kanaTable.put("๏พ•", "ใ‚†"); kanaTable.put("๏พ–", "ใ‚ˆ"); kanaTable.put("๏พ—", "ใ‚‰"); kanaTable.put("๏พ˜", "ใ‚Š"); kanaTable.put("๏พ™", "ใ‚‹"); kanaTable.put("๏พš", "ใ‚Œ"); kanaTable.put("๏พ›", "ใ‚"); kanaTable.put("๏พœ", "ใ‚"); kanaTable.put("๏ฝฆ", "ใ‚’"); kanaTable.put("๏พ", "ใ‚“"); kanaTable.put("๏ฝง", "ใ"); kanaTable.put("๏ฝจ", "ใƒ"); kanaTable.put("๏ฝฉ", "ใ…"); kanaTable.put("๏ฝช", "ใ‡"); kanaTable.put("๏ฝซ", "ใ‰"); kanaTable.put("๏ฝฏ", "ใฃ"); kanaTable.put("๏ฝฌ", "ใ‚ƒ"); kanaTable.put("๏ฝญ", "ใ‚…"); kanaTable.put("๏ฝฎ", "ใ‚‡"); kanaTable.put("๏ฝถ๏พž", "ใŒ"); kanaTable.put("๏ฝท๏พž", "ใŽ"); kanaTable.put("๏ฝธ๏พž", "ใ"); kanaTable.put("๏ฝน๏พž", "ใ’"); kanaTable.put("๏ฝบ๏พž", "ใ”"); kanaTable.put("๏ฝป๏พž", "ใ–"); kanaTable.put("๏ฝผ๏พž", "ใ˜"); kanaTable.put("๏ฝฝ๏พž", "ใš"); kanaTable.put("๏ฝพ๏พž", "ใœ"); kanaTable.put("๏ฝฟ๏พž", "ใž"); kanaTable.put("๏พ€๏พž", "ใ "); kanaTable.put("๏พ๏พž", "ใข"); kanaTable.put("๏พ‚๏พž", "ใฅ"); kanaTable.put("๏พƒ๏พž", "ใง"); kanaTable.put("๏พ„๏พž", "ใฉ"); kanaTable.put("๏พŠ๏พž", "ใฐ"); kanaTable.put("๏พ‹๏พž", "ใณ"); kanaTable.put("๏พŒ๏พž", "ใถ"); kanaTable.put("๏พ๏พž", "ใน"); kanaTable.put("๏พŽ๏พž", "ใผ"); kanaTable.put("๏พŠ๏พŸ", "ใฑ"); kanaTable.put("๏พ‹๏พŸ", "ใด"); kanaTable.put("๏พŒ๏พŸ", "ใท"); kanaTable.put("๏พ๏พŸ", "ใบ"); kanaTable.put("๏พŽ๏พŸ", "ใฝ"); kanaTable.put("๏ฝฐ", "ใƒผ"); kanaTable.put("-", "ใƒผ"); } /** * ๅŠ่ง’ใฎ้ƒตไพฟ็•ชๅทใ‚’ๅ…จ่ง’ใซๅค‰ๆ›ใ™ใ‚‹ใ€‚ * * @param str ๅŠ่ง’ใฎ้ƒตไพฟ็•ชๅท * @return ๅ…จ่ง’ใฎ้ƒตไพฟ็•ชๅท */ public static String convertZipHankakuZenkaku(String str) { if (str.length() != 7) { return ""; } StringBuilder ret = new StringBuilder(""); ret.append(hanZenTable.get(str.substring(0, 1))); ret.append(hanZenTable.get(str.substring(1, 2))); ret.append(hanZenTable.get(str.substring(2, 3))); ret.append("\uFF0D"); ret.append(hanZenTable.get(str.substring(3, 4))); ret.append(hanZenTable.get(str.substring(4, 5))); ret.append(hanZenTable.get(str.substring(5, 6))); ret.append(hanZenTable.get(str.substring(6, 7))); return ret.toString(); } /** * ๅ…จ่ง’่‹ฑๆ•ฐๅญ—ใ‚’ๅŠ่ง’ใซๅค‰ๆ›ใ™ใ‚‹ใ€‚ * * @param str ๅ‡ฆ็†ๅฏพ่ฑก * @return ๅ‡ฆ็†็ตๆžœ */ public static String convertZH(String str) { if (str == null) { return str; } StringBuilder buff = new StringBuilder(str); for (int i = 0; i < buff.length(); ++i) { switch (buff.charAt(i)) { case '๏ผ': buff.setCharAt(i, '0'); break; case '๏ผ‘': buff.setCharAt(i, '1'); break; case '๏ผ’': buff.setCharAt(i, '2'); break; case '๏ผ“': buff.setCharAt(i, '3'); break; case '๏ผ”': buff.setCharAt(i, '4'); break; case '๏ผ•': buff.setCharAt(i, '5'); break; case '๏ผ–': buff.setCharAt(i, '6'); break; case '๏ผ—': buff.setCharAt(i, '7'); break; case '๏ผ˜': buff.setCharAt(i, '8'); break; case '๏ผ™': buff.setCharAt(i, '9'); break; case '๏ผ': buff.setCharAt(i, '-'); break; case '๏ผก': buff.setCharAt(i, 'A'); break; case '๏ผข': buff.setCharAt(i, 'B'); break; case '๏ผฃ': buff.setCharAt(i, 'C'); break; case '๏ผค': buff.setCharAt(i, 'D'); break; case '๏ผฅ': buff.setCharAt(i, 'E'); break; case '๏ผฆ': buff.setCharAt(i, 'F'); break; case '๏ผง': buff.setCharAt(i, 'G'); break; case '๏ผจ': buff.setCharAt(i, 'H'); break; case '๏ผฉ': buff.setCharAt(i, 'I'); break; case '๏ผช': buff.setCharAt(i, 'J'); break; case '๏ผซ': buff.setCharAt(i, 'K'); break; case '๏ผฌ': buff.setCharAt(i, 'L'); break; case '๏ผญ': buff.setCharAt(i, 'M'); break; case '๏ผฎ': buff.setCharAt(i, 'N'); break; case '๏ผฏ': buff.setCharAt(i, 'O'); break; case '๏ผฐ': buff.setCharAt(i, 'P'); break; case '๏ผฑ': buff.setCharAt(i, 'Q'); break; case '๏ผฒ': buff.setCharAt(i, 'R'); break; case '๏ผณ': buff.setCharAt(i, 'S'); break; case '๏ผด': buff.setCharAt(i, 'T'); break; case '๏ผต': buff.setCharAt(i, 'U'); break; case '๏ผถ': buff.setCharAt(i, 'V'); break; case '๏ผท': buff.setCharAt(i, 'W'); break; case '๏ผธ': buff.setCharAt(i, 'X'); break; case '๏ผน': buff.setCharAt(i, 'Y'); break; case '๏ผบ': buff.setCharAt(i, 'Z'); break; case '๏ฝ': buff.setCharAt(i, 'a'); break; case '๏ฝ‚': buff.setCharAt(i, 'b'); break; case '๏ฝƒ': buff.setCharAt(i, 'c'); break; case '๏ฝ„': buff.setCharAt(i, 'd'); break; case '๏ฝ…': buff.setCharAt(i, 'e'); break; case '๏ฝ†': buff.setCharAt(i, 'h'); break; case '๏ฝ‡': buff.setCharAt(i, 'g'); break; case '๏ฝˆ': buff.setCharAt(i, 'h'); break; case '๏ฝ‰': buff.setCharAt(i, 'i'); break; case '๏ฝŠ': buff.setCharAt(i, 'j'); break; case '๏ฝ‹': buff.setCharAt(i, 'k'); break; case '๏ฝŒ': buff.setCharAt(i, 'l'); break; case '๏ฝ': buff.setCharAt(i, 'm'); break; case '๏ฝŽ': buff.setCharAt(i, 'n'); break; case '๏ฝ': buff.setCharAt(i, 'o'); break; case '๏ฝ': buff.setCharAt(i, 'p'); break; case '๏ฝ‘': buff.setCharAt(i, 'q'); break; case '๏ฝ’': buff.setCharAt(i, 'r'); break; case '๏ฝ“': buff.setCharAt(i, 's'); break; case '๏ฝ”': buff.setCharAt(i, 't'); break; case '๏ฝ•': buff.setCharAt(i, 'u'); break; case '๏ฝ–': buff.setCharAt(i, 'v'); break; case '๏ฝ—': buff.setCharAt(i, 'w'); break; case '๏ฝ˜': buff.setCharAt(i, 'x'); break; case '๏ฝ™': buff.setCharAt(i, 'y'); break; case '๏ฝš': buff.setCharAt(i, 'z'); break; case '๏ผŽ': buff.setCharAt(i, '.'); break; case '๏ผŒ': buff.setCharAt(i, ','); break; case 'โ€˜': buff.setCharAt(i, '\''); break; case 'โ€™': buff.setCharAt(i, '\''); break; case 'โ€œ': buff.setCharAt(i, '"'); break; case 'โ€': buff.setCharAt(i, '"'); break; case 'ใ€€': buff.setCharAt(i, ' '); break; case '๏ผˆ': buff.setCharAt(i, '('); break; case '๏ผ‰': buff.setCharAt(i, ')'); break; } } return buff.toString(); } /** * ๅŠ่ง’ใ‚ซใƒŠใ‚’ใฒใ‚‰ใŒใชใซๅค‰ๆ›ใ™ใ‚‹ใ€‚ * * @param str ๅ‡ฆ็†ๅฏพ่ฑก * @return ๅ‡ฆ็†็ตๆžœ */ public static String convertKana(String str) { StringBuilder ret = new StringBuilder(str); for (int i = ret.length() - 1; 0 <= i; --i) { String key = ret.substring(i, i + 1).toString(); if (kanaTable.containsKey(key)) { ret.replace(i, i + 1, kanaTable.get(key)); continue; } if (0 == i) { break; } key = ret.substring(i - 1, i + 1).toString(); if (kanaTable.containsKey(key)) { ret.replace(i - 1, i + 1, kanaTable.get(key)); continue; } } return ret.toString(); } }
[ "you@example.com" ]
you@example.com
3695e74f4e901980b0c2b63c234e1eaa41c67fda
1f84291b31b6ef9ed808d606a43524e7e5cce0f6
/src/main/java/com/l2jserver/gameserver/datatables/SpawnTable.java
f3bc83ef63edb3173388a0bdb86a691558dcad8a
[]
no_license
cucky/l2j_server_custom
ad57dae381fd9e7fa59a0ce455d595806f8883d7
980d9505824f77c7eb4c85449e0e9dabce7fc138
refs/heads/master
2021-01-19T17:25:19.131683
2017-03-01T09:34:02
2017-03-01T09:34:02
82,452,550
0
0
null
null
null
null
UTF-8
Java
false
false
16,418
java
/* * Copyright (C) 2004-2015 L2J Server * * This file is part of L2J Server. * * L2J Server is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J Server is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.l2jserver.gameserver.datatables; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; import com.l2jserver.commons.database.pool.impl.ConnectionFactory; import com.l2jserver.gameserver.data.xml.impl.NpcData; import com.l2jserver.gameserver.instancemanager.DayNightSpawnManager; import com.l2jserver.gameserver.instancemanager.ZoneManager; import com.l2jserver.gameserver.model.L2Spawn; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jserver.util.data.xml.IXmlReader; /** * Spawn data retriever. * @author Zoey76 */ public final class SpawnTable implements IXmlReader { // SQL private static final String SELECT_SPAWNS = "SELECT count, npc_templateid, locx, locy, locz, heading, respawn_delay, respawn_random, loc_id, periodOfDay FROM spawnlist"; private static final String SELECT_CUSTOM_SPAWNS = "SELECT count, npc_templateid, locx, locy, locz, heading, respawn_delay, respawn_random, loc_id, periodOfDay FROM custom_spawnlist"; private static final Map<Integer, Set<L2Spawn>> _spawnTable = new ConcurrentHashMap<>(); private int _xmlSpawnCount = 0; /** * Wrapper to load all spawns. */ @Override public void load() { if (!Config.ALT_DEV_NO_SPAWNS) { fillSpawnTable(false); final int spawnCount = _spawnTable.size(); LOG.info("{}: Loaded " + spawnCount + " npc spawns.", getClass().getSimpleName()); if (Config.CUSTOM_SPAWNLIST_TABLE) { fillSpawnTable(true); LOG.info("{}: Loaded " + (_spawnTable.size() - spawnCount) + " custom npc spawns.", getClass().getSimpleName()); } // Load XML list parseDatapackDirectory("data/spawnlist", false); LOG.info("{}: Loaded " + _xmlSpawnCount + " npc spawns from XML.", getClass().getSimpleName()); } } /** * Verifies if the template exists and it's spawnable. * @param npcId the NPC ID * @return {@code true} if the NPC ID belongs to an spawnable template, {@code false} otherwise */ private boolean checkTemplate(int npcId) { L2NpcTemplate npcTemplate = NpcData.getInstance().getTemplate(npcId); if (npcTemplate == null) { LOG.warn("{}: Data missing in NPC table for ID: {}.", getClass().getSimpleName(), npcId); return false; } if (npcTemplate.isType("L2SiegeGuard") || npcTemplate.isType("L2RaidBoss") || (!Config.ALLOW_CLASS_MASTERS && npcTemplate.isType("L2ClassMaster"))) { // Don't spawn return false; } return true; } @Override public void parseDocument(Document doc) { NamedNodeMap attrs; for (Node list = doc.getFirstChild(); list != null; list = list.getNextSibling()) { if (list.getNodeName().equalsIgnoreCase("list")) { attrs = list.getAttributes(); // skip disabled spawnlists if (!Boolean.parseBoolean(attrs.getNamedItem("enabled").getNodeValue())) { continue; } for (Node param = list.getFirstChild(); param != null; param = param.getNextSibling()) { attrs = param.getAttributes(); if (param.getNodeName().equalsIgnoreCase("spawn")) { String territoryName = null; String spawnName = null; Map<String, Integer> map = null; // Check, if spawn name specified if (attrs.getNamedItem("name") != null) { spawnName = parseString(attrs, "name"); } // Check, if spawn territory specified and exists if ((attrs.getNamedItem("zone") != null) && (ZoneManager.getInstance().getSpawnTerritory(attrs.getNamedItem("zone").getNodeValue()) != null)) { territoryName = parseString(attrs, "zone"); } for (Node npctag = param.getFirstChild(); npctag != null; npctag = npctag.getNextSibling()) { attrs = npctag.getAttributes(); // Check if there are any AI parameters if (npctag.getNodeName().equalsIgnoreCase("AIData")) { attrs = npctag.getAttributes(); if (map == null) { map = new HashMap<>(); } for (Node c = npctag.getFirstChild(); c != null; c = c.getNextSibling()) { // Skip odd nodes if (c.getNodeName().equals("#text")) { continue; } int val; switch (c.getNodeName()) { case "disableRandomAnimation": case "disableRandomWalk": val = Boolean.parseBoolean(c.getTextContent()) ? 1 : 0; break; default: val = Integer.parseInt(c.getTextContent()); } map.put(c.getNodeName(), val); } } // Check for NPC spawns else if (npctag.getNodeName().equalsIgnoreCase("npc")) { // mandatory final int templateId = parseInteger(attrs, "id"); // coordinates are optional, if territory is specified; mandatory otherwise int x = 0; int y = 0; int z = 0; try { x = parseInteger(attrs, "x"); y = parseInteger(attrs, "y"); z = parseInteger(attrs, "z"); } catch (NullPointerException npe) { // x, y, z can be unspecified, if this spawn is territory based, do nothing } if ((x == 0) && (y == 0) && (territoryName == null)) // Both coordinates and zone are unspecified { LOG.warn("{}: Spawn could not be initialized, both coordinates and zone are unspecified for ID {}", getClass().getSimpleName(), templateId); continue; } StatsSet spawnInfo = new StatsSet(); spawnInfo.set("npcTemplateid", templateId); spawnInfo.set("x", x); spawnInfo.set("y", y); spawnInfo.set("z", z); spawnInfo.set("territoryName", territoryName); spawnInfo.set("spawnName", spawnName); // trying to read optional parameters if (attrs.getNamedItem("heading") != null) { spawnInfo.set("heading", parseInteger(attrs, "heading")); } if (attrs.getNamedItem("count") != null) { spawnInfo.set("count", parseInteger(attrs, "count")); } if (attrs.getNamedItem("respawnDelay") != null) { spawnInfo.set("respawnDelay", parseInteger(attrs, "respawnDelay")); } if (attrs.getNamedItem("respawnRandom") != null) { spawnInfo.set("respawnRandom", parseInteger(attrs, "respawnRandom")); } if (attrs.getNamedItem("periodOfDay") != null) { String period = attrs.getNamedItem("periodOfDay").getNodeValue(); if (period.equalsIgnoreCase("day") || period.equalsIgnoreCase("night")) { spawnInfo.set("periodOfDay", period.equalsIgnoreCase("day") ? 1 : 2); } } _xmlSpawnCount += addSpawn(spawnInfo, map); } } } } } } } /** * Retrieves spawn data from database. * @param isCustom if {@code true} the spawns are loaded as custom from custom spawn table * @return the spawn count */ private int fillSpawnTable(boolean isCustom) { int npcSpawnCount = 0; try (Connection con = ConnectionFactory.getInstance().getConnection(); Statement s = con.createStatement(); ResultSet rs = s.executeQuery(isCustom ? SELECT_CUSTOM_SPAWNS : SELECT_SPAWNS)) { while (rs.next()) { StatsSet spawnInfo = new StatsSet(); int npcId = rs.getInt("npc_templateid"); // Check basic requirements first if (!checkTemplate(npcId)) { // Don't spawn continue; } spawnInfo.set("npcTemplateid", npcId); spawnInfo.set("count", rs.getInt("count")); spawnInfo.set("x", rs.getInt("locx")); spawnInfo.set("y", rs.getInt("locy")); spawnInfo.set("z", rs.getInt("locz")); spawnInfo.set("heading", rs.getInt("heading")); spawnInfo.set("respawnDelay", rs.getInt("respawn_delay")); spawnInfo.set("respawnRandom", rs.getInt("respawn_random")); spawnInfo.set("locId", rs.getInt("loc_id")); spawnInfo.set("periodOfDay", rs.getInt("periodOfDay")); spawnInfo.set("isCustomSpawn", isCustom); npcSpawnCount += addSpawn(spawnInfo); } } catch (Exception e) { LOG.warn("{}: Spawn could not be initialized!", getClass().getSimpleName(), e); } return npcSpawnCount; } /** * Creates NPC spawn * @param spawnInfo StatsSet of spawn parameters * @param AIData Map of specific AI parameters for this spawn * @return count NPC instances, spawned by this spawn */ private int addSpawn(StatsSet spawnInfo, Map<String, Integer> AIData) { L2Spawn spawnDat; int ret = 0; try { spawnDat = new L2Spawn(spawnInfo.getInt("npcTemplateid")); spawnDat.setAmount(spawnInfo.getInt("count", 1)); spawnDat.setX(spawnInfo.getInt("x", 0)); spawnDat.setY(spawnInfo.getInt("y", 0)); spawnDat.setZ(spawnInfo.getInt("z", 0)); spawnDat.setHeading(spawnInfo.getInt("heading", -1)); spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0)); spawnDat.setLocationId(spawnInfo.getInt("locId", 0)); String territoryName = spawnInfo.getString("territoryName", ""); String spawnName = spawnInfo.getString("spawnName", ""); spawnDat.setCustom(spawnInfo.getBoolean("isCustomSpawn", false)); if (!spawnName.isEmpty()) { spawnDat.setName(spawnName); } if (!territoryName.isEmpty()) { spawnDat.setSpawnTerritory(ZoneManager.getInstance().getSpawnTerritory(territoryName)); } // Register AI Data for this spawn NpcPersonalAIData.getInstance().storeData(spawnDat, AIData); switch (spawnInfo.getInt("periodOfDay", 0)) { case 0: // default ret += spawnDat.init(); break; case 1: // Day DayNightSpawnManager.getInstance().addDayCreature(spawnDat); ret = 1; break; case 2: // Night DayNightSpawnManager.getInstance().addNightCreature(spawnDat); ret = 1; break; } addSpawn(spawnDat); } catch (Exception e) { LOG.warn("{}: Spawn could not be initialized!", getClass().getSimpleName(), e); } return ret; } /** * Wrapper for {@link #addSpawn(StatsSet, Map)}. * @param spawnInfo StatsSet of spawn parameters * @return count NPC instances, spawned by this spawn */ private int addSpawn(StatsSet spawnInfo) { return addSpawn(spawnInfo, null); } /** * Gets the spawn data. * @return the spawn data */ public Map<Integer, Set<L2Spawn>> getSpawnTable() { return _spawnTable; } /** * Gets the spawns for the NPC Id. * @param npcId the NPC Id * @return the spawn set for the given npcId */ public Set<L2Spawn> getSpawns(int npcId) { return _spawnTable.getOrDefault(npcId, Collections.emptySet()); } /** * Gets the spawn count for the given NPC ID. * @param npcId the NPC Id * @return the spawn count */ public int getSpawnCount(int npcId) { return getSpawns(npcId).size(); } /** * Finds a spawn for the given NPC ID. * @param npcId the NPC Id * @return a spawn for the given NPC ID or {@code null} */ public L2Spawn findAny(int npcId) { return getSpawns(npcId).stream().findFirst().orElse(null); } /** * Adds a new spawn to the spawn table. * @param spawn the spawn to add * @param storeInDb if {@code true} it'll be saved in the database */ public void addNewSpawn(L2Spawn spawn, boolean storeInDb) { addSpawn(spawn); if (storeInDb) { final String spawnTable = spawn.isCustom() && Config.CUSTOM_SPAWNLIST_TABLE ? "custom_spawnlist" : "spawnlist"; try (Connection con = ConnectionFactory.getInstance().getConnection(); PreparedStatement insert = con.prepareStatement("INSERT INTO " + spawnTable + "(count,npc_templateid,locx,locy,locz,heading,respawn_delay,respawn_random,loc_id) values(?,?,?,?,?,?,?,?,?)")) { insert.setInt(1, spawn.getAmount()); insert.setInt(2, spawn.getId()); insert.setInt(3, spawn.getX()); insert.setInt(4, spawn.getY()); insert.setInt(5, spawn.getZ()); insert.setInt(6, spawn.getHeading()); insert.setInt(7, spawn.getRespawnDelay() / 1000); insert.setInt(8, spawn.getRespawnMaxDelay() - spawn.getRespawnMinDelay()); insert.setInt(9, spawn.getLocationId()); insert.execute(); } catch (Exception e) { LOG.warn("{}: Could not store spawn in the DB!", getClass().getSimpleName(), e); } } } /** * Delete an spawn from the spawn table. * @param spawn the spawn to delete * @param updateDb if {@code true} database will be updated */ public void deleteSpawn(L2Spawn spawn, boolean updateDb) { if (!removeSpawn(spawn)) { return; } if (updateDb) { try (Connection con = ConnectionFactory.getInstance().getConnection(); PreparedStatement delete = con.prepareStatement("DELETE FROM " + (spawn.isCustom() ? "custom_spawnlist" : "spawnlist") + " WHERE locx=? AND locy=? AND locz=? AND npc_templateid=? AND heading=?")) { delete.setInt(1, spawn.getX()); delete.setInt(2, spawn.getY()); delete.setInt(3, spawn.getZ()); delete.setInt(4, spawn.getId()); delete.setInt(5, spawn.getHeading()); delete.execute(); } catch (Exception e) { LOG.warn("{}: Spawn {} could not be removed from DB!", getClass().getSimpleName(), spawn, e); } } } /** * Add a spawn to the spawn set if present, otherwise add a spawn set and add the spawn to the newly created spawn set. * @param spawn the NPC spawn to add */ private void addSpawn(L2Spawn spawn) { _spawnTable.computeIfAbsent(spawn.getId(), k -> ConcurrentHashMap.newKeySet(1)).add(spawn); } /** * Remove a spawn from the spawn set, if the spawn set is empty, remove it as well. * @param spawn the NPC spawn to remove * @return {@code true} if the spawn was successfully removed, {@code false} otherwise */ private boolean removeSpawn(L2Spawn spawn) { final Set<L2Spawn> set = _spawnTable.get(spawn.getId()); if (set != null) { boolean removed = set.remove(spawn); if (set.isEmpty()) { _spawnTable.remove(spawn.getId()); } return removed; } return false; } /** * Execute a procedure over all spawns.<br> * <font size="4" color="red">Do not use it!</font> * @param function the function to execute * @return {@code true} if all procedures were executed, {@code false} otherwise */ public boolean forEachSpawn(Function<L2Spawn, Boolean> function) { for (Set<L2Spawn> set : _spawnTable.values()) { for (L2Spawn spawn : set) { if (!function.apply(spawn)) { return false; } } } return true; } public static SpawnTable getInstance() { return SingletonHolder._instance; } private static class SingletonHolder { protected static final SpawnTable _instance = new SpawnTable(); } }
[ "Michal@Michal" ]
Michal@Michal
e8360ce4c3882476eed14a608f7b8d9964246257
70185e521100e8bf85cfe6c1a7be20a93bfb03a5
/src/main/java/DTO/GotListDTO.java
0a495cdb55a71f1ac9253bd0a6685a8aa8f1be81
[]
no_license
josefmarcc/TestSem3projekt
ea89a90cb0089bd35f51112ed2913f53cc3faa05
6affb690464127f8e7c9f7d7ac0f265341df0da6
refs/heads/main
2023-02-13T06:39:44.764969
2021-01-15T20:32:05
2021-01-15T20:32:05
330,015,500
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
package DTO; import java.util.List; /** * * @author josef */ public class GotListDTO { private List<GotDTO> results; public List<GotDTO> getGotListDTO() { return results; } public GotListDTO(List<GotDTO> results) { this.results = results; } public void setGotListDTO(List<GotDTO> results) { this.results = results; } }
[ "56867995+josefmarcc@users.noreply.github.com" ]
56867995+josefmarcc@users.noreply.github.com
1cc447a7d11ad0714261daec3a031492b11c21b2
0591d1a0504f3a111d5283ae689c42299cd36324
/xysimageop1/src/main/java/mr/lmd/personal/xysimageop1/MainActivity.java
897a42fb117b01e1751c54fdab69964f8905d6a7
[]
no_license
MondayIsSun/AndroidHandleImg
48b76a284cba173ee51d3d678682250a703c0317
e58986edb9b2c3dd6f081e41a67a7c414ba457e5
refs/heads/master
2021-01-10T16:26:10.985434
2015-12-10T02:35:44
2015-12-10T02:35:44
45,101,474
0
0
null
null
null
null
UTF-8
Java
false
false
706
java
package mr.lmd.personal.xysimageop1; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void btnPixelsEffect(View view) { startActivity(new Intent(this, PixelsEffect.class)); } public void btnColorMatrix(View view) { startActivity(new Intent(this, ColorMatrix.class)); } public void btnPrimaryColor(View view) { startActivity(new Intent(this, PrimaryColor.class)); } }
[ "mr.lmd@outlook.com" ]
mr.lmd@outlook.com
db1d7fa0d7384fa576dce8970a2345c0ec950992
0b0d1cfd46f1a9bec0faec617895f3126fea9f8c
/src/test/java/org/n3r/eql/springtran/EqlTransactionTest.java
825a43506cf6a68551c7b1cae5075b281c9175eb
[]
no_license
AL-WUHC2/eql
636db06610f07978b74baad5ef6196390accb684
03b1a9ba444254279e4653ce0d82f4ef6959a3d0
refs/heads/master
2020-12-27T01:45:11.639976
2015-10-14T06:46:14
2015-10-14T06:46:14
44,228,655
0
1
null
2015-10-14T06:33:12
2015-10-14T06:33:11
null
UTF-8
Java
false
false
1,130
java
package org.n3r.eql.springtran; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = EqlTransactionTestConfig.class) public class EqlTransactionTest { @Autowired private EqlTranService eqlTranService; @Before public void before() { eqlTranService.prepareData(); } @Test public void addWithTranError() { try { eqlTranService.addWithTranError(); fail(); } catch (ArithmeticException e) { } assertThat(eqlTranService.queryDataCount(), is(0)); } @Test public void addWithTranSuccess() { eqlTranService.addWithTranSuccess(); assertThat(eqlTranService.queryDataCount(), is(2)); } }
[ "bingoo.huang@gmail.com" ]
bingoo.huang@gmail.com
1c9c8bde1854f0d285420de710db5a9dcdefe997
ed701b91a7235baa1e9d85acb292835c65992915
/jpiere.base.plugin/src/jpiere/base/plugin/org/adempiere/callout/JPiereAccessControlOrgCallout.java
5429db3841b1d934b3a2b1e55fed3aacacd2d43d
[]
no_license
JPiere/JPBP
4ef843f88791b119cccbb285cdc27910fc610bae
ad9e2e3ac64723d690e655920cc5223e57ca840c
refs/heads/master
2023-08-09T04:03:47.431289
2023-08-01T10:52:18
2023-08-01T10:52:18
229,442,795
2
9
null
null
null
null
UTF-8
Java
false
false
2,295
java
/****************************************************************************** * Product: JPiere * * Copyright (C) Hideaki Hagiwara (h.hagiwara@oss-erp.co.jp) * * * * This program is free software, you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * * that it will be useful, but WITHOUT ANY WARRANTY. * * See the GNU General Public License for more details. * * * * JPiere is maintained by OSS ERP Solutions Co., Ltd. * * (http://www.oss-erp.co.jp) * *****************************************************************************/ package jpiere.base.plugin.org.adempiere.callout; import java.util.Properties; import org.adempiere.base.IColumnCallout; import org.compiere.model.GridField; import org.compiere.model.GridTab; /** * * Set Default Value to AD_Org_ID for Access Control * * JPIERE-0546: Access Update of User Organization. * JPIERE-0547: Access Update of Role Organization. * JPIERE-0548: Access Update of User Role. * JPIERE-0549: Add Access Controle tab to Org Window. * * set Default Value at AD_Org_ID * * @author Hideaki Hagiwara * */ public class JPiereAccessControlOrgCallout implements IColumnCallout { @Override public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) { int AD_Org_ID = 0; if(value != null) AD_Org_ID = ((Integer)value).intValue(); int old_AD_Org_ID = 0; if(oldValue != null) old_AD_Org_ID = ((Integer)oldValue).intValue(); if(AD_Org_ID == 0 && old_AD_Org_ID == 0 && mTab.getParentTab() != null && mTab.isNew()) { Object obj_AD_Org_ID = mTab.getParentTab().getValue("AD_Org_ID"); if(obj_AD_Org_ID != null) AD_Org_ID = ((Integer)obj_AD_Org_ID).intValue(); mTab.setValue("AD_Org_ID", AD_Org_ID); } return null; } }
[ "h.hagiwara@compiere-distribution-lab.net" ]
h.hagiwara@compiere-distribution-lab.net
2c33cb68b984687cf9db41fc4682f5260e7f81c3
3f0015de89c8b0cd48ae203f35f395b2316dee28
/src/com/apiclient/pojo/DjUserAkp.java
6fa10b709c163a38795b63dde21bc92eeeeee752
[]
no_license
looooogan/icomp-4gb-pda
f8bf25c2ff20594ef802993ec708b66a8068d3dc
87f773b746485883f4839d646700a21d05c54d4f
refs/heads/master
2020-03-21T03:12:04.271544
2018-06-20T14:21:13
2018-06-20T14:21:13
133,898,130
0
0
null
null
null
null
UTF-8
Java
false
false
1,635
java
package com.apiclient.pojo; import java.io.Serializable; /** * Created by jiangchenkeji * Automated Build * ๅฎžไฝ“ DjUserAkp */ public class DjUserAkp implements Serializable { // ๅบๅˆ—ๅŒ–ๆŽฅๅฃๅฑžๆ€ง private static final long serialVersionUID = 1L; /** โ€จ* @fieldName userId * @fieldType Integer * @Description ็”จๆˆทID โ€จ*/ private Integer userId; /** โ€จ* @fieldName userName * @fieldType String * @Description ็”จๆˆทๅ โ€จ*/ private String userName; /** โ€จ* @fieldName password * @fieldType String * @Description ๅฏ†็  โ€จ*/ private String password; /** โ€จ* @fieldName name * @fieldType String * @Description ๅง“ๅ โ€จ*/ private String name; /** โ€จ* @fieldName title * @fieldType String * @Description ๆ€งๅˆซ โ€จ*/ private String title; /* ็”จๆˆทID */ public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } 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 String getName() { return name; } public void setName(String name) { this.name = name; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } }
[ "logan.box2016@gmail.com" ]
logan.box2016@gmail.com
c42eda957f45adb67ed7aaec1ea4f79ff239e7ef
a687bf9cd767ce096bf0751718e2d0d09e12c2e7
/examples/integrationTest/src/main/java/org/androidtransfuse/integrationTest/inject/ParcelTwoConverter.java
754a6aa7e964494cae943e69fb9ed412c9654a72
[ "Apache-2.0" ]
permissive
mingfai/transfuse
5a1167b3209f31e0a79e30a9a1139fb210cc67bf
1b5bae4acfb0081f6aefb4ae46fd92cb0d449b58
refs/heads/master
2020-04-06T06:47:06.617284
2013-06-23T23:02:59
2013-06-23T23:02:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,177
java
/** * Copyright 2013 John Ericksen * * 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.androidtransfuse.integrationTest.inject; import org.androidtransfuse.annotations.ParcelConverter; /** * @author John Ericksen */ public class ParcelTwoConverter implements ParcelConverter<ParcelTwo> { @Override public void toParcel(ParcelTwo input, android.os.Parcel destinationParcel) { destinationParcel.writeString(input.getValue()); } @Override public ParcelTwo fromParcel(android.os.Parcel parcel) { ParcelTwo parcelTwo = new ParcelTwo(); parcelTwo.setValue(parcel.readString()); return parcelTwo; } }
[ "johncarl81@gmail.com" ]
johncarl81@gmail.com
617466ad5c45ac5f24fa23c26d94ee2c25b1244f
bcf5d46fc4dba2913b672c3c30beb87fa92e52db
/OneDrive/Documents/NetBeansProjects/WebApplication2/src/java/mypack/admindatabase.java
dafc11b5b7e3ecf5038891d536c51093998e5fd9
[]
no_license
mansi332009/Online-Examination-Management-System
5c642cd18decb8882de3d71d04f88746888692ba
e65d98656d687993c168a411938571760eee3664
refs/heads/master
2023-06-26T18:52:28.793845
2021-07-08T18:54:15
2021-07-08T18:54:15
384,208,864
0
0
null
null
null
null
UTF-8
Java
false
false
1,236
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 mypack; /** * * @author Mansi */ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; public class admindatabase { Connection con ; public admindatabase(Connection con) { this.con = con; } public admin loginA(String auname, String apass){ admin am=null; try{ String query ="select * from admin where auname=? and apass=?"; PreparedStatement pst = this.con.prepareStatement(query); pst.setString(1, auname); pst.setString(2, apass); ResultSet rs = pst.executeQuery(); if(rs.next()){ am =new admin(); am.setUname(rs.getString("auname")); am.setAname(rs.getString("aname")); am.setPassword(rs.getString("apass")); } }catch(Exception e){ e.printStackTrace(); } return am; } }
[ "mansi171299saxena@gmail.com" ]
mansi171299saxena@gmail.com
02a33cc30843a182e5becdd2d0481410fedca579
731a0d20c0e417c646b055b231040ae9aec21af0
/src/test/java/me/haosdent/cgroup/subsystem/CpusetTest.java
022cf2d7e2bed3846e2235636444ee6bd0cf56c2
[ "Apache-2.0" ]
permissive
liuxinglanyue/jcgroup
4b2411b5eac31cb661d2e89299b5f132383152a8
e07e1ebf716fe7826d692318cba540b503a374fb
refs/heads/master
2021-01-12T21:44:22.589881
2016-01-11T09:51:31
2016-01-11T09:51:31
49,398,164
0
2
null
2016-01-11T02:54:13
2016-01-11T02:54:13
null
UTF-8
Java
false
false
5,060
java
package me.haosdent.cgroup.subsystem; import me.haosdent.cgroup.manage.Admin; import me.haosdent.cgroup.manage.Group; import me.haosdent.cgroup.util.Constants; import org.junit.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.LinkedList; import static org.junit.Assert.*; public class CpusetTest { private static final Logger LOG = LoggerFactory.getLogger(CpusetTest.class); private static Admin admin; private static Group root; private static Group one; private static Group two; @BeforeClass public static void setUpClass() { try { admin = new Admin(Constants.SUBSYS_CPUSET); root = admin.getRootGroup(); one = admin.createGroup("one", Constants.SUBSYS_CPUSET); two = admin.createGroup("two", Constants.SUBSYS_CPUSET); } catch (IOException e) { LOG.error("Create cgroup Failed.", e); assertTrue(false); } } @AfterClass public static void tearDownClass() { try { admin.umount(); } catch (IOException e) { LOG.error("Umount cgroup failed.", e); assertTrue(false); } } @Before public void setUp() {} @After public void tearDown() {} @Test public void testSetCpus() { try { int[] actual = {0,1}; one.getCpuset().setCpus(actual); int[] excepted = one.getCpuset().getCpus(); assertArrayEquals(actual, excepted); } catch (IOException e) { LOG.error("Set cpus failed.", e); assertTrue(false); } } @Test public void testSetMems() { try { int[] actual = {0}; one.getCpuset().setMems(actual); int[] excepted = one.getCpuset().getMems(); assertArrayEquals(actual, excepted); } catch (IOException e) { LOG.error("Set mems failed.", e); assertTrue(false); } } @Test public void testSetMemMigrate() { try { one.getCpuset().setMemMigrate(true); boolean flag = one.getCpuset().isMemMigrate(); assertTrue(flag); } catch (IOException e) { LOG.error("Set memory_migrate failed.", e); assertTrue(false); } } @Test public void testSetCpuExclusive() { try { one.getCpuset().setCpuExclusive(true); boolean flag = one.getCpuset().isCpuExclusive(); assertTrue(flag); } catch (IOException e) { LOG.error("Set cpu_exclusive failed.", e); assertTrue(false); } } @Test public void testSetMemExclusive() { try { one.getCpuset().setMemExclusive(true); boolean flag = one.getCpuset().isMemExclusive(); assertTrue(flag); } catch (IOException e) { LOG.error("Set mem_exclusive failed.", e); assertTrue(false); } } @Test public void testSetMemHardwall() { try { one.getCpuset().setMemHardwall(true); boolean flag = one.getCpuset().isMemHardwall(); assertTrue(flag); } catch (IOException e) { LOG.error("Set mem_hardwall failed.", e); assertTrue(false); } } @Test public void testGetMemPressure() { try { int pressure = one.getCpuset().getMemPressure(); assertTrue(pressure >= 0); } catch (IOException e) { LOG.error("Get memory_pressure failed.", e); assertTrue(false); } } @Test public void testSetMemPressureEnabled() { try { root.getCpuset().setMemPressureEnabled(true); boolean flag = root.getCpuset().isMemPressureEnabled(); LOG.error(flag + ""); assertTrue(flag); } catch (IOException e) { LOG.error("Set memory_pressure_enabled failed.", e); assertTrue(false); } } @Test public void testSetMemSpreadPage() { try { one.getCpuset().setMemSpreadPage(true); boolean flag = one.getCpuset().isMemSpreadPage(); assertTrue(flag); } catch (IOException e) { LOG.error("Set memory_spread_page failed.", e); assertTrue(false); } } @Test public void testSetMemSpreadSlab() { try { one.getCpuset().setMemSpreadSlab(true); boolean flag = one.getCpuset().isMemSpreadSlab(); assertTrue(flag); } catch (IOException e) { LOG.error("Set memory_spread_page failed.", e); assertTrue(false); } } @Test public void testSetSchedLoadBlance() { try { one.getCpuset().setSchedLoadBlance(true); boolean flag = one.getCpuset().isSchedLoadBlance(); assertTrue(flag); } catch (IOException e) { LOG.error("Set sched_load_balance failed.", e); assertTrue(false); } } @Test public void testSetSchedRelaxDomainLevel() { try { one.getCpuset().setSchedRelaxDomainLevel(0); int level = one.getCpuset().getSchedRelaxDomainLevel(); assertEquals(level, 0); } catch (IOException e) { LOG.error("Set sched_relax_domain_level failed.", e); assertTrue(false); } } @Test public void testParseNums() { String output = "0-1,3"; int[] actual = Cpuset.parseNums(output); int[] excepted = {0, 1, 3}; assertArrayEquals(actual, excepted); } }
[ "haosdent@gmail.com" ]
haosdent@gmail.com
183f3df4ca4dcc69ae4b753194515857c3b28ee4
c7a2139d906e9d8aeda1cb50a8c497f42271752b
/ec/src/main/java/njuse/ec/model/package-info.java
6af8c4cb3bddef858174dc07a6471cda89c98763
[ "Apache-2.0" ]
permissive
usernamegemaoa/EC
96995cd5aa53690c5439623249d7f8fa499ba12e
e9f0fcc859aad21d92d23930e33df039705ad81d
refs/heads/master
2021-01-19T22:40:25.132359
2016-05-06T13:16:48
2016-05-06T13:17:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
71
java
/** * model. * * @author ไธž * @version 1.1 */ package njuse.ec.model;
[ "lc504906985@gmail.com" ]
lc504906985@gmail.com
1dd2fbeb8c70d0366ac5f9b65b73c848d6fac468
dce4ff9edbef476d218c79cec4acd8861b09642c
/xenon-android-library/src/main/java/com/abubusoft/xenon/camera/Camera.java
fe0e2eda4aa324c0be292e9fff5cec0473eafd68
[]
no_license
skykying/xenon
d3e1cdc79932892d2a396926f9d21962ddef0568
619cc533e602307a62ceaf739daea76f88c37994
refs/heads/master
2021-09-16T04:22:45.416370
2018-06-16T09:01:28
2018-06-16T09:01:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,635
java
package com.abubusoft.xenon.camera; import com.abubusoft.xenon.math.XenonMath; import com.abubusoft.xenon.math.Point3; import android.opengl.Matrix; /** * Rappresenta la camera da cui si vede il mondo. * * @author Francesco Benincasa * */ public class Camera { /** * informazioni sulla camere */ public final CameraInfo info; public final Point3 lookAt; public final Point3 normal; public final Point3 position; public final Point3 rotation; /** * <p>La possiamo creare solo da CameraManager.</p> */ Camera(CameraManager cameraManager) { position = Point3.set(0f, 0f, 0f); lookAt = Point3.set(0, 0, -1); normal = Point3.set(0, 1, 0); rotation = Point3.set(0, 0, 0); info = new CameraInfo(); } /** * Muove la telecamera sul piano xy, senza modificare la normale e la * direzione della camera. * * Di default la posizione รจ: * * (0,0,0) position (0,0,-1) lookAt (0,1,0) normal * * @param offsetX * spostamento sull'asse startX * @param offsetY * spostamento sull'asse startY */ public void positionOnXYPlaneTo(float offsetX, float offsetY) { lookAt.x = offsetX; lookAt.y = offsetY; lookAt.z = -1f; position.x = offsetX; position.y = offsetY; position.z = 0; normal.x = offsetY; normal.y = 1 + XenonMath.abs(offsetX); normal.z = 0f; // ArgonMode4Wallpaper.getInstance().cameraInfo. Matrix.setLookAtM(info.cameraMatrix.get(), 0, position.x, position.y, position.z, lookAt.x, lookAt.y, lookAt.z, normal.x, normal.y, normal.z); info.projection4CameraMatrix.multiply(info.projectionMatrix, info.cameraMatrix); } }
[ "abubusoft@gmail.com" ]
abubusoft@gmail.com
b0b4ae5dd5629b29f2ae4d6bafc45c4cf0c73abe
c7f9043e3550d0d713bc5f892333c42d45a9008c
/src/com/example/carcontext/MainActivity.java
12cff325dd9c9c960135cbc336e2602bfab0f1cc
[]
no_license
TomyRO/HacktoryCarContext
4570032529ba3702f1191048bb97a34477039e85
d32e1eb17477844e76919e3b33dba705a0b616b7
refs/heads/master
2021-01-13T02:04:24.582392
2014-06-14T11:46:24
2014-06-14T11:46:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,949
java
package com.example.carcontext; import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBar; import android.support.v4.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.os.Build; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(R.id.container, new PlaceholderFragment()) .commit(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } /** * A placeholder fragment containing a simple view. */ public static class PlaceholderFragment extends Fragment { public PlaceholderFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); return rootView; } } }
[ "alex.dan.tomescu@gmail.com" ]
alex.dan.tomescu@gmail.com
417eeb31685eaadf362e979ae3c2de5059d9fe06
d7445e40f0ab7bdd309885b9ef8ce5a6bd00074b
/ProyectoBuffers/src/Principal/Principal.java
9a560e8b2ccfc2f5fd5d0ecda4dd7b553ed9721b
[]
no_license
AndreuCastello/Acceso-a-Datos
839fa591286896f04f7b4a8f5700fc9975290210
610d1638307be517213a68c0294ab960a3001cf3
refs/heads/master
2020-03-29T09:15:51.264443
2018-11-09T18:54:13
2018-11-09T18:54:13
149,749,279
0
0
null
null
null
null
UTF-8
Java
false
false
506
java
package Principal; import java.io.IOException; import javax.swing.JFrame; import model.*; import view.*; import controller.*; public class Principal { public static void main(String[] args) throws IOException { GestionDatos model = new GestionDatos(); LaunchView view = new LaunchView(); view.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); view.setVisible(true); GestionEventos controller = new GestionEventos(model,view); controller.contol(); } }
[ "AndreuCastello9lol@gmail.com" ]
AndreuCastello9lol@gmail.com
7d98a144cfa494dfbc642cf5a1cadd39021a1b4c
ad5cd983fa810454ccbb8d834882856d7bf6faca
/custom/training/trainingstorefront/web/src/de/hybris/training/storefront/filters/RequestLoggerFilter.java
a8b1969876028e478b789a959352d8e75e9f75a8
[]
no_license
amaljanan/my-hybris
2ea57d1a4391c9a81c8f4fef7c8ab977b48992b8
ef9f254682970282cf8ad6d26d75c661f95500dd
refs/heads/master
2023-06-12T17:20:35.026159
2021-07-09T04:33:13
2021-07-09T04:33:13
384,177,175
0
0
null
null
null
null
UTF-8
Java
false
false
3,571
java
/* * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. */ package de.hybris.training.storefront.filters; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; import org.apache.log4j.Logger; import org.springframework.web.filter.OncePerRequestFilter; import com.google.common.base.Stopwatch; /** * A filter that logs each request. This is a spring configured filter that is executed by the PlatformFilterChain. */ public class RequestLoggerFilter extends OncePerRequestFilter { private static final Logger LOG = Logger.getLogger(RequestLoggerFilter.class.getName()); @Override public void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws IOException, ServletException { if (LOG.isDebugEnabled()) { final String requestDetails = buildRequestDetails(request); writeDebugLog(requestDetails, "Begin"); logCookies(request); final ResponseWrapper wrappedResponse = new ResponseWrapper(response); final Stopwatch stopwatch = Stopwatch.createUnstarted(); stopwatch.start(); try { filterChain.doFilter(request, wrappedResponse); } finally { stopwatch.stop(); final int status = wrappedResponse.getStatus(); if (status != 0) { writeDebugLog(requestDetails, stopwatch.toString(), " (", String.valueOf(status), ")"); } else { writeDebugLog(requestDetails, stopwatch.toString()); } } return; } filterChain.doFilter(request, response); } protected void logCookies(final HttpServletRequest httpRequest) { if (LOG.isDebugEnabled()) { final Cookie[] cookies = httpRequest.getCookies(); if (cookies != null) { for (final Cookie cookie : cookies) { writeDebugLog("COOKIE Name: [", cookie.getName(), "] Path: [", cookie.getPath(), "] Value: [", cookie.getValue(), "]"); } } } } protected void writeDebugLog(final String... messages) { if (LOG.isDebugEnabled()) { LOG.debug(String.join(" ", messages)); } } protected String buildRequestDetails(final HttpServletRequest request) { String queryString = request.getQueryString(); if (queryString == null) { queryString = ""; } final String requestUri = request.getRequestURI(); final String securePrefix = request.isSecure() ? "s" : " "; final String methodPrefix = request.getMethod().substring(0, 1); return securePrefix + methodPrefix + " [" + requestUri + "] [" + queryString + "] "; } protected static class ResponseWrapper extends HttpServletResponseWrapper { private int status; public ResponseWrapper(final HttpServletResponse response) { super(response); } @Override public void setStatus(final int status) { super.setStatus(status); this.status = status; } @Override public int getStatus() { return status; } @Override public void sendError(final int status, final String msg) throws IOException { super.sendError(status, msg); // NOSONAR this.status = status; } @Override public void sendError(final int status) throws IOException { super.sendError(status); this.status = status; } } }
[ "amaljanan333@gmail.com" ]
amaljanan333@gmail.com
55b3ae864f4e91fd5bc92186a1641792a89a826d
495154acd14732d9a3953eb3e4ba45f2fc875c58
/ndt-etl/src/main/java/com/jk/ndtetl/mon/SysCpuInfo.java
a27c1f7da48d4401160e39702828b6f04f991dfa
[]
no_license
nikijm/network
fa076a9dc0d3a7235986c960f4d2910373f7f7dc
cb9526c2919fcbf0d11da9d2cf635b38e0145fcc
refs/heads/master
2021-07-02T08:37:44.478741
2017-09-17T15:12:25
2017-09-17T15:12:25
103,836,093
0
0
null
null
null
null
UTF-8
Java
false
false
2,377
java
package com.jk.ndtetl.mon; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; import ch.ethz.ssh2.Session; import ch.ethz.ssh2.StreamGobbler; /** * * @ClassName: SysCpuInfo * @Description: ่Žทๅ–็ณป็ปŸcpuไฟกๆฏ็š„็ฑป * @author wangzhi * @date 2017ๅนด5ๆœˆ25ๆ—ฅ ไธ‹ๅˆ3:43:25 * */ public class SysCpuInfo { private int CPU_IDLE = 0; private int CPU_VALUE = 0; int processStatus = 0; /** * ่Žทๅ–็›‘ๆŽงcpu็š„ไฟกๆฏ * * @param session */ public SysCpuInfo(Session session) { InputStream is = null; BufferedReader brStat = null; StringTokenizer tokenStat = null; Session sess = null; String str = ""; int i = 0, j = 0, cpuidle = 0; try { sess = session; sess.execCommand("vmstat 2 2 "); is = new StreamGobbler(sess.getStdout()); brStat = new BufferedReader(new InputStreamReader(is)); for (int m = 0; m < 2; m++) { str = brStat.readLine(); } for (j = 0; j < 2; j++) { str = brStat.readLine(); if (str == null) break; tokenStat = new StringTokenizer(str); for (i = 0; i < 14; i++) { tokenStat.nextToken(); } cpuidle = cpuidle + new Integer(tokenStat.nextToken()).intValue(); } CPU_VALUE = new Double(cpuidle / 2).intValue(); CPU_IDLE = 100 - CPU_VALUE; } catch (Exception e) { System.out.println(e.toString()); } finally { if (brStat != null) { try { brStat.close(); } catch (IOException e) { e.printStackTrace(); } finally { if (is != null) { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } } } } } public int getCPUInfo() { return CPU_IDLE; } }
[ "524972560@qq.com" ]
524972560@qq.com
4c9788f863378af4a4d33fb4856d4dad62cbf791
da1e223725b22f3b70e63f9e807fb2c0b7ac1146
/pro288/src/com/company/Main.java
ee2c7bba694f4c57c5ca16e499a0b9847696169d
[]
no_license
hangdu/leetcode
69b7599e4ccced8359417ca6d3ffb0b67faa9bf5
c691afeff9ca3203852350d297083dc57b28b126
refs/heads/master
2021-05-05T15:00:57.077206
2017-09-28T13:46:54
2017-09-28T13:46:54
103,151,810
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
package com.company; public class Main { public static void main(String[] args) { // write your code here String[] dict = {"a", "a"}; ValidWordAbbr validWordAbbr = new ValidWordAbbr(dict); boolean test; test = validWordAbbr.isUnique("a"); test = validWordAbbr.isUnique("cart"); test = validWordAbbr.isUnique("cane"); test = validWordAbbr.isUnique("make"); } }
[ "2580392278@qq.com" ]
2580392278@qq.com
143c2de03f24ad2ccbe9ba8635297fec5105135e
2819a06d65703c2e6e41cc8002efed9f61b48f5f
/src/com/cjj/learn/java/enumeration/Color.java
fc78485053f56e2029b3948d07833db265dd5141
[]
no_license
chenjianjun19920702/learn
168cb9083e87bfef6bd7207e73b2b6f10865f62f
5f3fcba4f8b16b936148896a57d3362b181237a8
refs/heads/master
2020-03-14T09:42:19.054445
2018-08-04T10:44:57
2018-08-04T10:44:57
131,390,435
2
0
null
null
null
null
UTF-8
Java
false
false
1,485
java
package com.cjj.learn.java.enumeration; /** * ๆ‰€ๆœ‰็š„ๆžšไธพ้ƒฝ็ปงๆ‰ฟ่‡ชjava.lang.Enum็ฑปใ€‚ * ็”ฑไบŽJava ไธๆ”ฏๆŒๅคš็ปงๆ‰ฟ๏ผŒๆ‰€ไปฅๆžšไธพๅฏน่ฑกไธ่ƒฝๅ†็ปงๆ‰ฟๅ…ถไป–็ฑปใ€‚ */ public enum Color implements Behaviour { // ๅฆ‚ๆžœๆ‰“็ฎ—่‡ชๅฎšไน‰่‡ชๅทฑ็š„ๆ–นๆณ•๏ผŒ้‚ฃไนˆๅฟ…้กปๅœจenumๅฎžไพ‹ๅบๅˆ—็š„ๆœ€ๅŽๆทปๅŠ ไธ€ไธชๅˆ†ๅทใ€‚่€Œไธ” Java ่ฆๆฑ‚ๅฟ…้กปๅ…ˆๅฎšไน‰ enum ๅฎžไพ‹ใ€‚ RED("็บข่‰ฒ", 1), GREEN("็ปฟ่‰ฒ", 2), BLANK("็™ฝ่‰ฒ", 3), YELLOW("้ป„่‰ฒ", 4); // ๆˆๅ‘˜ๅ˜้‡ private String name; private int index; // ๆž„้€ ๆ–นๆณ• private Color(String name,int index) { this.setName(name); this.setIndex(index); System.out.println("constructor is running... name is " + name + ",index is " + index); } // ๆ™ฎ้€šๆ–นๆณ• public static String getName(int index) { for (Color c : Color.values()) { if (index == c.getIndex()) { return c.getName(); } } return null; } // get set ๆ–นๆณ• public String getName() { return name; } public void setName(String name) { this.name = name; } public int getIndex() { return index; } public void setIndex(int index) { this.index = index; } // ่ฆ†็›–ๆ–นๆณ• @Override public String toString() { return this.index+"_"+this.name; } // ๆŽฅๅฃๆ–นๆณ• @Override public void print() { System.out.println(this.index+":"+this.name); } // ๆŽฅๅฃๆ–นๆณ• @Override public String getInfo() { return this.name; } }
[ "chenjianjun19920702@gmail.com" ]
chenjianjun19920702@gmail.com
e210bf62195acb978f9eeed157bbfeae12225117
add53ced55f107479860f39f03bfb29c4ce65752
/src/main/java/com/antonio/connectabackend/models/Employee.java
8da215fc59e0209c83c4d5ff07efa596659e72d3
[]
no_license
AsuSoftware/connecta-back
e61b3fdd73e78917c5b332b16c15ffa80151f5d3
c5450fb7676938baae5c5753ebc04a03d6e583e3
refs/heads/master
2023-01-13T21:38:47.354357
2020-11-24T09:16:49
2020-11-24T09:16:49
314,890,573
0
0
null
null
null
null
UTF-8
Java
false
false
2,184
java
package com.antonio.connectabackend.models; import com.fasterxml.jackson.annotation.JsonProperty; import com.sun.istack.NotNull; import javax.validation.constraints.Email; import lombok.Getter; import lombok.Setter; import lombok.ToString; import javax.persistence.*; import java.time.LocalDateTime; import java.util.Date; import java.util.List; import java.util.UUID; @Entity @Table(name = "employees") @Getter @Setter @ToString public class Employee { @Id @GeneratedValue private UUID id; @Column(name = "name") @NotNull private String name; @Column(name = "surname") @NotNull private String surname; @Column(name = "phone") @NotNull private String phone; @Column(name = "mobile") @NotNull private String mobile; @Email @Column(name = "email") @NotNull private String email; @Column(name = "active") @NotNull private String active; @Column(name = "note") @NotNull private String note; @Column(name = "insert_by") @NotNull private String insert_by; @Column(name = "insert_date") @NotNull private LocalDateTime insert_date; @Column(name = "modify_by") @NotNull private String modify_by; @Column(name = "modify_date") @NotNull private LocalDateTime modify_date; @Column(name = "deleted_by") @NotNull private String deleted_by; @Column(name = "deleted_date") @NotNull private LocalDateTime deleted_date; /* @ManyToOne // molti annunci su uno user @JoinColumn(name = "company_areas_id") private CompanyAreas company_areas; */ /* @OneToOne(cascade = CascadeType.ALL) // molti annunci su uno user @JoinColumn(name = "office_id", referencedColumnName = "id") private Office office; /* @OneToMany(mappedBy = "employee", cascade = CascadeType.ALL) // 1 employee puรฒ avere piรน business roles private List<BusinessRoles> businessRoles; */ /* @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "business_roles_id", referencedColumnName = "id") // rappresenta il nome della colonna che fa riferimento ad business roles id private BusinessRoles businessRoles; */ }
[ "web.antonio.popa@gmail.com" ]
web.antonio.popa@gmail.com
8df8030df26f61e3072cf9109d3519c3c4b84f32
4688d19282b2b3b46fc7911d5d67eac0e87bbe24
/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/GetRegionsResult.java
1f377d169c0a13e317ab0c7a2470bd0e96ca5366
[ "Apache-2.0" ]
permissive
emilva/aws-sdk-java
c123009b816963a8dc86469405b7e687602579ba
8fdbdbacdb289fdc0ede057015722b8f7a0d89dc
refs/heads/master
2021-05-13T17:39:35.101322
2018-12-12T13:11:42
2018-12-12T13:11:42
116,821,450
1
0
Apache-2.0
2018-09-19T04:17:41
2018-01-09T13:45:39
Java
UTF-8
Java
false
false
4,986
java
/* * Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.lightsail.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegions" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetRegionsResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * <p> * An array of key-value pairs containing information about your get regions request. * </p> */ private java.util.List<Region> regions; /** * <p> * An array of key-value pairs containing information about your get regions request. * </p> * * @return An array of key-value pairs containing information about your get regions request. */ public java.util.List<Region> getRegions() { return regions; } /** * <p> * An array of key-value pairs containing information about your get regions request. * </p> * * @param regions * An array of key-value pairs containing information about your get regions request. */ public void setRegions(java.util.Collection<Region> regions) { if (regions == null) { this.regions = null; return; } this.regions = new java.util.ArrayList<Region>(regions); } /** * <p> * An array of key-value pairs containing information about your get regions request. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setRegions(java.util.Collection)} or {@link #withRegions(java.util.Collection)} if you want to override * the existing values. * </p> * * @param regions * An array of key-value pairs containing information about your get regions request. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRegionsResult withRegions(Region... regions) { if (this.regions == null) { setRegions(new java.util.ArrayList<Region>(regions.length)); } for (Region ele : regions) { this.regions.add(ele); } return this; } /** * <p> * An array of key-value pairs containing information about your get regions request. * </p> * * @param regions * An array of key-value pairs containing information about your get regions request. * @return Returns a reference to this object so that method calls can be chained together. */ public GetRegionsResult withRegions(java.util.Collection<Region> regions) { setRegions(regions); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getRegions() != null) sb.append("Regions: ").append(getRegions()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetRegionsResult == false) return false; GetRegionsResult other = (GetRegionsResult) obj; if (other.getRegions() == null ^ this.getRegions() == null) return false; if (other.getRegions() != null && other.getRegions().equals(this.getRegions()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRegions() == null) ? 0 : getRegions().hashCode()); return hashCode; } @Override public GetRegionsResult clone() { try { return (GetRegionsResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
[ "" ]
396246c09dd8408f9e7fbd72805f9e6e27ea15f6
0ac8ebad56932855fecafbf253bc6a1a258389ca
/BaiTapThem/src/BaiThucHanh4/User.java
ec644adb55d891245b9150245cdd4befc6597d39
[]
no_license
cuongtien00/Module2
b4ae78930a11092022291f327221a165004ec80d
b991745dc0420478ea3bffc66cefe18d0badef7d
refs/heads/master
2023-08-19T19:47:34.171076
2021-10-08T08:13:14
2021-10-08T08:13:14
407,001,851
0
0
null
null
null
null
UTF-8
Java
false
false
43
java
package BaiThucHanh4;public class User { }
[ "cuonghiep000@gmail.com" ]
cuonghiep000@gmail.com
60ba6fa63cd7f2b8ac56f7eb2e57d15e55dd89c8
2703b0cf40291404cd27382d511fcd2b215c2c8d
/pemesanan.java
2c854c9615369d5210247e2c2f1e5882c4b09591
[]
no_license
Aminahfauziah/project1
bd43bc91eca67d6a3256aac4d256d3331bee2898
7a0829d29cfb4523bd7a166319e9bcf42df14975
refs/heads/master
2021-01-15T19:45:28.367354
2015-09-11T09:11:33
2015-09-11T09:11:33
42,298,187
0
0
null
null
null
null
UTF-8
Java
false
false
1,088
java
class pemesanan extends kamar { public pemesanan (String kode_kamar, int kode) { super.getkamar(kode_kamar,kode); } public int gethargakamar(String kode_kamar, int kode) { hargakamar = Integer.parseInt(getkamar(kode_kamar,2)); return hargakamar; } public String getmininap(String kode_kamar, int kode) { mininap=kode_kamar.substring(2,3); return mininap; } public int getlamainap(int Lama) { lamainap = Lama; return lamainap; } public int gettotalharga() { totalharga = hargakamar*lamainap; return totalharga; } public int getdiskon(String kode_kamar, int kode) { min=Integer.parseInt(mininap); dis=Integer.parseInt(getkamar(kode_kamar,3)); if (lamainap > min ){ diskon=(totalharga*dis)/100; } else{ diskon=0; } return diskon; } public int gettotalbayar() { totalbayar = totalharga - diskon; return totalbayar; } public int getbayar(int Bayar) { bayar = Bayar; return bayar; } public int getkembalian() { kembalian = bayar-totalbayar; if (kembalian>=0) { return kembalian; } return kembalian; } }
[ "Aminahfauziah@github.com" ]
Aminahfauziah@github.com
5d79d6f8c68296490e47ba14f308e0cf5efa8174
0f4e593287d8b26f051c24664ac6fea25497b1a2
/app/src/main/java/com/problemhunt/android/tmdbclient/service/MovieDataService.java
0c49b8a19a9045587aaf3b6c7b477f77ddcd232e
[]
no_license
shailendra-semwal/TMDBClientJetpack
90f645231eeb5cc648a4d4306844979135f6f4a2
77f6a7d54857b5092c903bcd67281b1f1a305547
refs/heads/master
2022-03-29T09:56:03.762270
2020-01-17T08:08:57
2020-01-17T08:08:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
package com.problemhunt.android.tmdbclient.service; import com.problemhunt.android.tmdbclient.model.MovieDBResponse; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Query; public interface MovieDataService { @GET("movie/popular") Call<MovieDBResponse> getPopularMovies(@Query("api_key") String apiKey); }
[ "shailendarsemwal@gmail.com" ]
shailendarsemwal@gmail.com
1a46b18d245f2f12496e30d1592d6552c8c02ac7
99a2a3d6d028513bf7a1f9b80733d3c8c9fc4312
/android/app/src/main/java/com/reactnative/MainActivity.java
d9335b24aac3742b5fa3706a8cb163f6b23a2855
[]
no_license
yahue/react-native-example
6193523bfebbf0828f801b8869296b244887eed9
62e1bea68c3672a59613c447619f4a7219269af2
refs/heads/master
2021-01-20T21:31:57.796499
2017-01-17T08:29:48
2017-01-17T08:29:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
418
java
package com.reactnative; import com.facebook.react.ReactActivity; import com.oblador.vectoricons.VectorIconsPackage; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "reactNative"; } }
[ "xiongle_2005@qq.com" ]
xiongle_2005@qq.com
861cf4170c5bdfabe426094a292b910d01058401
9f9e95e811710152358bdfa24528c4c7ea054baf
/src/chapter1/section3/Exercise_1.java
615c61b9740c5f1ad5f367e0c3ea1d6f0a0dfd09
[]
no_license
Vasilic-Maxim/Algorithms-4th-Edition
fdb969b2fe37e4ff9ac68994f034ad956b11fd5b
029a1a0279a62aa5e73321b7065589914ed88591
refs/heads/master
2022-12-18T09:00:42.416548
2020-09-17T16:56:51
2020-09-17T16:56:51
288,508,326
0
0
null
null
null
null
UTF-8
Java
false
false
1,054
java
package chapter1.section3; import edu.princeton.cs.algs4.StdOut; public class Exercise_1 { public static void main(String[] args) { FixedCapacityStackOfStrings stack = new FixedCapacityStackOfStrings(5); stack.push("Hello"); stack.push("World"); stack.push("."); StdOut.printf("Is empty: %b%n", stack.isEmpty()); StdOut.printf("Size: %d%n", stack.size()); StdOut.printf("Is full: %b%n", stack.isFull()); } public static class FixedCapacityStackOfStrings { private final String[] a; private int N; public FixedCapacityStackOfStrings(int cap) { a = new String[cap]; } private boolean isEmpty() { return N == 0; } private int size() { return N; } private void push(String item) { a[N++] = item; } private boolean isFull() { return N == a.length; } public String pop() { return a[--N]; } } }
[ "lmantenl@gmail.com" ]
lmantenl@gmail.com
81b93742c705b2c4345f1c362e07c88c8d5ecea6
c1af08ef651287d12f609f0581622fddb6ea3c5f
/hrms/src/main/java/HrmsProject/hrms/business/concretes/CandicateManager.java
7e4d31061fe0e3818123193827fadde5dd56777f
[]
no_license
muhammedargin/HrmsProject
ba0a186ca7b8b9dc7bb0e5fde5ead3fd37354172
b14171fe4e7c9903543dc6cc96d1b74e769acb39
refs/heads/master
2023-06-18T23:24:54.050806
2021-07-13T23:16:57
2021-07-13T23:16:57
381,459,829
0
0
null
null
null
null
UTF-8
Java
false
false
2,002
java
package HrmsProject.hrms.business.concretes; import HrmsProject.hrms.core.utilities.results.*; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import HrmsProject.hrms.business.abstracts.CandicateService; import HrmsProject.hrms.core.utilities.check.Abstract.CandicateCheckService; import HrmsProject.hrms.dataaccess.abstracts.CandicateDao; import HrmsProject.hrms.entities.concretes.Candicate; import HrmsProject.hrms.validation.abstracts.MailValidationService; @Service public class CandicateManager implements CandicateService{ private CandicateDao candicateDao; private MailValidationService mailValidationService; private CandicateCheckService candicateCheckService; @Autowired public CandicateManager(CandicateDao candicateDao ,MailValidationService mailValidationService,CandicateCheckService candicateCheckService) { this.candicateDao=candicateDao; this.mailValidationService=mailValidationService; this.candicateCheckService=candicateCheckService; } @Override public Result add(Candicate candicate) { //checkService deki metotlarฤฑmฤฑz Result dรถnรผyor, dรถndรผฤŸรผ resultu burada tutabilmek iรงin referasฤฑnฤฑ result ile tuttum //ve kontrolรผ aynฤฑ anda yapmฤฑลŸ oldum,aลŸaฤŸฤฑda da result dรถndรผฤŸรผ iรงin success kontrolรผ รผzerinden mail servise devam Result result=candicateCheckService.allCheck(candicate); if(result.isSusccess()==true) { mailValidationService.sendMail(candicate.getEMail()); if (mailValidationService.checkValidationComplete(candicate.getEMail())) { this.candicateDao.save(candicate); return new SuccessResult("Yeni รผye eklendi"); } else { return new ErrorResult("Mail doฤŸrulanmasฤฑ yapฤฑlmadฤฑ"); } }else { return result; } } @Override public DataResult<List<Candicate>> getAll() { return new SuccessDataResult<List<Candicate>>(this.candicateDao.findAll(),"Adaylar Listelendi"); } }
[ "yorgunargin@outlook.com" ]
yorgunargin@outlook.com
e174d05e1888fd6af13951626f6dcc8669fa737f
c3f0c338bcb612d9061a1b49a6a86c3ecda0c488
/src/main/java/com/casestudymd4/model/Image.java
c960830330a6304403b9334bfc5e38cb864d87a7
[]
no_license
hoangmanhcuong97/CaseStudyMD4
a7ce5ec4ab790cd1bc005760517fd670b33b92ae
a21b4cde6acf1152174d947373bc88f70e4095a8
refs/heads/master
2023-08-02T10:19:28.306275
2021-10-07T03:42:42
2021-10-07T03:42:42
414,161,337
0
0
null
null
null
null
UTF-8
Java
false
false
774
java
package com.casestudymd4.model; import javax.persistence.*; @Entity public class Image { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String path; @ManyToOne private Post post; public Image() { } public Image(Long id, String path, Post post) { this.id = id; this.path = path; this.post = post; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public Post getPost() { return post; } public void setPost(Post post) { this.post = post; } }
[ "cuong.hoangmanh23101997@gmail.com" ]
cuong.hoangmanh23101997@gmail.com
66ffbdb4aa861977ac4861c60a1930e00ea12ee5
ba26af1bfe70673303f39fb34bf83f5c08ed5905
/analysis/src/main/java/org/apache/calcite/rel/rules/SemiJoinFilterTransposeRule.java
fa38c2495f077c132e4475afce0f89546791e284
[ "MIT" ]
permissive
GinPonson/Quicksql
5a4a6671e87b3278e2d77eee497a4910ac340617
e31f65fb96ea2f2c373ba3acc43473a48dca10d1
refs/heads/master
2020-07-30T06:23:41.805009
2019-09-22T08:50:18
2019-09-22T08:50:18
210,116,844
0
0
MIT
2019-09-22T08:48:23
2019-09-22T08:48:23
null
UTF-8
Java
false
false
2,851
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.calcite.rel.rules; import org.apache.calcite.plan.RelOptRule; import org.apache.calcite.plan.RelOptRuleCall; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.RelFactories; import org.apache.calcite.rel.core.SemiJoin; import org.apache.calcite.rel.logical.LogicalFilter; import org.apache.calcite.tools.RelBuilderFactory; /** * Planner rule that pushes * {@link org.apache.calcite.rel.core.SemiJoin}s down in a tree past * a {@link org.apache.calcite.rel.core.Filter}. * * <p>The intention is to trigger other rules that will convert * {@code SemiJoin}s. * * <p>SemiJoin(LogicalFilter(X), Y) &rarr; LogicalFilter(SemiJoin(X, Y)) * * @see SemiJoinProjectTransposeRule */ public class SemiJoinFilterTransposeRule extends RelOptRule { public static final SemiJoinFilterTransposeRule INSTANCE = new SemiJoinFilterTransposeRule(RelFactories.LOGICAL_BUILDER); //~ Constructors ----------------------------------------------------------- /** * Creates a SemiJoinFilterTransposeRule. */ public SemiJoinFilterTransposeRule(RelBuilderFactory relBuilderFactory) { super( operand(SemiJoin.class, some(operand(LogicalFilter.class, any()))), relBuilderFactory, null); } //~ Methods ---------------------------------------------------------------- // implement RelOptRule public void onMatch(RelOptRuleCall call) { SemiJoin semiJoin = call.rel(0); LogicalFilter filter = call.rel(1); RelNode newSemiJoin = SemiJoin.create(filter.getInput(), semiJoin.getRight(), semiJoin.getCondition(), semiJoin.getLeftKeys(), semiJoin.getRightKeys()); final RelFactories.FilterFactory factory = RelFactories.DEFAULT_FILTER_FACTORY; RelNode newFilter = factory.createFilter(newSemiJoin, filter.getCondition()); call.transformTo(newFilter); } } // End SemiJoinFilterTransposeRule.java
[ "xushengguo-xy@360.cn" ]
xushengguo-xy@360.cn
58e49cecbd13df122a4e992b95d079044c4080b9
1478c1fb3acc567c5562f896aaa56d1639e7713d
/src/com/lsy/www/entity/cond/chat/KpkpWwwChatGroupSessCond.java
ee5601ad7f53f730d16c77ee9752178266d26863
[]
no_license
Lsyee10/lsyee2
edbfbdcf43182566db351b12bd707d1f39d2d0bd
bd719d9825463a0dac47ca85e1beb6de75b16f63
refs/heads/master
2020-12-03T13:20:52.967472
2016-09-09T11:42:13
2016-09-09T11:42:13
66,546,079
0
0
null
null
null
null
UTF-8
Java
false
false
979
java
/** * Project : kpkp * Copyright (c) Hang Zhou Daily Press Group. * All rights reserved. */ package com.lsy.www.entity.cond.chat; import com.lsy.www.entity.cond.KpkpWwwBaseCond; /** * Description:็พค่Šไผš่ฏๆกไปถ * * @version 1.0 2015ๅนด8ๆœˆ31ๆ—ฅ * @author Wu guang jing */ public class KpkpWwwChatGroupSessCond extends KpkpWwwBaseCond { private Integer sessId; private Integer userId; private Integer groupId; private Integer recycleFlag; public Integer getSessId() { return sessId; } public void setSessId(Integer sessId) { this.sessId = sessId; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public Integer getGroupId() { return groupId; } public void setGroupId(Integer groupId) { this.groupId = groupId; } public Integer getRecycleFlag() { return recycleFlag; } public void setRecycleFlag(Integer recycleFlag) { this.recycleFlag = recycleFlag; } }
[ "418383134@qq.com" ]
418383134@qq.com
4389b0c93dfa6995bd07bcb8e0c42320b104114a
97fd02f71b45aa235f917e79dd68b61c62b56c1c
/src/main/java/com/tencentcloudapi/ckafka/v20190819/models/DescribeTopicSyncReplicaResponse.java
92020ff61af12b62f9d87f6a314c5889420bdcb0
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-java
7df922f7c5826732e35edeab3320035e0cdfba05
09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec
refs/heads/master
2023-09-04T10:51:57.854153
2023-09-01T03:21:09
2023-09-01T03:21:09
129,837,505
537
317
Apache-2.0
2023-09-13T02:42:03
2018-04-17T02:58:16
Java
UTF-8
Java
false
false
3,192
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.ckafka.v20190819.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class DescribeTopicSyncReplicaResponse extends AbstractModel{ /** * ่ฟ”ๅ›žtopic ๅ‰ฏๆœฌ่ฏฆๆƒ… */ @SerializedName("Result") @Expose private TopicInSyncReplicaResult Result; /** * ๅ”ฏไธ€่ฏทๆฑ‚ ID๏ผŒๆฏๆฌก่ฏทๆฑ‚้ƒฝไผš่ฟ”ๅ›žใ€‚ๅฎšไฝ้—ฎ้ข˜ๆ—ถ้œ€่ฆๆไพ›่ฏฅๆฌก่ฏทๆฑ‚็š„ RequestIdใ€‚ */ @SerializedName("RequestId") @Expose private String RequestId; /** * Get ่ฟ”ๅ›žtopic ๅ‰ฏๆœฌ่ฏฆๆƒ… * @return Result ่ฟ”ๅ›žtopic ๅ‰ฏๆœฌ่ฏฆๆƒ… */ public TopicInSyncReplicaResult getResult() { return this.Result; } /** * Set ่ฟ”ๅ›žtopic ๅ‰ฏๆœฌ่ฏฆๆƒ… * @param Result ่ฟ”ๅ›žtopic ๅ‰ฏๆœฌ่ฏฆๆƒ… */ public void setResult(TopicInSyncReplicaResult Result) { this.Result = Result; } /** * Get ๅ”ฏไธ€่ฏทๆฑ‚ ID๏ผŒๆฏๆฌก่ฏทๆฑ‚้ƒฝไผš่ฟ”ๅ›žใ€‚ๅฎšไฝ้—ฎ้ข˜ๆ—ถ้œ€่ฆๆไพ›่ฏฅๆฌก่ฏทๆฑ‚็š„ RequestIdใ€‚ * @return RequestId ๅ”ฏไธ€่ฏทๆฑ‚ ID๏ผŒๆฏๆฌก่ฏทๆฑ‚้ƒฝไผš่ฟ”ๅ›žใ€‚ๅฎšไฝ้—ฎ้ข˜ๆ—ถ้œ€่ฆๆไพ›่ฏฅๆฌก่ฏทๆฑ‚็š„ RequestIdใ€‚ */ public String getRequestId() { return this.RequestId; } /** * Set ๅ”ฏไธ€่ฏทๆฑ‚ ID๏ผŒๆฏๆฌก่ฏทๆฑ‚้ƒฝไผš่ฟ”ๅ›žใ€‚ๅฎšไฝ้—ฎ้ข˜ๆ—ถ้œ€่ฆๆไพ›่ฏฅๆฌก่ฏทๆฑ‚็š„ RequestIdใ€‚ * @param RequestId ๅ”ฏไธ€่ฏทๆฑ‚ ID๏ผŒๆฏๆฌก่ฏทๆฑ‚้ƒฝไผš่ฟ”ๅ›žใ€‚ๅฎšไฝ้—ฎ้ข˜ๆ—ถ้œ€่ฆๆไพ›่ฏฅๆฌก่ฏทๆฑ‚็š„ RequestIdใ€‚ */ public void setRequestId(String RequestId) { this.RequestId = RequestId; } public DescribeTopicSyncReplicaResponse() { } /** * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, * and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. */ public DescribeTopicSyncReplicaResponse(DescribeTopicSyncReplicaResponse source) { if (source.Result != null) { this.Result = new TopicInSyncReplicaResult(source.Result); } if (source.RequestId != null) { this.RequestId = new String(source.RequestId); } } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamObj(map, prefix + "Result.", this.Result); this.setParamSimple(map, prefix + "RequestId", this.RequestId); } }
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
e582d649fa8ba163728f0a77c9f44fc731aaec84
c774d25f74d7128b247ae2c1569fd5046c41bce8
/org.tolven.passwordrecovery/tpf/source/org/tolven/passwordrecovery/gui/LoginPasswordRecoveryQuestionPanel.java
e811f861b1dc50522a15cd2d53fb76ed03db42a4
[]
no_license
dubrsl/tolven
f42744237333447a5dd8348ae991bb5ffcb5a2d3
0e292799b42ae7364050749705eff79952c1b5d3
refs/heads/master
2021-01-01T18:38:36.978913
2011-11-11T14:40:13
2011-11-11T14:40:13
40,418,393
1
0
null
null
null
null
UTF-8
Java
false
false
29,607
java
/* * * Created on August 19, 2007, 3:00 AM */ package org.tolven.passwordrecovery.gui; import java.awt.Component; import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.ArrayList; import java.util.List; import javax.swing.DefaultCellEditor; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.filechooser.FileFilter; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import org.tolven.passwordrecovery.api.SecurityQuestionsImpl; import org.tolven.passwordrecovery.gui.PropertyEditorDialog; import org.tolven.passwordrecovery.model.LoadSecurityQuestions; import org.tolven.passwordrecovery.model.PasswordRecoveryQuestionInfo; /** * * @author Joseph Isaac */ public class LoginPasswordRecoveryQuestionPanel extends javax.swing.JPanel { private JFileChooser chooser; private List<PasswordRecoveryQuestionInfo> passwordRecoveryQuestionInfos; private SecurityQuestionsImpl securityQuestionsImpl; private boolean startUpRefreshRequired = true; private JMenuItem addMenuItem = new JMenuItem("Add"); private JMenuItem editMenuItem = new JMenuItem("Edit"); private JMenuItem removeMenuItem = new JMenuItem("Remove"); public LoginPasswordRecoveryQuestionPanel(SecurityQuestionsImpl securityQuestionsImpl) { initComponents(); securityQuestionsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); securityQuestionsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { updateWidgets(); } } }); JPopupMenu popup = new JPopupMenu(); addMenuItem = new JMenuItem("Add"); addMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { add(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), ex.getMessage()); } } }); popup.add(addMenuItem); editMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { edit(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), ex.getMessage()); } } }); popup.add(editMenuItem); removeMenuItem = new JMenuItem("Remove"); removeMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { remove(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), ex.getMessage()); } } }); popup.add(removeMenuItem); securityQuestionsTable.setComponentPopupMenu(popup); TableColumn column = securityQuestionsTable.getColumnModel().getColumn(0); column.setCellRenderer(getTableCellRenderer()); column = securityQuestionsTable.getColumnModel().getColumn(1); column.setCellRenderer(getTableCellRenderer()); editButton.setEnabled(false); updateButton.setEnabled(false); addButton.setEnabled(false); removeButton.setEnabled(false); importButton.setEnabled(false); exportButton.setEnabled(false); addMenuItem.setEnabled(false); editMenuItem.setEnabled(false); removeMenuItem.setEnabled(false); setupFileChooser(); passwordRecoveryQuestionInfos = new ArrayList<PasswordRecoveryQuestionInfo>(); this.securityQuestionsImpl = securityQuestionsImpl; try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); SwingUtilities.updateComponentTreeUI(chooser); SwingUtilities.updateComponentTreeUI(this); } catch (Exception ex) { throw new RuntimeException("Could not set the Swing Look And Feel", ex); } } private TableCellRenderer getTableCellRenderer() { return new TableCellRenderer() { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel label = new JLabel(); label.setOpaque(true); if (isSelected) { label.setForeground(table.getSelectionForeground()); label.setBackground(table.getSelectionBackground()); } else { label.setForeground(table.getForeground()); label.setBackground(table.getBackground()); } PasswordRecoveryQuestionInfo passwordRecoveryQuestionInfo = (PasswordRecoveryQuestionInfo) value; if (column == 0) { label.setText(passwordRecoveryQuestionInfo.getQuestion()); } else if (column == 1) { label.setText(passwordRecoveryQuestionInfo.getDefaultStatusString()); label.setToolTipText(passwordRecoveryQuestionInfo.getDefaultStatusString()); } else { throw new RuntimeException("Unknown column found in " + LoginPasswordRecoveryQuestionPanel.class); } return label; } }; } public void propertyValueEditingStopped(ChangeEvent e) { int selectedRow = securityQuestionsTable.getSelectedRow(); PasswordRecoveryQuestionInfo selectedPasswordRecoveryQuestionInfo = passwordRecoveryQuestionInfos.get(selectedRow); if (selectedPasswordRecoveryQuestionInfo.getSecurityQuestion() == null) { JOptionPane.showMessageDialog(getRootPane(), "The selected item must be refreshed from the database before it can be edited"); updateSecurityQuestionsTable(); return; } DefaultCellEditor defaultCellEditor = (DefaultCellEditor) e.getSource(); selectedPasswordRecoveryQuestionInfo.setValue((String) defaultCellEditor.getCellEditorValue()); } private SecurityQuestionsImpl getSecurityQuestionsImpl() { return securityQuestionsImpl; } private void setupFileChooser() { chooser = new JFileChooser(); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setFileFilter(new FileFilter() { public boolean accept(File pathname) { return pathname.isDirectory() || pathname.getName().endsWith(".xml"); } public String getDescription() { return "Security Questions XML File"; } }); } private void setupSecurityQuestionsTable() { DefaultTableModel propertiesTableModel = (DefaultTableModel) securityQuestionsTable.getModel(); while (securityQuestionsTable.getRowCount() > 0) { propertiesTableModel.removeRow(0); } DefaultTableModel securityQuestionsTableModel = (DefaultTableModel) securityQuestionsTable.getModel(); for (PasswordRecoveryQuestionInfo passwordRecoveryQuestionInfo : passwordRecoveryQuestionInfos) { securityQuestionsTableModel.addRow(new Object[] { passwordRecoveryQuestionInfo, passwordRecoveryQuestionInfo, new Boolean(false) }); } } private void updateSecurityQuestionsTable() { for (int i = 0; i < securityQuestionsTable.getRowCount(); i++) { securityQuestionsTable.setValueAt(passwordRecoveryQuestionInfos.get(i), i, 0); securityQuestionsTable.setValueAt(passwordRecoveryQuestionInfos.get(i), i, 1); } } private void refresh() { try { if (updateButton.isEnabled()) { int returnValue = JOptionPane.showConfirmDialog(getRootPane(), "You have changes pending. Reload anyway?", "Refresh", JOptionPane.YES_NO_OPTION); if (returnValue == JOptionPane.NO_OPTION) { return; } } setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); passwordRecoveryQuestionInfos = getSecurityQuestionsImpl().getPasswordRecoveryQuestionInfos(); } finally { setCursor(Cursor.getDefaultCursor()); } setupSecurityQuestionsTable(); startUpRefreshRequired = false; updateWidgets(); } private void importSecurityQuestions() { if (updateButton.isEnabled()) { int returnValue = JOptionPane.showConfirmDialog(getRootPane(), "You have changes pending, which will be lost.\nProceed anyway?", "Import", JOptionPane.YES_NO_OPTION); if (returnValue == JOptionPane.NO_OPTION) { return; } } int returnVal = chooser.showOpenDialog(JOptionPane.getRootFrame()); if (returnVal == JFileChooser.APPROVE_OPTION) { passwordRecoveryQuestionInfos = getSecurityQuestionsImpl().importPasswordRecoveryQuestionInfos(chooser.getSelectedFile()); setupSecurityQuestionsTable(); updateButton.setEnabled(true); updateButton.requestFocus(); updateWidgets(); } } private void exportSecurityQuestions(File securityQuestionsFile) { getSecurityQuestionsImpl().exportPasswordRecoveryQuestionInfos(securityQuestionsFile); } public void add() { PropertyEditorDialog propertyEditorDialog = new PropertyEditorDialog(JOptionPane.getRootFrame(), "Add Security Question", "Add Security Question", false, null, true); propertyEditorDialog.setVisible(true); if (propertyEditorDialog.getStatus() == PropertyEditorDialog.CANCEL_STATUS) { return; } PasswordRecoveryQuestionInfo newPasswordRecoveryQuestionInfo = getSecurityQuestionsImpl().addPasswordRecoveryQuestionInfo(propertyEditorDialog.getPropertyValue()); if (newPasswordRecoveryQuestionInfo != null) { passwordRecoveryQuestionInfos.add(newPasswordRecoveryQuestionInfo); setupSecurityQuestionsTable(); } updateButton.setEnabled(true); updateButton.requestFocus(); updateWidgets(); } private void edit() { int selectedRow = securityQuestionsTable.getSelectedRow(); PasswordRecoveryQuestionInfo selectedPasswordRecoveryQuestionInfo = passwordRecoveryQuestionInfos.get(selectedRow); if (selectedPasswordRecoveryQuestionInfo.getSecurityQuestion() == null) { JOptionPane.showMessageDialog(getRootPane(), "The selected item must be refreshed from the database before it can be edited"); updateSecurityQuestionsTable(); return; } PropertyEditorDialog propertyEditorDialog = new PropertyEditorDialog(JOptionPane.getRootFrame(), "Edit Security Question", "Edit Security Question", false, selectedPasswordRecoveryQuestionInfo.getQuestion(), true); propertyEditorDialog.setVisible(true); if (propertyEditorDialog.getStatus() == PropertyEditorDialog.CANCEL_STATUS) { return; } selectedPasswordRecoveryQuestionInfo.setValue(propertyEditorDialog.getPropertyValue()); selectedPasswordRecoveryQuestionInfo.setStatus(PasswordRecoveryQuestionInfo.UPDATEPENDING); updateSecurityQuestionsTable(); updateButton.setEnabled(true); updateButton.requestFocus(); updateWidgets(); } private void remove() { int selectedRow = securityQuestionsTable.getSelectedRow(); PasswordRecoveryQuestionInfo selectedPasswordRecoveryQuestionInfo = (PasswordRecoveryQuestionInfo) securityQuestionsTable.getValueAt(selectedRow, 0); selectedPasswordRecoveryQuestionInfo.setStatus(PasswordRecoveryQuestionInfo.REMOVEPENDING); updateSecurityQuestionsTable(); updateWidgets(); updateButton.setEnabled(true); } private void update() { try { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); getSecurityQuestionsImpl().update(passwordRecoveryQuestionInfos); } finally { setCursor(Cursor.getDefaultCursor()); } updateButton.setEnabled(false); refresh(); updateWidgets(); } public void updateWidgets() { addButton.setEnabled(!startUpRefreshRequired && passwordRecoveryQuestionInfos.size() > 0); addMenuItem.setEnabled(!startUpRefreshRequired && passwordRecoveryQuestionInfos.size() > 0); int selectedRow = securityQuestionsTable.getSelectedRow(); editMenuItem.setEnabled(!startUpRefreshRequired && passwordRecoveryQuestionInfos.size() > 0 && selectedRow != -1); if (!startUpRefreshRequired && passwordRecoveryQuestionInfos.size() > 0 && selectedRow != -1) { PasswordRecoveryQuestionInfo selectedTolvenPropertyInfo = (PasswordRecoveryQuestionInfo) securityQuestionsTable.getValueAt(selectedRow, 0); editButton.setEnabled(selectedTolvenPropertyInfo.getStatus() != PasswordRecoveryQuestionInfo.REMOVEPENDING); editMenuItem.setEnabled(selectedTolvenPropertyInfo.getStatus() != PasswordRecoveryQuestionInfo.REMOVEPENDING); removeButton.setEnabled(selectedTolvenPropertyInfo.getStatus() != PasswordRecoveryQuestionInfo.REMOVEPENDING); removeMenuItem.setEnabled(selectedTolvenPropertyInfo.getStatus() != PasswordRecoveryQuestionInfo.REMOVEPENDING); } else { editButton.setEnabled(false); editMenuItem.setEnabled(false); removeButton.setEnabled(false); removeMenuItem.setEnabled(false); } importButton.setEnabled(true); exportButton.setEnabled(true && passwordRecoveryQuestionInfos.size() > 0); } private String getNestedMessage(Exception ex) { StringBuffer buff = new StringBuffer(); Throwable throwable = ex; do { buff.append(throwable.getMessage() + "\n"); throwable = throwable.getCause(); } while (throwable != null); return buff.toString(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); connectionStringTextField = new javax.swing.JTextField(); jPanel4 = new javax.swing.JPanel(); jLabel6 = new javax.swing.JLabel(); refreshButton = new javax.swing.JButton(); jScrollPane4 = new javax.swing.JScrollPane(); securityQuestionsTable = new javax.swing.JTable(); jPanel3 = new javax.swing.JPanel(); addButton = new javax.swing.JButton(); removeButton = new javax.swing.JButton(); importButton = new javax.swing.JButton(); exportButton = new javax.swing.JButton(); editButton = new javax.swing.JButton(); updateButton = new javax.swing.JButton(); jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel7.setText("Connection String:"); connectionStringTextField.setEditable(false); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(jLabel7) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(connectionStringTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 668, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel7) .add(connectionStringTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ); jLabel6.setText("Password Recovery Questions:"); refreshButton.setText("Refresh"); refreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { refreshButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(jLabel6) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 540, Short.MAX_VALUE) .add(refreshButton)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel6) .add(refreshButton)) ); securityQuestionsTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Password Recovery Question", "Status" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean [] { false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); securityQuestionsTable.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { securityQuestionsTableMouseClicked(evt); } }); jScrollPane4.setViewportView(securityQuestionsTable); addButton.setText("Add"); addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addButtonActionPerformed(evt); } }); removeButton.setText("Remove"); removeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeButtonActionPerformed(evt); } }); importButton.setText("Import"); importButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { importButtonActionPerformed(evt); } }); exportButton.setText("Export"); exportButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exportButtonActionPerformed(evt); } }); editButton.setText("Edit"); editButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editButtonActionPerformed(evt); } }); updateButton.setText("Update All Questions"); updateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { updateButtonActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(addButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(editButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(removeButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(importButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(exportButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 287, Short.MAX_VALUE) .add(updateButton)) ); jPanel3Layout.linkSize(new java.awt.Component[] {addButton, importButton}, org.jdesktop.layout.GroupLayout.HORIZONTAL); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(addButton) .add(editButton) .add(removeButton) .add(importButton) .add(exportButton) .add(updateButton)) ); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 761, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jScrollPane4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 525, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(16, 16, 16)) ); }// </editor-fold>//GEN-END:initComponents private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed try { add(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), getNestedMessage(ex)); } }//GEN-LAST:event_addButtonActionPerformed private void importButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importButtonActionPerformed try { importSecurityQuestions(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), getNestedMessage(ex)); } }//GEN-LAST:event_importButtonActionPerformed private void exportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportButtonActionPerformed int returnVal = chooser.showSaveDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { try { exportSecurityQuestions(chooser.getSelectedFile()); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), getNestedMessage(ex)); } } }//GEN-LAST:event_exportButtonActionPerformed private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed try { remove(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), getNestedMessage(ex)); } }//GEN-LAST:event_removeButtonActionPerformed private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed try { update(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), getNestedMessage(ex)); } }//GEN-LAST:event_updateButtonActionPerformed private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed try { refresh(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), getNestedMessage(ex)); } }//GEN-LAST:event_refreshButtonActionPerformed private void securityQuestionsTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_securityQuestionsTableMouseClicked try { if (evt.getClickCount() == 2 && securityQuestionsTable.getSelectedRow() != -1 && !startUpRefreshRequired && passwordRecoveryQuestionInfos.size() > 0) { edit(); } } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), getNestedMessage(ex)); } }//GEN-LAST:event_securityQuestionsTableMouseClicked private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed try { edit(); } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(getRootPane(), getNestedMessage(ex)); } }//GEN-LAST:event_editButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton addButton; private javax.swing.JTextField connectionStringTextField; private javax.swing.JButton editButton; private javax.swing.JButton exportButton; private javax.swing.JButton importButton; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JButton refreshButton; private javax.swing.JButton removeButton; private javax.swing.JTable securityQuestionsTable; private javax.swing.JButton updateButton; // End of variables declaration//GEN-END:variables }
[ "chrislomonico@21cf0891-b729-4dbf-aa24-92c9934df42b" ]
chrislomonico@21cf0891-b729-4dbf-aa24-92c9934df42b
a4531a8f930c3f4b76f79b265d24f473861fbae6
83d4be41cd6750935d2ad59d17c63822294a91ab
/Java/Fundamentals/Counter/src/main/java/com/john/counter/controllers/MainController.java
6a5a3d5e0cbba4380d9a649dd80ccba50ffed94e
[]
no_license
MyJPCoding/ClassProjects
d896fa3e9c5b6eb91a10d9064f052f9065f8ead2
b7d03f8001f0fb7f172f0f7c20e54c1dad3ee314
refs/heads/main
2023-02-19T12:13:49.356646
2021-01-20T22:36:11
2021-01-20T22:36:11
325,604,412
0
0
null
null
null
null
UTF-8
Java
false
false
703
java
package com.john.counter.controllers; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class MainController { @RequestMapping("/") public String index(HttpSession session) { session.setAttribute("count", 0); Integer count = (Integer) session.getAttribute("count"); return "index.jsp"; } @RequestMapping("/counter") public String counter(HttpSession session, Model model) { Integer count = (Integer) session.getAttribute("count"); model.addAttribute("count", count); return "counter.jsp"; } }
[ "noreply@github.com" ]
MyJPCoding.noreply@github.com
2be48383e2b9c6d36528ee29c29a9adc44b50c7e
f45722762576ede5e09c4d98c3dc7d5bb8c50635
/JavaRushTasks/1.JavaSyntax/src/com/javarush/task/task05/task0508/Person.java
58da2d07f40550bf24f46940d8cc4e134fb8358e
[]
no_license
alesur/JavaRush
10d99066a2bdd7c608325d34ef1749a315bbb3c6
bf304e49a927dc73248e63e78e9f656976c85c23
refs/heads/master
2020-09-13T16:57:19.068978
2019-11-20T04:21:50
2019-11-20T04:21:50
222,846,897
0
0
null
null
null
null
UTF-8
Java
false
false
622
java
package com.javarush.task.task05.task0508; /* ะ“ะตั‚ั‚ะตั€ั‹ ะธ ัะตั‚ั‚ะตั€ั‹ ะดะปั ะบะปะฐััะฐ Person */ public class Person { public String name; public int age; public char sex; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public char getSex() { return sex; } public void setSex(char sex) { this.sex = sex; } public static void main(String[] args) { } }
[ "aleksandr.surkov@outlook.com" ]
aleksandr.surkov@outlook.com
8a8ffb7d9a951f89c477ec403cadbf7196178bde
cc5709c8d3066a9b1a63bda3dbd37c7a75fbce63
/BlogNotes/src/main/java/Huawai/rotatArrat.java
1e29b129cc77a770e7b6fc808a7334e9fcf3e642
[]
no_license
wuhewuhe/AlgorithmeSource
f5e2ddf7ce07519edbce6fe997b8551792c1aa9e
faff66ca96cff806357c144983faa85dcefcecd7
refs/heads/master
2021-08-03T19:51:10.579605
2020-05-05T13:29:29
2020-05-05T13:29:29
223,817,068
0
0
null
2020-10-13T17:42:59
2019-11-24T22:04:34
Java
UTF-8
Java
false
false
516
java
package Huawai; import java.util.Arrays; import java.util.Scanner; public class rotatArrat { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (scan.hasNext()) { int n = scan.nextInt(); int m = scan.nextInt(); boolean sign = false; int sum = 0; for (int i = 1; i <= n; i++) { if (sign) { sum += i; } else { sum -= i; } if (i % m == 0) { sign = !sign; } } System.out.println(sum); } } // m^2 * (n/(2*m)) }
[ "dachichiwuhe@gmail.com" ]
dachichiwuhe@gmail.com
7f51db50543c4227e64d8cef45a2d2ed521da231
03a608a8b9568f631cf52c3522eeb5c779cf024a
/src/main/java/jpabook/jpashop/repository/order/query/OrderQueryDto.java
0eb9fb4690ae6336819c0cefbbcc8af24e805556
[]
no_license
bramhome5848/jpashop
7b72cbed121ffcac164043c95e49475f060c2daf
49fbcf9222035875c1f220830ab7d6a19d5f6d6a
refs/heads/master
2021-04-07T20:34:24.598512
2020-05-06T08:58:22
2020-05-06T08:58:22
248,706,734
0
0
null
null
null
null
UTF-8
Java
false
false
1,280
java
package jpabook.jpashop.repository.order.query; import com.fasterxml.jackson.annotation.JsonIgnore; import jpabook.jpashop.domain.Address; import jpabook.jpashop.domain.OrderStatus; import lombok.Data; import lombok.EqualsAndHashCode; import java.time.LocalDateTime; import java.util.List; @Data @EqualsAndHashCode(of = "orderId") //collect groupby ํ•  ๋•Œ ๊ธฐ์ค€์œผ๋กœ ๋ฌถ์–ด์คŒ public class OrderQueryDto { private Long orderId; private String name; private LocalDateTime orderDate; private OrderStatus orderStatus; private Address address; private List<OrderItemQueryDto> orderItems; public OrderQueryDto(Long orderId, String name, LocalDateTime orderDate, OrderStatus orderStatus, Address address) { this.orderId = orderId; this.name = name; this.orderDate = orderDate; this.orderStatus = orderStatus; this.address = address; } public OrderQueryDto(Long orderId, String name, LocalDateTime orderDate, OrderStatus orderStatus, Address address, List<OrderItemQueryDto> orderItems) { this.orderId = orderId; this.name = name; this.orderDate = orderDate; this.orderStatus = orderStatus; this.address = address; this.orderItems = orderItems; } }
[ "bramhome5848@gmail.com" ]
bramhome5848@gmail.com
8f959c231d174fada6c811ba50c82850d593e9ed
20591524b55c1ce671fd325cbe41bd9958fc6bbd
/service-consumer/src/main/java/com/rongdu/loans/credit/moxie/vo/bank/debitcard/DebitcardDebitcardUndueRegularBasisVO.java
a61d3f972bfaba8a79303d579ab7c4a1a50b6b3f
[]
no_license
ybak/loans-suniu
7659387eab42612fce7c0fa80181f2a2106db6e1
b8ab9bfa5ad8be38dc42c0e02b73179b11a491d5
refs/heads/master
2021-03-24T01:00:17.702884
2019-09-25T15:28:35
2019-09-25T15:28:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
package com.rongdu.loans.credit.moxie.vo.bank.debitcard; import java.io.Serializable; /** * 2.2 ๅ€Ÿ่ฎฐๅกๆœชๅˆฐๆœŸๅฎšๆœŸ่ฏฆๆƒ… ๏ผˆdebitcard_undue_regular_basis_list๏ผ‰ * * @author liuzhuang * */ public class DebitcardDebitcardUndueRegularBasisVO implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String cardId;// ๅกๅท 6214000012347654 private String balance;// ้‡‘้ข 4237.00 private String duedate;// ๅˆฐๆœŸๆ—ฅๆœŸ 2017-01-12 private String period;// ๆœŸๆ•ฐ 6 public String getCardId() { return cardId; } public void setCardId(String cardId) { this.cardId = cardId; } public String getBalance() { return balance; } public void setBalance(String balance) { this.balance = balance; } public String getDuedate() { return duedate; } public void setDuedate(String duedate) { this.duedate = duedate; } public String getPeriod() { return period; } public void setPeriod(String period) { this.period = period; } }
[ "tiramisuy18@163.com" ]
tiramisuy18@163.com
8177421b1fd53867ec6288da33ad144ec59173ed
0d6def871120e9f319adf763fb3f77d200eb039f
/leetcode/src/lc224/Solution.java
ee886c2738d22b2adc02cb91323d952610726c58
[]
no_license
whyuan/leetcode
a54508ee1396e5cf73f105d5a85246b331220b21
a2271b5a6c0f9f5c49c702ce110137918748dd9a
refs/heads/master
2020-12-25T14:14:13.026786
2016-12-01T16:20:03
2016-12-01T16:20:03
66,460,502
1
0
null
null
null
null
UTF-8
Java
false
false
2,566
java
package lc224; import java.util.*; public class Solution { public int calculate(String s) { Stack<Character> stack0 = new Stack<Character>(); Stack<String> stack1 = new Stack<String>(); int step = 0; char[] cs = s.toCharArray(); boolean isFirst = true; while (step < cs.length) { if (cs[step] >= '0' && cs[step] <= '9') { int step1 = step; while (step1<cs.length && cs[step1] >= '0' && cs[step1] <= '9') step1++; stack1.push(s.substring(step, step1)); step = step1; isFirst = false; } else if (cs[step] == '-' || cs[step] == '+') { if (isFirst) { isFirst = false; stack1.push("0"); } while (stack0.size() > 0 && (stack0.peek() == '-' || stack0.peek() == '+' || stack0.peek() == '*' || stack0.peek() == '/')) { stack1.push(Character.toString(stack0.pop())); } stack0.push(cs[step]); step++; } else if (cs[step] == '*' || cs[step] == '/') { while (stack0.size() > 0 && (stack0.peek() == '*' || stack0.peek() == '/')) { stack1.push(Character.toString(stack0.pop())); } stack0.push(cs[step]); step++; isFirst = false; } else if (cs[step] == '(') { stack0.push(cs[step]); step++; isFirst = true; } else if (cs[step] == ')') { while (stack0.size() > 0 && (stack0.peek() != '(')) { stack1.push(Character.toString(stack0.pop())); } stack0.pop(); step++; isFirst = false; } else { step++; } } while (stack0.size() > 0) { stack1.push(Character.toString(stack0.pop())); } Stack<String> stack2 = new Stack<String>(); while (stack1.size() > 0) { stack2.push(stack1.pop()); } Stack<Integer> stack3 = new Stack<Integer>(); while (stack2.size() > 0) { String top = stack2.pop(); if (top.equals("*")) { stack3.push(stack3.pop()*stack3.pop()); } else if (top.equals("/")) { Integer b = stack3.pop(); Integer a = stack3.pop(); stack3.push(a/b); } else if (top.equals("+")) { stack3.push(stack3.pop()+stack3.pop()); } else if (top.equals("-")) { Integer d = stack3.pop(); Integer c = stack3.pop(); stack3.push(c-d); } else { stack3.push(Integer.parseInt(top)); } } return stack3.pop(); } public static void main(String[] args) { } }
[ "519316166@qq.com" ]
519316166@qq.com
c390798826541151f22d89eb7f8325ea1dd959d6
4ca019d30f376af9cb4e97c4f80792c18772db1e
/PODM/SW/pod-manager/podm-external-services-api/src/main/java/com/intel/podm/client/api/resources/redfish/IpV6AddressPolicyObject.java
b7c260d20b8a56d6d303ec2c2438fe49fd2bbaf8
[ "Apache-2.0" ]
permissive
shingchuang/intelRSD
0f56a6bff3b71ba1ec2edbddb781b9eaaac8d1d7
a2939201dd4487acec88ca47657702378577c5cf
refs/heads/master
2021-01-23T01:50:55.150654
2017-03-23T10:35:15
2017-03-23T10:35:15
85,937,247
0
0
null
2017-03-23T10:31:41
2017-03-23T10:31:41
null
UTF-8
Java
false
false
822
java
/* * Copyright (c) 2015 Intel Corporation * * 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.intel.podm.client.api.resources.redfish; /** * IPv6 policy of IPv6 address. */ public interface IpV6AddressPolicyObject { String getPrefix(); Integer getPrecedence(); Integer getLabel(); }
[ "maciej.a.romanowski@intel.com" ]
maciej.a.romanowski@intel.com
5357860e3e98aade72f03d3720b78b5460ea5120
b7e3675f8a8a57caa63f8ae0fad39d2d723c7f41
/TPIAdmin/src/test/com/abc/tpi/db/TestDashboardServiceData.java
d000000c1f24a8698d0d9d07f5e808025df0ae71
[]
no_license
gouthamireddy13/EDISolution
04acc36e69c85256a1febc19970bcd51abf77328
bf7d9a4209f01a76e3c4347306eef1cfdae24059
refs/heads/master
2021-09-01T23:18:08.795848
2017-12-29T04:04:30
2017-12-29T04:04:30
115,682,453
0
0
null
null
null
null
UTF-8
Java
false
false
3,461
java
package com.abc.tpi.db; import java.util.List; import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.abc.dashboard.model.SdBusinessUnit; import com.abc.dashboard.model.SdServiceAccess; import com.abc.dashboard.model.SdServiceCategoryDef; import com.abc.dashboard.model.SdYesNo; import com.abc.dashboard.service.SdMasterDataService; import com.abc.dashboard.service.SdServiceCategoryService; import com.abc.tpi.model.service.ServiceCategory; import com.abc.tpi.model.tpp.LightWellPartner; @ContextConfiguration(locations={"classpath:application-contexttest.xml"}) @RunWith(SpringJUnit4ClassRunner.class) public class TestDashboardServiceData { public TestDashboardServiceData() { // TODO Auto-generated constructor stub } @Autowired SdServiceCategoryService sdServiceCategoryService; @Autowired SdMasterDataService sdMasterDataService; @Test @Transactional @Rollback(false) public void testAddNewSdServiceCategoryDef() { SdBusinessUnit bu = sdMasterDataService.findSdBusinessUnitByNameAndSubUnitName("ABSG", "Theracom"); SdServiceCategoryDef result = new SdServiceCategoryDef(); if (bu!=null) { result.setCategoryID(4); result.setPartnerSubscription(SdYesNo.Y); result.setServiceCategory(new ServiceCategory()); result.getServiceCategory().setName("test4"); LightWellPartner lw = new LightWellPartner(); lw.setActive(true); lw.setNotes("test notes"); lw.setOrganizationName("test 1"); lw.setProductionGsId("11111"); lw.setProductionIsaID("11111"); lw.setProductionIsaQualifier("PROD"); lw.setTestGsId("11111"); lw.setTestIsaID("11111"); lw.setTestIsaQualifier("TEST"); result.getServiceCategory().addLightWellPartner(lw); lw = new LightWellPartner(); lw.setActive(true); lw.setNotes("test notes2"); lw.setOrganizationName("test 2"); lw.setProductionGsId("22222"); lw.setProductionIsaID("22222"); lw.setProductionIsaQualifier("PROD"); lw.setTestGsId("22222"); lw.setTestIsaID("22222"); lw.setTestIsaQualifier("TEST"); result.getServiceCategory().addLightWellPartner(lw); result.setBusinessUnit(bu); result.setBusinessSubUnit(bu.getSubUnits().iterator().next()); } sdServiceCategoryService.saveSdServiceCategoryDef(result); } @Test @Transactional @Rollback(false) public void testAddNewSdServiceAccess() { SdServiceAccess result = new SdServiceAccess(); SdServiceCategoryDef serviceCategoryDef = sdServiceCategoryService.findSdServiceCategoryById(1); result.setServiceCategoryDef(serviceCategoryDef); result.setServiceType(sdMasterDataService.getAllServiceTypes().iterator().next()); result.setDestinationId("destination id"); result.setServicePreamble("service preamble"); result.setSourceId("source id"); sdServiceCategoryService.saveSdServiceAccess(result); } @Test public void testGetLightWellPartnersWithSdServiceCategoryMembership() { List<LightWellPartner> result = sdServiceCategoryService.getLightWellPartnersWithSdServiceCategoryMembership(); for (LightWellPartner ptnr : result) { System.out.println(ptnr.getProductionGsId()); } } }
[ "nagagouthami.b@LP-847BEB05C778.GEO.CORP.HCL.IN" ]
nagagouthami.b@LP-847BEB05C778.GEO.CORP.HCL.IN
07b8b5b7544f19afa846d5bd7e256b0db12aebf0
17e8438486cb3e3073966ca2c14956d3ba9209ea
/dso/tags/2.7.0-stable1/code/base/dso-l1-api/src/com/tc/object/logging/InstrumentationLogger.java
de9dad76ec8f9519a8e989ec27fa506aab9ee122
[]
no_license
sirinath/Terracotta
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
00a7662b9cf530dfdb43f2dd821fa559e998c892
refs/heads/master
2021-01-23T05:41:52.414211
2015-07-02T15:21:54
2015-07-02T15:21:54
38,613,711
1
0
null
null
null
null
UTF-8
Java
false
false
3,827
java
/* * All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved. */ package com.tc.object.logging; import com.tc.object.config.LockDefinition; import java.util.Collection; /** * Logging interface for the DSO class loading/adaption system */ public interface InstrumentationLogger { /////////////////////////////// // logging options /////////////////////////////// /** * Determine whether to log when a class is included for instrumentation (checked * before calls to {@link #classIncluded(String)}). * @return True if should log */ boolean getClassInclusion(); void setClassInclusion(boolean classInclusion); /** * Determine whether to log when a lock is inserted (checked before calls to * {@link #autolockInserted(String, String, String, LockDefinition)} or * {@link #lockInserted(String, String, String, LockDefinition[])}). * @return True if should log */ boolean getLockInsertion(); void setLockInsertion(boolean lockInsertion); /** * Determine whether to log when a root is inserted (checked before calls to * {@link #rootInserted(String, String, String, boolean)}). * @return True if should log */ boolean getRootInsertion(); void setRootInsertion(boolean rootInsertion); /** * Determine whether to log when a DMI call is inserted (checked before calls * to {@link #distMethodCallInserted(String, String, String)}). * @return True if should log */ boolean getDistMethodCallInsertion(); void setDistMethodCallInsertion(boolean distMethodClassInsertion); /** * Determine whether to log transient root warnings (checked before calls to * {@link #transientRootWarning(String, String)). * @return True if should log */ boolean getTransientRootWarning(); void setTransientRootWarning(boolean transientRootWarning); /////////////////////////////// // log methods /////////////////////////////// /** * Log class that is being instrumented * @param className Class name */ void classIncluded(String className); /** * Log that auto lock was inserted * @param className The class name * @param methodName The method name * @param methodDesc Method descriptor * @param lockDef The lock definition */ void autolockInserted(String className, String methodName, String methodDesc, LockDefinition lockDef); /** * Log that lock was inserted * @param className The class name * @param methodName The method name * @param methodDesc Method descriptor * @param locks The lock definitions */ void lockInserted(String className, String methodName, String methodDesc, LockDefinition[] locks); /** * Log that a subclass of a logically managed class cannot be instrumented * @param className The class * @param logicalSuperClasses All logical super classes that prevent className from being instrumented */ void subclassOfLogicallyManagedClasses(String className, Collection logicalSuperClasses); /** * Log that the transient property is being ignored for a root * @param className Class name * @param fieldName Transient field name */ void transientRootWarning(String className, String fieldName); /** * Log that a root was inserted * @param className The class name * @param fieldName The root field * @param desc Method descriptor * @param isStatic True if static root */ void rootInserted(String className, String fieldName, String desc, boolean isStatic); /** * Log that a DMI call was inserted. * @param className The class name * @param methodName The method name * @param desc The method descriptor */ void distMethodCallInserted(String className, String methodName, String desc); }
[ "hhuynh@7fc7bbf3-cf45-46d4-be06-341739edd864" ]
hhuynh@7fc7bbf3-cf45-46d4-be06-341739edd864
dfdac262b0d29284f519122cf401ac8666f154e0
694a3a07bd25005ef2c933134d314b3543f8c196
/src/main/java/top/lzmvlog/authority/model/vo/MenuTree.java
3922223d224d3b75708d89bdd3cf131c625fe048
[]
no_license
lzmvlog/authority
41851be8154a80fc02c60b7b89724dc3a05f0a05
3e1b00304964e79ec05c6888da53a7d46c11484e
refs/heads/master
2023-06-24T05:18:47.671925
2020-12-20T14:55:01
2020-12-20T14:55:01
280,383,570
2
0
null
2023-06-14T22:41:52
2020-07-17T09:28:13
Java
UTF-8
Java
false
false
586
java
package top.lzmvlog.authority.model.vo; import lombok.Data; import java.util.ArrayList; import java.util.List; /** * @author ShaoJie zhang1591313226@163.com * @Date 2020ๅนด12ๆœˆ17ๆ—ฅ 14:48 * @Description: */ @Data public class MenuTree { /** * ่œๅ•id */ private String id; /** * ็ˆถ่œๅ•ๅ็งฐ */ private String menuName; /** * ็ˆถ็บง่œๅ•id */ private String parentId; /** * ่œๅ•ๅ›พๆ ‡ */ private String icon; /** * ๅญ้ƒจ้—จ */ private List<?> children = new ArrayList<>(); }
[ "zhang1591313226@163.com" ]
zhang1591313226@163.com