blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
814f92048fd9b2a07a7541138a3013929888919b
12e891899ed38a1aa9246d70a1e10612d81ccb74
/app/src/test/java/com/nehar5383/itunes/ExampleUnitTest.java
8f3d5a88b428b57ececd3d852890cb654dc4bb9e
[]
no_license
nehar53/RestApi_Retrofit
d5b6ebf4ce33a191037cf6a3f3fb595ab6d55cba
9ae0353bf10dcc40ab2e8f3239acfac910bf7de4
refs/heads/main
2023-02-01T00:41:53.181964
2020-12-16T11:08:41
2020-12-16T11:08:41
321,955,395
0
0
null
null
null
null
UTF-8
Java
false
false
381
java
package com.nehar5383.itunes; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "nehar5383@users.noreply.github.com" ]
nehar5383@users.noreply.github.com
c1c771d547bfec7647cd275d3378f6dbb9000657
c8b6c5ab47c8075f29fdd9d84c0a561b1e2582a4
/SixthAssignment/app/src/test/java/com/example/shaloin/sixthassignmenta/ExampleUnitTest.java
0f44924246a15cb1187cb2cb8d746ec53812dc35
[]
no_license
Pritom14/Assignment6.1
264f5e1f302486657cf9d34c722691d38caca858
13547dfe38ae8470481c641aa3ded25478919fc7
refs/heads/master
2021-01-12T11:28:57.152546
2016-11-05T15:41:44
2016-11-05T15:41:44
72,935,432
0
0
null
null
null
null
UTF-8
Java
false
false
414
java
package com.example.shaloin.sixthassignmenta; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "pritommazumdar1995@gmail.com" ]
pritommazumdar1995@gmail.com
ef83cdb5ab377d5a18bca3331d25cf57e381da8b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/26/26_4ab80e33f2b83f581e2935526e4252b8a6e39b71/MarketDataIB/26_4ab80e33f2b83f581e2935526e4252b8a6e39b71_MarketDataIB_t.java
4c976a1179572c37559bc161899c555342735c4c
[]
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
7,125
java
package com.fhx.strategy.java; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Hashtable; import java.util.List; import java.util.Properties; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.marketcetera.event.AskEvent; import org.marketcetera.event.BidEvent; import org.marketcetera.event.TradeEvent; import org.marketcetera.marketdata.MarketDataRequest; import org.marketcetera.marketdata.MarketDataRequest.Content; import org.marketcetera.marketdata.interactivebrokers.LatestMarketData; import org.marketcetera.strategy.java.Strategy; import com.fhx.util.StatStreamUtil; /** * Strategy that receives IB market data * * @author * @version $Id$ * @since $Release$ */ public class MarketDataIB extends Strategy { private static Logger log = Logger.getLogger(MarketDataIB.class); private final Properties config = new Properties(); private static final String MARKET_DATA_PROVIDER = "interactivebrokers"; private static SimpleDateFormat marketTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); private List<String> symbolList = new ArrayList<String>(); // contains the latest market data for subscribed symbols private Hashtable<String, LatestMarketData> latestDataCache=new Hashtable<String, LatestMarketData>(); private BlockingQueue<Hashtable<String, LatestMarketData>> mdQueue; private MarketDataHandler mdHandle; private int tickFrequency = Integer.parseInt(System.getProperty("tickFrequency", "1")); // in seconds private static final ExecutorService sNotifierPool = Executors.newCachedThreadPool(); private AtomicLong tickCount = new AtomicLong(0); /** * Executed when the strategy is started. * Use this method to set up data flows * and other initialization tasks. */ @Override public void onStart() { PropertyConfigurator.configure("conf/log4j.properties"); try { config.load(new FileInputStream("conf/statstream.properties")); } catch (FileNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } symbolList = StatStreamUtil.getAllSymbols(config); // create market data object for each symbol StringBuilder sb = new StringBuilder(); for (String symbol : symbolList) { latestDataCache.put(symbol, new LatestMarketData(symbol)); sb.append(symbol); sb.append(","); } String symbolStr = sb.replace(sb.lastIndexOf(","), sb.length(), "").toString(); log.info("XXXX Subscribing to market data for symbols: " + symbolStr); // this goes to metc logs warn("XXXX Subscribed symbols: "+Arrays.toString(symbolList.toArray())); // send update to work thread every 5 seconds ScheduledThreadPoolExecutor stpe = new ScheduledThreadPoolExecutor(2); this.mdQueue = new LinkedBlockingQueue<Hashtable<String, LatestMarketData>>(); mdHandle = new MarketDataHandler(symbolList, mdQueue); log.info("Starting market data processing thread..."); sNotifierPool.submit(new Runnable() { public void run() { try { mdHandle.run(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); log.info("Start the market data update thread..."); stpe.scheduleAtFixedRate(new Runnable() { @Override public void run() { try { mdQueue.put(latestDataCache); } catch (InterruptedException e) { e.printStackTrace(); } } }, 0, tickFrequency, TimeUnit.SECONDS); log.info("XXXX calling requestMarketData(): "); requestMarketData(MarketDataRequest.newRequest(). withSymbols(symbolStr). fromProvider(MARKET_DATA_PROVIDER). withContent(Content.LATEST_TICK, Content.TOP_OF_BOOK)); } /** * Executed when the strategy receives an ask event. * * @param inAsk the ask event. */ @Override public void onAsk(AskEvent inAsk) { warn("Ask " + inAsk); tickCount.getAndIncrement(); LatestMarketData data = latestDataCache.get(inAsk.getSymbolAsString()); data.setOfferPrice(inAsk.getPrice()); data.setTime(inAsk.getTimestampAsDate()); } /** * Executed when the strategy receives a bid event. * * @param inBid the bid event. */ @Override public void onBid(BidEvent inBid) { tickCount.getAndIncrement(); warn("Bid " + inBid); LatestMarketData data = latestDataCache.get(inBid.getSymbolAsString()); data.setBidPrice(inBid.getPrice()); data.setTime(inBid.getTimestampAsDate()); } /** * Executed when the strategy receives a trade event. * * @param inTrade the ask event. */ @Override public void onTrade(TradeEvent inTrade) { warn("Trade " + inTrade); //System.out.println("xxxx Trade 1 " + inTrade); LatestMarketData data = latestDataCache.get(inTrade.getSymbolAsString()); data.setTradePrice(inTrade.getPrice()); data.setTradeSize(data.getLastestTrade().getSize().add(inTrade.getSize())); data.setTime(inTrade.getTimestampAsDate()); //latestData.put(inTrade.getSymbolAsString(), data); tickCount.getAndIncrement(); if (tickCount.get() % 100000 ==0) { String symbol= inTrade.getSymbolAsString(); StringBuilder sb = new StringBuilder(); sb.append("XXXX onTrade: "); sb.append(symbol); sb.append(","); sb.append(inTrade.getMessageId()); sb.append(","); sb.append(inTrade.getPrice().setScale(4)); sb.append(","); sb.append(inTrade.getSize()); sb.append(","); sb.append(marketTimeFormat.format(inTrade.getTimestampAsDate())); sb.append("\n"); log.info("XXXX onTrade= " + tickCount.get() + " | "+ sb.toString()); } } @Override public void onOther(Object inEvent) { warn("onOther" +inEvent); log.info("XXXX: onOther="+ inEvent); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9e9bc05fad399f3e67b2268137795f2e78c66b7a
5af39c1f081df0128daf1511f8ba83cef02e6c8b
/src/main/java/pl/swislowski/kamil/javaee/programowanieZdarzeniowe/faktura/training01/AddPozycjaFakturaJPanel.java
99ab278a9dccb5b6c255286c8dba246ea4929c98
[]
no_license
qamilus/java-ee
29eb72849a4f80c642766b125cc4a666dd327f2a
90889a5e6f2b4e16ae32a410c05ee0ad5f813ee5
refs/heads/master
2020-03-31T20:52:29.588870
2019-02-17T09:38:08
2019-02-17T09:38:08
152,558,762
0
0
null
null
null
null
UTF-8
Java
false
false
2,157
java
package pl.swislowski.kamil.javaee.programowanieZdarzeniowe.faktura.training01; import javax.swing.*; public class AddPozycjaFakturaJPanel extends JPanel { private AddFakturaJPanel addFakturaJPanel; private AddPozycjaFakturaJDialog addPozycjaFakturaJDialog; public AddPozycjaFakturaJPanel(AddFakturaJPanel addFakturaJPanel, AddPozycjaFakturaJDialog addPozycjaFakturaJDialog){ this.addFakturaJPanel = addFakturaJPanel; this.addPozycjaFakturaJDialog = addPozycjaFakturaJDialog; initializeComponents(); } private void initializeComponents() { JLabel nameJLabel = new JLabel("Nazwa: "); JTextField nameJTextField = new JTextField(); nameJTextField.setColumns(8); JLabel miaraJLabel = new JLabel("Miara: "); JTextField miaraJTextField = new JTextField(); miaraJTextField.setColumns(8); JLabel iloscJLabel = new JLabel("Ilosc: "); JTextField iloscJTextField = new JTextField(); iloscJTextField.setColumns(8); JLabel cenaJLabel = new JLabel("Cena: "); JTextField cenaJTextField = new JTextField(); cenaJTextField.setColumns(8); JLabel podatekJLabel = new JLabel("Podatek: "); JTextField podatekJTextField = new JTextField(); podatekJTextField.setColumns(8); JButton saveJButton = new JButton("Zapisz"); saveJButton.addActionListener(e->{ System.out.println("Zapisuję nową pozycję..."); this.addFakturaJPanel.addPozycjaFakturyOnList( nameJTextField.getText(), null, Double.valueOf(iloscJTextField.getText()), Double.valueOf(cenaJTextField.getText()), null); this.addPozycjaFakturaJDialog.setVisible(false); }); add(nameJLabel); add(nameJTextField); add(miaraJLabel); add(miaraJTextField); add(iloscJLabel); add(iloscJTextField); add(cenaJLabel); add(cenaJTextField); add(podatekJLabel); add(podatekJTextField); add(saveJButton); } }
[ "kamil.swislowski@gmail.com" ]
kamil.swislowski@gmail.com
a7557869f2affd8b559ccad3e38b6f4aa3b45749
df55153863a475d76bd3e440eaa5f3ada3b078dd
/java/engine/org/apache/derby/diag/StatementCache.java
72c9964d6aa70500d3a7ebad9e593ce401a61362
[]
no_license
lpxz/grail-derby-10.3.2.1
58d183be60418c041b9966bd337e4cd2d23459e7
7ac623f816d9562a1f8e2890b83e5f80d8b3d06d
refs/heads/master
2016-09-05T17:46:20.070401
2013-11-23T17:35:13
2013-11-23T17:35:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,303
java
/* Derby - Class org.apache.derby.diag.StatementCache 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.derby.diag; import java.io.InputStream; import java.io.Reader; import java.sql.NClob; import java.sql.ResultSetMetaData; import java.sql.RowId; import java.sql.SQLException; import java.sql.SQLXML; import java.sql.Timestamp; import java.sql.Types; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Vector; import org.apache.derby.iapi.reference.Limits; import org.apache.derby.iapi.services.cache.CacheManager; import org.apache.derby.iapi.sql.ResultColumnDescriptor; import org.apache.derby.iapi.sql.conn.ConnectionUtil; import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; import org.apache.derby.iapi.util.StringUtil; import org.apache.derby.impl.jdbc.EmbedResultSetMetaData; import org.apache.derby.impl.sql.GenericPreparedStatement; import org.apache.derby.impl.sql.GenericStatement; import org.apache.derby.impl.sql.conn.CachedStatement; import org.apache.derby.vti.VTITemplate; /** StatementCache is a virtual table that shows the contents of the SQL statement cache. This virtual table can be invoked by calling it directly. <PRE> select * from new org.apache.derby.diag.StatementCache() t</PRE> <P>The StatementCache virtual table has the following columns: <UL> <LI> ID CHAR(36) - not nullable. Internal identifier of the compiled statement. <LI> SCHEMANAME VARCHAR(128) - nullable. Schema the statement was compiled in. <LI> SQL_TEXT VARCHAR(32672) - not nullable. Text of the statement <LI> UNICODE BIT/BOOLEAN - not nullable. True if the statement is compiled as a pure unicode string, false if it handled unicode escapes. <LI> VALID BIT/BOOLEAN - not nullable. True if the statement is currently valid, false otherwise <LI> COMPILED_AT TIMESTAMP nullable - time statement was compiled, requires STATISTICS TIMING to be enabled. </UL> <P> The internal identifier of a cached statement matches the toString() method of a PreparedStatement object for a Derby database. <P> This class also provides a static method to empty the statement cache, StatementCache.emptyCache() */ public final class StatementCache extends VTITemplate { private int position = -1; private Vector data; private GenericPreparedStatement currentPs; private boolean wasNull; public StatementCache() throws SQLException { LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC(); CacheManager statementCache = lcc.getLanguageConnectionFactory().getStatementCache(); if (statementCache != null) { final Collection values = statementCache.values(); data = new Vector(values.size()); for (Iterator i = values.iterator(); i.hasNext(); ) { final CachedStatement cs = (CachedStatement) i.next(); final GenericPreparedStatement ps = (GenericPreparedStatement) cs.getPreparedStatement(); data.addElement(ps); } } } public boolean next() { if (data == null) return false; position++; for (; position < data.size(); position++) { currentPs = (GenericPreparedStatement) data.elementAt(position); if (currentPs != null) return true; } data = null; return false; } public void close() { data = null; currentPs = null; } public String getString(int colId) { wasNull = false; switch (colId) { case 1: return currentPs.getObjectName(); case 2: return ((GenericStatement) currentPs.statement).getCompilationSchema(); case 3: String sql = currentPs.getSource(); sql = StringUtil.truncate(sql, Limits.DB2_VARCHAR_MAXWIDTH); return sql; default: return null; } } public boolean getBoolean(int colId) { wasNull = false; switch (colId) { case 4: // was/is UniCode column, but since Derby 10.0 all // statements are compiled and submitted as UniCode. return true; case 5: return currentPs.isValid(); default: return false; } } public Timestamp getTimestamp(int colId) { Timestamp ts = currentPs.getEndCompileTimestamp(); wasNull = (ts == null); return ts; } public boolean wasNull() { return wasNull; } /* ** Metadata */ private static final ResultColumnDescriptor[] columnInfo = { EmbedResultSetMetaData.getResultColumnDescriptor("ID", Types.CHAR, false, 36), EmbedResultSetMetaData.getResultColumnDescriptor("SCHEMANAME", Types.VARCHAR, true, 128), EmbedResultSetMetaData.getResultColumnDescriptor("SQL_TEXT", Types.VARCHAR, false, Limits.DB2_VARCHAR_MAXWIDTH), EmbedResultSetMetaData.getResultColumnDescriptor("UNICODE", Types.BIT, false), EmbedResultSetMetaData.getResultColumnDescriptor("VALID", Types.BIT, false), EmbedResultSetMetaData.getResultColumnDescriptor("COMPILED_AT", Types.TIMESTAMP, true), }; private static final ResultSetMetaData metadata = new EmbedResultSetMetaData(columnInfo); public ResultSetMetaData getMetaData() { return metadata; } public int getHoldability() throws SQLException { // TODO Auto-generated method stub return 0; } public Reader getNCharacterStream(int columnIndex) throws SQLException { // TODO Auto-generated method stub return null; } public Reader getNCharacterStream(String columnLabel) throws SQLException { // TODO Auto-generated method stub return null; } public NClob getNClob(int columnIndex) throws SQLException { // TODO Auto-generated method stub return null; } public NClob getNClob(String columnLabel) throws SQLException { // TODO Auto-generated method stub return null; } public String getNString(int columnIndex) throws SQLException { // TODO Auto-generated method stub return null; } public String getNString(String columnLabel) throws SQLException { // TODO Auto-generated method stub return null; } public RowId getRowId(int columnIndex) throws SQLException { // TODO Auto-generated method stub return null; } public RowId getRowId(String columnLabel) throws SQLException { // TODO Auto-generated method stub return null; } public SQLXML getSQLXML(int columnIndex) throws SQLException { // TODO Auto-generated method stub return null; } public SQLXML getSQLXML(String columnLabel) throws SQLException { // TODO Auto-generated method stub return null; } public boolean isClosed() throws SQLException { // TODO Auto-generated method stub return false; } public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { // TODO Auto-generated method stub } public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { // TODO Auto-generated method stub } public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { // TODO Auto-generated method stub } public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { // TODO Auto-generated method stub } public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { // TODO Auto-generated method stub } public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { // TODO Auto-generated method stub } public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { // TODO Auto-generated method stub } public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { // TODO Auto-generated method stub } public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { // TODO Auto-generated method stub } public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { // TODO Auto-generated method stub } public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { // TODO Auto-generated method stub } public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { // TODO Auto-generated method stub } public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { // TODO Auto-generated method stub } public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { // TODO Auto-generated method stub } public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { // TODO Auto-generated method stub } public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { // TODO Auto-generated method stub } public void updateClob(int columnIndex, Reader reader) throws SQLException { // TODO Auto-generated method stub } public void updateClob(String columnLabel, Reader reader) throws SQLException { // TODO Auto-generated method stub } public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { // TODO Auto-generated method stub } public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { // TODO Auto-generated method stub } public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { // TODO Auto-generated method stub } public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { // TODO Auto-generated method stub } public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { // TODO Auto-generated method stub } public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { // TODO Auto-generated method stub } public void updateNClob(int columnIndex, NClob clob) throws SQLException { // TODO Auto-generated method stub } public void updateNClob(String columnLabel, NClob clob) throws SQLException { // TODO Auto-generated method stub } public void updateNClob(int columnIndex, Reader reader) throws SQLException { // TODO Auto-generated method stub } public void updateNClob(String columnLabel, Reader reader) throws SQLException { // TODO Auto-generated method stub } public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { // TODO Auto-generated method stub } public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { // TODO Auto-generated method stub } public void updateNString(int columnIndex, String string) throws SQLException { // TODO Auto-generated method stub } public void updateNString(String columnLabel, String string) throws SQLException { // TODO Auto-generated method stub } public void updateRowId(int columnIndex, RowId x) throws SQLException { // TODO Auto-generated method stub } public void updateRowId(String columnLabel, RowId x) throws SQLException { // TODO Auto-generated method stub } public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { // TODO Auto-generated method stub } public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { // TODO Auto-generated method stub } public boolean isWrapperFor(Class<?> iface) throws SQLException { // TODO Auto-generated method stub return false; } public <T> T unwrap(Class<T> iface) throws SQLException { // TODO Auto-generated method stub return null; } }
[ "lpxz@chcpu2.cs.ust.hk" ]
lpxz@chcpu2.cs.ust.hk
1238ec87f9ab38b5f7063873e525f87af7368645
88885baab901a722813101a8795bc6abd64692ad
/287.寻找重复数.java
30e181f3d0459603dff8a5b27e3a84c9d6a7bd59
[]
no_license
tongluyang/leetcode
31f14abaed956fad5198207c1b6c29413955d2b4
08339d13e82126d94ddabe0132e6630a9c0f60dc
refs/heads/master
2021-06-24T21:07:11.577441
2020-12-30T12:13:48
2020-12-30T12:13:48
191,535,505
4
1
null
null
null
null
UTF-8
Java
false
false
1,382
java
/* * @lc app=leetcode.cn id=287 lang=java * * [287] 寻找重复数 * * https://leetcode-cn.com/problems/find-the-duplicate-number/description/ * * algorithms * Medium (60.34%) * Likes: 375 * Dislikes: 0 * Total Accepted: 31.1K * Total Submissions: 49.9K * Testcase Example: '[1,3,4,2,2]' * * 给定一个包含 n + 1 个整数的数组 nums,其数字都在 1 到 n 之间(包括 1 和 * n),可知至少存在一个重复的整数。假设只有一个重复的整数,找出这个重复的数。 * * 示例 1: * * 输入: [1,3,4,2,2] * 输出: 2 * * * 示例 2: * * 输入: [3,1,3,4,2] * 输出: 3 * * * 说明: * * * 不能更改原数组(假设数组是只读的)。 * 只能使用额外的 O(1) 的空间。 * 时间复杂度小于 O(n^2) 。 * 数组中只有一个重复的数字,但它可能不止重复出现一次。 * * */ // @lc code=start class Solution { public int findDuplicate(int[] nums) { int ps = 0; int pf = 0; while (true) { ps = nums[ps]; pf = nums[nums[pf]]; if (ps == pf) { pf = 0; while (nums[ps] != nums[pf]) { ps = nums[ps]; pf = nums[pf]; } return nums[ps]; } } } } // @lc code=end
[ "tongluyang@gmail.com" ]
tongluyang@gmail.com
0a0b7b7bca5351f428f99eee23a2ce3997a12373
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/11/11_397120526dfb1aa382a662ae6cefe6ac53c196d0/WebMvcConfig/11_397120526dfb1aa382a662ae6cefe6ac53c196d0_WebMvcConfig_t.java
c5d8dbaa48d824dfa9678188c6e173092e7e2f9c
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,561
java
package ${package}.config; import org.springframework.context.annotation.*; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.view.tiles2.TilesConfigurer; import org.springframework.web.servlet.view.tiles2.TilesViewResolver; @Configuration @EnableWebMvc @ComponentScan(basePackages = { "${package}" }, excludeFilters = @Filter(type = FilterType.ANNOTATION, value = Configuration.class)) @Import(PersistenceConfig.class) public class WebMvcConfig extends WebMvcConfigurerAdapter { private static final String TILES = "/WEB-INF/tiles/tiles.xml"; private static final String VIEWS = "/WEB-INF/views/**/views.xml"; private static final String RESOURCES_HANDLER = "/resources/"; private static final String RESOURCES_LOCATION = RESOURCES_HANDLER + "**"; @Bean public TilesViewResolver configureTilesViewResolver() { return new TilesViewResolver(); } @Bean public TilesConfigurer configureTilesConfigurer() { TilesConfigurer configurer = new TilesConfigurer(); configurer.setDefinitions(new String[] {TILES, VIEWS}); return configurer; } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler(RESOURCES_HANDLER).addResourceLocations(RESOURCES_LOCATION); } @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { configurer.enable(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c5bd806df4b9fdd0d1a041fe9aa52870d7fc51ff
8c4ab8f04402f12edb36820acc44ee301b3e808f
/synonymRev/src/main/java/vldb17/GreedyValidatorOriginal.java
5f28abd7cd877566a22b874a8b4b40ba055565a4
[]
no_license
skh11720/string_synonyms-code
9b34ab5ebcf79230dca4cbbc8b230ea94b99f9be
ae9a912de8faf7e2006023e4af2c8a5023ad8a83
refs/heads/master
2023-02-11T11:40:01.117063
2019-05-02T01:21:47
2019-05-02T01:21:47
296,189,858
0
0
null
null
null
null
UTF-8
Java
false
false
8,118
java
package vldb17; import java.util.Arrays; import java.util.List; import java.util.Set; import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import snu.kdd.synonym.synonymRev.data.Record; import snu.kdd.synonym.synonymRev.data.Rule; import snu.kdd.synonym.synonymRev.tools.StatContainer; import snu.kdd.synonym.synonymRev.tools.Util; import snu.kdd.synonym.synonymRev.validator.Validator; import vldb17.set.JoinPkduckOriginal; public class GreedyValidatorOriginal extends Validator{ private long nCorrect = 0; private final double theta; private final static Boolean getTime = false; private final static Boolean debugPrint = false; public long ts; public long totalTime = 0; public long ruleCopyTime = 0; public long computeScoreTime = 0; public long bestRuleTime = 0; public long removeRuleTime = 0; public long bTransformTime = 0; public long reconstTime = 0; public long compareTime = 0; private static final boolean debug_print_transform = false; public GreedyValidatorOriginal(double theta) { this.theta = theta; } @Override public int isEqual( Record x, Record y ) { /* * -1: not equivalent * 0: exactly same * 1: equivalent, x -> y * 2: equivalent, y -> x */ ++checked; ts = System.nanoTime(); int res; if( areSameString( x, y )) res = 0; else { double simx2y = getSimL2R( x, y, false ); if ( simx2y >= theta ) res = 1; // else { // double simy2x = getSimL2R( y, x, false ); // if ( simy2x >= theta ) res = 2; // else res = -1; // } else res = -1; } totalTime += System.nanoTime() - ts; // print output for debugging if ( debug_print_transform && (res == 1 || res == 2) ) { JoinPkduckOriginal.pw.println(x.getID() +"\t" + x.toString()+"\t"+Arrays.toString(x.getTokensArray())+"\n"+y.getID()+"\t"+y.toString()+"\t"+Arrays.toString(y.getTokensArray())); if ( res == 1 ) getSimL2R( x, y, true ); // else getSimL2R( y, x, true ); } return res; } public double getSimL2R( Record x, Record y, boolean expPrint ) { if ( expPrint ) { JoinPkduckOriginal.pw.println(x.getID()+" -> "+y.getID()); } // Make a copy of applicable rules to x. List<PosRule> candidateRules = new ObjectArrayList<PosRule>( x.getNumApplicableRules() ); for (int i=0; i<x.size(); i++) { for (Rule rule : x.getSuffixApplicableRules( i )) { if ( rule.isSelfRule() ) continue; candidateRules.add( new PosRule(rule, i) ); if (expPrint) JoinPkduckOriginal.pw.println("cand rule: "+rule+"\t"+i); } } if (getTime) ruleCopyTime += System.nanoTime() - ts; Boolean[] bAvailable = new Boolean[x.size()]; Arrays.fill( bAvailable, true ); Boolean bTransformedAll = false; Set<Integer> tokenSet = new IntOpenHashSet( y.getTokensArray() ); Set<PosRule> appliedRuleSet = new ObjectOpenHashSet<PosRule>(); while ( candidateRules.size() > 0 ) { if (getTime) ts = System.nanoTime(); if (debugPrint) System.out.println( "loop start" ); if (debugPrint) System.out.println( "bAvailable: "+Arrays.toString( bAvailable ) ); // Compute scores of the remaining candidate rules. float bestScore = 0; int bestRuleIdx = -1; for (int i=0; i<candidateRules.size(); i++) { PosRule rule = candidateRules.get( i ); float score = 0; for (Integer token : rule.getRight()) { if ( tokenSet.contains( token ) ) score++; } score /= rule.rightSize(); if (score > bestScore) { bestScore = score; bestRuleIdx = i; } if (debugPrint) System.out.println( rule.rule.toOriginalString(Record.tokenIndex)+"\t"+rule.pos+"\t"+score+"\t"+bestScore+"\t"+bestRuleIdx ); if (bestScore == 1) break; } if (getTime) { computeScoreTime += System.nanoTime() - ts; ts = System.nanoTime(); } if (bestScore == 0) break; // Apply a rule with the largest score. PosRule bestRule = candidateRules.get( bestRuleIdx ); for (int j=0; j<bestRule.leftSize(); j++) bAvailable[bestRule.pos-j] = false; candidateRules.remove( bestRuleIdx ); appliedRuleSet.add( bestRule ); if ( expPrint && !bestRule.rule.isSelfRule() ) JoinPkduckOriginal.pw.println( "APPLY"+(bestRule.rule.isSelfRule()?"":"*")+": "+bestRule.rule.toOriginalString(Record.tokenIndex)); if (getTime) { bestRuleTime += System.nanoTime() - ts; ts = System.nanoTime(); } // Update the remaining token set. for (Integer token : bestRule.getRight()) tokenSet.remove( token ); // If the rule is not applicable anymore, remove it. for (int i=0; i<candidateRules.size(); i++) { PosRule rule = candidateRules.get( i ); Boolean isValid = true; for (int j=0; j<rule.leftSize(); j++) isValid &= bAvailable[rule.pos-j]; if (!isValid) candidateRules.remove( i-- ); } if (getTime) { removeRuleTime += System.nanoTime() - ts; ts = System.nanoTime(); } // Update bTransformedAll. bTransformedAll = true; for (int i=0; i<x.size(); i++) bTransformedAll &= !bAvailable[i]; if (debugPrint) System.out.println( "bTransformedAll: "+bTransformedAll ); if (getTime) { bTransformTime += System.nanoTime() - ts; ts = System.nanoTime(); } } // end while // Construct the transformed string. int transformedSize = (int)(Arrays.stream(bAvailable).filter(b -> b).count()); for (PosRule rule : appliedRuleSet) transformedSize += rule.rightSize(); int[] transformedRecord = new int[transformedSize]; if (debugPrint) { System.out.println( "transformedSize: "+transformedSize ); for (PosRule rule : appliedRuleSet) { System.out.println( rule.rule.toOriginalString(Record.tokenIndex)+", "+rule.pos ); } } if (expPrint) { for (PosRule rule : appliedRuleSet) { JoinPkduckOriginal.pw.println( rule.rule+", "+rule.pos ); } } for (int i=x.size()-1, j=transformedSize-1; i>=0;) { boolean isTransformed = false; for (PosRule rule : appliedRuleSet) { if ( rule.pos == i ) { if (debugPrint) System.out.println( rule.rule.toOriginalString(Record.tokenIndex)+", "+rule.pos ); for (int k=0; k<rule.rightSize(); k++) { if (debugPrint) System.out.println( i+"\t"+j+"\t"+k+"\t"+(j-k)+"\t"+(rule.rightSize()-k-1) ); transformedRecord[j-k] = rule.getRight()[rule.rightSize()-k-1]; } i -= rule.leftSize(); j -= rule.rightSize(); isTransformed = true; break; } } if (!isTransformed) { transformedRecord[j] = x.getTokensArray()[i]; --i; --j; } } if (getTime) { reconstTime += System.nanoTime() - ts; ts = System.nanoTime(); } if (debugPrint) System.out.println( Arrays.toString( transformedRecord ) ); if (expPrint) JoinPkduckOriginal.pw.println("transformed: "+(new Record(transformedRecord)).toString(Record.tokenIndex)); IntOpenHashSet setTrans = new IntOpenHashSet(transformedRecord); IntOpenHashSet setY = new IntOpenHashSet(y.getTokens()); double sim = Util.jaccard( transformedRecord, y.getTokensArray()); if ( expPrint ) { JoinPkduckOriginal.pw.println("SIM: "+sim); JoinPkduckOriginal.pw.flush(); } if (getTime) { compareTime += System.nanoTime() - ts; ts = System.nanoTime(); } return sim; } // public int isEqual( Record x, Record y, Boolean bIsEqual ) { // int res = isEqual(x, y); // if (bIsEqual && res>=0) nCorrect++; // return res; // } @Override public void addStat( StatContainer stat ) { super.addStat( stat ); stat.add( "Val_Correct_pair", nCorrect ); } @Override public String getName() { return "GreedyValidatorOriginal"; } private class PosRule { public Rule rule; public int pos; public PosRule( Rule rule, int pos ) { this.rule = rule; this.pos = pos; } public int leftSize() { return rule.leftSize(); } public int rightSize() { return rule.rightSize(); } public int[] getLeft() { return rule.getLeft(); } public int[] getRight() { return rule.getRight(); } @Override public int hashCode() { return rule.hashCode(); } } }
[ "ghsong@kdd.snu.ac.kr" ]
ghsong@kdd.snu.ac.kr
e5b61423304f40cc2d2020de920bea0b54d9e659
5d6c374a2518d469d674a1327d21d8e0cf2b54f7
/modules/plugin/svg/src/test/java/org/geotools/renderer/style/SVGGraphicFactoryTest.java
9ef8418e19ce6be33a63c973d25f7b447016e4e2
[]
no_license
HGitMaster/geotools-osgi
648ebd9343db99a1e2688d9aefad857f6521898d
09f6e327fb797c7e0451e3629794a3db2c55c32b
refs/heads/osgi
2021-01-19T08:33:56.014532
2014-03-19T18:04:03
2014-03-19T18:04:03
4,750,321
3
0
null
2014-03-19T13:50:54
2012-06-22T11:21:01
Java
UTF-8
Java
false
false
3,113
java
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2008, Open Source Geospatial Foundation (OSGeo) * * 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; * version 2.1 of the License. * * 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. */ package org.geotools.renderer.style; import java.net.URL; import javax.swing.Icon; import junit.framework.TestCase; import org.geotools.factory.CommonFactoryFinder; import org.opengis.filter.FilterFactory; public class SVGGraphicFactoryTest extends TestCase { private SVGGraphicFactory svg; private FilterFactory ff; @Override protected void setUp() throws Exception { svg = new SVGGraphicFactory(); ff = CommonFactoryFinder.getFilterFactory(null); } public void testNull() throws Exception { assertNull(svg.getIcon(null, ff.literal("http://www.nowhere.com"), null, 20)); } public void testInvalidPaths() throws Exception { assertNull(svg.getIcon(null, ff.literal("http://www.nowhere.com"), "image/svg+not!", 20)); try { svg.getIcon(null, ff.literal("ThisIsNotAUrl"), "image/svg", 20); fail("Should have throw an exception, invalid url"); } catch(IllegalArgumentException e) { } } public void testLocalURL() throws Exception { URL url = SVGGraphicFactory.class.getResource("gradient.svg"); assertNotNull(url); // first call, non cached path Icon icon = svg.getIcon(null, ff.literal(url), "image/svg", 20); assertNotNull(icon); assertEquals(20, icon.getIconHeight()); // check caching is working assertTrue(svg.glyphCache.containsKey(url)); // second call, hopefully using the cached path icon = svg.getIcon(null, ff.literal(url), "image/svg", 20); assertNotNull(icon); assertEquals(20, icon.getIconHeight()); } public void testNaturalSize() throws Exception { URL url = SVGGraphicFactory.class.getResource("gradient.svg"); assertNotNull(url); // first call, non cached path Icon icon = svg.getIcon(null, ff.literal(url), "image/svg", -1); assertNotNull(icon); assertEquals(500, icon.getIconHeight()); } public void testSizeWithPixels() throws Exception { URL url = SVGGraphicFactory.class.getResource("gradient-pixels.svg"); assertNotNull(url); // first call, non cached path Icon icon = svg.getIcon(null, ff.literal(url), "image/svg", -1); assertNotNull(icon); assertEquals(500, icon.getIconHeight()); } }
[ "devnull@localhost" ]
devnull@localhost
ef3bea166fb6e7bcff9e5138ba012fbbfc2606c3
89990c941182cee5378cdca9984c1b0681ad1683
/src/com/bring/digital/transaction/lib/service/BringService.java
d29429088b8652f27d6f80d65eb9ae4e9a3f1961
[]
no_license
jacksonvieira/bring-digital-test
0e4cb285d053d49d2480c17b7d93af40559be440
f625a082b6c8b167741c46545186425e2a3a5e99
refs/heads/main
2023-02-25T06:23:33.320933
2021-01-24T11:01:01
2021-01-24T11:01:01
332,422,790
0
0
null
null
null
null
UTF-8
Java
false
false
1,593
java
package com.bring.digital.transaction.lib.service; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Set; import javax.validation.ConstraintViolation; import javax.validation.Validation; import javax.validation.Validator; import javax.validation.ValidatorFactory; import com.bring.digital.transaction.lib.validation.Violation; import com.fasterxml.jackson.databind.ObjectMapper; public abstract class BringService<T> { public abstract List<T> all(); public abstract List<T> findByTypeTransaction(String type); public void validate(Object bean, Class<?>... classes) throws BringException { ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); Validator validator = factory.getValidator(); throwsViolations(validator.validate(bean, classes)); } private void throwsViolations(Set<ConstraintViolation<Object>> violations) throws BringException { if (violations.isEmpty()) { return; } String message = formatMessage(violations); throw new BringException(message); } private String formatMessage(Set<ConstraintViolation<Object>> violations) throws BringException { List<Violation> msgViolations = new ArrayList<>(); for (ConstraintViolation<Object> violation : violations) { msgViolations.add(new Violation(violation.getPropertyPath().toString(), violation.getMessage())); } ObjectMapper mapper = new ObjectMapper(); String messages; try { messages = mapper.writeValueAsString(msgViolations); } catch (IOException e) { throw new BringException(e); } return messages; } }
[ "jacksonsilvavieira@gmail.com" ]
jacksonsilvavieira@gmail.com
65445264b50a9dfc7711f9ee656fab7a0b4738e9
24a5ff8afe7b985ca6d46a9eaf4e2127f11dda22
/src/main/java/com/chart/rest/config/RestChartConfig.java
0802e72786b11d57a7ad234b996a1df4d4736e95
[]
no_license
ctc948040/wschart
17d0030e70f67f3a6b5d573a9f21f787fbfab075
43742e25cf929c23dab1155101bcb5cbeec3558f
refs/heads/master
2023-05-09T03:50:36.668852
2021-05-26T01:59:21
2021-05-26T01:59:21
366,556,137
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
package com.chart.rest.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import com.chart.rest.repositories.IndexPriceRepository; import com.chart.util.FakeDate; @Configuration public class RestChartConfig { @Autowired IndexPriceRepository indexPriceRepository; @Bean public FakeDate getFakeDate() { long minStartAt = Long.parseLong(indexPriceRepository.findByMinStartAt()); return new FakeDate(minStartAt); } }
[ "mir948040@naver.com" ]
mir948040@naver.com
984f0eaf2d93326091a17b775dd74cea456a1741
010b3b6e8afe18ee6a8a7fe9fa10840d415b2f50
/054 Spiral Matrix.java
bdbc035d90e9b5034431093fe6576254b913a543
[]
no_license
Orangehhh/Leetcode
9c91dcb40611ea5eb1c7912fdeda38b5a20ccd1e
6a905ffcc97666c3695990f1b03fca40930eb065
refs/heads/master
2020-05-30T19:31:32.158549
2020-01-10T01:27:49
2020-01-10T01:27:49
189,926,257
0
0
null
null
null
null
UTF-8
Java
false
false
941
java
class Solution { private int[][] dirs = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; public List<Integer> spiralOrder(int[][] matrix) { List<Integer> ans = new ArrayList<>(); if (matrix == null || matrix.length == 0 || matrix[0].length == 0) { return ans; } int m = matrix.length; int n = matrix[0].length; int i = 0; int j = 0; int k = 0; while (true) { ans.add(matrix[i][j]); matrix[i][j] = Integer.MAX_VALUE; if (ans.size() == m * n) break; int r = i + dirs[k][0]; int c = j + dirs[k][1]; if (r < 0 || c < 0 || r >= m || c >= n || matrix[r][c] == Integer.MAX_VALUE) { k = (k + 1) % 4; r = i + dirs[k][0]; c = j + dirs[k][1]; } i = r; j = c; } return ans; } }
[ "haoliu47@gmail.com" ]
haoliu47@gmail.com
9bf4544399147d42408048198828098d2337f379
3d832dc46f716941029176cda1e21f1ca18a2165
/app/src/main/java/com/example/lambdademo/toast/ToastUtils.java
c1fb96fbd114bf18616846c54ab9810ef40ba164
[]
no_license
PGzxc/LambdaDemo
41369e24e319c2d8f7f80eed79a0163554162e77
7536e462753540ebdda2dd62378eaf8ae8eadcb7
refs/heads/master
2021-08-29T08:13:23.472286
2017-12-13T14:24:55
2017-12-13T14:24:55
114,130,309
0
0
null
null
null
null
UTF-8
Java
false
false
448
java
package com.example.lambdademo.toast; import android.content.Context; import android.widget.Toast; /** * Created by admin on 2017/12/13. */ public class ToastUtils { private static Toast toast; public static void showToast(Context context,String msg){ if(toast==null){ toast=Toast.makeText(context,msg,Toast.LENGTH_SHORT); }else { toast.setText(msg); } toast.show(); } }
[ "827489398@qq.com" ]
827489398@qq.com
9868ecc47bb61f0e5f22cc0fa68bf3f26c2a0355
61830e7b0df435cd88ded63c8e0af14359742774
/Class Schedule/zsPractice/zsPractice/src/zspractice/MainController.java
b867e9ffb916c14c0944d6b51c7ecfcca4047a71
[]
no_license
emfpir/ScheduleMakerAndroid
745f588b60eb1be38b73721c50212e26ef96b8cc
2615cba2ec7f3e4b546cc7a429c936e80140dcc2
refs/heads/main
2023-04-23T15:10:14.058105
2021-05-12T00:19:32
2021-05-12T00:19:32
366,545,557
0
0
null
null
null
null
UTF-8
Java
false
false
38,083
java
package zspractice; import Variables.Customer; import Variables.DatabaseConnection; import Variables.Schedule; import java.net.URL; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; import java.util.ResourceBundle; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.control.Alert; import javafx.scene.control.RadioButton; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.TextField; import javafx.scene.control.cell.PropertyValueFactory; import javafx.stage.Stage; public class MainController { // variables private boolean vendorRadio; private boolean openSplash; String location; String zoneLoc; public static String tName ="change name"; public static String tAddress="update address"; public static String tPhone="add phone number"; public static String tType="purchaser"; public static String tStart="2018-01-01 05:00"; public static String tEnd="2018-01-01 08:00"; private ObservableList<Customer> customerList = FXCollections.observableArrayList(); private ObservableList<Customer> getCustomerList() {return customerList;} private ObservableList<Schedule> scheduleList = FXCollections.observableArrayList(); private ObservableList<Schedule> getScheduleList() {return scheduleList;} ZoneId newYorkZoneId = ZoneId.of("America/New_York"); ZoneId londonZoneId = ZoneId.of("Europe/London"); ZoneId losAngelesZoneId = ZoneId.of("America/Los_Angeles"); ZoneId parisZoneId = ZoneId.of("Europe/Paris"); private Stage dialogStage; Connection connection; private ZsPractice zsPractice; //set fxml & table content for the customer @FXML private TableView<Customer> customerTable; @FXML private TableColumn<Customer, String> name; @FXML private TableColumn<Customer, String> address; @FXML private TableColumn<Customer, String> phone; @FXML private TextField idField; @FXML private TextField nameField; @FXML private TextField addressField; @FXML private TextField phoneField; //set fxml & table content for the schedule @FXML private TableView<Schedule> scheduleTable; @FXML private TableColumn<Schedule, String> startColumn; @FXML private TableColumn<Schedule, String> endColumn; @FXML private TableColumn<Schedule, Integer> idColumn; @FXML private TableColumn<Schedule, String> typeColumn; @FXML private TextField dateYearField; @FXML private TextField dateMonthField; @FXML private TextField dateDayField; @FXML private TextField startHourField; @FXML private TextField startMinuteField; @FXML private TextField endHourField; @FXML private TextField endMinuteField; @FXML private TextField customerIdField; @FXML private TextField scheduleIdField; @FXML private RadioButton vendorRadioButton; @FXML private RadioButton purchaserRadioButton; // adds new customer to DB and loads the customer in customer table @FXML private void handleNewCustomer() { addCustomer(); newCustomerAlert(); dialogStage.close(); } // removes customer from DB and the customer table @FXML private void handleDeleteCustomer() { Customer selectedCustomer = customerTable.getSelectionModel().getSelectedItem(); removeCustomer(selectedCustomer); dialogStage.close(); } // get customer to update with values in fields @FXML private void handleSaveCustomer() { Customer selectedCustomer = customerTable.getSelectionModel().getSelectedItem(); if(selectedCustomer.getName().equals(nameField.getText()) && selectedCustomer.getAddress().equals(addressField.getText()) && selectedCustomer.getPhone().equals(phoneField.getText())){ clearTextField(); } else{ if(checkName(nameField.getText())==true && checkAddress(addressField.getText())==true && checkPhone(phoneField.getText())==true){ selectedCustomer.setName(nameField.getText()); selectedCustomer.setAddress(addressField.getText()); selectedCustomer.setPhone(phoneField.getText()); updateCustomer(selectedCustomer); dialogStage.close(); } else{ invalidEntryCustomer(); } } } //add new schedule using selected customer to DB and schedule table @FXML private void handleNewSchedule() { if(Integer.parseInt(customerIdField.getText())>=1){ addSchedule(Integer.parseInt(customerIdField.getText())); newScheduleAlert(); dialogStage.close(); } else{ noNewScheduleAlert(); } } // remove schedule from database and schedule table @FXML private void handleDeleteSchedule() { Schedule selectedSchedule = scheduleTable.getSelectionModel().getSelectedItem(); removeSchedule(selectedSchedule); dialogStage.close(); } // update selected schedule with data in text field @FXML private void handleSaveSchedule() { String start = dateYearField.getText()+"-"+dateMonthField.getText()+"-"+dateDayField.getText()+" "+startHourField.getText()+":"+startMinuteField.getText()+":00"; String end = dateYearField.getText()+"-"+dateMonthField.getText()+"-"+dateDayField.getText()+" "+endHourField.getText()+":"+endMinuteField.getText()+":00"; if(checkDate(start)==true && checkTime(start)==true && checkTime(end)==true && checkAppointmentTime(start,end)==true && checkOpen(start,end)==true){ updateDB(); dialogStage.close(); } else{ invalidEntrySchedule(); } } // control the vendor radio button @FXML private void handleVendorRadio() { vendorRadio = true; } // control the purchaser radio button @FXML private void handlePurchaserRadio() { vendorRadio = false; } // closes dialog stage @FXML private void handleExit() { openSplash = true; dialogStage.close(); } // create new customer by adding default vaules to database public static void addCustomer() { try { PreparedStatement addRow = DatabaseConnection.getConnect().prepareStatement("INSERT INTO U04bZK.customer(customerName,address,phone) VALUES(?,?,?);"); addRow.setString(1,tName); addRow.setString(2,tAddress); addRow.setString(3,tPhone); addRow.execute(); } catch(SQLException e) { e.printStackTrace(); } } //deletes customer from DB by customerId private void removeCustomer(Customer customer) { try { PreparedStatement ps = DatabaseConnection.getConnect().prepareStatement("DELETE FROM U04bZK.customer WHERE customerId = ?"); ps.setInt(1, customer.getId()); ps.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } // update customer in database by Customer value passed in public static void updateCustomer(Customer customer) { try { PreparedStatement modifyRow = DatabaseConnection.getConnect().prepareStatement("UPDATE U04bZK.customer SET customerName = ?, address = ?, phone = ? WHERE customerId = ?"); modifyRow.setString(1,customer.getName()); modifyRow.setString(2,customer.getAddress()); modifyRow.setString(3,customer.getPhone()); modifyRow.setInt(4,customer.getId()); modifyRow.executeUpdate(); } catch (SQLException ee) { ee.printStackTrace(); } } // add schedule using default values and associating customerId passed in public static void addSchedule(Integer customerId) { try { PreparedStatement addRow = DatabaseConnection.getConnect().prepareStatement("INSERT INTO U04bZK.appointment(customerId, type,start,end) VALUES(?,?,?,?);"); addRow.setInt(1, customerId); addRow.setString(2,tType); addRow.setString(3,tStart); addRow.setString(4,tEnd); addRow.execute(); } catch(SQLException e) { e.printStackTrace(); } } // remove schedule from database using schedule id value passed in private void removeSchedule(Schedule schedule) { try { PreparedStatement ps = DatabaseConnection.getConnect().prepareStatement("DELETE FROM U04bZK.appointment WHERE appointmentId = ?"); ps.setInt(1, schedule.getScheduleId()); ps.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } // returns string value based on the radio button position private String findRadio() { if(vendorRadio==true){ return "vendor"; } else{ return "purchaser"; } } // collect data from field to update schedule in database private void updateDB() { String xStart = dateYearField.getText()+"-"+dateMonthField.getText()+"-"+dateDayField.getText()+" "+startHourField.getText()+":"+startMinuteField.getText()+":00"; String xEnd = dateYearField.getText()+"-"+dateMonthField.getText()+"-"+dateDayField.getText()+" "+endHourField.getText()+":"+endMinuteField.getText()+":00"; Integer xScheduleId = Integer.parseInt(scheduleIdField.getText()); Integer xCustomerId = Integer.parseInt(customerIdField.getText()); String xType = findRadio(); System.out.println(location+" "+zoneLoc+" "+xStart); LocalDateTime rightNow = LocalDateTime.now(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); ZoneId rightNowZoneId = ZoneId.of(zoneLoc); //ZonedDateTime loginZoneSet =rightNow.atZone(rightNowZoneId); LocalDateTime startLDT = LocalDateTime.parse(xStart,formatter); ZonedDateTime startZDT = startLDT.atZone(rightNowZoneId); ZonedDateTime startNY = startZDT.withZoneSameInstant(newYorkZoneId); String startSave = startNY.toString().substring(0,10)+" "+startNY.toString().substring(11,16)+":00"; LocalDateTime endLDT = LocalDateTime.parse(xEnd,formatter); ZonedDateTime endZDT = endLDT.atZone(rightNowZoneId); ZonedDateTime endNY = endZDT.withZoneSameInstant(newYorkZoneId); String endSave = endNY.toString().substring(0,10)+" "+endNY.toString().substring(11,16)+":00"; System.out.println(startSave+" >< "+endSave); try { PreparedStatement ps = DatabaseConnection.getConnect().prepareStatement("UPDATE U04bZK.appointment SET customerId=?, type=?, start=?, end=? WHERE appointmentId=?;"); ps.setInt(1, xCustomerId); ps.setString(2,xType); ps.setString(3,startSave); ps.setString(4,endSave); ps.setInt(5, xScheduleId); ps.executeUpdate(); } catch (SQLException sqe) { System.out.println("Check your SQL collecting appoint"); } catch (Exception e) { System.out.println("Something besides the SQL went wrong."); } } // return boolean of openSplash (the function is called using the dialog is closed) public boolean exitClicked(){ return openSplash; } // set dialog stage public void setDialogStage(Stage dialogStage) { this.dialogStage = dialogStage; } // runs when main.fxml is opened public void setStart(ZsPractice zsPractice) { this.zsPractice = zsPractice; // set columns for the customer table name.setCellValueFactory(new PropertyValueFactory<>("name")); address.setCellValueFactory(new PropertyValueFactory<>("address")); phone.setCellValueFactory(new PropertyValueFactory<>("phone")); // set values for each row of the customer table customerTable.getItems().setAll(parseCustomers()); // lambda onclick sets data from the customer table to the fields associated customerTable.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) ->showCustomerDetails(newValue)); // get value of the user's login location =setLocation(); //set schedule table for correct time zone setScheduleTable(); // lambda onclick sets data from the schedule table to the fields associated scheduleTable.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) ->showScheduleDetails(newValue)); customerIdField.setText("0"); } //set the schedule table and loads data with time zone correction private void setScheduleTable() { //set columns for the schedule table idColumn.setCellValueFactory(new PropertyValueFactory<>("customerScheduleId")); startColumn.setCellValueFactory(new PropertyValueFactory<>("start")); endColumn.setCellValueFactory(new PropertyValueFactory<>("end")); typeColumn.setCellValueFactory(new PropertyValueFactory<>("type")); LocalDateTime rightNow = LocalDateTime.now(); // set zoneLoc based on location the user is located if(location.equals("Los Angeles, CA")){ zoneLoc = "America/Los_Angeles"; } else if(location.equals("New York, NY")){ zoneLoc = "America/New_York"; } else if(location.equals("London, England")){ zoneLoc = "Europe/London"; } else if(location.equals("Paris, France")){ zoneLoc = "Europe/Paris"; } else { System.exit(0); } // set format for LocalDateTime DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); ZoneId rightNowZoneId = ZoneId.of(zoneLoc); ZonedDateTime loginZoneSet =rightNow.atZone(rightNowZoneId); // variables for set data from schedule in database Integer xScheduleId; String xStart; String xEnd; Integer xCustomerId; String xType; // collecting data from database for all appointments try { PreparedStatement statement = DatabaseConnection.getConnect().prepareStatement("SELECT * FROM U04bZK.appointment;"); ResultSet rs = statement.executeQuery(); while(rs.next()) { // setting SQL data to variables xScheduleId = Integer.parseInt(rs.getString("appointmentId")); // setting the start datetime to LA TZ; then returning the data to datetime xStart = rs.getString("start"); xEnd = rs.getString("end"); xCustomerId = Integer.parseInt(rs.getString("customerId")); xType = rs.getString("type"); // checking which location the user is at and setting the zone to match if(zoneLoc.toString().equals("America/New_York")){ LocalDateTime nyStartLDT = LocalDateTime.parse(xStart,formatter); ZonedDateTime nyStartZDT = nyStartLDT.atZone(newYorkZoneId); String nyStart = nyStartZDT.toString().substring(0,10)+" "+nyStartZDT.toString().substring(11,16); LocalDateTime nyEndLDT = LocalDateTime.parse(xEnd,formatter); ZonedDateTime nyEndZDT = nyEndLDT.atZone(newYorkZoneId); String nyEnd = nyEndZDT.toString().substring(0,10)+" "+nyEndZDT.toString().substring(11,16); scheduleList.add(new Schedule(xScheduleId, nyStart, nyEnd, xCustomerId, xType)); } else if(zoneLoc.toString().equals("America/Los_Angeles")){ LocalDateTime nyStartLDT = LocalDateTime.parse(xStart,formatter); ZonedDateTime nyStartZDT = nyStartLDT.atZone(newYorkZoneId); ZonedDateTime laStartZDT = nyStartZDT.withZoneSameInstant(losAngelesZoneId); LocalDateTime nyEndLDT = LocalDateTime.parse(xEnd,formatter); ZonedDateTime nyEndZDT = nyEndLDT.atZone(newYorkZoneId); ZonedDateTime laEndZDT = nyEndZDT.withZoneSameInstant(losAngelesZoneId); String laStart = laStartZDT.toString().substring(0,10)+" "+laStartZDT.toString().substring(11,16); String laEnd = laEndZDT.toString().substring(0,10)+" "+laEndZDT.toString().substring(11,16); scheduleList.add(new Schedule(xScheduleId, laStart, laEnd, xCustomerId, xType)); } else if(zoneLoc.toString().equals("Europe/London")){ LocalDateTime nyStartLDT = LocalDateTime.parse(xStart,formatter); ZonedDateTime nyStartZDT = nyStartLDT.atZone(newYorkZoneId); ZonedDateTime londonStartZDT = nyStartZDT.withZoneSameInstant(londonZoneId); LocalDateTime nyEndLDT = LocalDateTime.parse(xEnd,formatter); ZonedDateTime nyEndZDT = nyEndLDT.atZone(newYorkZoneId); ZonedDateTime londonEndZDT = nyEndZDT.withZoneSameInstant(londonZoneId); String londonStart = londonStartZDT.toString().substring(0,10)+" "+londonStartZDT.toString().substring(11,16); String londonEnd = londonEndZDT.toString().substring(0,10)+" "+londonEndZDT.toString().substring(11,16); scheduleList.add(new Schedule(xScheduleId, londonStart, londonEnd, xCustomerId, xType)); } else if (zoneLoc.toString().equals("Europe/Paris")){ LocalDateTime nyStartLDT = LocalDateTime.parse(xStart,formatter); ZonedDateTime nyStartZDT = nyStartLDT.atZone(newYorkZoneId); ZonedDateTime parisStartZDT = nyStartZDT.withZoneSameInstant(parisZoneId); LocalDateTime nyEndLDT = LocalDateTime.parse(xEnd,formatter); ZonedDateTime nyEndZDT = nyEndLDT.atZone(newYorkZoneId); ZonedDateTime parisEndZDT = nyEndZDT.withZoneSameInstant(parisZoneId); String parisStart = parisStartZDT.toString().substring(0,10)+" "+parisStartZDT.toString().substring(11,16); String parisEnd = parisEndZDT.toString().substring(0,10)+" "+parisEndZDT.toString().substring(11,16); scheduleList.add(new Schedule(xScheduleId, parisStart, parisEnd, xCustomerId, xType)); } else { System.exit(0); } } scheduleTable.getItems().setAll(scheduleList); } catch (SQLException sqe) { System.out.println("Check your SQL collecting appoint"); } catch (Exception e) { System.out.println("Something besides the SQL went wrong."); } } // return string for the user login location private String setLocation() { try { PreparedStatement statement = DatabaseConnection.getConnect().prepareStatement("SELECT MAX(login) as login, active FROM U04bZK.user;"); ResultSet rs = statement.executeQuery(); while(rs.next()) { return rs.getString("active"); } } catch (SQLException sqe) { System.out.println("Check your SQL collecting appoint"); } catch (Exception e) { System.out.println("Something besides the SQL went wrong."); } return null; } //sets the selected schedule in schedule table to schedule fields private void showScheduleDetails(Schedule selectedSchedule) { // get selected information to set in fields String placeHoldStart = selectedSchedule.getStart().toString(); String placeHoldEnd = selectedSchedule.getEnd().toString(); // collecting the date String placeHoldYear = Character.toString(placeHoldStart.charAt(0))+Character.toString(placeHoldStart.charAt(1))+Character.toString(placeHoldStart.charAt(2))+Character.toString(placeHoldStart.charAt(3)); String placeHoldMonth = Character.toString(placeHoldStart.charAt(5))+Character.toString(placeHoldStart.charAt(6)); String placeHoldDay = Character.toString(placeHoldStart.charAt(8))+Character.toString(placeHoldStart.charAt(9)); // collecting the start time String placeHoldStartHour = Character.toString(placeHoldStart.charAt(11))+Character.toString(placeHoldStart.charAt(12)); String placeHoldStartMin = Character.toString(placeHoldStart.charAt(14))+Character.toString(placeHoldStart.charAt(15)); // collecting the end time String placeHoldEndHour = Character.toString(placeHoldEnd.charAt(11))+Character.toString(placeHoldEnd.charAt(12)); String placeHoldEndMin = Character.toString(placeHoldEnd.charAt(14))+Character.toString(placeHoldEnd.charAt(15)); // checking the state of the radio button if(selectedSchedule.getType().equals("vendor")) { vendorRadioButton.setSelected(true); } else if(selectedSchedule.getType().equals("purchaser")) { purchaserRadioButton.setSelected(true); } // setting the field data dateYearField.setText(placeHoldYear); dateMonthField.setText(placeHoldMonth); dateDayField.setText(placeHoldDay); startHourField.setText(placeHoldStartHour); startMinuteField.setText(placeHoldStartMin); endHourField.setText(placeHoldEndHour); endMinuteField.setText(placeHoldEndMin); customerIdField.setText(Integer.toString(selectedSchedule.getCustomerScheduleId())); scheduleIdField.setText(Integer.toString(selectedSchedule.getScheduleId())); } // sets the customer fields based on the passed in selectedCustomer private void showCustomerDetails(Customer selectedCustomer) { clearTextField(); nameField.setText(selectedCustomer.getName()); addressField.setText(selectedCustomer.getAddress()); phoneField.setText(selectedCustomer.getPhone()); idField.setText(Integer.toString(selectedCustomer.getId())); customerIdField.setText(Integer.toString(selectedCustomer.getId())); } // removes the values in fields private void clearTextField() { dateYearField.clear(); dateMonthField.clear(); dateDayField.clear(); startHourField.clear(); startMinuteField.clear(); endHourField.clear(); endMinuteField.clear(); customerIdField.clear(); scheduleIdField.clear(); idField.clear(); nameField.clear(); addressField.clear(); phoneField.clear(); } // creates list of schedule from values in Database private List<Schedule> parseSchedule() { Integer tAppointmentId; Integer tCustomerId; String tType; String tStart; String tEnd; System.out.println("parse customer has started"); try ( PreparedStatement statement = DatabaseConnection.getConnect().prepareStatement("SELECT appointmentId, customerId, type, start, end From U04bZK.appointment;"); ResultSet rs = statement.executeQuery();) { while (rs.next()) { tAppointmentId = Integer.parseInt(rs.getString("appointment.appointmentId")); tStart = rs.getString("appointment.start"); tEnd = rs.getString("appointment.end"); tCustomerId = Integer.parseInt(rs.getString("appointment.customerId")); tType = rs.getString("appointment.type"); scheduleList.add(new Schedule(tAppointmentId, tStart, tEnd, tCustomerId, tType)); System.out.println(tAppointmentId); } return scheduleList; } catch (SQLException sqe) { System.out.println("Check SQL"); } catch (Exception e) { System.out.println("something else is wrong."); } return scheduleList; } //create list of customer based on values in database private List<Customer> parseCustomers() { Integer tId; String tName; String tAddress; String tPhone; try ( PreparedStatement statement = DatabaseConnection.getConnect().prepareStatement("SELECT customerId, customerName, address, phone From U04bZK.customer;"); ResultSet rs = statement.executeQuery();) { while (rs.next()) { tId = Integer.parseInt(rs.getString("customer.customerId")); tName = rs.getString("customer.customerName"); tAddress = rs.getString("customer.address"); tPhone = rs.getString("customer.phone"); customerList.add(new Customer(tId, tName, tAddress, tPhone)); } return customerList; } catch (SQLException sqe) { System.out.println("Check SQL"); } catch (Exception e) { System.out.println("something else is wrong."); } return customerList; } // check if name is correct (only a-z & ' ') private boolean checkName(String name) { name = name.toLowerCase(); for(int i=0; i<name.length();i++){ char temp = name.charAt(i); if(temp=='a'){} else if(temp=='b'){} else if(temp=='c'){} else if(temp=='d'){} else if(temp=='e'){} else if(temp=='f'){} else if(temp=='g'){} else if(temp=='h'){} else if(temp=='i'){} else if(temp=='j'){} else if(temp=='k'){} else if(temp=='l'){} else if(temp=='m'){} else if(temp=='n'){} else if(temp=='o'){} else if(temp=='p'){} else if(temp=='q'){} else if(temp=='r'){} else if(temp=='s'){} else if(temp=='t'){} else if(temp=='u'){} else if(temp=='v'){} else if(temp=='w'){} else if(temp=='x'){} else if(temp=='y'){} else if(temp=='z'){} else if(temp==' '){} else{return false;} } return true; } //check address is correct (start with '0-9'; then ' '; then 'a-z') private boolean checkAddress(String address){ Integer space=0; for(int i=0; i<address.length(); i++){ char temp = address.charAt(i); if(temp == '0'){} else if(temp == '1'){} else if(temp=='2'){} else if(temp=='3'){} else if(temp=='4'){} else if(temp=='5'){} else if(temp=='6'){} else if(temp=='7'){} else if(temp=='8'){} else if(temp=='9'){} else if(temp==' '){ if(i==0){ return false; } else{ space=i; i=address.length(); } } else{return false;} } address = address.toLowerCase(); for(int i=space;i<address.length();i++){ char temp=address.charAt(i); if(temp=='a'){} else if(temp=='b'){} else if(temp=='c'){} else if(temp=='d'){} else if(temp=='e'){} else if(temp=='f'){} else if(temp=='g'){} else if(temp=='h'){} else if(temp=='i'){} else if(temp=='j'){} else if(temp=='k'){} else if(temp=='l'){} else if(temp=='m'){} else if(temp=='n'){} else if(temp=='o'){} else if(temp=='p'){} else if(temp=='q'){} else if(temp=='r'){} else if(temp=='s'){} else if(temp=='t'){} else if(temp=='u'){} else if(temp=='v'){} else if(temp=='w'){} else if(temp=='x'){} else if(temp=='y'){} else if(temp=='z'){} else if(temp==' '){} else{return false;} } return true; } // chcek phone is correct (must have '0-9' || ' ' || '-' || '(' || ')' ) private boolean checkPhone(String phone){ for(int i=0;i<phone.length();i++){ char temp=phone.charAt(i); if(temp=='0'){} else if(temp=='1'){} else if(temp=='2'){} else if(temp=='3'){} else if(temp=='4'){} else if(temp=='5'){} else if(temp=='6'){} else if(temp=='7'){} else if(temp=='8'){} else if(temp=='0'){} else if(temp==' '){} else if(temp=='-'){} else if(temp=='('){} else if(temp==')'){} else {return false;} } return true; } // check date is correct (year must be within 2000-2099, month must be 01-12, day must be correct with month and leap year private boolean checkDate(String date){ System.out.println(date.substring(0,1)); if(date.substring(0,1).equals("2")){ System.out.println(date.substring(1,2)); if(date.substring(1,2).equals("0")){ System.out.println(date.substring(2,3)); if(checkTenPlace(date.substring(2,3))==true){ System.out.println(date.substring(3,4)); if(checkTenPlace(date.substring(3,4))==true){ System.out.println(date.substring(5,7)); if(checkMonth(date.substring(5, 7))==true){ return checkDay(date); } else {return false;} } else{return false;} } else{return false;} } else{return false;} } else{return false;} } // check the last two digits in the year (must be '0-9' for both) private boolean checkTenPlace(String ten){ if(ten.equals("0")){} else if(ten.equals("1")){} else if(ten.equals("2")){} else if(ten.equals("3")){} else if(ten.equals("4")){} else if(ten.equals("5")){} else if(ten.equals("6")){} else if(ten.equals("7")){} else if(ten.equals("8")){} else if(ten.equals("9")){} else {return false;} return true; } // check the month (must be '01-12') private boolean checkMonth(String month){ if(month.equals("01")){} else if (month.equals("02")){} else if (month.equals("03")){} else if (month.equals("04")){} else if (month.equals("05")){} else if (month.equals("06")){} else if (month.equals("07")){} else if (month.equals("08")){} else if (month.equals("09")){} else if (month.equals("10")){} else if (month.equals("11")){} else if (month.equals("12")){} else {return false;} return true; } // find the maximum number of days for month/year combo private Integer numberOfDays(String date){ String year = date.substring(0,4); String month = date.substring(5,7); if(Integer.parseInt(year)%4==0){ if(Integer.parseInt(month)==02){ return 29; } } if(month.equals("01")){return 31;} else if(month.equals("02")){return 28;} else if(month.equals("03")){return 31;} else if(month.equals("04")){return 30;} else if(month.equals("05")){return 31;} else if(month.equals("06")){return 30;} else if(month.equals("07")){return 31;} else if(month.equals("08")){return 31;} else if(month.equals("09")){return 30;} else if(month.equals("10")){return 31;} else if(month.equals("11")){return 30;} else if(month.equals("12")){return 31;} else {return -1;} } //check the day is correct (must be within '01-mostDays') private boolean checkDay(String date){ Integer mostDays = numberOfDays(date); if(mostDays == -1){ System.out.print("mostDays is set at -1"); return false; } Integer currentDay = Integer.parseInt(date.substring(8,10)); if(currentDay<=mostDays && currentDay>0){return true;} System.out.println("checkDay caused issue"); return false; } // check start/end hour & min (must be '00-23' for hour & '00-59' for minute) private boolean checkTime(String date){ Integer hour = Integer.parseInt(date.substring(11,13)); Integer minute = Integer.parseInt(date.substring(14,16)); if(hour>=0 && hour<24 && minute>=0 && minute<60){ return true; } return false; } private boolean checkAppointmentTime(String start, String end){ Integer startTimeHour = Integer.parseInt(start.substring(11,13)); Integer startTimeMinute = Integer.parseInt(start.substring(14,16)); Integer endTimeHour = Integer.parseInt(end.substring(11,13)); Integer endTimeMinute = Integer.parseInt(end.substring(14,16)); if(startTimeHour==endTimeHour && startTimeMinute<endTimeMinute || startTimeHour<endTimeHour){ return true; } return false; } private boolean checkOpen(String start, String end) { Integer startTimeHour = Integer.parseInt(start.substring(11,13)); Integer endTimeHour = Integer.parseInt(end.substring(11,13)); Integer endTimeMinute = Integer.parseInt(end.substring(14,16)); if(startTimeHour<8||endTimeHour>17|| endTimeHour==17 &&endTimeMinute>0){return false;} return true; } private void invalidEntryCustomer(){ Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Data Entry Error"); alert.setHeaderText("Some of the data enter was not formatted incorrectly!!"); alert.setContentText("The customer name can only contain alphabetic character. The address must start with numeric character and end with alpahbetic characters. The phone number must only have numeric characters and hyphen."); alert.showAndWait(); } private void invalidEntrySchedule(){ Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Data Entry Error"); alert.setHeaderText("Some of the data enter was not formatted incorrectly!!"); alert.setContentText("The Schedule fields must only contain numeric characters. The start of an appointment can't be before the end. No appointment can be scheduled outside of 8am to 5pm."); alert.showAndWait(); } private void newCustomerAlert(){ Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("New Customer added"); alert.setHeaderText("A new customer was added with default values"); alert.setContentText("Please, change the new entry with the correct information!"); alert.showAndWait(); } private void newScheduleAlert(){ Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("New Schedule added"); alert.setHeaderText("A new schedule was added for the selected customer with default values"); alert.setContentText("Please, change the new entry with the correct information!"); alert.showAndWait(); } private void noNewScheduleAlert(){ Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("No Schedule Added"); alert.setHeaderText("A new schedule needs to have a customer associated."); alert.setContentText("Please, choose a customer. Then, a new schedule will be created with default values."); alert.showAndWait(); } }
[ "emfpir@gmail.com" ]
emfpir@gmail.com
9cf1dfb3108f6464723057c3bb81daeed95b778d
44e9c2c9cbdf7d5da4636679cf395f6d9ea349e1
/firstProject/src/operator/ifExample.java
218eb2edf9861e1872fcd9db66d662fb614de43a
[]
no_license
kimyuris/firstProject
bc33ac83fcaedbab910d5c27a77c299ff8769ecb
7479968a7d46a91eed5395069897f0c5b565c166
refs/heads/master
2023-06-18T20:16:47.396094
2021-07-13T07:49:32
2021-07-13T07:49:32
379,486,945
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
package operator; public class ifExample { public static void main(String[] args) { // if () {} int v1 = 20; int v2 = 20; if (v1 > v2) { System.out.println("v1 이 v2 보다 큽니다."); } else if (v1 == v2 ) { // 숫자가 같을때는 ==로 표시 // 문자가 같을때는 .equals 로 표시 System.out.println("v1과 v2는 같습니다."); } else { System.out.println("v2가 v1보다 큽니다."); // else가 제일 마지막에 나오는조건. } String str1 = "홍길동"; String str2 = "홍길동"; String str3 = new String("홍길동"); if (str1.equals (str3)) { System.out.println("같은 이름입니다."); } else { System.out.println("다른 이름입니다."); } System.out.println("end of prog."); } }
[ "Admin@DESKTOP-63EL9EP" ]
Admin@DESKTOP-63EL9EP
fa235e2c7ed5eea06c2194c3951d422159b37d8e
f3331661828062975f6ef9f801713811370cb662
/src/main/java/com/practice/basic/base/IntegerTest.java
c05ffbe4534a5fc6427dfe24481f2519f7f66fd7
[]
no_license
dkwx/practice
6a98715f66dea608a6af2b7073fdebbec080f794
850420d9b93f6ead4886b35b0cf9ab30ab9bbd21
refs/heads/master
2023-02-15T01:35:31.968790
2020-12-31T08:01:45
2020-12-31T08:01:45
260,921,394
0
0
null
2020-05-23T02:58:31
2020-05-03T13:09:52
Java
UTF-8
Java
false
false
531
java
package com.practice.basic.base; /** * @author : kai.dai * @date : 2020-05-30 20:40 */ public class IntegerTest { public static void main(String[] args) { Integer i = 10; System.out.println(i); System.out.println(new Integer(10)==Integer.valueOf(10).intValue()); System.out.println('\u0000'); System.out.println('\u0001'); System.out.println('\u0002'); System.out.println('\u0003'); System.out.println('\u0004'); System.out.println('\u007f'); } }
[ "kai.dai@qunar.com" ]
kai.dai@qunar.com
6de668f06103909bfc537b3b03f7f22e3dc702ae
ba7bcaff2576fde26b01d4baf95cbfc15d7373fe
/app/src/main/java/com/admin/coursetabledemo/AddCourseDialog.java
c1e89027a735b421463f26a316f143d2b5fdf53d
[]
no_license
liankin/CourseTableDemo
614c74083118f3d97e106a82f9cded0f6cd9d1cf
bbf1819a42c04408d63a1764a0b78c0a0bf8c89a
refs/heads/master
2021-09-02T11:15:58.795313
2018-01-02T07:23:27
2018-01-02T07:23:27
115,599,267
1
0
null
null
null
null
UTF-8
Java
false
false
3,620
java
package com.admin.coursetabledemo; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.support.annotation.NonNull; import android.view.Display; import android.view.View; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; import butterknife.BindView; import butterknife.ButterKnife; /** * Created by admin on 2017/12/28. */ public class AddCourseDialog extends Dialog { @BindView(R.id.ed_course_name) EditText edCourseName; @BindView(R.id.ed_week) EditText edWeek; @BindView(R.id.ed_course_begin) EditText edCourseBegin; @BindView(R.id.ed_course_ends) EditText edCourseEnds; @BindView(R.id.ed_teacher_name) EditText edTeacherName; @BindView(R.id.ed_course_room) EditText edCourseRoom; @BindView(R.id.btn_cancel) Button btnCancel; @BindView(R.id.btn_ok) Button btnOk; @BindView(R.id.layout_course_name) LinearLayout layoutCourseName; @BindView(R.id.layout_week) LinearLayout layoutWeek; @BindView(R.id.layout_course_start) LinearLayout layoutCourseStart; @BindView(R.id.layout_end) LinearLayout layoutEnd; @BindView(R.id.layout_teacher) LinearLayout layoutTeacher; @BindView(R.id.layout_room) LinearLayout layoutRoom; @BindView(R.id.tv_title) TextView tvTitle; public AddCourseDialog(@NonNull Context context) { super(context, R.style.dialog_add_course); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dialog_add_course); // 将对话框的大小按屏幕大小的百分比设置 WindowManager m = getWindow().getWindowManager(); Display d = m.getDefaultDisplay(); final WindowManager.LayoutParams p = getWindow().getAttributes(); p.height = (int) (d.getHeight() * 0.7); p.width = (int) (d.getWidth() * 0.7); getWindow().setAttributes(p); setCanceledOnTouchOutside(false); ButterKnife.bind(this); btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); } public void setTvTitle(String title) { this.tvTitle.setText(title); } public void setBtnSure(View.OnClickListener listener) { btnOk.setOnClickListener(listener); } public void setBtnCancel(View.OnClickListener listener) { btnCancel.setOnClickListener(listener); } public EditText getEdCourseName() { return edCourseName; } public EditText getEdWeek() { return edWeek; } public EditText getEdCourseBegin() { return edCourseBegin; } public EditText getEdCourseEnds() { return edCourseEnds; } public EditText getEdTeacherName() { return edTeacherName; } public EditText getEdCourseRoom() { return edCourseRoom; } public LinearLayout getLayoutCourseName() { return layoutCourseName; } public LinearLayout getLayoutWeek() { return layoutWeek; } public LinearLayout getLayoutCourseStart() { return layoutCourseStart; } public LinearLayout getLayoutEnd() { return layoutEnd; } public LinearLayout getLayoutTeacher() { return layoutTeacher; } public LinearLayout getLayoutRoom() { return layoutRoom; } }
[ "3242644163@qq.com" ]
3242644163@qq.com
d3aa7bda41ec22485e56db0f0d683b3e700c8262
01eb8ba8cc050c6f87c832f386183104ac7605fe
/src/main/java/mx/com/dsa/solrutilities/util/PreEmptiveBasicAuthenticator.java
09bb25f9ae29f083209ae574129db3073d1fb1ba
[]
no_license
gibrantd/solr-utilities-v4
6ac4469184a8dd5a70bf0752bf7c6740d2e6779d
88b5141a3d625d06433347eb4963f71207458705
refs/heads/master
2022-12-25T23:05:41.504458
2013-04-15T07:44:40
2013-04-15T07:44:40
9,443,041
0
0
null
2022-12-09T22:55:37
2013-04-15T07:28:17
Java
UTF-8
Java
false
false
1,043
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package mx.com.dsa.solrutilities.util; import java.io.IOException; import org.apache.http.HttpException; import org.apache.http.HttpRequest; import org.apache.http.HttpRequestInterceptor; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.impl.auth.BasicScheme; import org.apache.http.protocol.HttpContext; /** * * @author Attivio */ public class PreEmptiveBasicAuthenticator implements HttpRequestInterceptor { private final UsernamePasswordCredentials credentials; public PreEmptiveBasicAuthenticator(String user, String pass) { credentials = new UsernamePasswordCredentials(user, pass); } public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { request.addHeader(BasicScheme.authenticate(credentials,"US-ASCII",false)); } }
[ "gibrantd@yahoo.com.mx" ]
gibrantd@yahoo.com.mx
56828b13b0606a136f3f38bbafa6b7fcc2fc600d
1294f618e7f7a87ee04a6c67416e8cd4efa4c10f
/src/main/java/com/flloki/patterns/creational/singleton/Configuration.java
eee7d6378d0383827f77b71b3d760fec5e8f377d
[]
no_license
Flloki5/designPatterns
8aa10059d6899219e0635fd0e42679cc4c9f20b4
850af370d9bff52de046bf48e4dc26948e1a4c27
refs/heads/main
2023-04-13T10:17:03.811323
2021-04-20T12:55:00
2021-04-20T12:55:00
359,370,219
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
package com.flloki.patterns.creational.singleton; public class Configuration { private static Configuration INSTANCE; private Configuration(){ } public static Configuration getInstance() { if(INSTANCE == null) { INSTANCE = new Configuration(); } return INSTANCE; } }
[ "rozli@op.pl" ]
rozli@op.pl
9f07969ea0cecf68f36e13df3be6bf4d717ff614
7a23950b821eb3878baa13e6331d8eea7a4f31b7
/src/main/java/com/mozu/sterling/model/shipment/ItemAttrGrpTypeLocale.java
a970755ab4fe2860a3d5032b6590b43557fb95de
[]
no_license
Mozu/IBMSterling
992399993aa32f67fc81b7c49950c843f3db3f82
0783accef17ebd3d8889eab069269eb0fd0b5e8e
refs/heads/master
2021-01-21T19:06:34.271645
2016-05-05T19:06:54
2016-05-05T19:06:54
56,249,972
0
1
null
2016-05-05T16:45:36
2016-04-14T15:43:56
Java
UTF-8
Java
false
false
4,671
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.03.10 at 12:28:23 PM CST // package com.mozu.sterling.model.shipment; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "ItemAttrGrpTypeLocale") public class ItemAttrGrpTypeLocale { @XmlAttribute(name = "Country") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String country; @XmlAttribute(name = "Description") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String description; @XmlAttribute(name = "ItemAttrGroupTypeKey") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String itemAttrGroupTypeKey; @XmlAttribute(name = "ItemAttrGrpTypeLocaleKey") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String itemAttrGrpTypeLocaleKey; @XmlAttribute(name = "Language") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String language; @XmlAttribute(name = "Variant") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String variant; /** * Gets the value of the country property. * * @return * possible object is * {@link String } * */ public String getCountry() { return country; } /** * Sets the value of the country property. * * @param value * allowed object is * {@link String } * */ public void setCountry(String value) { this.country = value; } /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the itemAttrGroupTypeKey property. * * @return * possible object is * {@link String } * */ public String getItemAttrGroupTypeKey() { return itemAttrGroupTypeKey; } /** * Sets the value of the itemAttrGroupTypeKey property. * * @param value * allowed object is * {@link String } * */ public void setItemAttrGroupTypeKey(String value) { this.itemAttrGroupTypeKey = value; } /** * Gets the value of the itemAttrGrpTypeLocaleKey property. * * @return * possible object is * {@link String } * */ public String getItemAttrGrpTypeLocaleKey() { return itemAttrGrpTypeLocaleKey; } /** * Sets the value of the itemAttrGrpTypeLocaleKey property. * * @param value * allowed object is * {@link String } * */ public void setItemAttrGrpTypeLocaleKey(String value) { this.itemAttrGrpTypeLocaleKey = value; } /** * Gets the value of the language property. * * @return * possible object is * {@link String } * */ public String getLanguage() { return language; } /** * Sets the value of the language property. * * @param value * allowed object is * {@link String } * */ public void setLanguage(String value) { this.language = value; } /** * Gets the value of the variant property. * * @return * possible object is * {@link String } * */ public String getVariant() { return variant; } /** * Sets the value of the variant property. * * @param value * allowed object is * {@link String } * */ public void setVariant(String value) { this.variant = value; } }
[ "lakshmi_nair@volusion.com" ]
lakshmi_nair@volusion.com
2cad44292b6e933b4dd12582f3501c8c3786c1a8
906cd9079c697bc01c6fd9cf704100a48c0e71ae
/app/src/p_05_opengl_triangle/java/cn/eywalink/audiovideoandroidlearning/opengl_triangle/OpenGLTriangleActivity.java
dc857b0b5b05fc1019cb2c1e7733f24eb6db1b42
[]
no_license
eywalink/AudioVideoAndroidLearning
864c53061d0e57c7ca1b0c5bc7b1d9b85ed6eb43
b5a8ced98b3811459a81e8fd03edc88eba029ebb
refs/heads/master
2020-04-24T14:01:22.533032
2019-03-08T09:12:31
2019-03-08T09:12:31
172,006,678
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package cn.eywalink.audiovideoandroidlearning.opengl_triangle; import android.app.Activity; import android.opengl.GLSurfaceView; import android.os.Bundle; import android.support.annotation.Nullable; /** * Created by lixin on 2019/3/8. */ public class OpenGLTriangleActivity extends Activity{ MyGLSurfaceView glsv; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); glsv = new MyGLSurfaceView(getBaseContext()); setContentView(glsv); } }
[ "xin87.li@gmail.com" ]
xin87.li@gmail.com
37d08a8e9dff14124fc3167f82d11380552fb1e6
093ef36cbc86b98874cf744530f76d92e1647a92
/edward-skillful-dataStructure/src/main/java/com/binaryTrees/HafuManTree.java
6b6318f32144bcffe35ff578d97f135fff048485
[]
no_license
jianfengsuozhi/coreSkillfull1
74af0847a983ab4a828b037f565c2d01146982ab
6c47e3ae0b687527691b45558e9d7e5fc3005f9f
refs/heads/master
2020-12-25T22:36:30.949358
2017-03-21T07:39:43
2017-03-21T07:39:43
68,347,619
0
0
null
null
null
null
UTF-8
Java
false
false
695
java
package com.binaryTrees; import java.util.List; /** * 哈夫曼树:如将字符串转化为唯一的编码(压缩时使用:最短) * Created by weideliang on 2016/10/24. */ public class HafuManTree { public static class HNode<T> { T data; double weight; HNode leftChild; HNode rightChild; public HNode(T data,double weight){ this.data = data; this.weight = weight; } } public static HNode createHafumanTree(List<HNode> hNodes){ return null; } /** * 实现快速排序 * @param hNodes */ private static void subSort(List<HNode> hNodes,int start,int end){ } }
[ "704692689@qq.com" ]
704692689@qq.com
ad5ecec5412b595bc923e599a9fd4f1363dfe511
a4c702060e9fe16f6d30d195661222365f2661fa
/repo/src/test/java/indi/gscienty/gitterkid/repo/BlobTest.java
53d5be869c846014a57e5a89da055df8bb5e5a31
[ "MIT" ]
permissive
m1231996c/GitterKid
2daa3b60b3f8c478207d9d7626a2aa4677cc6639
819032be5e99b30314cee32a244d516e39e12430
refs/heads/master
2021-09-02T09:19:49.340800
2018-01-01T11:18:57
2018-01-01T11:18:57
115,480,035
0
0
null
2018-01-01T11:18:58
2017-12-27T04:06:37
C#
UTF-8
Java
false
false
1,060
java
package indi.gscienty.gitterkid.repo; import java.io.UnsupportedEncodingException; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * BlobTest */ public class BlobTest extends TestCase { public BlobTest(String testName) { super (testName); } public static Test suite() { return new TestSuite(BlobTest.class); } public void testBlob() { Market market = new Market("/home/ant"); Repository repository = null; for (Repository item : market) { if (item.getName().equals("repo")) { repository = item; break; } } GitBlob blob = new GitBlob(repository, "ce013625030ba8dba906f756967f9e9ca394464a"); assertTrue(blob.getObjectType() == GitObjectType.Blob); try { assertTrue(new String(blob.getContent(), "ASCII").equals("hello\n")); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "gaoxiaochuan@hotmail.com" ]
gaoxiaochuan@hotmail.com
360a3ccf07fd38eec4ae0aec10702861a771a172
00189b9a72b99e69eb3f1e1453dbd2dda538df19
/15/Exercise15_13/src/InsideARectangle.java
3f3521123bc073e52944ccd98841472c8bf9318e
[]
no_license
denizsalman/Projelerim
10b062f50a04ecdf48bc7cae9de721442a5af17a
60836e389c4397f3b2eb1a0a627d603c590392e7
refs/heads/master
2020-03-28T12:34:36.103543
2018-09-11T12:17:23
2018-09-11T12:17:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,071
java
import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.scene.text.Text; import javafx.stage.Stage; public class InsideARectangle extends Application { Rectangle rectangle = new Rectangle(100, 60, 100, 40); @Override public void start(Stage primaryStage) throws Exception { Pane pane = new Pane(); rectangle.setFill(Color.WHITE); rectangle.setStroke(Color.BLACK); pane.getChildren().add(rectangle); Text text = new Text(); pane.setOnMouseMoved(event -> { text.setText("Mouse point is " + (rectangle.contains(event.getX(), event.getY()) ? "inside" : "outside") + " the rectangle" ); text.setX(event.getX()); text.setY(event.getY()); }); pane.getChildren().add(text); Scene scene = new Scene(pane, 250, 150); primaryStage.setScene(scene); primaryStage.show(); } }
[ "ddenizsalman@gmail.com" ]
ddenizsalman@gmail.com
5865efa0edce515c93d1e0f4d07667f6fafb71ed
9cbcb7392f3263597627f56c10255c21aea20b53
/export_web_chat/src/main/java/cn/mccreefei/enums/LoginTypeEnum.java
8b542c74e1a80544f508e86b1864770ff65fadb2
[]
no_license
pobuing/SaaS-Export
68cc89c83f7feba745b7a55bfbef8d236ef37df0
e1344686a436ef9bcfd2525130d55bc7b172b090
refs/heads/master
2023-01-13T16:30:50.648188
2020-01-09T01:48:32
2020-01-09T01:48:32
228,735,565
1
2
null
2023-01-02T22:12:53
2019-12-18T01:51:34
JavaScript
UTF-8
Java
false
false
432
java
package cn.mccreefei.enums; /** * @author MccreeFei * @create 2018-04-28 下午1:49 */ public enum LoginTypeEnum { LOGIN(1, "上线"), LOGOUT(2, "下线"); private int code; private String desc; LoginTypeEnum(int code, String desc) { this.code = code; this.desc = desc; } public int getCode() { return code; } public String getDesc() { return desc; } }
[ "wangxin2006@qq.com" ]
wangxin2006@qq.com
acd057768b58a23fc13432e72a5ce05b870583ca
3455237f8105a5325821bf1e593749cdbb2015b0
/app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/swiperefreshlayout/R.java
4e07e4bf3a51e6271db2e8c3da2108dfb60993bc
[]
no_license
meyasa/myjne
d9fb8a5e1c3f5a08527c1ae0ea776dd7e8ef9664
4b73102df6e3be5f49b91035b389215ccc51a5f5
refs/heads/master
2021-01-09T12:00:12.176035
2020-02-22T06:46:42
2020-02-22T06:46:42
242,292,495
0
0
null
null
null
null
UTF-8
Java
false
false
10,458
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.swiperefreshlayout; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f020028; public static final int font = 0x7f020086; public static final int fontProviderAuthority = 0x7f020088; public static final int fontProviderCerts = 0x7f020089; public static final int fontProviderFetchStrategy = 0x7f02008a; public static final int fontProviderFetchTimeout = 0x7f02008b; public static final int fontProviderPackage = 0x7f02008c; public static final int fontProviderQuery = 0x7f02008d; public static final int fontStyle = 0x7f02008e; public static final int fontVariationSettings = 0x7f02008f; public static final int fontWeight = 0x7f020090; public static final int ttcIndex = 0x7f020158; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f04003f; public static final int notification_icon_bg_color = 0x7f040040; public static final int ripple_material_light = 0x7f04004a; public static final int secondary_text_default_material_light = 0x7f04004c; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f05004e; public static final int compat_button_inset_vertical_material = 0x7f05004f; public static final int compat_button_padding_horizontal_material = 0x7f050050; public static final int compat_button_padding_vertical_material = 0x7f050051; public static final int compat_control_corner_material = 0x7f050052; public static final int compat_notification_large_icon_max_height = 0x7f050053; public static final int compat_notification_large_icon_max_width = 0x7f050054; public static final int notification_action_icon_size = 0x7f05005f; public static final int notification_action_text_size = 0x7f050060; public static final int notification_big_circle_margin = 0x7f050061; public static final int notification_content_margin_start = 0x7f050062; public static final int notification_large_icon_height = 0x7f050063; public static final int notification_large_icon_width = 0x7f050064; public static final int notification_main_column_padding_top = 0x7f050065; public static final int notification_media_narrow_margin = 0x7f050066; public static final int notification_right_icon_size = 0x7f050067; public static final int notification_right_side_padding_top = 0x7f050068; public static final int notification_small_icon_background_padding = 0x7f050069; public static final int notification_small_icon_size_as_large = 0x7f05006a; public static final int notification_subtext_size = 0x7f05006b; public static final int notification_top_pad = 0x7f05006c; public static final int notification_top_pad_large_text = 0x7f05006d; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f060064; public static final int notification_bg = 0x7f060065; public static final int notification_bg_low = 0x7f060066; public static final int notification_bg_low_normal = 0x7f060067; public static final int notification_bg_low_pressed = 0x7f060068; public static final int notification_bg_normal = 0x7f060069; public static final int notification_bg_normal_pressed = 0x7f06006a; public static final int notification_icon_background = 0x7f06006b; public static final int notification_template_icon_bg = 0x7f06006c; public static final int notification_template_icon_low_bg = 0x7f06006d; public static final int notification_tile_bg = 0x7f06006e; public static final int notify_panel_notification_icon_bg = 0x7f06006f; } public static final class id { private id() {} public static final int action_container = 0x7f07002e; public static final int action_divider = 0x7f070030; public static final int action_image = 0x7f070031; public static final int action_text = 0x7f070037; public static final int actions = 0x7f070038; public static final int async = 0x7f070041; public static final int blocking = 0x7f070044; public static final int chronometer = 0x7f07004f; public static final int forever = 0x7f070064; public static final int icon = 0x7f07006b; public static final int icon_group = 0x7f07006c; public static final int info = 0x7f07006f; public static final int italic = 0x7f070071; public static final int line1 = 0x7f070073; public static final int line3 = 0x7f070074; public static final int normal = 0x7f070081; public static final int notification_background = 0x7f070082; public static final int notification_main_column = 0x7f070083; public static final int notification_main_column_container = 0x7f070084; public static final int right_icon = 0x7f07008f; public static final int right_side = 0x7f070090; public static final int tag_transition_group = 0x7f0700b7; public static final int tag_unhandled_key_event_manager = 0x7f0700b8; public static final int tag_unhandled_key_listeners = 0x7f0700b9; public static final int text = 0x7f0700ba; public static final int text2 = 0x7f0700bb; public static final int time = 0x7f0700bf; public static final int title = 0x7f0700c0; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f080004; } public static final class layout { private layout() {} public static final int notification_action = 0x7f0a0022; public static final int notification_action_tombstone = 0x7f0a0023; public static final int notification_template_custom_big = 0x7f0a0024; public static final int notification_template_icon_group = 0x7f0a0025; public static final int notification_template_part_chronometer = 0x7f0a0026; public static final int notification_template_part_time = 0x7f0a0027; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0d001d; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0e00ed; public static final int TextAppearance_Compat_Notification_Info = 0x7f0e00ee; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e00ef; public static final int TextAppearance_Compat_Notification_Time = 0x7f0e00f0; public static final int TextAppearance_Compat_Notification_Title = 0x7f0e00f1; public static final int Widget_Compat_NotificationActionContainer = 0x7f0e015c; public static final int Widget_Compat_NotificationActionText = 0x7f0e015d; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020028 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f020088, 0x7f020089, 0x7f02008a, 0x7f02008b, 0x7f02008c, 0x7f02008d }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f020086, 0x7f02008e, 0x7f02008f, 0x7f020090, 0x7f020158 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
[ "mysmalik0@gmail.com" ]
mysmalik0@gmail.com
302f6272ff9d3c29450c20ea23dd39ff84559f41
7510960e0a6aea5206de97081fce823e282d6ca8
/monitorstat-dao/src/main/java/com/nearinfinity/hbase/dsl/Table.java
68e1da706b2693394c6d80e5d876e84c18177af4
[]
no_license
sjywying/csp
ef8e348e2866643562edefc8b190e4994f3308ce
c4c858dd0b91dc41be4dd00b639601d23db8fd3a
refs/heads/master
2021-01-18T10:01:02.744898
2013-08-05T06:36:38
2013-08-05T06:36:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
package com.nearinfinity.hbase.dsl; public interface Table<QUERY_OP_TYPE extends QueryOps<ROW_ID_TYPE>, ROW_ID_TYPE> { SaveRow<QUERY_OP_TYPE, ROW_ID_TYPE> save(); FetchRow<ROW_ID_TYPE> fetch(); Scanner<QUERY_OP_TYPE, ROW_ID_TYPE> scan(); Scanner<QUERY_OP_TYPE, ROW_ID_TYPE> scan(ROW_ID_TYPE startId); Scanner<QUERY_OP_TYPE, ROW_ID_TYPE> scan(ROW_ID_TYPE startId, ROW_ID_TYPE endId); DeletedRow<QUERY_OP_TYPE, ROW_ID_TYPE> delete(); }
[ "zunyan.zb@taobao.com" ]
zunyan.zb@taobao.com
5ce2647af40ce45fcdaccf330ced8cbd23c57b82
7924ab62e96a978fc4ae6b66ffbef2845df41519
/src/el_Mahadir/List/SearchList.java
130452d5dfd53e594381e9cf43e874fb6ed68eab
[]
no_license
GharbiAbdelillah/projetHUIss
1cb16b8eb37593d0ce18aec7e81320e6879e7869
57542b175c21b9eecbd46325a74c294e5140b30a
refs/heads/master
2022-11-09T17:17:04.840422
2020-06-24T23:10:47
2020-06-24T23:10:47
271,803,311
0
0
null
null
null
null
UTF-8
Java
false
false
2,009
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 el_Mahadir.List; import javafx.beans.property.SimpleStringProperty; /** * * @author gharbi abdelillah */ public class SearchList { SimpleStringProperty column_رقم_الملف = new SimpleStringProperty(); SimpleStringProperty column_نوع_الملف = new SimpleStringProperty(); SimpleStringProperty column_طبيعة_الملف = new SimpleStringProperty(); SimpleStringProperty column_الطالب = new SimpleStringProperty(); SimpleStringProperty column_المطلوب = new SimpleStringProperty(); public String getColumn_رقم_الملف() { return column_رقم_الملف.get(); } public void setColumn_رقم_الملف(String column_رقم_الملف) { this.column_رقم_الملف .set(column_رقم_الملف); } public String getColumn_نوع_الملف() { return column_نوع_الملف.get(); } public void setColumn_نوع_الملف(String column_نوع_الملف) { this.column_نوع_الملف .set(column_نوع_الملف); } public String getColumn_طبيعة_الملف() { return column_طبيعة_الملف.get(); } public void setColumn_طبيعة_الملف(String column_طبيعة_الملف) { this.column_طبيعة_الملف .set(column_طبيعة_الملف); } public String getColumn_الطالب() { return column_الطالب.get(); } public void setColumn_الطالب(String column_الطالب) { this.column_الطالب .set(column_الطالب); } public String getColumn_المطلوب() { return column_المطلوب.get(); } public void setColumn_المطلوب(String column_المطلوب) { this.column_المطلوب .set(column_المطلوب); } }
[ "gharbiabdelillah62@gmail.com" ]
gharbiabdelillah62@gmail.com
c20fdb03ebd1c6b57198f61a30eb1f11fa857492
32db049d7ef00a8088bfacbdb1520686c2819f1b
/Exercise12_05(Flyweight_country)/src/Student.java
5c18b509a3c214ea36e0847bd70a68938ff71165
[]
no_license
DaniKoch1/SDJ2
9c39c935c39715e83e5d0f5936b804d38d9f831f
08035bc30ab76ce6f35cf5034f54a07b8fb7fdc1
refs/heads/master
2020-04-24T19:10:57.707427
2019-02-23T10:59:53
2019-02-23T10:59:53
172,203,910
0
0
null
null
null
null
UTF-8
Java
false
false
1,107
java
public class Student { private int studyNumber; private String name; private Country nationality; public Student(int studyNumber, String firstName, String lastName, String countryCode, String country) { this.studyNumber=studyNumber; name=firstName+" "+lastName; nationality=CountryFactory.getNationality(countryCode, country); } public int getStudyNumber() { return studyNumber; } public void setStudyNumber(int studyNumber) { this.studyNumber = studyNumber; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Country getNationality() { return nationality; } public void setNationality(Country nationality) { this.nationality = nationality; } public String toString() { return name+": study number: "+studyNumber+", nationality: "+nationality; } public boolean equals(Object obj) { if(!(obj instanceof Student)) return false; Student other=(Student) obj; if(other.name.equals(name)&&other.studyNumber==studyNumber&&other.nationality.equals(nationality)) return true; return false; } }
[ "baqueta.dani@gmail.com" ]
baqueta.dani@gmail.com
6c3ecd74ef1f8daff372ad6b22302190c6da278a
98f20ec801c8acddc757fa4339d21e83dcbb2a02
/adpharma/adpharma.modules/adpharma.client.frontoffice/src/main/java/org/adorsys/adpharma/client/jpa/customervoucher/CustomerVoucherRecordingUser.java
209b2a588b4ec3e181b985deb4bb6e138ec8ec97
[ "Apache-2.0" ]
permissive
francis-pouatcha/forgelab
f7e6bcc47621d4cab0f306c606e9a7dffbbe68e1
fdcbbded852a985f3bd437b639a2284d92703e33
refs/heads/master
2021-03-24T10:37:26.819883
2014-10-08T13:22:29
2014-10-08T13:22:29
15,254,083
0
0
null
null
null
null
UTF-8
Java
false
false
3,592
java
package org.adorsys.adpharma.client.jpa.customervoucher; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import org.adorsys.adpharma.client.jpa.gender.Gender; import org.adorsys.adpharma.client.jpa.login.Login; import org.adorsys.javaext.description.Description; import org.adorsys.javafx.crud.extensions.model.PropertyReader; import org.adorsys.javafx.crud.extensions.view.Association; import org.codehaus.jackson.annotate.JsonIgnoreProperties; @XmlRootElement @XmlAccessorType(XmlAccessType.PROPERTY) @Description("Login_description") @JsonIgnoreProperties(ignoreUnknown = true) public class CustomerVoucherRecordingUser implements Association<CustomerVoucher, Login>, Cloneable { private Long id; private int version; private SimpleStringProperty loginName; private SimpleStringProperty email; private SimpleObjectProperty<Gender> gender; public CustomerVoucherRecordingUser() { } public CustomerVoucherRecordingUser(Login entity) { PropertyReader.copy(entity, this); } public Long getId() { return id; } public final void setId(Long id) { this.id = id; } public int getVersion() { return version; } public final void setVersion(int version) { this.version = version; } public SimpleStringProperty loginNameProperty() { if (loginName == null) { loginName = new SimpleStringProperty(); } return loginName; } public String getLoginName() { return loginNameProperty().get(); } public final void setLoginName(String loginName) { this.loginNameProperty().set(loginName); } public SimpleStringProperty emailProperty() { if (email == null) { email = new SimpleStringProperty(); } return email; } public String getEmail() { return emailProperty().get(); } public final void setEmail(String email) { this.emailProperty().set(email); } public SimpleObjectProperty<Gender> genderProperty() { if (gender == null) { gender = new SimpleObjectProperty<Gender>(); } return gender; } public Gender getGender() { return genderProperty().get(); } public final void setGender(Gender gender) { this.genderProperty().set(gender); } @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; // CustomerVoucherRecordingUser other = (CustomerVoucherRecordingUser) obj; // if(id==other.id) return true; // if (id== null) return other.id==null; // return id.equals(other.id); // } public String toString() { return PropertyReader.buildToString(this, "loginName", "gender"); } @Override public Object clone() throws CloneNotSupportedException { CustomerVoucherRecordingUser a = new CustomerVoucherRecordingUser(); a.id = id; a.version = version; a.loginName = loginName; a.email = email; a.gender = gender; return a; } }
[ "francis.pouatcha@adorsys.com" ]
francis.pouatcha@adorsys.com
b5c8a9458ea12a18f3716d43c6e74fd71f587168
7ed08ac9d57e8cbc90b67cb1dc01784e2139a95f
/TaskTest.java
e44c5bb4cd249f3c7e7fb19214575d9ebb1024a9
[]
no_license
abethun1/CS320-TestAutomation
2fc116b924d95804d2487a285e4900d13043c2b9
d4e42af2edc4e7b9423b8e220e107ae4a03e68a1
refs/heads/main
2023-08-23T16:21:20.771253
2021-10-18T22:40:35
2021-10-18T22:40:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,817
java
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; /** * * @author Toni */ public class TaskTest { /** * Test of class object creation */ @Test public void testTaskClass() { Task run = new Task ("0", "Run", "Do a 5 mile run"); assertTrue(run.getID().equals("0")); assertTrue(run.getName().equals("Run")); assertTrue(run.getDescription().equals("Do a 5 mile run")); } @Test public void testIllegalArgumentsForTaskClass(){ //Test to make sure exception is thrown if ID is null or has too many chars Assertions.assertThrows(IllegalArgumentException.class, () -> { new Task ("1234567891011", "Run", "Do a 5 mile run"); }); Assertions.assertThrows(IllegalArgumentException.class, () -> { new Task (null, "Run", "Do a 5 mile run"); }); //Test to make sure exception is thrown if name of task is null or has too many chars Assertions.assertThrows(IllegalArgumentException.class, () -> { new Task ("0", "Running a maraton may be fun for the first few miles but could.......", "Do a 5 mile run"); }); Assertions.assertThrows(IllegalArgumentException.class, () -> { new Task ("0", null, "Do a 5 mile run"); }); //Test to make sure exception is thrown if description of task is null or has too many chars Assertions.assertThrows(IllegalArgumentException.class, () -> { new Task ("0", "Run", "Do a 5 mile run. " + "Running a maraton may be fun for the first few miles but could" + ".......Running a maraton may be fun for the first few miles but could" + ".......Running a maraton may be fun for the first few miles but could" + ".......Running a maraton may be fun for the first few miles but could" + ".......Running a maraton may be fun for the first few miles but could" + ".......Running a maraton may be fun for the first few miles but could" + ".......Running a maraton may be fun for the first few miles but could" + ".......Running a maraton may be fun for the first few miles but could" + ".......Running a maraton may be fun for the first few miles but could" + "......."); }); Assertions.assertThrows(IllegalArgumentException.class, () -> { new Task ("0", "Run", null); }); } }
[ "32306267+abethun1@users.noreply.github.com" ]
32306267+abethun1@users.noreply.github.com
669f732a53cceb814d6bec634cb3ca351679a1a7
751e4625d4995c8c5a675a4352b7885aaed09e1b
/xwindows-protocol/src/main/java/com/neaterbits/displayserver/protocol/enums/DrawDirection.java
3d8120195d4d05981b721307b370ba4281ab7ab0
[]
no_license
neaterbits/displayserver
ca8b2ef390a59a7fbaa21a2c1cc0ec15ceba681e
31edc49167ceb47e36eb13ae400660c1e0bdbecb
refs/heads/master
2022-02-26T03:59:43.179069
2019-09-12T17:51:11
2019-09-12T17:51:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package com.neaterbits.displayserver.protocol.enums; import com.neaterbits.displayserver.protocol.types.BYTE; public final class DrawDirection extends ByteEnum { public static final int LEFT_TO_RIGHT = 0; public static final int RIGHT_TO_LEFT = 1; public static final BYTE LeftToRight = make(LEFT_TO_RIGHT); public static final BYTE RightToLeft = make(RIGHT_TO_LEFT); }
[ "nils.lorentzen@gmail.com" ]
nils.lorentzen@gmail.com
77aefa1886cb156b7a11adf5a256db6a298821d3
9df88152b16abd74a63d24e75781f857476aa314
/src/main/java/util/Node.java
2f50ec69b263f5560c68497e01091c586d76c7dc
[]
no_license
KF525/grokking-coding-interview
39e04290eac905a2cd6937d9011083919515ee2b
4044efc5ded7da22928cb392240defcdbd46a4a8
refs/heads/main
2023-09-01T03:23:27.913699
2021-10-23T20:47:14
2021-10-23T20:47:14
419,844,807
0
0
null
null
null
null
UTF-8
Java
false
false
193
java
package util; public interface Node<T extends Node> { int getValue(); T getLeft(); T getRight(); void setValue(int val); void setLeft(T node); void setRight(T node); }
[ "katesuzannefulton@gmail.com" ]
katesuzannefulton@gmail.com
09747864bfc8e20960779562f13a6560bdecd54c
9d34c7307d2c925d715bb088faf0ca00e4736fb6
/src/main/java/kz/edu/sdu/diploma/service/EmailService.java
809eff3b36e3f7f3093c53527aa54019a2494730
[]
no_license
Daulet402/edu-library
9b8dfa80f71c5eed428edc9f7da19d70b58ca012
8edbede016c1ef7c3246ffbfd792dde2dffc28da
refs/heads/master
2020-03-19T11:30:26.993136
2018-06-07T10:18:15
2018-06-07T10:38:34
136,459,898
0
0
null
null
null
null
UTF-8
Java
false
false
151
java
package kz.edu.sdu.diploma.service; public interface EmailService { void sendMail(String recipient, String sender, String title, String text); }
[ "daulet.nurgali@kcell.kz" ]
daulet.nurgali@kcell.kz
24413aa9a07b0fa4475d629900abe7836e6ff94a
9f11cb86d6485e19df8df7ad4c0b0e46309175fc
/api/src/main/java/com/ucap/beans/Result.java
07c18a9c98a670a500cddfb7fba86094fe845d96
[]
no_license
GsonGung/elasticsearch
eb5f86d2cefd0535edeb4bf3cf9adb8de07fb241
2565ab1b32ded8f9e7231d81b6c98ee5e6922ce8
refs/heads/master
2021-07-03T02:50:25.000763
2017-09-24T15:35:36
2017-09-24T15:35:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,965
java
package com.ucap.beans; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by caolh on 2017/6/28. */ public class Result implements Serializable { public static void main(String[] args) { Result result = new Result(); System.out.println(result); } private boolean status=false; private String msg=null; private Map dataMap = new HashMap(); //默认count是0 private Integer count =0; //默认结果集是空 private List list = new ArrayList(); //通过构造方法完成组合 public Result() { //默认是0,若改变需要重新dataMap.put("count",num),不能通过设置成员变量count的值 dataMap.put("count",count); //默认list为空,增加直接通过成员变量list add添加元素就可以 dataMap.put("list",list); } /** * 只打印属性status,msg,dataMap * @return */ @Override public String toString() { return "Result{" + "status=" + status + ", msg='" + msg + '\'' + ", dataMap=" + dataMap + '}'; } public boolean isStatus() { return status; } public void setStatus(boolean status) { this.status = status; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public Map getDataMap() { return dataMap; } //禁止setMap // public void setDataMap(Map dataMap) { // this.dataMap = dataMap; // } public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public List getList() { return list; } //禁止setList,防止出错 // public void setList(List list) { // this.list = list; // } }
[ "caolh@ucap.com.cn" ]
caolh@ucap.com.cn
7ef928061f8217ea4cc96e9d23d0fd6d64f9700f
17667bc519a6cb80a3f29f5dce5c38cd4e3506d1
/Ch05_Classes/src/p03/privilege2/C.java
e7aa711e051382d1d811623dda23d96105505a43
[]
no_license
Shin-JS/jsjavaex
80270cf939aa9ff62ad68248304a2f4fcc08219c
17904a9b4e141b892261cc03c72c9512a4b832ea
refs/heads/master
2021-05-07T21:50:49.378814
2017-12-08T07:58:14
2017-12-08T07:58:14
109,063,429
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package p03.privilege2; import p03.privilege.B; //다른 패키지에서 만든 라이브러리를 마치 현재의 패키지에 만든것처럼 사용가능 /** [접근제한자] * **/ public class C{ // A a; //default 클래스: 다른패키지에서 접근불가 B b; //public 클래스: 다른 패키지에서 접근가능 }
[ "shin8702@gmail.com" ]
shin8702@gmail.com
b4a48d3eefb45449e87e2ad020ca017a49bb3c03
ca2ecd51d4edfcd9b301dd251fd6dabfcb9cdf38
/app/src/main/java/com/profile/cv/ahmed/cvprofile/adapter/ImageAdapter.java
b375fd52fdd04d753a20d3d8ecfac84b04c161d7
[]
no_license
droidahmed/prof
3fb36759b17201cb33d205fc33a5ec8335c06482
a9826ad82ff6d991d2b674cf36905d4fd3d3e932
refs/heads/master
2021-01-21T10:05:42.916448
2017-02-28T02:41:49
2017-02-28T02:41:49
83,380,957
0
0
null
null
null
null
UTF-8
Java
false
false
1,870
java
package com.profile.cv.ahmed.cvprofile.adapter; import android.app.Activity; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.profile.cv.ahmed.cvprofile.R; import com.profile.cv.ahmed.cvprofile.model.OfferModel; import java.util.ArrayList; /** * Created by ahmed on 7/19/2016. */ public class ImageAdapter extends RecyclerView .Adapter<ImageAdapter .DataObjectHolder> { private static String LOG_TAG = "MyRecyclerViewAdapter"; private ArrayList<Integer> mDataset; Activity context; public static class DataObjectHolder extends RecyclerView.ViewHolder { ImageView img; public DataObjectHolder(View itemView) { super(itemView); img = (ImageView) itemView.findViewById(R.id.imgItem); Log.i(LOG_TAG, "Adding Listener"); } } public ImageAdapter(Activity context, ArrayList<Integer> myDataset ) { this.mDataset = myDataset; this.context = context; } @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.image_items, parent, false); DataObjectHolder dataObjectHolder = new DataObjectHolder(view); return dataObjectHolder; } @Override public void onBindViewHolder(final DataObjectHolder holder, final int position) { holder.img.setImageResource(mDataset.get(position)); } @Override public int getItemCount() { return mDataset.size(); } }
[ "geo.aaar@gmail.com" ]
geo.aaar@gmail.com
f43720df1fc980b30445117005d0fd0006cd52f5
5b79d24728804882aa6e0e215bd32319b8fea9cb
/MyEventPlanner/app/src/main/java/com/dk/foi/myeventplanner/fragments/PersonalEventDetailsFragment.java
d4c993cdbd79f2dcf7114bc851b4217af229ebf7
[]
no_license
dalkofjac/MyEventPlannerApp
09b09ebbdb98d86aaec3c1eafbe5609df84fa2ad
8f74aedcd523926a0ec6dbbf9458cb65d2ec3f31
refs/heads/master
2020-03-22T21:56:33.932496
2018-09-21T13:27:27
2018-09-21T13:27:27
140,723,258
0
0
null
null
null
null
UTF-8
Java
false
false
844
java
package com.dk.foi.myeventplanner.fragments; import com.dk.foi.data.enums.EventType; import com.dk.foi.myeventplanner.R; import com.dk.foi.myeventplanner.fragments.base.EventDetailsFragmentBase; import com.dk.foi.myeventplanner.webservices.PersonalEventService; public class PersonalEventDetailsFragment extends EventDetailsFragmentBase { public PersonalEventDetailsFragment() { super(EventType.PERSONAL); } @Override protected String getFragmentTitle() { return getResources().getString(R.string.personal_event_details_title); } @Override protected void deleteCurrentEvent() { PersonalEventService eventService = new PersonalEventService(); eventService.delete(getActivity().getIntent().getStringExtra("USER_ID"), String.valueOf(currentEvent.getId())); } }
[ "dadolg22@gmail.com" ]
dadolg22@gmail.com
1d509346520685c85cc35904071cc3af460e303c
c2a6572587c0bfd9682f3d5b33f7223e8a50d2d9
/ea2ddl-dao/src/main/java/jp/sourceforge/ea2ddl/dao/cbean/bs/BsTOperationCB.java
041550af8cd001478df5cd0b4a86c3a55378d248
[ "Apache-2.0" ]
permissive
taktos/ea2ddl
96d6590311196d35c2d1ca1098c4aca3d2a87a39
282aa6c851be220441ee50df5c18ff575dfbe9ac
refs/heads/master
2021-01-19T01:52:01.456128
2016-07-13T06:57:34
2016-07-13T06:57:34
3,493,161
0
0
null
null
null
null
UTF-8
Java
false
false
12,195
java
package jp.sourceforge.ea2ddl.dao.cbean.bs; import java.util.Map; import org.seasar.dbflute.cbean.AbstractConditionBean; import org.seasar.dbflute.cbean.ConditionBean; import org.seasar.dbflute.cbean.ConditionQuery; import org.seasar.dbflute.cbean.SubQuery; import org.seasar.dbflute.cbean.UnionQuery; import org.seasar.dbflute.cbean.sqlclause.SqlClause; import org.seasar.dbflute.dbmeta.DBMetaProvider; import jp.sourceforge.ea2ddl.dao.allcommon.DBFluteConfig; import jp.sourceforge.ea2ddl.dao.allcommon.DBMetaInstanceHandler; import jp.sourceforge.ea2ddl.dao.allcommon.ImplementedSqlClauseCreator; import jp.sourceforge.ea2ddl.dao.cbean.*; import jp.sourceforge.ea2ddl.dao.cbean.cq.*; import jp.sourceforge.ea2ddl.dao.cbean.nss.*; /** * The base condition-bean of t_operation. * @author DBFlute(AutoGenerator) */ public class BsTOperationCB extends AbstractConditionBean { // =================================================================================== // Attribute // ========= private final DBMetaProvider _dbmetaProvider = new DBMetaInstanceHandler(); protected TOperationCQ _conditionQuery; // =================================================================================== // SqlClause // ========= @Override protected SqlClause createSqlClause() { return new ImplementedSqlClauseCreator().createSqlClause(this); } // =================================================================================== // DBMeta Provider // =============== @Override protected DBMetaProvider getDBMetaProvider() { return _dbmetaProvider; } // =================================================================================== // Table Name // ========== public String getTableDbName() { return "t_operation"; } public String getTableSqlName() { return "t_operation"; } // =================================================================================== // PrimaryKey Map // ============== public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { assertPrimaryKeyMap(primaryKeyMap); { Object obj = primaryKeyMap.get("OperationID"); if (obj instanceof java.lang.Integer) { query().setOperationid_Equal((java.lang.Integer)obj); } else { query().setOperationid_Equal(new java.lang.Integer((String)obj)); } } } // =================================================================================== // OrderBy Setting // =============== public ConditionBean addOrderBy_PK_Asc() { query().addOrderBy_Operationid_Asc(); return this; } public ConditionBean addOrderBy_PK_Desc() { query().addOrderBy_Operationid_Desc(); return this; } // =================================================================================== // Query // ===== public TOperationCQ query() { return getConditionQuery(); } public TOperationCQ getConditionQuery() { if (_conditionQuery == null) { _conditionQuery = new TOperationCQ(null, getSqlClause(), getSqlClause().getLocalTableAliasName(), 0); } return _conditionQuery; } /** * {@inheritDoc} * @return The conditionQuery of the local table as interface. (NotNull) */ public ConditionQuery localCQ() { return getConditionQuery(); } // =================================================================================== // Union // ===== /** * Set up 'union'. * <pre> * cb.query().union(new UnionQuery&lt;TOperationCB&gt;() { * public void query(TOperationCB unionCB) { * unionCB.query().setXxx... * } * }); * </pre> * @param unionQuery The query of 'union'. (NotNull) */ public void union(UnionQuery<TOperationCB> unionQuery) { final TOperationCB cb = new TOperationCB(); cb.xsetupForUnion(); unionQuery.query(cb); final TOperationCQ cq = cb.query(); query().xsetUnionQuery(cq); } /** * Set up 'union all'. * <pre> * cb.query().unionAll(new UnionQuery&lt;TOperationCB&gt;() { * public void query(TOperationCB unionCB) { * unionCB.query().setXxx... * } * }); * </pre> * @param unionQuery The query of 'union'. (NotNull) */ public void unionAll(UnionQuery<TOperationCB> unionQuery) { final TOperationCB cb = new TOperationCB(); cb.xsetupForUnion(); unionQuery.query(cb); final TOperationCQ cq = cb.query(); query().xsetUnionAllQuery(cq); } public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } // =================================================================================== // Setup Select // ============ protected TObjectNss _nssTObject; public TObjectNss getNssTObject() { if (_nssTObject == null) { _nssTObject = new TObjectNss(null); } return _nssTObject; } public TObjectNss setupSelect_TObject() { doSetupSelect(new SsCall() { public ConditionQuery qf() { return query().queryTObject(); } }); if (_nssTObject == null || !_nssTObject.hasConditionQuery()) { _nssTObject = new TObjectNss(query().queryTObject()); } return _nssTObject; } // [DBFlute-0.7.4] // =================================================================================== // Specify // ======= protected Specification _specification; public Specification specify() { if (_specification == null) { _specification = new Specification(this, new SpQyCall<TOperationCQ>() { public boolean has() { return true; } public TOperationCQ qy() { return query(); } }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery, getDBMetaProvider()); } return _specification; } public static class Specification extends AbstractSpecification<TOperationCQ> { protected SpQyCall<TOperationCQ> _myQyCall; protected TObjectCB.Specification _tObject; public Specification(ConditionBean baseCB, SpQyCall<TOperationCQ> qyCall , boolean forDeriveReferrer, boolean forScalarSelect, boolean forScalarSubQuery , DBMetaProvider dbmetaProvider) { super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, forScalarSubQuery, dbmetaProvider); _myQyCall = qyCall; } public void columnOperationid() { doColumn("OperationID"); } public void columnObjectId() { doColumn("Object_ID"); } public void columnName() { doColumn("Name"); } public void columnScope() { doColumn("Scope"); } public void columnType() { doColumn("Type"); } public void columnReturnarray() { doColumn("ReturnArray"); } public void columnStereotype() { doColumn("Stereotype"); } public void columnIsstatic() { doColumn("IsStatic"); } public void columnConcurrency() { doColumn("Concurrency"); } public void columnNotes() { doColumn("Notes"); } public void columnBehaviour() { doColumn("Behaviour"); } public void columnGenoption() { doColumn("GenOption"); } public void columnPos() { doColumn("Pos"); } public void columnStyle() { doColumn("Style"); } public void columnPure() { doColumn("Pure"); } public void columnClassifier() { doColumn("Classifier"); } public void columnCode() { doColumn("Code"); } public void columnIsroot() { doColumn("IsRoot"); } public void columnIsleaf() { doColumn("IsLeaf"); } public void columnIsquery() { doColumn("IsQuery"); } public void columnStateflags() { doColumn("StateFlags"); } public void columnEaGuid() { doColumn("ea_guid"); } public void columnStyleex() { doColumn("StyleEx"); } protected void doSpecifyRequiredColumn() { columnOperationid();// PK if (_myQyCall.qy().hasConditionQueryTObject()) { columnObjectId();// FK } } protected String getTableDbName() { return "t_operation"; } public TObjectCB.Specification specifyTObject() { assertForeign("tObject"); if (_tObject == null) { _tObject = new TObjectCB.Specification(_baseCB, new SpQyCall<TObjectCQ>() { public boolean has() { return _myQyCall.has() && _myQyCall.qy().hasConditionQueryTObject(); } public TObjectCQ qy() { return _myQyCall.qy().queryTObject(); } } , _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery, _dbmetaProvider); } return _tObject; } public RAFunction<TOperationparamsCB, TOperationCQ> derivedTOperationparamsList() { return new RAFunction<TOperationparamsCB, TOperationCQ>(_baseCB, _myQyCall.qy(), new RAQSetupper<TOperationparamsCB, TOperationCQ>() { public void setup(String function, SubQuery<TOperationparamsCB> subQuery, TOperationCQ cq, String aliasName) { cq.xsderiveTOperationparamsList(function, subQuery, aliasName); } }, _dbmetaProvider); } } // =================================================================================== // Display SQL // =========== @Override protected String getLogDateFormat() { return DBFluteConfig.getInstance().getLogDateFormat(); } @Override protected String getLogTimestampFormat() { return DBFluteConfig.getInstance().getLogTimestampFormat(); } // =================================================================================== // Internal // ======== // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return TOperationCB.class.getName(); } protected String getConditionQueryClassNameInternally() { return TOperationCQ.class.getName(); } protected String getSubQueryClassNameInternally() { return SubQuery.class.getName(); } }
[ "taktos9@136db618-7844-41ca-8ac1-fb3fd040db1d" ]
taktos9@136db618-7844-41ca-8ac1-fb3fd040db1d
7ca7958817493a148b215286d99b1827ad38bdb0
db6738dc01e86b9fab6f35d4c2fb7a97eda67aeb
/src/info/qrees/android/brains/Log.java
335eb5c84cdae9f87c4e4de5ec2f1c10d8967a61
[]
no_license
qrees/64b-Brains
3c8f67eeb4f0ba1b094653d8745b9f30670a2e02
e4f68f41fa5ce175cc900dfd8fbc3b087db4eb38
refs/heads/master
2021-01-13T01:26:49.249850
2012-08-23T19:33:30
2012-08-23T19:33:30
1,715,187
0
0
null
null
null
null
UTF-8
Java
false
false
545
java
package info.qrees.android.brains; public class Log { private static final String TAG = "Brains"; static public void d(String msg, Object ... args){ String formatted = String.format(msg, args); android.util.Log.d(TAG, formatted); } static public void w(String msg, Object ... args){ String formatted = String.format(msg, args); android.util.Log.w(TAG, formatted); } static public void e(String msg, Throwable tr, Object ... args){ String formatted = String.format(msg, args); android.util.Log.e(TAG, formatted, tr); } }
[ "qreesp@gmail.com" ]
qreesp@gmail.com
901a8d658dd485c3661d4a3b9d6ddddd24a5fd1f
0ac31576b1085b61fe26223c623084d5c8435b4c
/wxcp/com/huiju/weixin/cp/bean/messagebuilder/VoiceBuilder.java
c13d7ce91cfb689e276fa7d823f33347bd42b210
[]
no_license
Miaque/weixinTools1
6004f89347e5421077e3ed91e6e116e85ebf6b1e
37fedb71377ec65073cb550104d055333333a634
refs/heads/master
2021-01-01T03:45:50.994631
2016-05-19T03:13:29
2016-05-19T03:13:29
58,922,609
0
0
null
null
null
null
UTF-8
Java
false
false
924
java
package com.huiju.weixin.cp.bean.messagebuilder; import com.huiju.weixin.common.api.WxConsts; import com.huiju.weixin.cp.bean.WxCpMessage; /** * 语音消息builder * <pre> * 用法: WxCustomMessage m = WxCustomMessage.VOICE().mediaId(...).toUser(...).build(); * </pre> * @author Daniel Qian * */ public final class VoiceBuilder extends BaseBuilder<VoiceBuilder> { /** * 媒体ID */ private String mediaId; /** * 默认构造函数 */ public VoiceBuilder() { this.msgType = WxConsts.CUSTOM_MSG_VOICE; } /** * 媒体文件ID * @param media_id 媒体文件ID * @return 返回VoiceBuilder */ public VoiceBuilder mediaId(String media_id) { this.mediaId = media_id; return this; } /** * 消息实体创建 * @return 返回WxCpMessage */ public WxCpMessage build() { WxCpMessage m = super.build(); m.setMediaId(this.mediaId); return m; } }
[ "miaque@163.com" ]
miaque@163.com
b271ffe5542970d30aec1ed1efdfb120b1a4d3ae
9ffb3c6562e0b5a6fb7104267d2930beedf460a6
/hdms-community/hdms-biz/src/main/java/com/honvay/hdms/dms/model/request/UpdateTagRequest.java
91d48f467481bc393fcb9d2298b5fba1ddf6295e
[]
no_license
jingfh/FileManageSystem
d52fff741a5d3f3fea7c3b19f5f99a856982a4cf
92962385e9b5fae57be025fac2790ab05d8bd3bb
refs/heads/master
2020-05-15T01:24:11.556343
2019-04-18T06:59:40
2019-04-18T06:59:40
182,028,873
1
0
null
null
null
null
UTF-8
Java
false
false
703
java
/* Copyright (c) 2019. 本项目所有源码受中华人民共和国著作权法保护,已登记软件著作权。 * 本项目版权归南昌瀚为云科技有限公司所有,本项目仅供学习交流使用,未经许可不得进行商用,开源(社区版)遵守AGPL-3.0协议。 * */ package com.honvay.hdms.dms.model.request; import com.honvay.hdms.auth.core.AuthenticatedUser; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; /** * @author LIQIU * created on 2019/3/1 **/ @Data public class UpdateTagRequest { @NotNull private Integer id; @NotEmpty private String tags; private AuthenticatedUser user; }
[ "2904722702@qq.com" ]
2904722702@qq.com
ba217f7354ff1d14dd59872b6b8f80151f2436b0
01e1b1b60b55c3710f55155760f4bb7a27d0d301
/src/main/java/com/jagex/mobilesdk/payments/comms/PaymentComms.java
d372cde7a77550f346f2324c82da1b0ac3991252
[]
no_license
uttaravadina/devlotto-osrs-mobile
5dfc4e115ab92cb51ce8eae981252c85d522bb84
c03025b306df394a9470ede04c02d2217b0de4ee
refs/heads/master
2022-01-18T09:48:18.454862
2019-08-16T19:25:35
2019-08-16T19:25:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,147
java
package com.jagex.mobilesdk.payments.comms; import com.jagex.mobilesdk.auth.model.MobileAuthState; import com.jagex.mobilesdk.common.comms.CommsUtils; import com.jagex.mobilesdk.payments.comms.CompletePaymentComms.CompletePaymentCallback; import com.jagex.mobilesdk.payments.comms.FetchImageComms.FetchImageCallback; import com.jagex.mobilesdk.payments.comms.FetchPackagesComms.FetchPackagesCallback; import com.jagex.mobilesdk.payments.model.PaymentCompletionRequest; import java.util.HashMap; import java.util.Locale; public class PaymentComms { public static void FetchImageComms(String str, FetchImageCallback fetchImageCallback, boolean z) { FetchImageComms fetchImageComms = new FetchImageComms(str, fetchImageCallback); if (z) { fetchImageComms.execute(new Void[0]); } else { fetchImageComms.fetchImagePostAction(fetchImageComms.fetchImageAction(str), fetchImageCallback); } } public static void completePaymentsComms(String str, MobileAuthState mobileAuthState, PaymentCompletionRequest paymentCompletionRequest, CompletePaymentCallback completePaymentCallback, boolean z) { HashMap hashMap = new HashMap(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("Bearer "); stringBuilder.append(mobileAuthState.getAccessToken()); hashMap.put(CommsUtils.HTTP_HEADER_AUTHORIZATION, stringBuilder.toString()); hashMap.put(CommsUtils.HTTP_HEADER_CONTENT_TYPE, CommsUtils.HTTP_HEADER_ACCEPT_JSON); hashMap.put(CommsUtils.HTTP_HEADER_ACCEPT_TYPE, CommsUtils.HTTP_HEADER_ACCEPT_JSON); CompletePaymentComms completePaymentComms = new CompletePaymentComms(str, hashMap, paymentCompletionRequest, completePaymentCallback); if (z) { completePaymentComms.execute(new Void[0]); } else { completePaymentComms.completePaymentPostAction(completePaymentComms.completePaymentAction(str, hashMap, paymentCompletionRequest), completePaymentCallback); } } public static void fetchPackagesComms(String str, MobileAuthState mobileAuthState, float f, FetchPackagesCallback fetchPackagesCallback, boolean z) { HashMap hashMap = new HashMap(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("Bearer "); stringBuilder.append(mobileAuthState.getAccessToken()); hashMap.put(CommsUtils.HTTP_HEADER_AUTHORIZATION, stringBuilder.toString()); stringBuilder = new StringBuilder(); stringBuilder.append(f); stringBuilder.append(",d=android"); hashMap.put(CommsUtils.HTTP_HEADER_ACCEPT_RESOLUTION, stringBuilder.toString()); hashMap.put(CommsUtils.HTTP_HEADER_ACCEPT_LANGUAGE, Locale.getDefault().getLanguage()); FetchPackagesComms fetchPackagesComms = new FetchPackagesComms(str, hashMap, fetchPackagesCallback); if (z) { fetchPackagesComms.execute(new Void[0]); } else { fetchPackagesComms.fetchPackagesPostAction(fetchPackagesComms.fetchPackagesAction(str, hashMap), fetchPackagesCallback); } } }
[ "=" ]
=
73ee7c4c5b2832c92f43256e2168f04c418356af
cb23fa0d1d0f71e74554cdd1e5aedcd15aa7b1f4
/app/src/androidTest/java/mp/tareas/tarea5/ExampleInstrumentedTest.java
7d088be9b6c434e141ba4acf4181a38cef6b6c75
[]
no_license
MarcoFParra/tarea5
702c546ba8690c113000b4ab15eeb26de3e8123f
b513e27a1aaf84978c54500142a954f8c365dc9a
refs/heads/master
2020-08-27T14:00:12.303402
2019-10-31T17:58:20
2019-10-31T17:58:20
217,396,755
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package mp.tareas.tarea5; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.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() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("mp.tareas.tarea5", appContext.getPackageName()); } }
[ "marco_an_fi_pa@hotmail.com" ]
marco_an_fi_pa@hotmail.com
60dbb056a02e4614a225720e781d5f5ff307f405
abb5efea02f85930c89c18c6b0f172e36c3dbc89
/app/src/main/java/com/example/gulei/myapplication/common/callback/CommonCallback.java
ffb39404db39ccb8b18323c15b91e0339b5f9327
[]
no_license
MorningGu/MyApplication
ff2bf7e99774852fb5d461405089a9c3a316f97f
de6fc5fec570bcda6230840555c2a45c5338a5f9
refs/heads/master
2021-01-17T16:00:44.086046
2016-06-16T02:39:46
2016-06-16T02:39:46
58,100,824
0
1
null
2016-05-05T05:50:26
2016-05-05T03:13:56
Java
UTF-8
Java
false
false
1,168
java
package com.example.gulei.myapplication.common.callback; import com.lzy.okhttputils.callback.AbsCallback; import com.lzy.okhttputils.request.BaseRequest; /** * ================================================ * 作 者:jeasonlzy(廖子尧) * 版 本:1.0 * 创建日期:2016/4/8 * 描 述:我的Github地址 https://github.com/jeasonlzy0216 * 修订历史:该类主要用于在所有请求之前添加公共的请求头或请求参数,例如登录授权的 token,使用的设备信息等 * ================================================ */ public abstract class CommonCallback<T> extends AbsCallback<T> { @Override public void onBefore(BaseRequest request) { super.onBefore(request); //如果账户已经登录,就添加 token 等等 // request.headers("CallBackHeaderKey1", "CallBackHeaderValue1")// // .headers("CallBackHeaderKey2", "CallBackHeaderValue2")// // .params("CallBackParamsKey1", "CallBackParamsValue1")// // .params("CallBackParamsKey2", "CallBackParamsValue1")// // .params("token", "3215sdf13ad1f65asd4f3ads1f"); } }
[ "morninggu@foxmail.com" ]
morninggu@foxmail.com
52672861823b27eabb381d84057dc87024c65e74
233cdc6811e2b44dff6381fbb000577e8558fd16
/src/main/java/stsjorbsmod/cards/wanderer/CorpseExplosion_Wanderer.java
b39f7fd1ddf92009de14716b4cb9273b775f2b09
[ "MIT" ]
permissive
mderb4/jorbs-spire-mod
32c067383c0a0f81e401e6243bf79a33786cf08c
2a32faff0a9697c8b0cc176e610449b66d265c50
refs/heads/master
2020-09-05T14:17:04.286814
2019-11-06T05:47:17
2019-11-06T05:47:17
220,130,351
0
0
MIT
2019-11-07T02:05:12
2019-11-07T02:05:12
null
UTF-8
Java
false
false
2,112
java
package stsjorbsmod.cards.wanderer; import com.megacrit.cardcrawl.actions.AbstractGameAction.AttackEffect; import com.megacrit.cardcrawl.actions.common.DamageAction; import com.megacrit.cardcrawl.cards.DamageInfo; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.monsters.AbstractMonster; import stsjorbsmod.JorbsMod; import stsjorbsmod.cards.CustomJorbsModCard; import stsjorbsmod.actions.RememberSpecificMemoryAction; import stsjorbsmod.characters.Wanderer; import stsjorbsmod.memories.WrathMemory; import stsjorbsmod.patches.EntombedField; import static stsjorbsmod.JorbsMod.makeCardPath; import static stsjorbsmod.characters.Wanderer.Enums.REMEMBER_MEMORY; public class CorpseExplosion_Wanderer extends CustomJorbsModCard { public static final String ID = JorbsMod.makeID(CorpseExplosion_Wanderer.class.getSimpleName()); public static final String IMG = makeCardPath("Damage_Uncommons/corpse_explosion_wanderer.png"); private static final CardRarity RARITY = CardRarity.UNCOMMON; private static final CardTarget TARGET = CardTarget.ENEMY; private static final CardType TYPE = CardType.ATTACK; public static final CardColor COLOR = Wanderer.Enums.WANDERER_GRAY_COLOR; private static final int COST = 1; private static final int DAMAGE = 12; private static final int UPGRADE_PLUS_DAMAGE = 4; public CorpseExplosion_Wanderer() { super(ID, IMG, COST, TYPE, COLOR, RARITY, TARGET); baseDamage = DAMAGE; EntombedField.entombed.set(this, true); exhaust = true; tags.add(REMEMBER_MEMORY); } @Override public void use(AbstractPlayer p, AbstractMonster m) { addToBot(new RememberSpecificMemoryAction(new WrathMemory(p, false))); addToBot(new DamageAction(m, new DamageInfo(p, damage), AttackEffect.FIRE)); } @Override public void upgrade() { if (!upgraded) { upgradeName(); upgradeDamage(UPGRADE_PLUS_DAMAGE); initializeDescription(); } } }
[ "dan@dbjorge.net" ]
dan@dbjorge.net
26b7fe59c38c5c2601a1caeaa1d568c9bf3d3590
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
/aliyun-java-sdk-dms-enterprise/src/main/java/com/aliyuncs/dms_enterprise/model/v20181101/GetLogicDatabaseResponse.java
575adcec44cad6bb378c95258912918d661ae6d5
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-java-sdk
a263fa08e261f12d45586d1b3ad8a6609bba0e91
e19239808ad2298d32dda77db29a6d809e4f7add
refs/heads/master
2023-09-03T12:28:09.765286
2023-09-01T09:03:00
2023-09-01T09:03:00
39,555,898
1,542
1,317
NOASSERTION
2023-09-14T07:27:05
2015-07-23T08:41:13
Java
UTF-8
Java
false
false
3,986
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.dms_enterprise.model.v20181101; import java.util.List; import com.aliyuncs.AcsResponse; import com.aliyuncs.dms_enterprise.transform.v20181101.GetLogicDatabaseResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class GetLogicDatabaseResponse extends AcsResponse { private String requestId; private String errorCode; private String errorMessage; private Boolean success; private LogicDatabase logicDatabase; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getErrorCode() { return this.errorCode; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public String getErrorMessage() { return this.errorMessage; } public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } public Boolean getSuccess() { return this.success; } public void setSuccess(Boolean success) { this.success = success; } public LogicDatabase getLogicDatabase() { return this.logicDatabase; } public void setLogicDatabase(LogicDatabase logicDatabase) { this.logicDatabase = logicDatabase; } public static class LogicDatabase { private String databaseId; private String dbType; private Boolean logic; private String schemaName; private String searchName; private String envType; private String alias; private List<String> ownerIdList; private List<String> ownerNameList; private List<Long> databaseIds; public String getDatabaseId() { return this.databaseId; } public void setDatabaseId(String databaseId) { this.databaseId = databaseId; } public String getDbType() { return this.dbType; } public void setDbType(String dbType) { this.dbType = dbType; } public Boolean getLogic() { return this.logic; } public void setLogic(Boolean logic) { this.logic = logic; } public String getSchemaName() { return this.schemaName; } public void setSchemaName(String schemaName) { this.schemaName = schemaName; } public String getSearchName() { return this.searchName; } public void setSearchName(String searchName) { this.searchName = searchName; } public String getEnvType() { return this.envType; } public void setEnvType(String envType) { this.envType = envType; } public String getAlias() { return this.alias; } public void setAlias(String alias) { this.alias = alias; } public List<String> getOwnerIdList() { return this.ownerIdList; } public void setOwnerIdList(List<String> ownerIdList) { this.ownerIdList = ownerIdList; } public List<String> getOwnerNameList() { return this.ownerNameList; } public void setOwnerNameList(List<String> ownerNameList) { this.ownerNameList = ownerNameList; } public List<Long> getDatabaseIds() { return this.databaseIds; } public void setDatabaseIds(List<Long> databaseIds) { this.databaseIds = databaseIds; } } @Override public GetLogicDatabaseResponse getInstance(UnmarshallerContext context) { return GetLogicDatabaseResponseUnmarshaller.unmarshall(this, context); } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
b2988bb26913994c3907094d2780f1c62d43e576
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MOCKITO-7b-4-8-SPEA2-WeightedSum:TestLen:CallDiversity/org/mockito/internal/stubbing/defaultanswers/ReturnsDeepStubs_ESTest.java
9c138518cdaae571df7cd0538a9d1133c409d1cc
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
583
java
/* * This file was automatically generated by EvoSuite * Mon Apr 06 18:04:27 UTC 2020 */ package org.mockito.internal.stubbing.defaultanswers; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class ReturnsDeepStubs_ESTest extends ReturnsDeepStubs_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
af7e2a71b8fd3d447cb0d521fed765eddf57b837
f696f955a8d9f6cb87b113100451d50363b5be47
/src/main/java/org/myhost/App.java
aa64c5ee90bfed52cf8e208a35df878846fa8365
[]
no_license
dev4jcoder/startApp
122020ae46b86f50519859e3b8d4142957525c11
2c5da2609ecfcd185a96757bff48bce501addeb1
refs/heads/master
2020-05-20T12:40:36.451339
2017-01-30T12:55:23
2017-01-30T12:55:23
80,416,025
0
0
null
null
null
null
UTF-8
Java
false
false
186
java
package org.myhost; /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } }
[ "dev4j@yandex.ua" ]
dev4j@yandex.ua
ef5eb0ee377f51e30bc509e601dac4cc47d9f2e7
06b8eec1095b988a9dccc59639b5a2d480aa69c1
/src/main/java/ucf/assignments/Item.java
dc356c3636bd7da81863809bac9c8682517b3b8d
[]
no_license
udaygudipudi/Gudipudi-cop3330-assignment4
905280b013a80e39401daaf776e79dc9a07ce8ea
87bccb00bb52b9b34f6704c3d7db6e91a709a876
refs/heads/master
2023-08-30T05:27:22.461777
2021-11-02T01:19:43
2021-11-02T01:19:43
423,667,672
0
0
null
null
null
null
UTF-8
Java
false
false
1,471
java
package ucf.assignments; public class Item { private String title; private String description; private String duedate; private String check; public Item() { /* Set temp title to blank Set temp description to blank Set temp duedate to blank Set temp check to incomplete */ } public void readtitle () { /* return current title */ } public void newtitle () { /* takes in the new title as a parameter sets it to current return current title */ } public void readdescription () { /* return description */ } public void newdescription () { /* takes in the new description as a parameter sets it to current return current description */ } public void readduedate () { /* return duedate */ } public void newduedate () { /* takes in the new duedate as a parameter sets it to current return current duedate */ } public void readcheck () { /* return check */ } public void newcheck () { /* takes in the new check as a parameter sets it to current return current check */ } }
[ "udaygudipudi@knights.ucf.edu" ]
udaygudipudi@knights.ucf.edu
b5693d5733303ad9c4bed81809c0c9e2103d4984
d2b2097add60d3cf5a0108fa3d45aaa22d242b65
/src/main/java/com/tango/down/books/BooksRepository.java
164ac9a10252a5ee002b5b353569a2ec92b224a5
[]
no_license
kolo246/SimplyCRUDLibrary
1998df4bce166e2c9c348d63fc6c08ae1f631cfe
31ec132780cd41acfa76281700430fccc1651ce2
refs/heads/master
2023-06-28T23:56:57.863814
2021-05-14T15:25:59
2021-05-14T15:25:59
391,034,451
0
0
null
null
null
null
UTF-8
Java
false
false
376
java
package com.tango.down.books; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import java.util.Optional; public interface BooksRepository extends CrudRepository<Books, Long> { @Query("select b from Books b where b.id = ?1 and b.borrow = ?2") Optional<Books> findBookById(Long id, boolean isBorrow); }
[ "przesiak26@gmail.com" ]
przesiak26@gmail.com
683e8aff3a19cd53c78f3d686a8a451fac908190
70d905105165f012b3ddb1b357d269c5023d1e0c
/OOSD_proj/src/model/UtenteModeratore.java
f5df5b0f59180e825cb82541aec85196173933bd
[]
no_license
BestDogeGitHub/Progetto-OOSD
b3a9f653f0ac30833367bfb15e6588e75d6c59b2
c9d5a8ec6b1572b82364f84168edfd2560f86df2
refs/heads/master
2020-07-11T02:54:21.699372
2019-09-02T14:28:34
2019-09-02T14:28:34
204,430,999
0
0
null
null
null
null
UTF-8
Java
false
false
2,832
java
package model; import java.time.*; import model.TipiEnum.*; import java.sql.ResultSet; import java.sql.SQLException; /** * classe utilizzata per raccogliere le informazioni di utenti di grado moderatore o superiore, questi utenti * oltre ai dati degli utenti normali conservano l'id dell'utente che gli ha promossi, la data dell'ultima * promozione e il numero di pubblicazioni inserite * * @author fulvio lapenna * */ public class UtenteModeratore extends UtenteBase { /** * l'id dell'utente che lo ha promosso */ private int promotore; /** * la data dell'ultima promozione */ private LocalDate dataPromozione; /** * il numero di pubblicazioni inserite dall'utente */ private int numPubb; /** * costruttore che raccoglie tutti i dati di un utente moderatore ottenuti dal database * * @param iD * @param username * @param ruolo * @param utenteEliminato * @param dataUltimaRecensione * @param nome * @param cognome * @param dataNascita * @param luogoNascita * @param residenza * @param email * @param pass * @param promotore * @param dataPromozione * @param numPubb */ public UtenteModeratore(int iD, String username, RuoloUtente ruolo, boolean utenteEliminato, LocalDate dataUltimaRecensione, String nome, String cognome, LocalDate dataNascita, String luogoNascita, String residenza, String email, String pass, int promotore, LocalDate dataPromozione, int numPubb) { super(iD, username, ruolo, utenteEliminato, dataUltimaRecensione, nome, cognome, dataNascita, luogoNascita, residenza,email, pass); this.promotore = promotore; this.dataPromozione = dataPromozione; this.numPubb = numPubb; } /** * costruttore utilizzato per istanziare un utente moderatore tramite i dati forniti dal database in forma di resultSet * * @param rs * @param rsmod * @throws SQLException */ public UtenteModeratore( ResultSet rs, ResultSet rsmod ) throws SQLException { super( rs ); this.setPromotore( rsmod.getInt("Promotore") ); this.setDataPromozione( rsmod.getObject("DataPromozione", LocalDate.class) ); this.setNumPubb( rsmod.getInt("NumPubb") ); } public int getPromotore() { return promotore; } public void setPromotore(int promotore) { this.promotore = promotore; } public LocalDate getDataPromozione() { return dataPromozione; } public void setDataPromozione(LocalDate dataPromozione) { this.dataPromozione = dataPromozione; } public int getNumPubb() { return numPubb; } public void setNumPubb(int numPubb) { this.numPubb = numPubb; } public String toString() { return super.toString() + "UtenteModeratore [promotore=" + promotore + ", dataPromozione=" + dataPromozione + ", numPubb=" + numPubb + "]"; } }
[ "elful@LAPTOP-K9IOBEMV" ]
elful@LAPTOP-K9IOBEMV
427962328cbbfd5294bdefbf9f2c44d1182d0234
ed09118e0413c04f7239727b9cf363e8d67650c0
/Programming Basics/Exams_Practise/exam_16_07_17/p03_play_tickets.java
2c06cb1d81707ff715f3311bee64fc37d2e55892
[]
no_license
marmotka/Basics---Software-University---exersices
71ee644f8efe982077a356bbdec3dd64307bfe3e
1e56aadf4cd5445592c8a8dc0b1caffc6ad5f593
refs/heads/master
2021-06-16T18:03:38.084891
2017-05-16T20:53:52
2017-05-16T20:53:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,414
java
package exam_16_07_17; import java.util.Scanner; public class p03_play_tickets { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double budjet = Double.parseDouble(scan.nextLine()); String type = scan.nextLine().toLowerCase(); int peopleCount = Integer.parseInt(scan.nextLine()); double ticketsprice; // switch (type) { // case ("vip"): // ticketsprice = 499.99 * peopleCount; // break; // case ("normal"): // ticketsprice = 249.99 * peopleCount; // break; // } if (type.equals("vip")) { ticketsprice = 499.99 * peopleCount; } else { ticketsprice = 249.99 * peopleCount; } if (peopleCount < 5) { budjet = 0.25 * budjet; } else if (peopleCount < 10) { budjet = 0.4 * budjet; } else if (peopleCount < 25) { budjet = 0.5 * budjet; } else if (peopleCount < 50) { budjet = 0.6 * budjet; } else { budjet = 0.75 * budjet; } double diff = budjet - ticketsprice; if (diff >= 0) { System.out.printf("Yes! You have %.2f leva left.", diff); } else { System.out.printf("Not enough money! You need %.2f leva.",Math.abs(diff)); } } }
[ "dimanas@gmail.com" ]
dimanas@gmail.com
4733dcbedcc0d736aadcdf3240a3ef2b0424050c
86ce703dc1501cffa0c118cd590241cca1a7180e
/5th SEM/CO323/Lab03/Netbeans/TokenBucket/src/Bucket.java
a0df3db49296c79c1da6cda945e8a6f228f5aa0d
[]
no_license
GeethPriyanka/Academic_work
56da01ceedb9223e3a9a713635a4474e2a6ad2ad
2892e92f42f3fdd08d82fc32d147e8260611f935
refs/heads/master
2020-04-10T06:23:38.723773
2019-01-22T14:07:55
2019-01-22T14:07:55
160,853,009
0
1
null
null
null
null
UTF-8
Java
false
false
1,374
java
import java.util.Arrays; import java.util.concurrent.TimeUnit; /* * 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 Geeth */ class Bucket { int size; int [] bucketBuffer; int pointer; public Bucket(int size) throws InterruptedException{ size = this.size; bucketBuffer = new int [size]; Arrays.fill(bucketBuffer,0); //initializing the array buffer to 0 pointer= 0; //points to the top while(true){ bucketBuffer[pointer]=1; //marking tokenss TimeUnit.SECONDS.sleep(1); //wait for a second pointer++; if(pointer==size){ // if token bucket gets full make the counter constant pointer--; } } } int issueToken(int numOfTokens){ if(pointer<numOfTokens){ System.out.println("number of tokens are limited"); return pointer; }else{ for(int i=pointer;i>pointer-numOfTokens;i--){ bucketBuffer[i]=0; } pointer = pointer-numOfTokens; return numOfTokens; } } }
[ "geeth.priyanka@yahoo.com" ]
geeth.priyanka@yahoo.com
5babf8e08950bf9b14598ad9c2bf415160cc4f99
1bf3eac9026474436f34e460d51ee221a9a99521
/TestDemo/src/com/luban/net2/UDPReceDemo.java
6bdcfe4b236558815d043af5d9fd36abb8b88c4f
[]
no_license
xmhjava/newlintList
9da0fe0a99d7ba167366e0ffb6531d175b02f540
60a0d34de45a4752958109ce23fd4a4fcbdaa613
refs/heads/master
2023-02-05T09:44:13.829313
2020-12-29T02:47:31
2020-12-29T02:48:00
320,144,353
1
0
null
null
null
null
GB18030
Java
false
false
1,397
java
package com.luban.net2; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; public class UDPReceDemo { public static void main(String[] args) throws Exception { System.out.println("接收端启动。。。。。。。"); /** * 建立UDP接收端的思路 * 1,建立udp socket服务,因为是接收数据,必须要明确一个端口号 * 2,创建数据包,用于存储接收到的数据。方便用数据包对象的方法解析 * 3,使用socket服务的receive方法将接收的数据存储到数据包中 * 4,通过数据包的方法解析数据包中的数据 * 5,关闭资源 */ //建立udp socket服务 DatagramSocket ds=new DatagramSocket(10000); //2创建数据包 byte[] buf=new byte[1024]; DatagramPacket dp=new DatagramPacket(buf, buf.length); //使用接收方法将数据存储到数据包中 ds.receive(dp);//堵塞式的 //通过数据包对象的方法,解析其中的数据,比如,地址,端口,数据内容 String ip = dp.getAddress().getHostAddress(); int port = dp.getPort(); System.out.println("==ip=="+ip); String text=new String(dp.getData(),0,dp.getLength()); System.out.println(ip+":"+port+":"+text); //关闭资源 ds.close(); } }
[ "1395233280@qq.com" ]
1395233280@qq.com
5fa507f006534c37e005e91c41d5a7ee0a5de9a7
b5aff40e2f45ead5082191b72e8c6d764aef2d57
/app/src/main/java/com/dustoreapplication/android/ui/personal/EditCustomerInfoActivity.java
5370ef35bc826fc9d7a195f4bacb35254042d066
[]
no_license
1614202740/DuStoreApplication
05013576763a60487272a857d7354bbe4363f2ca
bd7f81706dd6767c563c925c700567dacbd692a5
refs/heads/master
2022-10-26T05:51:37.840043
2020-06-18T12:15:46
2020-06-18T12:15:46
271,226,641
0
0
null
null
null
null
UTF-8
Java
false
false
5,844
java
package com.dustoreapplication.android.ui.personal; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.AppCompatEditText; import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatTextView; import androidx.appcompat.widget.LinearLayoutCompat; import androidx.appcompat.widget.Toolbar; import androidx.lifecycle.ViewModelProvider; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.util.MutableInt; import android.view.Menu; import android.view.MenuItem; import com.bumptech.glide.Glide; import com.dustoreapplication.android.DuApplication; import com.dustoreapplication.android.R; import com.dustoreapplication.android.logic.service.CustomerIntentService; import com.orhanobut.dialogplus.DialogPlus; import de.hdodenhof.circleimageview.CircleImageView; public class EditCustomerInfoActivity extends AppCompatActivity { private Toolbar mToolbar; private LinearLayoutCompat avatarLinearLayout; private LinearLayoutCompat nameLinearLayout; private LinearLayoutCompat sexLinearLayout; private LinearLayoutCompat detailLinearLayout; private CircleImageView avatarImageView; private AppCompatTextView nameTextView; private AppCompatTextView sexTextView; private AppCompatTextView detailTextView; private EditInfoViewModel mViewModel; private AlertDialog.Builder builder; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_customer_info); initView(); initToolbar(); mViewModel = new ViewModelProvider(this).get(EditInfoViewModel.class); mViewModel.getAvatarUrl().observe(this,avatar-> Glide.with(this).load(avatar).into(avatarImageView)); mViewModel.getName().observe(this,name->nameTextView.setText(name)); mViewModel.getSex().observe(this,sex->sexTextView.setText(sex)); mViewModel.getDetail().observe(this,detail->detailTextView.setText(detail)); mViewModel.initData(DuApplication.customer); nameLinearLayout.setOnClickListener(v-> showNameDialog()); sexLinearLayout.setOnClickListener(v->showSexDialog()); detailLinearLayout.setOnClickListener(v->showDetailDialog()); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.edit_info_toolbar_menu,menu); return true; } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { int id = item.getItemId(); if(id==R.id.action_save){ CustomerIntentService.startActionEdit(this,mViewModel.customer); } return super.onOptionsItemSelected(item); } private void initToolbar(){ setSupportActionBar(mToolbar); mToolbar.setNavigationOnClickListener(v->finish()); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } private void initView(){ mToolbar = findViewById(R.id.toolbar); avatarLinearLayout = findViewById(R.id.edit_info_avatar_ll); nameLinearLayout = findViewById(R.id.edit_info_name_ll); sexLinearLayout = findViewById(R.id.edit_info_sex_ll); detailLinearLayout = findViewById(R.id.edit_info_detail_ll); avatarImageView = findViewById(R.id.edit_info_avatar_iv); nameTextView = findViewById(R.id.edit_info_name_tv); sexTextView = findViewById(R.id.edit_info_sex_tv); detailTextView = findViewById(R.id.edit_info_detail_tv); } /** * 显示姓名输入弹窗 */ private void showNameDialog(){ final AppCompatEditText editText = new AppCompatEditText(this); builder = new AlertDialog.Builder(this).setTitle("输入昵称").setView(editText) .setPositiveButton("确认", (dialogInterface, i) -> { Editable name = editText.getText(); if(name!=null){ mViewModel.setName(name.toString()); mViewModel.customer.setUsername(name.toString()); } }); builder.create().show(); } /** * 显示姓名单选弹窗 */ private void showSexDialog(){ final String[] items = {"男", "女"}; final int[] position = {0}; builder = new AlertDialog.Builder(this).setIcon(R.mipmap.ic_launcher).setTitle("单选列表") .setSingleChoiceItems(items, 0, (dialogInterface, i) -> { position[0] = i; }) .setPositiveButton("确定", (dialogInterface, i) -> { if (position[0]>=0){ mViewModel.setSex(items[position[0]]); mViewModel.customer.setSex(items[position[0]]); } }); builder.create().show(); } /** * 显示签名输入弹窗 */ private void showDetailDialog(){ final AppCompatEditText editText = new AppCompatEditText(this); builder = new AlertDialog.Builder(this).setTitle("输入签名").setView(editText) .setPositiveButton("确认", (dialogInterface, i) -> { Editable detail = editText.getText(); if(detail!=null){ mViewModel.setDetail(detail.toString()); } }); builder.create().show(); } public static void startActivity(Context context){ Intent intent = new Intent(context,EditCustomerInfoActivity.class); context.startActivity(intent); } }
[ "1614202740@qq.com" ]
1614202740@qq.com
bf9cb0e6a170e603dbfce61170cf3dcd311de92c
dbde38010aee32c5d04e58feca47c0d30abe34f5
/subprojects/opennaef.devicedriver.core/src/main/java/voss/model/HitachiApresia8000.java
fc13b733febe853495f6d77becbf96a8bb639ec8
[ "Apache-2.0" ]
permissive
openNaEF/openNaEF
c2c8d5645b499aae36d90205dbc91421f4d0bd7b
c88f0e17adc8d3f266787846911787f9b8aa3b0d
refs/heads/master
2020-12-30T15:41:09.806501
2017-05-22T22:37:24
2017-05-22T22:38:36
91,155,672
13
0
null
null
null
null
UTF-8
Java
false
false
3,369
java
package voss.model; import java.util.Arrays; public class HitachiApresia8000 extends AbstractEthernetSwitch { private static final long serialVersionUID = 1L; public static final String VENDOR_NAME = "Hitachi Cable"; public static interface ExtInfoKeys { public static interface LogicalEthernetPort { public static final String INGRESS_LIMITING_MAX_BURST_SIZE = "ingress-limiting-max-burst-size"; } } public static class RedundancyRegionDeviceLocalInstance extends AbstractVlanStpElement implements VlanStpElement { private static final long serialVersionUID = 1L; private String regionId_; private String[] vdrConfigPortIfnames_; public RedundancyRegionDeviceLocalInstance() { } public RedundancyRegionDeviceLocalInstance(String regionId, String[] vdrConfigPortIfnames) { if (regionId == null || vdrConfigPortIfnames == null) { throw new NullArgumentIsNotAllowedException(); } regionId_ = regionId; vdrConfigPortIfnames_ = vdrConfigPortIfnames; } public String getVlanStpElementId() { return getRegionId(); } public synchronized String getRegionId() { return regionId_; } public synchronized String[] getVdrConfigPortIfnames() { return vdrConfigPortIfnames_; } } public static boolean isAdaptive(String vendorName, String modelTypeName, String osVersion) { return vendorName != null && vendorName.equals(VENDOR_NAME) && modelTypeName.toLowerCase().matches("apresia ?8.*"); } private RedundancyRegionDeviceLocalInstance[] redundancyRegionDeviceLocalInstances_; public HitachiApresia8000() { setVendorName(VENDOR_NAME); } public synchronized void setRedundancyRegionDeviceLocalInstances( RedundancyRegionDeviceLocalInstance[] redundancyRegionDeviceLocalInstances) { if (redundancyRegionDeviceLocalInstances == null) { throw new NullArgumentIsNotAllowedException(); } redundancyRegionDeviceLocalInstances_ = redundancyRegionDeviceLocalInstances; } public synchronized RedundancyRegionDeviceLocalInstance[] getRedundancyRegionDeviceLocalInstances() { return redundancyRegionDeviceLocalInstances_; } public boolean isVdrConfigPort(String redundancyRegionId, LogicalEthernetPort logicalEth) { if (logicalEth.getDevice() != this) { throw new IllegalArgumentException("Device does not match."); } RedundancyRegionDeviceLocalInstance deviceLocalInstance = getRedundancyRegionDeviceLocalInstance(redundancyRegionId); if (deviceLocalInstance == null) { return false; } return Arrays.asList(deviceLocalInstance.getVdrConfigPortIfnames()).contains(logicalEth.getIfName()); } private synchronized RedundancyRegionDeviceLocalInstance getRedundancyRegionDeviceLocalInstance(String redundancyRegionId) { for (int i = 0; i < redundancyRegionDeviceLocalInstances_.length; i++) { if (redundancyRegionDeviceLocalInstances_[i].getRegionId().equals(redundancyRegionId)) { return redundancyRegionDeviceLocalInstances_[i]; } } return null; } }
[ "t.yamazaki@ttscweb.jp" ]
t.yamazaki@ttscweb.jp
35ac80220ec6b935c54d5e8d22f9391664ac5195
7188dcbb069b4f8540c1cde2ec0fdbe3071d2a9c
/app/src/main/java/com/amjadomari/rxjavasliederactivity/animation/TabletTransformer.java
895f2057b1f071687564773b2b1fcf6867ed5860
[ "Apache-2.0" ]
permissive
aomari/AndroidViewPagerRxJava
8761fcc5ffb4affd921db946d0ff2197190e1312
49d65fe970b18d6fc1a8af31654e41873b9ef56f
refs/heads/master
2021-07-03T20:56:45.054635
2017-09-22T19:31:29
2017-09-22T19:31:29
104,509,517
5
0
null
null
null
null
UTF-8
Java
false
false
1,891
java
/* * Copyright 2014 Toxic Bakery * * 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.amjadomari.rxjavasliederactivity.animation; import android.graphics.Camera; import android.graphics.Matrix; import android.view.View; public class TabletTransformer extends ABaseTransformer { private static final Matrix OFFSET_MATRIX = new Matrix(); private static final Camera OFFSET_CAMERA = new Camera(); private static final float[] OFFSET_TEMP_FLOAT = new float[2]; @Override protected void onTransform(View view, float position) { final float rotation = (position < 0 ? 30f : -30f) * Math.abs(position); view.setTranslationX(getOffsetXForRotation(rotation, view.getWidth(), view.getHeight())); view.setPivotX(view.getWidth() * 0.5f); view.setPivotY(0); view.setRotationY(rotation); } protected static final float getOffsetXForRotation(float degrees, int width, int height) { OFFSET_MATRIX.reset(); OFFSET_CAMERA.save(); OFFSET_CAMERA.rotateY(Math.abs(degrees)); OFFSET_CAMERA.getMatrix(OFFSET_MATRIX); OFFSET_CAMERA.restore(); OFFSET_MATRIX.preTranslate(-width * 0.5f, -height * 0.5f); OFFSET_MATRIX.postTranslate(width * 0.5f, height * 0.5f); OFFSET_TEMP_FLOAT[0] = width; OFFSET_TEMP_FLOAT[1] = height; OFFSET_MATRIX.mapPoints(OFFSET_TEMP_FLOAT); return (width - OFFSET_TEMP_FLOAT[0]) * (degrees > 0.0f ? 1.0f : -1.0f); } }
[ "aomari@asaltech.com" ]
aomari@asaltech.com
c24828a4787ebeb644484c9379d2af898bcf135c
634b0026cbac6f79248d3acd4026a4f861be48d8
/app/src/main/java/com/example/nobetcieczane/EczaneAdapter.java
d1ffa3e647ad43652ecd94ae2bd8c1beb3a61b6a
[]
no_license
elifnkaraca/Istanbul-Pharmacy-on-Duty-App
1ca6a2d4709d927f2df2e114204ed1e6ccc62fe1
41242b461f54308003dc0c26af2788f4ecebb316
refs/heads/master
2021-03-24T07:23:21.958561
2020-03-15T18:54:15
2020-03-15T18:54:15
247,529,755
1
0
null
null
null
null
UTF-8
Java
false
false
2,440
java
package com.example.nobetcieczane; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.TextView; import com.example.nobetcieczane.Models.EczaneDetay; import java.util.List; public class EczaneAdapter extends BaseAdapter { List<EczaneDetay> list; Context context; Activity activity; public EczaneAdapter(List<EczaneDetay> list, Context context,Activity activity) { this.list = list; this.context = context; this.activity = activity; } @Override public int getCount() { return list.size(); } @Override public Object getItem(int position) { return list.get(position); } @Override public long getItemId(int position) { return 0; } @Override public View getView(final int position, View convertView, ViewGroup parent) { convertView = LayoutInflater.from(context).inflate(R.layout.layout,parent,false); TextView eczaneIsim, eczaneAdres, eczaneTel, eczaneFax, eczaneAdresTarif; Button haritadaGoster, aramaYap; eczaneIsim = convertView.findViewById(R.id.eczaneIsmi); eczaneAdres = convertView.findViewById(R.id.eczaneAdres); eczaneTel = convertView.findViewById(R.id.eczaneTelefon); eczaneFax = convertView.findViewById(R.id.eczaneFax); eczaneAdresTarif = convertView.findViewById(R.id.eczaneTarif); haritadaGoster = convertView.findViewById(R.id.btn_haritadaGoster); aramaYap = convertView.findViewById(R.id.btn_aramaYap); eczaneIsim.setText(list.get(position).getEczaneIsmi()); eczaneAdres.setText(list.get(position).getAdres()); eczaneTel.setText(list.get(position).getTelefon()); eczaneFax.setText(list.get(position).getFax()); eczaneAdresTarif.setText(list.get(position).getTarif()); aramaYap.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.setData(Uri.parse("tel:"+list.get(position).getTelefon())); activity.startActivity(intent); } }); return convertView; } }
[ "elifnkaraca@users.noreply.github.com" ]
elifnkaraca@users.noreply.github.com
af4df67d78fd2ef452a61ac7a3b83bb206656863
958b13739d7da564749737cb848200da5bd476eb
/src/main/java/com/alipay/api/response/MybankCreditSceneprodPlanQueryResponse.java
ad93fe5edf462899279ea264c8d78af855ee8124
[ "Apache-2.0" ]
permissive
anywhere/alipay-sdk-java-all
0a181c934ca84654d6d2f25f199bf4215c167bd2
649e6ff0633ebfca93a071ff575bacad4311cdd4
refs/heads/master
2023-02-13T02:09:28.859092
2021-01-14T03:17:27
2021-01-14T03:17:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,596
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: mybank.credit.sceneprod.plan.query response. * * @author auto create * @since 1.0, 2019-01-07 20:51:15 */ public class MybankCreditSceneprodPlanQueryResponse extends AlipayResponse { private static final long serialVersionUID = 2194843424519374842L; /** * 贷款方案内容 */ @ApiField("loan_plan") private String loanPlan; /** * 是否离线准入,只有为true的时候loan_plan才会有数据 */ @ApiField("result") private String result; /** * 是否可重试 */ @ApiField("retry") private String retry; /** * 签约时间 */ @ApiField("sign_time") private String signTime; /** * 网商traceId,便于查询日志内容 */ @ApiField("trace_id") private String traceId; public void setLoanPlan(String loanPlan) { this.loanPlan = loanPlan; } public String getLoanPlan( ) { return this.loanPlan; } public void setResult(String result) { this.result = result; } public String getResult( ) { return this.result; } public void setRetry(String retry) { this.retry = retry; } public String getRetry( ) { return this.retry; } public void setSignTime(String signTime) { this.signTime = signTime; } public String getSignTime( ) { return this.signTime; } public void setTraceId(String traceId) { this.traceId = traceId; } public String getTraceId( ) { return this.traceId; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
500f72b9a18c632c032b5eed228aa03903f6f50c
a19390ac42e0a00d81dd89447d58d34574db713a
/src/main/java/seedu/address/model/card/FormattedHintSupplier.java
83ed11ddf4a913eabba36b47739cbd930445dd7f
[ "MIT" ]
permissive
AY1920S1-CS2103T-T11-2/main
0c6653b73bd04c5a172a5c48a24d19ae7c846622
99d142dc80ce67ae28ccda02a9851f9f597ad951
refs/heads/master
2020-07-22T15:54:10.678667
2019-11-11T14:04:59
2019-11-11T14:04:59
207,248,128
1
3
NOASSERTION
2019-11-11T14:05:01
2019-09-09T07:17:03
Java
UTF-8
Java
false
false
2,042
java
package seedu.address.model.card; import static java.util.Objects.requireNonNull; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.function.Supplier; import seedu.address.commons.core.index.Index; /** * Supplier that supplies FormattedHints. This Supplier stores a List of Hints {@code hintCharacters} and * a {@code FormattedHint}. It updates the FormattedHint automatically every time {@code get()} is called * by polling from the List of Hints, which has been shuffled. */ public class FormattedHintSupplier implements Supplier<FormattedHint> { private List<Hint> hintCharacters; private FormattedHint formattedHint; /** * Constructs a {@code FormattedHintSupplier}. * * @param text Word's String that the Hints are based on, cannot be null. */ FormattedHintSupplier(String text) { requireNonNull(text); hintCharacters = new LinkedList<>(); for (int i = 0; i < text.length(); ++i) { hintCharacters.add(new Hint(text.charAt(i), Index.fromZeroBased(i))); } Collections.shuffle(hintCharacters); /* Initializing formattedHint, contains all null characters at this point. */ formattedHint = new FormattedHint(hintCharacters.size()); } /** * Returns the size of {@code hintCharacters}. */ public int getRemainingNumOfHints() { return hintCharacters.size(); } /** * Returns {@code FormattedHint} that is updated with the new Hint characters, if available. * Returns same formatted hint if no more characters available. */ @Override public FormattedHint get() { if (hintCharacters.isEmpty()) { /* Do not update if no more hintCharacters are available. */ return formattedHint; } else { /* Polls and removes the first element of hintCharacters.*/ formattedHint.updateHintArray(hintCharacters.remove(0)); return formattedHint; } } }
[ "kohyida1997@gmail.com" ]
kohyida1997@gmail.com
546441095ca33d10633310375414025581f077d9
f66e2ad3fc0f8c88278c0997b156f5c6c8f77f28
/Android/GlideProgres/app/src/main/java/com/ztiany/progress/imageloader/ProgressInfo.java
e3001148ba8bffda52f2d60924a3ce3d7e96bd24
[ "Apache-2.0" ]
permissive
flyfire/Programming-Notes-Code
3b51b45f8760309013c3c0cc748311d33951a044
4b1bdd74c1ba0c007c504834e4508ec39f01cd94
refs/heads/master
2020-05-07T18:00:49.757509
2019-04-10T11:15:13
2019-04-10T11:15:13
180,750,568
1
0
Apache-2.0
2019-04-11T08:40:38
2019-04-11T08:40:38
null
UTF-8
Java
false
false
2,276
java
package com.ztiany.progress.imageloader; public class ProgressInfo { //当前下载的总长度 private long currentBytes; //数据总长度 private long contentLength; //本次调用距离上一次被调用所间隔的毫秒值 private long intervalTime; //本次调用距离上一次被调用的间隔时间内下载的 byte 长度 private long eachBytes; //请求的 ID private long id; //进度是否完成 private boolean finish; ProgressInfo(long id) { this.id = id; } void setCurrentBytes(long currentBytes) { this.currentBytes = currentBytes; } void setContentLength(long contentLength) { this.contentLength = contentLength; } void setIntervalTime(long intervalTime) { this.intervalTime = intervalTime; } void setEachBytes(long eachBytes) { this.eachBytes = eachBytes; } void setFinish(boolean finish) { this.finish = finish; } public long getCurrentBytes() { return currentBytes; } public long getContentLength() { return contentLength; } public long getIntervalTime() { return intervalTime; } public long getEachBytes() { return eachBytes; } public long getId() { return id; } public boolean isFinished() { return finish; } /** * 获取下载比例(0 - 1) */ public float getProgress() { if (getCurrentBytes() <= 0 || getContentLength() <= 0) { return 0; } return ((1F * getCurrentBytes()) / getContentLength()); } /** * 获取上传或下载网络速度,单位为byte/s */ public long getSpeed() { if (getEachBytes() <= 0 || getIntervalTime() <= 0){ return 0; } return getEachBytes() * 1000 / getIntervalTime(); } @Override public String toString() { return "ProgressInfo{" + "id=" + id + ", currentBytes=" + currentBytes + ", contentLength=" + contentLength + ", eachBytes=" + eachBytes + ", intervalTime=" + intervalTime + ", finish=" + finish + '}'; } }
[ "ZhanTianYou@ecqun.com" ]
ZhanTianYou@ecqun.com
ecb883725ffb8b0fe67a3cb0a9eb2e9c641191ac
eb70e1b4d95d5f3ec476dcbd676c091d75c7bef5
/src/week1/day1/day2/_06RelationalAndLogical.java
8277f9dfca9788a8144a3856eff17446757e696a
[]
no_license
QAMarinka/Java2016
d686352f96139ae62a1e1a61498c9d11911ca3d0
ed4c64d7564024b309bbc2b3b59cef5cc2813e27
refs/heads/master
2021-01-12T09:20:47.610091
2016-12-10T22:38:38
2016-12-10T22:38:38
76,140,190
0
0
null
null
null
null
UTF-8
Java
false
false
388
java
package week1.day1.day2; /** * Created by Maryna.Kurganska on 12/9/2016. */ public class _06RelationalAndLogical { public static void main(String[] args) { int a = 4; int b = 10; int c = 18; int d = 1; boolean res1 = a > b; boolean res2 = c != d; boolean result = res1 | res2; System.out.println(result); } }
[ "kamilla3975@gmail.com" ]
kamilla3975@gmail.com
39b94b1a58b5f78eef9e56e093391fcb875a7d80
d1bdf72edbd227d7db8bf29df9f4092d18f7e6eb
/Code/java_assignment5/src/java_assignment5/ans_2.java
52abf4456997284dc2a75eed4d051c85c2f74702
[]
no_license
tanyag330/JavaCB
cc838e16624c3497cbdb06ef280b0f0653206d14
6bc19d17a48b365fb004fedff889784a6d5db7bf
refs/heads/master
2021-01-01T20:09:51.494334
2017-07-30T07:52:04
2017-07-30T07:52:04
98,783,280
0
0
null
null
null
null
UTF-8
Java
false
false
321
java
package java_assignment5; public class ans_2 { public static int product(int n,int count) { //answer 2 if(n == 0) { return count; } if(n%10 == 0){ return product(n/10,count+=1); } return product(n/10,count); } public static void main(String[] args) { System.out.println(product(103050,0)); } }
[ "tanyag330@gmail.com" ]
tanyag330@gmail.com
9f5cf0dafb331cb3e081db4d8eb2db095893519b
0ca9a0873d99f0d69b78ed20292180f513a20d22
/saved/sources/com/google/android/exoplayer2/metadata/scte35/SpliceInsertCommand.java
c64b8c35ef4f03c649f61d68c916b2d77b440236
[]
no_license
Eliminater74/com.google.android.tvlauncher
44361fbbba097777b99d7eddd6e03d4bbe5f4d60
e8284f9970d77a05042a57e9c2173856af7c4246
refs/heads/master
2021-01-14T23:34:04.338366
2020-02-24T16:39:53
2020-02-24T16:39:53
242,788,539
1
0
null
null
null
null
UTF-8
Java
false
false
10,096
java
package com.google.android.exoplayer2.metadata.scte35; import android.os.Parcel; import android.os.Parcelable; import com.google.android.exoplayer2.C0841C; import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.TimestampAdjuster; import java.util.ArrayList; import java.util.Collections; import java.util.List; public final class SpliceInsertCommand extends SpliceCommand { public static final Parcelable.Creator<SpliceInsertCommand> CREATOR = new Parcelable.Creator<SpliceInsertCommand>() { public SpliceInsertCommand createFromParcel(Parcel in) { return new SpliceInsertCommand(in); } public SpliceInsertCommand[] newArray(int size) { return new SpliceInsertCommand[size]; } }; public final boolean autoReturn; public final int availNum; public final int availsExpected; public final long breakDurationUs; public final List<ComponentSplice> componentSpliceList; public final boolean outOfNetworkIndicator; public final boolean programSpliceFlag; public final long programSplicePlaybackPositionUs; public final long programSplicePts; public final boolean spliceEventCancelIndicator; public final long spliceEventId; public final boolean spliceImmediateFlag; public final int uniqueProgramId; private SpliceInsertCommand(long spliceEventId2, boolean spliceEventCancelIndicator2, boolean outOfNetworkIndicator2, boolean programSpliceFlag2, boolean spliceImmediateFlag2, long programSplicePts2, long programSplicePlaybackPositionUs2, List<ComponentSplice> componentSpliceList2, boolean autoReturn2, long breakDurationUs2, int uniqueProgramId2, int availNum2, int availsExpected2) { this.spliceEventId = spliceEventId2; this.spliceEventCancelIndicator = spliceEventCancelIndicator2; this.outOfNetworkIndicator = outOfNetworkIndicator2; this.programSpliceFlag = programSpliceFlag2; this.spliceImmediateFlag = spliceImmediateFlag2; this.programSplicePts = programSplicePts2; this.programSplicePlaybackPositionUs = programSplicePlaybackPositionUs2; this.componentSpliceList = Collections.unmodifiableList(componentSpliceList2); this.autoReturn = autoReturn2; this.breakDurationUs = breakDurationUs2; this.uniqueProgramId = uniqueProgramId2; this.availNum = availNum2; this.availsExpected = availsExpected2; } private SpliceInsertCommand(Parcel in) { this.spliceEventId = in.readLong(); boolean z = false; this.spliceEventCancelIndicator = in.readByte() == 1; this.outOfNetworkIndicator = in.readByte() == 1; this.programSpliceFlag = in.readByte() == 1; this.spliceImmediateFlag = in.readByte() == 1; this.programSplicePts = in.readLong(); this.programSplicePlaybackPositionUs = in.readLong(); int componentSpliceListSize = in.readInt(); List<ComponentSplice> componentSpliceList2 = new ArrayList<>(componentSpliceListSize); for (int i = 0; i < componentSpliceListSize; i++) { componentSpliceList2.add(ComponentSplice.createFromParcel(in)); } this.componentSpliceList = Collections.unmodifiableList(componentSpliceList2); this.autoReturn = in.readByte() == 1 ? true : z; this.breakDurationUs = in.readLong(); this.uniqueProgramId = in.readInt(); this.availNum = in.readInt(); this.availsExpected = in.readInt(); } /* JADX INFO: Multiple debug info for r1v6 int: [D('firstByte' long), D('uniqueProgramId' int)] */ /* JADX INFO: Multiple debug info for r2v7 long: [D('programSpliceFlag' boolean), D('componentSplicePts' long)] */ static SpliceInsertCommand parseFromSection(ParsableByteArray sectionData, long ptsAdjustment, TimestampAdjuster timestampAdjuster) { boolean spliceImmediateFlag2; boolean programSpliceFlag2; int availsExpected2; int availNum2; int uniqueProgramId2; long breakDurationUs2; boolean autoReturn2; List<ComponentSplice> componentSplices; boolean outOfNetworkIndicator2; long programSplicePts2; boolean outOfNetworkIndicator3; TimestampAdjuster timestampAdjuster2 = timestampAdjuster; long spliceEventId2 = sectionData.readUnsignedInt(); boolean spliceEventCancelIndicator2 = (sectionData.readUnsignedByte() & 128) != 0; long programSplicePts3 = C0841C.TIME_UNSET; List<ComponentSplice> componentSplices2 = Collections.emptyList(); boolean autoReturn3 = false; long breakDurationUs3 = C0841C.TIME_UNSET; if (!spliceEventCancelIndicator2) { int headerByte = sectionData.readUnsignedByte(); boolean outOfNetworkIndicator4 = (headerByte & 128) != 0; boolean programSpliceFlag3 = (headerByte & 64) != 0; boolean durationFlag = headerByte & true; boolean spliceImmediateFlag3 = (headerByte & 16) != 0; if (programSpliceFlag3 && !spliceImmediateFlag3) { programSplicePts3 = TimeSignalCommand.parseSpliceTime(sectionData, ptsAdjustment); } if (!programSpliceFlag3) { int componentCount = sectionData.readUnsignedByte(); outOfNetworkIndicator3 = outOfNetworkIndicator4; componentSplices2 = new ArrayList<>(componentCount); int i = 0; while (i < componentCount) { int componentTag = sectionData.readUnsignedByte(); long componentSplicePts = C0841C.TIME_UNSET; if (!spliceImmediateFlag3) { componentSplicePts = TimeSignalCommand.parseSpliceTime(sectionData, ptsAdjustment); } boolean programSpliceFlag4 = programSpliceFlag3; long componentSplicePts2 = componentSplicePts; componentSplices2.add(new ComponentSplice(componentTag, componentSplicePts2, timestampAdjuster2.adjustTsTimestamp(componentSplicePts2))); i++; programSpliceFlag3 = programSpliceFlag4; componentCount = componentCount; spliceImmediateFlag3 = spliceImmediateFlag3; } programSpliceFlag2 = programSpliceFlag3; spliceImmediateFlag2 = spliceImmediateFlag3; } else { outOfNetworkIndicator3 = outOfNetworkIndicator4; programSpliceFlag2 = programSpliceFlag3; spliceImmediateFlag2 = spliceImmediateFlag3; } if (durationFlag) { long firstByte = (long) sectionData.readUnsignedByte(); autoReturn3 = (firstByte & 128) != 0; breakDurationUs3 = (1000 * (((firstByte & 1) << 32) | sectionData.readUnsignedInt())) / 90; } uniqueProgramId2 = sectionData.readUnsignedShort(); availNum2 = sectionData.readUnsignedByte(); availsExpected2 = sectionData.readUnsignedByte(); componentSplices = componentSplices2; autoReturn2 = autoReturn3; breakDurationUs2 = breakDurationUs3; outOfNetworkIndicator2 = outOfNetworkIndicator3; programSplicePts2 = programSplicePts3; } else { outOfNetworkIndicator2 = false; programSpliceFlag2 = false; spliceImmediateFlag2 = false; componentSplices = componentSplices2; uniqueProgramId2 = 0; availNum2 = 0; availsExpected2 = 0; autoReturn2 = false; breakDurationUs2 = -9223372036854775807L; programSplicePts2 = -9223372036854775807L; } return new SpliceInsertCommand(spliceEventId2, spliceEventCancelIndicator2, outOfNetworkIndicator2, programSpliceFlag2, spliceImmediateFlag2, programSplicePts2, timestampAdjuster2.adjustTsTimestamp(programSplicePts2), componentSplices, autoReturn2, breakDurationUs2, uniqueProgramId2, availNum2, availsExpected2); } public static final class ComponentSplice { public final long componentSplicePlaybackPositionUs; public final long componentSplicePts; public final int componentTag; private ComponentSplice(int componentTag2, long componentSplicePts2, long componentSplicePlaybackPositionUs2) { this.componentTag = componentTag2; this.componentSplicePts = componentSplicePts2; this.componentSplicePlaybackPositionUs = componentSplicePlaybackPositionUs2; } public void writeToParcel(Parcel dest) { dest.writeInt(this.componentTag); dest.writeLong(this.componentSplicePts); dest.writeLong(this.componentSplicePlaybackPositionUs); } public static ComponentSplice createFromParcel(Parcel in) { return new ComponentSplice(in.readInt(), in.readLong(), in.readLong()); } } public void writeToParcel(Parcel dest, int flags) { dest.writeLong(this.spliceEventId); dest.writeByte(this.spliceEventCancelIndicator ? (byte) 1 : 0); dest.writeByte(this.outOfNetworkIndicator ? (byte) 1 : 0); dest.writeByte(this.programSpliceFlag ? (byte) 1 : 0); dest.writeByte(this.spliceImmediateFlag ? (byte) 1 : 0); dest.writeLong(this.programSplicePts); dest.writeLong(this.programSplicePlaybackPositionUs); int componentSpliceListSize = this.componentSpliceList.size(); dest.writeInt(componentSpliceListSize); for (int i = 0; i < componentSpliceListSize; i++) { this.componentSpliceList.get(i).writeToParcel(dest); } dest.writeByte((byte) this.autoReturn); dest.writeLong(this.breakDurationUs); dest.writeInt(this.uniqueProgramId); dest.writeInt(this.availNum); dest.writeInt(this.availsExpected); } }
[ "eliminater74@gmail.com" ]
eliminater74@gmail.com
2fecf3421ba37eabd7e0ce00e252b7a22e94e9a1
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/ga-20191120/src/main/java/com/aliyun/ga20191120/models/UpdateBasicEndpointGroupRequest.java
192982b24c5fb1af970aa5422ce57976c6768a54
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
4,995
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.ga20191120.models; import com.aliyun.tea.*; public class UpdateBasicEndpointGroupRequest extends TeaModel { /** * <p>The client token that is used to ensure the idempotence of the request.</p> * <br> * <p>You can use the client to generate the value, but you must make sure that it is unique among different requests. ClientToken can contain only ASCII characters.</p> * <br> * <p>> If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** may be different for each API request.</p> */ @NameInMap("ClientToken") public String clientToken; /** * <p>The description of the endpoint group that is associated with the basic GA instance.</p> * <br> * <p>The description cannot exceed 256 characters in length and cannot contain `http://` or `https://`.</p> */ @NameInMap("Description") public String description; /** * <p>The address of the endpoint.</p> */ @NameInMap("EndpointAddress") public String endpointAddress; /** * <p>The ID of the endpoint group that is associated with the basic GA instance.</p> */ @NameInMap("EndpointGroupId") public String endpointGroupId; /** * <p>The secondary address of the endpoint.</p> * <br> * <p>This parameter is required when the accelerated IP address is associated with the secondary private IP address of an ECS instance or an ENI.</p> * <br> * <p>* If the endpoint type is **ECS**, you can set the **EndpointSubAddress** parameter to the secondary private IP address of the primary ENI. If the parameter is left empty, the primary private IP address of the primary ENI is used.</p> * <p>* If the endpoint type is **ENI**, you can set the **EndpointSubAddress** parameter to the secondary private IP address of the secondary ENI. If the parameter is left empty, the primary private IP address of the secondary ENI is used.</p> */ @NameInMap("EndpointSubAddress") public String endpointSubAddress; /** * <p>The type of endpoint. Valid values:</p> * <br> * <p>* **ENI**: elastic network interface (ENI)</p> * <p>* **SLB**: Server Load Balancer (SLB) instance</p> */ @NameInMap("EndpointType") public String endpointType; /** * <p>The name of the endpoint group that is associated with the basic GA instance.</p> * <br> * <p>The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (\_), and hyphens (-). The name must start with a letter.</p> */ @NameInMap("Name") public String name; /** * <p>The ID of the region where the basic GA instance is deployed. Set the value to **cn-hangzhou**.</p> */ @NameInMap("RegionId") public String regionId; public static UpdateBasicEndpointGroupRequest build(java.util.Map<String, ?> map) throws Exception { UpdateBasicEndpointGroupRequest self = new UpdateBasicEndpointGroupRequest(); return TeaModel.build(map, self); } public UpdateBasicEndpointGroupRequest setClientToken(String clientToken) { this.clientToken = clientToken; return this; } public String getClientToken() { return this.clientToken; } public UpdateBasicEndpointGroupRequest setDescription(String description) { this.description = description; return this; } public String getDescription() { return this.description; } public UpdateBasicEndpointGroupRequest setEndpointAddress(String endpointAddress) { this.endpointAddress = endpointAddress; return this; } public String getEndpointAddress() { return this.endpointAddress; } public UpdateBasicEndpointGroupRequest setEndpointGroupId(String endpointGroupId) { this.endpointGroupId = endpointGroupId; return this; } public String getEndpointGroupId() { return this.endpointGroupId; } public UpdateBasicEndpointGroupRequest setEndpointSubAddress(String endpointSubAddress) { this.endpointSubAddress = endpointSubAddress; return this; } public String getEndpointSubAddress() { return this.endpointSubAddress; } public UpdateBasicEndpointGroupRequest setEndpointType(String endpointType) { this.endpointType = endpointType; return this; } public String getEndpointType() { return this.endpointType; } public UpdateBasicEndpointGroupRequest setName(String name) { this.name = name; return this; } public String getName() { return this.name; } public UpdateBasicEndpointGroupRequest setRegionId(String regionId) { this.regionId = regionId; return this; } public String getRegionId() { return this.regionId; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
94a8f92d16534d1e64e5a54a0e6086ec9e1c2070
b44769114f497b48d1f3edaa1a7bcee76591879a
/jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/PushImageStep.java
74eceddb4b1af009337fcb958c062b47843e4199
[ "Apache-2.0" ]
permissive
glaforge/jib
7e1502b75136d044379cb6d18cc14100c51ffc37
36c83afc5a56bd273a4da2bba5703dae5263ea52
refs/heads/master
2021-07-17T05:07:55.606555
2020-05-15T12:53:16
2020-05-15T12:53:16
264,164,636
2
0
Apache-2.0
2020-05-15T10:27:15
2020-05-15T10:27:14
null
UTF-8
Java
false
false
4,844
java
/* * Copyright 2018 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.cloud.tools.jib.builder.steps; import com.google.cloud.tools.jib.api.DescriptorDigest; import com.google.cloud.tools.jib.api.LogEvent; import com.google.cloud.tools.jib.api.RegistryException; import com.google.cloud.tools.jib.blob.BlobDescriptor; import com.google.cloud.tools.jib.builder.ProgressEventDispatcher; import com.google.cloud.tools.jib.builder.TimerEventDispatcher; import com.google.cloud.tools.jib.configuration.BuildContext; import com.google.cloud.tools.jib.event.EventHandlers; import com.google.cloud.tools.jib.hash.Digests; import com.google.cloud.tools.jib.image.Image; import com.google.cloud.tools.jib.image.json.BuildableManifestTemplate; import com.google.cloud.tools.jib.image.json.ImageToJsonTranslator; import com.google.cloud.tools.jib.registry.RegistryClient; import com.google.common.collect.ImmutableList; import java.io.IOException; import java.util.Set; import java.util.concurrent.Callable; /** * Pushes a manifest for a tag. Returns the manifest digest ("image digest") and the container * configuration digest ("image id") as {#link BuildResult}. */ class PushImageStep implements Callable<BuildResult> { private static final String DESCRIPTION = "Pushing manifest"; static ImmutableList<PushImageStep> makeList( BuildContext buildContext, ProgressEventDispatcher.Factory progressEventDispatcherFactory, RegistryClient registryClient, BlobDescriptor containerConfigurationDigestAndSize, Image builtImage) throws IOException { Set<String> tags = buildContext.getAllTargetImageTags(); try (TimerEventDispatcher ignored = new TimerEventDispatcher( buildContext.getEventHandlers(), "Preparing manifest pushers"); ProgressEventDispatcher progressEventDispatcher = progressEventDispatcherFactory.create("launching manifest pushers", tags.size())) { // Gets the image manifest to push. BuildableManifestTemplate manifestTemplate = new ImageToJsonTranslator(builtImage) .getManifestTemplate( buildContext.getTargetFormat(), containerConfigurationDigestAndSize); DescriptorDigest manifestDigest = Digests.computeJsonDigest(manifestTemplate); return tags.stream() .map( tag -> new PushImageStep( buildContext, progressEventDispatcher.newChildProducer(), registryClient, manifestTemplate, tag, manifestDigest, containerConfigurationDigestAndSize.getDigest())) .collect(ImmutableList.toImmutableList()); } } private final BuildContext buildContext; private final ProgressEventDispatcher.Factory progressEventDispatcherFactory; private final BuildableManifestTemplate manifestTemplate; private final RegistryClient registryClient; private final String tag; private final DescriptorDigest imageDigest; private final DescriptorDigest imageId; PushImageStep( BuildContext buildContext, ProgressEventDispatcher.Factory progressEventDispatcherFactory, RegistryClient registryClient, BuildableManifestTemplate manifestTemplate, String tag, DescriptorDigest imageDigest, DescriptorDigest imageId) { this.buildContext = buildContext; this.progressEventDispatcherFactory = progressEventDispatcherFactory; this.registryClient = registryClient; this.manifestTemplate = manifestTemplate; this.tag = tag; this.imageDigest = imageDigest; this.imageId = imageId; } @Override public BuildResult call() throws IOException, RegistryException { EventHandlers eventHandlers = buildContext.getEventHandlers(); try (TimerEventDispatcher ignored = new TimerEventDispatcher(eventHandlers, DESCRIPTION); ProgressEventDispatcher ignored2 = progressEventDispatcherFactory.create("pushing manifest for " + tag, 1)) { eventHandlers.dispatch(LogEvent.info("Pushing manifest for " + tag + "...")); registryClient.pushManifest(manifestTemplate, tag); return new BuildResult(imageDigest, imageId); } } }
[ "noreply@github.com" ]
noreply@github.com
0048b187f4dccc0323ef9bad0faa52f0b7ee5962
417d56ee415e3f33df2a50952826132fb42985ef
/src/main/java/monitoring/calendar/MonthNevigator.java
e3e913b94e8cc4109a29f169667da3aa3688b818
[]
no_license
purushah/tracking
7bf5d17e92dba0c8572cd3de42ed9e99b08ceb21
59043c5ad66048877c46e8a16a68f29ca7b39d1d
refs/heads/master
2020-05-25T11:31:11.118619
2017-11-15T20:25:57
2017-11-15T20:25:57
83,613,809
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package monitoring.calendar; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Calendar; public class MonthNevigator implements ActionListener { public MonthNevigator(Calendar cal) { // TODO Auto-generated constructor stub } public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub } }
[ "purushah@yahoo-inc.com" ]
purushah@yahoo-inc.com
34e1aa1c9959b4b10bcd684c264e9415ee7bfbb3
75f0d30b826fcc76f7c9a70e8ab502e40ba2c6df
/slideDateTimePicker/src/main/java/com/github/jjobes/slidedatetimepicker/TimeFragment.java
e5255782d86c1df5d69f79f4c7609781df00dcd4
[]
no_license
KPrabs106/WayneHillsNow
22c264ce03b76bf19828d1aa5feb36717f839746
352150c6c26f5451103586f893f1bf68681bb248
refs/heads/master
2021-01-01T19:19:29.986277
2015-07-04T05:25:57
2015-07-04T05:25:57
29,453,540
2
0
null
null
null
null
UTF-8
Java
false
false
6,853
java
package com.github.jjobes.slidedatetimepicker; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.text.format.DateFormat; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.DatePicker; import android.widget.NumberPicker; import android.widget.NumberPicker.OnValueChangeListener; import android.widget.TimePicker; /** * The fragment for the second page in the ViewPager that holds * the TimePicker. * * @author jjobes */ public class TimeFragment extends Fragment { private TimeChangedListener mCallback; private TimePicker mTimePicker; public TimeFragment() { // Required empty public constructor for fragment. } /** * Return an instance of TimeFragment with its bundle filled with the * constructor arguments. The values in the bundle are retrieved in * {@link #onCreateView()} below to properly initialize the TimePicker. * * @param theme * @param hour * @param minute * @param isClientSpecified24HourTime * @param is24HourTime * @return */ public static final TimeFragment newInstance(int theme, int hour, int minute, boolean isClientSpecified24HourTime, boolean is24HourTime) { TimeFragment f = new TimeFragment(); Bundle b = new Bundle(); b.putInt("theme", theme); b.putInt("hour", hour); b.putInt("minute", minute); b.putBoolean("isClientSpecified24HourTime", isClientSpecified24HourTime); b.putBoolean("is24HourTime", is24HourTime); f.setArguments(b); return f; } /** * Cast the reference to {@link SlideDateTimeDialogFragment} to a * {@link TimeChangedListener}. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { mCallback = (TimeChangedListener) getTargetFragment(); } catch (ClassCastException e) { throw new ClassCastException("Calling fragment must implement " + "TimeFragment.TimeChangedListener interface"); } } /** * Create and return the user interface view for this fragment. */ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { int theme = getArguments().getInt("theme"); int initialHour = getArguments().getInt("hour"); int initialMinute = getArguments().getInt("minute"); boolean isClientSpecified24HourTime = getArguments().getBoolean("isClientSpecified24HourTime"); boolean is24HourTime = getArguments().getBoolean("is24HourTime"); // Unless we inflate using a cloned inflater with a Holo theme, // on Lollipop devices the TimePicker will be the new-style // radial TimePicker, which is not what we want. So we will // clone the inflater that we're given but with our specified // theme, then inflate the layout with this new inflater. Context contextThemeWrapper = new ContextThemeWrapper( getActivity(), theme == SlideDateTimePicker.HOLO_DARK ? android.R.style.Theme_Holo : android.R.style.Theme_Holo_Light); LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper); View v = localInflater.inflate(R.layout.fragment_time, container, false); mTimePicker = (TimePicker) v.findViewById(R.id.timePicker); // block keyboard popping up on touch mTimePicker.setDescendantFocusability(DatePicker.FOCUS_BLOCK_DESCENDANTS); mTimePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() { @Override public void onTimeChanged(TimePicker view, int hourOfDay, int minute) { mCallback.onTimeChanged(hourOfDay, minute); } }); // If the client specifies a 24-hour time format, set it on // the TimePicker. if (isClientSpecified24HourTime) { mTimePicker.setIs24HourView(is24HourTime); } else { // If the client does not specify a 24-hour time format, use the // device default. mTimePicker.setIs24HourView(DateFormat.is24HourFormat( getTargetFragment().getActivity())); } mTimePicker.setCurrentHour(initialHour); mTimePicker.setCurrentMinute(initialMinute); // Fix for the bug where a TimePicker's onTimeChanged() is not called when // the user toggles the AM/PM button. Only applies to 4.0.0 and 4.0.3. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { fixTimePickerBug18982(); } return v; } /** * Workaround for bug in Android TimePicker where the onTimeChanged() callback * is not invoked when the user toggles between AM/PM. But we need to be able * to detect this in order to dynamically update the tab title properly when * the user toggles between AM/PM. * <p/> * Registered as Issue 18982: * <p/> * https://code.google.com/p/android/issues/detail?id=18982 */ private void fixTimePickerBug18982() { View amPmView = ((ViewGroup) mTimePicker.getChildAt(0)).getChildAt(3); if (amPmView instanceof NumberPicker) { ((NumberPicker) amPmView).setOnValueChangedListener(new OnValueChangeListener() { @Override public void onValueChange(NumberPicker picker, int oldVal, int newVal) { if (picker.getValue() == 1) // PM { if (mTimePicker.getCurrentHour() < 12) mTimePicker.setCurrentHour(mTimePicker.getCurrentHour() + 12); } else // AM { if (mTimePicker.getCurrentHour() >= 12) mTimePicker.setCurrentHour(mTimePicker.getCurrentHour() - 12); } mCallback.onTimeChanged( mTimePicker.getCurrentHour(), mTimePicker.getCurrentMinute()); } }); } } /** * Used to communicate back to the parent fragment as the user * is changing the time spinners so we can dynamically update * the tab text. */ public interface TimeChangedListener { void onTimeChanged(int hour, int minute); } }
[ "prabhukartik98@gmail.com" ]
prabhukartik98@gmail.com
4131827e73b7e6581d326da833309b66e17480c0
c11328c640c9db2c85fd305401266276e4f97f78
/smiparser/src/main/java/org/jsmiparser/util/token/GenericToken.java
a20897df2fb751473f77b9661e85cf04d3aa31ba
[ "Apache-2.0" ]
permissive
Mario-pinheiro/smiparser
baf79d4101d623de918496a9d0587ca384295392
7bf72bb3ab951e97b71ccbe1769dc6ca1220f4bc
refs/heads/master
2023-03-19T14:52:46.596699
2014-09-06T13:39:39
2014-09-06T13:39:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,027
java
/** * Copyright 2011-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jsmiparser.util.token; import org.jsmiparser.util.location.Location; public class GenericToken<Value> extends AbstractToken { protected Value value; public GenericToken(Location location, Value value) { super(location); this.value = value; } public Value getValue() { return value; } public Value getObject() { return value; } }
[ "bazzoni.marco@gmail.com" ]
bazzoni.marco@gmail.com
35a084d12bdaae5f4351af370df205611f6bbfc0
2e98a3f4610e2861befb41e7e42375ede0ba1e80
/src/com/vimukti/accounter/web/client/ui/core/DoubleField.java
9f9f836294c72d855138094002b8e9da548012a9
[ "Apache-2.0" ]
permissive
kisorbiswal/accounter
6eefd17d7973132469455d4a5d6b4c2b0a7ec9b3
7ef60c1d18892db72cedca411c143e377c379808
refs/heads/master
2021-01-20T16:34:35.511251
2015-10-20T09:57:42
2015-10-20T09:57:42
44,603,239
0
1
null
2015-10-20T11:59:08
2015-10-20T11:59:08
null
UTF-8
Java
false
false
2,744
java
package com.vimukti.accounter.web.client.ui.core; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; import com.vimukti.accounter.web.client.Global; import com.vimukti.accounter.web.client.ui.Accounter; import com.vimukti.accounter.web.client.ui.WidgetWithErrors; import com.vimukti.accounter.web.client.ui.forms.TextItem; public class DoubleField extends TextItem { private double number; private WidgetWithErrors errorsWidget; public DoubleField(WidgetWithErrors errorsWidget, final String name) { super(name, "integerField"); this.errorsWidget = errorsWidget; // ((TextBox) // getMainWidget()).setTextAlignment(TextBoxBase.ALIGN_RIGHT); addBlurHandler(getBlurHandler()); // setKeyPressHandler(new KeyPressListener() { // // @Override // public void onKeyPress(int keyCode) { // if (!((keyCode >= 48 && keyCode <= 57))) { // setValue("0"); // } // } // }); } public DoubleField(WidgetWithErrors errorsWidget, final String name, int maxLength) { super(name, "integerField", maxLength); this.errorsWidget = errorsWidget; addBlurHandler(getBlurHandler()); } @Override public void setValue(String value) { super.setValue(value); if (value != null && !value.isEmpty()) try { number = Long.parseLong(value); } catch (Exception e) { } } private BlurHandler getBlurHandler() { BlurHandler blurHandler = new BlurHandler() { Object value = null; public void onBlur(BlurEvent event) { try { Double enteredNumber = 0.0; value = getValue(); if (value == null) return; try { enteredNumber = Double.parseDouble(value.toString()); if (enteredNumber != null) { setNumber(enteredNumber); } errorsWidget.clearError(this); } catch (Exception e) { if (value.toString().length() != 0) { DoubleField.this.highlight(); // BaseView.errordata.setHTML("<li> " // + AccounterErrorType.INCORRECTINFORMATION // + "."); // BaseView.commentPanel.setVisible(true); errorsWidget .addError( this, Global.get() .messages() .pleaseEnter( messages.pleaseEnterValidNumber())); } // Accounter // .showError(AccounterErrorType.INCORRECTINFORMATION); } } catch (Exception e) { Accounter.showError(messages.invalidInfo()); } } }; return blurHandler; } public void setNumber(Double enteredNumber) { this.number = enteredNumber; if (enteredNumber != null) setValue(String.valueOf(enteredNumber)); else setValue(""); } /** * @return the number */ public Double getNumber() { return number; } }
[ "lingarao.r@vimukti.com" ]
lingarao.r@vimukti.com
a8e9de741fbc727779e896ee1f2625c80706a014
5bb4a4b0364ec05ffb422d8b2e76374e81c8c979
/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationStatuses.java
7a926319cae6452e00f64a4e045fde70362b32c1
[ "MIT", "LicenseRef-scancode-generic-cla", "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-or-later", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
FabianMeiswinkel/azure-sdk-for-java
bd14579af2f7bc63e5c27c319e2653db990056f1
41d99a9945a527b6d3cc7e1366e1d9696941dbe3
refs/heads/main
2023-08-04T20:38:27.012783
2020-07-15T21:56:57
2020-07-15T21:56:57
251,590,939
3
1
MIT
2023-09-02T00:50:23
2020-03-31T12:05:12
Java
UTF-8
Java
false
false
1,021
java
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.loganalytics.v2020_03_01_preview; import rx.Observable; import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.OperationStatusesInner; import com.microsoft.azure.arm.model.HasInner; /** * Type representing OperationStatuses. */ public interface OperationStatuses extends HasInner<OperationStatusesInner> { /** * Get the status of a long running azure asynchronous operation. * * @param location The region name of operation. * @param asyncOperationId The operation Id. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ Observable<OperationStatus> getAsync(String location, String asyncOperationId); }
[ "noreply@github.com" ]
noreply@github.com
705e22a567a939368487e0b7e2a29dabb60c329d
1d3d2db9a9c6d1eeea5f480505c11d42c4173a98
/src/Motorcycle.java
14f9518813866be5a611605a6a35e9b0ff14cd34
[]
no_license
manuhonores/TrainingOnReady
4b5a40e21a508d15c469fe73b94ece6a215c7841
a685b228c38f868a094e455ed23369841f551070
refs/heads/main
2023-02-04T20:08:56.520213
2020-12-29T04:05:33
2020-12-29T04:05:33
325,175,915
0
0
null
null
null
null
UTF-8
Java
false
false
725
java
import java.text.NumberFormat; public class Motorcycle extends Vehicle { //Cilindrada private String cc; public Motorcycle() { } public Motorcycle(String brand, String model, double price, String cc) { super(brand, model, price); this.cc = cc; } public String getCc() { return cc; } public void setCc(String cc) { this.cc = cc; } public String toString() { NumberFormat currencyFormat = NumberFormat.getCurrencyInstance(); return "Marca: " + this.getBrand() + " // " + "Modelo: " + this.getModel() + " // " + "Cilindrada: " + this.getCc() + " // " + "Precio: " + currencyFormat.format(this.getPrice()); } }
[ "manuel.honores.mh@gmail.com" ]
manuel.honores.mh@gmail.com
053c56f9f163ebb93606da8f9af306bfbe19108f
b2354ddbf598147f76f78d25d06896b15895dfcf
/src/main/java/ru/ponkin/billing/modules/PersistenceModule.java
46d4cd8f782aa4b8f1fa85ff93935509733dbe2c
[]
no_license
ponkin/simple-billing
61944043e45506f3f1564345edf0f5250d7b7391
e8edbfdaa1b7cf07cd13552554e5babb49fda64f
refs/heads/master
2021-03-30T23:50:27.701205
2018-03-08T13:06:58
2018-03-08T13:06:58
124,392,172
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package ru.ponkin.billing.modules; import com.google.inject.AbstractModule; import com.google.inject.TypeLiteral; import com.google.inject.persist.jpa.JpaPersistModule; import ru.ponkin.billing.dao.GenericDAO; import ru.ponkin.billing.dao.JpaAccountDAO; import ru.ponkin.billing.model.Account; /** * @author Alexey Ponkin */ public class PersistenceModule extends AbstractModule { private final String persistenceUnit; public PersistenceModule(String persistenceUnit) { this.persistenceUnit = persistenceUnit; } @Override protected void configure() { install(new JpaPersistModule(persistenceUnit)); bind(JpaInitializer.class).asEagerSingleton(); bind(new TypeLiteral<GenericDAO<Account>>() {}).to(new TypeLiteral<JpaAccountDAO>() {}); } }
[ "aponkin@luxoft.com" ]
aponkin@luxoft.com
33d57188cd4c9b56c1b8afe99d68f25e21579526
930fa6a6047e21183256556a1073a0b21328fc0e
/VäänänenOllipekka/viikko5/IntJoukkoSovellus/src/main/java/ohtu/intjoukkosovellus/komento/JoukonTulostusKomento.java
29610507998d14f03b48de3fbb7bc31d4e6d48a8
[]
no_license
ollivaan/ohtu2017
1bb68b23404012c79b920549d365a83227a5ddd4
c78beb5e8b3416ff4e13e5fd1f118e561d9c8edb
refs/heads/master
2020-12-24T11:47:01.902406
2017-05-08T18:10:08
2017-05-08T18:10:08
85,743,748
0
0
null
2017-03-21T19:19:33
2017-03-21T19:19:33
null
UTF-8
Java
false
false
365
java
package ohtu.intjoukkosovellus.komento; import ohtu.intjoukkosovellus.IntJoukko; public class JoukonTulostusKomento implements Komento{ private final IntJoukko jono; public JoukonTulostusKomento(IntJoukko joukko){ jono = joukko; } @Override public boolean toimi() { System.out.println(jono); return true; } }
[ "Ollipekka.vaananen@helsinki.fi" ]
Ollipekka.vaananen@helsinki.fi
a3c45ba918e4cf4593ceab72dd918fdef2ea8b42
066881130592441de7d20f92622f15501a11ddff
/app/build/generated/source/r/debug/android/support/v7/recyclerview/R.java
385cc8e65e9f648d3fc828498185a5504f52f1e1
[]
no_license
aldwinok31/Capstone_A2
45d0317227e9447af428cd6a2544d205783ec36c
91b2729acaedcb0671a3403f5d27dd5f4e2d48a9
refs/heads/master
2020-04-07T07:36:34.711068
2018-11-20T02:41:24
2018-11-20T02:41:24
158,182,495
0
0
null
null
null
null
UTF-8
Java
false
false
12,033
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.v7.recyclerview; public final class R { public static final class attr { public static final int coordinatorLayoutStyle = 0x7f030087; public static final int fastScrollEnabled = 0x7f0300ab; public static final int fastScrollHorizontalThumbDrawable = 0x7f0300ac; public static final int fastScrollHorizontalTrackDrawable = 0x7f0300ad; public static final int fastScrollVerticalThumbDrawable = 0x7f0300ae; public static final int fastScrollVerticalTrackDrawable = 0x7f0300af; public static final int font = 0x7f0300b0; public static final int fontProviderAuthority = 0x7f0300b2; public static final int fontProviderCerts = 0x7f0300b3; public static final int fontProviderFetchStrategy = 0x7f0300b4; public static final int fontProviderFetchTimeout = 0x7f0300b5; public static final int fontProviderPackage = 0x7f0300b6; public static final int fontProviderQuery = 0x7f0300b7; public static final int fontStyle = 0x7f0300b8; public static final int fontWeight = 0x7f0300b9; public static final int keylines = 0x7f0300d5; public static final int layoutManager = 0x7f0300db; public static final int layout_anchor = 0x7f0300dc; public static final int layout_anchorGravity = 0x7f0300dd; public static final int layout_behavior = 0x7f0300de; public static final int layout_dodgeInsetEdges = 0x7f03010a; public static final int layout_insetEdge = 0x7f030113; public static final int layout_keyline = 0x7f030114; public static final int reverseLayout = 0x7f03014a; public static final int spanCount = 0x7f03015a; public static final int stackFromEnd = 0x7f030160; public static final int statusBarBackground = 0x7f030164; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f040000; } public static final class color { public static final int notification_action_color_filter = 0x7f050057; public static final int notification_icon_bg_color = 0x7f050058; public static final int ripple_material_light = 0x7f050063; public static final int secondary_text_default_material_light = 0x7f050065; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f06004d; public static final int compat_button_inset_vertical_material = 0x7f06004e; public static final int compat_button_padding_horizontal_material = 0x7f06004f; public static final int compat_button_padding_vertical_material = 0x7f060050; public static final int compat_control_corner_material = 0x7f060051; public static final int fastscroll_default_thickness = 0x7f06007a; public static final int fastscroll_margin = 0x7f06007b; public static final int fastscroll_minimum_range = 0x7f06007c; public static final int item_touch_helper_max_drag_scroll_per_frame = 0x7f060084; public static final int item_touch_helper_swipe_escape_max_velocity = 0x7f060085; public static final int item_touch_helper_swipe_escape_velocity = 0x7f060086; public static final int notification_action_icon_size = 0x7f060087; public static final int notification_action_text_size = 0x7f060088; public static final int notification_big_circle_margin = 0x7f060089; public static final int notification_content_margin_start = 0x7f06008a; public static final int notification_large_icon_height = 0x7f06008b; public static final int notification_large_icon_width = 0x7f06008c; public static final int notification_main_column_padding_top = 0x7f06008d; public static final int notification_media_narrow_margin = 0x7f06008e; public static final int notification_right_icon_size = 0x7f06008f; public static final int notification_right_side_padding_top = 0x7f060090; public static final int notification_small_icon_background_padding = 0x7f060091; public static final int notification_small_icon_size_as_large = 0x7f060092; public static final int notification_subtext_size = 0x7f060093; public static final int notification_top_pad = 0x7f060094; public static final int notification_top_pad_large_text = 0x7f060095; } public static final class drawable { public static final int notification_action_background = 0x7f07008b; public static final int notification_bg = 0x7f07008c; public static final int notification_bg_low = 0x7f07008d; public static final int notification_bg_low_normal = 0x7f07008e; public static final int notification_bg_low_pressed = 0x7f07008f; public static final int notification_bg_normal = 0x7f070090; public static final int notification_bg_normal_pressed = 0x7f070091; public static final int notification_icon_background = 0x7f070092; public static final int notification_template_icon_bg = 0x7f070093; public static final int notification_template_icon_low_bg = 0x7f070094; public static final int notification_tile_bg = 0x7f070095; public static final int notify_panel_notification_icon_bg = 0x7f070096; } public static final class id { public static final int action_container = 0x7f08000f; public static final int action_divider = 0x7f080011; public static final int action_image = 0x7f080012; public static final int action_text = 0x7f080018; public static final int actions = 0x7f080019; public static final int async = 0x7f080021; public static final int blocking = 0x7f080026; public static final int bottom = 0x7f080027; public static final int chronometer = 0x7f080034; public static final int end = 0x7f08004e; public static final int forever = 0x7f08005a; public static final int icon = 0x7f080062; public static final int icon_group = 0x7f080063; public static final int info = 0x7f080069; public static final int italic = 0x7f08006b; public static final int item_touch_helper_previous_elevation = 0x7f08006c; public static final int left = 0x7f080070; public static final int line1 = 0x7f080072; public static final int line3 = 0x7f080073; public static final int none = 0x7f080088; public static final int normal = 0x7f080089; public static final int notification_background = 0x7f08008a; public static final int notification_main_column = 0x7f08008b; public static final int notification_main_column_container = 0x7f08008c; public static final int right = 0x7f08009b; public static final int right_icon = 0x7f08009c; public static final int right_side = 0x7f08009d; public static final int start = 0x7f0800c7; public static final int tag_transition_group = 0x7f0800d1; public static final int text = 0x7f0800d5; public static final int text2 = 0x7f0800d6; public static final int time = 0x7f0800e4; public static final int title = 0x7f0800e5; public static final int top = 0x7f0800e8; } public static final class integer { public static final int status_bar_notification_info_maxnum = 0x7f09000a; } public static final class layout { public static final int notification_action = 0x7f0a0034; public static final int notification_action_tombstone = 0x7f0a0035; public static final int notification_template_custom_big = 0x7f0a003c; public static final int notification_template_icon_group = 0x7f0a003d; public static final int notification_template_part_chronometer = 0x7f0a0041; public static final int notification_template_part_time = 0x7f0a0042; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f0d0043; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f0e00ed; public static final int TextAppearance_Compat_Notification_Info = 0x7f0e00ee; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e00f0; public static final int TextAppearance_Compat_Notification_Time = 0x7f0e00f3; public static final int TextAppearance_Compat_Notification_Title = 0x7f0e00f5; public static final int Widget_Compat_NotificationActionContainer = 0x7f0e016b; public static final int Widget_Compat_NotificationActionText = 0x7f0e016c; public static final int Widget_Support_CoordinatorLayout = 0x7f0e0178; } public static final class styleable { public static final int[] CoordinatorLayout = { 0x7f0300d5, 0x7f030164 }; public static final int CoordinatorLayout_keylines = 0; public static final int CoordinatorLayout_statusBarBackground = 1; public static final int[] CoordinatorLayout_Layout = { 0x010100b3, 0x7f0300dc, 0x7f0300dd, 0x7f0300de, 0x7f03010a, 0x7f030113, 0x7f030114 }; public static final int CoordinatorLayout_Layout_android_layout_gravity = 0; public static final int CoordinatorLayout_Layout_layout_anchor = 1; public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2; public static final int CoordinatorLayout_Layout_layout_behavior = 3; public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4; public static final int CoordinatorLayout_Layout_layout_insetEdge = 5; public static final int CoordinatorLayout_Layout_layout_keyline = 6; public static final int[] FontFamily = { 0x7f0300b2, 0x7f0300b3, 0x7f0300b4, 0x7f0300b5, 0x7f0300b6, 0x7f0300b7 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x01010532, 0x01010533, 0x0101053f, 0x7f0300b0, 0x7f0300b8, 0x7f0300b9 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_font = 3; public static final int FontFamilyFont_fontStyle = 4; public static final int FontFamilyFont_fontWeight = 5; public static final int[] RecyclerView = { 0x010100c4, 0x010100f1, 0x7f0300ab, 0x7f0300ac, 0x7f0300ad, 0x7f0300ae, 0x7f0300af, 0x7f0300db, 0x7f03014a, 0x7f03015a, 0x7f030160 }; public static final int RecyclerView_android_orientation = 0; public static final int RecyclerView_android_descendantFocusability = 1; public static final int RecyclerView_fastScrollEnabled = 2; public static final int RecyclerView_fastScrollHorizontalThumbDrawable = 3; public static final int RecyclerView_fastScrollHorizontalTrackDrawable = 4; public static final int RecyclerView_fastScrollVerticalThumbDrawable = 5; public static final int RecyclerView_fastScrollVerticalTrackDrawable = 6; public static final int RecyclerView_layoutManager = 7; public static final int RecyclerView_reverseLayout = 8; public static final int RecyclerView_spanCount = 9; public static final int RecyclerView_stackFromEnd = 10; } }
[ "aldwinotablante@gmail.com" ]
aldwinotablante@gmail.com
80b523d614ee1506c855d3c8e33e332f0b200a56
cb395742ad418d5cbd6ce51e009fba0c9a665c85
/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/fragment/R.java
55c87a8eedf0046888d3a684395117078c197f37
[]
no_license
M-Nikola/SimpleQuiz
9efd2ed16dbc954bb2c2d8174a9a69e92554c3cb
ce4a2c75e060b92f3ff0b0b2631d8c185a25ab1f
refs/heads/master
2021-06-16T06:30:59.986326
2019-07-02T14:26:43
2019-07-02T14:26:43
194,875,662
0
0
null
2021-05-12T00:57:55
2019-07-02T14:07:44
Java
UTF-8
Java
false
false
12,397
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.fragment; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f02002a; public static final int coordinatorLayoutStyle = 0x7f020065; public static final int font = 0x7f02007d; public static final int fontProviderAuthority = 0x7f02007f; public static final int fontProviderCerts = 0x7f020080; public static final int fontProviderFetchStrategy = 0x7f020081; public static final int fontProviderFetchTimeout = 0x7f020082; public static final int fontProviderPackage = 0x7f020083; public static final int fontProviderQuery = 0x7f020084; public static final int fontStyle = 0x7f020085; public static final int fontVariationSettings = 0x7f020086; public static final int fontWeight = 0x7f020087; public static final int keylines = 0x7f020099; public static final int layout_anchor = 0x7f02009c; public static final int layout_anchorGravity = 0x7f02009d; public static final int layout_behavior = 0x7f02009e; public static final int layout_dodgeInsetEdges = 0x7f02009f; public static final int layout_insetEdge = 0x7f0200a0; public static final int layout_keyline = 0x7f0200a1; public static final int statusBarBackground = 0x7f0200f4; public static final int ttcIndex = 0x7f020127; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f040048; public static final int notification_icon_bg_color = 0x7f040049; public static final int ripple_material_light = 0x7f040054; public static final int secondary_text_default_material_light = 0x7f040056; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f05004b; public static final int compat_button_inset_vertical_material = 0x7f05004c; public static final int compat_button_padding_horizontal_material = 0x7f05004d; public static final int compat_button_padding_vertical_material = 0x7f05004e; public static final int compat_control_corner_material = 0x7f05004f; public static final int compat_notification_large_icon_max_height = 0x7f050050; public static final int compat_notification_large_icon_max_width = 0x7f050051; public static final int notification_action_icon_size = 0x7f05005b; public static final int notification_action_text_size = 0x7f05005c; public static final int notification_big_circle_margin = 0x7f05005d; public static final int notification_content_margin_start = 0x7f05005e; public static final int notification_large_icon_height = 0x7f05005f; public static final int notification_large_icon_width = 0x7f050060; public static final int notification_main_column_padding_top = 0x7f050061; public static final int notification_media_narrow_margin = 0x7f050062; public static final int notification_right_icon_size = 0x7f050063; public static final int notification_right_side_padding_top = 0x7f050064; public static final int notification_small_icon_background_padding = 0x7f050065; public static final int notification_small_icon_size_as_large = 0x7f050066; public static final int notification_subtext_size = 0x7f050067; public static final int notification_top_pad = 0x7f050068; public static final int notification_top_pad_large_text = 0x7f050069; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f060073; public static final int notification_bg = 0x7f060074; public static final int notification_bg_low = 0x7f060075; public static final int notification_bg_low_normal = 0x7f060076; public static final int notification_bg_low_pressed = 0x7f060077; public static final int notification_bg_normal = 0x7f060078; public static final int notification_bg_normal_pressed = 0x7f060079; public static final int notification_icon_background = 0x7f06007a; public static final int notification_template_icon_bg = 0x7f06007b; public static final int notification_template_icon_low_bg = 0x7f06007c; public static final int notification_tile_bg = 0x7f06007d; public static final int notify_panel_notification_icon_bg = 0x7f06007e; } public static final class id { private id() {} public static final int action_container = 0x7f070010; public static final int action_divider = 0x7f070012; public static final int action_image = 0x7f070013; public static final int action_text = 0x7f070019; public static final int actions = 0x7f07001a; public static final int async = 0x7f070022; public static final int blocking = 0x7f070025; public static final int bottom = 0x7f070026; public static final int chronometer = 0x7f070030; public static final int end = 0x7f07003d; public static final int forever = 0x7f07004a; public static final int icon = 0x7f07004f; public static final int icon_group = 0x7f070050; public static final int info = 0x7f070054; public static final int italic = 0x7f070055; public static final int left = 0x7f070056; public static final int line1 = 0x7f070058; public static final int line3 = 0x7f070059; public static final int none = 0x7f070061; public static final int normal = 0x7f070062; public static final int notification_background = 0x7f070063; public static final int notification_main_column = 0x7f070064; public static final int notification_main_column_container = 0x7f070065; public static final int right = 0x7f07006b; public static final int right_icon = 0x7f07006c; public static final int right_side = 0x7f07006d; public static final int start = 0x7f070091; public static final int tag_transition_group = 0x7f070096; public static final int tag_unhandled_key_event_manager = 0x7f070097; public static final int tag_unhandled_key_listeners = 0x7f070098; public static final int text = 0x7f070099; public static final int text2 = 0x7f07009a; public static final int time = 0x7f07009d; public static final int title = 0x7f07009e; public static final int top = 0x7f0700a1; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f080005; } public static final class layout { private layout() {} public static final int notification_action = 0x7f09001e; public static final int notification_action_tombstone = 0x7f09001f; public static final int notification_template_custom_big = 0x7f090026; public static final int notification_template_icon_group = 0x7f090027; public static final int notification_template_part_chronometer = 0x7f09002b; public static final int notification_template_part_time = 0x7f09002c; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0b005a; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0c00f7; public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00f8; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00fa; public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00fd; public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00ff; public static final int Widget_Compat_NotificationActionContainer = 0x7f0c0170; public static final int Widget_Compat_NotificationActionText = 0x7f0c0171; public static final int Widget_Support_CoordinatorLayout = 0x7f0c0172; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f02002a }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] CoordinatorLayout = { 0x7f020099, 0x7f0200f4 }; public static final int CoordinatorLayout_keylines = 0; public static final int CoordinatorLayout_statusBarBackground = 1; public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f02009c, 0x7f02009d, 0x7f02009e, 0x7f02009f, 0x7f0200a0, 0x7f0200a1 }; public static final int CoordinatorLayout_Layout_android_layout_gravity = 0; public static final int CoordinatorLayout_Layout_layout_anchor = 1; public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2; public static final int CoordinatorLayout_Layout_layout_behavior = 3; public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4; public static final int CoordinatorLayout_Layout_layout_insetEdge = 5; public static final int CoordinatorLayout_Layout_layout_keyline = 6; public static final int[] FontFamily = { 0x7f02007f, 0x7f020080, 0x7f020081, 0x7f020082, 0x7f020083, 0x7f020084 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02007d, 0x7f020085, 0x7f020086, 0x7f020087, 0x7f020127 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
[ "milosevic.s.nikola@gmail.com" ]
milosevic.s.nikola@gmail.com
2cf4773022c08a75dc8ca149c1ab83db5ccfee59
ff443bad5681f9aa8868a2f4000406a1668d1da6
/groovy-psi/src/main/java/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrReferenceListElementType.java
3b58a338de42880ca0dd9cd3a9ada13e345bad77
[ "Apache-2.0" ]
permissive
consulo/consulo-groovy
db1b6108922e838b40c590ba33b495d2d7084d1d
f632985a683dfc6053f5602c50a23f619aca78cf
refs/heads/master
2023-09-03T19:47:57.655695
2023-09-02T11:02:52
2023-09-02T11:02:52
14,021,532
0
0
null
null
null
null
UTF-8
Java
false
false
2,933
java
/* * Copyright 2000-2014 JetBrains s.r.o. * * 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.jetbrains.plugins.groovy.lang.psi.stubs.elements; import com.intellij.java.language.psi.PsiNameHelper; import consulo.language.psi.stub.IndexSink; import consulo.language.psi.stub.StubElement; import consulo.language.psi.stub.StubInputStream; import consulo.language.psi.stub.StubOutputStream; import consulo.util.collection.ArrayUtil; import consulo.util.lang.StringUtil; import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrReferenceList; import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement; import org.jetbrains.plugins.groovy.lang.psi.stubs.GrReferenceListStub; import org.jetbrains.plugins.groovy.lang.psi.stubs.GrStubUtils; import org.jetbrains.plugins.groovy.lang.psi.stubs.index.GrDirectInheritorsIndex; import javax.annotation.Nonnull; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * @author ilyas */ public abstract class GrReferenceListElementType<T extends GrReferenceList> extends GrStubElementType<GrReferenceListStub, T> { public GrReferenceListElementType(final String debugName) { super(debugName); } @Override public GrReferenceListStub createStub(@Nonnull T psi, StubElement parentStub) { List<String> refNames = new ArrayList<String>(); for(GrCodeReferenceElement element : psi.getReferenceElementsGroovy()) { final String name = element.getText(); if(StringUtil.isNotEmpty(name)) { refNames.add(name); } } return new GrReferenceListStub(parentStub, this, ArrayUtil.toStringArray(refNames)); } @Override public void serialize(@Nonnull GrReferenceListStub stub, @Nonnull StubOutputStream dataStream) throws IOException { GrStubUtils.writeStringArray(dataStream, stub.getBaseClasses()); } @Override @Nonnull public GrReferenceListStub deserialize(@Nonnull StubInputStream dataStream, StubElement parentStub) throws IOException { return new GrReferenceListStub(parentStub, this, GrStubUtils.readStringArray(dataStream)); } @Override public void indexStub(@Nonnull GrReferenceListStub stub, @Nonnull IndexSink sink) { for(String name : stub.getBaseClasses()) { if(name != null) { sink.occurrence(GrDirectInheritorsIndex.KEY, PsiNameHelper.getShortClassName(name)); } } } @Override public boolean isLeftBound() { return true; } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
302c85555cd6d989a31d2b0512775ba6025b6d65
485248f1e5021ac84a7459f9a2a73b6fd1afbf59
/128-Longest-Consecutive-Sequence/solution.java
2f66d9a0c55ee22866a8775f676742d8a819156f
[]
no_license
XueyiGu/leetcode
5d8a8b441fe0dd916efae6efab1d4062d2cda1d2
31356ec3997a5c959a3f00ac54a941c3faaa12b7
refs/heads/master
2020-04-06T03:53:06.070737
2016-07-24T20:22:45
2016-07-24T20:22:45
56,539,986
0
1
null
null
null
null
UTF-8
Java
false
false
989
java
public class Solution { public int longestConsecutive(int[] nums) { HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>(); for(int i = 0; i < nums.length; i++){ map.put(nums[i], false); } int max = 0; for(int i = 0; i < nums.length; i++){ if(map.get(nums[i])){ continue; } int length = 1; map.put(nums[i], true); int right = nums[i] + 1; while(map.containsKey(right) && map.get(right) == false){ map.put(right, true); length++; right++; } int left = nums[i] - 1; while(map.containsKey(left) && map.get(left) == false){ map.put(left, true); length++; left--; } max = Math.max(max, length); } return max; } }
[ "xueyigu1990@gmail.com" ]
xueyigu1990@gmail.com
3df50a2768ede86e122517247bc4bb36fabe9bbc
0b2bf53aa85d76290730948c0891d43d215753e7
/openapi-validator/src/test/java/io/ballerina/openapi/validator/tests/Inputs.java
1fd4fbb1b72640fd5e66b9c320e0fec0927ecc4b
[ "Apache-2.0" ]
permissive
LahiruRajapaksha/ballerina-openapi
d69c9981c37ae9a7980bb9ebbf4863923f30cdff
95ca5064eea6b59da4077bac491f9ad9c30e5010
refs/heads/master
2023-08-16T20:23:45.145523
2021-09-25T15:24:34
2021-09-25T15:24:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,884
java
/* * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. 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 io.ballerina.openapi.validator.tests; import io.ballerina.compiler.api.SemanticModel; import io.ballerina.compiler.api.symbols.TypeSymbol; import io.ballerina.compiler.syntax.tree.SyntaxTree; /** * This test util for extract the symbol type for testing purposes. */ public class Inputs { private TypeSymbol paramType; private SemanticModel semanticModel; private SyntaxTree syntaxTree; public Inputs() { } public Inputs(TypeSymbol paramType, SyntaxTree syntaxTree, SemanticModel semanticModel) { this.paramType = paramType; this.syntaxTree = syntaxTree; this.semanticModel = semanticModel; } public TypeSymbol getParamType() { return paramType; } public void setParamType(TypeSymbol paramType) { this.paramType = paramType; } public SyntaxTree getSyntaxTree() { return syntaxTree; } public void setSyntaxTree(SyntaxTree syntaxTree) { this.syntaxTree = syntaxTree; } public SemanticModel getSemanticModel() { return semanticModel; } public void setSemanticModel(SemanticModel semanticModel) { this.semanticModel = semanticModel; } }
[ "sumudunissanke@gmail.com" ]
sumudunissanke@gmail.com
712bd58a134b0fafee62f9bdd680dd02e911ec9f
9f3984be056dbfc01fd9846d5ba2bc08e4a2dadf
/Book/FirebaseAuthentication/app/src/main/java/com/example/firebaseauthentication/Login.java
68a619a3bcaee925ec2477627351d8acdbcdc1e8
[]
no_license
hamidahmedantor/Android_Splash
a38820364782d8aaf8c18a4d0da9ec04cd6a715e
fa16f6c938ac48e86c933809d9db6625fda464d5
refs/heads/master
2022-07-08T23:08:19.566969
2020-05-14T12:32:18
2020-05-14T12:32:18
263,909,416
1
0
null
null
null
null
UTF-8
Java
false
false
341
java
package com.example.firebaseauthentication; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class Login extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); } }
[ "ahmedantorhamid.gmail.com" ]
ahmedantorhamid.gmail.com
b00fa5f39d7ff2b6b031ea6c5205c25046bbcb1c
979a0332c60117d130ea8c277c045f4dd32d5d3c
/app/src/main/java/com/example/week3daily3javanetworkcalls/model/User/UserResponse.java
295cefaf523e2c1a14c38f67618ef5239bc5028a
[]
no_license
fsdarwin/Week3Daily3JavaNetworkCalls
3f659dbb37ed42c421c612014ab003435e39d21e
1615624a4653e4648ba0d92d864c0e40a81bed8d
refs/heads/master
2020-04-19T16:41:12.537827
2019-01-30T09:06:59
2019-01-30T09:06:59
168,311,630
0
0
null
null
null
null
UTF-8
Java
false
false
1,567
java
package com.example.week3daily3javanetworkcalls.model.User; import android.os.Parcel; import android.os.Parcelable; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class UserResponse implements Parcelable { @SerializedName("results") @Expose private List<Result> results = null; @SerializedName("info") @Expose private Info info; public final static Creator<UserResponse> CREATOR = new Creator<UserResponse>() { @SuppressWarnings({ "unchecked" }) public UserResponse createFromParcel(Parcel in) { return new UserResponse(in); } public UserResponse[] newArray(int size) { return (new UserResponse[size]); } } ; protected UserResponse(Parcel in) { in.readList(this.results, (com.example.week3daily3javanetworkcalls.model.User.Result.class.getClassLoader())); this.info = ((Info) in.readValue((Info.class.getClassLoader()))); } public UserResponse() { } public List<Result> getResults() { return results; } public void setResults(List<Result> results) { this.results = results; } public Info getInfo() { return info; } public void setInfo(Info info) { this.info = info; } public void writeToParcel(Parcel dest, int flags) { dest.writeList(results); dest.writeValue(info); } public int describeContents() { return 0; } }
[ "frank.capstone@gmail.com" ]
frank.capstone@gmail.com
810bb38c2420ade7078e743fe52b26df698950d1
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/Jmol/rev11338-11938/right-trunk-11938/src/org/jmol/viewer/binding/Binding.java
3dabda2064f4b4fa1cd9253d431cff789b8c7bdd
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
7,022
java
package org.jmol.viewer.binding; import java.awt.Event; import java.util.Arrays; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; import org.jmol.util.Escape; import org.jmol.util.Logger; abstract public class Binding { public final static int WHEEL = 32; public final static int LEFT = 16; public final static int MIDDLE = Event.ALT_MASK; public final static int ALT = Event.ALT_MASK; public final static int RIGHT = Event.META_MASK; public final static int CTRL = Event.CTRL_MASK; public final static int SHIFT = Event.SHIFT_MASK; public final static int CTRL_ALT = CTRL | ALT; public final static int LEFT_MIDDLE_RIGHT = LEFT | MIDDLE | RIGHT; public final static int DOUBLE_CLICK = 2 << 8; public final static int SINGLE_CLICK = 1 << 8; private final static int BUTTON_MODIFIER_MASK = CTRL_ALT | SHIFT | LEFT | MIDDLE | RIGHT | WHEEL; private String name; private Hashtable bindings = new Hashtable(); public Hashtable getBindings() { return bindings; } public Binding(String name) { this.name = name; } public final String getName() { return name; } public final void bind(int mouseAction, int jmolAction) { addBinding(mouseAction + "\t" + jmolAction, new int[] {mouseAction, jmolAction}); } public void bind(int mouseAction, String name) { addBinding(mouseAction + "\t", Boolean.TRUE); addBinding(mouseAction + "\t" + name, new String[] { getMouseActionName(mouseAction, false), name }); } public final void unbind(int mouseAction, int jmolAction) { if (mouseAction == 0) unbindJmolAction(jmolAction); else removeBinding(mouseAction + "\t" + jmolAction); } public final void unbind(int mouseAction, String name) { if (name == null) unbindMouseAction(mouseAction); else removeBinding(mouseAction + "\t" + name); } public final void unbindJmolAction(int jmolAction) { Enumeration e = bindings.keys(); String skey = "\t" + jmolAction; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.endsWith(skey)) removeBinding(key); } } private void addBinding(String key, Object value) { if (Logger.debugging) Logger.debug("adding binding " + key + "\t==\t" + Escape.escape(value)); bindings.put(key, value); } private void removeBinding(String key) { if (Logger.debugging) Logger.debug("removing binding " + key); bindings.remove(key); } public final void unbindUserAction(String script) { Enumeration e = bindings.keys(); String skey = "\t" + script; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.endsWith(skey)) removeBinding(key); } } public final void unbindMouseAction(int mouseAction) { Enumeration e = bindings.keys(); String skey = mouseAction + "\t"; while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.startsWith(skey)) removeBinding(key); } } public final boolean isBound(int mouseAction, int action) { return bindings.containsKey(mouseAction + "\t" + action); } public final boolean isUserAction(int mouseAction) { return bindings.containsKey(mouseAction + "\t"); } public static int getMouseAction(int clickCount, int modifiers) { if (clickCount > 2) clickCount = 2; return (modifiers & BUTTON_MODIFIER_MASK) | (clickCount << 8); } public static int getMouseAction(String desc) { if (desc == null) return 0; int action = 0; desc = desc.toUpperCase(); if (desc.contains("CTRL")) action |= CTRL; if (desc.contains("ALT")) action |= ALT; if (desc.contains("SHIFT")) action |= SHIFT; if (desc.contains("MIDDLE")) action |= MIDDLE; else if (desc.contains("RIGHT")) action |= RIGHT; else if (desc.contains("WHEEL")) action |= WHEEL; else action |= LEFT; if (desc.contains("DOUBLE")) action |= DOUBLE_CLICK; else if ((action & WHEEL) == 0 || desc.contains("SINGLE")) action |= SINGLE_CLICK; return action; } public static int getModifiers(int mouseAction) { return mouseAction & BUTTON_MODIFIER_MASK; } public static int getClickCount(int mouseAction) { return mouseAction >> 8; } public String getBindingInfo(String[] actionNames, String qualifiers) { StringBuffer sb = new StringBuffer(); String qlow = (qualifiers == null || qualifiers.equalsIgnoreCase("all") ? null : qualifiers.toLowerCase()); Vector[] names = new Vector[actionNames.length]; for (int i = 0; i < actionNames.length; i++) names[i] = (qlow == null || actionNames[i].toLowerCase().indexOf(qlow) >= 0 ? new Vector() : null); Enumeration e = bindings.keys(); while (e.hasMoreElements()) { Object obj = bindings.get((String) e.nextElement()); if (!(obj instanceof int[])) continue; int[] info = (int[]) obj; int i = info[1]; if (names[i] == null) continue; names[i].add(getMouseActionName(info[0], true)); } for (int i = 0; i < actionNames.length; i++) { int n; if (names[i] == null || (n = names[i].size()) == 0) continue; Object[] list = names[i].toArray(); Arrays.sort(list); sb.append(actionNames[i]).append("\t"); String sep = ""; for (int j = 0; j < n; j++) { sb.append(sep); sb.append(((String) list[j]).substring(7)); sep = ", "; } sb.append('\n'); } return sb.toString(); } private static boolean includes(int mouseAction, int mod) { return ((mouseAction & mod) == mod); } public static String getMouseActionName(int mouseAction, boolean addSortCode) { StringBuffer sb = new StringBuffer(); if (mouseAction == 0) return ""; boolean isMiddle = (includes(mouseAction, MIDDLE) && !includes(mouseAction, LEFT) && !includes(mouseAction, RIGHT)); char[] code = " ".toCharArray(); if (includes(mouseAction, CTRL)) { sb.append("CTRL+"); code[4] = 'C'; } if (!isMiddle && includes(mouseAction, ALT)) { sb.append("ALT+"); code[3] = 'A'; } if (includes(mouseAction, SHIFT)) { sb.append("SHIFT+"); code[2] = 'S'; } if (includes(mouseAction, LEFT)) { code[1] = 'L'; sb.append("LEFT"); } else if (includes(mouseAction, RIGHT)) { code[1] = 'R'; sb.append("RIGHT"); } else if (isMiddle) { code[1] = 'W'; sb.append("MIDDLE"); } else if (includes(mouseAction, WHEEL)) { code[1] = 'W'; sb.append("WHEEL"); } if (includes(mouseAction, DOUBLE_CLICK)) { sb.append("+double-click"); code[0] = '2'; } return (addSortCode ? new String(code) + ":" + sb.toString() : sb .toString()); } }
[ "joliebig@fim.uni-passau.de" ]
joliebig@fim.uni-passau.de
c80edfbd460cc293fda74758d9257769db337056
d7511bab8c5841a31fc860e94bc1e75b1550c443
/src/fm/smart/r1/activity/CreateSoundResult.java
e4b7a28681b041721c25de067068daa1b68e2849
[]
no_license
tansaku/SmartFM-Mobile-Study-Dictionary
1d53ca7c77273a60d44ed34b15cec89dad37b1df
69e331405e580dd0ac8a41b516aee08d3108e1d3
refs/heads/master
2021-06-02T06:18:36.333294
2018-08-10T05:12:29
2018-08-10T05:12:29
321,739
1
2
null
null
null
null
UTF-8
Java
false
false
1,215
java
package fm.smart.r1.activity; import android.text.TextUtils; public class CreateSoundResult { int status_code = 0; String http_response = ""; String location = ""; public CreateSoundResult(int status_code, String http_response, String location) { this.status_code = status_code; this.http_response = http_response; this.location = location; } public String getTitle() { return "Create Sound Result"; } public boolean success(){ return (this.status_code == 201); } public String getMessage() { String message = ""; if(this.success()){ message = "Successfully Created Sound";//+ location; } else{ message = "Failed: "+ prettifyResponse(); } return message; } private String prettifyResponse() { String message = this.status_code + ", " + this.http_response; if (TextUtils .equals(this.http_response, "No access to modify Item.")) { message = "Apologies, at the moment sound can only be added to items you have created yourself."; } if (TextUtils .equals(this.http_response, "No access to modify Sentence.")) { message = "Apologies, at the moment sound can only be added to sentences you have created yourself."; } return message; } }
[ "srjoseph@hawaii.edu" ]
srjoseph@hawaii.edu
2806ac5bc53e2319e7ef6287285fa0440dc2d24f
fd618e8221ec2db0ccfde663bbd8ab78008a8f49
/projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/graphql/strategy/datajob/JobFieldStrategyByNextRunTest.java
0c93617ed49077926c6ce519b28e2e54fbb2c9eb
[ "Apache-2.0" ]
permissive
savadev/versatile-data-kit
04f3347215bf1eb5ca6fcf545358360aef8dcc88
9ac18145c6a32e0c3ae035b99796e87184a53522
refs/heads/main
2023-08-28T05:48:41.297395
2021-10-08T22:07:14
2021-10-11T13:40:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,328
java
/* * Copyright 2021 VMware, Inc. * SPDX-License-Identifier: Apache-2.0 */ package com.vmware.taurus.service.graphql.strategy.datajob; import com.cronutils.model.CronType; import com.cronutils.model.definition.CronDefinitionBuilder; import com.cronutils.model.time.ExecutionTime; import com.cronutils.parser.CronParser; import com.vmware.taurus.service.graphql.model.Criteria; import com.vmware.taurus.service.graphql.model.V2DataJob; import com.vmware.taurus.service.graphql.model.V2DataJobConfig; import com.vmware.taurus.service.graphql.model.V2DataJobSchedule; import com.vmware.taurus.service.graphql.model.Filter; import org.junit.jupiter.api.Test; import org.springframework.data.domain.Sort; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.chrono.ChronoZonedDateTime; import java.util.*; import java.util.function.Predicate; import static org.assertj.core.api.Assertions.assertThat; class JobFieldStrategyByNextRunTest { private final JobFieldStrategyByNextRun strategyByNextRun = new JobFieldStrategyByNextRun(); @Test void testJobNextRunStrategy_whenGettingStrategyName_shouldBeSpecific() { assertThat(strategyByNextRun.getStrategyName()).isEqualTo(JobFieldStrategyBy.NEXT_RUN_EPOCH_SECS); } @Test void testJobNextRunStrategy_whenAlteringFieldData_shouldModifyState() { String scheduleCron = "12 5 2 3 *"; var executionTime = ExecutionTime.forCron( new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.UNIX)).parse(scheduleCron)); Optional<ZonedDateTime> utc = executionTime.nextExecution(ZonedDateTime.now(ZoneId.of("UTC"))); int baseTime = Math.toIntExact(utc.map(ChronoZonedDateTime::toEpochSecond).get()); V2DataJob dataJob = new V2DataJob(); V2DataJobConfig dataJobConfig = new V2DataJobConfig(); V2DataJobSchedule dataJobSchedule = new V2DataJobSchedule(); dataJobConfig.setSchedule(dataJobSchedule); dataJobSchedule.setScheduleCron(scheduleCron); dataJob.setConfig(dataJobConfig); assertThat(dataJob.getConfig().getSchedule().getNextRunEpochSeconds()).isZero(); strategyByNextRun.alterFieldData(dataJob); int nextRunEpochSeconds = dataJob.getConfig().getSchedule().getNextRunEpochSeconds(); assertThat(nextRunEpochSeconds).isNotZero().isEqualTo(baseTime); } @Test void testJobNextRunStrategy_whenAlteringFieldDataWithNullConfig_shouldNotModifyState() { V2DataJob dataJob = createDummyJob("12 5 2 3 *"); dataJob.setConfig(null); strategyByNextRun.alterFieldData(dataJob); assertThat(dataJob.getConfig()).isNull(); } @Test void testJobNextRunStrategy_whenAlteringFieldDataWithNullSchedule_shouldNotModifyState() { V2DataJob dataJob = createDummyJob(null); dataJob.setConfig(new V2DataJobConfig()); strategyByNextRun.alterFieldData(dataJob); assertThat(dataJob.getConfig().getSchedule()).isNull(); } @Test void testJobNextRunStrategy_whenAlteringFieldDataWithEmptySchedule_shouldReturnInvalidSchedule() { V2DataJob dataJob = createDummyJob(null); V2DataJobSchedule dataJobSchedule = new V2DataJobSchedule(); dataJobSchedule.setScheduleCron(" "); V2DataJobConfig dataJobConfig = new V2DataJobConfig(); dataJobConfig.setSchedule(dataJobSchedule); dataJob.setConfig(dataJobConfig); strategyByNextRun.alterFieldData(dataJob); assertThat(dataJob.getConfig().getSchedule().getNextRunEpochSeconds()).isEqualTo(-1); } @Test void testJobNextRunStrategy_whenAlteringFieldDataWithInvalidSchedule_shouldReturnInvalidSchedule() { V2DataJob dataJob = createDummyJob(null); V2DataJobSchedule dataJobSchedule = new V2DataJobSchedule(); dataJobSchedule.setScheduleCron("* * "); V2DataJobConfig dataJobConfig = new V2DataJobConfig(); dataJobConfig.setSchedule(dataJobSchedule); dataJob.setConfig(dataJobConfig); strategyByNextRun.alterFieldData(dataJob); assertThat(dataJob.getConfig().getSchedule().getNextRunEpochSeconds()).isEqualTo(-1); } @Test void testJobNextRunStrategy_whenComputingValidCriteriaWithoutFilter_shouldReturnValidCriteria() { Criteria<V2DataJob> baseCriteria = new Criteria<>(Objects::nonNull, Comparator.comparing(V2DataJob::getJobName)); Filter baseFilter = new Filter("random", null, Sort.Direction.DESC); V2DataJob a = createDummyJob("5 4 * * *"); V2DataJob b = createDummyJob("5 6 * * *"); // later than previous Criteria<V2DataJob> v2DataJobCriteria = strategyByNextRun.computeFilterCriteria(baseCriteria, baseFilter); assertThat(v2DataJobCriteria.getPredicate().test(a)).isTrue(); assertThat(v2DataJobCriteria.getComparator().compare(a, b)).isPositive(); } /** * This test should create two data jobs executed: * a - “At 04:05 on day-of-month 1 and on Monday in January.” * b 0 “At 04:05 every day” * * by this info we create a two dates to make a range: * Next week and February 1st next year. This will makes a range which should include data job "a", but excludes "b" * so that test does not fail each year on specific time */ @Test void testJobNextRunStrategy_whenComputingValidCriteriaWithFilter_shouldReturnValidCriteria() { Criteria<V2DataJob> baseCriteria = new Criteria<>(Objects::nonNull, Comparator.comparing(V2DataJob::getJobName)); Filter baseFilter = new Filter("config.schedule.nextRunEpochSeconds", String.format("%d-%d",getNextWeek(), getSecondMonthOfNextYear()), Sort.Direction.ASC); V2DataJob a = createDummyJob("5 4 1 1 1"); V2DataJob b = createDummyJob("5 6 * * *"); // later than previous Criteria<V2DataJob> v2DataJobCriteria = strategyByNextRun.computeFilterCriteria(baseCriteria, baseFilter); assertThat(v2DataJobCriteria.getPredicate().test(a)).isTrue(); assertThat(v2DataJobCriteria.getPredicate().test(b)).isFalse(); assertThat(v2DataJobCriteria.getComparator().compare(a, b)).isPositive(); } @Test void testJobNextRunStrategy_whenComputingInvalidSearchProvided_shouldReturnValidPredicate() { Predicate<V2DataJob> predicate = strategyByNextRun.computeSearchCriteria("A"); V2DataJob a = createDummyJob("5 6 * * *"); assertThat(predicate.test(a)).isFalse(); } private V2DataJob createDummyJob(String schedule) { V2DataJob job = new V2DataJob(); V2DataJobConfig config = new V2DataJobConfig(); V2DataJobSchedule dataJobSchedule = new V2DataJobSchedule(); dataJobSchedule.setScheduleCron(schedule); config.setSchedule(dataJobSchedule); job.setConfig(config); strategyByNextRun.alterFieldData(job); return job; } private long getSecondMonthOfNextYear() { final Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.MONTH, 1); calendar.add(Calendar.YEAR, 1); return calendar.getTimeInMillis() / 1000; } private long getNextWeek() { final Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.WEEK_OF_YEAR, 1); return calendar.getTimeInMillis() / 1000; } }
[ "noreply@github.com" ]
noreply@github.com
a3bdeb1238da4a5419fcd079e1be57d2ec3a48a6
c650eda0c3a623c5a128e8cdfb0cb134616a8785
/pdp/src/Interface/Other.java
545a2fdb186c03cf1c4790f2a5b1def4001f18a6
[]
no_license
JeanneWattelet/pdp
c0e5f1875642ffa01ab2b3ddac84c28cd27a07e8
12043ef117d56d972f2e8a18063af18163f5acb9
refs/heads/master
2022-07-18T10:08:34.644265
2020-05-13T14:20:44
2020-05-13T14:20:44
242,764,078
0
0
null
null
null
null
UTF-8
Java
false
false
34,413
java
package Interface; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.jgrapht.graph.SimpleWeightedGraph; import de.fhpotsdam.unfolding.examples.animation.Edge; import de.fhpotsdam.unfolding.examples.animation.FadeTwoMapsApp; import de.fhpotsdam.unfolding.examples.animation.InfoStation; import de.fhpotsdam.unfolding.examples.animation.PositionInCity; import de.fhpotsdam.unfolding.geo.Location; import domain.ArcTrajet; import domain.ChercherChemin; import javafx.animation.AnimationTimer; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.input.ScrollEvent; import javafx.scene.layout.HBox; import javafx.scene.text.Font; import javafx.scene.text.FontWeight; import javafx.stage.Stage; import transport.Coordonnees; // CLASSE INTERFACE public class Other extends Application { /////////////////////////////////////////////////// PARAMETERS /////////////////////////////////////////////////// // width and height of the canvas private final static double WIDTH = 600; private final static double HEIGHT = 600; // zone of canvas used without menu bar private final static double bestWidth = WIDTH*0.9375; private final static double bestHeight = HEIGHT*0.9375; // middle zone private final static double bW2 = bestWidth/2; private final static double bH2 = bestHeight/2; // check what the user does in the application private String action = "first"; // if entered in case route private int wasInSchedule = 0; // draw one time in root private int countButtonOk = 0; // position start when search a route public static String start; // position end when search a route public static String end; // date and route when search a route public String date; // objective of the solver (0 : fast, 1 : less walking, 2 : less transports, 3 : less waiting time) public static int objectif = 0; // start location private Location startLocation = new Location(0,0); // end location private Location endLocation = new Location(0,0); // tab of station (to load or save) public static List<ArcTrajet> listStations; // tab of station's name public static List<String> listNameStations; // tab of station's numero public static List<String> listNumeroStations; // tab of station's coordinates public static List<Location> listCoordStations; // tab of route public static List<String> listHoraire; // list of lines banned by user private List<String> listBanned = new ArrayList<String>(); // all locations possible private List<PositionInCity> allLocations = new ArrayList<PositionInCity>(); // info stations private List<String> infoStations = new ArrayList<String>(); // line chosen in perturbation or schedule private String line; // zoom or not to check schedule private int zoom = 0; // path to access to the images public static String getRessourcePathByName(String name) { return Other.class.getResource("/images/" + name).toString(); } public static String getHorariesPathByName(String name) { return Other.class.getResource("/imgHoraries/" + name).toString(); } public static String getLogoPathByName(String name) { return Other.class.getResource("/imgLogo/" + name + ".png").toString(); } // all images used private Image imgFond = new Image(getRessourcePathByName("fond.jpg"), WIDTH, HEIGHT, false, false); private Image imgSchedule = new Image(getRessourcePathByName("schedule.png"), bW2, bH2, false, false); private Image imgRoute = new Image(getRessourcePathByName("route.png"), bW2, bH2, false, false); private Image imgPerturbation = new Image(getRessourcePathByName("perturbation.png"), bW2, bH2, false, false); private Image imgAboutUs = new Image(getRessourcePathByName("aboutUs.png"), bW2, bH2, false, false); private Image imgLeave = new Image(getRessourcePathByName("leave.jpg"), bestWidth/15, bestHeight/15, false, false); private Image imgLoad = new Image(getRessourcePathByName("load.png"), bestWidth/15, bestHeight/15, false, false); private Image imgSave = new Image(getRessourcePathByName("save.png"), bestWidth/15, bestHeight/15, false, false); private Image imgPrevious = new Image(getRessourcePathByName("previous.png"), bestWidth/15, bestHeight/15, false, false); private Image imgDetail = new Image(getRessourcePathByName("detail.jpg"), bestWidth/15, bestHeight/15, false, false); private Image imgBus = new Image(getRessourcePathByName("bus.png"), bestWidth/12, bestHeight/12, false, false); private Image imgTram = new Image(getRessourcePathByName("tram.png"), bestWidth/12, bestHeight/12, false, false); private Image imgMarche = new Image(getRessourcePathByName("marche.png"), bestWidth/12, bestHeight/12, false, false); // list of images corresponding (schedule0, route1, perturbation2, aboutUs3, other4, carte5, save6, load7, previous8, leave9) private List<Image> imgListTransport = new ArrayList<Image>(); // list of circles private static List<Circle> circles; // res of best path public static int tempsFinal; // number of circles private final static int nbrCercle = 10; // circles of perturbations set private List<Circle> circlesPerturb; // point clicked private Point pointClick; // number of offset to zoom private int nbrDecalX; private int nbrDecalY; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////// CLICK AREA /////////////////////////////////////////////////// // no circles in canvas public void moveCirclesToNull(int a) { for(int i = 0; i<nbrCercle-a; i++) { circles.get(i).putTo(-500, -500); } } // move circle leave public void moveCircleExit() { circles.get(9).putTo(bestWidth+bestWidth/30, bestHeight+bestHeight/30); } // move circles to its good position public void moveCirclesTo(int a, int b) { for(int i = 0; i<nbrCercle-2; i++) { circles.get(i).putTo(-500, -500); } circles.get(a).putTo(bestWidth - 2*bestWidth/15, bestHeight + bestWidth/30); if(b != -1) { circles.get(b).putTo(bestWidth - 3*bestWidth/15, bestHeight + bestWidth/30); } } // move break to its position public void moveCircleTo(int a) { if(a == 8) { circles.get(a).putTo(bestWidth - bestWidth/15, bestHeight + bestWidth/30); } else { circles.get(a).putTo(bestWidth - 2*bestWidth/15, bestHeight + bestWidth/30); } } // move circles to the menu position and exclude the others public void moveToMenu() { circles.get(0).putTo(bW2/2, bH2/2); circles.get(1).putTo(bW2+bW2/2,bH2/2); circles.get(2).putTo(bW2/2,bH2+bH2/2); circles.get(3).putTo(bW2+bW2/2,bH2+bH2/2); circles.get(9).putTo(bestWidth + bestWidth/30, bestHeight + bestWidth/30); for(int i = 4; i<9; i++) { circles.get(i).putTo(-500, -500); } } // recall : circles = (schedule0, route1, perturbation2, aboutUs3, other4, carte5, save6, load7, previous8, leave9) // move circles at the right place private void moveTo() { if(action != "first") { if(action == "schedule"){ moveCirclesTo(7, -1); // OK-Previous-Load } else if(action == "load" || action == "detailSchedule" || action == "save" || action == "detailRoute") { moveCirclesTo(5,6); // carte-save-Previous } else { moveCirclesToNull(2); // change position except previous and exit } moveCircleTo(8); // previous } else { moveToMenu(); } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////// USEFUL FUNCTIONS /////////////////////////////////////////// // transform second on a real time private String toTime(String sec) { double s = Integer.parseInt(sec); int h = 0; int m = 0; while(s-3600 >= 0) { s=s-3600; h++; } while(s-60 >= 0) { s=s-60; m++; } return (int)h+"h"+(int)m+"m"+(int)s+"s"; } // previous action private String previous(){ if(action == "schedule" || action == "aboutUs" || action == "perturbation" || action == "route"){ return "first"; } else if(action == "load"){ return "schedule"; } else if(action == "detailSchedule" || action == "save"){ reinitializeRoute(); return "schedule"; } else if(action == "detailRoute"){ return "route"; } else if(action == "carte"){ return "detailSchedule"; } else if(action == "horaries"){ return "route"; } return action; } // reinitialize data of route private void reinitializeRoute() { start = ""; end = ""; listStations = new ArrayList<ArcTrajet>(); listNameStations = new ArrayList<String>(); listHoraire = new ArrayList<String>(); listCoordStations = new ArrayList<Location>(); } // test the station validity private boolean isValid(String s) { if(s == "bus" || s == "tram") { return true; } for(int i = 0; i < infoStations.size(); i++) { if(s.equals(infoStations.get(i))) { return true; } } return false; } // test the start and end validity private boolean isValid(String s, String t, String city, String city2) { // need to verify name cities validity before or arrange it if not write correctly int k = 0; while((startLocation.getLat() == 0 || endLocation.getLat() == 0) && k < allLocations.size()) { if(allLocations.get(k).getString().toLowerCase().equals((String) s.toLowerCase() + city.toLowerCase())) { startLocation = allLocations.get(k).getLocation(); } else if(allLocations.get(k).getString().toLowerCase().equals((String) t.toLowerCase() + city2.toLowerCase())) { endLocation = allLocations.get(k).getLocation(); } k++; } if(k < allLocations.size()) { return true; } return false; } @SuppressWarnings("unchecked") public void chargeInfoStations() { try { ObjectInputStream entry = new ObjectInputStream(new FileInputStream("src/data1/infoLignes.dat")); infoStations = (List<String>) entry.readObject(); entry.close(); } catch(Exception e) { System.out.println("Error : " + e.getMessage()); } } // charge all location possible @SuppressWarnings("unchecked") private void chargeAllLocations() { try { ObjectInputStream entry = new ObjectInputStream(new FileInputStream("src/data1/allPositions.dat")); allLocations = (List<PositionInCity>) entry.readObject(); entry.close(); } catch(Exception e) { System.out.println("Error : " + e.getMessage()); } } @SuppressWarnings("unchecked") private void chargeGrapheOfWalkTime() { try { ObjectInputStream load = new ObjectInputStream(new FileInputStream("src/data1/grapheBx.dat")); FadeTwoMapsApp.loadedGraphe = (SimpleWeightedGraph<String, Edge>) load.readObject(); load.close(); } catch(Exception e) { System.out.println("Error " + e.getMessage()); } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////// MAIN FUNCTION ////////////////////////////////////////////// public static void main(String[] args) { launch(args); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////// START APPLICATION ////////////////////////////////////////// // start function public void start(final Stage stage) { ///////////////////////////////////////////// INITALIZATION //////////////////////////////////////////// // initialize canvas and display stage.setTitle("Projet de programmation"); stage.setResizable(false); // can't change size final Group root = new Group(); Scene scene = new Scene(root, WIDTH, HEIGHT); final Canvas canvas = new Canvas(WIDTH, HEIGHT); root.getChildren().add(canvas); final GraphicsContext gc = canvas.getGraphicsContext2D(); gc.setFont(Font.font("Helvetica", FontWeight.BOLD, 24)); stage.setScene(scene); stage.show(); // initialize perturbations listBanned = Deserialisable.takePerturbations(); // initialize graphe of walk chargeGrapheOfWalkTime(); // initialize informations of stations chargeInfoStations(); // initialize all locations chargeAllLocations(); // initalize images transport imgListTransport.add(imgBus); imgListTransport.add(imgTram); imgListTransport.add(imgMarche); // initialize circles Circle circleSchedule = new Circle(bW2/2); Circle circleRoute = new Circle(bW2/2); Circle circlePerturbation = new Circle(bW2/2); Circle circleAboutUs = new Circle(bW2/2); Circle circleLeave = new Circle(bestWidth/30); Circle circleLoad = new Circle(bestWidth/30); Circle circleSave = new Circle(bestWidth/30); Circle circlePrevious = new Circle(bestWidth/30); Circle circleOther = new Circle(bestWidth/30); Circle circleDetail = new Circle(bestWidth/30); // initialize list of this circles circles = new ArrayList<Circle>(); circles.add(circleSchedule);circles.add(circleRoute);circles.add(circlePerturbation); circles.add(circleAboutUs);circles.add(circleOther);circles.add(circleDetail); circles.add(circleSave);circles.add(circleLoad);circles.add(circlePrevious);circles.add(circleLeave); // initialize circle's position moveToMenu(); // to choose the objective HBox buttonCheck = new HBox(); CheckBox check0 = new CheckBox(); CheckBox check1 = new CheckBox(); CheckBox check2 = new CheckBox(); CheckBox check3 = new CheckBox(); ///////////////////////////////////////////// MOUSE EVENT ///////////////////////////////////////// // mouse click scene.setOnMouseClicked(new EventHandler<MouseEvent>() { public void handle(MouseEvent e) { // get the position of the click pointClick = new Point(e.getX(), e.getY()); // Recall : circles = (schedule0, route1, perturbation2, aboutUs3, other4, carte5, save6, load7, previous8, leave9) // updating action if (circles.get(0).isInside(pointClick)) { action = "schedule"; start = ""; end = ""; date = ""; objectif = 0; // reinitialize values } else if(circles.get(1).isInside(pointClick)){ action = "route"; } else if(circles.get(2).isInside(pointClick)){ action = "perturbation"; circlesPerturb = new ArrayList<Circle>(); // initialize the list of perturbation's circle if(listBanned.size() > 0) { for(int i = 0; i < listBanned.size(); i++) { Circle c = new Circle(bestWidth/30, new Point((bestWidth/10)*(i+1)+bestWidth/60, 1.25*bH2+bestWidth/60)); // circle's position circlesPerturb.add(c); } } } else if(circles.get(3).isInside(pointClick)){ action = "aboutUs"; } else if(circles.get(4).isInside(pointClick)){ action = "other"; } else if(circles.get(5).isInside(pointClick)){ FadeTwoMapsApp.OneMain(); // launch the map of the city with the route } else if(circles.get(6).isInside(pointClick)){ action = "save"; Serialisable.SaveSchedule(); // save the route } else if(circles.get(7).isInside(pointClick)){ action = "load"; Deserialisable.Deserialize(); // load the route saved if(listStations.size() == 0) { action = previous(); } } else if(circles.get(8).isInside(pointClick)){ action = previous(); countButtonOk = 0; // to delete the root } else if(circles.get(9).isInside(pointClick)){ action = "leave"; } else if(action == "horaries"){ if(e.getButton().equals(MouseButton.PRIMARY)) { // double click if(e.getClickCount() == 2) { if(zoom == 0) { // zoom in gc.scale(2.0, 2.0); moveCirclesToNull(0); // without circles zoom = 1; // zoom is activated } else { moveCircleExit(); while(nbrDecalX != 0) { // offset limited to the width of the canvas gc.translate(0, HEIGHT/4); nbrDecalX--; } while(nbrDecalY != 0) { // offset limited to the height of the canvas gc.translate(WIDTH/4, 0); nbrDecalY--; } gc.scale(0.5, 0.5); // zoom out zoom = 0; // zoom is inactive } } } } if(zoom != 1) { // don't add circles if zoom is active moveTo(); } // to delete a perturbation if(action == "perturbation") { if(listBanned.size() > 0) { for(int i = 0; i < listBanned.size(); i++) { if(circlesPerturb.get(i).isInside(pointClick)) { listBanned.remove(i); circlesPerturb.remove(i); Serialisable.putPerturbations(listBanned); listBanned = Deserialisable.takePerturbations(); break; } } } } System.out.println(action); // display the action System.out.println(pointClick); // display the click's coordinates } }); // if zoom is active, we retain the place clicked for offset to check the schedules scene.setOnMousePressed(new EventHandler<MouseEvent>() { public void handle(MouseEvent e) { if(zoom == 1) { pointClick = new Point(e.getX(), e.getY()); } } }); // scroll to zoom or not (no mouse to test) scene.setOnScroll(new EventHandler<ScrollEvent>(){ public void handle( ScrollEvent event ) { if(action == "horaries") { if(zoom == 0) { gc.scale(2.0, 2.0); moveCirclesToNull(0); // without circles zoom = 1; // zoom is activated moveTo(); } else { gc.scale(0.5, 0.5); zoom = 0; } } } }); // repair a movement for offset to check the schedules EventHandler<MouseEvent> mouse = new EventHandler<MouseEvent>() { public void handle(MouseEvent e) { if(zoom == 1) { // zoom must be active Point pointRelease = new Point(e.getX(), e.getY()); // point release coordinates if(!e.isDragDetect()) { if(pointClick.getPointY() < pointRelease.getPointY() && Math.abs(pointRelease.getPointX() - pointClick.getPointX()) <= 90) { // to the North if(nbrDecalX > 0) { gc.translate(0, HEIGHT/4); nbrDecalX--; } } else if(pointClick.getPointY() >= pointRelease.getPointY() && Math.abs(pointRelease.getPointX() - pointClick.getPointX()) <= 90) { // to the South if(nbrDecalX < 2) { gc.translate(0, -HEIGHT/4); nbrDecalX++; } } else if(pointClick.getPointX() < pointRelease.getPointX() && Math.abs(pointRelease.getPointY() - pointClick.getPointY()) <= 90) { // to the East if(nbrDecalY > 0) { gc.translate(WIDTH/4, 0); nbrDecalY--; } } else if(pointClick.getPointX() >= pointRelease.getPointX() && Math.abs(pointRelease.getPointY() - pointClick.getPointY()) <= 90) { // to the West if(nbrDecalY < 2) { gc.translate(-WIDTH/4, 0); nbrDecalY++; } } } } } }; scene.setOnMouseReleased(mouse); ///////////////////////////////////////////// ANIMATION LAUNCH ///////////////////////////////////// AnimationTimer animation = new AnimationTimer() { @SuppressWarnings("deprecation") public void handle(long arg0){ gc.drawImage(imgFond, 0, 0); // background if(action == "schedule" || action == "route" || action == "perturbation"){ if(action == "route" || action == "perturbation") { if(action == "perturbation") { gc.fillText("Une ligne a eviter ??", bestWidth*0.35, bestHeight*0.2); if(listBanned.size() > 0) { // draw lines to avoid for(int i = 0; i < listBanned.size(); i++) { double putX = (bestWidth/10)*(i+1); double putY = 1.25*bH2; try { gc.drawImage(new Image(getLogoPathByName(listBanned.get(i)), bestWidth/15, bestHeight/15, false, false), putX, putY); } catch(Exception e) { } } } } else { gc.fillText("Chercher un horaire", bestWidth*0.35, bestHeight*0.2); } gc.fillText("Ligne", bestWidth*0.5 , bestHeight*0.33, 30); if(countButtonOk == 0) { // added one time to the root // text area final TextField TextField = new TextField(); TextField.setPromptText(" Ligne "); // updating size TextField.setMaxWidth(bestWidth*0.5); TextField.setMaxHeight(bestWidth/75); // button to click Button buttonOK = new Button("RECHERCHER"); buttonOK.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { line = TextField.getText(); if(action == "route") { action = "horaries"; } else { if(listBanned.size() < 9 && !line.isEmpty() && isValid(line) && !listBanned.contains(line)) { // put bus, tram or a line's number to avoid it (limited to 9) Serialisable.retainPerturbation(line); // retain perturbation in memory listBanned.clear(); listBanned = Deserialisable.takePerturbations(); // new list of lines banned // updating list of circles circlesPerturb.clear(); if(listBanned.size() > 0) { for(int i = 0; i < listBanned.size(); i++) { Circle c = new Circle(bestWidth/30, new Point((bestWidth/10)*(i+1)+bestWidth/60, 1.25*bH2+bestWidth/60) ); circlesPerturb.add(c); } } } } } }); // updating position in root TextField.setTranslateX(bestWidth*0.41); TextField.setTranslateY(bestHeight*0.35); buttonOK.setTranslateX(bestWidth*0.465); buttonOK.setTranslateY(bestHeight*0.5); root.getChildren().addAll(TextField, buttonOK); wasInSchedule = 1; // used for previous } countButtonOk++; // added one time to the root } else if(action == "schedule"){ gc.drawImage(imgLoad, bestWidth - 2*bestWidth/15 - bestWidth/30, bestHeight); gc.fillText("Chercher un itineraire", bestWidth*0.35 , bestHeight*0.2); gc.fillText("Plus rapide", bestWidth*0.1*1.35, bestHeight*0.495, bestWidth*0.08); gc.fillText("Moins de marche", bestWidth*0.3*1.25, bestHeight*0.495, bestWidth*0.11); gc.fillText("Moins d'attente", bestWidth*0.5*1.23, bestHeight*0.495, bestWidth*0.11); gc.fillText("Trajet de marche uniquement", bestWidth*0.7*1.215, bestHeight*0.495, bestWidth*0.11); gc.fillText("Heure de depart", bestWidth*0.43*0.65, bestHeight*0.586, bestWidth*0.11); gc.fillText("ou", bestWidth*0.52, bestHeight*0.643, bestWidth*0.03); gc.fillText("Arriver avant", bestWidth*0.43*0.7, bestHeight*0.697, bestWidth*0.10); if(countButtonOk == 0) { // added one time to the root // text areas TextField TextField = new TextField(); TextField TextField2 = new TextField(); TextField TextField3 = new TextField(); TextField TextField4 = new TextField(); TextField TextField5 = new TextField(); TextField TextField6 = new TextField(); TextField.setPromptText(" Adresse de depart "); //TextField.setText("46 rue jules guesde"); TextField2.setPromptText(" Adresse d'arrivee "); //TextField2.setText("48 rue jules guesde"); Date d = new Date(); TextField3.setText(d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds()); TextField4.setPromptText("00:00:00"); TextField5.setText("Bordeaux"); TextField6.setText("Bordeaux"); buttonCheck.setPrefSize(bestWidth*0.5, bestHeight/75); // button launch Button buttonOK = new Button("RECHERCHER"); buttonOK.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { // useful to find the better route start = TextField.getText(); end = TextField2.getText(); date = TextField3.getText(); if(check0.isSelected()) { objectif = 0; } else if(check1.isSelected()) { objectif = 1; } else if(check2.isSelected()) { objectif = 2; } else if(check3.isSelected()) { objectif = 4; } else { objectif = -1; } if(isValid(start, end, TextField5.getText(), TextField6.getText()) && objectif != -1) { // check validity action = "detailSchedule"; moveTo(); listStations = new ArrayList<ArcTrajet>(); String dateEnd = TextField4.getText(); if(objectif != 4) { listNameStations = new ArrayList<String>(); listNumeroStations = new ArrayList<String>(); listHoraire = new ArrayList<String>(); listCoordStations = new ArrayList<Location>(); Coordonnees p1 = new Coordonnees(startLocation.getLat(), startLocation.getLon()); boolean partirA = true; if(dateEnd == "") { partirA = false; } ChercherChemin c = new ChercherChemin(); c.chercherChemin(start, end, dateEnd, 7, objectif, partirA); ////////////////////////////////////////////////////////// EXAMPLES //////////////////////////////////////////////////////////// // sourceT not present /*ArcTrajet startArc = new ArcTrajet(2, start + "%" + p1 + "%17:00:00", "Arts et Metiers%44.805983;-0.602284%17:10:00", "marche"); ArcTrajet e0 = new ArcTrajet(0, "Arts et Metiers%44.805983;-0.602284%17:10:00", "Quinconces B%44.844469;-0.573792%17:20:00", "Tram B"); ArcTrajet e1 = new ArcTrajet(2, "Quinconces B%44.844469;-0.573792%17:20:00", "Quinconces C%44.84420;-0.57195%17:30:00", "marche"); ArcTrajet e2 = new ArcTrajet(0, "Quinconces C%44.84420;-0.57195%17:30:00", "Gare St-Jean%44.825918;-0.556807%17:40:00", "Tram C"); listStations.add(startArc); listStations.add(e0); listStations.add(e1); listStations.add(e2); listNameStations.add(start); listNameStations.add("Arts et Metier"); listNameStations.add("Quinconces B"); listNameStations.add("Quinconces C"); listNameStations.add("Gare St_Jean"); listCoordStations.add(startLocation); listCoordStations.add(new Location(44.805983,-0.602284)); listCoordStations.add(new Location(44.844469,-0.573792)); listCoordStations.add(new Location(44.84420,-0.57195)); listCoordStations.add(new Location(44.825918,-0.556807)); listHoraire.add("600");listHoraire.add("600");listHoraire.add("600");listHoraire.add("600"); listNumeroStations.add("marche");listNumeroStations.add("Tram B");listNumeroStations.add("marche");listNumeroStations.add("Tram C"); date = "17:00:00";*/ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // to check !! listCoordStations.add(startLocation); for(int i = 0; i < listStations.size(); i++) { listNumeroStations.add(listStations.get(i).getNom()); String[] m = ((String) listStations.get(i).getSourceT()).split("%"); int index = m[1].indexOf(";"); Double d1 = Double.parseDouble(m[1].substring(0, index)); Double d2 = Double.parseDouble(m[1].substring(index+1)); listNameStations.add(m[0]); listHoraire.add(listStations.get(i).getWeightT() + ""); if(i != 0) { listCoordStations.add(new Location(d1,d2)); } } String[] m = ((String) listStations.get(listStations.size()-1).getSourceT()).split("%"); int index = m[1].indexOf(";"); Double d1 = Double.parseDouble(m[1].substring(0, index)); Double d2 = Double.parseDouble(m[1].substring(index+1)); listNameStations.add(m[0]); listCoordStations.add(new Location(d1, d2)); System.out.println(listStations); System.out.println(listNameStations); System.out.println(listCoordStations); System.out.println(listHoraire); System.out.println(listNumeroStations); for(int i = 0; i < listHoraire.size(); i++) { tempsFinal += Integer.parseInt(listHoraire.get(i)); listHoraire.set(i, toTime(listHoraire.get(i))); } } else { listCoordStations = new ArrayList<Location>(); listCoordStations.add(startLocation); listCoordStations.add(endLocation); FadeTwoMapsApp.OneMain(); action = "schedule"; } } else { // if one element is not valid action = "schedule"; moveTo(); } } }); // updating position in root TextField.setTranslateX(bestWidth*0.2); TextField.setTranslateY(bestHeight*0.29); TextField2.setTranslateX(bestWidth*0.2); TextField2.setTranslateY(bestHeight*0.38); TextField3.setTranslateX(bestWidth*0.43); TextField3.setTranslateY(bestHeight*0.56); TextField4.setTranslateX(bestWidth*0.43); TextField4.setTranslateY(bestHeight*0.67); TextField5.setTranslateX(bestWidth*0.6); TextField5.setTranslateY(bestHeight*0.29); TextField6.setTranslateX(bestWidth*0.6); TextField6.setTranslateY(bestHeight*0.38); check0.setTranslateX(bestWidth*0.1); check0.setTranslateY(bestHeight*0.47); check1.setTranslateX(bestWidth*0.3); check1.setTranslateY(bestHeight*0.47); check2.setTranslateX(bestWidth*0.5); check2.setTranslateY(bestHeight*0.47); check3.setTranslateX(bestWidth*0.7); check3.setTranslateY(bestHeight*0.47); buttonOK.setTranslateX(bestWidth*0.46); buttonOK.setTranslateY(bestHeight*0.8); // linked with root check0.setSelected(true); if(!buttonCheck.getChildren().contains(check0)) { buttonCheck.getChildren().addAll(check0, check1, check2, check3); } root.getChildren().addAll(buttonCheck); root.getChildren().addAll(TextField, buttonOK); root.getChildren().addAll(TextField2); root.getChildren().addAll(TextField3); root.getChildren().addAll(TextField4); root.getChildren().addAll(TextField5); root.getChildren().addAll(TextField6); wasInSchedule = 1; // used for previous } if(check0.isArmed() || check1.isArmed() || check2.isArmed() || check3.isArmed()) { check0.setSelected(false); check1.setSelected(false); check2.setSelected(false); check3.setSelected(false); } countButtonOk++; // added ont time to the root } } else if (action == "detailSchedule" || action == "load" || action == "save") { wasInSchedule = 0; root.getChildren().clear(); root.getChildren().add(canvas); int size = listStations.size(); double pos = 0.9*bestHeight/size; gc.strokeLine(0.5*bW2, 0.5*pos, 0.5*bW2, 0.5*pos + pos*(size-1)); // draw a line for(int i = 0; i<size-1; i++) { // to get the name of stations int transport = listStations.get(i).getTransport(); String source = listNameStations.get(i); String weight = listHoraire.get(i); gc.drawImage(imgListTransport.get(transport), 0.5*bW2 - imgListTransport.get(transport).getHeight()/2, 0.5*pos + pos*i); gc.fillText(source, 0.7*bW2, 0.3*pos + pos*i, bestWidth*0.2); gc.fillText(weight, 1.5*bW2, 0.5*pos + pos*i, bestWidth*0.1); } int transport = listStations.get(size-1).getTransport(); gc.drawImage(imgListTransport.get(transport), 0.5*bW2 - imgListTransport.get(transport).getHeight()/2, 0.5*pos + pos*(size-1)); gc.fillText(listNameStations.get(size-1), 0.7*bW2, 0.3*pos + pos*(size-1), bestWidth*0.2); gc.fillText(end, 0.7*bW2, 0.4*pos + pos*(size-1) + 1.5*imgListTransport.get(transport).getHeight(), bestWidth*0.2); gc.fillText(listHoraire.get(size-1), 1.5*bW2, 0.5*pos + pos*(size-1), bestWidth*0.1); gc.drawImage(imgSave, bestWidth - 3*bestWidth/15 - bestWidth/30, bestHeight); gc.drawImage(imgDetail, bestWidth - 2*bestWidth/15 - bestWidth/30, bestHeight); if (action == "load") { gc.fillText("LOADED", WIDTH/40, HEIGHT -10); } if(action == "save") { gc.fillText("SAVED", WIDTH/40, HEIGHT -10); } } else if(action == "aboutUs") { gc.fillText("En cours de construction", 0.7*bW2, 100); } else if(action == "horaries") { root.getChildren().clear(); root.getChildren().add(canvas); if(countButtonOk == 1) { countButtonOk = 0; action = "route"; } else { try { gc.drawImage(new Image(getHorariesPathByName(line + ".jpg"), WIDTH, HEIGHT, false, false), 0, 0); } catch(Exception ex) { action = previous(); countButtonOk = 0; } } } else { // menu if(wasInSchedule == 1) { wasInSchedule = 0; root.getChildren().clear(); root.getChildren().add(canvas); } countButtonOk = 0; gc.drawImage(imgSchedule, 0,0); gc.drawImage(imgRoute, bW2, 0); gc.drawImage(imgPerturbation, 0, bH2); gc.drawImage(imgAboutUs, bW2 , bH2); } if(action != "first") { gc.drawImage(imgPrevious, bestWidth*0.9, bestHeight); } gc.drawImage(imgLeave, bestWidth , bestHeight); if(action == "leave") { stage.close(); } // to draw circles /*for(int i = 0; i < nbrCercle; i++) { // put a circle at his position gc.strokeOval(circles.get(i).getCenterX()-circles.get(i).getRadius(), circles.get(i).getCenterY()-circles.get(i).getRadius(), circles.get(i).getRadius()*2, circles.get(i).getRadius()*2); }*/ } }; animation.start(); } }
[ "noreply@github.com" ]
noreply@github.com
d92204a63c869bf912786c2327bd788ba62ff682
5f604f6f69dfec269ad2e5782542f0c58a231e0b
/coding_interviews/src/linkedList/RemoveDuplicateUsingSet.java
d938443e3663d49b528251368c7f814de6fc5e17
[]
no_license
Ferdis17/BE_READY_2020
60649e955ef9654ff028f006d4fa747074fa88d2
d3d47ffb6566789877f66ed408462750b052c5b2
refs/heads/master
2023-09-01T10:41:45.919978
2021-11-03T22:20:53
2021-11-03T22:20:53
282,343,484
0
0
null
null
null
null
UTF-8
Java
false
false
1,708
java
package linkedList; import sep_2020.dataStructure.LRUWithLinkedListAndHashMap; import java.util.*; /** * this is will have O(n) running time */ public class RemoveDuplicateUsingSet { // using extra data structure public static void deleteDuplicates (Node head) { Set<Integer> set = new HashSet<>(); Node current = head; Node prev = null; while (current != null){ int currentVal = current.value; // we can also check if se contains the value if (!set.add(currentVal)) { prev.next = current.next; } else { set.add(currentVal); prev = current; } current = current.next; } } public static void displayElements(Node head){ while ( head != null) { System.out.println(head.value + " "); head = head.next; } } public static void main(String[] args) { Node start = new Node(12); start.next = new Node(12); start.next.next = new Node(11); start.next.next.next = new Node(23); start.next.next.next.next = new Node(12); start.next.next.next.next.next = new Node(11); start.next.next.next.next.next.next = new Node(10); System.out.println("Linked list before removing duplicates : "); displayElements(start); deleteDuplicates(start); System.out.println("Linked list after removing duplicates : "); displayElements(start); } static class Node{ int value; Node next; public Node(int value){ this.value = value; } } }
[ "fmuriyesu@gmail.com" ]
fmuriyesu@gmail.com
05b6c5d05b31ed20823e8dce1c1b06f5aff1e449
51152e6bcfadfeae012381f9c72bcde5dd260bfb
/Practice3/intentapp/src/test/java/ru/mirea/medvedevvladislav/intentapp/ExampleUnitTest.java
1c24074858201f27a075279cfe448ee96b36d922
[]
no_license
vol-de-mar-git/Android
e9baec2e1cab1d3e3326f0504ad6f41863b1ce58
cf0f82ba80061ae07aa899743930335f1343e711
refs/heads/main
2023-05-12T13:04:30.294480
2021-06-06T21:07:45
2021-06-06T21:07:45
374,464,131
0
0
null
null
null
null
UTF-8
Java
false
false
397
java
package ru.mirea.medvedevvladislav.intentapp; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "vladucha01@gmail.com" ]
vladucha01@gmail.com
0930c505857b1ca7d295fbd7d05281423357da16
9601e68c47cf80c02c9de8cbbe2ca9f90c19493f
/src/main/java/hitucc/actors/messages/NoTreeWorkMessage.java
5bdc5dd776e22d130ec45fd957e85d2239677e29
[ "Apache-2.0" ]
permissive
b-feldmann/hitucc
730c97408deff806bb1d2ef3ad77fc2678303396
7f28a46abe2b4141c00f92aa02ab8ddf297c3d9e
refs/heads/master
2022-03-30T01:21:15.596619
2020-01-07T11:04:01
2020-01-07T11:04:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
270
java
package hitucc.actors.messages; import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; @Data @AllArgsConstructor public class NoTreeWorkMessage implements Serializable { private static final long serialVersionUID = 7333555555533492487L; }
[ "benjamin-feldmann@web.de" ]
benjamin-feldmann@web.de
95a44866c3a31ada2887e281949b019d58b45540
d32a3d8d44aa8eacb3c8b466b82c07d274fbeb9f
/Java/CTS_SFDC/workspace/World Cup Finals-Date/src/Main.java
0b54bf0d37b79bfa9f3548c861dc9d49523f80f4
[]
no_license
umng/Learn-to-Program
5c6071f3d166673dc90f0ec017ae63cded083b24
9891558dcc1bcecf6468b1668e9cab8bf2d707d0
refs/heads/master
2021-01-14T08:19:44.931913
2018-10-02T07:37:50
2018-10-02T07:37:50
82,043,623
0
1
null
null
null
null
UTF-8
Java
false
false
553
java
import java.text.SimpleDateFormat; import java.util.Date; import java.util.Scanner; public class Main { public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); Scanner sc = new Scanner(System.in); System.out.println("Enter the date:"); try { Date DOB = sdf.parse(sc.nextLine()); sc.close(); System.out.println("MS Dhoni brought World Cup glory back for India on " + String.valueOf(new SimpleDateFormat("MMMM dd,yyyy").format(DOB.getTime()))); } catch (Exception e) { } } }
[ "umang85patel@gmail.com" ]
umang85patel@gmail.com
6a4c7e62eb7dba0facda16a98b157c5d7b454756
8b899133e183cb22900ee1867a10f67c8ebffb8e
/src/main/java/com/example/gaming/Model/News.java
7b44e437a35c1d27a0ab2affda911348e7340a44
[]
no_license
Dewsara/AF-Final-Project
5b4ba29b99d1401c46769aefef80ae0af1c502e3
e88dfc437803a80f35732d45b441cf453a1cc18b
refs/heads/master
2022-11-06T16:13:39.689080
2020-06-13T23:28:10
2020-06-13T23:28:10
271,941,333
0
0
null
null
null
null
UTF-8
Java
false
false
1,109
java
package com.example.gaming.Model; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; @Document(collection = "News") public class News { @Id private String id; private String newsTitle; private String newsDetails; private String newsLink; private String newsImg; public String getNewsImg() { return newsImg; } public void setNewsImg(String newsImg) { this.newsImg = newsImg; } public String getNewsLink() { return newsLink; } public void setNewsLink(String newsLink) { this.newsLink = newsLink; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getNewsTitle() { return newsTitle; } public void setNewsTitle(String newsTitle) { this.newsTitle = newsTitle; } public String getNewsDetails() { return newsDetails; } public void setNewsDetails(String newsDetails) { this.newsDetails = newsDetails; } }
[ "dewsara6@gmail.com" ]
dewsara6@gmail.com
8af29deba21c7246104022c9d21fdb9bdebb1cc2
bf8bfd47d217284f93b41af0ca420b46ff49eb16
/praticando.java
1e808462c237122b167fe97fc2beb378aa48a684
[]
no_license
tcisio10/Tarcisio
cd28638ff6109918e8b31a1d535175192d98b0ee
46ffa96f5357979cedd219c9d5119089ef797168
refs/heads/master
2021-05-21T05:13:33.605400
2020-05-04T22:34:15
2020-05-04T22:34:15
252,558,424
0
0
null
null
null
null
UTF-8
Java
false
false
435
java
import java.util.Scanner; public class MyClass { public static void main(String args[]) { double A, P; double IMC; Scanner sc = new Scanner(System.in); System.out.println("Digite sua Altura: "); A = sc.nextDouble(); System.out.println("Digite seu Peso: "); P = sc.nextDouble(); IMC = (P)/(A*A); System.out.println("Seu IMC é: " + IMC);
[ "noreply@github.com" ]
noreply@github.com
a819c8d8ef373742869109d06faf44f15ba9aad1
69c6501b8559ab0b2b29535f97f787c1740dc4b3
/app/src/androidTest/java/com/greyfieldstudios/budger/ApplicationTest.java
289325362d6a3cd4fc0e399980a6dd4ce3d74ba4
[]
no_license
inphomercial/Budger
ff0a7d0ce704520b151a53fd3de58a76c947b84e
833d6432abcdb0cd1484310b98f1a6032a48eb7b
refs/heads/master
2020-06-04T14:59:42.996979
2015-02-04T18:11:14
2015-02-04T18:11:14
29,749,897
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package com.greyfieldstudios.budger; 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); } }
[ "inphomercial@gmail.com" ]
inphomercial@gmail.com
c2e0e235eb3f2cfb16fab108624c26ad07d23cfc
822bd556c80b8076dc3caa0f8fb1621480547b1b
/Hubblog/src/com/donskifarrell/Hubblog/Activities/Dialogs/LightAlertDialog.java
6af84262a3266ae223f0cb8099743e47c6402c83
[ "MIT" ]
permissive
donskifarrell/hubblog
504056259ca59e2aeea487b27f46ae15917d98c6
b85c52e113ee45a22b597deeec3460a3eefd7779
refs/heads/master
2021-01-16T18:18:23.311714
2014-02-20T14:36:42
2014-02-20T14:36:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,327
java
package com.donskifarrell.Hubblog.Activities.Dialogs; /* * Copyright 2012 GitHub Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import static android.os.Build.VERSION.SDK_INT; import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH; import android.annotation.TargetApi; import android.app.AlertDialog; import android.content.Context; import android.os.Build; /** * Alert dialog using the Holo Light theme */ public class LightAlertDialog extends AlertDialog { /** * Create alert dialog * * @param context * @return dialog */ public static AlertDialog create(final Context context) { if (SDK_INT >= ICE_CREAM_SANDWICH) return new LightAlertDialog(context, THEME_HOLO_LIGHT); else return new LightAlertDialog(context); } private LightAlertDialog(final Context context, final int theme) { super(context, theme); } private LightAlertDialog(final Context context) { super(context); } /** * Alert dialog builder using the Holo Light theme */ public static class Builder extends AlertDialog.Builder { /** * Create alert dialog builder * * @param context * @return dialog builder */ public static LightAlertDialog.Builder create(final Context context) { if (SDK_INT >= ICE_CREAM_SANDWICH) return new LightAlertDialog.Builder(context, THEME_HOLO_LIGHT); else return new LightAlertDialog.Builder(context); } private Builder(Context context) { super(context); } @TargetApi(Build.VERSION_CODES.HONEYCOMB) private Builder(Context context, int theme) { super(context, theme); } } }
[ "donskifarrell+git@googlemail.com" ]
donskifarrell+git@googlemail.com
ecc1431ef24cdcdee1a981d0e12c37a016d08eea
f7415433e6794fe6a2882e6080ef0b806dc87175
/ADS-2 Assignments/Module 12/ADS-2_Exam-2/EdgeWeightedGraph.java
4a895467764c8db541fe71e1e6fef9902318db8b
[]
no_license
ChaitanyaPuritipati/ADS-2
9b80af64d957af02ff79a3ef841ba6fd2bb23be9
efaab09c9f5418e436168914b74468991943437a
refs/heads/master
2020-04-03T10:49:14.416130
2018-11-25T18:43:28
2018-11-25T18:43:28
155,203,581
0
0
null
null
null
null
UTF-8
Java
false
false
8,145
java
/****************************************************************************** * Compilation: javac EdgeWeightedGraph.java * Execution: java EdgeWeightedGraph filename.txt * Dependencies: Bag.java Edge.java In.java StdOut.java * Data files: https://algs4.cs.princeton.edu/43mst/tinyEWG.txt * https://algs4.cs.princeton.edu/43mst/mediumEWG.txt * https://algs4.cs.princeton.edu/43mst/largeEWG.txt * * An edge-weighted undirected graph, implemented using adjacency lists. * Parallel edges and self-loops are permitted. * * % java EdgeWeightedGraph tinyEWG.txt * 8 16 * 0: 6-0 0.58000 0-2 0.26000 0-4 0.38000 0-7 0.16000 * 1: 1-3 0.29000 1-2 0.36000 1-7 0.19000 1-5 0.32000 * 2: 6-2 0.40000 2-7 0.34000 1-2 0.36000 0-2 0.26000 2-3 0.17000 * 3: 3-6 0.52000 1-3 0.29000 2-3 0.17000 * 4: 6-4 0.93000 0-4 0.38000 4-7 0.37000 4-5 0.35000 * 5: 1-5 0.32000 5-7 0.28000 4-5 0.35000 * 6: 6-4 0.93000 6-0 0.58000 3-6 0.52000 6-2 0.40000 * 7: 2-7 0.34000 1-7 0.19000 0-7 0.16000 5-7 0.28000 4-7 0.37000 * ******************************************************************************/ /** * The {@code EdgeWeightedGraph} class represents an edge-weighted * graph of vertices named 0 through <em>V</em> – 1, where each * undirected edge is of type {@link Edge} and has a real-valued weight. * It supports the following two primary operations: add an edge to the graph, * iterate over all of the edges incident to a vertex. It also provides * methods for returning the number of vertices <em>V</em> and the number * of edges <em>E</em>. Parallel edges and self-loops are permitted. * By convention, a self-loop <em>v</em>-<em>v</em> appears in the * adjacency list of <em>v</em> twice and contributes two to the degree * of <em>v</em>. * <p> * This implementation uses an adjacency-lists representation, which * is a vertex-indexed array of {@link Bag} objects. * All operations take constant time (in the worst case) except * iterating over the edges incident to a given vertex, which takes * time proportional to the number of such edges. * <p> * For additional documentation, * see <a href="https://algs4.cs.princeton.edu/43mst">Section 4.3</a> of * <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne. * * @author Robert Sedgewick * @author Kevin Wayne */ public class EdgeWeightedGraph { /** * Value. */ private static final String NEWLINE = System.getProperty("line.separator"); /** * Value. */ private final int vertex; /** * Value. */ private int edge; /** * Value. */ private Bag<Edge>[] adj; /** * Initializes an empty edge-weighted graph with {@code V} * vertices and 0 edges. * * @param v1 the number of vertices * @throws IllegalArgumentException if {@code V < 0} * * Time Complexity : O(V) */ public EdgeWeightedGraph(final int v1) { if (v1 < 0) { throw new IllegalArgumentException( "Number of vertices must be nonnegative"); } this.vertex = v1; this.edge = 0; adj = (Bag<Edge>[]) new Bag[vertex]; for (int v = 0; v < vertex; v++) { adj[v] = new Bag<Edge>(); } } /** * Returns the number of vertices in this edge-weighted graph. * * @return the number of vertices in this edge-weighted graph * Time Complexity : O(1) */ public int vertexcount() { return vertex; } /** * Returns the number of edges in this edge-weighted graph. * * @return the number of edges in this edge-weighted graph * Time Complexity : O(1) */ public int edgecount() { return edge; } // throw an IllegalArgumentException unless {@code 0 <= v < V} /** * { function_description }. * * @param v { parameter_description } *Time Complexity : O(1) */ private void validateVertex(final int v) { if (v < 0 || v >= vertex) { throw new IllegalArgumentException( "vertex " + v + " is not between 0 and " + (vertex - 1)); } } /** * Adds the undirected edge {@code e} to this edge-weighted graph. * * @param e the edge * @throws IllegalArgumentException unless both endpoints are * between {@code 0} and {@code V-1} * Time Complexity : O(1) */ public void addEdge(final Edge e) { int v = e.either(); int w = e.other(v); validateVertex(v); validateVertex(w); adj[v].add(e); adj[w].add(e); edge++; } /** * Returns the edges incident on vertex {@code v}. * * @param v the vertex * @return the edges incident on vertex {@code v} as an Iterable * @throws IllegalArgumentException unless {@code 0 <= v < V} * Time Complexity : O(1) */ public Iterable<Edge> adj(final int v) { validateVertex(v); return adj[v]; } /** * Returns the degree of vertex {@code v}. * * @param v the vertex * @return the degree of vertex {@code v} * @throws IllegalArgumentException unless {@code 0 <= v < V} * Time Complexity : O(1) */ public int degree(final int v) { validateVertex(v); return adj[v].size(); } /** * Returns all edges in this edge-weighted graph. * To iterate over the edges in this edge-weighted * graph, use foreach notation: * {@code for (Edge e : G.edges())}. * * @return all edges in this edge-weighted graph, as an iterable * Time Complexity : O(degree(V)) */ public Iterable<Edge> edges() { Bag<Edge> list = new Bag<Edge>(); for (int v = 0; v < vertex; v++) { int selfLoops = 0; for (Edge e : adj(v)) { if (e.other(v) > v) { list.add(e); } else if (e.other(v) == v) { if (selfLoops % 2 == 0) { list.add(e); } selfLoops++; } } } return list; } /** * Returns a string representation of the edge-weighted graph. * This method takes time proportional to <em>E</em> + <em>V</em>. * * @return the number of vertices <em>V</em>, followed by the number * of edges <em>E</em>, * followed by the <em>V</em> adjacency lists of edges * Time Complexity : O(V * degree(V)) */ public String toString() { StringBuilder s = new StringBuilder(); s.append(vertex + " vertices " + edge + " edges" + NEWLINE); for (int v = 0; v < vertex; v++) { s.append(v + ": "); for (Edge e : adj[v]) { s.append(e + " "); } s.append(NEWLINE); } return s.toString(); } } /****************************************************************************** * Copyright 2002-2018, Robert Sedgewick and Kevin Wayne. * * This file is part of algs4.jar, which accompanies the textbook * * Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, * Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. * http://algs4.cs.princeton.edu * * * algs4.jar 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. * * algs4.jar 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 algs4.jar. If not, see http://www.gnu.org/licenses. ******************************************************************************/
[ "chaitanya.manipal@msitprogram.net" ]
chaitanya.manipal@msitprogram.net
a73599d802dd7e761481194916d97a3c98af7154
209e908242c201544e62990243decc08e8e7e415
/jmetal-core/src/test/java/org/uma/jmetal/operator/impl/selection/NaryTournamentSelectionTest.java
cd8cf8914af4d23959ad5d5580552924bf132264
[]
no_license
weaponhe/CMOEACD
7d3a9f7b6a908339f11adc5f20648d4920d854b9
6be561ed689f1eb17a28856079ddffe79ddbe9f4
refs/heads/master
2021-09-10T23:16:02.460594
2018-04-04T04:48:22
2018-04-04T04:48:22
110,501,459
1
2
null
null
null
null
UTF-8
Java
false
false
4,804
java
// This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package org.uma.jmetal.operator.impl.selection; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.Mockito; import org.springframework.test.util.ReflectionTestUtils; import org.uma.jmetal.problem.Problem; import org.uma.jmetal.solution.BinarySolution; import org.uma.jmetal.solution.DoubleSolution; import org.uma.jmetal.solution.IntegerSolution; import org.uma.jmetal.util.JMetalException; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; import static org.hamcrest.CoreMatchers.containsString; import static org.junit.Assert.*; import static org.mockito.Mockito.*; /** * @author Antonio J. Nebro * @version 1.0 */ public class NaryTournamentSelectionTest { private static final int POPULATION_SIZE = 20 ; @Rule public ExpectedException exception = ExpectedException.none(); @Test public void shouldDefaultConstructorSetTheNumberOfSolutionsToBeReturnedEqualsToTwo() { NaryTournamentSelection<IntegerSolution> selection = new NaryTournamentSelection<>() ; assertEquals(2, ReflectionTestUtils.getField(selection, "numberOfSolutionsToBeReturned")); } @Test public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsNull() { exception.expect(JMetalException.class); exception.expectMessage(containsString("The solution list is null")); NaryTournamentSelection<IntegerSolution> selection = new NaryTournamentSelection<>() ; List<IntegerSolution> population ; population = null ; selection.execute(population) ; } @Test (expected = JMetalException.class) public void shouldExecuteRaiseAnExceptionIfTheListOfSolutionsIsEmpty() { NaryTournamentSelection<IntegerSolution> selection = new NaryTournamentSelection<>() ; List<IntegerSolution> population = new ArrayList<>(0) ; selection.execute(population) ; } @Test public void shouldExecuteReturnAValidSolutionIsWithCorrectParameters() { NaryTournamentSelection<BinarySolution> selection = new NaryTournamentSelection<>() ; BinarySolution solution = mock(BinarySolution.class) ; Problem<BinarySolution> problem = mock(Problem.class) ; Mockito.when(problem.createSolution()).thenReturn(solution) ; List<BinarySolution> population = new ArrayList<>(POPULATION_SIZE) ; for (int i = 0 ; i < POPULATION_SIZE; i++) { population.add(problem.createSolution()); } assertNotNull(selection.execute(population)); verify(problem, times(POPULATION_SIZE)).createSolution(); } @Test public void shouldExecuteReturnTheSameSolutionIfTheListContainsOneSolution() { NaryTournamentSelection<DoubleSolution>selection = new NaryTournamentSelection<DoubleSolution>(1, mock(Comparator.class)) ; DoubleSolution solution = mock(DoubleSolution.class) ; List<DoubleSolution> population = new ArrayList<>(1) ; population.add(solution) ; assertSame(solution, selection.execute(population)); } @Test public void shouldExecuteReturnTwoSolutionsIfTheListContainsTwoSolutions() { NaryTournamentSelection<IntegerSolution> selection = new NaryTournamentSelection<>(2, mock(Comparator.class)) ; IntegerSolution solution1 = mock(IntegerSolution.class) ; IntegerSolution solution2 = mock(IntegerSolution.class) ; List<IntegerSolution> population = Arrays.asList(solution1, solution2) ; assertEquals(2, population.size()); } @Test public void shouldExecuteRaiseAnExceptionIfTheListSizeIsOneAndTwoSolutionsAreRequested() { exception.expect(JMetalException.class); exception.expectMessage(containsString("The solution list size (1) is less than " + "the number of requested solutions (4)")); NaryTournamentSelection<IntegerSolution> selection = new NaryTournamentSelection<>(4, mock(Comparator.class)) ; List<IntegerSolution> list = new ArrayList<>(1) ; list.add(mock(IntegerSolution.class)) ; selection.execute(list) ; } }
[ "weaponhe@126.com" ]
weaponhe@126.com
2087ad330fcb0102e3fcc85de6a0f785d10b9dae
1586ec8f439a4ac755faf88d15c23044670adc38
/01 - First Steps/FloatAndDouble/src/com/company/Main.java
77c320e6e9dd69b7d7584ec3025c22582d99f042
[]
no_license
russellkoons/java
fe4db8c3c314b9e87a808419948f8a038c619f75
8bdaeefac78eec768d35145903422693ba0f5957
refs/heads/main
2023-04-14T11:21:22.942748
2021-04-28T10:12:43
2021-04-28T10:12:43
318,757,264
0
0
null
null
null
null
UTF-8
Java
false
false
1,438
java
package com.company; public class Main { public static void main(String[] args) { float myMinFloatValue = Float.MIN_VALUE; float myMaxFloatValue = Float.MAX_VALUE; System.out.println("Float minimum value = " + myMinFloatValue); System.out.println("Float maximum value = " + myMaxFloatValue); double myMinDoubleValue = Double.MIN_VALUE; double myMaxDoubleValue = Double.MAX_VALUE; System.out.println("Double minimum value = " + myMinDoubleValue); System.out.println("Double maximum value = " + myMaxDoubleValue); int myIntValue = 5 / 3; // If you don't include an f or (float) here you get an error float myFloatValue = 5f / 3f; // double is the standard floating point type double myDoubleValue = 5.00 / 3.00; // Can also add d instead of .00 System.out.println("myIntValue = " + myIntValue); // returns 1 System.out.println("myFloatValue = " + myFloatValue); // returns 1.6666666 System.out.println("myDoubleValue = " + myDoubleValue); // returns 1.6666666666666667 // float and double challenge double pounds = 200d; double kilos = pounds * 0.45359237d; System.out.println(kilos); double pi = 3.1415927d; double anotherNumber = 3_000_000.4_567_890d; System.out.println(pi); System.out.println(anotherNumber); } }
[ "rkoons@gmail.com" ]
rkoons@gmail.com
cb0840bc4e39b2fac4a1ed6828dc793855181d1f
4bdf891808b9d61b8d657643769a25db817bda43
/src/main/java/com/lahad/beans/MboroForEnglish.java
671ae27024d0c9d0cdbb5025b1be8c2d9484b444
[]
no_license
lahad80/mboroProject
09fc8c3e0e5f435b07b54bbe502f02da5a5fcd63
c879cfcd29e4acc2f732acbdc4ba203dbe597dc7
refs/heads/master
2020-03-19T09:13:03.982510
2018-06-06T04:57:54
2018-06-06T04:57:54
132,663,593
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
package com.lahad.beans; public class MboroForEnglish { private int id; private int likesCount; public MboroForEnglish(){ } public MboroForEnglish(int liskesCount){ this.likesCount = liskesCount; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getLikesCount() { return this.likesCount; } public void setLikesCount(int likesCount) { this.likesCount = likesCount; } }
[ "diawcastel@gmail.com" ]
diawcastel@gmail.com
a0e52f06ce69f86491206de05c6fd4363ce9402e
e1e03077fb80cb3a1dbfdb1ce55146d5dda717b1
/src/travelSalesman/SimulatedAnnealing.java
5b6350d85bb964bea68be80e79a01fa2b9b598e0
[]
no_license
matios13/travelSalesmanProblem
6cbc9de858c1430afa1ca0197d3b3a67eb8161a1
0be250e69e92421d7975634332656ac03c427baa
refs/heads/master
2021-01-10T07:20:40.941906
2015-11-14T17:41:17
2015-11-14T17:41:17
46,183,509
0
0
null
null
null
null
UTF-8
Java
false
false
2,454
java
package travelSalesman; import static java.lang.Math.E; import static java.lang.Math.pow; import static java.lang.Math.random; import java.util.ArrayList; import java.util.Random; public class SimulatedAnnealing { private ArrayList<City> bestSolution; private ArrayList<City> analizedSolution; private double actualTemperature = 100000.0; private double coolingTempo = 0.9999; private double minimalTemperature = 0.0001; Random generator = new Random(); public SimulatedAnnealing(ArrayList<City> initialSolution) { this.analizedSolution = initialSolution; this.bestSolution = new ArrayList<City>(analizedSolution); } private double routeLength(ArrayList<City> route) { double length = 0; int size = route.size(); for (int i = 0; i < size - 1; i++) { length += route.get(i).distances.get(route.get(i + 1).cityNumber); } length += route.get(size - 1).distances.get(route.get(0).cityNumber); return length; } private double probability() { double result = pow( E, -((routeLength(analizedSolution) - routeLength(bestSolution)) / actualTemperature)); return result; } public void runSimulatedAnnealing() { while (actualTemperature > minimalTemperature) { swapTwoRandomly(); if (routeLength(analizedSolution) < routeLength(bestSolution)) { bestSolution = new ArrayList<City>(analizedSolution); } else if (random() < probability()) { bestSolution = new ArrayList<City>(analizedSolution); } actualTemperature *= coolingTempo; } } private void swapTwoRandomly() { int size = bestSolution.size(); int x = generator.nextInt(size); int y; do { y = generator.nextInt(size); } while (x == y); City tmp = analizedSolution.get(x); analizedSolution.set(x, analizedSolution.get(y)); analizedSolution.set(y, tmp); } public ArrayList<City> getBestSolution() { for (int j = 0; j < bestSolution.size() - 1; j++) { System.out.print(bestSolution.get(j).cityNumber + "-(" + bestSolution.get(j).distances.get(bestSolution.get( j + 1).cityNumber) + ")->"); } System.out.println(bestSolution.get(bestSolution.size() - 1).distances.get(bestSolution.get(0).cityNumber)); return bestSolution; } public double getBestSolutionLength() { return routeLength(bestSolution); } public String bestRoadToString(){ String out=""; for(City c : bestSolution){ out+=c.cityNumber+"->"; } out+=bestSolution.get(0).cityNumber; return out; } }
[ "matios13@gmail.com" ]
matios13@gmail.com
95a12a16d14e811c541ee7ec2a6228c07cb8759c
148c5186286a8f11e561b3935828bd186e5bdd22
/src/main/java/ua/org/gostroy/model/Visitor.java
36c769ff90afde48b73ae581bc0bb0bd009a79f0
[]
no_license
panser/JavaSite
4270e7a459027bd12768e6853e3ed06a6ac728dd
6702d62dfe57d28e644586c51ce8c1fccd1095ee
refs/heads/master
2021-01-18T14:36:33.483174
2014-12-24T07:58:39
2014-12-24T07:58:39
20,036,559
1
0
null
null
null
null
UTF-8
Java
false
false
1,246
java
package ua.org.gostroy.model; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.*; import javax.xml.bind.annotation.XmlTransient; import java.io.Serializable; import java.util.Date; /** * Created by panser on 5/27/2014. */ @Entity @Table(name = "visitors") public class Visitor extends BaseEntity{ private String ip; private String userAgent; @ManyToOne(optional = true, fetch = FetchType.LAZY) @JoinColumn(name = "article_id", referencedColumnName = "id") Article article; @DateTimeFormat private Date createDate; public Visitor() { this.createDate = new Date(); } public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } public String getUserAgent() { return userAgent; } public void setUserAgent(String userAgent) { this.userAgent = userAgent; } public Article getArticle() { return article; } public void setArticle(Article article) { this.article = article; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } }
[ "zzzibiaz" ]
zzzibiaz