blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53904f1dd49c38cb3a05459e62c041373a65b03a | dbc7f4f5dc94006fd3309b40dd537c05dc3c24a2 | /libs/src/main/java/com/juphoon/cmcc/app/lemon/MtcUtil.java | ba6b0cc2b5cfb5c75ff5a7917073614213b98db7 | [] | no_license | sherry5707/CallDemo | 584d3a1c8dec235f10bd7fa266d18e80c09ac872 | 626599ebda89c4d2828466c3d50cc842ee6258e8 | refs/heads/master | 2020-04-09T07:02:12.249448 | 2018-12-03T05:43:09 | 2018-12-03T05:43:09 | 160,137,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,784 | java | /**
* @file MtcUtil.java
* @brief MtcUtil interface
*/
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.2
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.juphoon.cmcc.app.lemon;
/**
* @brief MtcUtil interface
*/
public class MtcUtil implements MtcUtilConstants {
/**
* @brief Print ERROR log with format string information.
* User can specific log name as the log module prefix
* Log print level can be set by Mtc_CliDbSetLogLevel.
*
* @param [in] pcLogName The log name. Default name is "ZOS" if no log name.
* @param [in] pcFormat String format.
* @param [in] ... String vars.
*
* @see @ref MtcUtil::Mtc_AnyLogInfoStr
*/
public static void Mtc_AnyLogErrStr(String pcLogName, String pcFormat) {
MtcUtilJNI.Mtc_AnyLogErrStr(pcLogName, pcFormat);
}
/**
* @brief Print INFO log with format string information.
* User can specific log name as the log module prefix
* Log print level can be set by Mtc_CliDbSetLogLevel.
*
* @param [in] pcLogName The log name. Default name is "ZOS" if no log name.
* @param [in] pcFormat String format.
* @param [in] ... String vars.
*
* @see @ref MtcUtil::Mtc_AnyLogErrStr
*/
public static void Mtc_AnyLogInfoStr(String pcLogName, String pcFormat) {
MtcUtilJNI.Mtc_AnyLogInfoStr(pcLogName, pcFormat);
}
/**
* @brief Print DEBUG log with format string information.
* User can specific log name as the log module prefix
* Log print level can be set by Mtc_DbSetLogLevel.
*
* @param [in] pcLogName The log name. Default name is "ZOS" if no log name.
* @param [in] pcFormat String format.
* @param [in] ... String vars.
*
* @see @ref MtcUtil::Mtc_AnyLogInfoStr
*/
public static void Mtc_AnyLogDbgStr(String pcLogName, String pcFormat) {
MtcUtilJNI.Mtc_AnyLogDbgStr(pcLogName, pcFormat);
}
/**
* @brief This function flushs buffer into log file.
*
* @param [in] zLogId The log ID.
*
* @retval MtcCommonConstants::ZOK Flush operation successfully.
* @retval MtcCommonConstants::ZFAILED Flush operation failed.
*
* @see
*/
public static int Mtc_AnyLogFlush() {
return MtcUtilJNI.Mtc_AnyLogFlush();
}
/**
* @brief Print login ERROR log with format string information.
* User can specific log name as the log module prefix
* Log print level can be set by Mtc_CliDbSetLogLevel.
*
* @param [in] pcLogName The login log name. Default name is "ZOS" if no log name.
* @param [in] pcFormat String format.
* @param [in] ... String vars.
*
* @see @ref MtcUtil::Mtc_AnyLogLoginInfoStr
*/
public static void Mtc_AnyLogLoginErrStr(String pcLogName, String pcFormat) {
MtcUtilJNI.Mtc_AnyLogLoginErrStr(pcLogName, pcFormat);
}
/**
* @brief Print login INFO log with format string information.
* User can specific log name as the log module prefix
* Log print level can be set by Mtc_CliDbSetLogLevel.
*
* @param [in] pcLogName The login log name. Default name is "ZOS" if no log name.
* @param [in] pcFormat String format.
* @param [in] ... String vars.
*
* @see @ref MtcUtil::Mtc_AnyLogLoginErrStr
*/
public static void Mtc_AnyLogLoginInfoStr(String pcLogName, String pcFormat) {
MtcUtilJNI.Mtc_AnyLogLoginInfoStr(pcLogName, pcFormat);
}
/**
* @brief Print login DEBUG log with format string information.
* User can specific log name as the log module prefix
* Log print level can be set by Mtc_DbSetLogLevel.
*
* @param [in] pcLogName The login log name. Default name is "ZOS" if no log name.
* @param [in] pcFormat String format.
* @param [in] ... String vars.
*
* @see @ref MtcUtil::Mtc_AnyLogLoginInfoStr
*/
public static void Mtc_AnyLogLoginDbgStr(String pcLogName, String pcFormat) {
MtcUtilJNI.Mtc_AnyLogLoginDbgStr(pcLogName, pcFormat);
}
/**
* @brief This function flushs buffer into login log file.
*
* @param [in] zLogId The login log ID.
*
* @retval MtcCommonConstants::ZOK Flush operation successfully.
* @retval MtcCommonConstants::ZFAILED Flush operation failed.
*
* @see
*/
public static int Mtc_AnyLogLoginFlush() {
return MtcUtilJNI.Mtc_AnyLogLoginFlush();
}
/**
* @brief Get local ip count.
*
* @return Local ip count successfully, otherwise retrun 0.
*
* @see @ref MtcUtil::Mtc_GetLclIp
*/
public static int Mtc_GetLclIpCnt() {
return MtcUtilJNI.Mtc_GetLclIpCnt();
}
/**
* @brief Get local ip.
*
* @param [in] iIndex Local ip index.
*
* @return Local ip successfully, otherwise return loopback address.
* the caller must copy it, then use.
*
* @see @ref MtcUtil::Mtc_GetLclIpCnt
*/
public static String Mtc_GetLclIp(int iIndex) {
return MtcUtilJNI.Mtc_GetLclIp(iIndex);
}
/**
* @brief Get access network type.
*
* @return Access network type successfully,
* otherwise return MTC_ANET_UNKNOWN.
*/
public static int Mtc_GetAccessNetType() {
return MtcUtilJNI.Mtc_GetAccessNetType();
}
/**
* @brief Create a new timer.
*
* @param [in] iTimerType User defined timer type.
* @param [in] bCycle Timer mode, cycle or once a time.
* @param [in] pfnActive Timer active callback.
* @param [out] pzTimerId Timer ID.
*
* @retval MtcCommonConstants::ZOK Timer create successfully.
* @retval MtcCommonConstants::ZFAILED Timer create failed.
*
* @see @ref MtcUtil::Mtc_TimerDelete
*/
public static int Mtc_TimerCreate(int iTimerType, boolean bCycle, SWIGTYPE_p_f_unsigned_int_size_t__void pfnActive, MtcNumber pzTimerId) {
return MtcUtilJNI.Mtc_TimerCreate(iTimerType, bCycle, SWIGTYPE_p_f_unsigned_int_size_t__void.getCPtr(pfnActive), pzTimerId);
}
/**
* @brief Delete a timer.
*
* @param [in] zTimerId Timer ID.
*
* @retval MtcCommonConstants::ZOK Timer delete successfully.
* @retval MtcCommonConstants::ZFAILED Timer delete failed.
*
* @see @ref MtcUtil::Mtc_TimerCreate
*/
public static int Mtc_TimerDelete(int zTimerId) {
return MtcUtilJNI.Mtc_TimerDelete(zTimerId);
}
/**
* @brief Start a timer.
*
* @param [in] zTimerId Timer ID.
* @param [in] iTimeLen Time interval in milliseconds.
*
* @retval MtcCommonConstants::ZOK Timer start successfully.
* @retval MtcCommonConstants::ZFAILED Timer start failed.
*
* @note Timer must not in running state.
*
* @see @ref MtcUtil::Mtc_TimerStop
*/
public static int Mtc_TimerStart(int zTimerId, int iTimeLen) {
return MtcUtilJNI.Mtc_TimerStart(zTimerId, iTimeLen);
}
/**
* @brief Stop a timer.
*
* @param [in] zTimerId Timer ID.
*
* @retval MtcCommonConstants::ZOK Timer stop successfully.
* @retval MtcCommonConstants::ZFAILED Timer stop failed.
*
* @see @ref MtcUtil::Mtc_TimerStart
*/
public static int Mtc_TimerStop(int zTimerId) {
return MtcUtilJNI.Mtc_TimerStop(zTimerId);
}
/**
* @brief Check if a timer is running.
*
* @param [in] zTimerId Timer ID.
*
* @retval true Timer has been started and still in counting.
* @retval false Otherwise.
*
* @see @ref MtcUtil::Mtc_TimerStart
*/
public static boolean Mtc_TimerIsRun(int zTimerId) {
return MtcUtilJNI.Mtc_TimerIsRun(zTimerId);
}
/**
* @brief Schedule a new timer after some seconds.
*
* @param [in] iTimerType User defined timer type.
* @param [in] pfnSchedule User defined schedule callback.
* @param [in] iTimeLen Time interval in milliseconds.
*
* @retval MtcCommonConstants::ZOK Timer start successfully.
* @retval MtcCommonConstants::ZFAILED Timer start failed.
*
* @note Timer must not in running state.
*
* @see @ref MtcUtil::Mtc_TimerCreate
*/
public static int Mtc_TimerSchedule(int iTimerType, SWIGTYPE_p_f_size_t__void pfnSchedule, int iTimeLen) {
return MtcUtilJNI.Mtc_TimerSchedule(iTimerType, SWIGTYPE_p_f_size_t__void.getCPtr(pfnSchedule), iTimeLen);
}
/**
* @brief Convert time value from ZTIME_T to ST_MTC_SYS_TIME structure.
*
* @param [in] zTime Time value.
* @param [out] pstTime Time value in ST_MTC_SYS_TIME structure.
*
* @retval MtcCommonConstants::ZOK Convert successfully.
* @retval MtcCommonConstants::ZFAILED Convert failed.
*
* @see
*/
public static int Mtc_Time2SysTime(int zTime, ST_MTC_SYS_TIME pstTime) {
return MtcUtilJNI.Mtc_Time2SysTime(zTime, ST_MTC_SYS_TIME.getCPtr(pstTime), pstTime);
}
/**
* @brief Convert time value from ST_MTC_SYS_TIME structure to ZTIME_T.
*
* @param [in] pstTime Time value in ST_MTC_SYS_TIME structure.
* @param [out] pzTime Time value in ZTIME_T structure.
*
* @retval MtcCommonConstants::ZOK Convert successfully.
* @retval MtcCommonConstants::ZFAILED Convert failed.
*
* @see
*/
public static int Mtc_SysTime2Time(ST_MTC_SYS_TIME pstTime, MtcNumber pzTime) {
return MtcUtilJNI.Mtc_SysTime2Time(ST_MTC_SYS_TIME.getCPtr(pstTime), pstTime, pzTime);
}
/**
* @brief Run debug command.
*
* @param [in] pcCmd Command string.
*
* @retval MtcCommonConstants::ZOK Run command successfully.
* @retval MtcCommonConstants::ZFAILED Run command failed.
*
* @see
*/
public static int Mtc_CmdRun(String pcCmd) {
return MtcUtilJNI.Mtc_CmdRun(pcCmd);
}
/**
* @brief Test sip decode.
*
* @param [in] pcData SIP data string.
*
* @retval MtcCommonConstants::ZOK Test successfully.
* @retval MtcCommonConstants::ZFAILED Test failed.
*/
public static int Mtc_TestSipDecode(String pcData) {
return MtcUtilJNI.Mtc_TestSipDecode(pcData);
}
/**
* @brief Test http decode.
*
* @param [in] pcData HTTP data string.
*
* @retval MtcCommonConstants::ZOK Test successfully.
* @retval MtcCommonConstants::ZFAILED Test failed.
*/
public static int Mtc_TestHttpDecode(String pcData) {
return MtcUtilJNI.Mtc_TestHttpDecode(pcData);
}
}
| [
"[email protected]"
] | |
5d347daa667440fe4dade7b541bf7dbd068b18cb | c85b5e17379f6c7a8aa8eae0278d85833ed710da | /epoint-template-msg/src/main/java/com/epoint/tmsg/dto/StoreMsgTemplateDto.java | 5b117d8e43e7fab631723b59fd0c0a8615400a69 | [] | no_license | vigorous/epoint-modules | 9301477249e8711168f3144aff0f9dc0a6c84ac3 | 1c4d45af21228560d591477b8cf292c66f0b86f0 | refs/heads/master | 2021-01-01T18:19:58.171879 | 2017-07-25T13:20:54 | 2017-07-25T13:20:54 | 98,308,389 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,161 | java | package com.epoint.tmsg.dto;
import com.epoint.tmsg.enums.StoreMsgTemplateConstant;
/**
* Created by chiang on 2017/5/13.
*/
public class StoreMsgTemplateDto implements java.io.Serializable{
/**
* 模版消息标题
*/
private String title;
/**
* 模版消息标题-ERP开启显示
*/
private String subTitle;
private String templateIdShort;
private Integer status;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSubTitle() {
return subTitle;
}
public void setSubTitle(String subTitle) {
this.subTitle = subTitle;
}
public String getTemplateIdShort() {
return templateIdShort;
}
public void setTemplateIdShort(String templateIdShort) {
this.templateIdShort = templateIdShort;
}
public Integer getStatus() {
if (status == null){
return StoreMsgTemplateConstant.Status.CLOSED.getCode();
}
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
| [
"cj989824"
] | cj989824 |
00d246ec41a7ac8cdffe95c82404a649545ca1c9 | b4655fab5adb703af8df9a896ebcbcb986bbbb43 | /src/com/company/pokerTables/TexasHoldemPokerTable.java | 60ec145bb16b340db57d288046c2357f920629c3 | [] | no_license | genrihssaruhanovs/Poker | f4a334cf97a3cee21999f0e000ae7a6534515c1d | 136cc202e0a9b5b15e38c1c27b38149993ab6fcb | refs/heads/master | 2022-12-15T00:19:01.049221 | 2020-09-15T14:25:24 | 2020-09-15T14:25:24 | 293,905,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package com.company.pokerTables;
import com.company.CardSet;
import com.company.EvaluatedHand;
import com.company.combinations.CombinationFactory;
import com.company.enums.PokerTableTypes;
import java.util.Collections;
public class TexasHoldemPokerTable extends HoldemPokerTable {
public TexasHoldemPokerTable(String inputString) {
super(inputString, PokerTableTypes.TEXAS);
}
@Override
public void evaluateTable() {
for (CardSet hand : hands) {
evaluatedHands.add(new EvaluatedHand(hand, CombinationFactory.getBestCombination(board, hand)));
}
Collections.sort(evaluatedHands);
}
}
| [
"[email protected]"
] | |
a050446388b799778cab0c823738fd06eb00103f | 67984d7d945b67709b24fda630efe864b9ae9c72 | /core/src/main/java/com/ey/piit/core/paginator/domain/Paginator.java | 9d67a29a1d50129f36a93e581b761f802b493b60 | [] | no_license | JackPaiPaiNi/Piit | 76c7fb6762912127a665fa0638ceea1c76893fc6 | 89b8d79487e6d8ff21319472499b6e255104e1f6 | refs/heads/master | 2020-04-07T22:30:35.105370 | 2018-11-23T02:58:31 | 2018-11-23T02:58:31 | 158,773,760 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,027 | java | package com.ey.piit.core.paginator.domain;
import java.io.Serializable;
/**
* 分页器,根据page,limit,totalCount用于页面上分页显示多项内容,计算页码和当前页的偏移量,方便页面分页使用.
*
* @author badqiu
* @author miemiedev
*/
public class Paginator implements Serializable {
private static final long serialVersionUID = -2429864663690465105L;
private static final int DEFAULT_SLIDERS_COUNT = 7;
/**
* 分页大小
*/
private int limit;
/**
* 页数
*/
private int page;
/**
* 总记录数
*/
private int totalCount;
public Paginator(int page, int limit, int totalCount) {
super();
this.limit = limit;
this.totalCount = totalCount;
this.page = computePageNo(page);
}
/**
* 取得当前页。
*/
public int getPage() {
return page;
}
public int getLimit() {
return limit;
}
/**
* 取得总项数。
*
* @return 总项数
*/
public int getTotalCount() {
return totalCount;
}
/**
* 是否是首页(第一页),第一页页码为1
*
* @return 首页标识
*/
public boolean isFirstPage() {
return page <= 1;
}
/**
* 是否是最后一页
*
* @return 末页标识
*/
public boolean isLastPage() {
return page >= getTotalPages();
}
public int getPrePage() {
if (isHasPrePage()) {
return page - 1;
} else {
return page;
}
}
public int getNextPage() {
if (isHasNextPage()) {
return page + 1;
} else {
return page;
}
}
/**
* 判断指定页码是否被禁止,也就是说指定页码超出了范围或等于当前页码。
*
* @param page 页码
* @return boolean 是否为禁止的页码
*/
public boolean isDisabledPage(int page) {
return ((page < 1) || (page > getTotalPages()) || (page == this.page));
}
/**
* 是否有上一页
*
* @return 上一页标识
*/
public boolean isHasPrePage() {
return (page - 1 >= 1);
}
/**
* 是否有下一页
*
* @return 下一页标识
*/
public boolean isHasNextPage() {
return (page + 1 <= getTotalPages());
}
/**
* 开始行,可以用于oracle分页使用 (1-based)。
*/
public int getStartRow() {
if (getLimit() <= 0 || totalCount <= 0) return 0;
return page > 0 ? (page - 1) * getLimit() + 1 : 0;
}
/**
* 结束行,可以用于oracle分页使用 (1-based)。
*/
public int getEndRow() {
return page > 0 ? Math.min(limit * page, getTotalCount()) : 0;
}
/**
* offset,计数从0开始,可以用于mysql分页使用(0-based)
*/
public int getOffset() {
return page > 0 ? (page - 1) * getLimit() : 0;
}
/**
* 得到 总页数
*
* @return
*/
public int getTotalPages() {
if (totalCount <= 0) {
return 0;
}
if (limit <= 0) {
return 0;
}
int count = totalCount / limit;
if (totalCount % limit > 0) {
count++;
}
return count;
}
protected int computePageNo(int page) {
return computePageNumber(page, limit, totalCount);
}
/**
* 页码滑动窗口,并将当前页尽可能地放在滑动窗口的中间部位。
*
* @return
*/
public Integer[] getSlider() {
return slider(DEFAULT_SLIDERS_COUNT);
}
/**
* 页码滑动窗口,并将当前页尽可能地放在滑动窗口的中间部位。
* 注意:不可以使用 getSlider(1)方法名称,因为在JSP中会与 getSlider()方法冲突,报exception
*
* @return
*/
public Integer[] slider(int slidersCount) {
return generateLinkPageNumbers(getPage(), (int) getTotalPages(), slidersCount);
}
private static int computeLastPageNumber(int totalItems, int pageSize) {
if (pageSize <= 0) return 1;
int result = (int) (totalItems % pageSize == 0 ?
totalItems / pageSize
: totalItems / pageSize + 1);
if (result <= 1)
result = 1;
return result;
}
private static int computePageNumber(int page, int pageSize, int totalItems) {
if (page <= 1) {
return 1;
}
if (Integer.MAX_VALUE == page
|| page > computeLastPageNumber(totalItems, pageSize)) { //last page
return computeLastPageNumber(totalItems, pageSize);
}
return page;
}
private static Integer[] generateLinkPageNumbers(int currentPageNumber, int lastPageNumber, int count) {
int avg = count / 2;
int startPageNumber = currentPageNumber - avg;
if (startPageNumber <= 0) {
startPageNumber = 1;
}
int endPageNumber = startPageNumber + count - 1;
if (endPageNumber > lastPageNumber) {
endPageNumber = lastPageNumber;
}
if (endPageNumber - startPageNumber < count) {
startPageNumber = endPageNumber - count;
if (startPageNumber <= 0) {
startPageNumber = 1;
}
}
java.util.List<Integer> result = new java.util.ArrayList<Integer>();
for (int i = startPageNumber; i <= endPageNumber; i++) {
result.add(new Integer(i));
}
return result.toArray(new Integer[result.size()]);
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("Paginator");
sb.append("{page=").append(page);
sb.append(", limit=").append(limit);
sb.append(", totalCount=").append(totalCount);
sb.append('}');
return sb.toString();
}
}
| [
"1210287515@master"
] | 1210287515@master |
74ac6d10ce71d1e6a02ca2e265ce14779f04fa88 | 7fff54f4b074f7f0161a3612a094aeb99eae9f06 | /Player v1.5/Ranger.java | fedaf4073ac148edf35d31d90a14716a198c9969 | [] | no_license | virenvshah/BattleCode | 36e09ac3c8c1161110f29cf4fea7f9820203def3 | 249574175a9917a8acc818935bd65092c4bc82b4 | refs/heads/master | 2021-09-05T23:25:34.987219 | 2018-01-28T20:33:23 | 2018-01-28T20:33:23 | 119,709,820 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 303 | java | import bc.*;
/**
* Represents a ranger robot in the game
* @author virsain
*/
public class Ranger extends AbstractRobot {
public Ranger(int i, GameController g, Map map, MapLocation location) {
super(i, g, map, location, UnitType.Ranger);
state = State.Idle;
previousState = State.Idle;
}
}
| [
"[email protected]"
] | |
9a21b01d256be8e9bc8893fdbc60eabc3a39e87b | 7b9bb48e9fad83bbee196996feea6f162d8f0118 | /src/main/java/com/laselva/kafka/CustomerListener.java | 35159939480cb6f1579085131fac6ad04a0e5a53 | [] | no_license | adrianolaselva/blueprint-java-springboot-kafka | 5569ebbd75d87671e112714b7dd3e86a42e20e2d | 66cfba9f51e5eb93744fef3a12f1e43961db4738 | refs/heads/master | 2020-09-19T16:56:46.570119 | 2019-11-26T17:28:19 | 2019-11-26T17:28:19 | 224,248,385 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,232 | java | package com.laselva.kafka;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.header.Headers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Service;
import java.util.stream.StreamSupport;
@Service
public class CustomerListener {
private static final Logger logger = LoggerFactory.getLogger(CustomerListener.class);
@KafkaListener(topics = "customer-topic", clientIdPrefix = "json",
containerFactory = "kafkaListenerContainerFactory")
public void listenAsObject(ConsumerRecord<String, Customer> cr, @Payload Customer payload) {
logger.info("Logger 1 [JSON] received key {}: Type [{}] | Payload: {} | Record: {}", cr.key(),
typeIdHeader(cr.headers()), payload, cr.toString());
}
private static String typeIdHeader(Headers headers) {
return StreamSupport.stream(headers.spliterator(), false)
.filter(header -> header.key().equals("__TypeId__"))
.findFirst().map(header -> new String(header.value())).orElse("N/A");
}
}
| [
"[email protected]"
] | |
2d01c611509d7489638644559f704cde69da70fe | 16dfec7df208ec48698814e96e029f7820dedb2c | /app/src/main/java/brandon/example/com/despachador/MainActivity.java | 6c24f55612b54c6603050c5de87a2b6c13e38e1b | [] | no_license | Brandonitas/DespachadorApp | fd899615772b251af7e9bbe3b4b3fad5fe52b2e0 | eefb22d5899b34e14a5e906f2b9589c26476a479 | refs/heads/master | 2021-07-19T20:04:26.133371 | 2017-10-31T05:49:38 | 2017-10-31T05:49:38 | 108,800,762 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,988 | java | package brandon.example.com.despachador;
import android.content.Intent;
import android.os.Parcelable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class MainActivity extends AppCompatActivity {
EditText editText, editText1, editText2, editText3;
Button button, button2;
CheckBox checkBox;
TextView textView;
public static int micros=2;
public static int cuantum=3000;
public static int tcc=15;
public static int tb=15;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editText = (EditText)findViewById(R.id.editText);
editText1 = (EditText)findViewById(R.id.editText1);
editText2 = (EditText)findViewById(R.id.editText2);
editText3 = (EditText)findViewById(R.id.editText3);
checkBox = (CheckBox) findViewById(R.id.checkBox);
button=(Button) findViewById(R.id.button);
button2=(Button) findViewById(R.id.button2);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!editText.getText().toString().isEmpty() && !editText1.getText()
.toString().isEmpty() && !editText2.getText()
.toString().isEmpty() && !editText3.getText().toString().isEmpty()) {
micros = Integer.parseInt(editText.getText().toString());
cuantum = Integer.parseInt(editText1.getText().toString());
tcc = Integer.parseInt(editText2.getText().toString());
tb = Integer.parseInt(editText3.getText().toString());
if (micros >= 1 && cuantum >= 1 && tcc >= 0 && tb >= 0) {
if (checkBox.isChecked()) {
Intent intent = new Intent(MainActivity.this, EditartxtActivity.class);
intent.putExtra("micros", micros);
intent.putExtra("cuantum", cuantum);
intent.putExtra("tcc", tcc);
intent.putExtra("tb", tb);
startActivity(intent);
} else{
Intent intent = new Intent(MainActivity.this, TablaActivity.class);
intent.putExtra("micros", micros);
intent.putExtra("cuantum", cuantum);
intent.putExtra("tcc", tcc);
intent.putExtra("tb", tb);
intent.putExtra("modificado", false);
startActivity(intent);
}
} else {
Toast.makeText(MainActivity.this, "Ingresa numeros positivos mayores a 0", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(MainActivity.this, "Debes ingresar todos los valores", Toast.LENGTH_SHORT).show();
}
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
editText.setText("2");
editText1.setText("3000");
editText2.setText("15");
editText3.setText("15");
}
});
}
}
| [
"[email protected]"
] | |
91c14b9ec6a73ead6572c8c9f1430805287a84d9 | 9f83f3f306bbc29410c812444ce5d3a35b678d7f | /week-01/day-3/src/DefineBasicInfo.java | df2fee4a4888af0ccac0f89f78b7cfe20ee6e764 | [] | no_license | markpalotas/starlinginferno | 18eefbb5e3a6003ee77b30709b866b7d2a77fe63 | 5d711cf49e6446facc3e9e5383e39f46acd4f028 | refs/heads/master | 2020-04-17T14:34:50.553166 | 2019-01-16T12:20:47 | 2019-01-16T12:20:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 200 | java | public class DefineBasicInfo {
public static void main(String[] args) {
String name = "Lili";
int age = 26;
double height = 1.65;
boolean married = false;
}
}
| [
"[email protected]"
] | |
ecf5dc7ec23d9f70d398a5208cdd23708581a0b7 | 125602e06883342f57a55489119bd504b71f9289 | /test/unit/java/com/articulate/sigma/trans/TPTP3ProofProcTest.java | 15a95f4d299e75808bf26287f31fb11fc3daed11 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | manisabri/sigmakee | 45fe3591071104176c80cfbaae7a9bb407ce2f98 | 16eab15a396e01976bac7795df902984c1079513 | refs/heads/master | 2022-05-26T02:19:27.357494 | 2020-04-28T20:32:50 | 2020-04-28T20:32:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,165 | java | package com.articulate.sigma.trans;
import com.articulate.sigma.FormulaPreprocessor;
import com.articulate.sigma.trans.*;
import com.articulate.sigma.*;
import org.junit.Test;
import org.junit.Before;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.*;
import static org.junit.Assert.*;
import org.junit.Ignore;
import org.junit.BeforeClass;
/**
*/
public class TPTP3ProofProcTest extends UnitTestBase {
/** ***************************************************************
*/
@BeforeClass
public static void init() {
}
/** ***************************************************************
*/
public void test(String input, String expected, String label) {
System.out.println("=============================");
System.out.println("TPTP3ProofProcTest: " + label);
System.out.println();
TPTP3ProofProcessor tpp = new TPTP3ProofProcessor();
String actual = tpp.getPrologArgs(input).toString();
System.out.println("Expected: " + expected);
if (!StringUtil.emptyString(actual) && actual.equals(expected))
System.out.println(label + " : Success");
else
System.out.println(label + " : fail!");
assertEquals(expected, actual);
}
/** ***************************************************************
*/
@Test
public void testGetPrologArgs1() {
String input = "fof(c_0_5, axiom, (s__subclass(s__Artifact,s__Object)), c_0_3).";
String expected = "[fof, c_0_5, axiom, (s__subclass(s__Artifact,s__Object)), c_0_3]";
test(input,expected,"testGetPrologArgs1");
}
/** ***************************************************************
*/
@Test
public void testGetPrologArgs2() {
String input = "fof(c_0_2, negated_conjecture,(~(?[X1]:(s__subclass(X1,s__Object)&~$answer(esk1_1(X1)))))," +
"inference(assume_negation,[status(cth)],[inference(add_answer_literal,[status(thm)],[c_0_0, theory(answers)])])).";
String expected = "[fof, c_0_2, negated_conjecture, (~(?[X1]:(s__subclass(X1,s__Object)&~$answer(esk1_1(X1))))), " +
"inference(assume_negation,[status(cth)],[inference(add_answer_literal,[status(thm)],[c_0_0, theory(answers)])])]";
test(input,expected,"testGetPrologArgs2");
}
/** ***************************************************************
*/
@Test
public void testGetPrologArgs3() {
String input = "cnf(c_0_14,negated_conjecture,($false), " +
"inference(eval_answer_literal,[status(thm)], " +
"[inference(spm,[status(thm)],[c_0_12, c_0_13, theory(equality)]), theory(answers)]), ['proof']).";
String expected = "[cnf, c_0_14, negated_conjecture, ($false), inference(eval_answer_literal,[status(thm)], " +
"[inference(spm,[status(thm)],[c_0_12, c_0_13, theory(equality)]), theory(answers)]), ['proof']]";
test(input,expected,"testGetPrologArgs3");
}
/** ***************************************************************
*/
@Test
public void testGetPrologArgs4() {
String input = "fof(f185,conjecture,(" +
" ? [X15] : s__subclass(X15,s__Entity))," +
" file('/home/apease/.sigmakee/KBs/temp-comb.tptp',unknown)).";
String expected = "[fof, f185, conjecture, ( ? [X15] : s__subclass(X15,s__Entity)), " +
"file('/home/apease/.sigmakee/KBs/temp-comb.tptp',unknown)]";
test(input,expected,"testGetPrologArgs4");
}
/** ***************************************************************
*/
@Test
public void testParseProofStep () {
System.out.println("========================");
String ps1 = "fof(c_0_5, axiom, (s__subclass(s__Artifact,s__Object)), c_0_3).";
String ps2 = "fof(c_0_2, negated_conjecture,(~(?[X1]:(s__subclass(X1,s__Object)&~$answer(esk1_1(X1)))))," +
"inference(assume_negation,[status(cth)],[inference(add_answer_literal,[status(thm)],[c_0_0, theory(answers)])])).";
String ps3 = "cnf(c_0_14,negated_conjecture,($false), " +
"inference(eval_answer_literal,[status(thm)], [inference(spm,[status(thm)],[c_0_12, c_0_13, theory(equality)]), theory(answers)]), ['proof']).";
String ps4 = "fof(f185,conjecture,(" +
" ? [X15] : s__subclass(X15,s__Entity))," +
" file('/home/apease/.sigmakee/KBs/temp-comb.tptp',unknown)).";
TPTP3ProofProcessor tpp = new TPTP3ProofProcessor();
tpp.idTable.put("c_0_0", Integer.valueOf(0));
tpp.idTable.put("c_0_3", Integer.valueOf(1));
tpp.idTable.put("c_0_12", Integer.valueOf(2));
tpp.idTable.put("c_0_13", Integer.valueOf(3));
System.out.println(tpp.parseProofStep(ps1));
System.out.println();
System.out.println(tpp.parseProofStep(ps2));
System.out.println();
System.out.println(tpp.parseProofStep(ps3));
System.out.println();
tpp.idTable.put("f185", Integer.valueOf(4));
System.out.println(tpp.parseProofStep(ps4));
}
/** ***************************************************************
*/
@Test
public void testParseAnswers () {
System.out.println("========================");
String label = "testParseAnswers";
System.out.println("TPTP3ProofProcTest: " + label);
System.out.println();
String line = "[[s__A,s__B]|_]";
TPTP3ProofProcessor tpp = new TPTP3ProofProcessor();
tpp.processAnswers(line);
String actual = tpp.bindings.toString();
String expected = "[A, B]";
System.out.println("Actual: " + actual);
System.out.println("Expected: " + expected);
if (!StringUtil.emptyString(actual) && actual.equals(expected))
System.out.println(label + " : Success");
else
System.out.println(label + " : fail!");
assertEquals(expected, actual);
line = "% SZS answers Tuple [[s__A,s__B]|_] for temp-comb";
tpp = new TPTP3ProofProcessor();
tpp.processAnswers(line.substring(20,line.lastIndexOf(']')+1).trim());
actual = tpp.bindings.toString();
expected = "[A, B]";
System.out.println("Actual: " + actual);
System.out.println("Expected: " + expected);
if (!StringUtil.emptyString(actual) && actual.equals(expected))
System.out.println(label + " : Success");
else
System.out.println(label + " : fail!");
assertEquals(expected, actual);
}
/** ***************************************************************
*/
@Test
public void testExtractAnswerClause () {
System.out.println("========================");
String label = "testExtractAnswerClause";
String input = "(forall (?X0) (or (not (instance ?X0 Relation)) (not (ans0 ?X0))))";
TPTP3ProofProcessor tpp = new TPTP3ProofProcessor();
Formula ans = tpp.extractAnswerClause(new Formula(input));
assertFalse(ans == null);
String actual = ans.toString();
String expected = "(ans0 ?X0)";
System.out.println("Actual: " + actual);
System.out.println("Expected: " + expected);
if (!StringUtil.emptyString(actual) && actual.equals(expected))
System.out.println(label + " : Success");
else
System.out.println(label + " : fail!");
assertEquals(expected, actual);
}
/** ***************************************************************
*/
@Test
public void testProcessAnswersFromProof () {
System.out.println("========================");
String label = "testProcessAnswersFromProof";
ArrayList<String> input = new ArrayList();
input.add("% SZS status Theorem for temp-comb");
input.add("% SZS answers Tuple [[s__TransitFn__m]|_] for temp-comb");
input.add("% SZS output start Proof for temp-comb");
input.add("fof(f916,plain,( $false), inference(unit_resulting_resolution,[],[f915,f914])).");
input.add("fof(f914,plain,( ~ans0(s__TransitFn__m)), inference(resolution,[],[f601,f822])).");
input.add("fof(f822,plain,( s__instance(s__TransitFn__m,s__Relation)), inference(cnf_transformation,[],[f200])).");
input.add("fof(f200,axiom,( s__instance(s__TransitFn__m,s__Relation)), file('/home/apease/.sigmakee/KBs/temp-comb.tptp',kb_SUMO_200)).");
input.add("fof(f601,plain,( ( ! [X0] : (~s__instance(X0,s__Relation) | ~ans0(X0)) )), inference(cnf_transformation,[],[f553])).");
input.add("fof(f553,plain,( ! [X0] : (~s__instance(X0,s__Relation) | ~ans0(X0))), inference(ennf_transformation,[],[f395])).");
input.add("fof(f395,plain,( ~? [X0] : (s__instance(X0,s__Relation) & ans0(X0))), inference(rectify,[],[f394])).");
input.add("fof(f394,plain,( ~? [X16] : (s__instance(X16,s__Relation) & ans0(X16))), inference(answer_literal,[],[f393])).");
input.add("fof(f393,negated_conjecture,( ~? [X16] : s__instance(X16,s__Relation)), inference(negated_conjecture,[],[f392])).");
input.add("fof(f392,conjecture,( ? [X16] : s__instance(X16,s__Relation)), file('/home/apease/.sigmakee/KBs/temp-comb.tptp',query_0)).");
input.add("fof(f915,plain,( ( ! [X0] : (ans0(X0)) )), introduced(answer_literal,[])).");
TPTP3ProofProcessor tpp = new TPTP3ProofProcessor();
KB kb = KBmanager.getMgr().getKB(KBmanager.getMgr().getPref("sumokbname"));
tpp = tpp.parseProofOutput(input,kb);
tpp.processAnswersFromProof("(instance ?X Entity)");
String actual = tpp.bindingMap.toString();
String expected = "{?X=TransitFn}";
System.out.println("Actual: " + actual);
System.out.println("Expected: " + expected);
if (!StringUtil.emptyString(actual) && actual.equals(expected))
System.out.println(label + " : Success");
else
System.out.println(label + " : fail!");
assertEquals(expected, actual);
}
}
| [
"[email protected]"
] | |
4e5d6ed64a2e16e937950c6f52cfc6cff112fc41 | 11502fe559b083fb281052b11955919a4d531838 | /src/main/java/flud/necan/AppIdeasProjectApplication.java | ce4c49a81459762e92a7b3d84d943bea6546a4bd | [] | no_license | fnecan/ideas-api | e5a2f77fc443423e84b8f6d90b887b9d0829eaa5 | f9196932dd5a2285a852678a86c0977d94ab3f64 | refs/heads/master | 2020-06-12T22:29:53.893832 | 2019-07-16T12:01:41 | 2019-07-16T12:01:41 | 194,447,613 | 0 | 0 | null | 2019-07-16T12:01:43 | 2019-06-29T20:54:41 | Java | UTF-8 | Java | false | false | 543 | java | package flud.necan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@SpringBootApplication
public class AppIdeasProjectApplication {
public static void main(String[] args) {
SpringApplication.run(AppIdeasProjectApplication.class, args);
}
}
| [
"[email protected]"
] | |
e4e9cfc0bee89a7267fd88bd58aeaecc6f50f3ba | 5b32e98519d905a412a7f3f6de65346ee026c823 | /app/src/main/java/br/ufrn/locationtracker/Activities/MainActivity.java | b469cb4774f70bb0d0260a2fc42af7b05153f65c | [] | no_license | LocationTracker/LocationTrackerAPP | b7371d520eef01d50064bf7e27ca4e0291b70e2e | 701c1db337b98812ca84009293d37769074cbf16 | refs/heads/master | 2020-03-17T02:20:08.932608 | 2018-06-15T01:41:11 | 2018-06-15T01:41:31 | 133,186,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,068 | java | package br.ufrn.locationtracker.Activities;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TabLayout;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
import android.telephony.TelephonyManager;
import android.view.View;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import org.json.JSONObject;
import java.util.ArrayList;
import br.ufrn.locationtracker.Api.LocationApi;
import br.ufrn.locationtracker.Api.OnJSONObjectResponseCallback;
import br.ufrn.locationtracker.Fragment.TabPagerAdapter;
import br.ufrn.locationtracker.R;
import br.ufrn.locationtracker.Utl.Utl;
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
boolean todasPermissoes = true;
public static final int MULTIPLY_PERMISSIONS = 4;
TabPagerAdapter pagerAdapter;
ViewPager viewPager;
TabLayout tabLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
//setUpFacebook();
//setupPublicidade();
setupPermissions();
while (!todasPermissoes){
setupPermissions();
}
//getToken();
configureTabLayout();
}
private void setupPermissions(){
int fineLocationAccess = ActivityCompat.checkSelfPermission(getBaseContext(), Manifest.permission.ACCESS_FINE_LOCATION);
int permissionIMEI = ContextCompat.checkSelfPermission(getBaseContext(), Manifest.permission.READ_PHONE_STATE);
ArrayList<String> listaPermissoes = new ArrayList<>();
if(permissionIMEI != PackageManager.PERMISSION_GRANTED){
listaPermissoes.add(Manifest.permission.READ_PHONE_STATE);
todasPermissoes = false;
}
else {
TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
@SuppressLint("MissingPermission") String imei = tm.getDeviceId();
Utl.setDevice(getBaseContext(), imei);
}
if(fineLocationAccess != PackageManager.PERMISSION_GRANTED){
listaPermissoes.add(Manifest.permission.ACCESS_FINE_LOCATION);
todasPermissoes = false;
}
if(listaPermissoes.size()>0){
ActivityCompat.requestPermissions(this, listaPermissoes.toArray(new String[listaPermissoes.size()]),
MULTIPLY_PERMISSIONS);
} else {
todasPermissoes = true;
}
}
private void configureTabLayout() {
// Get the ViewPager and set it's PagerAdapter so that it can display items
viewPager = findViewById(R.id.viewpager);
viewPager.setOffscreenPageLimit(2);
pagerAdapter = new TabPagerAdapter(getSupportFragmentManager(), MainActivity.this, viewPager);
viewPager.setAdapter(pagerAdapter);
// Give the TabLayout the ViewPager
tabLayout = findViewById(R.id.tab_layout);
tabLayout.setupWithViewPager(viewPager);
tabLayout.getTabAt(0).setIcon(R.drawable.ic_menu_mapa_selecionado);
//tabLayout.getTabAt(1).setIcon(R.drawable.ic_menu_linha);
//tabLayout.getTabAt(2).setIcon(R.drawable.ic_menu_meuonibus);
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
setTitle(tab.getText());
int position = tab.getPosition();
switch (position){
case 0:
tab.setIcon(R.drawable.ic_menu_mapa_selecionado);
break;
/*case 1:
tab.setIcon(R.drawable.ic_menu_linha_selecionado);
break;
case 2:
tab.setIcon(R.drawable.ic_menu_meuonibus_selecionado);
break;*/
default:
break;
}
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
int position = tab.getPosition();
switch (position) {
case 0:
tab.setIcon(R.drawable.ic_menu_mapa);
break;
/*case 1:
tab.setIcon(R.drawable.ic_menu_linha);
break;
case 2:
tab.setIcon(R.drawable.ic_menu_meuonibus);
break;*/
default:
break;
}
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
int position = tab.getPosition();
switch (position) {
case 0:
tab.setIcon(R.drawable.ic_menu_mapa_selecionado);
return;
/* case 1:
tab.setIcon(R.drawable.ic_menu_linha_selecionado);
return;
case 2:
tab.setIcon(R.drawable.ic_menu_meuonibus_selecionado);
return;*/
default:
return;
}
}
});
}
@Override
public void onBackPressed() {
DrawerLayout drawer = findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.enviarPosicao) {
enviarLocalizacao(this);
}
return true;
}
LocationApi locationApi;
private void enviarLocalizacao(final Activity activity){
if(locationApi== null){
locationApi = new LocationApi(getBaseContext());
locationApi.postSendLocation(1, Utl.getLatitude(getBaseContext()),
Utl.getLongitude(getBaseContext()),
new OnJSONObjectResponseCallback() {
@Override
public void onJSONObjectResponse(boolean success, JSONObject response) {
if(success){
new AlertDialog.Builder(activity)
.setTitle("Sucesso")
.setMessage("Enviado com Sucesso!")
.setCancelable(false)
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}).show();
locationApi = null;
}
else {
new AlertDialog.Builder(activity)
.setTitle("Ops")
.setMessage("Erro no envio`!")
.setCancelable(false)
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}).show();
locationApi = null;
}
}
});
}
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_camera) {
// Handle the camera action
} else if (id == R.id.nav_gallery) {
} else if (id == R.id.nav_slideshow) {
} else if (id == R.id.nav_manage) {
} else if (id == R.id.nav_share) {
} else if (id == R.id.nav_send) {
}
DrawerLayout drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
}
| [
"[email protected]"
] | |
c3a22f027e5504e456e6c5c6cd7736043897334e | 27dcd4a0eb931a1d8f4712ddf58b3a851b05c8b2 | /core/src/test/java/io/github/jtsato/bookstore/core/author/usecase/FindAuthorsByIdsUseCaseTest.java | f968ec2cd08a768dfb51be0bdbb19898d20298d0 | [
"Apache-2.0"
] | permissive | jtsato/java-clean-architecture-example | 65ec928df6b02603dc4324200b1a5a78bd983bbc | 0e753814d9cf5301b0921da4a0c125fe9eabd4b3 | refs/heads/master | 2021-07-06T21:43:09.722694 | 2021-05-07T00:02:47 | 2021-05-07T00:02:47 | 282,562,948 | 16 | 5 | Apache-2.0 | 2021-06-24T21:16:41 | 2020-07-26T02:46:51 | Java | UTF-8 | Java | false | false | 6,614 | java | package io.github.jtsato.bookstore.core.author.usecase;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import io.github.jtsato.bookstore.core.author.domain.Author;
import io.github.jtsato.bookstore.core.author.domain.Gender;
import io.github.jtsato.bookstore.core.author.gateway.FindAuthorsByIdsGateway;
import io.github.jtsato.bookstore.core.author.action.FindAuthorsByIdsAction;
import io.github.jtsato.bookstore.core.common.paging.Page;
import io.github.jtsato.bookstore.core.common.paging.PageImpl;
import io.github.jtsato.bookstore.core.common.paging.Pageable;
import io.github.jtsato.bookstore.core.exception.InvalidParameterException;
/**
* @author Jorge Takeshi Sato
*/
@DisplayName("Find Authors By Ids")
class FindAuthorsByIdsUseCaseTest {
@Mock
private final FindAuthorsByIdsGateway findAuthorsByIdsGateway = Mockito.mock(FindAuthorsByIdsGateway.class);
@InjectMocks
private final FindAuthorsByIdsUseCase findAuthorsByIdsUseCase = new FindAuthorsByIdsAction(findAuthorsByIdsGateway);
@DisplayName("Fail to find authors by IDs if parameters are not valid")
@Test
void failToFindAuthorsByIdsIfParametersAreNotValid() {
when(findAuthorsByIdsGateway.execute(null)).thenReturn(null);
final Exception exception = Assertions.assertThrows(Exception.class, () -> findAuthorsByIdsUseCase.findAuthorsByIds(null));
assertThat(exception).isInstanceOf(InvalidParameterException.class);
final InvalidParameterException invalidParameterException = (InvalidParameterException) exception;
assertThat(invalidParameterException.getMessage()).isEqualTo("validation.authors.ids.null");
}
@DisplayName("Successful to find authors by IDs, when at least one is found")
@Test
void successfulToFindAuthorsByIdsIfFound() {
final List<Long> ids = Arrays.asList(1L, 2L);
when(findAuthorsByIdsGateway.execute(ids)).thenReturn(mockFindAuthorsByIdsGatewayOut());
final Page<Author> pageOfAuthors = findAuthorsByIdsUseCase.findAuthorsByIds(ids);
assertThat(pageOfAuthors).isNotNull();
final Pageable pageable = pageOfAuthors.getPageable();
assertThat(pageable).isNotNull();
assertThat(pageable.getPage()).isZero();
assertThat(pageable.getSize()).isOne();
assertThat(pageable.getNumberOfElements()).isOne();
assertThat(pageable.getTotalOfElements()).isOne();
assertThat(pageable.getTotalPages()).isOne();
final List<Author> authors = pageOfAuthors.getContent();
assertThat(authors).isNotNull().isNotEmpty();
assertThat(authors.size()).isOne();
final Author author = authors.get(0);
assertThat(author.getId()).isEqualTo(1L);
assertThat(author.getName()).isEqualTo("Joshua Bloch");
assertThat(author.getGender()).isEqualTo(Gender.MALE);
assertThat(author.getBirthdate()).isEqualTo(LocalDate.parse("1961-08-28"));
}
private Page<Author> mockFindAuthorsByIdsGatewayOut() {
final List<Author> content = new ArrayList<>(1);
content.add(new Author(1L, "Joshua Bloch", Gender.MALE, LocalDate.parse("1961-08-28")));
return new PageImpl<>(content, new Pageable(0, 1, 1, 1L, 1));
}
@DisplayName("Fail to find authors by IDs if not found")
@Test
void failToFindAuthorsByIdsIfNotFound() {
final List<Long> ids = Arrays.asList(1L, 2L);
final Page<Author> pageOfAuthors = new PageImpl<>(Collections.emptyList(), new Pageable(0, 1, 0, 0L, 0));
when(findAuthorsByIdsGateway.execute(ids)).thenReturn(pageOfAuthors);
final Pageable pageable = pageOfAuthors.getPageable();
assertThat(pageable).isNotNull();
assertThat(pageable.getPage()).isZero();
assertThat(pageable.getSize()).isOne();
assertThat(pageable.getNumberOfElements()).isZero();
assertThat(pageable.getTotalOfElements()).isZero();
assertThat(pageable.getTotalPages()).isZero();
}
@DisplayName("Fail to find authors by IDs if the limit is exceeded")
@Test
void failToFindAuthorsByIdsIfTheLimitIsExceeded() {
final List<Long> ids = new ArrayList<>(1001);
for (int index = 1; index <= 1001; index++) {
ids.add((long) index);
}
when(findAuthorsByIdsGateway.execute(ids)).thenReturn(mockFindAuthorsByIdsGatewayOut());
final Exception exception = Assertions.assertThrows(Exception.class, () -> findAuthorsByIdsUseCase.findAuthorsByIds(ids));
assertThat(exception).isInstanceOf(InvalidParameterException.class);
final InvalidParameterException invalidParameterException = (InvalidParameterException) exception;
assertThat(invalidParameterException.getMessage()).isEqualTo("validation.get.by.ids.limit");
}
@DisplayName("Successful to find authors by IDs if the limit is exceeded")
@Test
void successfulToFindAuthorsByIdsIfTheLimitIsNotExceeded() {
final List<Long> ids = new ArrayList<>(1000);
for (int index = 1; index <= 1000; index++) {
ids.add((long) index);
}
when(findAuthorsByIdsGateway.execute(ids)).thenReturn(mockFindAuthorsByIdsGatewayOut());
final Page<Author> pageOfAuthors = findAuthorsByIdsUseCase.findAuthorsByIds(ids);
assertThat(pageOfAuthors).isNotNull();
final Pageable pageable = pageOfAuthors.getPageable();
assertThat(pageable).isNotNull();
assertThat(pageable.getPage()).isZero();
assertThat(pageable.getSize()).isOne();
assertThat(pageable.getNumberOfElements()).isOne();
assertThat(pageable.getTotalOfElements()).isOne();
assertThat(pageable.getTotalPages()).isOne();
final List<Author> authors = pageOfAuthors.getContent();
assertThat(authors).isNotNull().isNotEmpty();
assertThat(authors.size()).isOne();
final Author author = authors.get(0);
assertThat(author.getId()).isEqualTo(1L);
assertThat(author.getName()).isEqualTo("Joshua Bloch");
assertThat(author.getGender()).isEqualTo(Gender.MALE);
assertThat(author.getBirthdate()).isEqualTo(LocalDate.parse("1961-08-28"));
}
}
| [
"[email protected]"
] | |
798bc128ec928febee41e11ef1c0fac4db37832c | 2cd9a5c94534abb37ed7eba5cced87eb2ca0b33f | /app/src/main/java/com/koudle/navigationbarexample/MainActivity.java | 25c27896630eeb90aaa9d3042697ce93a7c8d3f5 | [
"Apache-2.0"
] | permissive | koudle/NavigationBar | 5606f875635aaebb67197f6b49a6ea091e3d2044 | 50e95276ab62745c133b4fe177e51312c34faff7 | refs/heads/master | 2021-01-10T07:57:11.300428 | 2016-03-02T09:56:20 | 2016-03-02T09:56:20 | 51,905,891 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,695 | java | package com.koudle.navigationbarexample;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import com.koudle.navigationbar.TabBarView;
import com.koudle.navigationbar.TabItemClickEvent;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
public class MainActivity extends AppCompatActivity {
private final static String TAG = "MainActivity";
private MyTabBarView tabBarView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tabBarView = (MyTabBarView) findViewById(R.id.navigationBarView);
EventBus.getDefault().register(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@Subscribe(
threadMode = ThreadMode.MAIN
)
public void onItemClick(TabItemClickEvent event){
}
}
| [
"[email protected]"
] | |
33f6a503929d4ecafec8f64fcca21c15343b1995 | d369f332eee40d4168ccc061c7b1ff2e82485284 | /src/main/java/com/suprun/periodicals/view/constants/PagesPath.java | ac6effc82abd6d8692dec7bbfb7a798aa1645110 | [] | no_license | AndreiSuprun/periodicals | 3c4bddcaa01ae4e959e8818949df30018b8466a7 | 15477a5d7f6b069531cb2a7558ce99f520a90c7e | refs/heads/master | 2023-03-24T00:24:03.380915 | 2021-02-17T00:02:01 | 2021-02-17T00:02:01 | 312,561,622 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,698 | java | package com.suprun.periodicals.view.constants;
import com.suprun.periodicals.util.Resource;
/**
* Relative path of pages
*/
public final class PagesPath {
public static final String SITE_PREFIX = Resource.PATH.getProperty("site.prefix");
public static final String SIGN_IN_PATH = Resource.PATH.getProperty("path.signin");
public static final String REGISTER_PATH = Resource.PATH.getProperty("path.register");
public static final String HOME_PATH = Resource.PATH.getProperty("path.home");
public static final String PERIODICAL_PATH = Resource.PATH.getProperty("path.periodical");
public static final String CATALOG_PATH = Resource.PATH.getProperty("path.catalog");
public static final String SEARCH_PATH = Resource.PATH.getProperty("path.fulltext.search");
public static final String PROFILE_PATH = Resource.PATH.getProperty("path.profile");
public static final String SIGN_OUT_PATH = Resource.PATH.getProperty("path.signout");
public static final String BIN_PATH = Resource.PATH.getProperty("path.bin");
public static final String BIN_ADD_ITEM_PATH = Resource.PATH.getProperty("path.bin.add.item");
public static final String BIN_REMOVE_ITEM_PATH = Resource.PATH.getProperty("path.bin.remove.item");
public static final String BIN_REMOVE_ALL_ITEM_PATH = Resource.PATH.getProperty("path.bin.remove.all.item");
public static final String BIN_SUBSCRIPTION_PAYMENT_PATH = Resource.PATH.getProperty("path.bin.subscription.payment");
public static final String SUBSCRIPTIONS_PATH = Resource.PATH.getProperty("path.user.subscriptions");
public static final String ADMIN_CATALOG_PATH = Resource.PATH.getProperty("path.admin.catalog");
public static final String CREATE_PERIODICAL_PATH = Resource.PATH.getProperty("path.admin.catalog.periodical.create");
public static final String ADD_PUBLISHER_PATH = Resource.PATH.getProperty("path.admin.catalog.publisher.add");
public static final String EDIT_PERIODICAL_PATH = Resource.PATH.getProperty("path.admin.catalog.periodical.edit");
public static final String CHANGE_STATUS_PERIODICAL_PATH = Resource.PATH.getProperty("path.admin.catalog.change.status");
public static final String PAYMENTS_PATH = Resource.PATH.getProperty("path.admin.payments");
public static final String PAYMENT_OVERVIEW_PATH = Resource.PATH.getProperty("path.admin.payment");
public static final String USER_PATH = Resource.PATH.getProperty("path.admin.user");
public static final String ERROR_PATH = Resource.PATH.getProperty("path.error");
private PagesPath() {
}
}
| [
"[email protected]"
] | |
7cb90d9a39af9377f6cd2ca9ed17e40e3358df70 | 5e4806e13b1632d16e08215d66541cd99ddda032 | /flow-tests/test-v14-bootstrap/src/main/java/com/vaadin/flow/pwatest/ui/ParentLayout.java | c5953147397fcd4c6f9a79f52540a05ebb254b5c | [
"Apache-2.0"
] | permissive | rudiejd/flow | c99516849cdf68f122006c3cfbd6ac1a790a86bb | e54cd09e97552e3ba098eb5dfb7825cf3fec0108 | refs/heads/master | 2023-07-05T02:06:13.234236 | 2021-07-30T16:55:56 | 2021-07-30T16:55:56 | 390,061,633 | 0 | 0 | Apache-2.0 | 2021-07-27T16:56:31 | 2021-07-27T16:56:31 | null | UTF-8 | Java | false | false | 1,123 | java | /*
* Copyright 2000-2021 Vaadin Ltd.
*
* 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.vaadin.flow.pwatest.ui;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.page.AppShellConfigurator;
import com.vaadin.flow.router.RouterLayout;
import com.vaadin.flow.server.PWA;
@PWA(name = ParentLayout.PWA_NAME, shortName = ParentLayout.PWA_SHORT_NAME)
public class ParentLayout extends Div
implements RouterLayout, AppShellConfigurator {
static final String PWA_NAME = "PWA test name";
static final String PWA_SHORT_NAME = "PWA";
public ParentLayout() {
}
}
| [
"[email protected]"
] | |
09c8559e8436ca0ebf54a54381ab86bdb3515567 | a66f3ee4d1b7e90f5f83f9afe970d0a57dc8e4e2 | /labbook-6/src/com/LabBook6/Ex2CountChar.java | 6234f49e83d11baeb84e45e1f583155559ffadd1 | [] | no_license | architabhatia/Labbook | 5b8ebeaae3397f1328764e8690b097e1730da592 | 1dfc8dd870fa24d4b6d84fa68e832a7612f02000 | refs/heads/main | 2023-04-22T04:10:56.005091 | 2021-05-10T11:19:55 | 2021-05-10T11:19:55 | 358,113,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 817 | java | package com.LabBook6;
import java.util.HashMap;
import java.util.Scanner;
public class Ex2CountChar {
static void countChars(char[] ch) {
HashMap<Character, Integer> charCountMap = new HashMap<Character, Integer>();
for (char c : ch)
{
if(charCountMap.containsKey(c))
{
charCountMap.put(c, charCountMap.get(c)+1);
}
else
{
charCountMap.put(c, 1);
}
}
System.out.println(charCountMap);
}
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
System.out.println("enter the characters");
String s=sc.nextLine();
sc.close();
countChars(s.toCharArray());
}
} | [
"[email protected]"
] | |
537e720253d5a7a97dc2d17a64972315800f0428 | 985b30ade6bb55358b925df6a2b7855ff5c3ae0d | /zenodot-tests/test/dd/kms/zenodot/tests/common/AbstractTest.java | a2a34e42b026c3e66d44f51cb66a7a73fd5e2be4 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"MIT"
] | permissive | tbrunsch/Zenodot | cc38f2793a9b3f761fab5ffa9607a7ab596fae44 | 2036f311e2e548f77f9ad56ae8cf44bdc2e5c74f | refs/heads/master | 2023-06-27T14:51:22.227490 | 2023-06-21T21:21:54 | 2023-06-21T21:30:12 | 227,767,280 | 0 | 0 | MIT | 2023-06-21T21:05:56 | 2019-12-13T05:57:29 | Java | UTF-8 | Java | false | false | 2,910 | java | package dd.kms.zenodot.tests.common;
import com.google.common.collect.ImmutableList;
import dd.kms.zenodot.api.Variables;
import dd.kms.zenodot.api.common.AccessModifier;
import dd.kms.zenodot.api.debug.ParserConsoleLogger;
import dd.kms.zenodot.api.debug.ParserLogger;
import dd.kms.zenodot.api.settings.EvaluationMode;
import dd.kms.zenodot.api.settings.ObjectTreeNode;
import dd.kms.zenodot.api.settings.ParserSettingsBuilder;
import dd.kms.zenodot.impl.debug.ParserLoggers;
import org.junit.Assert;
import java.util.Arrays;
/**
* This test uses {@link EvaluationMode#STATIC_TYPING} by default.
*/
public class AbstractTest<T extends AbstractTest>
{
public static final boolean SKIP_UNSTABLE_TESTS = "true".equalsIgnoreCase(System.getProperty("skipUnstableTests"));
protected final Object testInstance;
protected final ParserSettingsBuilder settingsBuilder = ParserSettingsBuilder.create()
.minimumAccessModifier(AccessModifier.PRIVATE)
.evaluationMode(EvaluationMode.STATIC_TYPING);
protected final Variables variables = Variables.create();
private boolean stopAtError = false;
private boolean printLogEntriesAtError = false;
protected AbstractTest(Object testInstance) {
this.testInstance = testInstance;
}
public void createVariable(String name, Object value, boolean isFinal) {
variables.createVariable(name, value, isFinal);
}
public void minimumAccessModifier(AccessModifier minimumAccessModifier) {
settingsBuilder.minimumAccessModifier(minimumAccessModifier);
}
public void importClasses(String... classNames) {
try {
settingsBuilder.importClassesByName(Arrays.asList(classNames));
} catch (ClassNotFoundException e) {
Assert.fail("ClassNotFoundException: " + e.getMessage());
}
}
public void importPackages(String... packageNames) {
settingsBuilder.importPackages(Arrays.asList(packageNames));
}
public void customHierarchyRoot(ObjectTreeNode root) {
settingsBuilder.customHierarchyRoot(root);
}
public void evaluationMode(EvaluationMode evaluationMode) {
settingsBuilder.evaluationMode(evaluationMode);
}
public void enableConsideringAllClassesForClassCompletions() {
settingsBuilder.considerAllClassesForClassCompletions(true);
}
public void stopAtError() {
stopAtError = true;
}
public void printLogEntriesAtError() {
printLogEntriesAtError = true;
}
protected ParserLogger prepareLogger(boolean printToConsole, int numLoggedEntriesToStopAfter) {
ParserLogger logger = printToConsole
? new ParserConsoleLogger().printNumberOfLoggedEntries(true)
: ParserLoggers.createNullLogger();
logger.stopAfter(numLoggedEntriesToStopAfter);
settingsBuilder.logger(logger);
return logger;
}
protected boolean isStopAtError() {
return stopAtError;
}
protected boolean isPrintLogEntriesAtError() {
return printLogEntriesAtError;
}
}
| [
"[email protected]"
] | |
796b7c6f5e7f6a0d60f63918d98a1ea02200db01 | 86cf61187d22b867d1e5d3c8a23d97e806636020 | /src/main/java/base/operators/operator/nlp/word2vec/core/domain/Neuron.java | 6e311a6c830d3ec41463cc1380b2c80fd82cd34d | [] | no_license | hitaitengteng/abc-pipeline-engine | f94bb3b1888ad809541c83d6923a64c39fef9b19 | 165a620b94fb91ae97647135cc15a66d212a39e8 | refs/heads/master | 2022-02-22T18:49:28.915809 | 2019-10-27T13:40:58 | 2019-10-27T13:40:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 497 | java | package base.operators.operator.nlp.word2vec.core.domain;
public abstract class Neuron implements Comparable<Neuron> {
public double freq;
public Neuron parent;
public int code;
// 语料预分类
public int category = -1;
@Override
public int compareTo(Neuron neuron) {
if (this.category == neuron.category) {
if (this.freq > neuron.freq) {
return 1;
} else {
return -1;
}
} else if (this.category > neuron.category) {
return 1;
} else {
return -1;
}
}
}
| [
"[email protected]"
] | |
2fa9530b8a9569ab9303c450f2d65d63f14f4ce9 | 6fa7a245b15f8aef1878f82a1a54ca76aef5ccd4 | /src/memory/Gracz.java | 2cf5a769a232d29ca191d2b7417f820738a28b23 | [] | no_license | Mateusz530/Memory | 2618fba037b8412ae981308467f26a75db04eeb9 | b05aadc567c2921abc513b0d5278a40ba35a5244 | refs/heads/master | 2020-06-22T05:33:21.272409 | 2019-07-18T19:36:50 | 2019-07-18T19:36:50 | 197,644,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 814 | java | package memory;
import java.io.Serializable;
public class Gracz implements Serializable, Comparable<Gracz> {
String nick;
String czas;
int rozmiar;
Integer punkty;
public Gracz(){
}
public Gracz(String nick, String czas, int rozmiar, Integer punkty){
this.nick = nick;
this.czas = czas;
this.rozmiar = rozmiar;
this.punkty = punkty;
}
public String toString(){
return nick + " (Czas: " + czas + ", rozmiar: " + rozmiar + "x" + rozmiar + ", memory.Wynik: " + punkty + "pkt)";
}
@Override
public int compareTo(Gracz o) {
int compare = this.punkty.compareTo(o.punkty);
if(compare > 0) return -1;
if(compare < 0) return 1;
return 0;
}
}
| [
"[email protected]"
] | |
d8f894275eaba611a0c32fb143c86ba8b27698ce | c7ffea75dee67125f76983a822195fa834ce47f6 | /faza-3/UnitTest.java | 4b3b7369f45982e6d0dded2e38e2054a29aab4d5 | [] | no_license | vrusi/blockchain | 06b625c175185e463ac83c0fce00e9fc675ff90b | ac755e77aac6f9f4cb2d1527aa26a1332efe349c | refs/heads/master | 2023-03-25T01:17:40.833510 | 2021-03-24T15:32:16 | 2021-03-24T15:32:16 | 346,499,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 96 | java | import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class UnitTest {
}
| [
"[email protected]"
] | |
434685153cc21320df96a777948f282356ff7d19 | aeef9545afa2b124cb7efdd8654979855ef65900 | /src/main/java/io/microservices/sellersService/controllers/SellersController.java | cfeeaeba71aa16ea99a96851b9c07380c26f59bb | [] | no_license | YoussefJAMOURE/-Microservices-Service-Sellers | 4cf6f4af99484bf805f1f5d1c19453569274ffe1 | a885d7ac1b188d3db3cfbf6d59cdc64e1b4fab68 | refs/heads/master | 2020-07-12T17:22:23.422834 | 2019-09-04T16:38:56 | 2019-09-04T16:38:56 | 204,872,194 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 769 | java | package io.microservices.sellersService.controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.microservices.sellersService.beans.Seller;
import io.microservices.sellersService.repositories.SellersRepository;
@RestController
@RequestMapping("sellersWS")
public class SellersController {
@Autowired
SellersRepository sellersRepo;
@GetMapping(value = "/isUp")
public String isUp(){
return "Yeah it is !";
}
@GetMapping(value = "/getAll")
public List<Seller> getAllSellers(){
return sellersRepo.findAll();
}
}
| [
"[email protected]"
] | |
ce5edaa2f787198c04a8c6145cb2d1a606a5274e | b28ddf16c4799152e580efcde3eb57de42420f83 | /src/com/hibernatetutorial/part03/crud/dao/EmployeeDAO.java | 1975154d15837afe1fe7311c5658e7174562701c | [] | no_license | tutkuince/HibernateTutorial | eb34e911199816484afd6fa37bf2f94622743c96 | 068fb6e6fd7d8a5fc619c443f066478b2fc735dd | refs/heads/master | 2020-03-07T11:22:53.090993 | 2018-05-09T11:15:56 | 2018-05-09T11:15:56 | 127,454,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package com.muditasoft.dao;
import java.util.List;
import com.muditasoft.model.Employee;
public interface EmployeeDAO {
void insert(Employee employee);
Employee getById(int id);
List<Employee> getAll();
void update(int id);
void delete(int id);
}
| [
"[email protected]"
] | |
01b1538b37cd57d33cd693f145842ff8a3268ffd | e33d289f3e78263eedc7f5ea92695acab91ab318 | /OpenglDemo/src/com/cdm/opengl/activity/Sample6/Sample6_5_Activity.java | 073d958cd3e83bd25cb97ba2b4a62faed840cf8e | [] | no_license | iflove/android_apps_gallery | 3ca69894e3f247965c4cd794d267c0137317efa0 | 8441785b8f1816658c085370a6e7420137023100 | refs/heads/master | 2023-03-17T06:20:56.235895 | 2015-04-08T11:20:16 | 2015-04-08T11:20:16 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,848 | java | package com.cdm.opengl.activity.Sample6;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import com.cdm.opengl.R;
import com.cdm.opengl.view.Sample6.MySurfaceView6_5;
public class Sample6_5_Activity extends Activity {
private MySurfaceView6_5 mGLSurfaceView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 设置为全屏
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//设置为横屏
// 初始化GLSurfaceView
mGLSurfaceView = new MySurfaceView6_5(this);
// 切换到主界面
setContentView(R.layout.main6_3);
LinearLayout ll = (LinearLayout) findViewById(R.id.main_liner6_3);
ll.addView(mGLSurfaceView);
SeekBar sb=(SeekBar)this.findViewById(R.id.SeekBar6_3);
sb.setOnSeekBarChangeListener(
new SeekBar.OnSeekBarChangeListener()
{
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
mGLSurfaceView.setLightOffset((seekBar.getMax()/2.0f-progress)/(seekBar.getMax()/2.0f)*-4);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) { }
@Override
public void onStopTrackingTouch(SeekBar seekBar) { }
}
);
}
@Override
protected void onResume() {
super.onResume();
mGLSurfaceView.onResume();
}
@Override
protected void onPause() {
super.onPause();
mGLSurfaceView.onPause();
}
} | [
"[email protected]"
] | |
277ab396aaa2f2a65114ca92952cdecaae6db89c | 9a9f8bfc04c39aa9e9008ded5e3eb4d1fb018aa6 | /src/com/collection/methods/EmployeeManagement.java | 8862bc39dbe1ecf77e79e6eb04c64dd385234ef5 | [] | no_license | amrendrabagga/Task-4-30-aug-19 | 77559ef0c0e4b0205bfe1d93f7ff66df40028b6b | 89c4454a2f19391f9cae06a3366cf9f8f33cd9bb | refs/heads/master | 2020-07-14T23:44:50.331067 | 2019-08-30T17:41:09 | 2019-08-30T17:41:09 | 205,429,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,341 | java | package com.collection.methods;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class EmployeeManagement {
public static void main(String args[]) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int i = 1;
ArrayList<Employee> empList = new ArrayList<>();
while (i != 0) {
System.out.println("OPTIONS");
System.out.println("=============================================================");
System.out.println("1. ADD EMPLOYEE");
System.out.println("2. VIEW EMPLOYEES");
System.out.println("3. REMOVE EMPLOYEE");
System.out.println("4. CLEAR DATA");
System.out.println("5. CHANGE SALARY");
System.out.println("6. SEARCH EMPLOYEE");
System.out.println("7. VIEW DEPARTMENT WISE LIST");
System.out.println("8. EXIT");
int input = Integer.parseInt(reader.readLine());
if (input == 8)
System.exit(0);
switch (input) {
case 1:
System.out.println("ENTER EMPLOYEE DETAILS - ");
System.out.println("ENTER ENO ");
int eno = Integer.parseInt(reader.readLine());
System.out.println("ENTER ENAME ");
String ename = reader.readLine();
System.out.println("ENTER SALARY ");
long salary = Integer.parseInt(reader.readLine());
System.out.println("ENTER DESIGNATION ");
String designation = reader.readLine();
System.out.println("ENTER DEPARTMENT NAME ");
String dept = reader.readLine();
Employee emp = new Employee(eno, ename, salary, designation, dept);
empList.add(emp);
System.out.println(emp);
System.out.println("EMPLOYEE ADDED SUCCESSFULLY");
break;
case 2:
if (empList.size() != 0) {
for (Employee e : empList) {
System.out.println(e);
}
} else
System.out.println("NO DATA PRESENT");
break;
case 3:
System.out.println("ENTER ENO ");
int eno1 = Integer.parseInt(reader.readLine());
empList.removeIf(x -> x.getEno() == eno1);
System.out.println("EMPLOYEE REMOVED SUCCESSFULLY");
break;
case 4:
empList.clear();
System.out.println("DATA REMOVED");
break;
case 5:
System.out.println("ENTER ENO AND NEW SALARY ");
int eno2 = Integer.parseInt(reader.readLine());
long newSalary = Long.parseLong(reader.readLine());
Employee fetchEmp = empList.stream().filter(x -> x.getEno() == eno2).findFirst().orElse(null);
if (fetchEmp != null) {
fetchEmp.setSalary(newSalary);
System.out.println("SALARY CHANGED SUCCESSFULLY");
} else
System.out.println("NO SUCH ENO FOUND");
break;
case 6:
System.out.println("ENTER ENO ");
int eno3 = Integer.parseInt(reader.readLine());
empList.stream().filter(x -> x.getEno() == eno3).forEach(x -> System.out.println(x));
break;
case 7:
System.out.println("ENTER DEPARTMENT NAME ");
String dept1 = reader.readLine();
Map<String, List<Employee>> deptWiseEmployee = empList.stream().filter(x -> x.getDept().equals(dept1))
.collect(Collectors.groupingBy(x -> x.getDept(), Collectors.toList()));
deptWiseEmployee.forEach((k, v) -> System.out.println(k + " ->" + v));
break;
}
}
reader.close();
}
}
| [
"[email protected]"
] | |
654f4a2ef09b61d40b2e1407b4e2a0386d059445 | 037c46361f3d77a7af36f99437d0ae5ed1a17714 | /pangjiao/src/main/java/com/pxy/pangjiao/compiler/mpv/MvpCompiler.java | 08099a8338661e05e7f0612a9ab11756c6d307a7 | [] | no_license | xinyupu/pangjiao | 293e9f8b3782bbf3d33eaef24c296e3f3a82ec47 | 3cd7c0cb1fb460ff7efc1f04ac74c5a4c25af6f5 | refs/heads/master | 2021-04-09T10:16:48.366639 | 2018-08-04T08:50:07 | 2018-08-04T08:50:07 | 125,300,723 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,853 | java | package com.pxy.pangjiao.compiler.mpv;
import com.pxy.pangjiao.compiler.mpv.annotation.Autowire;
import com.pxy.pangjiao.compiler.mpv.annotation.AutowireProxy;
import com.pxy.pangjiao.compiler.mpv.annotation.DataField;
import com.pxy.pangjiao.compiler.mpv.annotation.Presenter;
import com.pxy.pangjiao.compiler.mpv.annotation.Service;
import com.pxy.pangjiao.compiler.mpv.annotation.ViewData;
import com.pxy.pangjiao.compiler.mpv.annotation.Views;
import com.pxy.pangjiao.compiler.mpv.config.AutoWireCompilerConfig;
import com.pxy.pangjiao.compiler.mpv.config.CompilerClassConfig;
import com.pxy.pangjiao.compiler.mpv.config.CompilerFieldConfig;
import com.pxy.pangjiao.compiler.mpv.config.CompilerMethodConfig;
import com.pxy.pangjiao.compiler.mpv.config.IConfig;
import com.pxy.pangjiao.compiler.mpv.config.InterfaceConfig;
import com.pxy.pangjiao.compiler.mpv.config.ViewDataConfig;
import com.pxy.pangjiao.compiler.mpv.config.ViewsConfig;
import com.pxy.pangjiao.compiler.mpv.factory.AutoWireInjectProduct;
import com.pxy.pangjiao.databus.DataEvent;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.MirroredTypeException;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
/**
* Created by pxy on 2018/3/13.
*/
public class MvpCompiler {
private Elements mElementUtils;
private RoundEnvironment env;
private List<IConfig> configs;
private AutoWireInjectProduct injectProduct;
private Map<String, List<InterfaceConfig>> interfaceMaps;
private Map<String, List<AutoWireCompilerConfig>> autoWireConfigMaps;
private Map<String, List<AutoWireCompilerConfig>> autoWireProxyConfigMaps;
private Map<String, ViewsConfig> viewConfigMaps;
public MvpCompiler(RoundEnvironment env, Elements mElementUtils, AutoWireInjectProduct injectProduct) {
this.env = env;
this.mElementUtils = mElementUtils;
this.injectProduct = injectProduct;
configs = new ArrayList<>();
interfaceMaps = new HashMap<>();
autoWireConfigMaps = new HashMap<>();
autoWireProxyConfigMaps = new HashMap<>();
viewConfigMaps = new HashMap<>();
initService();
initPresent();
initViews();
initViewData();
parse(Autowire.class, autoWireConfigMaps);
parse(AutowireProxy.class, autoWireConfigMaps);
initDataEvent();
}
private void initService() {
Set<? extends Element> elements = this.env.getElementsAnnotatedWith(Service.class);
for (Element element : elements) {
if (element.getKind() == ElementKind.CLASS) {
TypeElement typeElement = (TypeElement) element;
List<? extends TypeMirror> interfaces = typeElement.getInterfaces();
for (TypeMirror type : interfaces) {
String interfaceName = type.toString();
if (interfaceMaps.get(interfaceName) == null) {
List<InterfaceConfig> interfaceList = new ArrayList<>();
interfaceList.add(new InterfaceConfig(interfaceName, typeElement.toString()));
interfaceMaps.put(interfaceName, interfaceList);
} else {
List<InterfaceConfig> interfaceConfigs = interfaceMaps.get(interfaceName);
interfaceConfigs.add(new InterfaceConfig(interfaceName, typeElement.toString()));
}
}
CompilerClassConfig beanConfig = new CompilerClassConfig(element, Service.class, mElementUtils);
configs.add(beanConfig);
}
}
}
private void initViewData(){
Set<? extends Element> elements = this.env.getElementsAnnotatedWith(ViewData.class);
for (Element element:elements){
if (element.getKind() == ElementKind.CLASS){
TypeElement typeElement = (TypeElement) element;
ViewData annotation = typeElement.getAnnotation(ViewData.class);
// TypeMirror viewDataClass = getViewDataClass(annotation);
// Class[] value = annotation.value();
// new ViewDataConfig(env,element,value);
}else {
throw new RuntimeException("@ViewData must on Type");
}
}
}
private void initPresent() {
Set<? extends Element> elements = this.env.getElementsAnnotatedWith(Presenter.class);
for (Element element : elements) {
if (element.getKind() == ElementKind.CLASS) {
TypeElement typeElement = (TypeElement) element;
List<? extends TypeMirror> interfaces = typeElement.getInterfaces();
for (TypeMirror type : interfaces) {
String interfaceName = type.toString();
if (interfaceMaps.get(interfaceName) == null) {
List<InterfaceConfig> interfaceList = new ArrayList<>();
interfaceList.add(new InterfaceConfig(interfaceName, typeElement.toString()));
interfaceMaps.put(interfaceName, interfaceList);
} else {
List<InterfaceConfig> interfaceConfigs = interfaceMaps.get(interfaceName);
interfaceConfigs.add(new InterfaceConfig(interfaceName, typeElement.toString()));
}
}
CompilerClassConfig beanConfig = new CompilerClassConfig(element, Presenter.class, mElementUtils);
configs.add(beanConfig);
}
}
}
private <T extends Annotation> void parse(Class<T> clsT, Map<String, List<AutoWireCompilerConfig>> map) {
Set<? extends Element> elements = this.env.getElementsAnnotatedWith(clsT);
for (Element element : elements) {
TypeElement typeElement = (TypeElement) element.getEnclosingElement();
Views viewsAnnotation= typeElement.getAnnotation(Views.class);
Service serviceAnnotation = typeElement.getAnnotation(Service.class);
Presenter presenterAnnotation = typeElement.getAnnotation(Presenter.class);
if (viewsAnnotation==null&&serviceAnnotation==null&&presenterAnnotation==null){
throw new NullPointerException("\n"+typeElement.asType().toString()+" must add @Views or @Service or @Presenter");
}
if (element.getKind() != ElementKind.FIELD) {
throw new IllegalArgumentException(String.format("Only FIELD can be annotated with @%s",
clsT.getSimpleName()));
}
T annotation = element.getAnnotation(clsT);
TypeMirror autowireImp = null;
if (clsT == Autowire.class) {
autowireImp = getAutowireImp((Autowire) annotation);
} else if (clsT == AutowireProxy.class) {
autowireImp = getAutowireImp((AutowireProxy) annotation);
}
String autoWireClassName = "";
if (null != autowireImp) {
autoWireClassName = autowireImp.toString();
}
VariableElement fieldElement = (VariableElement) element;
List<AutoWireCompilerConfig> configLists = map.get(typeElement.asType().toString());
String fieldTypeClassName = fieldElement.asType().toString();
AutoWireCompilerConfig compilerConfig = new AutoWireCompilerConfig();
compilerConfig.setFieldName(element.getSimpleName().toString());
compilerConfig.setAutoFieldClassName(element.toString());
compilerConfig.setSimpleName(element.getSimpleName());
compilerConfig.setFieldName(element.getSimpleName().toString());
compilerConfig.setAutoFieldClassName(fieldTypeClassName);
if (configLists == null) {
configLists = new ArrayList<>();
pareAutoWire(fieldTypeClassName, compilerConfig, autoWireClassName);
configLists.add(compilerConfig);
map.put(typeElement.asType().toString(), configLists);
} else {
pareAutoWire(fieldTypeClassName, compilerConfig, autoWireClassName);
configLists.add(compilerConfig);
}
CompilerFieldConfig beanConfig = new CompilerFieldConfig(element, clsT);
configs.add(beanConfig);
}
}
private void pareAutoWire(String fieldTypeClassName, AutoWireCompilerConfig compilerConfig, String autoWireClassName) {
List<InterfaceConfig> interfaceConfigs = interfaceMaps.get(fieldTypeClassName);
if (interfaceConfigs != null && interfaceConfigs.size() > 0) {
compilerConfig.setInterface(true);
List<String> interfaceImp = new ArrayList<>();
for (InterfaceConfig config : interfaceConfigs) {
interfaceImp.add(config.getInterfaceImpClassName());
}
if (!autoWireClassName.equals("java.lang.Void")) {
if (interfaceImp.contains(autoWireClassName)) {
compilerConfig.setAutoFieldClassImpName(autoWireClassName);
} else if (!autoWireClassName.equals("java.lang.Void")) {
throw new NullPointerException(String.format("\ncause by:\n"+"not add @Service or @Presenter on %s",
autoWireClassName));
}
} else {
compilerConfig.setAutoFieldClassImpName(interfaceConfigs.get(0).getInterfaceImpClassName());
}
} else {
compilerConfig.setInterface(false);
}
}
private void initViews() {
Set<? extends Element> elements = this.env.getElementsAnnotatedWith(Views.class);
for (Element element : elements) {
CompilerClassConfig compilerClassConfig = new CompilerClassConfig(element, Views.class, mElementUtils);
String typeName = compilerClassConfig.getType().toString();
if (viewConfigMaps.get(typeName) == null) {
ViewsConfig viewsConfig = new ViewsConfig();
viewsConfig.setClassName(typeName);
viewConfigMaps.put(typeName, viewsConfig);
}
}
}
private void initDataEvent() {
Set<? extends Element> elements = this.env.getElementsAnnotatedWith(DataEvent.class);
for (Element element : elements) {
CompilerMethodConfig beanConfig = new CompilerMethodConfig(element, DataEvent.class);
configs.add(beanConfig);
}
}
public List<IConfig> getConfigs() {
return configs;
}
public Map<String, List<AutoWireCompilerConfig>> getAutoWireConfigMaps() {
return autoWireConfigMaps;
}
public Map<String, List<AutoWireCompilerConfig>> getAutoWireProxyConfigMaps() {
return autoWireProxyConfigMaps;
}
public Map<String, ViewsConfig> getViewConfigMaps() {
return viewConfigMaps;
}
private TypeMirror getAutowireImp(Autowire annotation) {
try {
annotation.imp();
} catch (MirroredTypeException mte) {
return mte.getTypeMirror();
}
return null;
}
private TypeMirror getAutowireImp(AutowireProxy annotation) {
try {
annotation.imp();
} catch (MirroredTypeException mte) {
return mte.getTypeMirror();
}
return null;
}
}
| [
"[email protected]"
] | |
45aea828373af16c8d8d06e86da20808bfc278c1 | 205d18401445f4bb5e955e270b0f072202b0ec22 | /api/src/main/java/de/learnlib/api/oracle/SingleQueryOmegaOracle.java | c81a1dba31c8f9d64197cc74ed665d942cd31a33 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | damascenodiego/learnlib | b56d07bb904a9b6a770496e09bac687304dee053 | 09b7f505bcee188efe4605a038536a36a2e4c98c | refs/heads/develop | 2021-06-04T12:26:36.840535 | 2018-11-26T19:02:56 | 2018-11-26T19:02:56 | 159,353,246 | 0 | 0 | Apache-2.0 | 2021-02-18T09:46:00 | 2018-11-27T15:02:47 | Java | UTF-8 | Java | false | false | 1,748 | java | /* Copyright (C) 2013-2018 TU Dortmund
* This file is part of LearnLib, http://www.learnlib.de/.
*
* 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 de.learnlib.api.oracle;
import java.util.Collection;
import de.learnlib.api.query.OmegaQuery;
import net.automatalib.commons.util.Pair;
import net.automatalib.words.Word;
/**
* An {@link OmegaMembershipOracle} that answers single queries.
*
* @author Jeroen Meijer
*
* @see OmegaMembershipOracle
* @see SingleQueryOracle
*/
public interface SingleQueryOmegaOracle<S, I, D> extends OmegaMembershipOracle<S, I, D> {
@Override
default void processQuery(OmegaQuery<I, D> query) {
Pair<D, Integer> output = answerQuery(query.getPrefix(), query.getLoop(), query.getRepeat());
query.answer(output.getFirst(), output.getSecond());
}
@Override
default void processQueries(Collection<? extends OmegaQuery<I, D>> queries) {
queries.forEach(this::processQuery);
}
interface SingleQueryOmegaOracleDFA<S, I> extends SingleQueryOmegaOracle<S, I, Boolean>, DFAOmegaMembershipOracle<S, I> {}
interface SingleQueryOmegaOracleMealy<S, I, O> extends SingleQueryOmegaOracle<S, I, Word<O>>, MealyOmegaMembershipOracle<S, I, O> {}
}
| [
"[email protected]"
] | |
4df589b023bf95d28fbf9f39637adecddd304b02 | 77a788678ba5c1c42fdb7372850732fadd81382e | /Servidor/branches/PruebasHibernateCasino/src/Beans/Partidas.java | ef3115d41115b8e27e235a8fe60afa9791c6e799 | [] | no_license | gruize/is0809casino | 6165c60402f498ac219e9cdfb37af8abdd698009 | 10637627c5e153bb376362c59b47514e665bc136 | refs/heads/master | 2021-01-19T11:20:53.909460 | 2009-05-28T07:01:09 | 2009-05-28T07:01:09 | 40,656,814 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,773 | java | package Beans;
// Generated 09-mar-2009 10:54:47 by Hibernate Tools 3.2.1.GA
import java.util.HashSet;
import java.util.Set;
/**
* Partidas generated by hbm2java
*/
public class Partidas implements java.io.Serializable {
private int codigo;
private Mesas mesas;
private int numjugadores;
private int ganador;
private Set clienteses = new HashSet(0);
public Partidas() {
}
public Partidas(int codigo, Mesas mesas, int numjugadores, int ganador) {
this.codigo = codigo;
this.mesas = mesas;
this.numjugadores = numjugadores;
this.ganador = ganador;
}
public Partidas(int codigo, Mesas mesas, int numjugadores, int ganador, Set clienteses) {
this.codigo = codigo;
this.mesas = mesas;
this.numjugadores = numjugadores;
this.ganador = ganador;
this.clienteses = clienteses;
}
public int getCodigo() {
return this.codigo;
}
public void setCodigo(int codigo) {
this.codigo = codigo;
}
public Mesas getMesas() {
return this.mesas;
}
public void setMesas(Mesas mesas) {
this.mesas = mesas;
}
public int getNumjugadores() {
return this.numjugadores;
}
public void setNumjugadores(int numjugadores) {
this.numjugadores = numjugadores;
}
public int getGanador() {
return this.ganador;
}
public void setGanador(int ganador) {
this.ganador = ganador;
}
public Set getClienteses() {
return this.clienteses;
}
public void setClienteses(Set clienteses) {
this.clienteses = clienteses;
}
}
| [
"asct86@cc0f0ba8-a479-11dd-a8c6-677c70d10fe4"
] | asct86@cc0f0ba8-a479-11dd-a8c6-677c70d10fe4 |
8b3b5b98ab71b02c5c366172fdbce8170c1a5a7d | 79d69c2b5a4cf453c1469439dcda327da1252bbd | /BasicNeuralNetworkStandardLibs.java | 906d9c454f8e5e8e596225caff5880a1af930e88 | [] | no_license | laasan/ML_in_java | cf98fe275b88a6fbd01a0b1db62711f988c89640 | 4adae7900fd30b48b85dcd293f4271634ba968bd | refs/heads/master | 2021-09-08T04:46:08.146047 | 2018-03-07T07:26:02 | 2018-03-07T07:26:02 | 123,408,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,562 | java | /*
basic neural network using standard Java libraries
*/
public class BasicNeuralNetworkStandardLibs {
double errors;
int inputNeurons;
int outputNeurons;
int hiddenNeurons;
int totalNeurons;
int weights;
double learningRate;
double outputResults[];
double resultsMatrix[];
double lastErrors[];
double changes[];
double thresholds[];
double weightChanges[];
double allThresholds[];
double threshChanges[];
double momentum;
double errorChanges[];
public BasicNeuralNetworkStandardLibs(int inputCount,
int hiddenCount,
int outputCount,
double learnRate,
double momentum) {
learningRate = learnRate;
momentum = momentum;
inputNeurons = inputCount;
hiddenNeurons = hiddenCount;
outputNeurons = outputCount;
totalNeurons = inputCount + hiddenCount + outputCount;
weights = (inputCount * hiddenCount)
+ (hiddenCount * outputCount);
outputResults = new double[totalNeurons];
resultsMatrix = new double[weights];
weightChanges = new double[weights];
thresholds = new double[totalNeurons];
errorChanges = new double[totalNeurons];
lastErrors = new double[totalNeurons];
allThresholds = new double[totalNeurons];
changes = new double[weights];
threshChanges = new double[totalNeurons];
reset();
}
public void reset() {
int loc;
for (loc = 0; loc < totalNeurons; loc++) {
thresholds[loc] = 0.5 - (Math.random());
threshChanges[loc] = 0;
allThresholds[loc] = 0;
}
for (loc = 0; loc < resultsMatrix.length; loc++) {
resultsMatrix[loc] = 0.5 - (Math.random());
weightChanges[loc] = 0;
changes[loc] = 0;
}
}
public double threshold(double sum) {
return 1.0 / (1 + Math.exp(-1.0 * sum));
}
public double[] calcOutput(double input[]) {
int loc, pos;
final int hiddenIndex = inputNeurons;
final int outIndex = inputNeurons + hiddenNeurons;
for (loc = 0; loc < inputNeurons; loc++) {
outputResults[loc] = input[loc];
}
int rLoc = 0;
for (loc = hiddenIndex; loc < outIndex; loc++) {
double sum = thresholds[loc];
for (pos = 0; pos < inputNeurons; pos++) {
sum += outputResults[pos] * resultsMatrix[rLoc++];
}
outputResults[loc] = threshold(sum);
}
double result[] = new double[outputNeurons];
for (loc = outIndex; loc < totalNeurons; loc++) {
double sum = thresholds[loc];
for (pos = hiddenIndex; pos < outIndex; pos++) {
sum += outputResults[pos] * resultsMatrix[rLoc++];
}
outputResults[loc] = threshold(sum);
result[loc-outIndex] = outputResults[loc];
}
return result;
}
public void calcError(double ideal[]) {
int loc, pos;
final int hiddenIndex = inputNeurons;
final int outputIndex = inputNeurons + hiddenNeurons;
for (loc = inputNeurons; loc < totalNeurons; loc++) {
lastErrors[loc] = 0;
}
for (loc = outputIndex; loc < totalNeurons; loc++) {
lastErrors[loc] = ideal[loc - outputIndex] -
outputResults[loc];
errors += lastErrors[loc] * lastErrors[loc];
errorChanges[loc] = lastErrors[loc] * outputResults[loc]
* (1 - outputResults[loc]);
}
int locx = inputNeurons * hiddenNeurons;
for (loc = outputIndex; loc < totalNeurons; loc++) {
for (pos = hiddenIndex; pos < outputIndex; pos++) {
changes[locx] += errorChanges[loc] *
outputResults[pos];
lastErrors[pos] += resultsMatrix[locx] *
errorChanges[loc];
locx++;
}
allThresholds[loc] += errorChanges[loc];
}
for (loc = hiddenIndex; loc < outputIndex; loc++) {
errorChanges[loc] = lastErrors[loc] *outputResults[loc]
* (1 - outputResults[loc]);
}
locx = 0;
for (loc = hiddenIndex; loc < outputIndex; loc++) {
for (pos = 0; pos < hiddenIndex; pos++) {
changes[locx] += errorChanges[loc] *
outputResults[pos];
lastErrors[pos] += resultsMatrix[locx] *
errorChanges[loc];
locx++;
}
allThresholds[loc] += errorChanges[loc];
}
}
public double getError(int len) {
double err = Math.sqrt(errors / (len * outputNeurons));
errors = 0;
return err;
}
public void train() {
int loc;
for (loc = 0; loc < resultsMatrix.length; loc++) {
weightChanges[loc] = (learningRate * changes[loc]) +
(momentum * weightChanges[loc]);
resultsMatrix[loc] += weightChanges[loc];
changes[loc] = 0;
}
for (loc = inputNeurons; loc < totalNeurons; loc++) {
threshChanges[loc] = learningRate * allThresholds[loc] +
(momentum * threshChanges[loc]);
thresholds[loc] += threshChanges[loc];
allThresholds[loc] = 0;
}
}
public static void main(String[] args){
double xorIN[][] ={
{0.0,0.0},
{1.0,0.0},
{0.0,1.0},
{1.0,1.0}};
double xorEXPECTED[][] = { {0.0},{1.0},{1.0},{0.0}};
BasicNeuralNetworkStandardLibs network = new
BasicNeuralNetworkStandardLibs(2,3,1,0.7,0.9);
for (int runCnt=0;runCnt<10000;runCnt++) {
for (int loc=0;loc<xorIN.length;loc++) {
network.calcOutput(xorIN[loc]);
network.calcError(xorEXPECTED[loc]);
network.train();
}
System.out.println("Trial #" + runCnt + ",Error:" +
network.getError(xorIN.length));
}
}
}
| [
"[email protected]"
] | |
4d2ea4c1fd849a4fc10a65d5a338c20dcc6f5725 | 5d3d78d93c49823a91f5e1e18bd1565893002321 | /src/main/java/org/gwtproject/i18n/shared/cldr/impl/CurrencyList_ru_UA.java | 0535e8257b765bda35669e7adebaac21ab247e5e | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | vegegoku/gwt-i18n-cldr | ecf38343c0448bab21118c8cdc017ed91b628e71 | fdf25c7f898993a50ef9d10fe41ccc44c1ee500f | refs/heads/master | 2021-06-11T05:07:57.695293 | 2020-08-27T08:26:12 | 2020-08-27T08:26:12 | 128,426,644 | 2 | 1 | null | 2020-07-17T17:29:11 | 2018-04-06T17:38:54 | Java | UTF-8 | Java | false | false | 53,016 | java | package org.gwtproject.i18n.shared.cldr.impl;
import java.lang.Override;
import java.lang.String;
import java.util.HashMap;
import javax.annotation.Generated;
import org.gwtproject.i18n.shared.cldr.CurrencyData;
import org.gwtproject.i18n.shared.cldr.CurrencyDataImpl;
@Generated("gwt-cldr-importer : org.gwtproject.tools.cldr.CurrencyListProcessor, CLDR version : release-34")
public class CurrencyList_ru_UA extends CurrencyList_ru {
public CurrencyData getDefault() {
return new CurrencyDataImpl("UAH","грн.",2,"грн.","грн.");
}
protected HashMap<String, CurrencyData> loadCurrencyMap() {
HashMap<String,CurrencyData> result = super.loadCurrencyMap();
// Андоррская песета
result.put("ADP", new CurrencyDataImpl("ADP","ADP",128,"ADP","ADP"));
// дирхам ОАЭ
result.put("AED", new CurrencyDataImpl("AED","AED",2,"AED","AED"));
// Афгани (1927–2002)
result.put("AFA", new CurrencyDataImpl("AFA","AFA",130,"AFA","AFA"));
// афгани
result.put("AFN", new CurrencyDataImpl("AFN","AFN",0,"AFN","AFN"));
// ALK
result.put("ALK", new CurrencyDataImpl("ALK","ALK",130,"ALK","ALK"));
// албанский лек
result.put("ALL", new CurrencyDataImpl("ALL","ALL",0,"ALL","ALL"));
// армянский драм
result.put("AMD", new CurrencyDataImpl("AMD","AMD",2,"AMD","AMD"));
// нидерландский антильский гульден
result.put("ANG", new CurrencyDataImpl("ANG","ANG",2,"ANG","ANG"));
// ангольская кванза
result.put("AOA", new CurrencyDataImpl("AOA","AOA",2,"AOA","AOA"));
// Ангольская кванза (1977–1990)
result.put("AOK", new CurrencyDataImpl("AOK","AOK",130,"AOK","AOK"));
// Ангольская новая кванза (1990–2000)
result.put("AON", new CurrencyDataImpl("AON","AON",130,"AON","AON"));
// Ангольская кванза реюстадо (1995–1999)
result.put("AOR", new CurrencyDataImpl("AOR","AOR",130,"AOR","AOR"));
// Аргентинский аустрал
result.put("ARA", new CurrencyDataImpl("ARA","ARA",130,"ARA","ARA"));
// ARL
result.put("ARL", new CurrencyDataImpl("ARL","ARL",130,"ARL","ARL"));
// ARM
result.put("ARM", new CurrencyDataImpl("ARM","ARM",130,"ARM","ARM"));
// Аргентинское песо (1983–1985)
result.put("ARP", new CurrencyDataImpl("ARP","ARP",130,"ARP","ARP"));
// аргентинский песо
result.put("ARS", new CurrencyDataImpl("ARS","ARS",2,"ARS","ARS"));
// Австрийский шиллинг
result.put("ATS", new CurrencyDataImpl("ATS","ATS",130,"ATS","ATS"));
// австралийский доллар
result.put("AUD", new CurrencyDataImpl("AUD","A$",2,"A$","A$"));
// арубанский флорин
result.put("AWG", new CurrencyDataImpl("AWG","AWG",2,"AWG","AWG"));
// Старый азербайджанский манат
result.put("AZM", new CurrencyDataImpl("AZM","AZM",130,"AZM","AZM"));
// азербайджанский манат
result.put("AZN", new CurrencyDataImpl("AZN","AZN",2,"AZN","AZN"));
// Динар Боснии и Герцеговины
result.put("BAD", new CurrencyDataImpl("BAD","BAD",130,"BAD","BAD"));
// конвертируемая марка Боснии и Герцеговины
result.put("BAM", new CurrencyDataImpl("BAM","BAM",2,"BAM","BAM"));
// BAN
result.put("BAN", new CurrencyDataImpl("BAN","BAN",130,"BAN","BAN"));
// барбадосский доллар
result.put("BBD", new CurrencyDataImpl("BBD","BBD",2,"BBD","BBD"));
// бангладешская така
result.put("BDT", new CurrencyDataImpl("BDT","BDT",2,"BDT","BDT"));
// Бельгийский франк (конвертируемый)
result.put("BEC", new CurrencyDataImpl("BEC","BEC",130,"BEC","BEC"));
// Бельгийский франк
result.put("BEF", new CurrencyDataImpl("BEF","BEF",130,"BEF","BEF"));
// Бельгийский франк (финансовый)
result.put("BEL", new CurrencyDataImpl("BEL","BEL",130,"BEL","BEL"));
// Лев
result.put("BGL", new CurrencyDataImpl("BGL","BGL",130,"BGL","BGL"));
// BGM
result.put("BGM", new CurrencyDataImpl("BGM","BGM",130,"BGM","BGM"));
// болгарский лев
result.put("BGN", new CurrencyDataImpl("BGN","BGN",2,"BGN","BGN"));
// BGO
result.put("BGO", new CurrencyDataImpl("BGO","BGO",130,"BGO","BGO"));
// бахрейнский динар
result.put("BHD", new CurrencyDataImpl("BHD","BHD",3,"BHD","BHD"));
// бурундийский франк
result.put("BIF", new CurrencyDataImpl("BIF","BIF",0,"BIF","BIF"));
// бермудский доллар
result.put("BMD", new CurrencyDataImpl("BMD","BMD",2,"BMD","BMD"));
// брунейский доллар
result.put("BND", new CurrencyDataImpl("BND","BND",2,"BND","BND"));
// боливийский боливиано
result.put("BOB", new CurrencyDataImpl("BOB","BOB",2,"BOB","BOB"));
// BOL
result.put("BOL", new CurrencyDataImpl("BOL","BOL",130,"BOL","BOL"));
// Боливийское песо
result.put("BOP", new CurrencyDataImpl("BOP","BOP",130,"BOP","BOP"));
// Боливийский мвдол
result.put("BOV", new CurrencyDataImpl("BOV","BOV",130,"BOV","BOV"));
// Бразильский новый крузейро (1967–1986)
result.put("BRB", new CurrencyDataImpl("BRB","BRB",130,"BRB","BRB"));
// Бразильское крузадо
result.put("BRC", new CurrencyDataImpl("BRC","BRC",130,"BRC","BRC"));
// Бразильский крузейро (1990–1993)
result.put("BRE", new CurrencyDataImpl("BRE","BRE",130,"BRE","BRE"));
// бразильский реал
result.put("BRL", new CurrencyDataImpl("BRL","R$",2,"R$","R$"));
// Бразильское новое крузадо
result.put("BRN", new CurrencyDataImpl("BRN","BRN",130,"BRN","BRN"));
// Бразильский крузейро
result.put("BRR", new CurrencyDataImpl("BRR","BRR",130,"BRR","BRR"));
// BRZ
result.put("BRZ", new CurrencyDataImpl("BRZ","BRZ",130,"BRZ","BRZ"));
// багамский доллар
result.put("BSD", new CurrencyDataImpl("BSD","BSD",2,"BSD","BSD"));
// бутанский нгултрум
result.put("BTN", new CurrencyDataImpl("BTN","BTN",2,"BTN","BTN"));
// Джа
result.put("BUK", new CurrencyDataImpl("BUK","BUK",130,"BUK","BUK"));
// ботсванская пула
result.put("BWP", new CurrencyDataImpl("BWP","BWP",2,"BWP","BWP"));
// Белорусский рубль (1994–1999)
result.put("BYB", new CurrencyDataImpl("BYB","BYB",130,"BYB","BYB"));
// белорусский рубль
result.put("BYN", new CurrencyDataImpl("BYN","BYN",2,"BYN","BYN"));
// Белорусский рубль (2000–2016)
result.put("BYR", new CurrencyDataImpl("BYR","BYR",128,"BYR","BYR"));
// белизский доллар
result.put("BZD", new CurrencyDataImpl("BZD","BZD",2,"BZD","BZD"));
// канадский доллар
result.put("CAD", new CurrencyDataImpl("CAD","CA$",2,"CA$","CA$"));
// конголезский франк
result.put("CDF", new CurrencyDataImpl("CDF","CDF",2,"CDF","CDF"));
// WIR евро
result.put("CHE", new CurrencyDataImpl("CHE","CHE",130,"CHE","CHE"));
// швейцарский франк
result.put("CHF", new CurrencyDataImpl("CHF","CHF",2,"CHF","CHF"));
// WIR франк
result.put("CHW", new CurrencyDataImpl("CHW","CHW",130,"CHW","CHW"));
// CLE
result.put("CLE", new CurrencyDataImpl("CLE","CLE",130,"CLE","CLE"));
// Условная расчетная единица Чили
result.put("CLF", new CurrencyDataImpl("CLF","CLF",132,"CLF","CLF"));
// чилийский песо
result.put("CLP", new CurrencyDataImpl("CLP","CLP",0,"CLP","CLP"));
// китайский офшорный юань
result.put("CNH", new CurrencyDataImpl("CNH","CNH",130,"CNH","CNH"));
// CNX
result.put("CNX", new CurrencyDataImpl("CNX","CNX",130,"CNX","CNX"));
// китайский юань
result.put("CNY", new CurrencyDataImpl("CNY","CN¥",2,"CN¥","CN¥"));
// колумбийский песо
result.put("COP", new CurrencyDataImpl("COP","COP",2,"COP","COP"));
// Единица реальной стоимости Колумбии
result.put("COU", new CurrencyDataImpl("COU","COU",130,"COU","COU"));
// костариканский колон
result.put("CRC", new CurrencyDataImpl("CRC","CRC",2,"CRC","CRC"));
// Старый Сербский динар
result.put("CSD", new CurrencyDataImpl("CSD","CSD",130,"CSD","CSD"));
// Чехословацкая твердая крона
result.put("CSK", new CurrencyDataImpl("CSK","CSK",130,"CSK","CSK"));
// кубинский конвертируемый песо
result.put("CUC", new CurrencyDataImpl("CUC","CUC",2,"CUC","CUC"));
// кубинский песо
result.put("CUP", new CurrencyDataImpl("CUP","CUP",2,"CUP","CUP"));
// эскудо Кабо-Верде
result.put("CVE", new CurrencyDataImpl("CVE","CVE",2,"CVE","CVE"));
// Кипрский фунт
result.put("CYP", new CurrencyDataImpl("CYP","CYP",130,"CYP","CYP"));
// чешская крона
result.put("CZK", new CurrencyDataImpl("CZK","CZK",2,"CZK","CZK"));
// Восточногерманская марка
result.put("DDM", new CurrencyDataImpl("DDM","DDM",130,"DDM","DDM"));
// Немецкая марка
result.put("DEM", new CurrencyDataImpl("DEM","DEM",130,"DEM","DEM"));
// франк Джибути
result.put("DJF", new CurrencyDataImpl("DJF","DJF",0,"DJF","DJF"));
// датская крона
result.put("DKK", new CurrencyDataImpl("DKK","DKK",2,"DKK","DKK"));
// доминиканский песо
result.put("DOP", new CurrencyDataImpl("DOP","DOP",2,"DOP","DOP"));
// алжирский динар
result.put("DZD", new CurrencyDataImpl("DZD","DZD",2,"DZD","DZD"));
// Эквадорский сукре
result.put("ECS", new CurrencyDataImpl("ECS","ECS",130,"ECS","ECS"));
// Постоянная единица стоимости Эквадора
result.put("ECV", new CurrencyDataImpl("ECV","ECV",130,"ECV","ECV"));
// Эстонская крона
result.put("EEK", new CurrencyDataImpl("EEK","EEK",130,"EEK","EEK"));
// египетский фунт
result.put("EGP", new CurrencyDataImpl("EGP","EGP",2,"EGP","EGP"));
// эритрейская накфа
result.put("ERN", new CurrencyDataImpl("ERN","ERN",2,"ERN","ERN"));
// Испанская песета (А)
result.put("ESA", new CurrencyDataImpl("ESA","ESA",130,"ESA","ESA"));
// Испанская песета (конвертируемая)
result.put("ESB", new CurrencyDataImpl("ESB","ESB",130,"ESB","ESB"));
// Испанская песета
result.put("ESP", new CurrencyDataImpl("ESP","ESP",128,"ESP","ESP"));
// эфиопский быр
result.put("ETB", new CurrencyDataImpl("ETB","ETB",2,"ETB","ETB"));
// евро
result.put("EUR", new CurrencyDataImpl("EUR","€",2,"€","€"));
// Финская марка
result.put("FIM", new CurrencyDataImpl("FIM","FIM",130,"FIM","FIM"));
// доллар Фиджи
result.put("FJD", new CurrencyDataImpl("FJD","FJD",2,"FJD","FJD"));
// фунт Фолклендских островов
result.put("FKP", new CurrencyDataImpl("FKP","FKP",2,"FKP","FKP"));
// Французский франк
result.put("FRF", new CurrencyDataImpl("FRF","FRF",130,"FRF","FRF"));
// британский фунт стерлингов
result.put("GBP", new CurrencyDataImpl("GBP","£",2,"£","£"));
// Грузинский купон
result.put("GEK", new CurrencyDataImpl("GEK","GEK",130,"GEK","GEK"));
// грузинский лари
result.put("GEL", new CurrencyDataImpl("GEL","₾",2,"₾","₾"));
// Ганский седи (1979–2007)
result.put("GHC", new CurrencyDataImpl("GHC","GHC",130,"GHC","GHC"));
// ганский седи
result.put("GHS", new CurrencyDataImpl("GHS","GHS",2,"GHS","GHS"));
// гибралтарский фунт
result.put("GIP", new CurrencyDataImpl("GIP","GIP",2,"GIP","GIP"));
// гамбийский даласи
result.put("GMD", new CurrencyDataImpl("GMD","GMD",2,"GMD","GMD"));
// гвинейский франк
result.put("GNF", new CurrencyDataImpl("GNF","GNF",0,"GNF","GNF"));
// Гвинейская сили
result.put("GNS", new CurrencyDataImpl("GNS","GNS",130,"GNS","GNS"));
// Эквеле экваториальной Гвинеи
result.put("GQE", new CurrencyDataImpl("GQE","GQE",130,"GQE","GQE"));
// Греческая драхма
result.put("GRD", new CurrencyDataImpl("GRD","GRD",130,"GRD","GRD"));
// гватемальский кетсаль
result.put("GTQ", new CurrencyDataImpl("GTQ","GTQ",2,"GTQ","GTQ"));
// Эскудо Португальской Гвинеи
result.put("GWE", new CurrencyDataImpl("GWE","GWE",130,"GWE","GWE"));
// Песо Гвинеи-Бисау
result.put("GWP", new CurrencyDataImpl("GWP","GWP",130,"GWP","GWP"));
// гайанский доллар
result.put("GYD", new CurrencyDataImpl("GYD","GYD",2,"GYD","GYD"));
// гонконгский доллар
result.put("HKD", new CurrencyDataImpl("HKD","HK$",2,"HK$","HK$"));
// гондурасская лемпира
result.put("HNL", new CurrencyDataImpl("HNL","HNL",2,"HNL","HNL"));
// Хорватский динар
result.put("HRD", new CurrencyDataImpl("HRD","HRD",130,"HRD","HRD"));
// хорватская куна
result.put("HRK", new CurrencyDataImpl("HRK","HRK",2,"HRK","HRK"));
// гаитянский гурд
result.put("HTG", new CurrencyDataImpl("HTG","HTG",2,"HTG","HTG"));
// венгерский форинт
result.put("HUF", new CurrencyDataImpl("HUF","HUF",2,"HUF","HUF"));
// индонезийская рупия
result.put("IDR", new CurrencyDataImpl("IDR","IDR",2,"IDR","IDR"));
// Ирландский фунт
result.put("IEP", new CurrencyDataImpl("IEP","IEP",130,"IEP","IEP"));
// Израильский фунт
result.put("ILP", new CurrencyDataImpl("ILP","ILP",130,"ILP","ILP"));
// ILR
result.put("ILR", new CurrencyDataImpl("ILR","ILR",130,"ILR","ILR"));
// новый израильский шекель
result.put("ILS", new CurrencyDataImpl("ILS","₪",2,"₪","₪"));
// индийская рупия
result.put("INR", new CurrencyDataImpl("INR","₹",2,"₹","₹"));
// иракский динар
result.put("IQD", new CurrencyDataImpl("IQD","IQD",0,"IQD","IQD"));
// иранский риал
result.put("IRR", new CurrencyDataImpl("IRR","IRR",0,"IRR","IRR"));
// ISJ
result.put("ISJ", new CurrencyDataImpl("ISJ","ISJ",130,"ISJ","ISJ"));
// исландская крона
result.put("ISK", new CurrencyDataImpl("ISK","ISK",0,"ISK","ISK"));
// Итальянская лира
result.put("ITL", new CurrencyDataImpl("ITL","ITL",128,"ITL","ITL"));
// ямайский доллар
result.put("JMD", new CurrencyDataImpl("JMD","JMD",2,"JMD","JMD"));
// иорданский динар
result.put("JOD", new CurrencyDataImpl("JOD","JOD",3,"JOD","JOD"));
// японская иена
result.put("JPY", new CurrencyDataImpl("JPY","¥",0,"¥","¥"));
// кенийский шиллинг
result.put("KES", new CurrencyDataImpl("KES","KES",2,"KES","KES"));
// киргизский сом
result.put("KGS", new CurrencyDataImpl("KGS","KGS",2,"KGS","KGS"));
// камбоджийский риель
result.put("KHR", new CurrencyDataImpl("KHR","KHR",2,"KHR","KHR"));
// коморский франк
result.put("KMF", new CurrencyDataImpl("KMF","KMF",0,"KMF","KMF"));
// северокорейская вона
result.put("KPW", new CurrencyDataImpl("KPW","KPW",0,"KPW","KPW"));
// KRH
result.put("KRH", new CurrencyDataImpl("KRH","KRH",130,"KRH","KRH"));
// KRO
result.put("KRO", new CurrencyDataImpl("KRO","KRO",130,"KRO","KRO"));
// южнокорейская вона
result.put("KRW", new CurrencyDataImpl("KRW","₩",0,"₩","₩"));
// кувейтский динар
result.put("KWD", new CurrencyDataImpl("KWD","KWD",3,"KWD","KWD"));
// доллар Островов Кайман
result.put("KYD", new CurrencyDataImpl("KYD","KYD",2,"KYD","KYD"));
// казахский тенге
result.put("KZT", new CurrencyDataImpl("KZT","KZT",2,"KZT","KZT"));
// лаосский кип
result.put("LAK", new CurrencyDataImpl("LAK","LAK",0,"LAK","LAK"));
// ливанский фунт
result.put("LBP", new CurrencyDataImpl("LBP","LBP",0,"LBP","LBP"));
// шри-ланкийская рупия
result.put("LKR", new CurrencyDataImpl("LKR","LKR",2,"LKR","LKR"));
// либерийский доллар
result.put("LRD", new CurrencyDataImpl("LRD","LRD",2,"LRD","LRD"));
// Лоти
result.put("LSL", new CurrencyDataImpl("LSL","LSL",2,"LSL","LSL"));
// Литовский лит
result.put("LTL", new CurrencyDataImpl("LTL","LTL",130,"LTL","LTL"));
// Литовский талон
result.put("LTT", new CurrencyDataImpl("LTT","LTT",130,"LTT","LTT"));
// Конвертируемый франк Люксембурга
result.put("LUC", new CurrencyDataImpl("LUC","LUC",130,"LUC","LUC"));
// Люксембургский франк
result.put("LUF", new CurrencyDataImpl("LUF","LUF",128,"LUF","LUF"));
// Финансовый франк Люксембурга
result.put("LUL", new CurrencyDataImpl("LUL","LUL",130,"LUL","LUL"));
// Латвийский лат
result.put("LVL", new CurrencyDataImpl("LVL","LVL",130,"LVL","LVL"));
// Латвийский рубль
result.put("LVR", new CurrencyDataImpl("LVR","LVR",130,"LVR","LVR"));
// ливийский динар
result.put("LYD", new CurrencyDataImpl("LYD","LYD",3,"LYD","LYD"));
// марокканский дирхам
result.put("MAD", new CurrencyDataImpl("MAD","MAD",2,"MAD","MAD"));
// Марокканский франк
result.put("MAF", new CurrencyDataImpl("MAF","MAF",130,"MAF","MAF"));
// MCF
result.put("MCF", new CurrencyDataImpl("MCF","MCF",130,"MCF","MCF"));
// MDC
result.put("MDC", new CurrencyDataImpl("MDC","MDC",130,"MDC","MDC"));
// молдавский лей
result.put("MDL", new CurrencyDataImpl("MDL","MDL",2,"MDL","MDL"));
// малагасийский ариари
result.put("MGA", new CurrencyDataImpl("MGA","MGA",0,"MGA","MGA"));
// Малагасийский франк
result.put("MGF", new CurrencyDataImpl("MGF","MGF",128,"MGF","MGF"));
// македонский денар
result.put("MKD", new CurrencyDataImpl("MKD","MKD",2,"MKD","MKD"));
// MKN
result.put("MKN", new CurrencyDataImpl("MKN","MKN",130,"MKN","MKN"));
// Малийский франк
result.put("MLF", new CurrencyDataImpl("MLF","MLF",130,"MLF","MLF"));
// мьянманский кьят
result.put("MMK", new CurrencyDataImpl("MMK","MMK",0,"MMK","MMK"));
// монгольский тугрик
result.put("MNT", new CurrencyDataImpl("MNT","MNT",2,"MNT","MNT"));
// патака Макао
result.put("MOP", new CurrencyDataImpl("MOP","MOP",2,"MOP","MOP"));
// мавританская угия (1973–2017)
result.put("MRO", new CurrencyDataImpl("MRO","MRO",128,"MRO","MRO"));
// мавританская угия
result.put("MRU", new CurrencyDataImpl("MRU","MRU",2,"MRU","MRU"));
// Мальтийская лира
result.put("MTL", new CurrencyDataImpl("MTL","MTL",130,"MTL","MTL"));
// Мальтийский фунт
result.put("MTP", new CurrencyDataImpl("MTP","MTP",130,"MTP","MTP"));
// маврикийская рупия
result.put("MUR", new CurrencyDataImpl("MUR","MUR",2,"MUR","MUR"));
// MVP
result.put("MVP", new CurrencyDataImpl("MVP","MVP",130,"MVP","MVP"));
// мальдивская руфия
result.put("MVR", new CurrencyDataImpl("MVR","MVR",2,"MVR","MVR"));
// малавийская квача
result.put("MWK", new CurrencyDataImpl("MWK","MWK",2,"MWK","MWK"));
// мексиканский песо
result.put("MXN", new CurrencyDataImpl("MXN","MX$",2,"MX$","MX$"));
// Мексиканское серебряное песо (1861–1992)
result.put("MXP", new CurrencyDataImpl("MXP","MXP",130,"MXP","MXP"));
// Мексиканская пересчетная единица (UDI)
result.put("MXV", new CurrencyDataImpl("MXV","MXV",130,"MXV","MXV"));
// малайзийский ринггит
result.put("MYR", new CurrencyDataImpl("MYR","MYR",2,"MYR","MYR"));
// Мозамбикское эскудо
result.put("MZE", new CurrencyDataImpl("MZE","MZE",130,"MZE","MZE"));
// Старый мозамбикский метикал
result.put("MZM", new CurrencyDataImpl("MZM","MZM",130,"MZM","MZM"));
// мозамбикский метикал
result.put("MZN", new CurrencyDataImpl("MZN","MZN",2,"MZN","MZN"));
// доллар Намибии
result.put("NAD", new CurrencyDataImpl("NAD","NAD",2,"NAD","NAD"));
// нигерийская найра
result.put("NGN", new CurrencyDataImpl("NGN","NGN",2,"NGN","NGN"));
// Никарагуанская кордоба (1988–1991)
result.put("NIC", new CurrencyDataImpl("NIC","NIC",130,"NIC","NIC"));
// никарагуанская кордоба
result.put("NIO", new CurrencyDataImpl("NIO","NIO",2,"NIO","NIO"));
// Нидерландский гульден
result.put("NLG", new CurrencyDataImpl("NLG","NLG",130,"NLG","NLG"));
// норвежская крона
result.put("NOK", new CurrencyDataImpl("NOK","NOK",2,"NOK","NOK"));
// непальская рупия
result.put("NPR", new CurrencyDataImpl("NPR","NPR",2,"NPR","NPR"));
// новозеландский доллар
result.put("NZD", new CurrencyDataImpl("NZD","NZ$",2,"NZ$","NZ$"));
// оманский риал
result.put("OMR", new CurrencyDataImpl("OMR","OMR",3,"OMR","OMR"));
// панамский бальбоа
result.put("PAB", new CurrencyDataImpl("PAB","PAB",2,"PAB","PAB"));
// Перуанское инти
result.put("PEI", new CurrencyDataImpl("PEI","PEI",130,"PEI","PEI"));
// перуанский соль
result.put("PEN", new CurrencyDataImpl("PEN","PEN",2,"PEN","PEN"));
// Перуанский соль (1863–1965)
result.put("PES", new CurrencyDataImpl("PES","PES",130,"PES","PES"));
// кина Папуа – Новой Гвинеи
result.put("PGK", new CurrencyDataImpl("PGK","PGK",2,"PGK","PGK"));
// филиппинский песо
result.put("PHP", new CurrencyDataImpl("PHP","PHP",2,"PHP","PHP"));
// пакистанская рупия
result.put("PKR", new CurrencyDataImpl("PKR","PKR",2,"PKR","PKR"));
// польский злотый
result.put("PLN", new CurrencyDataImpl("PLN","PLN",2,"PLN","PLN"));
// Злотый
result.put("PLZ", new CurrencyDataImpl("PLZ","PLZ",130,"PLZ","PLZ"));
// Португальское эскудо
result.put("PTE", new CurrencyDataImpl("PTE","PTE",130,"PTE","PTE"));
// парагвайский гуарани
result.put("PYG", new CurrencyDataImpl("PYG","PYG",0,"PYG","PYG"));
// катарский риал
result.put("QAR", new CurrencyDataImpl("QAR","QAR",2,"QAR","QAR"));
// Родезийский доллар
result.put("RHD", new CurrencyDataImpl("RHD","RHD",130,"RHD","RHD"));
// Старый Румынский лей
result.put("ROL", new CurrencyDataImpl("ROL","ROL",130,"ROL","ROL"));
// румынский лей
result.put("RON", new CurrencyDataImpl("RON","RON",2,"RON","RON"));
// сербский динар
result.put("RSD", new CurrencyDataImpl("RSD","RSD",0,"RSD","RSD"));
// российский рубль
result.put("RUB", new CurrencyDataImpl("RUB","₽",2,"₽","₽"));
// Российский рубль (1991–1998)
result.put("RUR", new CurrencyDataImpl("RUR","р.",130,"р.","р."));
// франк Руанды
result.put("RWF", new CurrencyDataImpl("RWF","RWF",0,"RWF","RWF"));
// саудовский риял
result.put("SAR", new CurrencyDataImpl("SAR","SAR",2,"SAR","SAR"));
// доллар Соломоновых Островов
result.put("SBD", new CurrencyDataImpl("SBD","SBD",2,"SBD","SBD"));
// сейшельская рупия
result.put("SCR", new CurrencyDataImpl("SCR","SCR",2,"SCR","SCR"));
// Суданский динар
result.put("SDD", new CurrencyDataImpl("SDD","SDD",130,"SDD","SDD"));
// суданский фунт
result.put("SDG", new CurrencyDataImpl("SDG","SDG",2,"SDG","SDG"));
// Старый суданский фунт
result.put("SDP", new CurrencyDataImpl("SDP","SDP",130,"SDP","SDP"));
// шведская крона
result.put("SEK", new CurrencyDataImpl("SEK","SEK",2,"SEK","SEK"));
// сингапурский доллар
result.put("SGD", new CurrencyDataImpl("SGD","SGD",2,"SGD","SGD"));
// фунт острова Святой Елены
result.put("SHP", new CurrencyDataImpl("SHP","SHP",2,"SHP","SHP"));
// Словенский толар
result.put("SIT", new CurrencyDataImpl("SIT","SIT",130,"SIT","SIT"));
// Словацкая крона
result.put("SKK", new CurrencyDataImpl("SKK","SKK",130,"SKK","SKK"));
// леоне
result.put("SLL", new CurrencyDataImpl("SLL","SLL",0,"SLL","SLL"));
// сомалийский шиллинг
result.put("SOS", new CurrencyDataImpl("SOS","SOS",0,"SOS","SOS"));
// суринамский доллар
result.put("SRD", new CurrencyDataImpl("SRD","SRD",2,"SRD","SRD"));
// Суринамский гульден
result.put("SRG", new CurrencyDataImpl("SRG","SRG",130,"SRG","SRG"));
// южносуданский фунт
result.put("SSP", new CurrencyDataImpl("SSP","SSP",2,"SSP","SSP"));
// добра Сан-Томе и Принсипи (1977–2017)
result.put("STD", new CurrencyDataImpl("STD","STD",128,"STD","STD"));
// добра Сан-Томе и Принсипи
result.put("STN", new CurrencyDataImpl("STN","STN",2,"STN","STN"));
// Рубль СССР
result.put("SUR", new CurrencyDataImpl("SUR","SUR",130,"SUR","SUR"));
// Сальвадорский колон
result.put("SVC", new CurrencyDataImpl("SVC","SVC",130,"SVC","SVC"));
// сирийский фунт
result.put("SYP", new CurrencyDataImpl("SYP","SYP",0,"SYP","SYP"));
// свазилендский лилангени
result.put("SZL", new CurrencyDataImpl("SZL","SZL",2,"SZL","SZL"));
// таиландский бат
result.put("THB", new CurrencyDataImpl("THB","฿",2,"฿","฿"));
// Таджикский рубль
result.put("TJR", new CurrencyDataImpl("TJR","TJR",130,"TJR","TJR"));
// таджикский сомони
result.put("TJS", new CurrencyDataImpl("TJS","TJS",2,"TJS","TJS"));
// Туркменский манат
result.put("TMM", new CurrencyDataImpl("TMM","TMM",128,"TMM","TMM"));
// новый туркменский манат
result.put("TMT", new CurrencyDataImpl("TMT","ТМТ",2,"ТМТ","ТМТ"));
// тунисский динар
result.put("TND", new CurrencyDataImpl("TND","TND",3,"TND","TND"));
// тонганская паанга
result.put("TOP", new CurrencyDataImpl("TOP","TOP",2,"TOP","TOP"));
// Тиморское эскудо
result.put("TPE", new CurrencyDataImpl("TPE","TPE",130,"TPE","TPE"));
// Турецкая лира (1922–2005)
result.put("TRL", new CurrencyDataImpl("TRL","TRL",128,"TRL","TRL"));
// турецкая лира
result.put("TRY", new CurrencyDataImpl("TRY","TL",2,"TL","TL"));
// доллар Тринидада и Тобаго
result.put("TTD", new CurrencyDataImpl("TTD","TTD",2,"TTD","TTD"));
// новый тайваньский доллар
result.put("TWD", new CurrencyDataImpl("TWD","NT$",2,"NT$","NT$"));
// танзанийский шиллинг
result.put("TZS", new CurrencyDataImpl("TZS","TZS",2,"TZS","TZS"));
// украинская гривна
result.put("UAH", new CurrencyDataImpl("UAH","грн.",2,"грн.","грн."));
// Карбованец (украинский)
result.put("UAK", new CurrencyDataImpl("UAK","UAK",130,"UAK","UAK"));
// Старый угандийский шиллинг
result.put("UGS", new CurrencyDataImpl("UGS","UGS",130,"UGS","UGS"));
// угандийский шиллинг
result.put("UGX", new CurrencyDataImpl("UGX","UGX",0,"UGX","UGX"));
// доллар США
result.put("USD", new CurrencyDataImpl("USD","$",2,"$","$"));
// Доллар США следующего дня
result.put("USN", new CurrencyDataImpl("USN","USN",130,"USN","USN"));
// Доллар США текущего дня
result.put("USS", new CurrencyDataImpl("USS","USS",130,"USS","USS"));
// Уругвайский песо (индекс инфляции)
result.put("UYI", new CurrencyDataImpl("UYI","UYI",128,"UYI","UYI"));
// Уругвайское старое песо (1975–1993)
result.put("UYP", new CurrencyDataImpl("UYP","UYP",130,"UYP","UYP"));
// уругвайский песо
result.put("UYU", new CurrencyDataImpl("UYU","UYU",2,"UYU","UYU"));
// UYW
result.put("UYW", new CurrencyDataImpl("UYW","UYW",132,"UYW","UYW"));
// узбекский сум
result.put("UZS", new CurrencyDataImpl("UZS","UZS",2,"UZS","UZS"));
// Венесуэльский боливар (1871–2008)
result.put("VEB", new CurrencyDataImpl("VEB","VEB",130,"VEB","VEB"));
// венесуэльский боливар (2008–2018)
result.put("VEF", new CurrencyDataImpl("VEF","VEF",130,"VEF","VEF"));
// венесуэльский боливар
result.put("VES", new CurrencyDataImpl("VES","VES",2,"VES","VES"));
// вьетнамский донг
result.put("VND", new CurrencyDataImpl("VND","₫",0,"₫","₫"));
// VNN
result.put("VNN", new CurrencyDataImpl("VNN","VNN",130,"VNN","VNN"));
// вату Вануату
result.put("VUV", new CurrencyDataImpl("VUV","VUV",0,"VUV","VUV"));
// самоанская тала
result.put("WST", new CurrencyDataImpl("WST","WST",2,"WST","WST"));
// франк КФА BEAC
result.put("XAF", new CurrencyDataImpl("XAF","FCFA",0,"FCFA","FCFA"));
// Серебро
result.put("XAG", new CurrencyDataImpl("XAG","XAG",130,"XAG","XAG"));
// Золото
result.put("XAU", new CurrencyDataImpl("XAU","XAU",130,"XAU","XAU"));
// Европейская составная единица
result.put("XBA", new CurrencyDataImpl("XBA","XBA",130,"XBA","XBA"));
// Европейская денежная единица
result.put("XBB", new CurrencyDataImpl("XBB","XBB",130,"XBB","XBB"));
// расчетная единица европейского валютного соглашения (XBC)
result.put("XBC", new CurrencyDataImpl("XBC","XBC",130,"XBC","XBC"));
// расчетная единица европейского валютного соглашения (XBD)
result.put("XBD", new CurrencyDataImpl("XBD","XBD",130,"XBD","XBD"));
// восточно-карибский доллар
result.put("XCD", new CurrencyDataImpl("XCD","EC$",2,"EC$","EC$"));
// СДР (специальные права заимствования)
result.put("XDR", new CurrencyDataImpl("XDR","XDR",130,"XDR","XDR"));
// ЭКЮ (единица европейской валюты)
result.put("XEU", new CurrencyDataImpl("XEU","XEU",130,"XEU","XEU"));
// Французский золотой франк
result.put("XFO", new CurrencyDataImpl("XFO","XFO",130,"XFO","XFO"));
// Французский UIC-франк
result.put("XFU", new CurrencyDataImpl("XFU","XFU",130,"XFU","XFU"));
// франк КФА ВСЕАО
result.put("XOF", new CurrencyDataImpl("XOF","CFA",0,"CFA","CFA"));
// Палладий
result.put("XPD", new CurrencyDataImpl("XPD","XPD",130,"XPD","XPD"));
// французский тихоокеанский франк
result.put("XPF", new CurrencyDataImpl("XPF","CFPF",0,"CFPF","CFPF"));
// Платина
result.put("XPT", new CurrencyDataImpl("XPT","XPT",130,"XPT","XPT"));
// единица RINET-фондов
result.put("XRE", new CurrencyDataImpl("XRE","XRE",130,"XRE","XRE"));
// XSU
result.put("XSU", new CurrencyDataImpl("XSU","XSU",130,"XSU","XSU"));
// тестовый валютный код
result.put("XTS", new CurrencyDataImpl("XTS","XTS",130,"XTS","XTS"));
// XUA
result.put("XUA", new CurrencyDataImpl("XUA","XUA",130,"XUA","XUA"));
// неизвестная валюта
result.put("XXX", new CurrencyDataImpl("XXX","XXXX",130,"XXXX","XXXX"));
// Йеменский динар
result.put("YDD", new CurrencyDataImpl("YDD","YDD",130,"YDD","YDD"));
// йеменский риал
result.put("YER", new CurrencyDataImpl("YER","YER",0,"YER","YER"));
// Югославский твердый динар
result.put("YUD", new CurrencyDataImpl("YUD","YUD",130,"YUD","YUD"));
// Югославский новый динар
result.put("YUM", new CurrencyDataImpl("YUM","YUM",130,"YUM","YUM"));
// Югославский динар
result.put("YUN", new CurrencyDataImpl("YUN","YUN",130,"YUN","YUN"));
// YUR
result.put("YUR", new CurrencyDataImpl("YUR","YUR",130,"YUR","YUR"));
// Южноафриканский рэнд (финансовый)
result.put("ZAL", new CurrencyDataImpl("ZAL","ZAL",130,"ZAL","ZAL"));
// южноафриканский рэнд
result.put("ZAR", new CurrencyDataImpl("ZAR","ZAR",2,"ZAR","ZAR"));
// Квача (замбийская) (1968–2012)
result.put("ZMK", new CurrencyDataImpl("ZMK","ZMK",128,"ZMK","ZMK"));
// замбийская квача
result.put("ZMW", new CurrencyDataImpl("ZMW","ZMW",2,"ZMW","ZMW"));
// Новый заир
result.put("ZRN", new CurrencyDataImpl("ZRN","ZRN",130,"ZRN","ZRN"));
// Заир
result.put("ZRZ", new CurrencyDataImpl("ZRZ","ZRZ",130,"ZRZ","ZRZ"));
// Доллар Зимбабве
result.put("ZWD", new CurrencyDataImpl("ZWD","ZWD",128,"ZWD","ZWD"));
// Доллар Зимбабве (2009)
result.put("ZWL", new CurrencyDataImpl("ZWL","ZWL",130,"ZWL","ZWL"));
// ZWR
result.put("ZWR", new CurrencyDataImpl("ZWR","ZWR",130,"ZWR","ZWR"));
return result;
}
@Override
protected HashMap<String, String> loadNamesMap() {
HashMap<String, String> result = super.loadNamesMap();
result.put("ADP","Андоррская песета");
result.put("AED","дирхам ОАЭ");
result.put("AFA","Афгани (1927–2002)");
result.put("AFN","афгани");
result.put("ALL","албанский лек");
result.put("AMD","армянский драм");
result.put("ANG","нидерландский антильский гульден");
result.put("AOA","ангольская кванза");
result.put("AOK","Ангольская кванза (1977–1990)");
result.put("AON","Ангольская новая кванза (1990–2000)");
result.put("AOR","Ангольская кванза реюстадо (1995–1999)");
result.put("ARA","Аргентинский аустрал");
result.put("ARP","Аргентинское песо (1983–1985)");
result.put("ARS","аргентинский песо");
result.put("ATS","Австрийский шиллинг");
result.put("AUD","австралийский доллар");
result.put("AWG","арубанский флорин");
result.put("AZM","Старый азербайджанский манат");
result.put("AZN","азербайджанский манат");
result.put("BAD","Динар Боснии и Герцеговины");
result.put("BAM","конвертируемая марка Боснии и Герцеговины");
result.put("BBD","барбадосский доллар");
result.put("BDT","бангладешская така");
result.put("BEC","Бельгийский франк (конвертируемый)");
result.put("BEF","Бельгийский франк");
result.put("BEL","Бельгийский франк (финансовый)");
result.put("BGL","Лев");
result.put("BGN","болгарский лев");
result.put("BHD","бахрейнский динар");
result.put("BIF","бурундийский франк");
result.put("BMD","бермудский доллар");
result.put("BND","брунейский доллар");
result.put("BOB","боливийский боливиано");
result.put("BOP","Боливийское песо");
result.put("BOV","Боливийский мвдол");
result.put("BRB","Бразильский новый крузейро (1967–1986)");
result.put("BRC","Бразильское крузадо");
result.put("BRE","Бразильский крузейро (1990–1993)");
result.put("BRL","бразильский реал");
result.put("BRN","Бразильское новое крузадо");
result.put("BRR","Бразильский крузейро");
result.put("BSD","багамский доллар");
result.put("BTN","бутанский нгултрум");
result.put("BUK","Джа");
result.put("BWP","ботсванская пула");
result.put("BYB","Белорусский рубль (1994–1999)");
result.put("BYN","белорусский рубль");
result.put("BYR","Белорусский рубль (2000–2016)");
result.put("BZD","белизский доллар");
result.put("CAD","канадский доллар");
result.put("CDF","конголезский франк");
result.put("CHE","WIR евро");
result.put("CHF","швейцарский франк");
result.put("CHW","WIR франк");
result.put("CLF","Условная расчетная единица Чили");
result.put("CLP","чилийский песо");
result.put("CNH","китайский офшорный юань");
result.put("CNY","китайский юань");
result.put("COP","колумбийский песо");
result.put("COU","Единица реальной стоимости Колумбии");
result.put("CRC","костариканский колон");
result.put("CSD","Старый Сербский динар");
result.put("CSK","Чехословацкая твердая крона");
result.put("CUC","кубинский конвертируемый песо");
result.put("CUP","кубинский песо");
result.put("CVE","эскудо Кабо-Верде");
result.put("CYP","Кипрский фунт");
result.put("CZK","чешская крона");
result.put("DDM","Восточногерманская марка");
result.put("DEM","Немецкая марка");
result.put("DJF","франк Джибути");
result.put("DKK","датская крона");
result.put("DOP","доминиканский песо");
result.put("DZD","алжирский динар");
result.put("ECS","Эквадорский сукре");
result.put("ECV","Постоянная единица стоимости Эквадора");
result.put("EEK","Эстонская крона");
result.put("EGP","египетский фунт");
result.put("ERN","эритрейская накфа");
result.put("ESA","Испанская песета (А)");
result.put("ESB","Испанская песета (конвертируемая)");
result.put("ESP","Испанская песета");
result.put("ETB","эфиопский быр");
result.put("EUR","евро");
result.put("FIM","Финская марка");
result.put("FJD","доллар Фиджи");
result.put("FKP","фунт Фолклендских островов");
result.put("FRF","Французский франк");
result.put("GBP","британский фунт стерлингов");
result.put("GEK","Грузинский купон");
result.put("GEL","грузинский лари");
result.put("GHC","Ганский седи (1979–2007)");
result.put("GHS","ганский седи");
result.put("GIP","гибралтарский фунт");
result.put("GMD","гамбийский даласи");
result.put("GNF","гвинейский франк");
result.put("GNS","Гвинейская сили");
result.put("GQE","Эквеле экваториальной Гвинеи");
result.put("GRD","Греческая драхма");
result.put("GTQ","гватемальский кетсаль");
result.put("GWE","Эскудо Португальской Гвинеи");
result.put("GWP","Песо Гвинеи-Бисау");
result.put("GYD","гайанский доллар");
result.put("HKD","гонконгский доллар");
result.put("HNL","гондурасская лемпира");
result.put("HRD","Хорватский динар");
result.put("HRK","хорватская куна");
result.put("HTG","гаитянский гурд");
result.put("HUF","венгерский форинт");
result.put("IDR","индонезийская рупия");
result.put("IEP","Ирландский фунт");
result.put("ILP","Израильский фунт");
result.put("ILS","новый израильский шекель");
result.put("INR","индийская рупия");
result.put("IQD","иракский динар");
result.put("IRR","иранский риал");
result.put("ISK","исландская крона");
result.put("ITL","Итальянская лира");
result.put("JMD","ямайский доллар");
result.put("JOD","иорданский динар");
result.put("JPY","японская иена");
result.put("KES","кенийский шиллинг");
result.put("KGS","киргизский сом");
result.put("KHR","камбоджийский риель");
result.put("KMF","коморский франк");
result.put("KPW","северокорейская вона");
result.put("KRW","южнокорейская вона");
result.put("KWD","кувейтский динар");
result.put("KYD","доллар Островов Кайман");
result.put("KZT","казахский тенге");
result.put("LAK","лаосский кип");
result.put("LBP","ливанский фунт");
result.put("LKR","шри-ланкийская рупия");
result.put("LRD","либерийский доллар");
result.put("LSL","Лоти");
result.put("LTL","Литовский лит");
result.put("LTT","Литовский талон");
result.put("LUC","Конвертируемый франк Люксембурга");
result.put("LUF","Люксембургский франк");
result.put("LUL","Финансовый франк Люксембурга");
result.put("LVL","Латвийский лат");
result.put("LVR","Латвийский рубль");
result.put("LYD","ливийский динар");
result.put("MAD","марокканский дирхам");
result.put("MAF","Марокканский франк");
result.put("MDL","молдавский лей");
result.put("MGA","малагасийский ариари");
result.put("MGF","Малагасийский франк");
result.put("MKD","македонский денар");
result.put("MLF","Малийский франк");
result.put("MMK","мьянманский кьят");
result.put("MNT","монгольский тугрик");
result.put("MOP","патака Макао");
result.put("MRO","мавританская угия (1973–2017)");
result.put("MRU","мавританская угия");
result.put("MTL","Мальтийская лира");
result.put("MTP","Мальтийский фунт");
result.put("MUR","маврикийская рупия");
result.put("MVR","мальдивская руфия");
result.put("MWK","малавийская квача");
result.put("MXN","мексиканский песо");
result.put("MXP","Мексиканское серебряное песо (1861–1992)");
result.put("MXV","Мексиканская пересчетная единица (UDI)");
result.put("MYR","малайзийский ринггит");
result.put("MZE","Мозамбикское эскудо");
result.put("MZM","Старый мозамбикский метикал");
result.put("MZN","мозамбикский метикал");
result.put("NAD","доллар Намибии");
result.put("NGN","нигерийская найра");
result.put("NIC","Никарагуанская кордоба (1988–1991)");
result.put("NIO","никарагуанская кордоба");
result.put("NLG","Нидерландский гульден");
result.put("NOK","норвежская крона");
result.put("NPR","непальская рупия");
result.put("NZD","новозеландский доллар");
result.put("OMR","оманский риал");
result.put("PAB","панамский бальбоа");
result.put("PEI","Перуанское инти");
result.put("PEN","перуанский соль");
result.put("PES","Перуанский соль (1863–1965)");
result.put("PGK","кина Папуа – Новой Гвинеи");
result.put("PHP","филиппинский песо");
result.put("PKR","пакистанская рупия");
result.put("PLN","польский злотый");
result.put("PLZ","Злотый");
result.put("PTE","Португальское эскудо");
result.put("PYG","парагвайский гуарани");
result.put("QAR","катарский риал");
result.put("RHD","Родезийский доллар");
result.put("ROL","Старый Румынский лей");
result.put("RON","румынский лей");
result.put("RSD","сербский динар");
result.put("RUB","российский рубль");
result.put("RUR","Российский рубль (1991–1998)");
result.put("RWF","франк Руанды");
result.put("SAR","саудовский риял");
result.put("SBD","доллар Соломоновых Островов");
result.put("SCR","сейшельская рупия");
result.put("SDD","Суданский динар");
result.put("SDG","суданский фунт");
result.put("SDP","Старый суданский фунт");
result.put("SEK","шведская крона");
result.put("SGD","сингапурский доллар");
result.put("SHP","фунт острова Святой Елены");
result.put("SIT","Словенский толар");
result.put("SKK","Словацкая крона");
result.put("SLL","леоне");
result.put("SOS","сомалийский шиллинг");
result.put("SRD","суринамский доллар");
result.put("SRG","Суринамский гульден");
result.put("SSP","южносуданский фунт");
result.put("STD","добра Сан-Томе и Принсипи (1977–2017)");
result.put("STN","добра Сан-Томе и Принсипи");
result.put("SUR","Рубль СССР");
result.put("SVC","Сальвадорский колон");
result.put("SYP","сирийский фунт");
result.put("SZL","свазилендский лилангени");
result.put("THB","таиландский бат");
result.put("TJR","Таджикский рубль");
result.put("TJS","таджикский сомони");
result.put("TMM","Туркменский манат");
result.put("TMT","новый туркменский манат");
result.put("TND","тунисский динар");
result.put("TOP","тонганская паанга");
result.put("TPE","Тиморское эскудо");
result.put("TRL","Турецкая лира (1922–2005)");
result.put("TRY","турецкая лира");
result.put("TTD","доллар Тринидада и Тобаго");
result.put("TWD","новый тайваньский доллар");
result.put("TZS","танзанийский шиллинг");
result.put("UAH","украинская гривна");
result.put("UAK","Карбованец (украинский)");
result.put("UGS","Старый угандийский шиллинг");
result.put("UGX","угандийский шиллинг");
result.put("USD","доллар США");
result.put("USN","Доллар США следующего дня");
result.put("USS","Доллар США текущего дня");
result.put("UYI","Уругвайский песо (индекс инфляции)");
result.put("UYP","Уругвайское старое песо (1975–1993)");
result.put("UYU","уругвайский песо");
result.put("UZS","узбекский сум");
result.put("VEB","Венесуэльский боливар (1871–2008)");
result.put("VEF","венесуэльский боливар (2008–2018)");
result.put("VES","венесуэльский боливар");
result.put("VND","вьетнамский донг");
result.put("VUV","вату Вануату");
result.put("WST","самоанская тала");
result.put("XAF","франк КФА BEAC");
result.put("XAG","Серебро");
result.put("XAU","Золото");
result.put("XBA","Европейская составная единица");
result.put("XBB","Европейская денежная единица");
result.put("XBC","расчетная единица европейского валютного соглашения (XBC)");
result.put("XBD","расчетная единица европейского валютного соглашения (XBD)");
result.put("XCD","восточно-карибский доллар");
result.put("XDR","СДР (специальные права заимствования)");
result.put("XEU","ЭКЮ (единица европейской валюты)");
result.put("XFO","Французский золотой франк");
result.put("XFU","Французский UIC-франк");
result.put("XOF","франк КФА ВСЕАО");
result.put("XPD","Палладий");
result.put("XPF","французский тихоокеанский франк");
result.put("XPT","Платина");
result.put("XRE","единица RINET-фондов");
result.put("XTS","тестовый валютный код");
result.put("XXX","неизвестная валюта");
result.put("YDD","Йеменский динар");
result.put("YER","йеменский риал");
result.put("YUD","Югославский твердый динар");
result.put("YUM","Югославский новый динар");
result.put("YUN","Югославский динар");
result.put("ZAL","Южноафриканский рэнд (финансовый)");
result.put("ZAR","южноафриканский рэнд");
result.put("ZMK","Квача (замбийская) (1968–2012)");
result.put("ZMW","замбийская квача");
result.put("ZRN","Новый заир");
result.put("ZRZ","Заир");
result.put("ZWD","Доллар Зимбабве");
result.put("ZWL","Доллар Зимбабве (2009)");
return result;
}
}
| [
"[email protected]"
] | |
b03d67166adcb29d4060766e87ae30556b8a1169 | 3a9f7febd26844ce3829267d1180079c4a90c7f2 | /Read.java | 7eb585f30079ab6c7e140eec5163692168bf16b1 | [] | no_license | maganoegi/hepial | 2ae8245230cc2f6f27279de2e40e894424a537ca | 3ba4e7a948f0617b23c4b423f0ba9118523ccec9 | refs/heads/master | 2023-02-22T19:20:18.900134 | 2021-01-25T03:11:32 | 2021-01-25T03:11:32 | 330,738,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java |
public class Read extends Instruction {
protected Expression destination;
public Read(Expression e, String fl, int line, int col){
super(fl, line, col);
this.destination = e;
}
public Expression getDestination() {
return this.destination;
}
/**
* Accepts a AST visitor
*/
Object accept(ASTVisitor visitor){
return visitor.visit(this);
}
} | [
"[email protected]"
] | |
48bd7d76d328fcf96f7b5928d7d5864c66c455a6 | b6ef786c51d33c6df3de5487b5af2cd7fea1afdf | /Client/ClientApp.java | dd92dea364c6469a0a3664f1aa9dfb5532df93d3 | [] | no_license | AnitaRezaee/CourseRegistration | 9de581a9714fdb341aea1060f66757012a32af60 | 72d6bb062a99f93320883ac3c3af36685b672b27 | refs/heads/master | 2023-03-04T02:31:26.409982 | 2021-02-15T22:16:34 | 2021-02-15T22:16:34 | 339,216,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java |
public class ClientApp {
public static void main(String[] args) {
CommunicationController commCtrl = new CommunicationController("localhost", 8099);
LoginGUI loginView = new LoginGUI(400, 170);
LoginGUIController loginController = new LoginGUIController(loginView, commCtrl);
}
}
| [
"[email protected]"
] | |
9eea9ccfbf288746764fafc05825c3eb4a9c4b4e | d5b5ff7e669c3b5af75d75f9287772a215ec1aef | /src/com/AIPC/RobotConnection.java | 0b16416e91cb436c13fbfec3a8c1b20241ef76b6 | [] | no_license | matty234/AIPC | c1e84f3cf496ca5faefa3db602e60d7d58065d08 | f34d912cf6ae570cb66f827a56c14161efa96da2 | refs/heads/master | 2023-04-30T01:39:25.922161 | 2016-12-07T23:22:22 | 2016-12-07T23:22:22 | 72,861,802 | 0 | 0 | null | 2023-04-17T16:01:51 | 2016-11-04T15:46:32 | Java | UTF-8 | Java | false | false | 2,335 | java | package com.AIPC;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import lejos.pc.comm.NXTComm;
import lejos.pc.comm.NXTCommException;
import lejos.pc.comm.NXTCommFactory;
import lejos.pc.comm.NXTInfo;
public class RobotConnection implements RCCommand {
NXTComm nxtComm = NXTCommFactory.createNXTComm(NXTCommFactory.BLUETOOTH);
DataOutputStream brickOutput;
DataInputStream brickInput;
public RobotConnection(NXTInfo nxtInfo, NXTComm nxtComm) throws NXTCommException {
setNxtComm(nxtComm);
openConnection(nxtInfo);
}
public RobotConnection(NXTInfo nxtInfo) throws NXTCommException {
openConnection(nxtInfo);
}
private void openConnection(NXTInfo nxtInfo) throws NXTCommException {
nxtComm.open(nxtInfo);
brickOutput = new DataOutputStream(nxtComm.getOutputStream());
brickInput = new DataInputStream(nxtComm.getInputStream());
}
public boolean handshake() {
try {
writeByte(RCCommand.Modes.HANDSHAKE);
if(readByte()==RCCommand.Modes.HANDSHAKE) {
return true;
}
} catch (IOException e) {
e.printStackTrace();
return false;
}
return false;
}
public NXTComm getNxtComm() {
return nxtComm;
}
private void setNxtComm(NXTComm nxtComm) {
this.nxtComm = nxtComm;
}
public void writeInt(int value) throws IOException {
brickOutput.writeInt(value);
brickOutput.flush();
}
public void writeByte(byte value) throws IOException {
brickOutput.writeByte(value);
brickOutput.flush();
}
public void writeRobotPacket(RobotPacket rb) throws IOException {
brickOutput.write(rb.getMode());
brickOutput.write(rb.getLength());
for (int i = 0; i < rb.getLength(); i++) {
brickOutput.write(rb.getCommands()[i]);
}
brickOutput.flush();
}
public byte readByte() throws IOException {
return brickInput.readByte();
}
public RobotPacket readRobotPacket() throws IOException {
byte mode = readByte();
int length = readByte();
byte[] commands = new byte[length];
for (int i = 0; i < length; i++) {
commands[i] = readByte();
}
RobotPacket robotPacket = new RobotPacket(mode, commands);
return robotPacket;
}
public void close() throws IOException {
brickOutput.close();
brickInput.close();
}
}
| [
"[email protected]"
] | |
08cf6d88d207cbbbe008775308dd7c59bfb9416f | fb676f57d00b7bed6f57b0fcb340e19bd0231bf6 | /src/main/java/domain/CampaignName.java | fa1a220750ba796c2ab818fe9276b805dbf190ee | [] | no_license | jammazwan/xbo_BareBonesCamelMicroService | 984bd527281b9e3d4cc61608cd8b939037f2fc79 | 240138e772df7fa724b40404b857006748f2c937 | refs/heads/master | 2021-01-09T20:29:09.220626 | 2017-02-02T01:52:29 | 2017-02-02T01:52:29 | 63,264,261 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package domain;
public class CampaignName {
public String campaignKey;
public CampaignName() {
super();
}
@Override
public String toString() {
return "CampaignName [campaignKey=" + campaignKey + "]";
}
}
| [
"[email protected]"
] | |
17cf60e9214a2a683d069dcf99507a48802fa07d | df6f96898184729604068a013622c5a3b0833c03 | /app/src/main/java/com/rose/guojiangzhibo/fragment/TwoFragment.java | 5b9f40bcfd3b543e76e5abd0f73c475653589526 | [] | no_license | cherry98/huahua | bd0ab7bcc2b304d7f7c1f44afbaeb0aa38f6d934 | 73ce804da1f0f28f17a57b8eaed376d9d3301ddd | refs/heads/master | 2020-12-30T13:09:29.585800 | 2017-05-15T15:24:58 | 2017-05-15T15:24:58 | 91,336,211 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,466 | java | package com.rose.guojiangzhibo.fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.rose.guojiangzhibo.R;
import com.rose.guojiangzhibo.bean.SelectionHeaderItem;
import com.rose.guojiangzhibo.bean.SelectionItem;
import com.rose.guojiangzhibo.fragment.TwoFragments.CircleFragment;
import com.rose.guojiangzhibo.fragment.TwoFragments.SelectionFragment;
import com.rose.guojiangzhibo.urlconfig.ConfigURL;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;
import java.util.ArrayList;
/**
* A simple {@link Fragment} subclass.
*/
public class TwoFragment extends Fragment {
private View view;
private TextView selection;
private TextView circle;
private FragmentTransaction fragmentTransaction;
private FragmentManager fragmentManager;
private ArrayList<SelectionItem> selections;
private SelectionFragment selectionFragment;
private CircleFragment circleFragment;
private ArrayList<SelectionHeaderItem> headers;
public TwoFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_two, container, false);
getListViewData();
getHeaderData();
initView(view);
return view;
}
private void initView(View view) {
fragmentManager = getFragmentManager();
fragmentTransaction = fragmentManager.beginTransaction();
selectionFragment = new SelectionFragment();
circleFragment = new CircleFragment();
fragmentTransaction.add(R.id.contentframelayout_twofrag, selectionFragment, null);
fragmentTransaction.show(selectionFragment);
fragmentTransaction.add(R.id.contentframelayout_twofrag, circleFragment, null);
fragmentTransaction.hide(circleFragment);
fragmentTransaction.commit();
selection = (TextView) view.findViewById(R.id.selectiontitle_twofragment);
circle = (TextView) view.findViewById(R.id.circletitle_twofragment);
selection.setTextColor(0xffffffff);
View.OnClickListener onClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
fragmentTransaction = fragmentManager.beginTransaction();
selection.setTextColor(0xffbbbbbb);
circle.setTextColor(0xffbbbbbb);
switch (v.getId()) {
case R.id.selectiontitle_twofragment:
selection.setTextColor(0xffffffff);
fragmentTransaction.show(selectionFragment);
fragmentTransaction.hide(circleFragment);
break;
case R.id.circletitle_twofragment:
circle.setTextColor(0xffffffff);
fragmentTransaction.show(circleFragment);
fragmentTransaction.hide(selectionFragment);
break;
}
fragmentTransaction.commit();
}
};
selection.setOnClickListener(onClickListener);
circle.setOnClickListener(onClickListener);
}
public void getListViewData() {
RequestParams requestParams = new RequestParams(ConfigURL.getSelcetion());
x.http().get(requestParams, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
try {
JSONObject jsonObject = new JSONObject(result);
JSONArray jsonArray = jsonObject.optJSONArray("data");
selections = new ArrayList<>();
for (int i = 0; i < jsonArray.length(); i++) {
SelectionItem item = new SelectionItem();
item.getJSONObject(jsonArray.getJSONObject(i));
selections.add(item);
}
initListView();
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
}
});
}
private void initHeader(ArrayList<SelectionHeaderItem> headers) {
selectionFragment.setHeader(headers);
}
private void initListView() {
selectionFragment.setList(selections);
}
public void getHeaderData() {
final RequestParams headerString = new RequestParams(ConfigURL.getSelectionHeader());
x.http().get(headerString, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String result) {
try {
JSONObject jsonObject = new JSONObject(result);
JSONArray data = jsonObject.optJSONArray("data");
headers = new ArrayList<>();
for (int i = 0; i < data.length(); i++) {
SelectionHeaderItem selectionHeaderItem = new SelectionHeaderItem();
JSONObject object = data.optJSONObject(i);
selectionHeaderItem.getJSONObject(object);
headers.add(selectionHeaderItem);
}
initHeader(headers);
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onError(Throwable ex, boolean isOnCallback) {
}
@Override
public void onCancelled(CancelledException cex) {
}
@Override
public void onFinished() {
}
});
}
}
| [
"[email protected]"
] | |
c0c21d2dab04486aa9d8727d28bf62445f127b64 | 76dc3f3a7226fca163ec234ab5643a2fb1b90700 | /reto3/src/main/java/tienda_disfraces/reto3/controlador/DisfrazControlador.java | 3ca59033d87de196427dad3bf3ef88f0162bc578 | [] | no_license | aacunam/Reto3 | d466939161a43e8031c372a2c9246fb6b5727195 | 7053f35f3a384eb0baa4ef047742a1a0bb01fd5f | refs/heads/master | 2023-08-31T20:27:56.551228 | 2021-10-31T04:17:56 | 2021-10-31T04:17:56 | 422,994,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,073 | java | package tienda_disfraces.reto3.controlador;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import tienda_disfraces.reto3.modelo.Costume;
import tienda_disfraces.reto3.servicios.DisfrazServicios;
@RestController
@RequestMapping("/api/Costume")
@CrossOrigin(origins = "*", methods = { RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT,
RequestMethod.DELETE })
public class DisfrazControlador {
@Autowired
private DisfrazServicios disfrazServicios;
@GetMapping("/all")
public List<Costume> getDisfraz() {
return disfrazServicios.getAll();
}
@GetMapping("/{id}")
public Optional<Costume> getDisfraz(@PathVariable("id") int id) {
return disfrazServicios.getDisfraz(id);
}
@PostMapping("/save")
@ResponseStatus(HttpStatus.CREATED)
public Costume save(@RequestBody Costume disfraz) {
return disfrazServicios.save(disfraz);
}
@PutMapping("/update")
@ResponseStatus(HttpStatus.CREATED)
public Costume update(@RequestBody Costume disfraz) {
return disfrazServicios.update(disfraz);
}
@DeleteMapping("/{id}")
@ResponseStatus(HttpStatus.NO_CONTENT)
public boolean deletePapeleria(@PathVariable("id") int id) {
return disfrazServicios.deleteDisfraz(id);
}
}
| [
"[email protected]"
] | |
a9dc917a837845728d9bf39e78e40cfcc2170881 | c4eec416ae4678d6346b09bf28a1700f20f1b7d6 | /assignment.queryreport.rest/src/main/java/nl/lunatech/assignment/queryreport/rest/util/QueryReportSQL.java | 0323c3c49be3d2175ed0713e24967fbde60f69a3 | [] | no_license | ArkiTheDeveloper/workspace | d1d8acb1fbfda3761dc99b090cb6a2302ae19534 | 2f6deb2fb1de3a6397db87ed7d22592fa481fa0c | refs/heads/master | 2020-03-21T03:45:04.162039 | 2018-06-20T13:20:54 | 2018-06-20T13:20:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,690 | java | package nl.lunatech.assignment.queryreport.rest.util;
/**
* Utility Class with SQLs
*
*/
public class QueryReportSQL {
public static final String GET_COUNTRY_DETAILS_FOR_COUNTRY_NAME="SELECT C.ID, C.NAME, C.CODE, A.ID, A.NAME, A.IDENT, A.ISO_COUNTRY, R.ID, R.SURFACE, R.LENGTH_FT, " +
"R.WIDTH_FT, R.AIRPORT_REF, R.AIRPORT_IDENT FROM ((COUNTRY C INNER JOIN AIRPORT A ON C.CODE = A.ISO_COUNTRY) " +
"INNER JOIN RUNWAY R ON A.ID = R.AIRPORT_REF) WHERE UPPER(C.NAME) LIKE upper('%?%')";
public static final String GET_COUNTRY_DETAILS_FOR_COUNTRY_CODE="SELECT C.ID, C.NAME, C.CODE, A.ID, A.NAME, A.IDENT, A.ISO_COUNTRY, R.ID, R.SURFACE, R.LENGTH_FT, " +
"R.WIDTH_FT, R.AIRPORT_REF, R.AIRPORT_IDENT FROM ((COUNTRY C INNER JOIN AIRPORT A ON C.CODE = A.ISO_COUNTRY) " +
"INNER JOIN RUNWAY R ON A.ID = R.AIRPORT_REF) WHERE UPPER(C.CODE) LIKE upper('%?%')";
public static final String GET_COUNTRY_WITH_HIGHEST_AIRPORTS="SELECT DISTINCT(A.ISO_COUNTRY), COUNT(A.ISO_COUNTRY) FROM AIRPORT A group BY A.ISO_COUNTRY ORDER BY COUNT(A.ISO_COUNTRY) DESC";
public static final String GET_COUNTRY_WITH_LOWEST_AIRPORTS="SELECT DISTINCT(A.ISO_COUNTRY), COUNT(A.ISO_COUNTRY) FROM AIRPORT A group BY A.ISO_COUNTRY ORDER BY COUNT(A.ISO_COUNTRY) ASC";
public static final String GET_RUNWAY_TYPE_FOR_ALL_COUNTRIES="SELECT C.NAME, R.SURFACE FROM ((COUNTRY C INNER JOIN AIRPORT A ON C.CODE = A.ISO_COUNTRY) " +
"INNER JOIN RUNWAY R ON A.ID = R.AIRPORT_REF) GROUP BY C.NAME, R.SURFACE";
public static final String GET_HIGHEST_USED_RUNWAY_IDENT="SELECT R.LE_IDENT, COUNT(R.LE_IDENT) FROM RUNWAY R GROUP BY R.LE_IDENT ORDER BY COUNT(R.LE_IDENT) DESC";
}
| [
"[email protected]"
] | |
a162974fb10f458e1af0040b59b993ab02708388 | f3a4782a5066fe87e29044ddf6a43eacb710876b | /852.Peak_Index_in_a_Mountain_Array/solution.java | 1da19978e8eda5f631d4c8b59f51dac5aa6abb5c | [] | no_license | Xintong-Wang/Leetcode | 1c530a06f033ad567cea06a479a3c6608c1069b5 | b604d7031828fc9bf34baa8eff8f7b59a3f22f9a | refs/heads/master | 2022-04-12T20:35:05.922199 | 2020-03-22T04:57:21 | 2020-03-22T04:57:21 | 197,919,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 256 | java | class Solution {
public int peakIndexInMountainArray(int[] A) {
if(A.length < 3)
return 0;
for(int i = 1; i < A.length; i++){
if(A[i - 1] > A[i])
return i - 1;
}
return 0;
}
}
| [
"[email protected]"
] | |
7f58a5bd23ca5da4a4407b09b2e7dbff7bc1ac78 | 2e15cf72332dea0fa1916a626b00983d802ec5d6 | /src/model/Mail.java | 9dfebe01f9421c60a649f617aa6a427e3208fc08 | [] | no_license | jorvesan96/Kata4 | 9df870a0a7c425cb2e7f2dc2716d7343917ef9e4 | 8b4e05e0c99049b4dab8f4876cbc222450cf65ad | refs/heads/master | 2021-12-03T00:05:08.794799 | 2021-11-04T15:02:23 | 2021-11-04T15:04:56 | 221,471,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package model;
public class Mail {
private final String mail;
public Mail(String mail) {
this.mail = mail;
}
public String getEmail(){return mail;}
public String getDomain(){
try{
String[] domain = this.mail.split("@");
return domain[1];
}catch(Exception e){
return "";
}
}
}
| [
"jorve@DESKTOP-5E2NNK5"
] | jorve@DESKTOP-5E2NNK5 |
dac5ea3fc002de88b0a86b2e8267451074242239 | d00af6c547e629983ff777abe35fc9c36b3b2371 | /jboss-all/jetty/src/main/org/mortbay/html/Input.java | 410082a08a8c15cd4b8de48de7b03bf9f716d10c | [] | no_license | aosm/JBoss | e4afad3e0d6a50685a55a45209e99e7a92f974ea | 75a042bd25dd995392f3dbc05ddf4bbf9bdc8cd7 | refs/heads/master | 2023-07-08T21:50:23.795023 | 2013-03-20T07:43:51 | 2013-03-20T07:43:51 | 8,898,416 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,820 | java | // ===========================================================================
// Copyright (c) 1996 Mort Bay Consulting Pty. Ltd. All rights reserved.
// $Id: Input.java,v 1.15.2.3 2003/06/04 04:47:37 starksm Exp $
// ---------------------------------------------------------------------------
package org.mortbay.html;
/* -------------------------------------------------------------------- */
/** HTML Form Input Tag.
* <p>
* @see Tag
* @see Form
* @version $Id: Input.java,v 1.15.2.3 2003/06/04 04:47:37 starksm Exp $
* @author Greg Wilkins
*/
public class Input extends Tag
{
/* ----------------------------------------------------------------- */
/** Input types */
public final static String Text="text";
public final static String Password="password";
public final static String Checkbox="checkbox";
public final static String Radio="radio";
public final static String Submit="submit";
public final static String Reset="reset";
public final static String Hidden="hidden";
public final static String File="file";
public final static String Image="image";
/* ----------------------------------------------------------------- */
public Input(String type,String name)
{
super("input");
attribute("type",type);
attribute("name",name);
}
/* ----------------------------------------------------------------- */
public Input(String type,String name, String value)
{
this(type,name);
attribute("value",value);
}
/* ----------------------------------------------------------------- */
public Input(Image image,String name, String value)
{
super("input");
attribute("type","image");
attribute("name",name);
if (value!=null)
attribute("value",value);
attribute(image.attributes());
}
/* ----------------------------------------------------------------- */
public Input(Image image,String name)
{
super("input");
attribute("type","image");
attribute("name",name);
attribute(image.attributes());
}
/* ----------------------------------------------------------------- */
public Input check()
{
attribute("checked");
return this;
}
/* ----------------------------------------------------------------- */
public Input setSize(int size)
{
size(size);
return this;
}
/* ----------------------------------------------------------------- */
public Input setMaxSize(int size)
{
attribute("maxlength",size);
return this;
}
/* ----------------------------------------------------------------- */
public Input fixed()
{
setMaxSize(size());
return this;
}
}
| [
"[email protected]"
] | |
f9e719f69f53830c9057405f50fe574273aa9396 | 62d620ee3370f874236cbf921b37e16257f593cf | /CSE214/src/ApplicantNotFoundException.java | 2dd417bc72d9b82a56980846c9bba1e98440ca17 | [] | no_license | Tamaarine/CSE214-Storage-File | 3cfe2504ef3ed51315d6fea9b7d3a39ea35bd788 | 407b895548fa4ca5d604232ea874fb9f13c29b92 | refs/heads/master | 2022-11-28T12:18:30.836158 | 2019-12-26T19:11:23 | 2019-12-26T19:11:23 | 212,611,601 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 738 | java | /**
* The ApplicantNotFoundException class is meant to be a custom Exception class
* that reports the exception of the Applicant not being found when searching through
* the HiringTable
*
* @author Ricky Lu
* email: [email protected]
* Stony Brook ID: 112829937
* Recitation: Wednesday 11:00AM - 11:53Am
*/
public class ApplicantNotFoundException extends Exception
{
/**
* Constructor of the ApplicantNotFoundException, it takes the a input of a
* msg that is printed when the exception is evoked
*
* @param msg
* The message to display to the user when the exception is called
*/
public ApplicantNotFoundException(String msg)
{
super(msg);
}
} | [
"[email protected]"
] | |
666f1e903ab555ba4ff6c3b20d5490615abb2b36 | a8d6029b78411ca580dd0463e4658b511e136f8a | /Calculator/src/test/java/CalculatorTest.java | 33ac37be7c66a60274073e5b9ffa7828d2301587 | [] | no_license | ChaYujin/OOP_WITH_JAVA | 67eae2dc25c3d6154afd52c3cf1174af0cd542a9 | 48bb0597bfbfb3bf9bc08895d88a6a5ffc480642 | refs/heads/master | 2021-01-24T01:51:26.127795 | 2018-02-23T15:44:06 | 2018-02-23T15:44:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 645 | java | import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.*;
public class CalculatorTest {
Calculator calculator;
@Before
public void setup() {
calculator = new Calculator();
}
@Test
public void plus() {
assertThat(calculator.plus(1,2)).isEqualTo(3);
}
@Test
public void minus() {
assertThat(calculator.minus(2,1)).isEqualTo(1);
}
@Test
public void multiply() {
assertThat(calculator.multifly(4,2)).isEqualTo(8);
}
@Test
public void devide() {
assertThat(calculator.divide(4,2)).isEqualTo(2);
}
}
| [
"[email protected]"
] | |
2df1538e18797249b0b33bc62e3cfb0f81fc43f4 | 4db6c5146d1450cdd346af800d598dc845151b38 | /src/main/java/at/ac/tuwien/student/e01526624/backend/service/ModelManager.java | 0451ee41c689412226feb5424a7ee84d8cc13050 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0"
] | permissive | jjnp/dss-ue2 | 66a515c1ec837cd702bc83611235db274abb2c29 | 83aedf456be1fc7b09dee22ca1be52cc93e7beda | refs/heads/master | 2022-11-21T11:27:39.069654 | 2020-07-09T02:50:26 | 2020-07-09T02:50:26 | 278,241,720 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,023 | java | package at.ac.tuwien.student.e01526624.backend.service;
import org.apache.jena.ontology.*;
import org.apache.jena.query.Dataset;
import org.apache.jena.query.ReadWrite;
import org.apache.jena.rdf.model.*;
import org.apache.jena.tdb.TDBFactory;
import org.springframework.stereotype.Component;
@Component
public class ModelManager {
public static final String NS = "http://www.jacobpalecek.com/01526624/dss-ue2-ss20/excel#";
public static final String MODEL_NAME = "ExcelRdfModel";
public static final String DATASET_LOCATION = "target/ds";
public static final String CELL_URI = NS + "Cell";
public static final String PURE_CELL_URI = NS + "PureCell";
public static final String CALCULATED_CELL_URI = NS + "CalculatedCell";
public static final String CELL_VALUE_URI = NS + "cell_value";
public static final String CELL_WORKSHEET_URI = NS + "worksheet";
public static final String CELL_WORKBOOK_URI = NS + "workbook";
public static final String CELL_COLUMN_URI = NS + "cell_column";
public static final String CELL_ROW_URI = NS + "cell_row";
public static final String CELL_USESVALUEFROM_URI = NS + "usesValueFrom";
public static final String CELL_FORMULA_URI = NS + "cell_formula";
public static final String FILE_NAME_URI = NS + "filename";
public static final String FILE_HASH_URI = NS + "filehash";
public static final String EXCEL_FILE_URI = NS + "ExcelFile";
private OntModel excelModel;
private OntModel inferencedExcelModel;
private Dataset dataset;
public OntClass cell;
public OntClass pureCell;
public OntClass calculatedCell;
public OntClass excelFile;
public DatatypeProperty cellValue;
public DatatypeProperty cellWorksheet;
public DatatypeProperty cellColumn;
public DatatypeProperty cellRow;
public DatatypeProperty cellFormula;
public DatatypeProperty filename;
public DatatypeProperty filehash;
public ObjectProperty cellUsesValueFrom;
public ObjectProperty cellWorkbook;
public ModelManager() {
this.initialize();
}
public void beginTx() {
if (!this.dataset.isInTransaction()) {
this.dataset.begin(ReadWrite.WRITE);
}
}
public void endTx() {
this.dataset.commit();
this.dataset.end();
}
public OntModel getExcelModel() {
return excelModel;
}
public OntModel getInferencedExcelModel() {
return inferencedExcelModel;
}
public void saveModel() {
if (this.dataset.isInTransaction()) {
this.dataset.commit();
this.dataset.end();
}
this.dataset.begin(ReadWrite.WRITE);
// this.dataset.replaceNamedModel(MODEL_NAME, model);
this.dataset.commit();
this.dataset.end();
}
private void initialize() {
this.dataset = TDBFactory.createDataset(DATASET_LOCATION);
if (!this.dataset.containsNamedModel(MODEL_NAME)) {
createInitialDataset();
}
loadModels();
loadOntologyArtifacts();
}
private void loadModels() {
this.dataset.begin(ReadWrite.READ);
Model base = this.dataset.getNamedModel(MODEL_NAME);
this.excelModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, base);
this.inferencedExcelModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF, base);
this.dataset.commit();
this.dataset.end();
}
private void loadOntologyArtifacts() {
this.dataset.begin(ReadWrite.READ);
this.cell = this.excelModel.getOntClass(CELL_URI);
this.pureCell = this.excelModel.getOntClass(PURE_CELL_URI);
this.excelFile = this.excelModel.getOntClass(EXCEL_FILE_URI);
this.calculatedCell = this.excelModel.getOntClass(CALCULATED_CELL_URI);
this.cellValue = this.excelModel.getDatatypeProperty(CELL_VALUE_URI);
this.cellWorksheet = this.excelModel.getDatatypeProperty(CELL_WORKSHEET_URI); // not working somehow
this.cellRow = this.excelModel.getDatatypeProperty(CELL_ROW_URI);
this.cellColumn = this.excelModel.getDatatypeProperty(CELL_COLUMN_URI);
this.cellFormula = this.excelModel.getDatatypeProperty(CELL_FORMULA_URI);
this.filehash = this.excelModel.getDatatypeProperty(FILE_HASH_URI);
this.filename = this.excelModel.getDatatypeProperty(FILE_NAME_URI);
this.cellWorkbook = this.excelModel.getObjectProperty(CELL_WORKBOOK_URI);
this.cellUsesValueFrom = this.excelModel.getObjectProperty(CELL_USESVALUEFROM_URI);
this.dataset.end();
}
private void createInitialDataset() {
System.out.println("Creating initial dataset");
this.dataset.begin(ReadWrite.WRITE);
OntModel base = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
base.read("ontology/excel_ontology.owl");
this.dataset.addNamedModel(MODEL_NAME, base);
this.dataset.commit();
this.dataset.end();
}
}
| [
"[email protected]"
] | |
b7542ee03c0073f3bfc73bf7d51119668a981b84 | 0b5c3fceed7f662ea7224fc9373ff65be027d087 | /app/src/main/java/kntryer/downloadapk/util/CustomTools.java | 89bb787505bb047b99b1888fc2d2f0c742064eb8 | [] | no_license | lipeijian/UpdateApk | c4621cf573259931f95aa20386c64b5321e71cbb | 9938a1bcc4ac2d35947c51c06abe7d825357bb7f | refs/heads/master | 2021-07-13T13:52:19.470376 | 2017-10-17T08:18:12 | 2017-10-17T08:18:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,029 | java | package kntryer.downloadapk.util;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.support.v4.content.FileProvider;
import android.util.Log;
import android.view.View;
import java.io.File;
import kntryer.downloadapk.BuildConfig;
import kntryer.downloadapk.server.DownloadApkService;
import me.drakeet.materialdialog.MaterialDialog;
/**
* Created by kntryer on 2017/10/13.
*/
public class CustomTools {
/**
* @param context
* @param title
* @param msg
* @param positive
*/
public static void showToast(Context context, String title, String msg, String positive) {
final MaterialDialog dialog = new MaterialDialog(context);
dialog.setTitle(title);
dialog.setMessage(msg);
dialog.setCanceledOnTouchOutside(true);
if (!positive.equals("")) {
dialog.setPositiveButton(positive, new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
}
dialog.show();
}
/**
* 获取应用版本号
*
* @param context
* @return
* @throws Exception
*/
public static String getVersionName(Context context) {
PackageManager packageManager = context.getPackageManager();
// getPackageName()是你当前类的包名,0代表是获取版本信息
PackageInfo packInfo = null;
try {
packInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
String version = packInfo.versionName;
return version;
}
/**
* 检查版本号是否一致
*
* @param context
* @param serverVersion
* @return
*/
public static boolean checkVersionUpdate(Context context, String serverVersion) {
String[] serverVersions = serverVersion.split("\\.");
String[] localVersions = getVersionName(context).split("\\.");
int num = serverVersions.length > localVersions.length ? localVersions.length : serverVersions.length;
for (int i = 0; i < num; i++) {
if (serverVersions[i].compareTo(localVersions[i]) > 0) {
return true;
} else if (serverVersions[i].compareTo(localVersions[i]) < 0) {
return false;
}
}
return serverVersions.length > localVersions.length;
}
/**
* 版本更新
*
* @param context
* @param status
* @param url
*/
public static void startUpdateApk(final Context context, int status, final String url) {
final MaterialDialog dialog = new MaterialDialog(context);
dialog.setTitle("更新啦");
dialog.setMessage("快来体验崭新的宝宝!");
dialog.setCanceledOnTouchOutside(status == 0);
dialog.setPositiveButton("立即更新", new View.OnClickListener() {
@Override
public void onClick(View v) {
//启动下载服务,显示通知栏
Log.e("---->", "下载更新");
Intent intent = new Intent(context, DownloadApkService.class);
intent.setAction(DownloadApkService.ACTION_START);
intent.putExtra("id", 0);
intent.putExtra("url", url);
intent.putExtra("name", "宝宝.apk");
context.startService(intent);
dialog.dismiss();
}
});
if (status == 0) {
dialog.setNegativeButton("稍候更新", new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
}
dialog.show();
}
/**
* 安装apk文件
*
* @param context
* @param file
*/
public static void installApk(Context context, File file) {
Intent intent = new Intent(Intent.ACTION_VIEW);
//判断是否是AndroidN以及更高的版本
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NEW_TASK);
Uri contentUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".fileProvider", file);
intent.setDataAndType(contentUri, "application/vnd.android.package-archive");
} else {
intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
context.startActivity(intent);
}
}
| [
"l"
] | l |
8d4b31930bf03b27202e7e7d18c28e2ebfb942e4 | 637b4faf515c75451a10c580287f7e5f44423ba0 | /2.JavaCore/src/com/javarush/task/task18/task1814/TxtInputStream.java | 8740546dbef40ce100018367d75b1898fa418f99 | [] | no_license | Abrekov/JavaRushTasks | ccc51f357ee542801e90811dbbc2a4c99845e0e6 | b1703a05303f3b1442e373a853a861bf793031b0 | refs/heads/master | 2020-09-07T05:57:18.878059 | 2019-12-08T17:19:18 | 2019-12-08T17:19:18 | 220,676,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 461 | java | package com.javarush.task.task18.task1814;
import java.io.*;
/*
UnsupportedFileName
*/
public class TxtInputStream extends FileInputStream {
public TxtInputStream(String fileName) throws IOException, UnsupportedFileNameException {
super(fileName);
if (!fileName.endsWith(".txt")) {
super.close();
throw new UnsupportedFileNameException();
}
}
public static void main(String[] args) {
}
}
| [
"[email protected]"
] | |
32ac5a04ce449408bbbed6cb78917d4929cbf65d | 432bde2a0e2672eb1bb5e12b6c27aea76f26f64f | /src/main/java/cn/movie/utils/DBUtil.java | ff662baf070a15f79089d19b01be340c00e2ed09 | [] | no_license | tanbinh123/moviedesign | 317859ea333ee98c37cf1ba12340f1dfc86cf7fa | cd5e697482b57f5e728e59bef66e9bc280e31eb6 | refs/heads/master | 2023-03-19T15:04:49.043701 | 2018-08-28T07:50:25 | 2018-08-28T07:50:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | package cn.movie.utils;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBUtil {
private static final String DRIVER ="com.mysql.jdbc.Driver";
private static final String URL = "jdbc:mysql://localhost:3306/data_movie?characterEncoding=UTF-8";
private static final String USER="root";
private static final String PASSWORD="123456";
private static Connection connection;
public static Connection getConnection(){
try{
Class.forName(DRIVER);
connection = DriverManager.getConnection(URL,USER,PASSWORD);
}catch(ClassNotFoundException e){
e.printStackTrace();
}catch(SQLException e){
e.printStackTrace();
}
return connection;
}
}
| [
"[email protected]"
] | |
3c50fb0c9c4358f43f8f7c3eb4ec9bc96d4e8098 | d132a32f07cdc583c021e56e61a4befff6228900 | /src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java | 614c56f53c190ac6c47cfa868c253d0a04248f7a | [] | no_license | TechCatOther/um_clean_forge | 27d80cb6e12c5ed38ab7da33a9dd9e54af96032d | b4ddabd1ed7830e75df9267e7255c9e79d1324de | refs/heads/master | 2020-03-22T03:14:54.717880 | 2018-07-02T09:28:10 | 2018-07-02T09:28:10 | 139,421,233 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,209 | java | package net.minecraft.network.play.server;
import java.io.IOException;
import net.minecraft.network.INetHandler;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayClient;
import net.minecraft.util.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class S05PacketSpawnPosition implements Packet
{
private BlockPos field_179801_a;
private static final String __OBFID = "CL_00001336";
public S05PacketSpawnPosition() {}
public S05PacketSpawnPosition(BlockPos p_i45956_1_)
{
this.field_179801_a = p_i45956_1_;
}
public void readPacketData(PacketBuffer buf) throws IOException
{
this.field_179801_a = buf.readBlockPos();
}
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeBlockPos(this.field_179801_a);
}
public void func_180752_a(INetHandlerPlayClient p_180752_1_)
{
p_180752_1_.handleSpawnPosition(this);
}
@SideOnly(Side.CLIENT)
public BlockPos func_179800_a()
{
return this.field_179801_a;
}
public void processPacket(INetHandler handler)
{
this.func_180752_a((INetHandlerPlayClient)handler);
}
} | [
"[email protected]"
] | |
4fbaf563ef057b4bae9fbcf03e6715c3032671b8 | 78bd7a8e8d4db38eb775f10d56a8498595458fba | /src/main/java/com/dimatech/backend/apirest/models/dao/iEquipoDao.java | 3e8420d7b5321f138ef4aafc351b82307193ca6d | [] | no_license | edgarconrado/dimatech-backend-apirest | 1fa99c4c92cd0bf44ee8079ab592a41d6f4e4bf9 | c94736397b3693c746a29783ee38afaf542d2e7f | refs/heads/master | 2022-12-21T19:54:18.389949 | 2020-09-24T20:45:48 | 2020-09-24T20:45:48 | 298,387,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 239 | java | package com.dimatech.backend.apirest.models.dao;
import org.springframework.data.repository.CrudRepository;
import com.dimatech.backend.apirest.models.entity.Equipo;
public interface iEquipoDao extends CrudRepository<Equipo, Long> {
}
| [
"[email protected]"
] | |
3d5567a0fad57619c3cf62b12ff7f7991215f5e1 | b69b6701de0b990f95310952e7108066bad33f1f | /.history/lesson4_20210501172301.java | e009be243f0a5ad56ef91245cd8d67d30bda2dc3 | [] | no_license | deepakadishankar/Practice | 909551bf369ed286dfde1b6c8e495bc19dc22d7e | 5725cdd6cb55ae5ff1e6b4607692ef364a3dc267 | refs/heads/master | 2023-07-27T07:26:13.783415 | 2021-09-14T07:51:18 | 2021-09-14T07:51:18 | 352,027,381 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 99 | java | public class lesson4 {
public static void main(String[] args) {
}
}
class aircarft{
} | [
"[email protected]"
] | |
043d60d4b2af48d73909e3334e5ba03e3612c1f7 | 77fb90c41fd2844cc4350400d786df99e14fa4ca | /com/coremedia/iso/boxes/TitleBox.java | 926251eadcfdaee6df93a8a470309ca24eb3d064 | [] | no_license | highnes7/umaang_decompiled | 341193b25351188d69b4413ebe7f0cde6525c8fb | bcfd90dffe81db012599278928cdcc6207632c56 | refs/heads/master | 2020-06-19T07:47:18.630455 | 2019-07-12T17:16:13 | 2019-07-12T17:16:13 | 196,615,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,295 | java | package com.coremedia.iso.boxes;
import f.h.a.MimeMessage;
import f.slide.asm.ByteBufferList;
import f.slide.asm.Label;
import org.aspectj.lang.JoinPoint;
public class TitleBox
extends MimeMessage
{
public static final String TYPE = "titl";
public String language;
public String title;
static {}
public TitleBox()
{
super("titl");
}
public void _parseDetails(java.nio.ByteBuffer paramByteBuffer)
{
parseVersionAndFlags(paramByteBuffer);
language = ByteBufferList.nextToken(paramByteBuffer);
title = ByteBufferList.readString(paramByteBuffer);
}
public void getContent(java.nio.ByteBuffer paramByteBuffer)
{
writeVersionAndFlags(paramByteBuffer);
Label.add(paramByteBuffer, language);
paramByteBuffer.put(f.slide.asm.ByteBuffer.append(title));
paramByteBuffer.put((byte)0);
}
public long getContentSize()
{
return f.slide.asm.ByteBuffer.convert(title) + 7;
}
public String getLanguage()
{
JoinPoint localJoinPoint = org.aspectj.runtime.reflect.Factory.makeJP(ajc$tjp_0, this, this);
f.h.a.Factory.aspectOf().before(localJoinPoint);
return language;
}
public String getTitle()
{
JoinPoint localJoinPoint = org.aspectj.runtime.reflect.Factory.makeJP(ajc$tjp_1, this, this);
f.h.a.Factory.aspectOf().before(localJoinPoint);
return title;
}
public void setLanguage(String paramString)
{
JoinPoint localJoinPoint = org.aspectj.runtime.reflect.Factory.makeJP(ajc$tjp_2, this, this, paramString);
f.h.a.Factory.aspectOf().before(localJoinPoint);
language = paramString;
}
public void setTitle(String paramString)
{
JoinPoint localJoinPoint = org.aspectj.runtime.reflect.Factory.makeJP(ajc$tjp_3, this, this, paramString);
f.h.a.Factory.aspectOf().before(localJoinPoint);
title = paramString;
}
public String toString()
{
StringBuilder localStringBuilder = f.sufficientlysecure.rootcommands.util.StringBuilder.getTag(org.aspectj.runtime.reflect.Factory.makeJP(ajc$tjp_4, this, this), "TitleBox[language=");
localStringBuilder.append(getLanguage());
localStringBuilder.append(";title=");
localStringBuilder.append(getTitle());
localStringBuilder.append("]");
return localStringBuilder.toString();
}
}
| [
"[email protected]"
] | |
925ab2104fb6e893e7fd63c54352fafdb2548389 | 66cbc16fbbf8d66854052d4ef05fb6680d783e20 | /daogenerator/src/main/java/com/example/Daogenerator.java | d9b0e355fbe1597909c73c40efee8f1e9ef378c3 | [] | no_license | zhangqingdev/new_lsj | 2d6fc1d06831b2fd311fb7b75659ad5b792bb5be | b42d771d566ae96f469a5a5ec103333f4cda4862 | refs/heads/master | 2021-01-22T19:59:11.428252 | 2017-04-06T10:32:13 | 2017-04-06T10:32:13 | 85,265,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,490 | java | package com.example;
import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;
public class Daogenerator {
public static void main(String[] args) throws Exception {
int version = 1;
String defaultJavaPackage = "com.oushangfeng.ounews.greendao";
Schema schema = new Schema(version, defaultJavaPackage);
addTable(schema);
// /表示根目录, ./表示当前路径, ../表示上一级父目录
new DaoGenerator().generateAll(schema, "./app/src/main/java-gen");
}
private static void addTable(Schema schema) {
Entity note = schema.addEntity("NewsChannelTable");
// note.addIdProperty();
/**
* 频道名称
*/
note.addStringProperty("newsChannelName").notNull().primaryKey().index();
/**
* 频道id
*/
note.addStringProperty("newsChannelId").notNull();
/**
* 频道类型
*/
note.addStringProperty("newsChannelType").notNull();
/**
* 选中的频道
*/
note.addBooleanProperty("newsChannelSelect").notNull();
/**
* 频道的排序位置
*/
note.addIntProperty("newsChannelIndex").notNull();
/**
* 频道是否是固定的
*/
note.addBooleanProperty("newsChannelFixed");
}
}
| [
"[email protected]"
] | |
c65e15c66e7c7731cf480f791a84376dfa65ed9a | 53c3bc5000cef82f8244e3686649aef0b77937d3 | /NCC An Thien/quanLyKho/KhuVuc.java | ab0c76dd1fe7f09ffd872a4008bc69917a31059c | [] | no_license | toxicskrill/QuanLyKho2 | 32e1859fb238c5fce5b145ff4831c27d02854b8e | 9c3f51f690861eed8b0c5027ba9c228aefdb1c4b | refs/heads/master | 2020-03-22T15:01:44.026596 | 2018-07-09T02:57:59 | 2018-07-09T02:57:59 | 140,223,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,941 | java | package quanLyKho;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class KhuVuc {
private int id;
private String ten;
private String TrangThai;
private int DienTich;
private ArrayList<MatHang> ListMatHang;
public void setDienTich(int dienTich) {
DienTich = dienTich;
}
public void Xoa() {
try {
new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void HienThi() {
System.out.println("ID: " +id);
System.out.println("Ten: " +ten);
System.out.println("Dien Tich" +DienTich);
}
public void Nhap() {
layout hien = new layout();
Scanner Xuat = new Scanner(System.in);
hien.hien("nhap ID: ");
id=Integer.parseInt(Xuat.nextLine());
Xoa();
hien.hien("nhap Ten: ");
ten=Xuat.nextLine();
Xoa();
}
@Override
public String toString() {
// TODO Auto-generated method stub
return "khu("+"ID: "+id+" Ten: "+ten+" Dien Tich: "+DienTich+"ListMH:"+ListMatHang+')';
}
public KhuVuc() {
// TODO Auto-generated constructor stub
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTen() {
return ten;
}
public void setTen(String ten) {
this.ten = ten;
}
public int getDienTich() {
return DienTich;
}
public ArrayList<MatHang> getListMatHang() {
return ListMatHang;
}
public void setListMatHang(ArrayList<MatHang> listMatHang) {
ListMatHang = listMatHang;
}
public String getTrangThai() {
return TrangThai;
}
public void setTrangThai(String trangThai) {
TrangThai = trangThai;
}
}
| [
"[email protected]"
] | |
f28b0c8f32b2a0193f6661e5e1ac62c006e372c2 | 5a89a92f2fc4d0fc9e60dbe0fe50a85b212b5ee8 | /Lesson02-GitHub-Repo-Search/T02.04-Exercise-ConnectingToTheInternet/app/src/main/java/com/example/android/datafrominternet/MainActivity.java | b2b3914862ab67f30f82ff59351b5650edfe2fd1 | [
"Apache-2.0"
] | permissive | floydkots/favorite-toys | 294f8f5674ef8b96fecbd813745e007c5515b2d9 | 90c2caba050819bdc28a56b02bb4a417078fdcf0 | refs/heads/master | 2020-03-19T14:14:01.355528 | 2018-06-14T13:09:01 | 2018-06-14T13:09:01 | 136,614,303 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,023 | java | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.datafrominternet;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.TextView;
import com.example.android.datafrominternet.utilities.NetworkUtils;
import java.io.IOException;
import java.net.URL;
public class MainActivity extends AppCompatActivity {
private EditText mSearchBoxEditText;
private TextView mUrlDisplayTextView;
private TextView mSearchResultsTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mSearchBoxEditText = (EditText) findViewById(R.id.et_search_box);
mUrlDisplayTextView = (TextView) findViewById(R.id.tv_url_display);
mSearchResultsTextView = (TextView) findViewById(R.id.tv_github_search_results_json);
}
/**
* This method retrieves the search text from the EditText, constructs
* the URL (using {@link NetworkUtils}) for the github repository you'd like to find, displays
* that URL in a TextView, and finally fires off an AsyncTask to perform the GET request using
* our (not yet created) {@link GithubQueryTask}
*/
private void makeGithubSearchQuery() {
String githubQuery = mSearchBoxEditText.getText().toString();
URL githubSearchUrl = NetworkUtils.buildUrl(githubQuery);
mUrlDisplayTextView.setText(githubSearchUrl.toString());
// TODO (2) Call getResponseFromHttpUrl and display the results in mSearchResultsTextView
// TODO (3) Surround the call to getResponseFromHttpUrl with a try / catch block to catch an IOException
try {
String results = NetworkUtils.getResponseFromHttpUrl(githubSearchUrl);
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemThatWasClickedId = item.getItemId();
if (itemThatWasClickedId == R.id.action_search) {
makeGithubSearchQuery();
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
13602b5373cf1386cd99f28fc4a3cee03dbf51ed | a261b977e6f5a9e38832274adafd797d3bc78752 | /letus-search/src/main/java/com/letus/search/controller/ItemController.java | 0d48ee4de1319a0e3ce842663f86cced3e5371b0 | [] | no_license | xfyin/letus-learing | 0a14f3f8fd746c8487cce0f5c4c01f01d35d6232 | c5211994d17b92cc071b056d23f88c7e92c66622 | refs/heads/master | 2020-06-17T19:37:45.677844 | 2016-12-19T16:09:53 | 2016-12-19T16:09:53 | 74,976,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,044 | java | /**
* File:ItemController.java
* Package:com.letus.search.controller
* Author:xfyin
* Date:2016-12-11 上午10:52:05
* Copyright (C) 2016-2016 letus179-Copyright
*/
package com.letus.search.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.letus.common.pojo.LetusResult;
import com.letus.search.service.ItemService;
/**
*
* 索引库维护---发布服务controller
*
* @author xfyin
*
*/
@Controller
@RequestMapping("/manager")
public class ItemController {
/**
* 注入service
*/
@Autowired
private ItemService itemService;
/**
* 导入所有商品信息到索引库
*
* @return LetusResult
*/
@RequestMapping("/importall")
@ResponseBody
public LetusResult importAllItems() {
return itemService.importAllItems();
}
}
| [
"[email protected]"
] | |
331ab3a201226f3f2b1e3e5244b71b94f3c7b010 | e4aea93f2988e2cf1be4f96a39f6cc3328cbbd50 | /src/com/flagleader/builder/a/bt.java | eb8b0fc1bbd2fd56450b3b1c45f995362d7dd9ce | [] | no_license | lannerate/ruleBuilder | 18116282ae55e9d56e9eb45d483520f90db4a1a6 | b5d87495990aa1988adf026366e92f7cbb579b19 | refs/heads/master | 2016-09-05T09:13:43.879603 | 2013-11-10T08:32:58 | 2013-11-10T08:32:58 | 14,231,127 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 303 | java | package com.flagleader.builder.a;
public class bt
implements bp
{
public void b()
{
}
public String a()
{
return "";
}
}
/* Location: D:\Dev_tools\ruleEngine\rbuilder.jar
* Qualified Name: com.flagleader.builder.a.bt
* JD-Core Version: 0.6.0
*/ | [
"[email protected]"
] | |
eb000a6d1c48edda9203a65d71b4a578a2bdb7ff | ea2f0f5b5bb494f816d8e9a236199a55827c945b | /java-estacionamento-backend/src/main/java/com/backend/test/java/JavaEstacionamentoBackendApplication.java | a8493cf908d7bf565c8da384f86220c790a5d227 | [] | no_license | 94rodrigo/backend-test-java | 3293235ab5cc467a2da048270a74db2d002ca460 | addb4e3c10498b5da13fd5215d58889ccbd69f67 | refs/heads/master | 2021-03-31T09:23:32.916082 | 2020-05-01T16:01:01 | 2020-05-01T16:01:01 | 248,096,608 | 0 | 0 | null | 2020-03-17T23:47:25 | 2020-03-17T23:47:24 | null | UTF-8 | Java | false | false | 352 | java | package com.backend.test.java;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class JavaEstacionamentoBackendApplication {
public static void main(String[] args) {
SpringApplication.run(JavaEstacionamentoBackendApplication.class, args);
}
}
| [
"[email protected]"
] | |
aa5e933ae6d2756571816bb21f803d684bd0883a | 9dd072444f1bea8e7c9247a2964af786f554c264 | /Phone/app/src/main/java/com/example/lance_3770/phone/phonedialer.java | 76214f6c1bd20b24fb5a617bb8e93e87911abe23 | [] | no_license | fangj99/AndroidStudioProjects | d51530c8cb32dfd65c83bdc9749dc2893fa1375f | 137373a7be47fb85498cc45080ba4a076d2f898d | refs/heads/master | 2021-01-17T11:14:00.461341 | 2016-03-25T07:05:56 | 2016-03-25T07:05:56 | 41,685,465 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,037 | java | package com.example.lance_3770.phone;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class phonedialer extends Activity {
/*lance changed*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_phonedialer);
Button button = (Button) this.findViewById(R.id.button);
button.setOnClickListener(new ButtonClickListener());
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_phonedialer, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/*lance changed*/
private final class ButtonClickListener implements View.OnClickListener {
public void onClick(View v){
EditText mobileText = (EditText) findViewById(R.id.mobile);
String number = mobileText.getText().toString();
Intent intent= new Intent();
intent.setAction("android.intent.action.CALL");
intent.addCategory("android.intent.category.DEFAULT");
intent.setData (Uri.parse("tel:" + number));
startActivity (intent);// 可以不用intent.addCategory("android.intent.category.DEFAULT"); 自动添加
}
}
}
| [
"[email protected]"
] | |
d775f8d7d0531248968135720fe7b8f99b38acea | 25e1bad480f2352be09f78038c5ec15a8aff391e | /DMServer/src/teamHarambe/Server.java | 01532d2125728a81b6b12f3c830584dd89826a82 | [] | no_license | cleikness/DM_GitHub | d3c0af8208282b9ec0362735b9dde66ea1d95b86 | 6ab5403093dc9d6513e45554b2ba895fe5bf0cd8 | refs/heads/master | 2021-01-12T16:14:22.724063 | 2016-10-25T19:15:15 | 2016-10-25T19:15:15 | 71,953,894 | 0 | 0 | null | 2016-10-26T01:30:35 | 2016-10-26T01:30:34 | null | UTF-8 | Java | false | false | 4,213 | java | package teamHarambe;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
import java.util.Calendar;
import org.json.JSONObject;
public class Server {
static List<Team> teams = new LinkedList<>();
static Scanner console = new Scanner(System.in);
static Schedule schedule;
public static void main(String[] args) throws IOException {
ServerSocket server = new ServerSocket(1234);
JSONObject database = getDatabase();
System.out.println("Server ready to accept clients.");
while (true) {
Socket s = server.accept();
Runnable connectionHandler = new ConnectionHandler(s, database);
new Thread(connectionHandler).start();
}
}
private static JSONObject getDatabase() throws IOException {
File dbFile = new File("resources/Database.json");
if (!dbFile.exists()) {
dbFile.createNewFile();
System.out.println("Welcome to first time setup!");
String password = promptInitialPassword();
System.out.println("How many teams will play in the debate season?");
int numTeams = promptInt(2);
promptTeams(numTeams);
System.out.println("How many referees will manage the season?");
int numReferees = promptInt(numTeams/2);
List<Referee> referees = generateRefereeList(numReferees);
System.out.println("Enter the season start date.");
Calendar startDate = promptDate();
schedule = new Schedule(teams, referees);
String filePath = dbFile.getPath();
String dbString = "{\n \"Schedule\": "+ schedule.toJSON() + "\n}";
PrintWriter writer = new PrintWriter(filePath, "UTF-8");
writer.println(dbString);
writer.close();
}
return new JSONObject(readFile("resources/Database.json", StandardCharsets.UTF_8));
}
private static int promptInt(int minValue) {
int input = 0;
do {
try {
input = console.nextInt();
if (input < minValue) {
System.out.print("Please input an integer >= " + minValue + ": ");
}
}
catch (NumberFormatException e) {
System.out.print("Please input an integer >= " + minValue + ": ");
}
} while (input < minValue);
return input;
}
private static void promptTeams(int numTeams) {
System.out.println("Please enter " + numTeams + " team names.");
for (int i = 0; i < numTeams; i++) {
System.out.print((i + 1) + ". ");
teams.add(new Team(console.next()));
}
}
private static Calendar promptDate() {
Calendar selectedDate = Calendar.getInstance();//shitty Java library
int selectedYear, selectedMonth, selectedDay;
int currentYear = selectedDate.get(Calendar.YEAR);
int currentMonth = selectedDate.get(Calendar.MONTH);
int currentDay = selectedDate.get(Calendar.DAY_OF_MONTH);
System.out.print("Enter the season start year: ");
selectedYear = promptInt(currentYear);
System.out.print("Enter the season start month: ");
selectedMonth = promptInt(selectedYear == currentYear ? currentMonth+1 : 1)-1;
System.out.print("Enter the season start day: ");
selectedDay = promptInt(selectedYear == currentYear && selectedMonth == currentMonth ? currentDay : 1);
selectedDate.set(selectedYear, selectedMonth, selectedDay);
return selectedDate;
}
private static String promptInitialPassword() {
String password;
System.out.print("Please create a password: ");
password = console.nextLine();
System.out.println("Your password is " + password);
return password;
}
private static List<Referee> generateRefereeList(int numReferees) {
List<Referee> referees = new LinkedList<>();
Random r = new Random();
for (int i=0; i < numReferees; i ++) {
referees.add(new Referee(r.nextInt(999999999) + 111111111, i==0));
}
return referees;
}
private static String readFile(String path, Charset encoding) throws IOException {
byte[] encoded = Files.readAllBytes(Paths.get(path));
return new String(encoded, encoding);
}
}
| [
"[email protected]"
] | |
381ba1890023d84c2b51dff933f68292a7fe8f0d | fbee421a0dded774dfdc20c67b33a02e9d24c366 | /pet-clinic-data/src/main/java/com/example/model/PetType.java | 3d1fd3d6565a0c3a9f441124d18c621fe3104484 | [] | no_license | freana86/sfg-pet-clinic | b9297e6c79d31f4310a1ff7fe4ae6559e0dea1ed | eb840863f6ae17160b4452cc636925e796b92f9c | refs/heads/master | 2020-05-22T13:54:23.431299 | 2019-07-12T18:54:17 | 2019-07-12T18:54:17 | 186,369,724 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package com.example.model;
public class PetType extends BaseEntity {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"[email protected]"
] | |
5741916a562539a682103e510ec2b342ebcc7655 | d80156bb8e04f815f3d498ad1fc941146ebd741e | /app/src/main/java/com/huaren/logistics/myrecycleinput/IMyRecycleInputDetailView.java | d00db0bcca80fced87375c9c2f2d17ce29098945 | [] | no_license | pq27120/Logistics | aa88a4b9a6548602924cb3b67e2fe3f908f2a70a | 9cc3c4e575769f0578d793915f25c4d2961d07e9 | refs/heads/master | 2020-05-21T14:00:23.331485 | 2017-11-20T12:59:36 | 2017-11-20T12:59:36 | 49,876,773 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package com.huaren.logistics.myrecycleinput;
import com.dexafree.materialList.card.Card;
/**
* Created by bj on 2016/9/1.
*/
public interface IMyRecycleInputDetailView {
void addCard(Card card);
}
| [
"[email protected]"
] | |
490fcbb1be50f81f19bae91c1848584ebaadf4ba | 1d771c2b70a8a2247fce3ce7eafce095d5e6827c | /POO/Actividad6T2/src/Empleados.java | 83e12f6ecf40f3c63c4e8c5627de3b824e6db0a4 | [] | no_license | ProgramacionPolitecnicoMalaga/PPM-Pablo-Gutierrez-Campos | bef9332abd01d6f75636ad2410aa0727e1e4547e | 7953f4c51e218b499c4f82555aa2ef34e11c82fb | refs/heads/master | 2021-07-16T14:11:44.286713 | 2020-05-21T18:22:41 | 2020-05-21T18:22:41 | 218,272,496 | 0 | 0 | null | 2020-10-14T00:29:06 | 2019-10-29T11:36:02 | Java | UTF-8 | Java | false | false | 268 | java | public abstract class Empleados {
String nombre;
String apellidos;
public Empleados(String nombre, String apellidos) {
this.nombre = nombre;
this.apellidos = apellidos;
}
public abstract double getSueldo();
}
| [
"[email protected]"
] | |
72e02d70e8117315303367885c941a13668d0c64 | 31f7f0a21dddbd4437bae55bad7f1a2d4bb10f77 | /src/main/java/omtteam/omlib/reference/Reference.java | a57ceba1cb0f025830ee78d59bd74ed840a34544 | [
"MIT"
] | permissive | OpenModularTurretsTeam/OMLib | 948b22155152c9aab9863c4151dec23b9b780584 | 2a70145d7ee2993c765048146e184bfd6597c059 | refs/heads/1.12 | 2022-05-11T14:44:30.182699 | 2021-08-12T10:12:15 | 2021-08-12T10:18:59 | 74,905,225 | 6 | 10 | MIT | 2018-03-28T18:55:31 | 2016-11-27T18:08:37 | Java | UTF-8 | Java | false | false | 468 | java | package omtteam.omlib.reference;
import static omtteam.omlib.compatibility.OMLibModCompatibility.*;
public class Reference {
public static final String MOD_ID = "omlib";
public static final String NAME = "OMLib";
public static final String VERSION = "@VERSION@";
public static final String DEPENDENCIES = "after:" + TEModID + ";after:" + CCModID + ";after:" + MekModID +
";after:" + EIOModID + ";after:" + TCModID + ";after:" + OCModID;
} | [
"[email protected]"
] | |
014a2038c991125c1b8000c0a94830a192cb9bfc | 6750fce76a576c4aad2e16003ec3b34eae4fd988 | /src/com/example/android/pinprogress/MainActivity.java | 0a7e015cd1afc6e5c78b44504abcb854367a456c | [] | no_license | ymotoba/pinprogress | 39f16fe9a74b701466e99e91faabcef9180b1e52 | e34b384e784cf34c3f6ee120202a4b3104de69cd | refs/heads/master | 2016-09-05T18:24:40.833596 | 2013-04-19T07:45:47 | 2013-04-19T07:45:47 | 9,540,219 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,182 | java | /*
* Copyright 2012 Roman Nurik
*
* 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.example.android.pinprogress;
import android.app.Activity;
import android.os.Bundle;
import android.widget.CompoundButton;
import android.widget.SeekBar;
import android.widget.TextView;
public class MainActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final HpPinProgressButton pinProgress1 = (HpPinProgressButton) findViewById(
R.id.pin_progress_1);
final CircleProgress pinProgress2 = (CircleProgress) findViewById(
R.id.pin_progress_2);
final PinProgressButton pinProgress3 = (PinProgressButton) findViewById(
R.id.pin_progress_3);
final PinProgressButton pinProgress4 = (PinProgressButton) findViewById(
R.id.pin_progress_4);
final TextView pinProgress1TextView = (TextView) findViewById(R.id.pin_progress_1_TextView);
CompoundButton.OnCheckedChangeListener checkedChangeListener
= new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
updatePinProgressContentDescription((PinProgressButton) compoundButton);
}
};
pinProgress1.setOnCheckedChangeListener(checkedChangeListener);
pinProgress3.setOnCheckedChangeListener(checkedChangeListener);
pinProgress4.setOnCheckedChangeListener(checkedChangeListener);
SeekBar progressSeekBar = (SeekBar) findViewById(R.id.progress_seek_bar);
progressSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
pinProgress1.setProgress(progress);
pinProgress2.setProgress(progress);
pinProgress3.setProgress(progress);
pinProgress4.setProgress(progress);
updatePinProgressContentDescription(pinProgress1);
updatePinProgressContentDescription(pinProgress3);
updatePinProgressContentDescription(pinProgress4);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
pinProgress1.setProgress(progressSeekBar.getProgress());
pinProgress2.setProgress(progressSeekBar.getProgress());
pinProgress3.setProgress(progressSeekBar.getProgress());
pinProgress4.setProgress(progressSeekBar.getProgress());
updatePinProgressContentDescription(pinProgress1);
updatePinProgressContentDescription(pinProgress3);
updatePinProgressContentDescription(pinProgress4);
}
private void updatePinProgressContentDescription(HpPinProgressButton button) {
int progress = button.getProgress();
if (progress <= 0) {
button.setContentDescription(getString(button.isChecked()
? R.string.content_desc_pinned_not_downloaded
: R.string.content_desc_unpinned_not_downloaded));
} else if (progress >= 100) {
button.setContentDescription(getString(button.isChecked()
? R.string.content_desc_pinned_downloaded
: R.string.content_desc_unpinned_downloaded));
} else {
button.setContentDescription(getString(button.isChecked()
? R.string.content_desc_pinned_downloading
: R.string.content_desc_unpinned_downloading));
}
}
private void updatePinProgressContentDescription(PinProgressButton button) {
int progress = button.getProgress();
if (progress <= 0) {
button.setContentDescription(getString(button.isChecked()
? R.string.content_desc_pinned_not_downloaded
: R.string.content_desc_unpinned_not_downloaded));
} else if (progress >= 100) {
button.setContentDescription(getString(button.isChecked()
? R.string.content_desc_pinned_downloaded
: R.string.content_desc_unpinned_downloaded));
} else {
button.setContentDescription(getString(button.isChecked()
? R.string.content_desc_pinned_downloading
: R.string.content_desc_unpinned_downloading));
}
}
}
| [
"[email protected]"
] | |
2e7d4e38eac5f7b41a810c2dca6742c6b9055405 | 9344af5fb6424e1328d69a1a705a0a3e324b7ca9 | /src/com/guofeilong/fortune/ui/coolguide/transitions/ChangeRotate.java | eb09f7879e9fdfb9a57e234c5a00a29f5a804774 | [] | no_license | GuoFeilong/MySelfFortune | e3eaeb2994e50007a366a7c56c8b953d29d9daa1 | 1ea8fc9f53cb3633a0ff50d4875e1d0a384bc4f3 | refs/heads/master | 2020-12-24T08:01:38.909626 | 2016-08-09T10:04:03 | 2016-08-09T10:04:03 | 48,013,764 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,352 | java | package com.guofeilong.fortune.ui.coolguide.transitions;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.os.Build;
import android.transition.Transition;
import android.transition.TransitionValues;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by linfaxin on 2015/5/29.
* Email: [email protected]
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
public class ChangeRotate extends Transition {
private static final String PROPNAME_NAME = "android:rotate:rotate";
private static final String PROPNAME_NAME_X = "android:rotate:rotateX";
private static final String PROPNAME_NAME_Y = "android:rotate:rotateY";
private static final String FIELD_NAME = "rotation";
private static final String FIELD_NAME_X = "rotationX";
private static final String FIELD_NAME_Y = "rotationY";
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
public void captureStartValues(TransitionValues transitionValues) {
transitionValues.values.put(PROPNAME_NAME, transitionValues.view.getRotation());
transitionValues.values.put(PROPNAME_NAME_X, transitionValues.view.getRotationX());
transitionValues.values.put(PROPNAME_NAME_Y, transitionValues.view.getRotationY());
}
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
public void captureEndValues(TransitionValues transitionValues) {
transitionValues.values.put(PROPNAME_NAME, transitionValues.view.getRotation());
transitionValues.values.put(PROPNAME_NAME_X, transitionValues.view.getRotationX());
transitionValues.values.put(PROPNAME_NAME_Y, transitionValues.view.getRotationY());
}
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues,
TransitionValues endValues) {
if (startValues == null || endValues == null) {
return null;
}
final View view = endValues.view;
float startValue = (Float) startValues.values.get(PROPNAME_NAME);
float startValueX = (Float) startValues.values.get(PROPNAME_NAME_X);
float startValueY = (Float) startValues.values.get(PROPNAME_NAME_Y);
float endValue = (Float) endValues.values.get(PROPNAME_NAME);
float endValueX = (Float) endValues.values.get(PROPNAME_NAME_X);
float endValueY = (Float) endValues.values.get(PROPNAME_NAME_Y);
AnimatorSet animatorSet = new AnimatorSet();
if (startValue != endValue) {
view.setRotation(startValue);
animatorSet.playTogether(ObjectAnimator.ofFloat(view, FIELD_NAME, startValue, endValue));
}
if (startValueX != endValueX) {
view.setRotationX(startValueX);
animatorSet.playTogether(ObjectAnimator.ofFloat(view, FIELD_NAME_X, startValueX, endValueX));
}
if (startValueY != endValueY) {
view.setRotationY(startValueY);
animatorSet.playTogether(ObjectAnimator.ofFloat(view, FIELD_NAME_Y, startValueY, endValueY));
}
if(animatorSet.getChildAnimations()!=null && animatorSet.getChildAnimations().size()>0){
return animatorSet;
}
return null;
}
}
| [
"[email protected]"
] | |
1ccb4e414f22700d2372921a84d2eff4a648f080 | 22c4af186e7e90e83f25f9a4072d19d73fb1cafb | /src/main/java/com/example/controller/JsonWebToken.java | 015a68128167a2b4e186b41cacefedd2b4350287 | [] | no_license | yinshicong/jwtone | e0da658ba5bcc6d4e85a4a6aa8afc83ccde46fc5 | 8a8cbb60a83b4fccd1a01aa6379b4de1fc886e20 | refs/heads/master | 2020-03-28T10:40:47.569696 | 2018-09-10T09:47:49 | 2018-09-10T09:47:49 | 148,133,600 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,645 | java | package com.example.controller;
import com.example.Entity.UserInfoEntity;
import com.example.config.Audience;
import com.example.dto.AccessToken;
import com.example.dto.LoginPara;
import com.example.repositoy.IUserInfoRepository;
import com.example.util.JwtHelper;
import com.example.util.MyUtils;
import com.example.util.ResultMsg;
import com.example.util.ResultStatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
*
* JWT流程。
* https://cnodejs.org/topic/5b0c4a7b8a4f51e140d942fc
*
* Created by Administrator on 2018/8/20 0020.
*/
@RestController
public class JsonWebToken {
@Autowired
private Audience audienceEntity;
@Autowired
private IUserInfoRepository userRepositoy;
@PostMapping("oauth/token")
public Object getAccessToken(@RequestBody LoginPara loginPara)
{
ResultMsg resultMsg;
try
{
if(loginPara.getClientId() == null
|| (loginPara.getClientId().compareTo(audienceEntity.getClientId()) != 0))
{
resultMsg = new ResultMsg(ResultStatusCode.INVALID_CLIENTID.getErrcode(),
ResultStatusCode.INVALID_CLIENTID.getErrmsg(), null);
return resultMsg;
}
//验证码校验在后面章节添加
//验证用户名密码
UserInfoEntity user = userRepositoy.findUserInfoByName(loginPara.getUserName());
if (user == null)
{
resultMsg = new ResultMsg(ResultStatusCode.INVALID_PASSWORD.getErrcode(),
ResultStatusCode.INVALID_PASSWORD.getErrmsg(), null);
return resultMsg;
}
else
{
String md5Password = MyUtils.getMD5(loginPara.getPassword()+user.getSalt());
if (md5Password.compareTo(user.getPassword()) != 0)
{
resultMsg = new ResultMsg(ResultStatusCode.INVALID_PASSWORD.getErrcode(),
ResultStatusCode.INVALID_PASSWORD.getErrmsg(), null);
return resultMsg;
}
}
//拼装accessToken
String accessToken = JwtHelper.createJWT(
loginPara.getUserName(),
String.valueOf(user.getName()),
user.getRole(),
audienceEntity.getClientId(),
audienceEntity.getName(),
audienceEntity.getExpiresSecond() * 1000,
audienceEntity.getBase64Secret()
);
//返回accessToken
AccessToken accessTokenEntity = new AccessToken();
accessTokenEntity.setAccess_token(accessToken);
accessTokenEntity.setExpires_in(audienceEntity.getExpiresSecond());
accessTokenEntity.setToken_type("bearer");
resultMsg = new ResultMsg(ResultStatusCode.OK.getErrcode(),
ResultStatusCode.OK.getErrmsg(), accessTokenEntity);
return resultMsg;
}
catch(Exception ex)
{
resultMsg = new ResultMsg(ResultStatusCode.SYSTEM_ERR.getErrcode(),
ResultStatusCode.SYSTEM_ERR.getErrmsg(), null);
return resultMsg;
}
}
@GetMapping("hello")
public String hello(){
return "hello";
}
}
| [
"[email protected]"
] | |
b88451a5908c80f168452a2941f1627d296cd711 | 9019a0dda1150b6897b9140b818b8bf96a62fd92 | /trec-ndd/src/main/java/de/webis/trec_ndd/App.java | 30aec45351eb658dee7e54f0fda40cb3ed6fbf10 | [] | no_license | mam10eks/robust04-self-similarity-join | 8d7cd2dc3308e6272dc2db68b794aba7be8d8b20 | ef38ab8383fea8a50c02994d8fde28c610988e1b | refs/heads/master | 2022-07-16T18:27:12.771639 | 2021-05-12T04:25:38 | 2021-05-12T04:25:38 | 195,593,741 | 0 | 0 | null | 2022-06-22T18:38:10 | 2019-07-07T00:17:10 | Java | UTF-8 | Java | false | false | 2,358 | java | package de.webis.trec_ndd;
import java.io.IOException;
import java.util.Set;
import org.apache.http.HttpHost;
import de.webis.trec_ndd.es.ElasticSearchClient;
import de.webis.trec_ndd.similarity.TextProfileSignatureSimilarity;
import de.webis.trec_ndd.similarity.TextSimilarity;
import de.webis.trec_ndd.trec_collections.QrelReader;
import de.webis.trec_ndd.util.QueryByExampleBuilder;
public class App {
public static void main(String[] args) throws IOException {
System.out.println("Please note that you must be connected to the vpn ;)");
executeExampleReadOnlyRequestsProductionElasticsearch();
readSomeQrelFiles();
doSomeNearDuplicateDetection();
}
private static void executeExampleReadOnlyRequestsProductionElasticsearch() throws IOException {
//Attention: Our production system. Please use only read operations!
ElasticSearchClient client = productionCluewebElasticSearch();
String documentId = "340b9756-040d-5a2d-b062-d351fb7ca660";
String documentText = client.getTextOfDocument(documentId);
System.out.println("The full text of document '"+
documentId +"' is: " + documentText);
String query = QueryByExampleBuilder.esQueryByExampleWithKMedianTokens(documentText, 5);
System.out.println("I use the query '"+ query +"' to obtain near duplicates.");
System.out.println(client.getDocumentsForQuery(query, 3));
}
private static void readSomeQrelFiles() throws IOException {
String exampleQrelFile = "topics-and-qrels/qrels.web.51-100.txt";
Set<String> judgedDocumentIds = new QrelReader().readJudgedDocumentIdsFromQrelsFile(exampleQrelFile);
System.out.println("The qrel-file '"+ exampleQrelFile
+"' has the following documents with judgements: "
+ judgedDocumentIds);
}
private static void doSomeNearDuplicateDetection() {
TextSimilarity textSimilarity = new TextProfileSignatureSimilarity();
String textOfDocumentA = "Hello World";
String textOfDocumentB = "Hello World";
System.out.println("Dummy documents are near-duplicates: "
+ textSimilarity.textsAreSimilar(textOfDocumentA, textOfDocumentB)
);
}
private static ElasticSearchClient productionCluewebElasticSearch() {
String index = "webis_warc_clueweb12_011";
HttpHost productionHost = new HttpHost("betaweb120", 9200, "http");
return new ElasticSearchClient(productionHost, index);
}
}
| [
"[email protected]"
] | |
c08468d24bcc348540dae848cac0ff2eb785258b | b752743f04621c57a3dc07cdd4becbd97408b2c5 | /ReadMe/app/src/droidQuery-master/droidQuery/src/self/philbrown/droidQuery/CustomHttpUriRequest.java | 262e622b178b9230188a91b33f0dcaefb6506a73 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | Nuriix/ConUHacks2 | 269f70ed56d5599e06a2431530ce4727aa690bda | b723070ed854f50d49ab7d894cea8eb8b091462b | refs/heads/master | 2021-01-11T18:55:13.366752 | 2017-01-23T21:54:49 | 2017-01-23T21:54:49 | 79,657,517 | 0 | 3 | null | 2017-01-22T06:26:50 | 2017-01-21T16:29:42 | Java | UTF-8 | Java | false | false | 965 | java | /*
* Copyright 2013 Phil Brown
*
* 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 self.philbrown.droidQuery;
import org.apache.http.client.methods.HttpUriRequest;
/**
* Used to create custom HTTP Requests for Ajax
* @author Phil Brown
*/
public abstract class CustomHttpUriRequest implements HttpUriRequest {
/**
* Constructor
* @param url the URL of the page to request
*/
protected CustomHttpUriRequest(String url)
{
}
}
| [
"[email protected]"
] | |
6922482ea06de9ea38f4a8d5b2e0ab4997ecee47 | a86d058e0b602d357407fb4cc1120a52cf767c69 | /logstash-core/src/main/java/org/logstash/instrument/metrics/counter/LongCounter.java | 69aeceafb050e6a1c6f3f3ba4367dcb6a5e350ce | [
"Apache-2.0"
] | permissive | zentavr/logstash | c1d09c5f69d4c5182747c52a429d9db03a1abab4 | 63aba80eaffa0bc8a1a5d5b2fd9f4b9fc82d0f7c | refs/heads/master | 2021-05-07T19:55:12.770689 | 2017-11-14T20:27:09 | 2017-11-14T20:27:09 | 108,912,907 | 1 | 0 | null | 2017-10-30T21:57:08 | 2017-10-30T21:57:08 | null | UTF-8 | Java | false | false | 1,793 | java | package org.logstash.instrument.metrics.counter;
import org.logstash.instrument.metrics.AbstractMetric;
import org.logstash.instrument.metrics.MetricType;
import java.util.concurrent.atomic.LongAdder;
/**
* A {@link CounterMetric} that is backed by a {@link Long} type.
*/
public class LongCounter extends AbstractMetric<Long> implements CounterMetric<Long> {
private static final IllegalArgumentException NEGATIVE_COUNT_EXCEPTION = new IllegalArgumentException("Counters can not be incremented by negative values");
private LongAdder longAdder;
/**
* Constructor
*
* @param name The name of this metric. This value may be used for display purposes.
*/
public LongCounter(String name) {
super(name);
longAdder = new LongAdder();
}
@Override
public MetricType getType() {
return MetricType.COUNTER_LONG;
}
@Override
public Long getValue() {
return longAdder.longValue();
}
@Override
public void increment() {
increment(1l);
}
@Override
public void increment(Long by) {
if (by < 0) {
throw NEGATIVE_COUNT_EXCEPTION;
}
longAdder.add(by);
}
/**
* Optimized version of {@link #increment(Long)} to avoid auto-boxing.
* @param by The value which to increment by. Can not be negative.
*/
public void increment(long by) {
if (by < 0) {
throw NEGATIVE_COUNT_EXCEPTION;
}
longAdder.add(by);
}
/**
* Resets the counter back to it's initial state.
*/
public void reset(){
//replacing since LongAdder#reset "is only effective if there are no concurrent updates", we can not make that guarantee
longAdder = new LongAdder();
}
}
| [
"[email protected]"
] | |
52e1e80476c8646b0f28465e8bac1a000d39cb99 | 2055c9c3c6531511d29a3ad7ab8f2ad1785ccc8a | /python.django/src/org/netbeans/modules/python/django/project/ui/wizards/DjangoApplicationWizardPanel1.java | 2b350d67586b8d51d9c854d77f8a18d5bc2d8710 | [] | no_license | Seha16/netbeans-django | 30534cbdc7bbbd5dd82b6e5523a853ee102bee62 | 24c9c359740a9d945afca9214a2606b185f994c1 | refs/heads/master | 2020-05-28T07:42:30.130567 | 2009-03-04T09:21:53 | 2009-03-04T09:21:53 | 40,284,852 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,789 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.netbeans.modules.python.django.project.ui.wizards;
import java.awt.Component;
import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx;
public class DjangoApplicationWizardPanel1 implements WizardDescriptor.Panel {
/**
* The visual component that displays this panel. If you need to access the
* component from this class, just use getComponent().
*/
private Component component;
// Get the visual component for the panel. In this template, the component
// is kept separate. This can be more efficient: if the wizard is created
// but never displayed, or not all panels are displayed, it is better to
// create only those which really need to be visible.
public Component getComponent() {
if (component == null) {
component = new DjangoApplicationVisualPanel1();
}
return component;
}
public HelpCtx getHelp() {
// Show no Help button for this panel:
return HelpCtx.DEFAULT_HELP;
// If you have context help:
// return new HelpCtx(SampleWizardPanel1.class);
}
public boolean isValid() {
// If it is always OK to press Next or Finish, then:
return true;
// If it depends on some condition (form filled out...), then:
// return someCondition();
// and when this condition changes (last form field filled in...) then:
// fireChangeEvent();
// and uncomment the complicated stuff below.
}
public final void addChangeListener(ChangeListener l) {
}
public final void removeChangeListener(ChangeListener l) {
}
/*
private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1); // or can use ChangeSupport in NB 6.0
public final void addChangeListener(ChangeListener l) {
synchronized (listeners) {
listeners.add(l);
}
}
public final void removeChangeListener(ChangeListener l) {
synchronized (listeners) {
listeners.remove(l);
}
}
protected final void fireChangeEvent() {
Iterator<ChangeListener> it;
synchronized (listeners) {
it = new HashSet<ChangeListener>(listeners).iterator();
}
ChangeEvent ev = new ChangeEvent(this);
while (it.hasNext()) {
it.next().stateChanged(ev);
}
}
*/
// You can use a settings object to keep track of state. Normally the
// settings object will be the WizardDescriptor, so you can use
// WizardDescriptor.getProperty & putProperty to store information entered
// by the user.
public void readSettings(Object settings) {
}
public void storeSettings(Object settings) {
}
}
| [
"alberto.paro@53ee0c52-ff2b-11dd-9d1d-173cc1d06e3c"
] | alberto.paro@53ee0c52-ff2b-11dd-9d1d-173cc1d06e3c |
560377673bf5d465df3b220eeade41895e9103a3 | 81cf7eb8613af1d178e85888cc15e74669f69273 | /app/src/test/java/quotes/AppTest.java | 30839d7eb9c923681aeb19576bea13e1d482ed01 | [] | no_license | ahmedbani/quotes | 975cd67a752b922abec6ed3a897e19954b6da52d | 37c35ef7879e6f93278c3027028fe5ebd4cddc42 | refs/heads/main | 2023-09-01T16:34:07.765323 | 2021-10-26T08:50:59 | 2021-10-26T08:50:59 | 419,364,957 | 0 | 0 | null | 2021-10-20T16:39:22 | 2021-10-20T14:29:31 | null | UTF-8 | Java | false | false | 3,106 | java | /*
* This Java source file was generated by the Gradle 'init' task.
*/
package quotes;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.junit.jupiter.api.Test;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.util.Arrays;
import static org.junit.jupiter.api.Assertions.*;
class AppTest {
Gson gson = new Gson();
@Test void gson() throws FileNotFoundException {
Reader reader = new FileReader("/Users/macbookpro/projects/401/quotes/app/src/main/resources/data.json");
Quotes [] quotesArray = gson.fromJson(reader,Quotes[].class);
Quotes quote = quotesArray[5];
String text = "{\"author\":\"ahmed\",\"text\":\"roses are red\"}";
Quotes quote1 = gson.fromJson(text,Quotes.class);
assertTrue(Arrays.asList(quotesArray).contains(quote));
assertFalse(Arrays.asList(quotesArray).contains(quote1));
assertEquals("{\"author\":\"Marilyn Monroe\",\"text\": “I am good, but not an angel. I do sin, but I am not the devil. I am just a small girl in a big world trying to find someone to love.” }",quotesArray[0].toString());
}
@Test void testApi() throws IOException {
Gson gson = new Gson();
URL url = new URL("http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11");
InputStream inputStream = connection.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader input = new BufferedReader(inputStreamReader);
String quote = input.readLine();
ApiQuotes newQuote = gson.fromJson(quote, ApiQuotes.class);
System.out.println(newQuote);
try {
Object obj = JsonParser.parseReader(new FileReader("/Users/macbookpro/projects/401/quotes/app/src/main/resources/Data.json"));
JsonArray jsonArray = (JsonArray)obj;
JsonObject quoteToAdd = new JsonObject();
quoteToAdd.addProperty("author",newQuote.getQuoteAuthor());
quoteToAdd.addProperty("quote",newQuote.getQuoteText());
jsonArray.add(quoteToAdd);
System.out.println(jsonArray.get(jsonArray.size()-1));
FileWriter file = new FileWriter("/Users/macbookpro/projects/401/quotes/app/src/main/resources/Data.json");
file.write(jsonArray.toString());
file.flush();
file.close();
assertTrue(jsonArray.contains(quoteToAdd));
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
d2a2f1c031af068b2b9702c4888963734f89bb90 | 12563229bd1c69d26900d4a2ea34fe4c64c33b7e | /nan21.dnet.module.ad/nan21.dnet.module.ad.presenter/src/main/java/net/nan21/dnet/module/ad/workflow/ds/model/WfDefNodeFieldDs.java | d0d2034848377876d2661bf080afb22e73d5f875 | [] | no_license | nan21/nan21.dnet.modules | 90b002c6847aa491c54bd38f163ba40a745a5060 | 83e5f02498db49e3d28f92bd8216fba5d186dd27 | refs/heads/master | 2023-03-15T16:22:57.059953 | 2012-08-01T07:36:57 | 2012-08-01T07:36:57 | 1,918,395 | 0 | 1 | null | 2012-07-24T03:23:00 | 2011-06-19T05:56:03 | Java | UTF-8 | Java | false | false | 1,582 | java | /*
* DNet eBusiness Suite
* Copyright: 2008-2012 Nan21 Electronics SRL. All rights reserved.
* Use is subject to license terms.
*/
package net.nan21.dnet.module.ad.workflow.ds.model;
import net.nan21.dnet.core.api.annotation.Ds;
import net.nan21.dnet.core.api.annotation.DsField;
import net.nan21.dnet.core.api.annotation.SortField;
import net.nan21.dnet.core.presenter.model.base.AbstractTypeDs;
import net.nan21.dnet.module.ad.workflow.domain.entity.WfDefNodeField;
@Ds(entity = WfDefNodeField.class, sort = { @SortField(field = WfDefNodeFieldDs.fNAME) })
public class WfDefNodeFieldDs extends AbstractTypeDs<WfDefNodeField> {
public static final String fTYPE = "type";
public static final String fREQUIRED = "required";
public static final String fNODEID = "nodeId";
@DsField()
private String type;
@DsField()
private Boolean required;
@DsField(join = "left", path = "node.id")
private Long nodeId;
public WfDefNodeFieldDs() {
super();
}
public WfDefNodeFieldDs(WfDefNodeField e) {
super(e);
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
public Boolean getRequired() {
return this.required;
}
public void setRequired(Boolean required) {
this.required = required;
}
public Long getNodeId() {
return this.nodeId;
}
public void setNodeId(Long nodeId) {
this.nodeId = nodeId;
}
}
| [
"[email protected]"
] | |
4c070ef7bda03f8a56214549cadd43aa15add9dc | 61fcf94ee170f516448ed8bbe3ee9ddaa6781239 | /app/src/main/java/com/example/crime/missingcrime/AdminHome.java | 0ebb2ecf1d2e5c999e0e8737c7a1af4f3a544172 | [] | no_license | narayandudhe/CrimeReport | 5a6febca897dd653cf437a614079cb18c6bf955f | f429fdbeacc1c13fb7aba356dc8d06d7e4d36a22 | refs/heads/master | 2020-05-31T01:34:34.430414 | 2019-06-03T17:35:57 | 2019-06-03T17:35:57 | 190,052,072 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,359 | java | package com.example.crime.missingcrime;
import android.Manifest;
import android.app.Dialog;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.net.Uri;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.telephony.SmsManager;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.example.crime.missingcrime.Model.UserModel;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
public class AdminHome extends AppCompatActivity {
private static final String TAG = "MissingPersonMenuActivity";
private static final int ERROR_DIALOG_REQUEST = 9001;
private FirebaseAuth mAuth;
private FirebaseUser user;
public UserModel userModel;
Button send;
TextView textView;
public FirebaseDatabase database;
CardView add,list,myReports;
private FusedLocationProviderClient client;
private LocationManager locationManager;
private com.google.android.gms.location.LocationListener listener;
public static final int REQUEST_ID_MULTIPLE_PERMISSIONS = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_home);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mAuth = FirebaseAuth.getInstance();
user = FirebaseAuth.getInstance().getCurrentUser();
if(checkAndRequestPermissions()) {
// carry on the normal flow, as the case of permissions granted.
}
textView = findViewById(R.id.location);
database = FirebaseDatabase.getInstance();
client = LocationServices.getFusedLocationProviderClient(this);
cardView();
}
@Override
protected void onStart() {
super.onStart();
if (user != null) {
// User is signed in
} else {
Intent intentLogin= new Intent(this, SignInActivity.class );
startActivity(intentLogin);
}
}
public boolean isServicesOK(){
int available = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(AdminHome.this);
if(available == ConnectionResult.SUCCESS){
//everything is fine and the user can make map requests
Toast.makeText(this, "isServicesOK: Google Play Services is working", Toast.LENGTH_SHORT).show();
return true;
}
else if(GoogleApiAvailability.getInstance().isUserResolvableError(available)){
//an error occured but we can resolve it
Toast.makeText(this, "isServicesOK: an error occured but we can fix it", Toast.LENGTH_SHORT).show();
Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(AdminHome.this, available, ERROR_DIALOG_REQUEST);
dialog.show();
}else{
Toast.makeText(this, "You can't make map requests", Toast.LENGTH_SHORT).show();
}
return false;
}
public void cardView()
{
list=(CardView)findViewById(R.id.reportList);
myReports=(CardView)findViewById(R.id.myReports);
// on click
list.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
reportList();
}
});
myReports.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
myReport();
}
});
}
void signOut()
{
FirebaseAuth.getInstance().signOut();
Intent intent = new Intent(AdminHome.this, SignInActivity.class);
startActivity(intent);
finish();
return;
}
private void requestPermission(){
ActivityCompat.requestPermissions(this, new String[]{ACCESS_FINE_LOCATION}, 1);
if (ContextCompat.checkSelfPermission(this,
android.Manifest.permission.SEND_SMS)
!= PackageManager.PERMISSION_GRANTED)
{
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
android.Manifest.permission.SEND_SMS))
{
Toast.makeText(getBaseContext(),
"App requires permission to send SMS",
Toast.LENGTH_SHORT).show();
}
else
{
// No explanation needed, we can request the permission.
ActivityCompat.requestPermissions(this,
new String[]{android.Manifest.permission.SEND_SMS},
1);
}
} }
private boolean checkAndRequestPermissions() {
int permissionSendMessage = ContextCompat.checkSelfPermission(this,
android.Manifest.permission.SEND_SMS);
int locationPermission = ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION);
List<String> listPermissionsNeeded = new ArrayList<>();
if (locationPermission != PackageManager.PERMISSION_GRANTED) {
listPermissionsNeeded.add(android.Manifest.permission.ACCESS_FINE_LOCATION);
}
if (permissionSendMessage != PackageManager.PERMISSION_GRANTED) {
listPermissionsNeeded.add(Manifest.permission.SEND_SMS);
}
if (!listPermissionsNeeded.isEmpty()) {
ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]),REQUEST_ID_MULTIPLE_PERMISSIONS);
return false;
}
return true;
}
public void addReport()
{
Intent intentAddCrime = new Intent(this, AddReportActivity.class);
startActivity(intentAddCrime);
}
public void reportList()
{
Intent intentReportList = new Intent(this, AdminReports.class);
startActivity(intentReportList);
}
public void myReport()
{
Intent myReports = new Intent(this, ApproveActivity.class);
startActivity(myReports);
}
public void emergencyContact()
{
Intent intentContacts = new Intent(this, ContactsActvity.class);
startActivity(intentContacts);
}
}
| [
"[email protected]"
] | |
8fcc945b90f060f35ba9c589d1d470d80353dec0 | daef55c1cb336fe3c82d71e36f62a4934c2f3e0f | /it.ismb.pert.pwal.core.smartcity.api/src/main/java/it/ismb/pertlab/smartcity/api/Quarter.java | 724fb3eec2ff3a39f3e507cd37dc6f95aa599be2 | [
"Apache-2.0"
] | permissive | almanacproject/scral | 9e13aff8b41d7bab426e826d46f8b0ed337794e2 | b4771e8464ea7f3962bdc342b3a71dbd3e71c924 | refs/heads/master | 2021-01-11T06:20:12.676724 | 2016-10-06T13:34:58 | 2016-10-06T13:34:58 | 70,152,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,715 | java | /*
* SmartCityAPI - core
*
* Copyright (c) 2014 Dario Bonino
*
* 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 it.ismb.pertlab.smartcity.api;
import java.util.HashSet;
import java.util.Set;
/**
*
* @author <a href="mailto:[email protected]">Dario Bonino</a>
*
*/
public class Quarter
{
// The quarter name
private String name;
// the quarter url
private String url;
// The quarter human-readable description
private String description;
// the city name
private SmartCity city;
// the district name
private District district;
// the set of waste production data, per year and genre
private Set<WasteProduction> wasteProduction;
// the quarter boundary
private GeoBoundary boundary;
// the waste bins located in the quarter
public Set<WasteBin> bins;
/**
*
*/
public Quarter()
{
// initialize inner data structures
this.wasteProduction = new HashSet<WasteProduction>();
this.bins = new HashSet<WasteBin>();
}
public Quarter(String name)
{
// store the name
this.setName(name);
// initialize inner data structures
this.wasteProduction = new HashSet<WasteProduction>();
this.bins = new HashSet<WasteBin>();
}
/**
* @return the name
*/
public String getName()
{
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name)
{
this.name = name;
}
/**
* @return the city
*/
public SmartCity getCity()
{
return city;
}
/**
* @param city
* the city to set
*/
public void setCity(SmartCity city)
{
this.city = city;
}
/**
* @return the district
*/
public District getDistrict()
{
return district;
}
/**
* @param district the district to set
*/
public void setDistrict(District district)
{
this.district = district;
}
/**
* @return the wasteProduction
*/
public Set<WasteProduction> getWasteProduction()
{
return wasteProduction;
}
/**
* @param wasteProduction
* the wasteProduction to set
*/
public void setWasteProduction(Set<WasteProduction> wasteProduction)
{
this.wasteProduction = wasteProduction;
}
public void addWasteProduction(WasteProduction wasteProduction)
{
this.wasteProduction.add(wasteProduction);
}
/**
* @return the boundary
*/
public GeoBoundary getBoundary()
{
return boundary;
}
/**
* @param boundary
* the boundary to set
*/
public void setBoundary(GeoBoundary boundary)
{
this.boundary = boundary;
}
/**
* @return the bins
*/
public Set<WasteBin> getBins()
{
return bins;
}
/**
* @param bins
* the bins to set
*/
public void setBins(Set<WasteBin> bins)
{
this.bins = bins;
}
public void addBin(WasteBin bin)
{
this.bins.add(bin);
}
/**
* @return the description
*/
public String getDescription()
{
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* @return the url
*/
public String getUrl()
{
return url;
}
/**
* @param url the url to set
*/
public void setUrl(String url)
{
this.url = url;
}
} | [
"[email protected]"
] | |
949a1b86e3f1ec7e539c4ed4e8a0185e9f1808e8 | 2fc61092f6b10492f88bb4b20dc181ee5f49580f | /app/src/main/java/co/in/divi/ui/CountDownTimerView.java | e258a859112d9d0a13d493916f309009c470fc4f | [] | no_license | indra83/Divi2 | 9f51c67b102697652621338c050ef0b7577266b1 | 2ab9d9b7beb7bc7b9e7708ab54165f5305a14779 | refs/heads/master | 2023-04-22T00:46:17.642565 | 2021-05-10T07:50:35 | 2021-05-10T07:50:35 | 27,070,971 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,249 | java | package co.in.divi.ui;
import co.in.divi.util.Util;
import android.content.Context;
import android.os.Handler;
import android.text.Html;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
public class CountDownTimerView extends TextView {
private static final String TAG = CountDownTimerView.class.getSimpleName();
private static final long UPDATE_FREQUENCY = 499; // ms
public static final long FOREVER = Long.MAX_VALUE;
public interface CountDownTimerViewListener {
public void timerEvent();
}
private enum TimerState {
BEFORE, DURING, AFTER
}
private CountDownTimerViewListener listener = null;
private Handler handler;
private long endTime;
private String preText;
private TimerState curState;
private Runnable updateTextRunnable = new Runnable() {
@Override
public void run() {
long now = Util.getTimestampMillis();
if (now > endTime) {
if (listener != null)
listener.timerEvent();
stop();
return;
} else {
long diff_secs = (endTime - now) / 1000;
String text = preText
+ " <b>"
+ String.format("%02d:%02d", diff_secs / 60, diff_secs % 60)
+ "</b>";
setText(Html.fromHtml(text));
}
handler.postDelayed(updateTextRunnable, UPDATE_FREQUENCY);
}
};
public CountDownTimerView(Context context, AttributeSet attrs) {
super(context, attrs);
handler = new Handler();
}
public void start(long endTime, String preText, CountDownTimerViewListener listener) {
if (Util.getTimestampMillis() > endTime)
throw new RuntimeException("End time is in past!");
this.listener = listener;
this.preText = preText;
this.endTime = endTime;
handler.removeCallbacks(updateTextRunnable);
handler.post(updateTextRunnable);
setVisibility(View.VISIBLE);
}
public void stop() {
handler.removeCallbacks(updateTextRunnable);
listener = null;
setVisibility(View.INVISIBLE);
}
}
| [
"[email protected]"
] | |
440ba3f910d3043726876ae33f4f5e446cfe72b9 | 379729a2a64021d6af30d0a980d420769e83b3c0 | /YiBoLibrary/src/com/cattong/commons/util/Base64.java | adb8948fed6e6677681172e3ed4c3e5fcd00873f | [
"Apache-2.0"
] | permissive | Terry-L/YiBo | 632e81ab27d104c73fda0c36e277d77b61a23255 | 6c5709c839722553b963cfb0c883fcd6cf99f8c7 | refs/heads/master | 2021-01-01T17:48:00.816313 | 2013-12-06T08:26:53 | 2013-12-06T08:26:53 | 14,976,533 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 26,069 | java | package com.cattong.commons.util;
/*
* Copyright 2001-2008 The Apache Software Foundation.
* 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.
*/
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
/**
* Provides Base64 encoding and decoding as defined by RFC 2045.
*
* <p>
* This class implements section <cite>6.8. Base64 Content-Transfer-Encoding</cite> from RFC 2045 <cite>Multipurpose
* Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</cite> by Freed and Borenstein.
* </p>
*
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
* @author Apache Software Foundation
* @author John Kristian
*/
public class Base64 {
/**
* Chunk size per RFC 2045 section 6.8.
*
* <p>
* The {@value} character limit does not count the trailing CRLF, but counts all other characters, including any
* equal signs.
* </p>
*
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 section 6.8</a>
*/
static final int CHUNK_SIZE = 76;
/**
* Chunk separator per RFC 2045 section 2.1.
*
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 section 2.1</a>
*/
static final byte[] CHUNK_SEPARATOR = {'\r', '\n'};
/**
* This array is a lookup table that translates 6-bit positive integer
* index values into their "Base64 Alphabet" equivalents as specified
* in Table 1 of RFC 2045.
*
* Thanks to "commons" project in ws.apache.org for this code.
* http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
*/
private static final byte[] intToBase64 = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
};
/**
* Byte used to pad output.
*/
private static final byte PAD = '=';
/**
* This array is a lookup table that translates unicode characters
* drawn from the "Base64 Alphabet" (as specified in Table 1 of RFC 2045)
* into their 6-bit positive integer equivalents. Characters that
* are not in the Base64 alphabet but fall within the bounds of the
* array are translated to -1.
*
* Thanks to "commons" project in ws.apache.org for this code.
* http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
*/
private static final byte[] base64ToInt = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
};
/** Mask used to extract 6 bits, used when encoding */
private static final int MASK_6BITS = 0x3f;
/** Mask used to extract 8 bits, used in decoding base64 bytes */
private static final int MASK_8BITS = 0xff;
// The static final fields above are used for the original static byte[] methods on Base64.
// The private member fields below are used with the new streaming approach, which requires
// some state be preserved between calls of encode() and decode().
/**
* Line length for encoding. Not used when decoding. A value of zero or less implies
* no chunking of the base64 encoded data.
*/
private final int lineLength;
/**
* Line separator for encoding. Not used when decoding. Only used if lineLength > 0.
*/
private final byte[] lineSeparator;
/**
* Convenience variable to help us determine when our buffer is going to run out of
* room and needs resizing. <code>decodeSize = 3 + lineSeparator.length;</code>
*/
private final int decodeSize;
/**
* Convenience variable to help us determine when our buffer is going to run out of
* room and needs resizing. <code>encodeSize = 4 + lineSeparator.length;</code>
*/
private final int encodeSize;
/**
* Buffer for streaming.
*/
private byte[] buf;
/**
* Position where next character should be written in the buffer.
*/
private int pos;
/**
* Position where next character should be read from the buffer.
*/
private int readPos;
/**
* Variable tracks how many characters have been written to the current line.
* Only used when encoding. We use it to make sure each encoded line never
* goes beyond lineLength (if lineLength > 0).
*/
private int currentLinePos;
/**
* Writes to the buffer only occur after every 3 reads when encoding, an
* every 4 reads when decoding. This variable helps track that.
*/
private int modulus;
/**
* Boolean flag to indicate the EOF has been reached. Once EOF has been
* reached, this Base64 object becomes useless, and must be thrown away.
*/
private boolean eof;
/**
* Place holder for the 3 bytes we're dealing with for our base64 logic.
* Bitwise operations store and extract the base64 encoding or decoding from
* this variable.
*/
private int x;
/**
* Default constructor: lineLength is 76, and the lineSeparator is CRLF
* when encoding, and all forms can be decoded.
*/
public Base64() {
this(CHUNK_SIZE, CHUNK_SEPARATOR);
}
/**
* <p>
* Consumer can use this constructor to choose a different lineLength
* when encoding (lineSeparator is still CRLF). All forms of data can
* be decoded.
* </p><p>
* Note: lineLengths that aren't multiples of 4 will still essentially
* end up being multiples of 4 in the encoded data.
* </p>
*
* @param lineLength each line of encoded data will be at most this long
* (rounded up to nearest multiple of 4).
* If lineLength <= 0, then the output will not be divided into lines (chunks).
* Ignored when decoding.
*/
public Base64(int lineLength) {
this(lineLength, CHUNK_SEPARATOR);
}
/**
* <p>
* Consumer can use this constructor to choose a different lineLength
* and lineSeparator when encoding. All forms of data can
* be decoded.
* </p><p>
* Note: lineLengths that aren't multiples of 4 will still essentially
* end up being multiples of 4 in the encoded data.
* </p>
* @param lineLength Each line of encoded data will be at most this long
* (rounded up to nearest multiple of 4). Ignored when decoding.
* If <= 0, then output will not be divided into lines (chunks).
* @param lineSeparator Each line of encoded data will end with this
* sequence of bytes.
* If lineLength <= 0, then the lineSeparator is not used.
* @throws IllegalArgumentException The provided lineSeparator included
* some base64 characters. That's not going to work!
*/
public Base64(int lineLength, byte[] lineSeparator) {
this.lineLength = lineLength;
this.lineSeparator = new byte[lineSeparator.length];
System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length);
if (lineLength > 0) {
this.encodeSize = 4 + lineSeparator.length;
} else {
this.encodeSize = 4;
}
this.decodeSize = encodeSize - 1;
if (containsBase64Byte(lineSeparator)) {
String sep;
try {
sep = new String(lineSeparator, "UTF-8");
} catch (UnsupportedEncodingException uee) {
sep = new String(lineSeparator);
}
throw new IllegalArgumentException("lineSeperator must not contain base64 characters: [" + sep + "]");
}
}
/**
* Returns true if this Base64 object has buffered data for reading.
*
* @return true if there is Base64 object still available for reading.
*/
boolean hasData() { return buf != null; }
/**
* Returns the amount of buffered data available for reading.
*
* @return The amount of buffered data available for reading.
*/
int avail() { return buf != null ? pos - readPos : 0; }
/** Doubles our buffer. */
private void resizeBuf() {
if (buf == null) {
buf = new byte[8192];
pos = 0;
readPos = 0;
} else {
byte[] b = new byte[buf.length * 2];
System.arraycopy(buf, 0, b, 0, buf.length);
buf = b;
}
}
/**
* Extracts buffered data into the provided byte[] array, starting
* at position bPos, up to a maximum of bAvail bytes. Returns how
* many bytes were actually extracted.
*
* @param b byte[] array to extract the buffered data into.
* @param bPos position in byte[] array to start extraction at.
* @param bAvail amount of bytes we're allowed to extract. We may extract
* fewer (if fewer are available).
* @return The number of bytes successfully extracted into the provided
* byte[] array.
*/
int readResults(byte[] b, int bPos, int bAvail) {
if (buf != null) {
int len = Math.min(avail(), bAvail);
if (buf != b) {
System.arraycopy(buf, readPos, b, bPos, len);
readPos += len;
if (readPos >= pos) {
buf = null;
}
} else {
// Re-using the original consumer's output array is only
// allowed for one round.
buf = null;
}
return len;
} else {
return eof ? -1 : 0;
}
}
/**
* Small optimization where we try to buffer directly to the consumer's
* output array for one round (if consumer calls this method first!) instead
* of starting our own buffer.
*
* @param out byte[] array to buffer directly to.
* @param outPos Position to start buffering into.
* @param outAvail Amount of bytes available for direct buffering.
*/
void setInitialBuffer(byte[] out, int outPos, int outAvail) {
// We can re-use consumer's original output array under
// special circumstances, saving on some System.arraycopy().
if (out != null && out.length == outAvail) {
buf = out;
pos = outPos;
readPos = outPos;
}
}
/**
* <p>
* Encodes all of the provided data, starting at inPos, for inAvail bytes.
* Must be called at least twice: once with the data to encode, and once
* with inAvail set to "-1" to alert encoder that EOF has been reached,
* so flush last remaining bytes (if not multiple of 3).
* </p><p>
* Thanks to "commons" project in ws.apache.org for the bitwise operations,
* and general approach.
* http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
* </p>
*
* @param in byte[] array of binary data to base64 encode.
* @param inPos Position to start reading data from.
* @param inAvail Amount of bytes available from input for encoding.
*/
void encode(byte[] in, int inPos, int inAvail) {
if (eof) {
return;
}
// inAvail < 0 is how we're informed of EOF in the underlying data we're
// encoding.
if (inAvail < 0) {
eof = true;
if (buf == null || buf.length - pos < encodeSize) {
resizeBuf();
}
switch (modulus) {
case 1:
buf[pos++] = intToBase64[(x >> 2) & MASK_6BITS];
buf[pos++] = intToBase64[(x << 4) & MASK_6BITS];
buf[pos++] = PAD;
buf[pos++] = PAD;
break;
case 2:
buf[pos++] = intToBase64[(x >> 10) & MASK_6BITS];
buf[pos++] = intToBase64[(x >> 4) & MASK_6BITS];
buf[pos++] = intToBase64[(x << 2) & MASK_6BITS];
buf[pos++] = PAD;
break;
}
if (lineLength > 0) {
System.arraycopy(lineSeparator, 0, buf, pos, lineSeparator.length);
pos += lineSeparator.length;
}
} else {
for (int i = 0; i < inAvail; i++) {
if (buf == null || buf.length - pos < encodeSize) {
resizeBuf();
}
modulus = (++modulus) % 3;
int b = in[inPos++];
if (b < 0) { b += 256; }
x = (x << 8) + b;
if (0 == modulus) {
buf[pos++] = intToBase64[(x >> 18) & MASK_6BITS];
buf[pos++] = intToBase64[(x >> 12) & MASK_6BITS];
buf[pos++] = intToBase64[(x >> 6) & MASK_6BITS];
buf[pos++] = intToBase64[x & MASK_6BITS];
currentLinePos += 4;
if (lineLength > 0 && lineLength <= currentLinePos) {
System.arraycopy(lineSeparator, 0, buf, pos, lineSeparator.length);
pos += lineSeparator.length;
currentLinePos = 0;
}
}
}
}
}
/**
* <p>
* Decodes all of the provided data, starting at inPos, for inAvail bytes.
* Should be called at least twice: once with the data to decode, and once
* with inAvail set to "-1" to alert decoder that EOF has been reached.
* The "-1" call is not necessary when decoding, but it doesn't hurt, either.
* </p><p>
* Ignores all non-base64 characters. This is how chunked (e.g. 76 character)
* data is handled, since CR and LF are silently ignored, but has implications
* for other bytes, too. This method subscribes to the garbage-in, garbage-out
* philosophy: it will not check the provided data for validity.
* </p><p>
* Thanks to "commons" project in ws.apache.org for the bitwise operations,
* and general approach.
* http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
* </p>
* @param in byte[] array of ascii data to base64 decode.
* @param inPos Position to start reading data from.
* @param inAvail Amount of bytes available from input for encoding.
*/
void decode(byte[] in, int inPos, int inAvail) {
if (eof) {
return;
}
if (inAvail < 0) {
eof = true;
}
for (int i = 0; i < inAvail; i++) {
if (buf == null || buf.length - pos < decodeSize) {
resizeBuf();
}
byte b = in[inPos++];
if (b == PAD) {
x = x << 6;
switch (modulus) {
case 2:
x = x << 6;
buf[pos++] = (byte) ((x >> 16) & MASK_8BITS);
break;
case 3:
buf[pos++] = (byte) ((x >> 16) & MASK_8BITS);
buf[pos++] = (byte) ((x >> 8) & MASK_8BITS);
break;
}
// WE'RE DONE!!!!
eof = true;
return;
} else {
if (b >= 0 && b < base64ToInt.length) {
int result = base64ToInt[b];
if (result >= 0) {
modulus = (++modulus) % 4;
x = (x << 6) + result;
if (modulus == 0) {
buf[pos++] = (byte) ((x >> 16) & MASK_8BITS);
buf[pos++] = (byte) ((x >> 8) & MASK_8BITS);
buf[pos++] = (byte) (x & MASK_8BITS);
}
}
}
}
}
}
/**
* Returns whether or not the <code>octet</code> is in the base 64 alphabet.
*
* @param octet
* The value to test
* @return <code>true</code> if the value is defined in the the base 64 alphabet, <code>false</code> otherwise.
*/
public static boolean isBase64(byte octet) {
return octet == PAD || (octet >= 0 && octet < base64ToInt.length && base64ToInt[octet] != -1);
}
/**
* Tests a given byte array to see if it contains only valid characters within the Base64 alphabet.
* Currently the method treats whitespace as valid.
*
* @param arrayOctet
* byte array to test
* @return <code>true</code> if all bytes are valid characters in the Base64 alphabet or if the byte array is
* empty; false, otherwise
*/
public static boolean isArrayByteBase64(byte[] arrayOctet) {
for (int i = 0; i < arrayOctet.length; i++) {
if (!isBase64(arrayOctet[i]) && !isWhiteSpace(arrayOctet[i])) {
return false;
}
}
return true;
}
/*
* Tests a given byte array to see if it contains only valid characters within the Base64 alphabet.
*
* @param arrayOctet
* byte array to test
* @return <code>true</code> if any byte is a valid character in the Base64 alphabet; false herwise
*/
private static boolean containsBase64Byte(byte[] arrayOctet) {
for (int i = 0; i < arrayOctet.length; i++) {
if (isBase64(arrayOctet[i])) {
return true;
}
}
return false;
}
/**
* Encodes binary data using the base64 algorithm but does not chunk the output.
*
* @param binaryData
* binary data to encode
* @return Base64 characters
*/
public static byte[] encodeBase64(byte[] binaryData) {
return encodeBase64(binaryData, false);
}
/**
* Encodes binary data using the base64 algorithm and chunks the encoded output into 76 character blocks
*
* @param binaryData
* binary data to encode
* @return Base64 characters chunked in 76 character blocks
*/
public static byte[] encodeBase64Chunked(byte[] binaryData) {
return encodeBase64(binaryData, true);
}
/**
* Decodes a byte[] containing containing characters in the Base64 alphabet.
*
* @param pArray
* A byte array containing Base64 character data
* @return a byte array containing binary data
*/
public byte[] decode(byte[] pArray) {
return decodeBase64(pArray);
}
/**
* Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
*
* @param binaryData
* Array containing binary data to encode.
* @param isChunked
* if <code>true</code> this encoder will chunk the base64 output into 76 character blocks
* @return Base64-encoded data.
* @throws IllegalArgumentException
* Thrown when the input array needs an output array bigger than {@link Integer#MAX_VALUE}
*/
public static byte[] encodeBase64(byte[] binaryData, boolean isChunked) {
if (binaryData == null || binaryData.length == 0) {
return binaryData;
}
Base64 b64 = isChunked ? new Base64() : new Base64(0);
long len = (binaryData.length * 4) / 3;
long mod = len % 4;
if (mod != 0) {
len += 4 - mod;
}
if (isChunked) {
len += (1 + (len / CHUNK_SIZE)) * CHUNK_SEPARATOR.length;
}
if (len > Integer.MAX_VALUE) {
throw new IllegalArgumentException(
"Input array too big, output array would be bigger than Integer.MAX_VALUE=" + Integer.MAX_VALUE);
}
byte[] buf = new byte[(int) len];
b64.setInitialBuffer(buf, 0, buf.length);
b64.encode(binaryData, 0, binaryData.length);
b64.encode(binaryData, 0, -1); // Notify encoder of EOF.
// Encoder might have resized, even though it was unnecessary.
if (b64.buf != buf) {
b64.readResults(buf, 0, buf.length);
}
return buf;
}
/**
* Decodes Base64 data into octets
*
* @param base64Data Byte array containing Base64 data
* @return Array containing decoded data.
*/
public static byte[] decodeBase64(byte[] base64Data) {
if (base64Data == null || base64Data.length == 0) {
return base64Data;
}
Base64 b64 = new Base64();
long len = (base64Data.length * 3) / 4;
byte[] buf = new byte[(int) len];
b64.setInitialBuffer(buf, 0, buf.length);
b64.decode(base64Data, 0, base64Data.length);
b64.decode(base64Data, 0, -1); // Notify decoder of EOF.
// We have no idea what the line-length was, so we
// cannot know how much of our array wasn't used.
byte[] result = new byte[b64.pos];
b64.readResults(result, 0, result.length);
return result;
}
/**
* Check if a byte value is whitespace or not.
*
* @param byteToCheck the byte to check
* @return true if byte is whitespace, false otherwise
*/
private static boolean isWhiteSpace(byte byteToCheck){
switch (byteToCheck) {
case ' ' :
case '\n' :
case '\r' :
case '\t' :
return true;
default :
return false;
}
}
/**
* Discards any characters outside of the base64 alphabet, per the requirements on page 25 of RFC 2045 - "Any
* characters outside of the base64 alphabet are to be ignored in base64 encoded data."
*
* @param data
* The base-64 encoded data to groom
* @return The data, less non-base64 characters (see RFC 2045).
*/
static byte[] discardNonBase64(byte[] data) {
byte groomedData[] = new byte[data.length];
int bytesCopied = 0;
for (int i = 0; i < data.length; i++) {
if (isBase64(data[i])) {
groomedData[bytesCopied++] = data[i];
}
}
byte packedData[] = new byte[bytesCopied];
System.arraycopy(groomedData, 0, packedData, 0, bytesCopied);
return packedData;
}
// Implementation of the Encoder Interface
/**
* Encodes a byte[] containing binary data, into a byte[] containing characters in the Base64 alphabet.
*
* @param pArray
* a byte array containing binary data
* @return A byte array containing only Base64 character data
*/
public byte[] encode(byte[] pArray) {
return encodeBase64(pArray, false);
}
// Implementation of integer encoding used for crypto
/**
* Decode a byte64-encoded integer according to crypto
* standards such as W3C's XML-Signature
*
* @param pArray a byte array containing base64 character data
* @return A BigInteger
*/
public static BigInteger decodeInteger(byte[] pArray) {
return new BigInteger(1, decodeBase64(pArray));
}
/**
* Encode to a byte64-encoded integer according to crypto
* standards such as W3C's XML-Signature
*
* @param bigInt a BigInteger
* @return A byte array containing base64 character data
* @throws NullPointerException if null is passed in
*/
public static byte[] encodeInteger(BigInteger bigInt) {
if (bigInt == null) {
throw new NullPointerException("encodeInteger called with null parameter");
}
return encodeBase64(toIntegerBytes(bigInt), false);
}
/**
* Returns a byte-array representation of a <code>BigInteger</code>
* without sign bit.
*
* @param bigInt <code>BigInteger</code> to be converted
* @return a byte array representation of the BigInteger parameter
*/
static byte[] toIntegerBytes(BigInteger bigInt) {
int bitlen = bigInt.bitLength();
// round bitlen
bitlen = ((bitlen + 7) >> 3) << 3;
byte[] bigBytes = bigInt.toByteArray();
if (((bigInt.bitLength() % 8) != 0) &&
(((bigInt.bitLength() / 8) + 1) == (bitlen / 8))) {
return bigBytes;
}
// set up params for copying everything but sign bit
int startSrc = 0;
int len = bigBytes.length;
// if bigInt is exactly byte-aligned, just skip signbit in copy
if ((bigInt.bitLength() % 8) == 0) {
startSrc = 1;
len--;
}
int startDst = bitlen / 8 - len; // to pad w/ nulls as per spec
byte[] resizedBytes = new byte[bitlen / 8];
System.arraycopy(bigBytes, startSrc, resizedBytes, startDst, len);
return resizedBytes;
}
}
| [
"[email protected]"
] | |
c571b975bb65dadf11860a99aea4e67765f2edfa | 32b2a0072c0d740c081e0c8dece3ee1cf7123804 | /src/main/java/com/rainier/strategypattern/promotionscenario/HolidayPromotionFactory.java | c27ce120050c73622cf709aef8b4db202e22a9f1 | [] | no_license | aiyun-app/design-pattern | f90b96c7d9cd2e7146922c6475220767afb1f067 | 077d5754c66f5818f9ac2d4f50768492e78757da | refs/heads/master | 2021-03-23T19:38:33.101083 | 2019-03-24T15:32:20 | 2019-03-24T15:32:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 608 | java | package com.rainier.strategypattern.promotionscenario;
import java.time.LocalDate;
public class HolidayPromotionFactory {
public static HolidayPromotion getPromotion(){
LocalDate date = LocalDate.now();
int month = date.getMonthValue();
int day = date.getDayOfMonth();
if (month == 10 && day >=1 && day <= 7 ){
return new NationalDayPromotion();
}
else if (month == 2 && day >= 4 && day <= 10){
return new SpringFestivalPromotion();
}
else {
return new DefaultHolidayPromotion();
}
}
}
| [
"[email protected]"
] | |
f0034af1f8232c2e1e57e5051df1bee59f7ad1ad | 8652aa52ac965a3388854e298ce36996780bf4b4 | /TestSys/src/com/example/testsys/fragment/EnvironmentFragment.java | 308a6c60edc8581d70a399e3d51f19d071aeb7df | [] | no_license | irelia8/TestSys | b2a1aaf51065617cdb7116fb1af2d112b9553581 | e5c881e29cdcebf49364289347fae25659c06d0d | refs/heads/master | 2016-08-10T20:57:30.157575 | 2016-03-02T10:51:06 | 2016-03-02T10:51:06 | 52,945,412 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,492 | java | package com.example.testsys.fragment;
import java.util.ArrayList;
import com.example.testsys.R;
import com.example.testsys.adapter.TrafficLightAdapter;
import com.example.testsys.bean.BusStation;
import com.example.testsys.bean.Environment;
import com.example.testsys.bean.TrafficLight;
import com.example.testsys.util.HttpThreadNew;
import com.example.testsys.request.BaseRequest;
import com.example.testsys.request.BaseRequestNew;
import com.example.testsys.request.GetCarSpeedRequest;
import com.example.testsys.request.GetEnvironmentRequest;
import com.example.testsys.request.GetStationRequest;
import com.example.testsys.request.GetTrafficLight;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.TextView;
public class EnvironmentFragment extends Fragment{
ArrayAdapter<TrafficLight> trafficlightAdapter;
private ListView lv_trafficlight;
private TextView tv_station1;
private TextView tv_station2;
private ArrayList<TrafficLight> trafficLightList;
private BusStation station1;
private BusStation station2;
private ArrayList<BaseRequestNew> requestList;
private GetTrafficLight request1;
private GetTrafficLight request2;
private GetTrafficLight request3;
private GetTrafficLight request4;
private GetTrafficLight request5;
private GetStationRequest request6;
private GetStationRequest request7;
Handler mHandler = new Handler(){
public void handleMessage(Message msg) {
switch (msg.what) {
case 0:
updateTrafficLight(trafficLightList.get(0),(TrafficLight) msg.obj);
break;
case 1:
updateTrafficLight(trafficLightList.get(1),(TrafficLight) msg.obj);
break;
case 2:
updateTrafficLight(trafficLightList.get(2),(TrafficLight) msg.obj);
break;
case 3:
updateTrafficLight(trafficLightList.get(3),(TrafficLight) msg.obj);
break;
case 4:
updateTrafficLight(trafficLightList.get(4),(TrafficLight) msg.obj);
break;
case 5:
updateStation(station1,(BusStation) msg.obj);
break;
case 6:
updateStation(station2,(BusStation) msg.obj);
break;
default:
System.out.println("notchange");
break;
}
updateView();
};
};
@Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
initData();
startThread();
}
protected void updateTrafficLight(TrafficLight oldTL, TrafficLight newTL) {
// TODO Auto-generated method stub
oldTL.setGreenTime(newTL.getGreenTime());
oldTL.setRedTime(newTL.getRedTime());
oldTL.setYellowTime(newTL.getYellowTime());
}
protected void updateStation(BusStation oldStation, BusStation newStation) {
// TODO Auto-generated method stub
try {
oldStation.setDistanceTo1(newStation.getDistanceTo1());
oldStation.setDistanceTo2(newStation.getDistanceTo2());
} catch (Exception e) {
// TODO: handle exception
System.out.println("station null");
}
}
private void startThread() {
// TODO Auto-generated method stub
requestList = new ArrayList<BaseRequestNew>();
request1 = new GetTrafficLight("http://172.16.164.3:8080/transportservice/type/jason/action/GetTrafficLightConfigAction.do",String.valueOf(1));
request2 = new GetTrafficLight("http://172.16.164.3:8080/transportservice/type/jason/action/GetTrafficLightConfigAction.do",String.valueOf(2));
request3 = new GetTrafficLight("http://172.16.164.3:8080/transportservice/type/jason/action/GetTrafficLightConfigAction.do",String.valueOf(3));
request4 = new GetTrafficLight("http://172.16.164.3:8080/transportservice/type/jason/action/GetTrafficLightConfigAction.do",String.valueOf(4));
request5 = new GetTrafficLight("http://172.16.164.3:8080/transportservice/type/jason/action/GetTrafficLightConfigAction.do",String.valueOf(5));
request6 = new GetStationRequest("http://172.16.164.3:8080/transportservice/type/jason/action/GetBusStationInfo.do", String.valueOf(1));
request7 = new GetStationRequest("http://172.16.164.3:8080/transportservice/type/jason/action/GetBusStationInfo.do", String.valueOf(2));
request1.setTAG("GetTrafficLight");
request2.setTAG("GetTrafficLight");
request3.setTAG("GetTrafficLight");
request4.setTAG("GetTrafficLight");
request5.setTAG("GetTrafficLight");
request6.setTAG("GetStation");
request7.setTAG("GetStation");
requestList.add(request1);
requestList.add(request2);
requestList.add(request3);
requestList.add(request4);
requestList.add(request5);
requestList.add(request6);
requestList.add(request7);
HttpThreadNew threadNew = new HttpThreadNew(mHandler, requestList);
threadNew.setLoop(true, 2000);
threadNew.start();
}
private void initData() {
trafficLightList = new ArrayList<TrafficLight>();
for (int i = 0; i < 5; i++) {
TrafficLight tf = new TrafficLight();
tf.setGreenTime(0);
tf.setRedTime(0);
tf.setYellowTime(0);
trafficLightList.add(tf);
}
station1 = new BusStation();
station1.setDistanceTo1(0);
station1.setDistanceTo2(0);
station2 = new BusStation();
station2.setDistanceTo1(0);
station2.setDistanceTo2(0);
}
private void updateView() {
trafficlightAdapter.notifyDataSetChanged();
String str = "1号公交 : "+station1.getDistanceTo1()+"m,2号公交 : "+station1.getDistanceTo2()+"m";
tv_station1.setText(str);
str = "1号公交 : "+station2.getDistanceTo1()+"m,2号公交 : "+station2.getDistanceTo2()+"m";
tv_station2.setText(str);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
View v = inflater.inflate(R.layout.fragment_envio, container, false);
initView(v);
updateView();
return v;
}
private void initView(View v) {
// TODO Auto-generated method stub
lv_trafficlight = (ListView) v.findViewById(R.id.lv_trafficLight);
tv_station1 = (TextView) v.findViewById(R.id.tv_station1);
tv_station2 = (TextView) v.findViewById(R.id.tv_station2);
trafficlightAdapter = new TrafficLightAdapter(getActivity(), R.layout.item_tl, trafficLightList);
lv_trafficlight.setAdapter(trafficlightAdapter);
}
}
| [
"[email protected]"
] | |
8b948406ad74908d578d31e40aa7b57b8080ecbd | 4f76b11fe30cec0c817418a418ae0bbb65df058d | /glcfsPointQuery/src/us/glos/glcfs/helpers/GLCFSGrid.java | 22ccea701cb3dedfaa97678389ac214687d4d4c7 | [] | no_license | glos/glos_server_script | 1a3b80c03b7cf31d20276928208536d5fa41210f | 5d741a56b2f320dffb2ed62edf80a1d6ce69905d | refs/heads/master | 2020-04-12T05:34:11.029361 | 2017-11-09T13:50:34 | 2017-11-09T13:50:34 | 64,231,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,526 | java | /*
;---xdist.pro-------------------------------------------------------------------
function xdist,rlat,rlon,ip,rp
; geographic to map coordinate transformation for x coordinate
alpha=rp(6)*!dtor
; transformation for approximate polyconic projection
if(ip(4) eq 0) then begin
dlat=rlat-rp(0)
dlon=rp(1)-rlon
xp=rp(7)*dlon+rp(8)*dlat+rp(9)*dlon*dlat+rp(10)*dlon*dlon
yp=rp(11)*dlon+rp(12)*dlat+rp(13)*dlat*dlon+rp(14)*dlon*dlon
xp=xp*1000.
yp=yp*1000.
end
; transformation for lambert conformal conic projection
if(ip(4) eq 1) then begin
r=(tan(!pi/4.-!dtor*rlat/2.))^rp(10)
xp=rp(11)*r*sin(rp(10)*(rp(7)-!dtor*rlon))
yp=-rp(11)*r*cos(rp(10)*(rp(7)-!dtor*rlon))
xp=xp-rp(12)
yp=yp-rp(13)
end
; transform to 'unprimed' system
; first rotate
xd=xp*cos(alpha)+yp*sin(alpha)
; now translate
xd=xd+ip(2)*rp(2)
return,xd
end
;---ydist.pro-------------------------------------------------------------------
function ydist,rlat,rlon,ip,rp
; geographic to map coordinate transformation for y coordinate
alpha=rp(6)*!dtor
; transformation for approximate polyconic projection
if(ip(4) eq 0) then begin
dlat=rlat-rp(0)
dlon=rp(1)-rlon
xp=rp(7)*dlon+rp(8)*dlat+rp(9)*dlon*dlat+rp(10)*dlon*dlon
yp=rp(11)*dlon+rp(12)*dlat+rp(13)*dlat*dlon+rp(14)*dlon*dlon
xp=xp*1000.
yp=yp*1000.
end
; transformation for lambert conformal conic projection
if(ip(4) eq 1) then begin
r=(tan(!pi/4.-!dtor*rlat/2.))^rp(10)
xp=rp(11)*r*sin(rp(10)*(rp(7)-!dtor*rlon))
yp=-rp(11)*r*cos(rp(10)*(rp(7)-!dtor*rlon))
xp=xp-rp(12)
yp=yp-rp(13)
end
; transform to 'unprimed' system
; first rotate
yd=yp*cos(alpha)-xp*sin(alpha)
; now translate
yd=yd+ip(3)*rp(2)
return,yd
end
;----------------------------------------------------------------------
pro rgrid,fname,gname,dgrid,iparm,rparm
; Purpose:
; To read a bathymetric grid data file
; and return grid parameters and depths.
; Arguments:
; On input:
; fname - Full pathway name of bathymetric data file
; On output:
; gname - Lake name (from bathymetric data file)
; dgrid - Depth grid
; iparm - Integer parameters for grid description and
; coordinate conversion
; rparm - Real parameters for grid description and
; coordinate conversion
;
; ------------------------------------------------------------------
; FORMAT OF BATHYMETRIC DATA FILE
; ------------------------------------------------------------------
; FIELD FORTRAN FORMAT COLUMNS
; ------------------------------------------------------------------
; RECORD 1: LAKE NAME 40A1 1-40
; RECORD 2: FIRST (I) DIMENSION OF DEPTH ARRAY I5 1-5
; SECOND (J) DIMENSION OF DEPTH ARRAY I5 6-10
; BASE LATITUDE F12.7 11-22
; BASE LONGITUDE F12.7 23-34
; GRID SIZE F5.0 35-39
; MAXIMUM DEPTH F5.0 40-44
; MINIMUM DEPTH F5.0 45-49
; BASE ROTATION (CCW FROM E-W) F6.2 50-55
; I DISPLACEMENT I5 56-60
; J DISPLACEMENT I5 61-65
; ROTATION FROM BASE (CCW) F6.2 66-71
; POWER OF TEN TO CONVERT DEPTHS TO
; METERS I3 72-74
; MAP PROJECTION INDICATOR
; 0=APPROXIMATE POLYCONIC
; 1=LAMBERT CONFORMAL CONIC I2 75-76
; RECORDS 3-6 (FOR APPROXIMATE POLYCONIC PROJECTION):
; MAP PROJECTION COORDINATE CONVERSION
; COEFFICIENTS 4E15.6 1-60
; RECORD 3 (FOR LAMBERT CONFORMAL CONIC PROJECTION):
; CENTRAL MERIDIAN OF PROJECTION E15.6 1-15
; SOUTHERNMOST STANDARD PARALLEL E15.6 16-30
; NORTHERNMOST STANDARD PARALLEL E15.6 31-45
; FOLLOWING RECORDS:
; DEPTHS IN ASCENDING I, ASCENDING J
; SEQUENCE, 19 TO A RECORD 19F4.0 1-76
; ------------------------------------------------------------------
;
; ON OUTPUT:
; D - DEPTH ARRAY. ZERO FOR LAND, AVERAGE DEPTH
; OF GRID BOX IN METERS FOR WATER.
; RPARM - ARRAY CONTAINING REAL-VALUED BATHYMETRIC
; GRID PARAMETERS AS FOLLOWS:
; 1. BASE LATITUDE
; 2. BASE LONGITUDE
; 3. GRID SIZE (M)
; 4. MAXIMUM DEPTH (M)
; 5. MINIMUM DEPTH (M)
; 6. BASE ROTATION (COUNTERCLOCKWISE FROM E-W)
; 7. ROTATION FROM BASE (COUNTERCLOCKWISE)
;
; FOR IPARM(45)=0 (APPROXIMATE POLYCONIC PROJECTION):
; 8-11. GEOGRAPHIC-TO-MAP COORDINATE CONVERSION
; COEFFICIENTS FOR X
; 12-15. GEOGRAPHIC-TO-MAP COORDINATE CONVERSION
; COEFFICIENTS FOR Y
; 16-19. MAP-TO-GEOGRAPHIC COORDINATE CONVERSION
; COEFFICIENTS FOR LONGITUDE
; 20-23. MAP-TO-GEOGRAPHIC COORDINATE CONVERSION
; COEFFICIENTS FOR LATITUDE
;
; FOR IPARM(45)=1 (LAMBERT CONFORMAL CONIC PROJECTION):
; 8. CENTRAL MERIDIAN OF PROJECTION (RADIANS)
; 9. SOUTHERNMOST STANDARD PARALLEL (RADIANS)
; 10. NORTHERNMOST STANDARD PARALLEL (RADIANS)
; 11. LOGARITHMIC COEFFICIENT FOR TRANSFORMATIONS
; 12. DISTANCE SCALING FACTOR FOR TRANSFORMATIONS
; 13. X DISPLACEMENT OF BATHYMETRIC GRID ORIGIN
; FROM MAP PROJECTION ORIGIN
; 14. Y DISPLACEMENT OF BATHYMETRIC GRID ORIGIN
; FROM MAP PROJECTION ORIGIN
;
; IPARM - ARRAY CONTAINING INTEGER-VALUED BATHYMETRIC
; GRID PARAMETERS AS FOLLOWS:
; 1. NUMBER OF GRID BOXES IN X DIRECTION
; 2. NUMBER OF GRID BOXES IN Y DIRECION
; 3. I DISPLACEMENT - THE NUMBER OF NEW GRID
; SQUARES IN THE X-DIRECTION FROM THE NEW
; GRID ORIGIN TO THE OLD GRID ORIGIN
; (USED ONLY FOR IPARM(45)=0)
; 4. J DISPLACEMENT - THE NUMBER OF NEW GRID
; SQUARES IN THE Y-DIRECTION FROM THE NEW
; GRID ORIGIN TO THE OLD GRID ORIGIN
; (USED ONLY FOR IPARM(45)=0)
; 5. MAP PROJECTION USED FOR BATHYMETRIC GRID:
; 0=APPROXIMATE POLYCONIC (GREAT LAKES GRIDS)
; 1=LAMBERT CONFORMAL CONIC
gname=' '
rparm=fltarr(23)
iparm=intarr(5)
openr,1,fname
readf,1,gname
iw1=intarr(2)
iw2=intarr(2)
rw1=fltarr(6)
r1=0.
on_ioerror,next
readf,1,iw1,rw1,iw2,r1,idexp,iproj, $
format='(2I5,2F12.7,3F5.0,F6.2,2I5,F6.2,I3,I2)'
goto,next1
next:idexp=0
iproj=0
next1:on_ioerror,null
iparm(0:1)=iw1
rparm(0:5)=rw1
iparm(2:3)=iw2
iparm(4)=iproj
rparm(6)=r1
if(iproj eq 0) then begin ;Approximate Polyconic Projection
rw1=fltarr(16)
readf,1,format='(4e15.6)',rw1
rparm(7:22)=rw1
end
if(iproj eq 1) then begin ;Lambert Conformal Conic
rw1=fltarr(3)
readf,1,format='(3e15.6)',rw1
rparm(7:9)=rw1
end
im=iparm(0)
jm=iparm(1)
dgrid=fltarr(im,jm)
readf,1,dgrid,format='(19f4.0)'
close,1
; adjust depths
dfac=10.^idexp
rparm(3)=rparm(3)*dfac
rparm(4)=rparm(4)*dfac
dgrid=dgrid*dfac
; for lambert projection compute required constants
if(iparm(4) eq 1) then begin
a45=atan(1.)
rparm(7)=rparm(7)*!dtor
rparm(8)=rparm(8)*!dtor
rparm(9)=rparm(9)*!dtor
; alon0=rparm(7)
a1=rparm(8)
a2=rparm(9)
rparm(10)=(alog(cos(a1))-alog(cos(a2)))/ $
(alog(tan(a45-a1/2.))-alog(tan(a45-a2/2.)))
; set scale factor for n-s distance from a1 to a2
aexp=rparm(10)
y1=(tan(a45-a1/2.))^aexp
y2=(tan(a45-a2/2.))^aexp
rparm(11)=6378140.*(a2-a1)/(y1-y2)
rparm(12)=0.
rparm(13)=0.
dx=xdist(rparm(0),rparm(1),iparm,rparm)
dy=ydist(rparm(0),rparm(1),iparm,rparm)
rparm(12)=dx
rparm(13)=dy
end
return
end
;-------------------------------------------------------------------------
*/
package us.glos.glcfs.helpers;
import java.util.HashMap;
import org.glc.domain.Coordinate;
public class GLCFSGrid {
private static final double Degree2Radians=0.017453293;
private static final double PI=3.1415927;
private static HashMap<String,int[]> IPARAM=null;
private static HashMap<String,double[]> RPARAM=null;
//private static HashMap<String,Coordinate> ORIGIN=null;
static
{
IPARAM=new HashMap<String,int[]>(6);
RPARAM=new HashMap<String,double[]>(6);
//ORIGIN=new HashMap<String,Coordinate>(6);
int[] michiganIP={131, 251, 0, 0, 1};
double[] michiganRP={41.5976372, 87.9898071, 2000, 273*Math.pow(10, 0), 1*Math.pow(10, 0), 0.00, 0.00, 86.500000*Degree2Radians, 43.000000*Degree2Radians, 45.000000*Degree2Radians, 0.0, 0.0, 0.0, 0.0};
michiganRP[10]=(Math.log(Math.cos(michiganRP[8]))-Math.log(Math.cos(michiganRP[9])))/(Math.log(Math.tan(Math.atan(1.0)-michiganRP[8]/2.0))-Math.log(Math.tan(Math.atan(1.0)-michiganRP[9]/2.0)));
michiganRP[11]=6378140.*(michiganRP[9]-michiganRP[8])/(Math.pow(Math.tan(Math.atan(1.0)-michiganRP[8]/2.0), michiganRP[10])-Math.pow(Math.tan(Math.atan(1.0)-michiganRP[9]/2.0), michiganRP[10]));
IPARAM.put("michigan", michiganIP);
RPARAM.put("michigan", michiganRP);
Coordinate origin=GetCoordInXY(false,michiganRP[1],michiganRP[0],null,"michigan");
if(origin!=null)
{
michiganRP[12]=origin.getLon();
michiganRP[13]=origin.getLat();
}
//Coordinate coord=GetCoordInXY(michiganRP[1],michiganRP[0],null,"michigan");
//ORIGIN.put("michigan", coord);
int[] erieIP={193, 87, 0, 0, 1};
double[] erieRP={41.3358841, 83.4890823, 2000, 628*Math.pow(10, -1), 30*Math.pow(10, -1), 0.00, 0.00, 81.000000*Degree2Radians, 41.750000*Degree2Radians, 42.500000*Degree2Radians, 0.0, 0.0, 0.0, 0.0};
erieRP[10]=(Math.log(Math.cos(erieRP[8]))-Math.log(Math.cos(erieRP[9])))/(Math.log(Math.tan(Math.atan(1.0)-erieRP[8]/2.0))-Math.log(Math.tan(Math.atan(1.0)-erieRP[9]/2.0)));
erieRP[11]=6378140.*(erieRP[9]-erieRP[8])/(Math.pow(Math.tan(Math.atan(1.0)-erieRP[8]/2.0), erieRP[10])-Math.pow(Math.tan(Math.atan(1.0)-erieRP[9]/2.0), erieRP[10]));
IPARAM.put("erie", erieIP);
RPARAM.put("erie", erieRP);
origin=GetCoordInXY(false,erieRP[1],erieRP[0],null,"erie");
if(origin!=null)
{
erieRP[12]=origin.getLon();
erieRP[13]=origin.getLat();
}
int[] huronIP={201, 188, 0, 0, 1};
double[] huronRP={42.9612122, 84.6548080, 2000, 2144*Math.pow(10, -1), 20*Math.pow(10, -1), 0.00, 0.00, 82.000000*Degree2Radians, 43.000000*Degree2Radians, 45.000000*Degree2Radians, 0.0, 0.0, 0.0, 0.0};
huronRP[10]=(Math.log(Math.cos(huronRP[8]))-Math.log(Math.cos(huronRP[9])))/(Math.log(Math.tan(Math.atan(1.0)-huronRP[8]/2.0))-Math.log(Math.tan(Math.atan(1.0)-huronRP[9]/2.0)));
huronRP[11]=6378140.*(huronRP[9]-huronRP[8])/(Math.pow(Math.tan(Math.atan(1.0)-huronRP[8]/2.0), huronRP[10])-Math.pow(Math.tan(Math.atan(1.0)-huronRP[9]/2.0), huronRP[10]));
IPARAM.put("huron", huronIP);
RPARAM.put("huron", huronRP);
origin=GetCoordInXY(false,huronRP[1],huronRP[0],null,"huron");
if(origin!=null)
{
huronRP[12]=origin.getLon();
huronRP[13]=origin.getLat();
}
int[] huron2006IP={81, 75, 1, 0, 0};
double[] huron2006RP={42.9660301, 84.6620712, 5000, 206*Math.pow(10, 0), 1*Math.pow(10, 0), 0.0, 0.0,
0.815869E+02, 0.257566E+01, -0.134705E+01, 0.000000E+00,
-0.185606E+01, 0.111111E+03, 0.000000E+00, 0.485354E+00,
0.122482E-01, -0.297178E-03, 0.192849E-05, 0.000000E+00,
0.220311E-03, 0.899372E-02, 0.000000E+00, -0.702891E-06
};
IPARAM.put("huron2006", huron2006IP);
RPARAM.put("huron2006", huron2006RP);
int[] ontarioIP={61, 25, 0, 1, 0};
double[] ontarioRP={43.1655426, 79.8199615, 5000, 226*Math.pow(10, 0), 7*Math.pow(10, 0), 0.0, 0.0,
0.813204E+02, 0.242939E+01, -0.133486E+01, 0.0,
-0.176688E+01, 0.111101E+03, 0.0, 0.485416E+00,
0.122965E-01, -0.274739E-03, 0.185864E-05, 0.0,
0.199237E-03, 0.899770E-02, 0.0, -0.674272E-06
};
IPARAM.put("ontario", ontarioIP);
RPARAM.put("ontario", ontarioRP);
int[] superiorIP={61, 30, 1, 0, 0};
double[] superiorRP={46.3184662, 92.1027527, 10000, 326*Math.pow(10, 0), 12*Math.pow(10, 0), 0.0, 0.0,
0.770215E+02, 0.584617E+01, -0.142494E+01, 0.0,
-0.398892E+01, 0.111176E+03, 0.0, 0.486127E+00,
0.129841E-01, -0.717624E-03, 0.226882E-05, 0.0,
0.477160E-03, 0.898120E-02, 0.0, -0.757848E-06
};
IPARAM.put("superior", superiorIP);
RPARAM.put("superior", superiorRP);
}
public static Coordinate GetCoordInXY(boolean isCellNo,double lon,double lat,String year,String lake)
{
Coordinate coord=null;
if(lake!=null&&year!=null&&lake.equals("huron")&&(year.equals("2006")||year.equals("2007")||year.equals("2008")))
lake="huron2006";
int[] iparam=IPARAM.get(lake);
double[] rparam=RPARAM.get(lake);
if(iparam!=null&&rparam!=null)
{
if(lon<0)lon=lon*-1.0;
double alpha=rparam[6]*Degree2Radians;
double xp=0.,yp=0.;
if(iparam[4]==1)
{
double r=Math.pow(Math.tan(PI/4.0-Degree2Radians*lat/2.0),rparam[10]);
xp=rparam[11]*r*Math.sin(rparam[10]*(rparam[7]-Degree2Radians*lon));
yp=-rparam[11]*r*Math.cos(rparam[10]*(rparam[7]-Degree2Radians*lon));
xp-=rparam[12];
yp-=rparam[13];
}
else if(iparam[4]==0)
{
xp=1000.0*(rparam[7]*(rparam[1]-lon)+rparam[8]*(lat-rparam[0])+rparam[9]*(rparam[1]-lon)*(lat-rparam[0])+rparam[10]*(rparam[1]-lon)*(rparam[1]-lon));
yp=1000.0*(rparam[11]*(rparam[1]-lon)+rparam[12]*(lat-rparam[0])+rparam[13]*(rparam[1]-lon)*(lat-rparam[0])+rparam[14]*(rparam[1]-lon)*(rparam[1]-lon));
}
double xd=xp*Math.cos(alpha)+yp*Math.sin(alpha)+iparam[2]*rparam[2];
double yd=yp*Math.cos(alpha)-xp*Math.sin(alpha)+iparam[3]*rparam[2];
//Coordinate ocoord=ORIGIN.get(lake);
//if(ocoord!=null)
// coord=new Coordinate((xd-ocoord.getLon())/rparam[2],(yd-ocoord.getLat())/rparam[2]);
//coord=new Coordinate((xd)/rparam[2],(yd)/rparam[2]);
//else
if(isCellNo)
{
double xr=xd/rparam[2];
double yr=yd/rparam[2];
if(xr>=0&&xr<iparam[0]&&yr<iparam[1]&&yr>=0)
coord=new Coordinate(xd/rparam[2],yd/rparam[2]);
else
coord=new Coordinate(-1,-1);
}
else
coord=new Coordinate(xd,yd);
}
return coord;
}
}
| [
"[email protected]"
] | |
18dc5fcdb546cde578a5d31cc92062a49391e1d6 | 0d380a2cdc70b7720c9b5b95cd96bc0f769257d1 | /src/main/java/com/redsparkle/foe/containers/player_additional_inventory/Slots/SlotAmmo.java | a9376fadb3095935e21d98af60acee95271bf4d9 | [
"MIT"
] | permissive | BrotherLavarius/Fallout_Equestria | 6d0f2004044db8a856a01a780e307d7d3d1e7378 | 090278c4e4454f90366a5088b73bfeb80c76237c | refs/heads/master | 2022-03-12T05:22:02.033915 | 2018-04-05T13:58:50 | 2018-04-05T13:58:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,467 | java | package com.redsparkle.foe.containers.player_additional_inventory.Slots;
import com.redsparkle.api.items.helpers.Item_Instances.Item_AmmoHolder;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
/**
* Created by hoijima on 28.06.17.
*/
public class SlotAmmo extends Slot {
/**
* The inventory we want to extract a slot from.
*/
public final IInventory inventory;
/**
* The index of the slot in the inventory.
*/
private final int slotIndex;
/**
* the id of the slot(also the index in the inventory arraylist)
*/
public int slotNumber;
/**
* display position of the inventory slot on the screen x axis
*/
public int xPos;
/**
* display position of the inventory slot on the screen y axis
*/
public int yPos;
public SlotAmmo(IInventory inventoryIn, int index, int xPosition, int yPosition) {
super(inventoryIn, index, xPosition, yPosition);
this.inventory = inventoryIn;
this.slotIndex = index;
this.xPos = xPosition;
this.yPos = yPosition;
}
@Override
public int getSlotIndex() {
return slotIndex;
}
@Override
public int getSlotStackLimit() {
return 65;
}
@Override
public boolean isItemValid(ItemStack stack) {
return super.isItemValid(stack) && stack.getItem() instanceof Item_AmmoHolder;
}
}
| [
"[email protected]"
] | |
b650f79f6c8dbf77fbf997c3577b07c5f288e572 | 737c1f09c9c4928198752bd02f01041c3429b002 | /src/main/java/blservice/organizationBLService/StudentBLService.java | 7c17fb0be796543f33203a8fc377ec530d012bdb | [] | no_license | marioquer/Phenomenology | cc6f1c2d7a433040a2d950a0f0b7102539d8bdd4 | 250c9f9249b6c5dfcecd4caa072d0c6a12cf1434 | refs/heads/master | 2021-01-24T11:01:27.397777 | 2016-10-07T16:06:29 | 2016-10-07T16:06:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 906 | java | package blservice.organizationBLService;
import ENUM.UniversalState;
import vo.OrganizationVO;
import java.util.ArrayList;
/**
* Created by lvdechao on 2016/9/30.
*/
public interface StudentBLService {
//得到一个新的存储id
public int getID();
//增加一条本所学生记录
public String addItem(OrganizationVO organizationVO);
//删除一条本所学生记录
public UniversalState deleteItem(int id);
//更新一条本所学生记录
public UniversalState updateItem(OrganizationVO organizationVO);
//将本所学生进行排序【ArrayList里面id的顺序即为最终顺序】
public UniversalState sort(ArrayList<Integer> idList);
//得到某位本所学生的详细信息
public OrganizationVO getItem(int id);
//按排序获得所有本所学生的名单
public ArrayList<OrganizationVO> getAllItem(String language);
}
| [
"[email protected]"
] | |
3b806ed29bd0730c8e0784541978530a97d002d4 | 85aa9949fc6ff7e44eff58631d0950fd76907d3f | /src/Also/Classes/BorderTools.java | ffd1e7a08abd38f5701bc02a553bea28b17d4780 | [] | no_license | PlumIk/PathOfPaint | bc43bb79070b2e7d81bb810ba99093237c8ae6fc | 68018b8c82b051ec1d29cc1333cdf54661b0f56b | refs/heads/main | 2023-03-09T00:51:22.239090 | 2021-02-22T06:35:05 | 2021-02-22T06:35:05 | 341,103,571 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 515 | java | package Also.Classes;
import javax.swing.*;
import java.awt.*;
public class BorderTools {
public JButton ChBottomAk=null;
public JButton ChBottomCo=null;
public void NewCol(JButton NewBot){
ChBottomCo.setSelected(false);
ChBottomCo=NewBot;
ChBottomCo.setSelected(true);
}
public void NewAk(JButton NewBot){
if (ChBottomAk != null) {
ChBottomAk.setSelected(false);
}
ChBottomAk=NewBot;
ChBottomAk.setSelected(true);
}
}
| [
"[email protected]"
] | |
28aefd57bb20165cdf3bae67ae8829e8f3155f47 | a197dcc02c98151b519a921d7abc940c19f2dae9 | /Java8/src/Day0402/Hangman2.java | a841e3d0dfcd5d575733199a07be3ee8a422f746 | [] | no_license | EunJuOh33/java8 | a6b08a1c1e20433e76c761b6d435d9683d97a6e4 | d69d6d16ed2e65b5ece60a3d3657c3bf385d9765 | refs/heads/master | 2021-03-25T03:02:51.843520 | 2020-05-11T15:21:46 | 2020-05-11T15:21:46 | 247,584,474 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 260 | java | package Day0402;
public class Hangman2 extends Hangman {
static String[] arr = {"hello", "hospital", "capacity", "language"};
static String str = arr[(int)(Math.random()*arr.length)];
/* »ý¼ºÀÚ */
public Hangman2() {
super(str);
}
}
| [
"yn-s04@DESKTOP-7TBF8RP"
] | yn-s04@DESKTOP-7TBF8RP |
1a18e2645e14f94df4a87a07b3c0ccfdf8495d4f | 275226290cef9e77e6581416351ed25386339dd0 | /DecoratorPattern/src/main/java/com/guoyang/my/nyStarbuzz.java | f0d732e156873f63d2d62a468e575b5aaa0f82a8 | [] | no_license | PlumpMath/DesignPattern-652 | ec1979f9bfdb2eaf38cc1d1a73c64aa75d6192c7 | d48d8d8179d0f56c1cb5577a6408ec7a5c754590 | refs/heads/master | 2021-01-20T09:42:24.048125 | 2017-01-25T01:31:55 | 2017-01-25T01:31:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package com.guoyang.my;
/**
* Created by L'Accordeur on 2016/11/10.
*/
public class nyStarbuzz {
public static void main(String[] args) {
Beverage beverage = new DarkRoast();
beverage = new Mocha(beverage);
beverage = new Mocha(beverage);
System.out.println(beverage.getDescription() + " $" + beverage.cost());
}
}
| [
"[email protected]"
] | |
02b13b8b7e19b8b2757e5aeed88ca48ddae6d49c | 5a9c39be816778887d59dd5252641e9addec924f | /2017025_Lab06/Lab6/src/InvalidProductException.java | ff2698ce5b394eb51ef027111b704636552057d8 | [] | no_license | anshuman1117/Advanced-Programming-Labs | 6807991893987f764da5c72e854f21e1effefd8d | e8d1b2f472fce21a1d7762ac739bda0377fd352a | refs/heads/master | 2020-04-16T09:38:34.046650 | 2019-01-13T07:00:14 | 2019-01-13T07:00:14 | 165,471,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java |
public class InvalidProductException extends Exception {
public InvalidProductException(String arg0) {
super(arg0);
}
}
| [
"[email protected]"
] | |
4fa9987ef35e802f8a4228e9655436ef6650536e | 5b6269673007ca62e47ce933c13f5251cf324875 | /src/main/java/io/alpyg/rpg/events/EntityConstructEvents.java | 6e8c8b64e18481cc875a1bfdc3838bbfc43ccf63 | [] | no_license | Alpyg/RPGSeed | 0babfc2b7504aa53b61cc50ded34ba03e14b6b3b | 2748bb4b7d306987fa247c72ff71f4c162e9cdae | refs/heads/master | 2021-06-27T03:09:16.131607 | 2019-05-23T23:47:22 | 2019-05-23T23:47:22 | 173,173,470 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 513 | java | package io.alpyg.rpg.events;
import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.entity.SpawnEntityEvent;
import io.alpyg.rpg.data.npc.NpcData;
public class EntityConstructEvents {
@Listener
public void onEntityConstruct(SpawnEntityEvent.ChunkLoad e) {
for (Entity entity : e.getEntities()) {
if (entity.get(NpcData.class).isPresent()) {
System.out.println(entity);
// entity.remove();
}
}
}
}
| [
"abder@DESKTOP-HBA4111"
] | abder@DESKTOP-HBA4111 |
89ebe69b1c1ed3fdea9b4d1028e2bd1b74e67782 | 7a682dcc4e284bced37d02b31a3cd15af125f18f | /bitcamp-java-basic/src/main/java/ch20/d/Test04.java | 1a4a25f2045e0a2013d899ce5b378420d38198ce | [] | no_license | eomjinyoung/bitcamp-java-20190527 | a415314b74954f14989042c475a4bf36b7311a8c | 09f1b677587225310250078c4371ed94fe428a35 | refs/heads/master | 2022-03-15T04:33:15.248451 | 2019-11-11T03:33:58 | 2019-11-11T03:33:58 | 194,775,330 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 860 | java | // HashMap에서 value 목록 꺼내기
package ch20.d;
import java.util.Collection;
import java.util.HashMap;
public class Test04 {
public static void main(String[] args) {
class Student {
String name;
int age;
public Student(String name, int age) {
this.name = name;
this.age = age;
}
@Override
public String toString() {
return "Student [name=" + name + ", age=" + age + "]";
}
}
HashMap<String, Student> map = new HashMap<>();
map.put("aaa", new Student("홍길동", 20));
map.put("bbb", new Student("임꺽정", 30));
map.put("ccc", new Student("안중근", 25));
// value 목록 꺼내기
Collection<Student> values = map.values();
for (Student value : values) {
System.out.println(value);
}
}
}
| [
"[email protected]"
] | |
2cb6aed9c009826daf248fe699bab0e20d1140ed | 468b7ad129000f390bafce9a81df19ecc7fa0862 | /src/main/java/parser.java | d08644c3c8c9851163f3312250a403583e50314b | [] | no_license | rnc/java_cup | 5485b5309804b4a7857aa8dce712fb5f3bdade10 | 4b44237e0371ea6765ffd6acb4d2caf52188629f | refs/heads/master | 2020-04-01T19:35:48.805617 | 2014-04-02T16:12:26 | 2014-04-02T16:12:26 | 18,372,425 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 35,532 | java |
//----------------------------------------------------
// The following code was generated by CUP v0.9e
// Sun Apr 07 11:44:20 EDT 1996
//----------------------------------------------------
package java_cup;
import java_cup.runtime.*;
import java.util.Hashtable;
public class parser extends java_cup.runtime.lr_parser {
/** constructor */
public parser() {super();}
/** production table */
protected static final short _production_table[][] = {
{0, 2}, {31, 0}, {1, 9}, {1, 4}, {32, 0},
{2, 4}, {2, 1}, {3, 2}, {3, 1}, {33, 0},
{11, 4}, {4, 2}, {5, 4}, {5, 1}, {6, 4},
{6, 1}, {13, 4}, {13, 1}, {14, 4}, {14, 1},
{7, 2}, {7, 1}, {34, 0}, {15, 5}, {35, 0},
{15, 6}, {36, 0}, {15, 4}, {37, 0}, {15, 5},
{17, 3}, {17, 1}, {18, 3}, {18, 1}, {38, 0},
{8, 5}, {8, 1}, {9, 2}, {9, 1}, {39, 0},
{19, 5}, {40, 0}, {19, 3}, {24, 3}, {24, 1},
{25, 1}, {20, 2}, {20, 1}, {21, 2}, {21, 1},
{30, 2}, {30, 1}, {10, 3}, {10, 1}, {12, 3},
{12, 1}, {16, 1}, {22, 1}, {23, 1}, {27, 1},
{28, 1}, {29, 1}, {26, 0} };
/** access to production table */
public short[][] production_table() {return _production_table;}
/** parse action table */
protected static final short[][] _action_table = {
/*0*/{1,4,2,-2,3,-2,5,-2,6,-2,7,-2,8,-2,9,-2,10,-2,-1,0},
/*1*/{0,114,-1,0},
/*2*/{2,72,3,-63,5,-63,6,-63,7,-63,8,-63,9,-63,10,-63,-1,0},
/*3*/{7,5,8,8,-1,0},
/*4*/{1,59,20,10,-1,0},
/*5*/{1,-22,7,-22,8,-22,12,-22,20,-22,-1,0},
/*6*/{1,-63,7,5,8,8,12,28,20,-63,-1,0},
/*7*/{7,9,-1,0},
/*8*/{1,11,20,10,-1,0},
/*9*/{13,-54,16,-54,20,-54,-1,0},
/*10*/{13,-29,-1,0},
/*11*/{20,18,-1,0},
/*12*/{16,14,20,-57,-1,0},
/*13*/{20,15,-1,0},
/*14*/{13,-53,16,-53,20,-53,-1,0},
/*15*/{13,-34,14,-34,-1,0},
/*16*/{13,-25,14,20,-1,0},
/*17*/{13,-59,14,-59,-1,0},
/*18*/{13,22,-1,0},
/*19*/{20,18,-1,0},
/*20*/{13,-33,14,-33,-1,0},
/*21*/{1,-26,7,-26,8,-26,12,-26,20,-26,-1,0},
/*22*/{13,24,-1,0},
/*23*/{1,-30,7,-30,8,-30,12,-30,20,-30,-1,0},
/*24*/{1,-21,7,-21,8,-21,12,-21,20,-21,-1,0},
/*25*/{1,-37,20,-37,-1,0},
/*26*/{1,34,20,30,-1,0},
/*27*/{11,29,-1,0},
/*28*/{20,30,-1,0},
/*29*/{13,-60,18,-60,-1,0},
/*30*/{13,-35,-1,0},
/*31*/{13,33,-1,0},
/*32*/{1,-36,20,-36,-1,0},
/*33*/{13,-42,-1,0},
/*34*/{18,-40,-1,0},
/*35*/{0,-4,1,34,20,30,-1,0},
/*36*/{0,-39,1,-39,20,-39,-1,0},
/*37*/{0,-38,1,-38,20,-38,-1,0},
/*38*/{18,40,-1,0},
/*39*/{13,-63,19,-63,20,-63,21,-63,-1,0},
/*40*/{13,-48,19,-48,20,-48,21,-48,-1,0},
/*41*/{13,-46,19,-46,20,49,21,48,-1,0},
/*42*/{13,-45,19,-45,-1,0},
/*43*/{13,45,19,46,-1,0},
/*44*/{0,-41,1,-41,20,-41,-1,0},
/*45*/{13,-63,19,-63,20,-63,21,-63,-1,0},
/*46*/{13,-44,19,-44,-1,0},
/*47*/{13,-50,19,-50,20,-50,21,-50,-1,0},
/*48*/{13,-61,17,-61,19,-61,20,-61,21,-61,-1,0},
/*49*/{13,-63,17,54,19,-63,20,-63,21,-63,-1,0},
/*50*/{13,-47,19,-47,20,-47,21,-47,-1,0},
/*51*/{13,-52,19,-52,20,-52,21,-52,-1,0},
/*52*/{13,-49,19,-49,20,-49,21,-49,-1,0},
/*53*/{20,55,-1,0},
/*54*/{13,-62,19,-62,20,-62,21,-62,-1,0},
/*55*/{13,-51,19,-51,20,-51,21,-51,-1,0},
/*56*/{13,58,-1,0},
/*57*/{0,-43,1,-43,20,-43,-1,0},
/*58*/{13,-27,-1,0},
/*59*/{20,63,-1,0},
/*60*/{13,-23,14,64,-1,0},
/*61*/{13,-32,14,-32,-1,0},
/*62*/{13,-58,14,-58,-1,0},
/*63*/{20,63,-1,0},
/*64*/{13,66,-1,0},
/*65*/{1,-24,7,-24,8,-24,12,-24,20,-24,-1,0},
/*66*/{13,-31,14,-31,-1,0},
/*67*/{13,69,-1,0},
/*68*/{1,-28,7,-28,8,-28,12,-28,20,-28,-1,0},
/*69*/{3,-7,5,-7,6,-7,7,-7,8,-7,9,-7,10,-7,-1,0},
/*70*/{3,-63,5,-63,6,-63,7,-63,8,-63,9,-63,10,-63,-1,0},
/*71*/{20,10,-1,0},
/*72*/{13,-5,16,14,-1,0},
/*73*/{13,75,-1,0},
/*74*/{3,-6,5,-6,6,-6,7,-6,8,-6,9,-6,10,-6,-1,0},
/*75*/{3,82,5,79,6,-63,7,-63,8,-63,9,-63,10,-63,-1,0},
/*76*/{3,-9,5,-9,6,-9,7,-9,8,-9,9,-9,10,-9,-1,0},
/*77*/{6,-14,7,-14,8,-14,9,-14,10,-14,-1,0},
/*78*/{4,111,-1,0},
/*79*/{6,107,7,-63,8,-63,9,-63,10,-63,-1,0},
/*80*/{3,-8,5,-8,6,-8,7,-8,8,-8,9,-8,10,-8,-1,0},
/*81*/{20,10,-1,0},
/*82*/{7,-63,8,-63,9,86,10,-63,-1,0},
/*83*/{7,-18,8,-18,10,-18,-1,0},
/*84*/{7,-63,8,-63,10,92,-1,0},
/*85*/{11,87,-1,0},
/*86*/{21,88,-1,0},
/*87*/{13,89,-1,0},
/*88*/{7,-17,8,-17,10,-17,-1,0},
/*89*/{7,-20,8,-20,-1,0},
/*90*/{7,5,8,8,-1,0},
/*91*/{11,93,-1,0},
/*92*/{21,94,-1,0},
/*93*/{13,95,-1,0},
/*94*/{7,-19,8,-19,-1,0},
/*95*/{1,-63,7,5,8,8,12,28,20,-63,-1,0},
/*96*/{1,34,20,30,-1,0},
/*97*/{0,-3,1,34,20,30,-1,0},
/*98*/{13,-10,-1,0},
/*99*/{13,-56,16,101,-1,0},
/*100*/{15,102,20,15,-1,0},
/*101*/{13,-55,-1,0},
/*102*/{13,104,-1,0},
/*103*/{3,-11,5,-11,6,-11,7,-11,8,-11,9,-11,10,-11,-1,0},
/*104*/{7,-16,8,-16,9,-16,10,-16,-1,0},
/*105*/{7,-12,8,-12,9,-12,10,-12,-1,0},
/*106*/{4,108,-1,0},
/*107*/{21,109,-1,0},
/*108*/{13,110,-1,0},
/*109*/{7,-15,8,-15,9,-15,10,-15,-1,0},
/*110*/{21,112,-1,0},
/*111*/{13,113,-1,0},
/*112*/{6,-13,7,-13,8,-13,9,-13,10,-13,-1,0},
/*113*/{0,-1,-1,0},
};
/** access to parse action table */
public short[][] action_table() {return _action_table;}
/** reduce_goto table */
protected static final short[][] _reduce_table = {
/*0*/{1,1,31,2,-1,-1},
/*1*/{-1,-1},
/*2*/{2,70,26,69,-1,-1},
/*3*/{7,6,15,5,-1,-1},
/*4*/{10,12,16,59,-1,-1},
/*5*/{-1,-1},
/*6*/{8,26,15,24,26,25,-1,-1},
/*7*/{-1,-1},
/*8*/{10,12,16,11,-1,-1},
/*9*/{-1,-1},
/*10*/{37,22,-1,-1},
/*11*/{18,16,23,15,-1,-1},
/*12*/{-1,-1},
/*13*/{-1,-1},
/*14*/{-1,-1},
/*15*/{-1,-1},
/*16*/{35,18,-1,-1},
/*17*/{-1,-1},
/*18*/{-1,-1},
/*19*/{23,20,-1,-1},
/*20*/{-1,-1},
/*21*/{-1,-1},
/*22*/{-1,-1},
/*23*/{-1,-1},
/*24*/{-1,-1},
/*25*/{-1,-1},
/*26*/{9,35,19,36,27,34,-1,-1},
/*27*/{-1,-1},
/*28*/{27,30,-1,-1},
/*29*/{-1,-1},
/*30*/{38,31,-1,-1},
/*31*/{-1,-1},
/*32*/{-1,-1},
/*33*/{40,56,-1,-1},
/*34*/{39,38,-1,-1},
/*35*/{19,37,27,34,-1,-1},
/*36*/{-1,-1},
/*37*/{-1,-1},
/*38*/{-1,-1},
/*39*/{20,41,24,43,25,42,26,40,-1,-1},
/*40*/{-1,-1},
/*41*/{21,50,28,49,-1,-1},
/*42*/{-1,-1},
/*43*/{-1,-1},
/*44*/{-1,-1},
/*45*/{20,41,25,46,26,40,-1,-1},
/*46*/{-1,-1},
/*47*/{-1,-1},
/*48*/{-1,-1},
/*49*/{26,51,30,52,-1,-1},
/*50*/{-1,-1},
/*51*/{-1,-1},
/*52*/{-1,-1},
/*53*/{29,55,-1,-1},
/*54*/{-1,-1},
/*55*/{-1,-1},
/*56*/{-1,-1},
/*57*/{-1,-1},
/*58*/{36,67,-1,-1},
/*59*/{17,60,22,61,-1,-1},
/*60*/{34,64,-1,-1},
/*61*/{-1,-1},
/*62*/{-1,-1},
/*63*/{22,66,-1,-1},
/*64*/{-1,-1},
/*65*/{-1,-1},
/*66*/{-1,-1},
/*67*/{-1,-1},
/*68*/{-1,-1},
/*69*/{-1,-1},
/*70*/{3,75,26,76,-1,-1},
/*71*/{10,72,-1,-1},
/*72*/{32,73,-1,-1},
/*73*/{-1,-1},
/*74*/{-1,-1},
/*75*/{4,82,5,79,11,80,26,77,-1,-1},
/*76*/{-1,-1},
/*77*/{-1,-1},
/*78*/{-1,-1},
/*79*/{6,105,26,104,-1,-1},
/*80*/{-1,-1},
/*81*/{10,99,12,98,-1,-1},
/*82*/{13,84,26,83,-1,-1},
/*83*/{-1,-1},
/*84*/{14,90,26,89,-1,-1},
/*85*/{-1,-1},
/*86*/{-1,-1},
/*87*/{-1,-1},
/*88*/{-1,-1},
/*89*/{-1,-1},
/*90*/{7,95,15,5,-1,-1},
/*91*/{-1,-1},
/*92*/{-1,-1},
/*93*/{-1,-1},
/*94*/{-1,-1},
/*95*/{8,96,15,24,26,25,-1,-1},
/*96*/{9,97,19,36,27,34,-1,-1},
/*97*/{19,37,27,34,-1,-1},
/*98*/{33,102,-1,-1},
/*99*/{-1,-1},
/*100*/{-1,-1},
/*101*/{-1,-1},
/*102*/{-1,-1},
/*103*/{-1,-1},
/*104*/{-1,-1},
/*105*/{-1,-1},
/*106*/{-1,-1},
/*107*/{-1,-1},
/*108*/{-1,-1},
/*109*/{-1,-1},
/*110*/{-1,-1},
/*111*/{-1,-1},
/*112*/{-1,-1},
/*113*/{-1,-1},
};
/** access to reduce_goto table */
public short[][] reduce_table() {return _reduce_table;}
/** instance of action encapsulation class */
protected CUP$actions action_obj;
/** action encapsulation object initializer */
protected void init_actions()
{
action_obj = new CUP$actions();
}
/** invoke a user supplied parse action */
public java_cup.runtime.symbol do_action(
int act_num,
java_cup.runtime.lr_parser parser,
java.util.Stack stack,
int top)
throws java.lang.Exception
{
/* call code in generated class */
return action_obj.CUP$do_action(act_num, parser, stack, top);
}
/** start state */
public int start_state() {return 0;}
/** start production */
public int start_production() {return 0;}
/** EOF symbol index */
public int EOF_sym() {return 0;}
/** error symbol index */
public int error_sym() {return 1;}
/** user initialization */
public void user_init() throws java.lang.Exception
{
lexer.init();
}
/** scan to get the next token */
public java_cup.runtime.token scan()
throws java.lang.Exception
{
return lexer.next_token();
}
/* override error routines */
public void report_fatal_error(
String message,
Object info)
{
done_parsing();
lexer.emit_error(message);
System.err.println("Can't recover from previous error(s), giving up.");
System.exit(1);
}
public void report_error(String message, Object info)
{
lexer.emit_error(message);
}
};
/** Cup generated class to encapsulate user supplied action code.*/
class CUP$actions {
/** helper routine to clone a new production part adding a given label */
protected production_part add_lab(production_part part, String lab)
throws internal_error
{
/* if there is no label, or this is an action, just return the original */
if (lab == null || part.is_action()) return part;
/* otherwise build a new one with the given label attached */
return new symbol_part(((symbol_part)part).the_symbol(),lab);
}
/** max size of right hand side we will support */
protected final int MAX_RHS = 200;
/** array for accumulating right hand side parts */
protected production_part[] rhs_parts = new production_part[MAX_RHS];
/** where we are currently in building a right hand side */
protected int rhs_pos = 0;
/** start a new right hand side */
protected void new_rhs() {rhs_pos = 0; }
/** add a new right hand side part */
protected void add_rhs_part(production_part part) throws java.lang.Exception
{
if (rhs_pos >= MAX_RHS)
throw new Exception("Internal Error: Productions limited to " +
MAX_RHS + " symbols and actions");
rhs_parts[rhs_pos] = part;
rhs_pos++;
}
/** string to build up multiple part names */
protected String multipart_name = new String();
/** append a new name segment to the accumulated multipart name */
protected void append_multipart(String name)
{
String dot = "";
/* if we aren't just starting out, put on a dot */
if (multipart_name.length() != 0) dot = ".";
multipart_name = multipart_name.concat(dot + name);
}
/** table of declared symbols -- contains production parts indexed by name */
protected Hashtable symbols = new Hashtable();
/** table of just non terminals -- contains non_terminals indexed by name */
protected Hashtable non_terms = new Hashtable();
/** declared start non_terminal */
protected non_terminal start_nt = null;
/** left hand side non terminal of the current production */
protected non_terminal lhs_nt;
/** Constructor */
CUP$actions() { }
/** Method with the actual generated action code. */
public final java_cup.runtime.symbol CUP$do_action(
int CUP$act_num,
java_cup.runtime.lr_parser CUP$parser,
java.util.Stack CUP$stack,
int CUP$top)
throws java.lang.Exception
{
/* object for return from actions */
java_cup.runtime.symbol CUP$result;
/* select the action based on the action number */
switch (CUP$act_num)
{
/*. . . . . . . . . . . . . . . . . . . .*/
case 62: // empty ::=
{
CUP$result = new java_cup.runtime.symbol(/*empty*/26);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 61: // label_id ::= ID
{
CUP$result = new java_cup.runtime.str_token(/*label_id*/29);
((java_cup.runtime.str_token)CUP$result).str_val = (/*the_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 60: // symbol_id ::= ID
{
CUP$result = new java_cup.runtime.str_token(/*symbol_id*/28);
((java_cup.runtime.str_token)CUP$result).str_val = (/*the_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 59: // nt_id ::= ID
{
CUP$result = new java_cup.runtime.str_token(/*nt_id*/27);
((java_cup.runtime.str_token)CUP$result).str_val = (/*the_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 58: // new_non_term_id ::= ID
{
CUP$result = new java_cup.runtime.symbol(/*new_non_term_id*/23);
/* see if this non terminal has been declared before */
if (symbols.get((/*non_term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val) != null)
{
/* issue a message */
lexer.emit_error( "Symbol \"" + (/*non_term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val +
"\" has already been declared");
}
else
{
/* build the non terminal object */
non_terminal this_nt =
new non_terminal((/*non_term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val, multipart_name);
/* put it in the non_terms table */
non_terms.put((/*non_term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val, this_nt);
/* build a production_part and put it in the symbols table */
symbols.put((/*non_term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val, new symbol_part(this_nt));
}
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 57: // new_term_id ::= ID
{
CUP$result = new java_cup.runtime.symbol(/*new_term_id*/22);
/* see if this terminal has been declared before */
if (symbols.get((/*term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val) != null)
{
/* issue a message */
lexer.emit_error("Symbol \"" + (/*term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val +
"\" has already been declared");
}
else
{
/* build a production_part and put it in the table */
symbols.put((/*term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val,
new symbol_part(new terminal((/*term_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val, multipart_name)));
}
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 56: // type_id ::= multipart_id
{
CUP$result = new java_cup.runtime.symbol(/*type_id*/16);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 55: // import_id ::= multipart_id
{
CUP$result = new java_cup.runtime.symbol(/*import_id*/12);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 54: // import_id ::= multipart_id DOT STAR
{
CUP$result = new java_cup.runtime.symbol(/*import_id*/12);
append_multipart("*");
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 53: // multipart_id ::= ID
{
CUP$result = new java_cup.runtime.symbol(/*multipart_id*/10);
append_multipart((/*an_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 52: // multipart_id ::= multipart_id DOT ID
{
CUP$result = new java_cup.runtime.symbol(/*multipart_id*/10);
append_multipart((/*another_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 51: // opt_label ::= empty
{
CUP$result = new java_cup.runtime.str_token(/*opt_label*/30);
((java_cup.runtime.str_token)CUP$result).str_val = null;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 50: // opt_label ::= COLON label_id
{
CUP$result = new java_cup.runtime.str_token(/*opt_label*/30);
((java_cup.runtime.str_token)CUP$result).str_val = (/*labid*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 49: // prod_part ::= CODE_STRING
{
CUP$result = new java_cup.runtime.symbol(/*prod_part*/21);
/* add a new production part */
add_rhs_part(new action_part((/*code_str*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val));
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 48: // prod_part ::= symbol_id opt_label
{
CUP$result = new java_cup.runtime.symbol(/*prod_part*/21);
/* try to look up the id */
production_part symb = (production_part)symbols.get((/*symid*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-1)).str_val);
/* if that fails, symbol is undeclared */
if (symb == null)
{
if (lexer.error_count == 0)
lexer.emit_error("Symbol \"" + (/*symid*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-1)).str_val +
"\" has not been declared");
}
else
{
/* add a labeled production part */
add_rhs_part(add_lab(symb, (/*labid*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val));
}
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 47: // prod_part_list ::= empty
{
CUP$result = new java_cup.runtime.symbol(/*prod_part_list*/20);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 46: // prod_part_list ::= prod_part_list prod_part
{
CUP$result = new java_cup.runtime.symbol(/*prod_part_list*/20);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 45: // rhs ::= prod_part_list
{
CUP$result = new java_cup.runtime.symbol(/*rhs*/25);
if (lhs_nt != null)
{
/* build the production */
production p = new production(lhs_nt, rhs_parts, rhs_pos);
/* if we have no start non-terminal declared and this is
the first production, make its lhs nt the start_nt
and build a special start production for it. */
if (start_nt == null)
{
start_nt = lhs_nt;
/* build a special start production */
new_rhs();
add_rhs_part(new symbol_part(start_nt));
add_rhs_part(new symbol_part(terminal.EOF));
emit.start_production =
new production(non_terminal.START_nt, rhs_parts, rhs_pos);
new_rhs();
}
}
/* reset the rhs accumulation in any case */
new_rhs();
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 44: // rhs_list ::= rhs
{
CUP$result = new java_cup.runtime.symbol(/*rhs_list*/24);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 43: // rhs_list ::= rhs_list BAR rhs
{
CUP$result = new java_cup.runtime.symbol(/*rhs_list*/24);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 42: // production ::= error NT$9 SEMI
{
CUP$result = new java_cup.runtime.symbol(/*production*/19);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 41: // NT$9 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$9*/40);
lexer.emit_error("Syntax Error");
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 40: // production ::= nt_id NT$8 COLON_COLON_EQUALS rhs_list SEMI
{
CUP$result = new java_cup.runtime.symbol(/*production*/19);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 39: // NT$8 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$8*/39);
/* lookup the lhs nt */
lhs_nt = (non_terminal)non_terms.get((/*lhs_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
/* if it wasn't declared, emit a message */
if (lhs_nt == null)
{
if (lexer.error_count == 0)
lexer.emit_error("LHS non terminal \"" + (/*lhs_id*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val +
"\" has not been declared");
}
/* reset the rhs accumulation */
new_rhs();
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 38: // production_list ::= production
{
CUP$result = new java_cup.runtime.symbol(/*production_list*/9);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 37: // production_list ::= production_list production
{
CUP$result = new java_cup.runtime.symbol(/*production_list*/9);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 36: // start_spec ::= empty
{
CUP$result = new java_cup.runtime.symbol(/*start_spec*/8);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 35: // start_spec ::= START WITH nt_id NT$7 SEMI
{
CUP$result = new java_cup.runtime.symbol(/*start_spec*/8);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 34: // NT$7 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$7*/38);
/* verify that the name has been declared as a non terminal */
non_terminal nt = (non_terminal)non_terms.get((/*start_name*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
if (nt == null)
{
lexer.emit_error( "Start non terminal \"" + (/*start_name*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val +
"\" has not been declared");
}
else
{
/* remember the non-terminal for later */
start_nt = nt;
/* build a special start production */
new_rhs();
add_rhs_part(new symbol_part(start_nt));
add_rhs_part(new symbol_part(terminal.EOF));
emit.start_production =
new production(non_terminal.START_nt, rhs_parts, rhs_pos);
new_rhs();
}
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 33: // non_term_name_list ::= new_non_term_id
{
CUP$result = new java_cup.runtime.symbol(/*non_term_name_list*/18);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 32: // non_term_name_list ::= non_term_name_list COMMA new_non_term_id
{
CUP$result = new java_cup.runtime.symbol(/*non_term_name_list*/18);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 31: // term_name_list ::= new_term_id
{
CUP$result = new java_cup.runtime.symbol(/*term_name_list*/17);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 30: // term_name_list ::= term_name_list COMMA new_term_id
{
CUP$result = new java_cup.runtime.symbol(/*term_name_list*/17);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 29: // symbol ::= NON TERMINAL error NT$6 SEMI
{
CUP$result = new java_cup.runtime.symbol(/*symbol*/15);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 28: // NT$6 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$6*/37);
/* reset the accumulated multipart name */
multipart_name = new String();
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 27: // symbol ::= TERMINAL error NT$5 SEMI
{
CUP$result = new java_cup.runtime.symbol(/*symbol*/15);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 26: // NT$5 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$5*/36);
/* reset the accumulated multipart name */
multipart_name = new String();
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 25: // symbol ::= NON TERMINAL type_id non_term_name_list NT$4 SEMI
{
CUP$result = new java_cup.runtime.symbol(/*symbol*/15);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 24: // NT$4 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$4*/35);
/* reset the accumulated multipart name */
multipart_name = new String();
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 23: // symbol ::= TERMINAL type_id term_name_list NT$3 SEMI
{
CUP$result = new java_cup.runtime.symbol(/*symbol*/15);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 22: // NT$3 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$3*/34);
/* reset the accumulated multipart name */
multipart_name = new String();
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 21: // symbol_list ::= symbol
{
CUP$result = new java_cup.runtime.symbol(/*symbol_list*/7);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 20: // symbol_list ::= symbol_list symbol
{
CUP$result = new java_cup.runtime.symbol(/*symbol_list*/7);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 19: // scan_code ::= empty
{
CUP$result = new java_cup.runtime.symbol(/*scan_code*/14);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 18: // scan_code ::= SCAN WITH CODE_STRING SEMI
{
CUP$result = new java_cup.runtime.symbol(/*scan_code*/14);
/* save the user code */
emit.scan_code = (/*user_code*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-1)).str_val;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 17: // init_code ::= empty
{
CUP$result = new java_cup.runtime.symbol(/*init_code*/13);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 16: // init_code ::= INIT WITH CODE_STRING SEMI
{
CUP$result = new java_cup.runtime.symbol(/*init_code*/13);
/* save the user code */
emit.init_code = (/*user_code*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-1)).str_val;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 15: // parser_code_part ::= empty
{
CUP$result = new java_cup.runtime.symbol(/*parser_code_part*/6);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 14: // parser_code_part ::= PARSER CODE CODE_STRING SEMI
{
CUP$result = new java_cup.runtime.symbol(/*parser_code_part*/6);
/* save the user included code string */
emit.parser_code = (/*user_code*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-1)).str_val;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 13: // action_code_part ::= empty
{
CUP$result = new java_cup.runtime.symbol(/*action_code_part*/5);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 12: // action_code_part ::= ACTION CODE CODE_STRING SEMI
{
CUP$result = new java_cup.runtime.symbol(/*action_code_part*/5);
/* save the user included code string */
emit.action_code = (/*user_code*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-1)).str_val;
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 11: // code_part ::= action_code_part parser_code_part
{
CUP$result = new java_cup.runtime.symbol(/*code_part*/4);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 10: // import_spec ::= IMPORT import_id NT$2 SEMI
{
CUP$result = new java_cup.runtime.symbol(/*import_spec*/11);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 9: // NT$2 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$2*/33);
/* save this import on the imports list */
emit.import_list.push(multipart_name);
/* reset the accumulated multipart name */
multipart_name = new String();
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 8: // import_list ::= empty
{
CUP$result = new java_cup.runtime.symbol(/*import_list*/3);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 7: // import_list ::= import_list import_spec
{
CUP$result = new java_cup.runtime.symbol(/*import_list*/3);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 6: // package_spec ::= empty
{
CUP$result = new java_cup.runtime.symbol(/*package_spec*/2);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 5: // package_spec ::= PACKAGE multipart_id NT$1 SEMI
{
CUP$result = new java_cup.runtime.symbol(/*package_spec*/2);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 4: // NT$1 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$1*/32);
/* save the package name */
emit.package_name = multipart_name;
/* reset the accumulated multipart name */
multipart_name = new String();
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 3: // spec ::= error symbol_list start_spec production_list
{
CUP$result = new java_cup.runtime.symbol(/*spec*/1);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 2: // spec ::= NT$0 package_spec import_list code_part init_code scan_code symbol_list start_spec production_list
{
CUP$result = new java_cup.runtime.symbol(/*spec*/1);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 1: // NT$0 ::=
{
CUP$result = new java_cup.runtime.token(/*NT$0*/31);
/* declare "error" as a terminal */
symbols.put("error", new symbol_part(terminal.error));
/* declare start non terminal */
non_terms.put("$START", non_terminal.START_nt);
}
return CUP$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 0: // $START ::= spec EOF
{
CUP$result = new java_cup.runtime.token(/*$START*/0);
}
/* ACCEPT */
CUP$parser.done_parsing();
return CUP$result;
/* . . . . . .*/
default:
throw new Exception(
"Invalid action number found in internal parse table");
}
}
};
| [
"[email protected]"
] | |
b8cb1b65ed7b48746484beab457f112ce032922d | b91b34b404d15f0b67e3369b711bffafd6625a95 | /src/pidev/GUI1/UserScreenController.java | 2f5114aa316fd2307bbd8cc7b05b60eaa523f6b5 | [] | no_license | achrefzeddini/PIDEV-Desktop-JAVA | 6dac6ac4c1b86253bfe39f6448f9c5a706bc92e0 | f42469fc8a04113318831505c347fda512c614ae | refs/heads/main | 2023-06-30T09:35:05.044534 | 2021-07-25T12:57:25 | 2021-07-25T12:57:25 | 389,344,649 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,758 | 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 pidev.GUI1;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
/**
* FXML Controller class
*
* @author Testouri Mohamed
*/
public class UserScreenController implements Initializable {
@FXML
private AnchorPane Pane;
@FXML
private TextField SearchTermTextFiled;
@FXML
private TableView<?> Table;
@FXML
private TableColumn<?, ?> IDUser;
@FXML
private TableColumn<?, ?> FnameUser;
@FXML
private TableColumn<?, ?> LnameUser;
@FXML
private TableColumn<?, ?> PhoneUser;
@FXML
private TableColumn<?, ?> EmailUser;
@FXML
private Button DeleteButton;
@FXML
private Button UpdateButton;
@FXML
private Button AddButton;
@FXML
private Button AssignButton;
@FXML
private Button refreshButton;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
@FXML
private void deleteUser(ActionEvent event) {
}
@FXML
private void updateUser(ActionEvent event) {
}
@FXML
private void addUser(ActionEvent event) {
}
@FXML
private void assignUser(ActionEvent event) {
}
@FXML
private void refresh(ActionEvent event) {
}
}
| [
"[email protected]"
] | |
d61cc91daf598cc499eb33f1776e40e173a02f40 | ae22a4eddf5faa9bb4dd9bb1dc9073c892b3cbb8 | /src/test/java/TodoTest.java | 9bf8ff2cfcc2520681d61b6c792529349e25ab4f | [] | no_license | Leofeng10/ip | fa655ed44642ae6843224fcd348b1234d17c3df9 | 15a6da1b1c21b1abc1148c3a74da0ac580d2a784 | refs/heads/master | 2023-08-17T12:35:55.940398 | 2021-10-12T15:46:47 | 2021-10-12T15:46:47 | 397,195,584 | 0 | 0 | null | 2021-09-05T13:11:17 | 2021-08-17T09:43:29 | Java | UTF-8 | Java | false | false | 751 | java | import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.Test;
import duke.core.Duke;
import duke.task.Todo;
public class TodoTest {
@Test
public void createTodoTest() {
try {
Duke duke = new Duke("data/todoList2.txt");
Todo todo = new Todo("test", false);
} catch (Exception e) {
fail("Should not have thrown any exception");
}
}
@Test
public void searchKeywordTest() {
try {
Duke duke = new Duke("data/todoList2.txt");
Todo todo = new Todo("test", false);
todo.searchKeyword("run");
} catch (Exception e) {
fail("Should not have thrown any exception");
}
}
}
| [
"[email protected]"
] | |
bfab4f60fcc8999f74cae3227b1b5da4dbbc5405 | b7cd8062b527c86441c7838e4824e4a5b4c67932 | /gwt-test-utils-gxt3/src/test/java/com/googlecode/gxt/test/WindowTest.java | 34728fd42ceaba61e4cdd092778f48573d8b8c62 | [] | no_license | vboulaye/gwt-test-utils | 5e9ecd93259a1500b5fa0a3a965bc7b795cc09bb | a40f63937b42d2861f8e974d9927351c9b91bde7 | refs/heads/master | 2021-07-13T03:21:46.185661 | 2017-04-03T06:55:49 | 2017-04-03T06:55:49 | 107,225,727 | 0 | 0 | null | 2017-10-17T06:15:31 | 2017-10-17T06:15:29 | null | UTF-8 | Java | false | false | 4,562 | java | package com.googlecode.gxt.test;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.*;
import com.sencha.gxt.widget.core.client.event.ActivateEvent.ActivateHandler;
import com.sencha.gxt.widget.core.client.event.DeactivateEvent.DeactivateHandler;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
import com.sencha.gxt.widget.core.client.event.MaximizeEvent.MaximizeHandler;
import com.sencha.gxt.widget.core.client.event.MinimizeEvent.MinimizeHandler;
import com.sencha.gxt.widget.core.client.event.RestoreEvent.RestoreHandler;
import com.sencha.gxt.widget.core.client.event.ShowEvent.ShowHandler;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class WindowTest extends GwtGxtTest {
private boolean activate;
private boolean deactivate;
private boolean hide;
private boolean maximize;
private boolean minimize;
private boolean restore;
private boolean show;
private Window window;
@Test
public void activate() {
// Given
window.addActivateHandler(new ActivateHandler<Window>() {
public void onActivate(ActivateEvent<Window> event) {
assertThat(event.getItem()).isEqualTo(window);
activate = true;
}
});
window.show();
// When
window.setActive(true);
// Then
assertThat(activate).isTrue();
}
@Before
public void beforeWindowTest() {
window = new Window();
RootPanel.get().add(window);
activate = false;
deactivate = false;
hide = false;
maximize = false;
minimize = false;
restore = false;
show = false;
}
@Test
public void deactivate() {
// Given
window.addDeactivateHandler(new DeactivateHandler<Window>() {
public void onDeactivate(DeactivateEvent<Window> event) {
assertThat(event.getItem()).isEqualTo(window);
deactivate = true;
}
});
window.show();
// When
window.setActive(false);
// Then
assertThat(deactivate).isTrue();
}
@Test
public void hide() {
// Given
window.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
assertThat(event.getSource()).isEqualTo(window);
hide = true;
}
});
window.show();
// When
window.hide();
// Then
assertThat(hide).isTrue();
}
@Test
public void maximize() {
// Given
window.addMaximizeHandler(new MaximizeHandler() {
public void onMaximize(MaximizeEvent event) {
assertThat(event.getSource()).isEqualTo(window);
maximize = true;
}
});
window.show();
// When
window.maximize();
// Then
assertThat(maximize).isTrue();
}
@Test
public void minimize() {
// Given
window.addMinimizeHandler(new MinimizeHandler() {
public void onMinimize(MinimizeEvent event) {
assertThat(event.getSource()).isEqualTo(window);
minimize = true;
}
});
window.show();
// When
window.minimize();
// Then
assertThat(minimize).isTrue();
}
@Test
public void restore() {
// Given
window.addRestoreHandler(new RestoreHandler() {
public void onRestore(RestoreEvent event) {
assertThat(event.getSource()).isEqualTo(window);
restore = true;
}
});
window.show();
window.maximize();
// When
window.restore();
// Then
assertThat(restore).isTrue();
}
@Test
public void show() {
// Given
window.addShowHandler(new ShowHandler() {
public void onShow(ShowEvent event) {
assertThat(event.getSource()).isEqualTo(window);
show = true;
}
});
// When
window.show();
// Then
assertThat(show).isTrue();
}
}
| [
"[email protected]"
] | |
80400d6be80906984753c6e0581bb17ad49662bf | e24c795684765bbc3b0931e1fe49861d1bb2a975 | /CoursesRegistrationSystemHCMUS/src/main/java/GUI/teacherClassShow.java | 966e62571902e82420f5480a13fa11006b30c0c7 | [] | no_license | vophiminhhieu/CoursesRegistrationSystem | 9da93a0488207505e4140ea66fe30e819a0654d8 | a5a624bc6feb982c1205f4523f279de84467f51b | refs/heads/master | 2023-05-30T08:41:58.086729 | 2021-06-11T18:12:26 | 2021-06-11T18:12:26 | 366,107,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,437 | java | package GUI;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import DAL.DAO.ClassDao;
public class teacherClassShow extends JPanel {
private ImageIcon background = new ImageIcon("image/Menu/leftCenterPanel.png");
private Icon backIcon = new ImageIcon("image/Menu/Dashboard/userAccount/back.png");
private JButton backBtn = new JButton(backIcon);
private JFrame frame = new JFrame();
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (background != null) {
g.drawImage(background.getImage(), 0, 0, getWidth(), getHeight(), null);
}
}
private void prepareGUI() {
backBtn.setBounds(400, 200, 95, 29); backBtn.setActionCommand("Back");
frame.setLayout(null);
frame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
frame.setLocation(200,80);
frame.setTitle("List of Semester");
frame.pack();
frame.setSize(750,550);
}
private void on() {
ClassDao dao = new ClassDao();
String[] columnName = {"ID","Name","Number of Male","Number of Female","Number of Student"};
JTable table = new JTable(dao.getListClass(),columnName);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.getColumnModel().getColumn(0).setPreferredWidth(80);
table.getColumnModel().getColumn(1).setPreferredWidth(220);
table.getColumnModel().getColumn(2).setPreferredWidth(144);
table.getColumnModel().getColumn(3).setPreferredWidth(144);
table.getColumnModel().getColumn(4).setPreferredWidth(144);
JPanel panel =new JPanel(new BorderLayout());
panel.setPreferredSize(new Dimension(750,550));
JScrollPane sp=new JScrollPane(table);
panel.add(sp,BorderLayout.CENTER);
panel.setOpaque(true);
frame.setContentPane(panel);
frame.setVisible(true);
}
public teacherClassShow(ActionListener obj) {
setLayout(null); add(backBtn); prepareGUI(); backBtn.addActionListener(obj); on(); setBounds(0, 10, 495, 281);
}
}
| [
"[email protected]"
] | |
715f6334cb00c9bd1a8dc6392cd5a804274b6bc0 | 0efe079e25f22a8bd6964a9eb3a4d4790344e1f3 | /app/src/main/java/com/longer/demo/di/component/ActivityComponent.java | 65cb30800e478c501ea954ab7f1add747ae5ef40 | [] | no_license | lg878398509/demo | b52f9de341f4e3c6ef66542a795a06339ff015d8 | 348f6a632618ef5b05bc500f07581b7ccdc87674 | refs/heads/master | 2021-01-15T23:21:33.152524 | 2017-08-10T14:01:28 | 2017-08-10T14:01:28 | 99,929,062 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.longer.demo.di.component;
import android.app.Activity;
import com.longer.demo.di.module.ActivityModule;
import com.longer.demo.di.scope.PerActivity;
import dagger.Component;
@PerActivity
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {
Activity activity();
}
| [
"[email protected]"
] | |
3e2d552d6dea046c8a7e842d2e387e1c5ad2315d | 171e316664227454084cbda2e123b7ecf778b094 | /generating_func.java | c8dcef55781ec8a50bb3bbfd2bbfb82dc2e33430 | [] | no_license | shwetacharchita/Basic-Codes | 9accc988c56fd2c09627b3d4ba76abb41c89e53b | c561e2d78f1f544b31d29c89a7a83cf093f3fb3b | refs/heads/master | 2021-01-01T03:42:39.282319 | 2016-05-01T16:20:11 | 2016-05-01T16:20:11 | 57,636,666 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,287 | java | import java.io.*;
class generating_func
{
public static void main(String[]args)throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Generating Function of Numeric Functions of type:\n1.Exponential: x^r\n2.Polynomial:Cor^0+C1r^1+C2r^2+...");
int op=Integer.parseInt(in.readLine());
switch(op)
{
case 1:
System.out.println("Enter value of x:");
int x=Integer.parseInt(in.readLine());
System.out.println("Enter value of r till which function is to be generated:");
int r=Integer.parseInt(in.readLine());
System.out.println("Generating function:");
for(int i=0;i<=r;i++)
{
int a=xfn(x,i);
System.out.print(a+"z^"+i);
if(i!=r)
System.out.print("\t+\t");
}
break;
case 2:
System.out.println("Enter value of degree till which function is to be generated:");
int d=Integer.parseInt(in.readLine());
float rhs[]=new float[d+1];
for(int i=0;i<=d;i++)
{
System.out.println("Enter coefficient for r^"+i+":");
rhs[i]=Float.parseFloat(in.readLine());
}
float z=0;
System.out.println("Generating function:");
for(int i=0;i<=d;i++)
{
for(int j=0;j<=d;j++)
{
z+=rhs[j]*xfn(i,j);
}
System.out.print(z+"z^"+i);
if(i!=d)
System.out.print("\t+\t");
z=0;
}
break;
default:System.out.println("Invalid choice!");
}
}
public static int xfn(int a,int i)
{
int val=1;
for(int j=0;j<i;j++)
{
val*=a;
}
return val;
}
} | [
"[email protected]"
] | |
0fd90faced321c87436ba4004d31f9b25b9b81b0 | d168c02c4753a30bd0bf07e86b49ccacfb9b5f83 | /AndroidViews/src/net/learn2develop/PurchaseOrders/WebServiceTransferTo.java | f06de6af9166027209fca99c247e8aae44093f88 | [] | no_license | luizsr/jtelmon | 3ec5e679523ab3adf602c9beeb0fae7ca68447f0 | 6792e3dc8152f058fd16d0862b7b1aae051bb25c | refs/heads/master | 2021-01-10T07:43:46.820147 | 2015-03-12T17:28:07 | 2015-03-12T17:28:07 | 47,506,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,327 | java |
package net.learn2develop.PurchaseOrders;
import net.learn2develop.R;
import java.util.List;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.Toast;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.json.JSONStringer;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import android.util.Log;
public class WebServiceTransferTo extends Activity {
private final static String SERVICE_URI = "http://sfa.pangram.ro:8090/PostgresWebService/rest";
// private final static String SERVICE_URI = "http://192.168.61.3/SalesService/SalesService.svc";
// private final static String SERVICE_URI = "http://ftp.pangram.ro:9090/SalesService/SalesService.svc";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ProgressDialog progressDialog = ProgressDialog.show(this, "", "Trimitere comenzi...");
new Thread() {
public void run() {
SyncOrders();
progressDialog.dismiss();
}
}.start();
}
private Handler threadHandler = new Handler() {
public void handleMessage(android.os.Message msg) {
String isNot = new String(" ");
if (msg.what == 0) {
// t3.setText(msg.getData().getString("result"));
isNot = msg.getData().getString("result");
Toast.makeText(WebServiceTransferTo.this, isNot + " OK ! " + "\n", Toast.LENGTH_LONG).show() ;
}
super.handleMessage(msg);
}
};
public void SyncOrders() {
Message messageToThread = threadHandler.obtainMessage();
DataManipulator dm;
List<String[]> ordersToSend = null ;
dm = new DataManipulator(this);
ordersToSend = dm.selectAllOrders();
String isNot = new String(" ");
Bundle messageData = new Bundle();
HttpPost request = new HttpPost(SERVICE_URI + "/sales");
request.setHeader("Accept", "application/json");
request.setHeader("Content-type", "application/json");
for (String[] orderToSend : ordersToSend) {
String idLineToSend = orderToSend[0];
String clientToSend = orderToSend[1];
String productToSend = orderToSend[2];
String piecesToSend = orderToSend[3];
String discountToSend = orderToSend[4];
try {
JSONStringer jsonOrderToSend = new JSONStringer()
.object()
.key("client").value(clientToSend)
.key("product").value(productToSend)
.key("pieces").value(piecesToSend)
.key("discount").value(discountToSend)
.key("line").value(idLineToSend)
.endObject();
StringEntity entity = new StringEntity(jsonOrderToSend.toString());
Log.d( " OrderLine " , jsonOrderToSend.toString() + "\n" ) ;
request.setEntity(entity);
// Send request to REST Web Service ->
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpResponse response = httpClient.execute(request);
// IF [200=response.getStatusLine().getStatusCode()] => HttpResponse=OK
Log.d("WebInvoke", " OK if 200 = " + response.getStatusLine().getStatusCode());
}catch (Exception e) {
isNot = "NOT ";
}
}
// Toast.makeText(this, isNot + " OK ! " + "\n", Toast.LENGTH_LONG).show() ;
messageToThread.what = 0;
messageData.putString("result", isNot);
messageToThread.setData(messageData);
threadHandler.sendMessage(messageToThread);
if (dm != null) {
dm.close();
}
}
}
| [
"auntaru@fbeace9d-d74f-0410-b0ac-cf0a61670a25"
] | auntaru@fbeace9d-d74f-0410-b0ac-cf0a61670a25 |
e38ac5c02f420ef99210e815e5b7b55b21eb20f4 | 7139a93e7d5515fd490e4c2d838f906043999add | /src/application/beans/Coordinates.java | 1e3f6615aa134af2c1b931736c9360a2744772ac | [] | no_license | antoniospoletojr/Fractal-Explorer | 3d3ba021e91234513d31e8ac85aed3e5855f8138 | 2b36bf5199918092989393f72136c9a47669823a | refs/heads/master | 2020-06-21T21:12:32.537038 | 2019-09-12T21:10:49 | 2019-09-12T21:10:49 | 197,553,525 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,793 | java | package application.beans;
/**
* Bean class implementing the coordinates of the complex plane, used to render the fractals.
* It implements Cloneable for the Memento pattern.
* @author Antonio Spoleto Junior
*/
public class Coordinates implements Cloneable
{
private double realMax;
private double realMin;
private double imagMax;
private double imagMin;
public Coordinates(){}
/**
* Construct the plane with its 4 edges.
* @param realMax
* @param realMin
* @param imagMax
* @param imagMin
*/
public Coordinates(double realMax, double realMin, double imagMax, double imagMin)
{
this.realMax = realMax;
this.realMin = realMin;
this.imagMax = imagMax;
this.imagMin = imagMin;
}
public double getRealMax()
{
return realMax;
}
public void setRealMax(double realMax)
{
this.realMax = realMax;
}
public double getRealMin()
{
return realMin;
}
public void setRealMin(double realMin)
{
this.realMin = realMin;
}
public double getImagMax()
{
return imagMax;
}
public void setImagMax(double imagMax)
{
this.imagMax = imagMax;
}
public double getImagMin()
{
return imagMin;
}
public void setImagMin(double imagMin)
{
this.imagMin = imagMin;
}
@Override
public Coordinates clone() {
try {
return (Coordinates) super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}
@Override
public String toString()
{
return "realMax=" + realMax + ", realMin=" + realMin + ", imagMax=" + imagMax + ", imagMin=" + imagMin;
}
}
| [
"[email protected]"
] | |
83458a24fdeb12e953f73493cfae1654aaeeef25 | a6905033ace978b540ea1ced70ed95b3033fba45 | /LearningGit/src/myJavaCodes/SalesTool.java | ca500e207e44f93fc8a2776c81a8d76325040d42 | [] | no_license | ps2811/JavaCodesRepo | d4bc4f0a32efd59541fb326c789780c8d7ccd715 | b4876b938ced664a674ef40f55e8463b31f2748f | refs/heads/master | 2021-01-10T04:45:28.891927 | 2015-10-17T17:34:22 | 2015-10-17T17:34:22 | 44,220,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 264 | java | package myJavaCodes;
public class SalesTool {
int data[] = {0,4,42};
public void display() {
System.out.println("Inside SalesTool class");
System.out.println("Insode SalesTool 2");
System.out.println("SalesTool Ends");
}
} | [
"[email protected]"
] | |
023b76c002aaf863be60ae0c81cc3f2f5af87a6b | e2904a117b4ba8582579955ad383cbf8250a6ae5 | /src/march11Codes/reviewMethods.java | 34f7e424b522c274e4fc306c5059a149b5408792 | [] | no_license | eyilmaz4/March11 | 05e24a8d42974333a4128f0071562f47f7baef01 | 52c239f4b473afd7c51201cdb106a1d072120926 | refs/heads/master | 2021-03-14T04:11:25.683507 | 2020-03-12T03:34:17 | 2020-03-12T03:34:17 | 246,735,986 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 680 | java | package march11Codes;
public class reviewMethods {
public static void main(String[] args) {
parkFee(true, 12);
}
public static void parkFee(Boolean member, int hour) {
int payment=0;
if (member) {
System.out.println("no charge");;
} else {
if (hour >= 1 && hour <= 2) {
payment = 3;
} else if (hour >= 3 && hour <= 6) {
payment = 5;
} else if (hour >= 7 && hour <= 12) {
payment = 10;
} else if (hour > 12) {
payment = 15;
}
}System.out.println("your parking fee is: $"+payment);
}
}
| [
"[email protected]"
] | |
f527af81dcd24427dde869074c4e02a155e649c6 | 27b260a46caa09eb5f28877ffc27322881b80a6b | /task2/src/main/java/com/vinaypabba/task2/Task2Application.java | b40983f37a4f5f680c64090007c826376d6a18f3 | [] | no_license | vinaynikhil313/assignment | 65435646dd84198cfa93d692e61a1e6ee362c87c | 0abbcce02640e59b75b27016814bd9cb4338859b | refs/heads/master | 2022-11-16T22:01:38.041403 | 2020-07-13T05:37:35 | 2020-07-13T05:37:35 | 279,120,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 968 | java | package com.vinaypabba.task2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication
@EnableSwagger2
public class Task2Application {
public static void main(String[] args) {
SpringApplication.run(Task2Application.class, args);
}
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.vinaypabba.task2"))
.paths(PathSelectors.any())
.build();
}
}
| [
"[email protected]"
] | |
e7c249afd565aa8688d3a6e0d3a0f694101afcc1 | 88c866eab06fa3e896b0bd709caaa630b1d8ae41 | /src/exe234/Student.java | f2fee941670a100553cc1fc63efbadf2f6387fcd | [] | no_license | lebaohung/Java-HomeWork | b3b8a60233d36f76897c33ec97eff57f604e966f | 4822124e25386984c4d60b78850fb45f23d338eb | refs/heads/master | 2021-05-21T02:34:29.587628 | 2020-04-03T08:13:08 | 2020-04-03T08:13:08 | 252,504,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,376 | java | package exe234;
import java.util.Scanner;
public class Student extends Person {
private int id;
private double averageScore ;
private String email;
private boolean getScholarship = false;
public Student() {
}
public Student(String name, String gender, int birth, String add, int id, double averageScore, String email) {
super(name, gender, birth, add);
this.id = id;
this.averageScore = averageScore;
this.email = email;
if (this.averageScore > 8) this.setGetScholarship(true);
}
public int getId() {
return id;
}
public boolean isGetScholarship() {
return getScholarship;
}
public void setGetScholarship(boolean getScholarship) {
this.getScholarship = getScholarship;
}
public double getAverageScore() {
return averageScore;
}
public String getEmail() {
return email;
}
public void setId(int id) {
this.id = id;
}
public void setAverageScore(double averageScore) {
this.averageScore = averageScore;
}
public void setEmail(String email) {
this.email = email;
}
public void inputStudent() {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter Student name: ");
this.setName(scanner.nextLine());
System.out.print("Enter gender (male/female): ");
this.setGender(scanner.nextLine());
System.out.print("Enter birthday: ");
this.setBirth(scanner.nextInt());
scanner.nextLine();
System.out.print("Enter address: ");
this.setAdd(scanner.nextLine());
System.out.print("Enter Student ID: ");
this.setId(scanner.nextInt());
System.out.print("Enter Student's average score: ");
this.setAverageScore(scanner.nextDouble());
scanner.nextLine();
System.out.print("Enter Student Email: ");
this.setEmail(scanner.nextLine());
}
public void displayStudent() {
System.out.printf("%-15s%-10s%-10d%-10s%-10d%-10.2f%-30s",this.getName(), this.getGender(), this.getBirth(), this.getAdd(),this.getId(), this.getAverageScore(), this.getEmail());
System.out.println();
}
public void checkScholarship() {
if (this.getAverageScore() > 8) {
this.getScholarship = true;
}
}
}
| [
"[email protected]"
] | |
1090ac7ca7db92ea2b46826c0ca152f25a2b2124 | b02b82032567f2b2d5882016b313dbc60dbd91d7 | /app/src/main/java/ua/tarastom/newsaggregator/api/ApiInterface.java | a0fb01056683b3015c64ee4bacd4ae17ec6b4cf6 | [] | no_license | HeavyMetal77/NewsAggregator | 39a785034cfb7c209dec91222d4159fcaccceae3 | 67803ac9900a633d379b818e0077455092cdf572 | refs/heads/main | 2023-02-15T06:33:19.656969 | 2020-12-21T09:28:18 | 2020-12-21T09:28:18 | 328,184,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 564 | java | package ua.tarastom.newsaggregator.api;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
import ua.tarastom.newsaggregator.models.News;
public interface ApiInterface {
@GET("find")
Call<News> getFeed(
@Query("key") String keyWord,
@Query("country") String country,
@Query("category") String category,
@Query("language") String language,
@Query("titleChannel") String titleChannel,
@Query("page") int page,
@Query("size") int size
);
}
| [
"[email protected]"
] | |
c971df983705b95dd8aa4ea022a91b8391181d65 | 330a4176df3be6c73a2c0af36391a92f04740789 | /app/src/main/java/cn/vailing/chunqiu/jiashifen/bean/FileBean.java | 7eead1bf768f00646f375d1141fb13d4240b9b12 | [] | no_license | WHUCC/JiaShiFen | 0d4b12a27d865deb01795b06956acb1c9d1a16dc | 9d9c0914729b437e558d33accaaa671b7c8c2282 | refs/heads/master | 2022-02-22T13:20:23.351742 | 2019-09-05T03:52:03 | 2019-09-05T03:52:03 | 276,130,042 | 1 | 0 | null | 2020-06-30T14:56:06 | 2020-06-30T14:56:05 | null | UTF-8 | Java | false | false | 1,083 | java | package cn.vailing.chunqiu.jiashifen.bean;
import android.widget.ImageButton;
/**
* Created by dream on 2018/7/4.
*/
public class FileBean {
private String thumbnailBigPath;
private String originalPath;
private ImageButton imageButton;
public ImageButton getImageButton() {
return imageButton;
}
public void setImageButton(ImageButton imageButton) {
this.imageButton = imageButton;
}
public FileBean( String thumbnailBigPath,String originalPath,ImageButton imageButton) {
this.imageButton = imageButton;
this.originalPath = originalPath;
this.thumbnailBigPath = thumbnailBigPath;
}
public FileBean() {
}
public String getOriginalPath() {
return originalPath;
}
public void setOriginalPath(String originalPath) {
this.originalPath = originalPath;
}
public String getThumbnailBigPath() {
return thumbnailBigPath;
}
public void setThumbnailBigPath(String thumbnailBigPath) {
this.thumbnailBigPath = thumbnailBigPath;
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.