blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
64a9f5d64ef23f021c392837f377de2267d482c6 | 570367b3b35e724ed5279c7f34b9e776536ca871 | /Ciphers/src/sample/Main.java | bcc3e4e4d2a7719ed530c22f2ea8491f406b93d6 | [] | no_license | ysfgouicem/java_projects | b1c46b793cc1bdfc2117fa3ed166157ab8a6d27e | f8e69d45f4c436b6e7288983c8ab13455b43b775 | refs/heads/master | 2021-04-26T23:20:32.656421 | 2019-06-10T22:44:06 | 2019-06-10T22:44:06 | 123,967,855 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,762 | java | /* Vigenere / Vernam / Ceasar Ciphers -
Functions for encrypting and decrypting data messages. Then send them to a friend.
*/
package sample;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.layout.*;
import javafx.stage.Stage;
import java.util.Vector;
public class Main extends Application {
private Button buttonenc;
private Button buttondec;
private Button buttonclr;
@Override
public void start(Stage primaryStage) throws Exception{
//Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Ciphers");
VBox centermenu = new VBox();
Label lab = new Label("Enter text below : ") ;
centermenu.setPrefWidth(100);
TextArea textArea = new TextArea();
textArea.setPrefHeight(350);
textArea.setPrefWidth(300);
textArea.setStyle("-fx-font-size: 1.5em;");
buttonenc = new Button("ENCRYPT") ;
buttondec = new Button("DECRYPT");
buttonclr = new Button("CLEAR");
buttonclr.setMinWidth(100);
buttondec.setMinWidth(100);
buttonenc.setMinWidth(100);
buttonclr.setPadding(new Insets(3));
buttonenc.setPadding(new Insets(3));
buttondec.setPadding(new Insets(3));
buttonclr.setOnAction(e->textArea.clear());
// check if textarea is not empty
buttonenc.setOnAction(e->{
if(textArea.getText().length()<1){
// alert box here cuz empty text area prompt ( enter some text )
AlertBox.display(" ALERT !", "Empty textarea !! , please enter some text");
}
else {
Encryptionwin.display(textArea.getText()); }
});
// check if textarea is not empty
buttondec.setOnAction(e->{
if(textArea.getText().length()<1){
// alert box here cuz empty text area prompt ( enter some text )
AlertBox.display(" ALERT !", "Empty textarea !! , please enter some text");
}
else {
Decryptionwin.display(textArea.getText()); }
});
centermenu.getChildren().addAll(lab,textArea,buttonenc,buttondec,buttonclr);
centermenu.setAlignment(Pos.CENTER);
centermenu.setSpacing(5);
BorderPane bp = new BorderPane();
bp.setCenter(centermenu);
Scene scene = new Scene(bp, 600, 500);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
| [
"ysfgouicem@gmail.com"
] | ysfgouicem@gmail.com |
ee6b3256261580d3e9c69b1f58f60b1febc603d9 | eec9aa71fca1d12cfeda08affdb8c5ef032f5c39 | /app/src/main/java/com/pinkump3/musiconline/adapter/FragmentAdapter.java | 4978dc6514eaa1229f1b0e65cd744a0806eb4878 | [] | no_license | fandofastest/yopylagi | 5ba4ba581613fc52497093ac53f2dec99e787255 | 257c57740b3cd54240f3d2be438e588ba1ab5205 | refs/heads/master | 2020-11-30T04:58:20.155481 | 2019-12-28T07:34:57 | 2019-12-28T07:34:57 | 230,306,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 988 | java | package com.pinkump3.musiconline.adapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import java.util.ArrayList;
import java.util.List;
public class FragmentAdapter extends FragmentPagerAdapter {
private final List<Fragment> mFragmentList = new ArrayList<>();
private final List<String> mFragmentTitleList = new ArrayList<>();
public FragmentAdapter(FragmentManager fragment) {
super(fragment);
}
@Override
public Fragment getItem(int position) {
return mFragmentList.get(position);
}
@Override
public int getCount() {
return mFragmentList.size();
}
public void addFragment(Fragment fragment, String title) {
mFragmentList.add(fragment);
mFragmentTitleList.add(title);
}
@Override
public CharSequence getPageTitle(int position) {
return mFragmentTitleList.get(position);
}
}
| [
"fandofast@gmail.com"
] | fandofast@gmail.com |
607a43cb8d89f32c9d660d09646632f22f65b6b9 | b907f692c0cdd412a6c0d1c947196e0ecd1747bb | /springboot/datasource/dynamic/src/main/java/alvin/study/springboot/ds/conf/DataSourceConfig.java | 993541467c227f63d3884f4d6978c6f7066ce8b1 | [] | no_license | alvin-qh/study-java | 64af09464325ab9de09cde6ce6240cf8d3e1653d | 63b9580f56575aa9d7b271756713a06c7e375c1a | refs/heads/master | 2023-08-22T05:53:39.790527 | 2023-08-20T16:06:11 | 2023-08-20T16:06:11 | 150,560,041 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,828 | java | package alvin.study.springboot.ds.conf;
import alvin.study.springboot.ds.core.data.DataSourceFactory;
import alvin.study.springboot.ds.core.data.DynamicDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
/**
* 配置数据源
*
* <p>
* {@link EnableTransactionManagement @EnableTransactionManagement}
* 注解表示启动默认的事务管理器
* </p>
*/
@Configuration("conf/datasource")
@EnableTransactionManagement
public class DataSourceConfig {
/**
* 创建动态数据源对象
*
* <p>
* 动态数据源 {@link DynamicDataSource} 类型是一个能够根据线程上下文中存储的数据库名称动态进行数据源切换的特殊数据源类型
* </p>
*
* <p>
* 动态数据源中的实际数据源对象是通过 {@link DataSourceFactory} 对象创建的
* </p>
*
* <p>
* 本例中有两类数据源, 默认数据源存储配置信息, 即不同组织代码所要访问的目标数据库, 该数据库共有一个; 业务数据库是根据组织代码对应的数据库,
* 该数据库有多个
* </p>
*
* @param defaultDbName 默认的数据库名称
* @param dataSourceFactory 数据源工厂对象
* @return 动态数据源对象
*/
@Bean
@Primary
DataSource dynamicDataSource(
@Value("${spring.datasource-template.default-db-name}") String defaultDbName,
DataSourceFactory dataSourceFactory) {
return new DynamicDataSource(defaultDbName, dataSourceFactory);
}
}
| [
"quhao317@163.com"
] | quhao317@163.com |
d5e820d9dc5f23ddee67fed4235aa0d3a9fa6871 | 076bdf2c9cd8a4038ab59231f7dd34d5b4330149 | /powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/instance/InstanceTimeWheelService.java | 10a0c9d3720c12e049158eeb3af3966e20f16bb2 | [
"Apache-2.0"
] | permissive | qitao321/PowerJob | 0f975e72fbb7157eba2f406dd43f5c2e398720fa | 34ee79ca0631481595fa754490ef38dc5bf87778 | refs/heads/master | 2023-03-22T16:17:39.530484 | 2021-03-18T01:02:57 | 2021-03-18T01:02:57 | 283,451,421 | 0 | 0 | Apache-2.0 | 2020-07-29T09:08:05 | 2020-07-29T09:08:04 | null | UTF-8 | Java | false | false | 1,662 | java | package com.github.kfcfans.powerjob.server.service.instance;
import com.github.kfcfans.powerjob.server.common.utils.timewheel.HashedWheelTimer;
import com.github.kfcfans.powerjob.server.common.utils.timewheel.TimerFuture;
import com.github.kfcfans.powerjob.server.common.utils.timewheel.TimerTask;
import com.google.common.collect.Maps;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* 定时调度任务实例
*
* @author tjq
* @since 2020/7/25
*/
public class InstanceTimeWheelService {
private static final Map<Long, TimerFuture> CARGO = Maps.newConcurrentMap();
// 精确时间轮,每 1S 走一格
private static final HashedWheelTimer TIMER = new HashedWheelTimer(1, 4096, Runtime.getRuntime().availableProcessors() * 4);
// 支持取消的时间间隔,低于该阈值则不会放进 CARGO
private static final long MIN_INTERVAL_MS = 1000;
/**
* 定时调度
* @param uniqueId 唯一 ID,必须是 snowflake 算法生成的 ID
* @param delayMS 延迟毫秒数
* @param timerTask 需要执行的目标方法
*/
public static void schedule(Long uniqueId, Long delayMS, TimerTask timerTask) {
TimerFuture timerFuture = TIMER.schedule(() -> {
CARGO.remove(uniqueId);
timerTask.run();
}, delayMS, TimeUnit.MILLISECONDS);
if (delayMS > MIN_INTERVAL_MS) {
CARGO.put(uniqueId, timerFuture);
}
}
/**
* 获取 TimerFuture
* @param uniqueId 唯一 ID
* @return TimerFuture
*/
public static TimerFuture fetchTimerFuture(Long uniqueId) {
return CARGO.get(uniqueId);
}
}
| [
"jiqi.tjq@alibaba-inc.com"
] | jiqi.tjq@alibaba-inc.com |
170c70f154364113f2d817945530d29808e91f1f | d27377cbc47756a318d30417d6d637debbe7321a | /src/main/java/wzd/util/TableOfMysqlUtil.java | 869ce7b97bbb3aec7e608c80880529faa7c3412b | [] | no_license | zdwang0317/imt | 9b7ff832365c2ecba55b68d1458e1961b5d22735 | 233ad9557beddc63d558db9a7b4fab6785906331 | refs/heads/master | 2020-05-22T09:31:27.902941 | 2019-01-15T01:20:35 | 2019-01-15T01:32:05 | 39,880,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,135 | java | package wzd.util;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class TableOfMysqlUtil {
public static int createTableToCpWipHistory(Connection conn,String tableName){
PreparedStatement pst = null;
int fd = -1;
if (conn != null) {
try {
pst = conn
.prepareStatement("CREATE TABLE "+tableName+"("
+ "Id int(11) NOT NULL AUTO_INCREMENT,"
+ "pn varchar(50) DEFAULT NULL,"
+ "cpn varchar(50) DEFAULT NULL,"
+ "ipn varchar(50) DEFAULT NULL,"
+ "lid varchar(50) DEFAULT NULL,"
+ "qty int(11) DEFAULT NULL,"
+ "wid varchar(255) DEFAULT NULL,"
+ "startDate date DEFAULT NULL,"
+ "stage varchar(100) DEFAULT NULL,"
+ "status varchar(100) DEFAULT NULL,"
+ "foTime date DEFAULT NULL,"
+ "remLayer varchar(200) DEFAULT NULL,"
+ "holdDate date DEFAULT NULL,"
+ "holdRemark mediumtext,"
+ "location varchar(100) DEFAULT NULL,"
+ "sendDate datetime DEFAULT NULL,"
+ "firm varchar(100) DEFAULT NULL,"
+ "fileName varchar(100) DEFAULT NULL,"
+ "erpDate varchar(50) DEFAULT NULL,"
+ "tpnFlow varchar(100) DEFAULT NULL,"
+ "productNo varchar(100) DEFAULT NULL,"
+ "PRIMARY KEY (Id)"
+ ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;");
fd = pst.executeUpdate();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
ConnUtil.closePst(pst);
}
}
return fd;
}
public static boolean checkTableExist(Connection conn,String tableName){
boolean hasTable = false;
DatabaseMetaData meta;
try {
meta = (DatabaseMetaData) conn.getMetaData();
ResultSet hasRst = meta.getTables (null, null,tableName, null);
while (hasRst.next()) {
hasTable =true;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return hasTable;
}
}
| [
"zdwang@gigadevice.com"
] | zdwang@gigadevice.com |
c7d17652b6a3dd32df02f6f2827b5c0fae2f3f84 | 8d5c6c8242fa60d99abc73b4b90f3d7f61e013a1 | /src/main/java/com/acme/livroservice/LoadDatabase.java | ad033222f6a0e9e1ac3facae51f9da86243d7e5d | [] | no_license | tiagolpadua/msc-livro-microservice | 004f994687fbb3d932a8138d1e8aa34af10f795e | a88b94ef2a07f4a180f5cde10c499ab586a8ae1d | refs/heads/master | 2020-04-17T13:20:39.383754 | 2019-02-08T02:45:10 | 2019-02-08T02:45:10 | 166,611,686 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 942 | java | package com.acme.livroservice;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
class LoadDatabase {
Logger logger = LoggerFactory.getLogger(LoadDatabase.class);
@Bean
public CommandLineRunner initDatabase(LivroRepository repository) {
return args -> {
logger.info("Preloading " + repository.save(new Livro("Miguel de Cervantes", "Don Quixote", 144.0)));
logger.info("Preloading " + repository.save(new Livro("J. R. R. Tolkien", "O Senhor dos Anéis", 123.0)));
logger.info("Preloading "
+ repository.save(new Livro("Antoine de Saint-Exupéry", "O Pequeno Príncipe", 152.0)));
logger.info(
"Preloading " + repository.save(new Livro("Charles Dickens", "Um Conto de Duas Cidades", 35.0)));
};
}
}
| [
"tiagolpadua@gmail.com"
] | tiagolpadua@gmail.com |
72eda4c278a2101fc7895b15e52b3d601cb1d6b8 | e2cd2d66a27dd8661810ef80785e683bdc7817f6 | /nzsproject/src/main/java/com/needmall/common/vo/Category1depVO.java | 6fd8f80c2aee7bd77bd1f2fc4b879cc745b01cdc | [] | no_license | needmall/data | 3d2aed5ea45303bcc824b17c13857198cadb2f39 | f646aec46e927ddbaa666e4f280dbe654f1f2196 | refs/heads/master | 2020-03-26T07:42:40.778859 | 2018-09-17T04:35:11 | 2018-09-17T04:35:11 | 144,667,138 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | package com.needmall.common.vo;
public class Category1depVO {
private int c1_num;
private String c1_name;
public int getC1_num() {
return c1_num;
}
public void setC1_num(int c1_num) {
this.c1_num = c1_num;
}
public String getC1_name() {
return c1_name;
}
public void setC1_name(String c1_name) {
this.c1_name = c1_name;
}
@Override
public String toString() {
return "Category1depVO [c1_num=" + c1_num + ", c1_name=" + c1_name + "]";
}
}
| [
"trustray7@gmail.com"
] | trustray7@gmail.com |
1498c4e8d48fb74b92ffef3a0d58562511956882 | 67c2a85a9225c5f41ca1effaec1caa2abb3f9e32 | /yytj_java/dal/src/main/java/com/hongbao/dal/config/JedisConfig.java | 1c619191bff915a1acfae004a750be2a796e1737 | [] | no_license | qinbo89/yytj_java | 789a31e1f3d17ad16f05b63b70306b171ffd144e | 4de9e02e49dbbb5d58f55fdb37ff6c8e43c313e3 | refs/heads/master | 2021-01-18T22:11:42.721730 | 2016-09-27T02:21:53 | 2016-09-27T02:21:53 | 69,311,520 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,656 | java | package com.hongbao.dal.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import redis.clients.jedis.ShardedJedisPool;
import com.hongbao.dal.redis.JedisUtil;
import com.hongbao.utils.DateUtil;
/**
* 类JedisConfig.java的实现描述:TODO 类实现描述
*
* @author tatos 2014年9月23日 下午3:27:33
*/
@Configuration
@ImportResource("classpath:/META-INF/applicationContext-jedis-dataSource.xml")
public class JedisConfig {
private static Logger LOG = LoggerFactory.getLogger(JedisConfig.class);
@Autowired
private ShardedJedisPool shardedJedisPool;
/**
* 应用的名字作用域
*/
@Value("${appName}")
private String appName;
@Bean
public JedisUtil jedisUtil() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setNameSpace("jedisUtil");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "hongbaoCache")
public JedisUtil hongbaoCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("hongbaoCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "userByLoginNameCache")
public JedisUtil userByLoginNameCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("userByLoginNameCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "userByIdCache")
public JedisUtil userByIdCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("userByIdCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "userScoreTopTenCache")
public JedisUtil userScoreTopTenCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("userScoreTopTenCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "accessTokenCacheShike")
public JedisUtil accessTokenCacheShike() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("accessTokenCacheShike");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "userHeadImgCache")
public JedisUtil userHeadImgCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("userHeadImgCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "qrCodeTicketCache")
public JedisUtil qrCodeTicketCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("qrCodeTicketCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "qrTicketUserIdCache")
public JedisUtil qrTicketUserIdCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("qrTicketUserIdCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "loginSiginCache")
public JedisUtil loginSiginCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("loginSiginCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "ticketCache")
public JedisUtil ticketCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("ticketCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
@Bean(name = "countAddCache")
public JedisUtil countAddCache() {
JedisUtil jedisUtil = new JedisUtil();
jedisUtil.setAppName(appName);
jedisUtil.setPeriod(DateUtil.HOUR_SECONDS);
jedisUtil.setNameSpace("countAddCache");
jedisUtil.setShardedJedisPool(shardedJedisPool);
return jedisUtil;
}
}
| [
"qinbo89@163.com"
] | qinbo89@163.com |
afeb5573b7b46bbf2a0b79ebdf7711f70026150d | 33f0b85ce1aac9fa7148bc22c2fa6012e1eee7c3 | /ezwel_project/ezwel_if/src/main/java/com/ezwel/htl/interfaces/service/data/cancelFeeAmt/CancelFeeAmtOutSDO.java | 87332c69ec02458252bb8c111c74162f6a74ac2a | [
"Apache-2.0"
] | permissive | ezwelapi/ezwel-api | d3a8faf7fa8c3ecc6b6cc7e9f1c79d1e9e8c82a3 | edffc2473326f11df145a1eb0457120b4ae5ba6a | refs/heads/master | 2020-04-06T08:28:06.500385 | 2019-02-19T12:02:43 | 2019-02-19T12:02:43 | 157,305,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,391 | java | package com.ezwel.htl.interfaces.service.data.cancelFeeAmt;
import com.ezwel.htl.interfaces.commons.abstracts.AbstractSDO;
import com.ezwel.htl.interfaces.commons.annotation.APIModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.ezwel.htl.interfaces.commons.annotation.APIFields;
/**
* <pre>
*
* </pre>
*
* @author swkim@ebsolution.co.kr
* @date 2018. 11. 13.
*/
@APIModel
@Data
@EqualsAndHashCode(callSuper=true)
public class CancelFeeAmtOutSDO extends AbstractSDO {
@APIFields(description = "취소수수료계산 output code", required=true, maxLength=4)
private String code;
@APIFields(description = "취소수수료계산 output message", maxLength=100)
private String message;
@APIFields(description = "RestAPI URI")
private String restURI;
public String getRestURI() {
return restURI;
}
public void setRestURI(String restURI) {
this.restURI = restURI;
}
@APIFields(description = "취소수수료계산 output data")
private CancelFeeAmtDataOutSDO data;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public CancelFeeAmtDataOutSDO getData() {
return data;
}
public void setData(CancelFeeAmtDataOutSDO data) {
this.data = data;
}
}
| [
"ezwelapiksw@gmail.com"
] | ezwelapiksw@gmail.com |
b33d7603457f9357d2c4ca5c8adf41679e0ba461 | d1ef93899f5a5264e26000043c8388b200b9a19f | /src/test/java/de/detecmedia/checkaccountnumber/Method61Test.java | 03ee56f11197f740ebeef65ed4d9ab1b8ba4483e | [] | no_license | detecmedia/check-account-number | 7ebc298a9ce6f7cec8c55a152c10cebfe091bc77 | d9c463217fc073ade33bac1b326f854c5e73e2dd | refs/heads/develop | 2021-06-25T14:00:20.253824 | 2017-09-12T18:39:19 | 2017-09-12T18:39:19 | 90,244,415 | 0 | 0 | null | 2017-09-12T18:39:20 | 2017-05-04T09:16:43 | Java | UTF-8 | Java | false | false | 1,725 | 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 de.detecmedia.checkaccountnumber;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* @author Markus Potthast <mpt@detecmedia.de>
*/
public class Method61Test {
public Method61Test() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of check method, of class Method61.
*/
@Test
public void testTest() {
System.out.println("check");
Method61 instance = new Method61();
instance.setAccountNumber("2063099200");
boolean expResult = true;
boolean result = instance.test();
assertEquals(expResult, result);
}
@Test
public void testCheck1() {
System.out.println("check");
Method61 instance = new Method61();
instance.setAccountNumber("0260760481");
boolean expResult = true;
boolean result = instance.test();
assertEquals(expResult, result);
}
/**
* Test of getFlag method, of class Method61.
*/
@Test
public void testGetFlag() {
System.out.println("getFlag");
Method61 instance = new Method61();
char[] expResult = "61".toCharArray();
char[] result = instance.getFlag();
assertArrayEquals(expResult, result);
}
}
| [
"potthast@bestit-online.de"
] | potthast@bestit-online.de |
88168c6c9a8de271062940ffa2143d163d0d1e69 | 6c4135cc07753b8348a07e17dba571c32990ff73 | /flowable/src/main/java/com/example/flowable/demo/Demo.java | 7a8345aaf4fc8c4d2c03bf088a3099a9c3d6f455 | [] | no_license | 17671367716/demo | 07b89c083a09febc9d096ca2489becabbccbbeb6 | d8dd60127ddfc56ed60c01533b82e36f629c5cc2 | refs/heads/master | 2023-06-26T07:57:33.467379 | 2021-08-02T06:22:34 | 2021-08-02T06:22:34 | 387,984,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 82 | java | package com.example.flowable.demo;
public class Demo {
private String Id;
}
| [
"1328235636@qq.com"
] | 1328235636@qq.com |
33dca71ddf5c70345f354e7716741d5018c7eebb | 658669457cabfdfc1c7259144d82e40450d6bf93 | /model/DTO/ci/validator/UploadInDTOValidator.java | 5cfda66e0d873fe3c06fd63fa002f2acd4085e5b | [] | no_license | urexmails/android | 0de5132be55e5c5d7eda9db878ae4d59e336979a | 4cedcdc658a8861ec4388f81b82ff084d7fc734e | refs/heads/master | 2020-03-21T08:44:05.773405 | 2018-06-23T01:21:22 | 2018-06-23T01:21:22 | 138,361,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,810 | java | package com.contactpoint.model.DTO.ci.validator;
import java.util.HashMap;
import com.contactpoint.model.DTO.ci.UploadInDTO;
public class UploadInDTOValidator extends Validator {
//public final static int DEFAULT_SIG_LENGTH = 1136;
public static boolean validateServiceDetail(HashMap<String, String> param) {
if (param.get(UploadInDTO.P_Q1_TIME_ATTENDING) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q1_SERVICE_ORDERED) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q2_PROVIDER_CONFIRM) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q2_PROVIDER_CONFIRM).compareTo(UploadInDTO.YES) == 0 &&
param.get(UploadInDTO.P_Q2C_TIME_MET) == null) {
return false;
}
return true;
}
public static boolean validateProviderService1(HashMap<String, String> param) {
if (param.get(UploadInDTO.P_Q3C_NO_OF_CREW) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_PROVIDER_LOGO_DISPLAYED) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_1_PRESENTATION_CREW) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_2_CUST_SERVICE_SKILL) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_3_COND_OF_VEHICLE) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_4_COND_OF_PACKAGING) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_5_STANDING_CONTAINER) == null) {
return false;
}
/*
if (param.get(UploadInDTO.P_Q3C_6_REMLST_ON_TIME) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_7_REMLST_PROFESSIONAL) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_8_REM_CONDUCTED_TIMELY) == null) {
return false;
}*/
return true;
}
public static boolean validateProviderService2(HashMap<String, String> param) {
/*
if (param.get(UploadInDTO.P_Q3C_9_SPEC_PACKAGING) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_9_SPEC_PACKAGING).compareTo(UploadInDTO.YES) == 0 &&
param.get(UploadInDTO.P_Q3C_9A_SPEC_MATLS_PROVIDED)== null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_9_SPEC_PACKAGING).compareTo(UploadInDTO.YES) == 0 &&
param.get(UploadInDTO.P_Q3C_9B_PLASMA_REAR_PROJ) == null &&
param.get(UploadInDTO.P_Q3C_9B_BIKE) == null &&
param.get(UploadInDTO.P_Q3C_9B_PAINTING) == null &&
param.get(UploadInDTO.P_Q3C_9B_OTHER) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_10_REMOVAL_AS_REQD) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_11_ICR) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_11_ICR).compareTo(UploadInDTO.YES) == 0 &&
param.get(UploadInDTO.P_Q3C_11A_ICR_CORRECT) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_12_REMLST_VEH_POS) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_12_REMLST_VEH_POS).compareTo(UploadInDTO.NO) == 0 &&
param.get(UploadInDTO.P_Q3C_12A_TRUCK_IN_DRIVEWAY) == null &&
param.get(UploadInDTO.P_Q3C_12A_TRUCK_DBL_PARKED) == null &&
param.get(UploadInDTO.P_Q3C_12A_TRUCK_ON_VERGE) == null) {
return false;
}*/
return true;
}
public static boolean validateProviderService3(HashMap<String, String> param) {
/*
if (param.get(UploadInDTO.P_Q3C_13_REMLST_FE_RESP) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_14_REMLST_TREATING_RESID) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_15_PROVIDER_OHS_COMP) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q3C_15_PROVIDER_OHS_COMP).compareTo(UploadInDTO.NO) == 0 &&
param.get(UploadInDTO.P_Q3C_15A_NO_SAFETY_GEAR) == null &&
param.get(UploadInDTO.P_Q3C_15A_TRUCK_LOAD) == null &&
param.get(UploadInDTO.P_Q3C_15A_UNSAFE_LIFT_CARRY) == null &&
param.get(UploadInDTO.P_Q3C_15A_PACKING) == null &&
param.get(UploadInDTO.P_Q3C_15A_TRUCK_LOCATION) == null) {
return false;
}*/
return true;
}
public static boolean validateMemberRating(HashMap<String, String> param) {
if (param.get(UploadInDTO.P_Q4U_8_RATING) == null &&
param.get(UploadInDTO.P_Q6D_4_RATING) == null) {
return false;
}
/*
if (param.get(UploadInDTO.P_Q4U_7_REMLST_COMMS) == null &&
param.get(UploadInDTO.P_Q4U_7_OVERALL_IMPRESSION) == null &&
param.get(UploadInDTO.P_Q4U_7_NO_OF_CREW_INSUFF) == null &&
param.get(UploadInDTO.P_Q4U_7_TREAT_SPEC_ITEMS) == null &&
param.get(UploadInDTO.P_Q4U_7_ICR_COMPLETED) == null) {
return false;
}*/
return true;
}
public static boolean validateTollRating(HashMap<String, String> param) {
if (param.get(UploadInDTO.P_Q8_1_RATING) == null) {
return false;
}
if (!isNotEmpty(param.get(UploadInDTO.P_Q8_2_TIME_ON_SITE))) {
return false;
}
return true;
}
public static boolean validateVolume(HashMap<String, String> param) {
if (!isNotEmpty(param.get(UploadInDTO.P_Q5U_VOLUME)) &&
!isNotEmpty(param.get(UploadInDTO.P_Q7D_VOLUME))) {
return false;
}
return true;
}
public static boolean validateDelivery(HashMap<String, String> param) {
if (param.get(UploadInDTO.P_Q6D_1_MEM_ADVISED_PAID) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q6D_2_MEM_TOLL_WARR) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q6D_3_DELIVERY_COMPLETED) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q6D_4_MEM_REM_DEBRIS) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q7D_1_REM_UNPACK) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q7D_2_PACK_MATL) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q7D_3_ANYTHING_OFF_LOAD) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q7D_3_ANYTHING_OFF_LOAD)
.compareTo(UploadInDTO.YES) == 0) {
if (!isNotEmpty(param.get(UploadInDTO.P_Q7D_3A_VOLUME))) {
return false;
}
if (param.get(UploadInDTO.P_Q7D_3A_VOLUME) == null) {
return false;
}
}
return true;
}
public static boolean validateUplift(HashMap<String, String> param) {
if (param.get(UploadInDTO.P_Q4U_1_CARTON_KIT_REQD) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4U_1_CARTON_KIT_REQD).compareTo(UploadInDTO.YES) == 0 &&
param.get(UploadInDTO.P_Q4U_1A_REVD_IN_TIMELY_MANNER) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4U_2_MEM_REVD_GUIDE) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4U_3_MEM_AWARE_OF_ITEMS) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4U_4_MEM_AWARE_ICR) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4U_5_MEM_AWARE_OF_WARR) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4U_6_MEM_AWARE_OF_CHANGES) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4U_6_MEM_AWARE_OF_CHANGES)
.compareTo(UploadInDTO.YES) == 0) {
if (param.get(UploadInDTO.P_Q4_7_CASE_MAN_AWARE_OF_CHANG) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4_8_CASE_MANAGER_APPROVAL) == null) {
return false;
}
if (param.get(UploadInDTO.P_Q4U_7_PROV_CHANGES_MEM_INV) == null) {
return false;
}
}
return true;
}
public static boolean validateSignature(HashMap<String, String> param) {
if (param.get(UploadInDTO.TT) == null ||
/*param.get(UploadInDTO.TT).length() == DEFAULT_SIG_LENGTH*/
(param.get(UploadInDTO.Member) == null &&
param.get(UploadInDTO.Agent) == null)) {
return false;
}
return true;
}
}
| [
"rexu@tollgroup.com"
] | rexu@tollgroup.com |
9647eb752f12577e12b2b7a773e34b52dff24f99 | 65a09e9f4450c6133e6de337dbba373a5510160f | /leanCrm/src/main/java/co/simasoft/view/ActivitiesTypesBean.java | d2d34413499c5c9c478b09e864b5c25bdb521406 | [] | no_license | nelsonjava/simasoft | c0136cdf0c208a5e8d01ab72080330e4a15b1261 | be83eb8ef67758be82bbd811b672572eff1910ee | refs/heads/master | 2021-01-23T15:21:01.981277 | 2017-04-27T12:46:16 | 2017-04-27T12:46:16 | 27,980,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,876 | java | package co.simasoft.view;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import javax.ejb.SessionContext;
import javax.ejb.Stateful;
import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import co.simasoft.models.ActivitiesTypes;
import co.simasoft.models.Activities;
import java.util.Iterator;
/**
* Backing bean for ActivitiesTypes entities.
* <p/>
* This class provides CRUD functionality for all ActivitiesTypes entities. It
* focuses purely on Java EE 6 standards (e.g. <tt>@ConversationScoped</tt>
* for state management, <tt>PersistenceContext</tt> for persistence,
* <tt>CriteriaBuilder</tt> for searches) rather than introducing a CRUD
* framework or custom base class.
*/
@Named
@Stateful
@ConversationScoped
public class ActivitiesTypesBean implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Support creating and retrieving ActivitiesTypes entities
*/
private Long id;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
private ActivitiesTypes activitiesTypes;
public ActivitiesTypes getActivitiesTypes() {
return this.activitiesTypes;
}
public void setActivitiesTypes(ActivitiesTypes activitiesTypes) {
this.activitiesTypes = activitiesTypes;
}
@Inject
private Conversation conversation;
@PersistenceContext(unitName = "leanCrmPU-JTA", type = PersistenceContextType.EXTENDED)
private EntityManager entityManager;
public String create() {
this.conversation.begin();
this.conversation.setTimeout(1800000L);
return "create?faces-redirect=true";
}
public void retrieve() {
if (FacesContext.getCurrentInstance().isPostback()) {
return;
}
if (this.conversation.isTransient()) {
this.conversation.begin();
this.conversation.setTimeout(1800000L);
}
if (this.id == null) {
this.activitiesTypes = this.example;
} else {
this.activitiesTypes = findById(getId());
}
}
public ActivitiesTypes findById(Long id) {
return this.entityManager.find(ActivitiesTypes.class, id);
}
/*
* Support updating and deleting ActivitiesTypes entities
*/
public String update() {
this.conversation.end();
try {
if (this.id == null) {
this.entityManager.persist(this.activitiesTypes);
return "search?faces-redirect=true";
} else {
this.entityManager.merge(this.activitiesTypes);
return "view?faces-redirect=true&id="
+ this.activitiesTypes.getId();
}
} catch (Exception e) {
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(e.getMessage()));
return null;
}
}
public String delete() {
this.conversation.end();
try {
ActivitiesTypes deletableEntity = findById(getId());
Iterator<Activities> iterActivities = deletableEntity
.getActivities().iterator();
for (; iterActivities.hasNext();) {
Activities nextInActivities = iterActivities.next();
nextInActivities.setActivitiesTypes(null);
iterActivities.remove();
this.entityManager.merge(nextInActivities);
}
this.entityManager.remove(deletableEntity);
this.entityManager.flush();
return "search?faces-redirect=true";
} catch (Exception e) {
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(e.getMessage()));
return null;
}
}
/*
* Support searching ActivitiesTypes entities with pagination
*/
private int page;
private long count;
private List<ActivitiesTypes> pageItems;
private ActivitiesTypes example = new ActivitiesTypes();
public int getPage() {
return this.page;
}
public void setPage(int page) {
this.page = page;
}
public int getPageSize() {
return 10;
}
public ActivitiesTypes getExample() {
return this.example;
}
public void setExample(ActivitiesTypes example) {
this.example = example;
}
public String search() {
this.page = 0;
return null;
}
public void paginate() {
CriteriaBuilder builder = this.entityManager.getCriteriaBuilder();
// Populate this.count
CriteriaQuery<Long> countCriteria = builder.createQuery(Long.class);
Root<ActivitiesTypes> root = countCriteria.from(ActivitiesTypes.class);
countCriteria = countCriteria.select(builder.count(root)).where(
getSearchPredicates(root));
this.count = this.entityManager.createQuery(countCriteria)
.getSingleResult();
// Populate this.pageItems
CriteriaQuery<ActivitiesTypes> criteria = builder
.createQuery(ActivitiesTypes.class);
root = criteria.from(ActivitiesTypes.class);
TypedQuery<ActivitiesTypes> query = this.entityManager
.createQuery(criteria.select(root).where(
getSearchPredicates(root)));
query.setFirstResult(this.page * getPageSize()).setMaxResults(
getPageSize());
this.pageItems = query.getResultList();
}
private Predicate[] getSearchPredicates(Root<ActivitiesTypes> root) {
CriteriaBuilder builder = this.entityManager.getCriteriaBuilder();
List<Predicate> predicatesList = new ArrayList<Predicate>();
String alias = this.example.getAlias();
if (alias != null && !"".equals(alias)) {
predicatesList.add(builder.like(
builder.lower(root.<String> get("alias")),
'%' + alias.toLowerCase() + '%'));
}
String observations = this.example.getObservations();
if (observations != null && !"".equals(observations)) {
predicatesList.add(builder.like(
builder.lower(root.<String> get("observations")),
'%' + observations.toLowerCase() + '%'));
}
String name = this.example.getName();
if (name != null && !"".equals(name)) {
predicatesList.add(builder.like(
builder.lower(root.<String> get("name")),
'%' + name.toLowerCase() + '%'));
}
return predicatesList.toArray(new Predicate[predicatesList.size()]);
}
public List<ActivitiesTypes> getPageItems() {
return this.pageItems;
}
public long getCount() {
return this.count;
}
/*
* Support listing and POSTing back ActivitiesTypes entities (e.g. from
* inside an HtmlSelectOneMenu)
*/
public List<ActivitiesTypes> getAll() {
CriteriaQuery<ActivitiesTypes> criteria = this.entityManager
.getCriteriaBuilder().createQuery(ActivitiesTypes.class);
return this.entityManager.createQuery(
criteria.select(criteria.from(ActivitiesTypes.class)))
.getResultList();
}
@Resource
private SessionContext sessionContext;
public Converter getConverter() {
final ActivitiesTypesBean ejbProxy = this.sessionContext
.getBusinessObject(ActivitiesTypesBean.class);
return new Converter() {
@Override
public Object getAsObject(FacesContext context,
UIComponent component, String value) {
return ejbProxy.findById(Long.valueOf(value));
}
@Override
public String getAsString(FacesContext context,
UIComponent component, Object value) {
if (value == null) {
return "";
}
return String.valueOf(((ActivitiesTypes) value).getId());
}
};
}
/*
* Support adding children to bidirectional, one-to-many tables
*/
private ActivitiesTypes add = new ActivitiesTypes();
public ActivitiesTypes getAdd() {
return this.add;
}
public ActivitiesTypes getAdded() {
ActivitiesTypes added = this.add;
this.add = new ActivitiesTypes();
return added;
}
}
| [
"nelsonjava@gmail.com"
] | nelsonjava@gmail.com |
2f4fffde0515134c235df0382347c912026c21de | f1ed4776e7e2f6fc3dfe4355b86e1ffb7a5daf3d | /C9Alarm/src/com/tavx/C9Alarm/bean/PointCountBean.java | 04a0b76b6f6b2205b9cf2ad102fb5d6924c83d80 | [] | no_license | laoda512/dhie | 05cc3e4ee674c58af99d12d5b63bd9ef520edd27 | ef7b1fb5d81c85058b2aa8d5c1561d1d4fedca3b | refs/heads/master | 2021-01-10T18:30:20.610318 | 2015-02-13T02:03:33 | 2015-02-13T02:03:33 | 30,735,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,055 | java | /**
*
*/
package com.tavx.C9Alarm.bean;
import com.tavx.C9Alam.connector.MyLogger;
import com.tavx.C9Alarm.AlarmApplication;
import com.tavx.C9Alarm.Symbol;
import com.tavx.C9Alarm.Manager.NumberManager;
import android.content.Context;
import util.readWriteAbleBean;
/**
* @author Administrator
*
*/
public class PointCountBean extends readWriteAbleBean{
private String count;
private Long date;
private String MAX_COUNT ;
/**
* @param c
* @param _tag
*/
public PointCountBean(Context c, String _tag) {
super(c, _tag);
MyLogger.e("aaa", _tag+" "+toString());
}
@Override
public String toString() {
return "ClickBean [count=" + count + ", date=" + date + ", MAX_COUNT="
+ MAX_COUNT + "]";
}
/* (non-Javadoc)
* @see util.readWriteAbleBean#iniParam()
*/
@Override
public void iniParam() {
count = "0";
date =0l;
MAX_COUNT = "200";
}
public boolean hasOverMax(){
NumberManager nm = NumberManager.getInstance();
refixTime(nm);
if(nm.isLargerEqual(getCount(), MAX_COUNT)) return true;
return false;
}
public String getCount() {
return count;
}
public Long getDate() {
return date;
}
public void setCount(String count) {
this.count = count;
writeData(AlarmApplication.getApp(), "count");
}
public void setDate(Long date) {
this.date = date;
writeData(AlarmApplication.getApp(), "date");
}
public boolean addCount(String howMuch){
NumberManager nm = NumberManager.getInstance();
refixTime(nm);
if(nm.isLargerEqual(getCount(), MAX_COUNT)) return false;
setCount(nm.add(getCount(), howMuch));
return true;
//setCount(getCount()+1);
}
private void refixTime(NumberManager nm ){
Long time = System.currentTimeMillis();
if(checkIsTimeOverMax()){
setDate(time);
setCount(nm.getMixedString(0));
};
}
private boolean checkIsTimeOverMax(){
Long time = System.currentTimeMillis();
if(time>getDate()+getTimeInterval()){
return true;
};
return false;
}
private long getTimeInterval(){
return Symbol.INTERVAL_DAY/24*20;
}
}
| [
"cwang@splunk.com"
] | cwang@splunk.com |
5ea5e07c2358a84584132acd88b2454b910a4d5f | f4f6f68f956b9f0107877397a6cecbf1177e45ca | /AttDEMO/app/src/main/java/com/aiwinn/faceattendance/ui/m/MainActivity.java | 97d0a1ded8a10915ab2d422a5ab8776276437859 | [] | no_license | P79N6A/RecognitionDemo | a07183e0b8d20d74fb8e20d93ae670ab833b3025 | c91f988a5aad3daee33f338cc0403b67deab9e0c | refs/heads/master | 2020-04-08T00:32:56.743535 | 2018-11-23T16:28:21 | 2018-11-23T16:28:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,636 | java | package com.aiwinn.faceattendance.ui.m;
import android.Manifest;
import android.annotation.SuppressLint;
import android.hardware.Camera;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.aiwinn.base.activity.BaseActivity;
import com.aiwinn.base.util.AppUtils;
import com.aiwinn.base.util.FileUtils;
import com.aiwinn.base.util.PermissionUtils;
import com.aiwinn.base.util.ToastUtils;
import com.aiwinn.faceattendance.AttApp;
import com.aiwinn.faceattendance.R;
import com.aiwinn.faceattendance.adapter.ActivityAdapter;
import com.aiwinn.faceattendance.common.AttConstants;
import com.aiwinn.facedetectsdk.FaceDetectManager;
import com.aiwinn.facedetectsdk.common.ConfigLib;
import com.aiwinn.facedetectsdk.common.Constants;
import com.chad.library.adapter.base.BaseQuickAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* com.aiwinn.faceattendance.ui.m
* SDK_ATT
* 2018/08/29
* Created by LeoLiu on User
*/
public class MainActivity extends BaseActivity implements View.OnClickListener ,PermissionUtils.FullCallback{
TextView mVersion;
TextView mName;
RecyclerView mRecyclerView;
ArrayList<String> mStringArrayList;
private String[] permissions = new String[]{
Manifest.permission.CAMERA,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE
};
private boolean mIsGranted;
private ActivityAdapter mActivityAdapter;
@Override
public int getLayoutId() {
return R.layout.activity_main;
}
@SuppressLint("WrongViewCast")
@Override
public void initViews() {
mVersion = findViewById(R.id.version);
mName = findViewById(R.id.name);
mRecyclerView = findViewById(R.id.activity);
}
@Override
public void initData() {
mVersion.setText("APP V_"+getVersionName());
mName.setText(getResources().getString(R.string.app_name));
mIsGranted = true;
for (int i = 0; i < permissions.length; i++) {
if (!PermissionUtils.isGranted(permissions[i])) {
mIsGranted = false;
break;
}
}
GridLayoutManager lm = new GridLayoutManager(MainActivity.this, 2);
mRecyclerView.setLayoutManager(lm);
mStringArrayList = new ArrayList<>();
mStringArrayList.clear();
mActivityAdapter = new ActivityAdapter(mStringArrayList);
mRecyclerView.setAdapter(mActivityAdapter);
prepareActivityString();
}
private void prepareActivityString() {
mStringArrayList.add(getResources().getString(R.string.yuvregist));//相机注册
mStringArrayList.add(getResources().getString(R.string.bmpregist));//图片注册
mStringArrayList.add(getResources().getString(R.string.detect));//探测
mStringArrayList.add(getResources().getString(R.string.config));//配置
mStringArrayList.add(getResources().getString(R.string.list));//注册列表
mStringArrayList.add(getResources().getString(R.string.bulkregist));//批量注册
mStringArrayList.add(getResources().getString(R.string.authorization));//授权
mActivityAdapter.replaceData(mStringArrayList);
}
@Override
public void initListeners() {
mActivityAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
switch (position){
case 0:
if (checkInitState()) {
mIntent.setClass(MainActivity.this, YuvRegistActivity.class);
startActivity(mIntent);
}
break;
case 1:
if (checkInitState()) {
mIntent.setClass(MainActivity.this, BmpRegistActvity.class);
startActivity(mIntent);
}
break;
case 2:
if (checkInitState()) {
mIntent.setClass(MainActivity.this, DetectActivity.class);
startActivity(mIntent);
}
break;
case 3:
if (checkInitState()) {
mIntent.setClass(MainActivity.this, ConfigActivity.class);
startActivity(mIntent);
}
break;
case 4:
if (checkInitState()) {
mIntent.setClass(MainActivity.this, RegisterListActivity.class);
startActivity(mIntent);
}
break;
case 5:
if (checkInitState()) {
mIntent.setClass(MainActivity.this, BulkRegistActivity.class);
startActivity(mIntent);
}
break;
case 6:
if (Constants.SDK_AUTHORIZATION_VERSION) {
mIntent.setClass(MainActivity.this, AuthorizationActivity.class);
startActivity(mIntent);
}else {
ToastUtils.showLong(getResources().getString(R.string.authorization_not));
}
break;
}
}
});
}
private long mExitTime;
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if ((System.currentTimeMillis() - mExitTime) > 3000) {
Toast.makeText(this, getResources().getString(R.string.press_exit), Toast.LENGTH_SHORT).show();
mExitTime = System.currentTimeMillis();
} else {
FaceDetectManager.release();
AppUtils.exitApp();
}
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onResume() {
super.onResume();
if (mIsGranted) {
if (!AttConstants.INIT_STATE) {
FileUtils.createOrExistsDir(AttConstants.PATH_AIWINN);
FileUtils.createOrExistsDir(AttConstants.PATH_ATTENDANCE);
FileUtils.createOrExistsDir(AttConstants.PATH_BULK_REGISTRATION);
FileUtils.createOrExistsDir(AttConstants.PATH_CARD);
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
int cameraCount = Camera.getNumberOfCameras();
for (int i = 0; i < cameraCount; i++) {
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
AttConstants.hasBackCamera = true;
}else if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT){
AttConstants.hasFrontCamera = true;
}
}
AttConstants.cameraCount = cameraCount;
if (AttConstants.hasBackCamera) {
AttConstants.CAMERA_ID = AttConstants.CAMERA_BACK_ID;
AttConstants.CAMERA_DEGREE = AttConstants.CAMERA_BACK_DEGREE;
}
if (!AttConstants.hasBackCamera && AttConstants.hasFrontCamera) {
AttConstants.CAMERA_ID = AttConstants.CAMERA_FRONT_ID;
AttConstants.CAMERA_DEGREE = AttConstants.CAMERA_FRONT_DEGREE;
}
AttConstants.CAMERA_PREVIEW_HEIGHT = AttApp.sp.getInt(AttConstants.PREFS_CAMERA_PREVIEW_SIZE,AttConstants.CAMERA_PREVIEW_HEIGHT);
ConfigLib.picScaleSize = AttApp.sp.getFloat(AttConstants.PREFS_TRACKER_SIZE,ConfigLib.picScaleSize);
ConfigLib.picScaleRate = AttApp.sp.getFloat(AttConstants.PREFS_DETECT_RATE,ConfigLib.picScaleRate);
ConfigLib.Nv21ToBitmapScale = AttApp.sp.getInt(AttConstants.PREFS_FEATURE_SIZE,ConfigLib.Nv21ToBitmapScale);
FaceDetectManager.setFaceMinRect(AttApp.sp.getInt(AttConstants.PREFS_DETECT_SIZE,FaceDetectManager.getFaceMinRect()));
AttConstants.CAMERA_ID = AttApp.sp.getInt(AttConstants.PREFS_CAMERA_ID,AttConstants.CAMERA_ID);
AttConstants.CAMERA_DEGREE = AttApp.sp.getInt(AttConstants.PREFS_CAMERA_DEGREE,AttConstants.CAMERA_DEGREE);
AttConstants.PREVIEW_DEGREE = AttApp.sp.getInt(AttConstants.PREFS_PREVIEW_DEGREE,AttConstants.PREVIEW_DEGREE);
AttConstants.LEFT_RIGHT = AttApp.sp.getBoolean(AttConstants.PREFS_LR,AttConstants.LEFT_RIGHT);
AttConstants.TOP_BOTTOM = AttApp.sp.getBoolean(AttConstants.PREFS_TB,AttConstants.TOP_BOTTOM);
ConfigLib.detectWithRecognition = AttApp.sp.getBoolean(AttConstants.PREFS_RECOGNITION,ConfigLib.detectWithRecognition);
ConfigLib.detectWithLiveness = AttApp.sp.getBoolean(AttConstants.PREFS_LIVENESS,ConfigLib.detectWithLiveness);
ConfigLib.featureThreshold = AttApp.sp.getFloat(AttConstants.PREFS_UNLOCK,ConfigLib.featureThreshold);
ConfigLib.livenessThreshold = AttApp.sp.getFloat(AttConstants.PREFS_LIVENESST,ConfigLib.livenessThreshold);
ConfigLib.registerPicRect = AttApp.sp.getInt(AttConstants.PREFS_FACEMINIMA,ConfigLib.registerPicRect);
ConfigLib.maxRegisterBrightness = AttApp.sp.getFloat(AttConstants.PREFS_MAXREGISTERBRIGHTNESS,ConfigLib.maxRegisterBrightness);
ConfigLib.minRegisterBrightness = AttApp.sp.getFloat(AttConstants.PREFS_MINREGISTERBRIGHTNESS,ConfigLib.minRegisterBrightness);
ConfigLib.blurRegisterThreshold = AttApp.sp.getFloat(AttConstants.PREFS_BLURREGISTERTHRESHOLD,ConfigLib.blurRegisterThreshold);
ConfigLib.maxRecognizeBrightness = AttApp.sp.getFloat(AttConstants.PREFS_MAXRECOGNIZEBRIGHTNESS,ConfigLib.maxRecognizeBrightness);
ConfigLib.minRecognizeBrightness = AttApp.sp.getFloat(AttConstants.PREFS_MINRECOGNIZEBRIGHTNESS,ConfigLib.minRecognizeBrightness);
ConfigLib.blurRecognizeThreshold = AttApp.sp.getFloat(AttConstants.PREFS_BLURECOGNIZETHRESHOLD,ConfigLib.blurRecognizeThreshold);
ConfigLib.blurRecognizeNewThreshold = AttApp.sp.getFloat(AttConstants.PREFS_BLURECOGNIZENEWTHRESHOLD,ConfigLib.blurRecognizeNewThreshold);
Constants.DEBUG_SAVE_BLUR = AttApp.sp.getBoolean(AttConstants.PREFS_SAVEBLURDATA,Constants.DEBUG_SAVE_BLUR);
Constants.DEBUG_SAVE_NOFACE = AttApp.sp.getBoolean(AttConstants.PREFS_SAVENOFACEDATA,Constants.DEBUG_SAVE_NOFACE);
Constants.DEBUG_SAVE_SIMILARITY_SMALL = AttApp.sp.getBoolean(AttConstants.PREFS_SAVESSDATA,Constants.DEBUG_SAVE_SIMILARITY_SMALL);
AttConstants.DEBUG = AttApp.sp.getBoolean(AttConstants.PREFS_DEBUG,AttConstants.DEBUG);
Constants.TRACKER_MODE = AttApp.sp.getInt(AttConstants.PREFS_TRACKER_MODE,Constants.TRACKER_MODE);
FaceDetectManager.setDetectFaceMode(AttApp.sp.getInt(AttConstants.PREFS_DETECT_MODE,FaceDetectManager.getDetectFaceMode()));
AttApp.initSDK();
}
}else{
PermissionUtils.permission(permissions).callback(this).request();
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
default:break;
}
}
boolean checkInitState(){
if (!AttConstants.INIT_STATE) {
ToastUtils.showLong(getResources().getString(R.string.init_fail)+" : "+ AttConstants.INIT_STATE_ERROR);
return false;
}else {
return true;
}
}
@Override
public void onGranted(List<String> list) {
mIsGranted = true;
}
@Override
public void onDenied(List<String> list, List<String> list1) {
mIsGranted = false;
}
}
| [
"5694209@qq.com"
] | 5694209@qq.com |
122a37be9e5a54e833d712e8b6b899768f246627 | 12b788074006cccc45e9b448a6cf164a24bd7e67 | /app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/drawerlayout/R.java | 0a869596d69cfd6216dc6d966e175781e0e48c06 | [] | no_license | Akabo027/ProductCatalog | d9389d520e15f683b008c642b1c193b94aeb24d2 | 1cdf8143f83a2e5672a0d96bded777430f7a7e63 | refs/heads/master | 2020-04-05T01:58:07.677397 | 2018-11-06T23:41:05 | 2018-11-06T23:41:05 | 156,458,346 | 0 | 0 | null | 2018-11-06T22:43:21 | 2018-11-06T22:43:20 | null | UTF-8 | Java | false | false | 10,459 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.drawerlayout;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f020027;
public static final int font = 0x7f02007a;
public static final int fontProviderAuthority = 0x7f02007c;
public static final int fontProviderCerts = 0x7f02007d;
public static final int fontProviderFetchStrategy = 0x7f02007e;
public static final int fontProviderFetchTimeout = 0x7f02007f;
public static final int fontProviderPackage = 0x7f020080;
public static final int fontProviderQuery = 0x7f020081;
public static final int fontStyle = 0x7f020082;
public static final int fontVariationSettings = 0x7f020083;
public static final int fontWeight = 0x7f020084;
public static final int ttcIndex = 0x7f02013c;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f04003f;
public static final int notification_icon_bg_color = 0x7f040040;
public static final int ripple_material_light = 0x7f04004b;
public static final int secondary_text_default_material_light = 0x7f04004d;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f05004b;
public static final int compat_button_inset_vertical_material = 0x7f05004c;
public static final int compat_button_padding_horizontal_material = 0x7f05004d;
public static final int compat_button_padding_vertical_material = 0x7f05004e;
public static final int compat_control_corner_material = 0x7f05004f;
public static final int compat_notification_large_icon_max_height = 0x7f050050;
public static final int compat_notification_large_icon_max_width = 0x7f050051;
public static final int notification_action_icon_size = 0x7f05005b;
public static final int notification_action_text_size = 0x7f05005c;
public static final int notification_big_circle_margin = 0x7f05005d;
public static final int notification_content_margin_start = 0x7f05005e;
public static final int notification_large_icon_height = 0x7f05005f;
public static final int notification_large_icon_width = 0x7f050060;
public static final int notification_main_column_padding_top = 0x7f050061;
public static final int notification_media_narrow_margin = 0x7f050062;
public static final int notification_right_icon_size = 0x7f050063;
public static final int notification_right_side_padding_top = 0x7f050064;
public static final int notification_small_icon_background_padding = 0x7f050065;
public static final int notification_small_icon_size_as_large = 0x7f050066;
public static final int notification_subtext_size = 0x7f050067;
public static final int notification_top_pad = 0x7f050068;
public static final int notification_top_pad_large_text = 0x7f050069;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f060054;
public static final int notification_bg = 0x7f060055;
public static final int notification_bg_low = 0x7f060056;
public static final int notification_bg_low_normal = 0x7f060057;
public static final int notification_bg_low_pressed = 0x7f060058;
public static final int notification_bg_normal = 0x7f060059;
public static final int notification_bg_normal_pressed = 0x7f06005a;
public static final int notification_icon_background = 0x7f06005b;
public static final int notification_template_icon_bg = 0x7f06005c;
public static final int notification_template_icon_low_bg = 0x7f06005d;
public static final int notification_tile_bg = 0x7f06005e;
public static final int notify_panel_notification_icon_bg = 0x7f06005f;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f07000e;
public static final int action_divider = 0x7f070010;
public static final int action_image = 0x7f070011;
public static final int action_text = 0x7f070017;
public static final int actions = 0x7f070018;
public static final int async = 0x7f070020;
public static final int blocking = 0x7f070023;
public static final int chronometer = 0x7f07002e;
public static final int forever = 0x7f070045;
public static final int icon = 0x7f07004b;
public static final int icon_group = 0x7f07004c;
public static final int info = 0x7f07004f;
public static final int italic = 0x7f070051;
public static final int line1 = 0x7f070053;
public static final int line3 = 0x7f070054;
public static final int normal = 0x7f07005e;
public static final int notification_background = 0x7f07005f;
public static final int notification_main_column = 0x7f070060;
public static final int notification_main_column_container = 0x7f070061;
public static final int right_icon = 0x7f07006a;
public static final int right_side = 0x7f07006b;
public static final int tag_transition_group = 0x7f07008c;
public static final int tag_unhandled_key_event_manager = 0x7f07008d;
public static final int tag_unhandled_key_listeners = 0x7f07008e;
public static final int text = 0x7f07008f;
public static final int text2 = 0x7f070090;
public static final int time = 0x7f070096;
public static final int title = 0x7f070097;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f080005;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f09001e;
public static final int notification_action_tombstone = 0x7f09001f;
public static final int notification_template_custom_big = 0x7f090026;
public static final int notification_template_icon_group = 0x7f090027;
public static final int notification_template_part_chronometer = 0x7f09002b;
public static final int notification_template_part_time = 0x7f09002c;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0b0032;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0c00ec;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00ed;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00ef;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00f2;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00f4;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0c015d;
public static final int Widget_Compat_NotificationActionText = 0x7f0c015e;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f, 0x7f020080, 0x7f020081 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02007a, 0x7f020082, 0x7f020083, 0x7f020084, 0x7f02013c };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"unkabore@gmail.com"
] | unkabore@gmail.com |
3552a1d55931beb5ef4c832619b0eb0907ae89c6 | 51973ce0cb415b94546301936cd99c44ce04c761 | /src/main/java/cn/wsq/util/JsonUtils.java | dcaebeca33e0547ee435c1e82f3f49da431da768 | [] | no_license | qin501/testtest | 4aac60d559167d677ca702221f65387275f6962a | 2311be17134b1e64439133353d545cf52e27645b | refs/heads/master | 2020-04-09T10:53:44.527088 | 2018-12-16T07:38:18 | 2018-12-16T07:38:18 | 160,286,662 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,715 | java | package cn.wsq.util;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.List;
/**
* 自定义响应结构, 转换类
*/
public class JsonUtils {
// 定义jackson对象
private static final ObjectMapper MAPPER = new ObjectMapper();
/**
* 将对象转换成json字符串。
* <p>Title: pojoToJson</p>
* <p>Description: </p>
* @param data
* @return
*/
public static String objectToJson(Object data) {
try {
String string = MAPPER.writeValueAsString(data);
return string;
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return null;
}
/**
* 将json结果集转化为对象
*
* @param jsonData json数据
* @param clazz 对象中的object类型
* @return
*/
public static <T> T jsonToPojo(String jsonData, Class<T> beanType) {
try {
T t = MAPPER.readValue(jsonData, beanType);
return t;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 将json数据转换成pojo对象list
* <p>Title: jsonToList</p>
* <p>Description: </p>
* @param jsonData
* @param beanType
* @return
*/
public static <T>List<T> jsonToList(String jsonData, Class<T> beanType) {
JavaType javaType = MAPPER.getTypeFactory().constructParametricType(List.class, beanType);
try {
List<T> list = MAPPER.readValue(jsonData, javaType);
return list;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
| [
"1732667017@qq.com"
] | 1732667017@qq.com |
f87560a87adc6327bc69f68c8083c6d926129fd4 | 8456a184d4f5964b19d6c1b3a1a1b9f5addc395f | /Software_Development/BattleShip_Game/part2/src/main/java/edu/neu/ccs/cs5004/model/fleet/AbstractFleet.java | 2148bbafb71a12a6365607439dd4e63574f7ca63 | [] | no_license | bohraAnkur/Project_All | f39e1c14736cbb4fbd9b9660559271e40a47547d | f1524c336198c8aab9076e8effd2b08db137dca7 | refs/heads/master | 2021-07-09T12:34:05.122026 | 2020-04-03T21:38:18 | 2020-04-03T21:38:18 | 201,547,699 | 0 | 0 | null | 2020-10-13T20:54:34 | 2019-08-09T22:19:58 | Jupyter Notebook | UTF-8 | Java | false | false | 2,645 | java | package edu.neu.ccs.cs5004.model.fleet;
import edu.neu.ccs.cs5004.model.ships.Ship;
import java.util.ArrayList;
/**
* abstract class for the fleet.
*/
public abstract class AbstractFleet implements FleetInterface {
/**
* the list of ships representing the fleet.
*/
protected ArrayList<Ship> fleet;
/**
* constructor for the abstract fleet.
*/
public AbstractFleet() {
this.fleet = new ArrayList<Ship>();
}
protected abstract void initializeFleet();
/**
* Getter for the fleet of the fleet.
*
* @return the fleet of the map.
*/
public ArrayList<Ship> getFleet() {
return this.fleet;
}
/**
* Getter for the size of the fleet.
*
* @return an Integer representing the number of ships in the fleet
*/
public Integer getListSize() {
return this.fleet.size();
}
/**
* Implementation of the property if the fleet contains this ship.
*
* @param thisShip thisShip represents the InputSHip
* @return a Boolean representing true or false if the ship is there inside the fleet or not
*/
public Boolean containsShip(Ship thisShip) {
return this.fleet.contains(thisShip);
}
/**
* Implementation of the property if the fleet is empty.
*
* @return A boolean if the fleet is empty
*/
public Boolean isEmpty() {
return this.fleet.isEmpty();
}
/**
* Implementation of the property getIndex of, returns the last Index of the occurrence of the.
* ship at which it is.
*
* @param thisShip theShip whom's Index is to be looked upon
* @return An Integer which represents the index of the position of the list
*/
public Integer getIndexOf(Ship thisShip) {
return this.fleet.lastIndexOf(thisShip);
}
/**
* Implementation of the property get ship at a given index from the ship.
*
* @param index represents an Integer
* @return A ship
*/
public Ship getShip(Integer index) {
return this.fleet.get(index);
}
@Override
public Boolean isFleetSunk() {
for (int i = 0; i < this.fleet.size(); i++) {
if (!this.getShip(i).isSunk()) {
return false;
}
}
return true;
}
/**
* checks that two objects are equal.
* @param obj the object to be compared
* @return true if they are equal, false otherwise
*/
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
AbstractFleet other = (AbstractFleet) obj;
return other.getFleet().equals(this.getFleet());
}
public int hashCode() {
return fleet.hashCode();
}
}
| [
"ankur.bohra1995@gmail.com"
] | ankur.bohra1995@gmail.com |
b532539b3698567d0351efbb29dbdcc3f244fb34 | a32557b99e4b25900c0abaa94987eea932fe7d04 | /signal-data/src/main/java/com/skr/signal/data/websocket/handler/WebSocketHandler.java | 8748d7aa7389b6cd59b065f3aec773f9cdebfc1c | [] | no_license | EchoFish/netty-stroll | 2c67b13a9914531f32f940e90e4362944176ff42 | 21c41c81683045bceef90195ed1608c051c838be | refs/heads/master | 2022-12-04T12:34:41.021495 | 2020-09-01T05:52:49 | 2020-09-01T05:52:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,441 | java | package com.skr.signal.data.websocket.handler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import java.time.LocalDateTime;
/**
* @author mqw
* @create 2020-06-12-11:28
*/
public class WebSocketHandler extends SimpleChannelInboundHandler<TextWebSocketFrame> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, TextWebSocketFrame msg) {
//回复消息
System.err.println(msg.text());
ctx.channel().writeAndFlush(new TextWebSocketFrame("服务器时间" + LocalDateTime.now() + " "));
}
//当web客户端连接后
@Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
//id 表示唯一的值,LongText 是唯一的 ShortText 不是唯一
System.out.println("handlerAdded 被调用" + ctx.channel().id().asLongText());
System.out.println("handlerAdded 被调用" + ctx.channel().id().asShortText());
}
@Override
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
System.out.println("handlerRemoved 被调用" + ctx.channel().id().asLongText());
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
System.out.println("异常发生 " + cause.getMessage());
ctx.close();
}
}
| [
"mengqingwen@hetao101.com"
] | mengqingwen@hetao101.com |
29463bc249042abea43959bf2751238070330b6c | 62517f9cc72c594784c583b21ab93e060eed4e60 | /app/src/main/java/cn/com/tcsl/mvptest/ui/down/DownPresenter.java | 594da623cd989a7bac7565f727535d8839d82c89 | [] | no_license | kailaisi/MVPTest | 5833f050582d34c0a783c1880965bc5ef52e929f | 995653da87deb7bc5c9ab2a9860950f473531054 | refs/heads/master | 2023-05-02T17:48:55.824146 | 2016-08-01T10:47:40 | 2016-08-01T10:47:40 | 63,403,411 | 0 | 0 | null | 2023-04-15T12:35:09 | 2016-07-15T08:02:19 | Java | UTF-8 | Java | false | false | 1,591 | java | package cn.com.tcsl.mvptest.ui.down;
import java.io.File;
import cn.com.tcsl.mvptest.http.RetrofitHttpUtils;
import cn.com.tcsl.mvptest.http.interfaces.DownProgressListener;
import okhttp3.ResponseBody;
import rx.Subscriber;
/**
* Created by wjx on 2016/7/23.
*/
public class DownPresenter implements DownContract.Presenter {
DownContract.View view;
DownContract.Model model;
public DownPresenter(DownContract.View view) {
this.view = view;
model=new DownModel();
}
@Override
public void downLoad(String url) {
view.showProgress();
DownProgressListener mListeren=new DownProgressListener() {
@Override
public void update(long current, long total, boolean isCompleted) {
view.updateProgress((int)(100l*current/total));
}
};
Subscriber<ResponseBody> subscriber=new Subscriber<ResponseBody>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(ResponseBody responseBody) {
view.dismisProgress();
File file=model.writeToSD(responseBody.byteStream());
view.intallAPK(file);
}
};
RetrofitHttpUtils.getDownInstance(mListeren).downLoad(subscriber,"http://hengdawb-app.oss-cn-hangzhou.aliyuncs.com/app-debug.apk");
}
@Override
public void start() {
}
@Override
public void onDestroy() {
}
}
| [
"541018378@qq.com"
] | 541018378@qq.com |
b1f8c5b161a228e3197b9e67f596cad1dcae03d3 | f38d8e69234d6004086c832f7b2265fabed8fba4 | /src/main/java/com/jeecg/z_entry/controller/ZEntryController.java | 06cea5c1674525d941fc0fb7d4088670a8819cc5 | [] | no_license | qpy1992/20180626 | befd1eae204b741b7e5dbc46027163efe301a49c | ebf8dfefc4676ddd2f58b964c74eaff6f51f38af | refs/heads/master | 2020-04-04T08:46:11.980490 | 2018-11-02T09:02:42 | 2018-11-02T09:02:42 | 155,793,891 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,360 | java | package com.jeecg.z_entry.controller;
import com.jeecg.z_entry.entity.ZEntryEntity;
import com.jeecg.z_entry.service.ZEntryServiceI;
import com.jeecg.z_entry.page.ZEntryPage;
import com.jeecg.z_entrydetail.entity.ZEntrydetailEntity;
import java.util.ArrayList;
import java.util.List;
import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.ExceptionUtil;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.pojo.base.TSDepart;
import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.core.util.MyBeanUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants;
import org.springframework.ui.ModelMap;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import java.io.IOException;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.jwt.util.GsonUtil;
import org.jeecgframework.jwt.util.ResponseMessage;
import org.jeecgframework.jwt.util.Result;
import com.alibaba.fastjson.JSONArray;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.jeecgframework.core.beanvalidator.BeanValidators;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import java.net.URI;
import org.springframework.http.MediaType;
import org.springframework.web.util.UriComponentsBuilder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* @Title: Controller
* @Description: 入库
* @author onlineGenerator
* @date 2018-08-08 13:44:54
* @version V1.0
*
*/
@Api(value="ZEntry",description="入库",tags="zEntryController")
@Controller
@RequestMapping("/zEntryController")
public class ZEntryController extends BaseController {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(ZEntryController.class);
@Autowired
private ZEntryServiceI zEntryService;
@Autowired
private SystemService systemService;
@Autowired
private Validator validator;
/**
* 入库列表 页面跳转
*
* @return
*/
@RequestMapping(params = "list")
public ModelAndView list(HttpServletRequest request) {
return new ModelAndView("com/jeecg/z_entry/zEntryList");
}
/**
* easyui AJAX请求数据
*
* @param request
* @param response
* @param dataGrid
* @param user
*/
@RequestMapping(params = "datagrid")
public void datagrid(ZEntryEntity zEntry,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(ZEntryEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, zEntry);
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
this.zEntryService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
/**
* 删除入库
*
* @return
*/
@RequestMapping(params = "doDel")
@ResponseBody
public AjaxJson doDel(ZEntryEntity zEntry, HttpServletRequest request) {
AjaxJson j = new AjaxJson();
zEntry = systemService.getEntity(ZEntryEntity.class, zEntry.getId());
String message = "入库删除成功";
try{
zEntryService.delMain(zEntry);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "入库删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* 批量删除入库
*
* @return
*/
@RequestMapping(params = "doBatchDel")
@ResponseBody
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
AjaxJson j = new AjaxJson();
String message = "入库删除成功";
try{
for(String id:ids.split(",")){
ZEntryEntity zEntry = systemService.getEntity(ZEntryEntity.class,
id
);
zEntryService.delMain(zEntry);
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
}
}catch(Exception e){
e.printStackTrace();
message = "入库删除失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* 添加入库
*
* @param ids
* @return
*/
@RequestMapping(params = "doAdd")
@ResponseBody
public AjaxJson doAdd(ZEntryEntity zEntry,ZEntryPage zEntryPage, HttpServletRequest request) {
List<ZEntrydetailEntity> zEntrydetailList = zEntryPage.getZEntrydetailList();
AjaxJson j = new AjaxJson();
String message = "添加成功";
try{
zEntryService.addMain(zEntry, zEntrydetailList);
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "入库添加失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* 更新入库
*
* @param ids
* @return
*/
@RequestMapping(params = "doUpdate")
@ResponseBody
public AjaxJson doUpdate(ZEntryEntity zEntry,ZEntryPage zEntryPage, HttpServletRequest request) {
List<ZEntrydetailEntity> zEntrydetailList = zEntryPage.getZEntrydetailList();
AjaxJson j = new AjaxJson();
String message = "更新成功";
try{
zEntryService.updateMain(zEntry, zEntrydetailList);
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
}catch(Exception e){
e.printStackTrace();
message = "更新入库失败";
throw new BusinessException(e.getMessage());
}
j.setMsg(message);
return j;
}
/**
* 入库新增页面跳转
*
* @return
*/
@RequestMapping(params = "goAdd")
public ModelAndView goAdd(ZEntryEntity zEntry, HttpServletRequest req) {
if (StringUtil.isNotEmpty(zEntry.getId())) {
zEntry = zEntryService.getEntity(ZEntryEntity.class, zEntry.getId());
req.setAttribute("zEntryPage", zEntry);
}
return new ModelAndView("com/jeecg/z_entry/zEntry-add");
}
/**
* 入库编辑页面跳转
*
* @return
*/
@RequestMapping(params = "goUpdate")
public ModelAndView goUpdate(ZEntryEntity zEntry, HttpServletRequest req) {
if (StringUtil.isNotEmpty(zEntry.getId())) {
zEntry = zEntryService.getEntity(ZEntryEntity.class, zEntry.getId());
req.setAttribute("zEntryPage", zEntry);
}
return new ModelAndView("com/jeecg/z_entry/zEntry-update");
}
/**
* 加载明细列表[入库明细表]
*
* @return
*/
@RequestMapping(params = "zEntrydetailList")
public ModelAndView zEntrydetailList(ZEntryEntity zEntry, HttpServletRequest req) {
//===================================================================================
//获取参数
Object id0 = zEntry.getId();
//===================================================================================
//查询-入库明细表
String hql0 = "from ZEntrydetailEntity where 1 = 1 AND z_ID = ? ";
try{
List<ZEntrydetailEntity> zEntrydetailEntityList = systemService.findHql(hql0,id0);
req.setAttribute("zEntrydetailList", zEntrydetailEntityList);
}catch(Exception e){
logger.info(e.getMessage());
}
return new ModelAndView("com/jeecg/z_entrydetail/zEntrydetailList");
}
/**
* 导出excel
*
* @param request
* @param response
*/
@RequestMapping(params = "exportXls")
public String exportXls(ZEntryEntity zEntry,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid,ModelMap map) {
CriteriaQuery cq = new CriteriaQuery(ZEntryEntity.class, dataGrid);
//查询条件组装器
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, zEntry);
try{
//自定义追加查询条件
}catch (Exception e) {
throw new BusinessException(e.getMessage());
}
cq.add();
List<ZEntryEntity> list=this.zEntryService.getListByCriteriaQuery(cq, false);
List<ZEntryPage> pageList=new ArrayList<ZEntryPage>();
if(list!=null&&list.size()>0){
for(ZEntryEntity entity:list){
try{
ZEntryPage page=new ZEntryPage();
MyBeanUtils.copyBeanNotNull2Bean(entity,page);
Object id0 = entity.getId();
String hql0 = "from ZEntrydetailEntity where 1 = 1 AND z_ID = ? ";
List<ZEntrydetailEntity> zEntrydetailEntityList = systemService.findHql(hql0,id0);
page.setZEntrydetailList(zEntrydetailEntityList);
pageList.add(page);
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
map.put(NormalExcelConstants.FILE_NAME,"入库");
map.put(NormalExcelConstants.CLASS,ZEntryPage.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("入库列表", "导出人:Jeecg",
"导出信息"));
map.put(NormalExcelConstants.DATA_LIST,pageList);
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* 通过excel导入数据
* @param request
* @param
* @return
*/
@RequestMapping(params = "importExcel", method = RequestMethod.POST)
@ResponseBody
public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) {
AjaxJson j = new AjaxJson();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(2);
params.setNeedSave(true);
try {
List<ZEntryPage> list = ExcelImportUtil.importExcel(file.getInputStream(), ZEntryPage.class, params);
ZEntryEntity entity1=null;
for (ZEntryPage page : list) {
entity1=new ZEntryEntity();
MyBeanUtils.copyBeanNotNull2Bean(page,entity1);
zEntryService.addMain(entity1, page.getZEntrydetailList());
}
j.setMsg("文件导入成功!");
} catch (Exception e) {
j.setMsg("文件导入失败!");
logger.error(ExceptionUtil.getExceptionMessage(e));
}finally{
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return j;
}
/**
* 导出excel 使模板
*/
@RequestMapping(params = "exportXlsByT")
public String exportXlsByT(ModelMap map) {
map.put(NormalExcelConstants.FILE_NAME,"入库");
map.put(NormalExcelConstants.CLASS,ZEntryPage.class);
map.put(NormalExcelConstants.PARAMS,new ExportParams("入库列表", "导出人:"+ ResourceUtil.getSessionUser().getRealName(),
"导出信息"));
map.put(NormalExcelConstants.DATA_LIST,new ArrayList());
return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
/**
* 导入功能跳转
*
* @return
*/
@RequestMapping(params = "upload")
public ModelAndView upload(HttpServletRequest req) {
req.setAttribute("controller_name", "zEntryController");
return new ModelAndView("common/upload/pub_excel_upload");
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="入库列表信息",produces="application/json",httpMethod="GET")
public ResponseMessage<List<ZEntryPage>> list() {
List<ZEntryEntity> list= zEntryService.getList(ZEntryEntity.class);
List<ZEntryPage> pageList=new ArrayList<ZEntryPage>();
if(list!=null&&list.size()>0){
for(ZEntryEntity entity:list){
try{
ZEntryPage page=new ZEntryPage();
MyBeanUtils.copyBeanNotNull2Bean(entity,page);
Object id0 = entity.getId();
String hql0 = "from ZEntrydetailEntity where 1 = 1 AND z_ID = ? ";
List<ZEntrydetailEntity> zEntrydetailOldList = this.zEntryService.findHql(hql0,id0);
page.setZEntrydetailList(zEntrydetailOldList);
pageList.add(page);
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
return Result.success(pageList);
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value="根据ID获取入库信息",notes="根据ID获取入库信息",httpMethod="GET",produces="application/json")
public ResponseMessage<?> get(@ApiParam(required=true,name="id",value="ID")@PathVariable("id") String id) {
ZEntryEntity task = zEntryService.get(ZEntryEntity.class, id);
if (task == null) {
return Result.error("根据ID获取入库信息为空");
}
ZEntryPage page = new ZEntryPage();
try {
MyBeanUtils.copyBeanNotNull2Bean(task, page);
Object id0 = task.getId();
String hql0 = "from ZEntrydetailEntity where 1 = 1 AND z_ID = ? ";
List<ZEntrydetailEntity> zEntrydetailOldList = this.zEntryService.findHql(hql0,id0);
page.setZEntrydetailList(zEntrydetailOldList);
} catch (Exception e) {
e.printStackTrace();
}
return Result.success(page);
}
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="创建入库")
public ResponseMessage<?> create(@ApiParam(name="入库对象")@RequestBody ZEntryPage zEntryPage, UriComponentsBuilder uriBuilder) {
//调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<ZEntryPage>> failures = validator.validate(zEntryPage);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
List<ZEntrydetailEntity> zEntrydetailList = zEntryPage.getZEntrydetailList();
ZEntryEntity zEntry = new ZEntryEntity();
try{
MyBeanUtils.copyBeanNotNull2Bean(zEntryPage,zEntry);
}catch(Exception e){
logger.info(e.getMessage());
return Result.error("保存入库失败");
}
zEntryService.addMain(zEntry, zEntrydetailList);
return Result.success(zEntry);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@ApiOperation(value="更新入库",notes="更新入库")
public ResponseMessage<?> update(@RequestBody ZEntryPage zEntryPage) {
//调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息.
Set<ConstraintViolation<ZEntryPage>> failures = validator.validate(zEntryPage);
if (!failures.isEmpty()) {
return Result.error(JSONArray.toJSONString(BeanValidators.extractPropertyAndMessage(failures)));
}
//保存
List<ZEntrydetailEntity> zEntrydetailList = zEntryPage.getZEntrydetailList();
ZEntryEntity zEntry = new ZEntryEntity();
try{
MyBeanUtils.copyBeanNotNull2Bean(zEntryPage,zEntry);
}catch(Exception e){
logger.info(e.getMessage());
return Result.error("入库更新失败");
}
zEntryService.updateMain(zEntry, zEntrydetailList);
//按Restful约定,返回204状态码, 无内容. 也可以返回200状态码.
return Result.success();
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ApiOperation(value="删除入库")
public ResponseMessage<?> delete(@ApiParam(name="id",value="ID",required=true)@PathVariable("id") String id) {
logger.info("delete[{}]" + id);
// 验证
if (StringUtils.isEmpty(id)) {
return Result.error("ID不能为空");
}
try {
ZEntryEntity zEntry = zEntryService.get(ZEntryEntity.class, id);
zEntryService.delMain(zEntry);
} catch (Exception e) {
e.printStackTrace();
return Result.error("入库删除失败");
}
return Result.success();
}
}
| [
"794429910@qq.com"
] | 794429910@qq.com |
b0f476aa84743ceda755679876faf686e536bd17 | 1f4d669dc6e56aa8d74342a0f35dfac47ac7eb8d | /Test/src/java/controller/TransactionSvl.java | 9bd382c0850be9feb2871c0295b28d18f8b9ac34 | [] | no_license | aoeminh/ASM-Webservice-Client | 01990fefc57279ccccb585e80b1345948a8ad057 | 062c724c883811feff50b0998404be86fe69bf71 | refs/heads/master | 2020-03-27T04:58:22.707380 | 2018-08-24T11:42:54 | 2018-08-24T11:42:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,735 | 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 controller;
import com.example.service.CheckPartnerService_Service;
import com.example.service.Partner;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.ws.rs.client.Client;
import javax.xml.ws.WebServiceRef;
/**
*
* @author apple
*/
public class TransactionSvl extends HttpServlet {
@WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/ASMWebservice-war/CheckPartnerService.wsdl")
private CheckPartnerService_Service service;
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//processRequest(request, response);
HttpSession session = request.getSession();
com.example.service.Partner partnerSes = (Partner) session.getAttribute("partner");
String clientID = request.getParameter("clientid");
String password = request.getParameter("cpassword");
String checkFee = request.getParameter("check");
String transName = request.getParameter("transname");
//money of partner before transaction
Date date = new Date();
try {
int moneyofPartner = partnerSes.getPartnermoney();
int money = Integer.parseInt(request.getParameter("money"));
com.example.service.Client client = new com.example.service.Client();
client = checkClient(clientID, password);
//money of client before transaction
boolean checkUpdateClient = false;
boolean checkUpdatePartner = false;
int moneyOfClient = client.getCmoney();
int fee = caculateFee(money);
if (client != null) {
if (checkFee != null) {
//money of client and partner before transaction
int clientMoneyChange = moneyOfClient - (fee + money);
int partnerMoneyChange = moneyofPartner + money;
//transaction
//update money for client and partner;
updateCLientMoney(clientID, clientMoneyChange);
updatePartnerMoney(partnerSes.getPartneraccount(), partnerMoneyChange);
userHis(transName, money, -fee, client.getClienid());
partnerHis(transName, money, 0, partnerSes.getPartnerid());
} else {
//money of client and partner before transaction
int clientMoneyChange = moneyOfClient - money;
int partnerMoneyChange = moneyofPartner + (money - fee);
//transaction
//update money for client and partner;
checkUpdateClient = updateCLientMoney(clientID, clientMoneyChange);
checkUpdatePartner = updatePartnerMoney(partnerSes.getPartneraccount(), partnerMoneyChange);
userHis(transName, money, 0, client.getClienid());
partnerHis(transName, money, -fee, partnerSes.getPartnerid());
}
// if (checkUpdateClient && checkUpdatePartner) {
// request.getRequestDispatcher("success.jsp").forward(request, response);
// } else {
// request.getRequestDispatcher("error.jsp").forward(request, response);
// }
request.getRequestDispatcher("success.jsp").forward(request, response);
} else {
request.getRequestDispatcher("error.jsp").forward(request, response);
}
} catch (Exception ex) {
request.getRequestDispatcher("error.jsp").forward(request, response);
}
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
private boolean updateCLientMoney(java.lang.String clienid, int money) {
// Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
// If the calling of port operations may lead to race condition some synchronization is required.
com.example.service.CheckPartnerService port = service.getCheckPartnerServicePort();
return port.updateCLientMoney(clienid, money);
}
private boolean updatePartnerMoney(java.lang.String partnerid, int money) {
// Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
// If the calling of port operations may lead to race condition some synchronization is required.
com.example.service.CheckPartnerService port = service.getCheckPartnerServicePort();
return port.updatePartnerMoney(partnerid, money);
}
public int caculateFee(int money) {
if (money <= 100000) {
return 10000;
} else if (money > 100000 && money <= 500000) {
return money * 4 / 100;
} else if (money > 500000 && money <= 1000000) {
return (money * 3) / 100;
} else if (money > 1000000 && money <= 5000000) {
return (money * 2) / 100;
} else if (money > 5000000) {
return money / 100;
} else {
return 0;
}
}
private com.example.service.Client checkClient(java.lang.String id, java.lang.String password) {
// Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
// If the calling of port operations may lead to race condition some synchronization is required.
com.example.service.CheckPartnerService port = service.getCheckPartnerServicePort();
return port.checkClient(id, password);
}
private boolean partnerHis(java.lang.String transname, int money, int fee, java.lang.String partnerid) {
// Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
// If the calling of port operations may lead to race condition some synchronization is required.
com.example.service.CheckPartnerService port = service.getCheckPartnerServicePort();
return port.partnerHis(transname, money, fee, partnerid);
}
private boolean userHis(java.lang.String transname, int money, int fee, java.lang.String clientid) {
// Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
// If the calling of port operations may lead to race condition some synchronization is required.
com.example.service.CheckPartnerService port = service.getCheckPartnerServicePort();
return port.userHis(transname, money, fee, clientid);
}
}
| [
"aoeminh@gmail.com"
] | aoeminh@gmail.com |
ace1280206e99ca74c09169a6754b4b986a0c710 | 3e21a4608bc5d468a9f45197154f75ce4b3db70c | /jlox/src/com/craftinginterpreters/lox/Environment.java | b2d04a5ce9fd098ca49551c0a774e6d9238082d3 | [] | no_license | prateekkumarweb/lox | 6134b4bb89c41d004544ec0ab5700a6d5da8d636 | 69f339759b1a7f419b341d38dd33a88ad8a24096 | refs/heads/master | 2022-06-03T17:46:30.308103 | 2020-05-01T05:59:11 | 2020-05-01T10:43:28 | 260,390,635 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,386 | java | package com.craftinginterpreters.lox;
import java.util.HashMap;
import java.util.Map;
class Environment {
final Environment enclosing;
private final Map<String, Object> values = new HashMap<>();
Environment() {
enclosing = null;
}
Environment(Environment enclosing) {
this.enclosing = enclosing;
}
Object get(Token name) {
if (values.containsKey(name.lexeme)) {
return values.get(name.lexeme);
}
if (enclosing != null)
return enclosing.get(name);
throw new RuntimeError(name, "Undefined variable '" + name.lexeme + "'.");
}
void assign(Token name, Object value) {
if (values.containsKey(name.lexeme)) {
values.put(name.lexeme, value);
return;
}
if (enclosing != null) {
enclosing.assign(name, value);
return;
}
throw new RuntimeError(name, "Undefined variable '" + name.lexeme + "'.");
}
void define(String name, Object value) {
values.put(name, value);
}
Environment ancestor(int distance) {
Environment environment = this;
for (int i = 0; i < distance; i++) {
environment = environment.enclosing;
}
return environment;
}
Object getAt(int distance, String name) {
return ancestor(distance).values.get(name);
}
void assignAt(int distance, Token name, Object value) {
ancestor(distance).values.put(name.lexeme, value);
}
} | [
"prateek@prateekkumar.in"
] | prateek@prateekkumar.in |
bd1ff0ce98033e0353f37fec40c08363f2f5e99e | d58ca055992c5ce7813ecce136a06014f3221999 | /src/main/java/lib/duolingoproject/hibernate/dao/UserShopDaoImpl.java | 452b80a8ac0af10aa82779cdd97f80b005891938 | [] | no_license | ProyectoDuolingo/lib | 88b7092cfa5c6365d501d7bfcb892517583a8606 | 1849c9c1f2f483655081f9e96ddff44e9aa01d27 | refs/heads/master | 2023-02-02T12:35:15.818996 | 2020-12-17T19:11:37 | 2020-12-17T19:11:37 | 314,102,730 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,358 | java | package lib.duolingoproject.hibernate.dao;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.Transaction;
import lib.duolingoproject.hibernate.dao.i.IUserShopDao;
import lib.duolingoproject.hibernate.model.association.UserShop;
import lib.duolingoproject.hibernate.util.HibernateUtil;
public class UserShopDaoImpl implements IUserShopDao{
// saveUserShop
// getAllUserShops
// getUserShopById
// updateUserShop
// deleteUserShopById
public UserShop getUserShopById(long userId, long shopId) {
Transaction transaction = null;
UserShop userShop = null;
try (Session session = HibernateUtil.getSessionFactory().openSession()) {
// Start the transaction
transaction = session.beginTransaction();
// Get UserShop object
userShop = session.get(UserShop.class, userShop.new UserShopId(userId, shopId));
// Commit the transaction
transaction.commit();
} catch (Exception e) {
if (transaction != null) {
transaction.rollback();
}
}
return userShop;
}
public List<UserShop> getAllUserShopsById(long userId) {
Transaction transaction = null;
List<UserShop> userShopsList = null;
try (Session session = HibernateUtil.getSessionFactory().openSession()) {
// Start the transaction
transaction = session.beginTransaction();
// Get UserShops list
userShopsList = session.createQuery("from user_shop where user_id = '" + userId + "'").list();
// Commit the transaction
transaction.commit();
} catch (Exception e) {
if (transaction != null) {
transaction.rollback();
}
}
return userShopsList;
}
public void saveUserShop(UserShop userShop) {
Transaction transaction = null;
try (Session session = HibernateUtil.getSessionFactory().openSession()) {
// Start the transaction
transaction = session.beginTransaction();
// Save UserShop object
session.save(userShop);
// Commit the transaction
transaction.commit();
} catch (Exception e) {
if (transaction != null) {
transaction.rollback();
}
}
}
public void updateUserShop(UserShop userShop) {
Transaction transaction = null;
try (Session session = HibernateUtil.getSessionFactory().openSession()) {
// Start the transaction
transaction = session.beginTransaction();
// Save UserShop object
session.saveOrUpdate(userShop);
// Commit the transaction
transaction.commit();
} catch (Exception e) {
if (transaction != null) {
transaction.rollback();
}
}
}
public void deleteUserShopById(long userId, long shopId) {
Transaction transaction = null;
UserShop userShop = null;
try (Session session = HibernateUtil.getSessionFactory().openSession()) {
// Start the transaction
transaction = session.beginTransaction();
// Get UserShop object
userShop = session.get(UserShop.class, userShop.new UserShopId(userId, shopId));
// Delete UserShop object
session.delete(userShop);
// Commit the transaction
transaction.commit();
} catch (Exception e) {
if (transaction != null) {
transaction.rollback();
}
}
}
}
| [
"elkrysss@gmail.com"
] | elkrysss@gmail.com |
e82d0d3adb133afbf36fee4376a2e193f3f4d17c | 743971fe05db7479c1ff94648c941ce80621dee3 | /app/src/test/java/com/something/kumaranurag/ggsipusyllabus/somethingUnitTest.java | 2241ecbb2ad31589901318760f9738a8b4ac94c8 | [
"BSD-3-Clause"
] | permissive | kmranrg/IPU_Syllabus | aa26ed3e28bbc8071627610e3bed4cfce73b0ed2 | 56eb9f543f2d3fd0f18e55d1be777bc6c21b09e0 | refs/heads/master | 2020-05-02T03:50:15.721549 | 2019-10-22T05:24:14 | 2019-10-22T05:24:14 | 177,737,535 | 0 | 0 | BSD-3-Clause | 2019-10-20T18:44:07 | 2019-03-26T07:37:43 | Java | UTF-8 | Java | false | false | 422 | java | package com.something.kumaranurag.ggsipusyllabus;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* something local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class somethingUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"kmranrg@gmail.com"
] | kmranrg@gmail.com |
4a9807b71deea2324cb57801fd6c29ffa21f1e85 | 5e12a12323d3401578ea2a7e4e101503d700b397 | /branches/fitnesse/src/main/java/fitnesse/slimTables/HtmlTableScanner.java | a8f329deba71f5a2989ef77daefd4ab1a0aafe55 | [] | no_license | xiangyong/jtester | 369d4b689e4e66f25c7217242b835d1965da3ef8 | 5f4b3948cd8d43d3e8fea9bc34e5bd7667f4def9 | refs/heads/master | 2021-01-18T21:02:05.493497 | 2013-10-08T01:48:18 | 2013-10-08T01:48:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,783 | java | // Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
// Released under the terms of the CPL Common Public License version 1.0.
package fitnesse.slimTables;
import org.htmlparser.Node;
import org.htmlparser.Parser;
import org.htmlparser.lexer.Lexer;
import org.htmlparser.lexer.Page;
import org.htmlparser.tags.TableTag;
import org.htmlparser.util.NodeList;
import org.htmlparser.util.ParserException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
public class HtmlTableScanner implements TableScanner {
private List<Table> tables = new ArrayList<Table>();
private NodeList htmlTree;
public HtmlTableScanner(String page) throws ParserException {
if (page == null || page.equals(""))
page = "<i>This page intentionally left blank.</i>";
Parser parser = new Parser(new Lexer(new Page(page)));
htmlTree = parser.parse(null);
scanForTables(htmlTree);
}
private void scanForTables(NodeList nodes) {
for (int i = 0; i < nodes.size(); i++) {
Node node = nodes.elementAt(i);
if (node instanceof TableTag) {
TableTag tableTag = (TableTag) node;
guaranteeThatAllTablesAreUnique(tableTag);
tables.add(new HtmlTable(tableTag));
} else {
NodeList children = node.getChildren();
if (children != null)
scanForTables(children);
}
}
}
private void guaranteeThatAllTablesAreUnique(TableTag tagTable) {
tagTable.setAttribute("_TABLENUMBER", "" + Math.abs((new Random()).nextLong()));
}
public int getTableCount() {
return tables.size();
}
public Table getTable(int i) {
return tables.get(i);
}
public Iterator<Table> iterator() {
return tables.iterator();
}
public String toWikiText() {
StringBuffer b = new StringBuffer();
for (Table t : tables) {
b.append("\n");
for (int row = 0; row < t.getRowCount(); row++) {
b.append("|");
if (t.getColumnCountInRow(row) == 0)
b.append("|");
for (int col = 0; col < t.getColumnCountInRow(row); col++) {
b.append(t.getCellContents(col, row));
b.append("|");
}
b.append("\n");
}
}
return b.toString();
}
public String toHtml(Table startTable, Table endBeforeTable) {
String allHtml = htmlTree.toHtml();
int startIndex = 0;
int endIndex = allHtml.length();
if (startTable != null) {
String startText = startTable.toHtml();
int nodeIndex = allHtml.indexOf(startText);
if (nodeIndex > 0) {
startIndex = nodeIndex;
}
}
if (endBeforeTable != null) {
String stopText = endBeforeTable.toHtml();
int nodeIndex = allHtml.indexOf(stopText);
if (nodeIndex > 0) {
endIndex = nodeIndex;
}
}
return htmlTree.toHtml().substring(startIndex, endIndex);
}
public String toHtml() {
return htmlTree.toHtml();
}
}
| [
"darui.wu@9ac485da-fb45-aad8-5227-9c360d3c5fad"
] | darui.wu@9ac485da-fb45-aad8-5227-9c360d3c5fad |
4754c51479348baf5c183eb7c25eda1141ce2ef3 | 3d794c33bcdbedea05712444950be4f72f4ecd70 | /android/app/src/main/java/com/andrewbrook/nghbrly/MainActivity.java | 3eb31b6754d29741b99c9350bd60d9d92a2c7f22 | [] | no_license | fourthbrook/nghbrly | 0af0ee082f5538abbce780a3734aaace6edf98b0 | 9211bfffce8269c7b79b6bca6bc5186ec0ec3b19 | refs/heads/master | 2022-06-18T01:07:09.662056 | 2020-05-16T01:30:40 | 2020-05-16T01:30:40 | 261,613,697 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package com.andrewbrook.nghbrly;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "nghbrly";
}
}
| [
"fourthbrook@gmail.com"
] | fourthbrook@gmail.com |
ebdc875fd58e45cb057f228133a9d9e6dbbbc3b3 | 99f891f10705463169559e4cba3b852eedd73613 | /week-meeting/src/main/java/com/hirain/mapper/PlanMapper.java | a2eb7650b729cd9ad6ff4a1f9957ac2f034415f8 | [] | no_license | Chaves-z/week-meeting | e1b524c7ae1bfaeb80343b40ebcb4a3b711c401d | 947c087ac8d4e700421f2d78cef5161ef3b713f8 | refs/heads/master | 2020-03-21T04:21:30.054316 | 2018-06-21T11:10:38 | 2018-06-21T11:10:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package com.hirain.mapper;
import java.util.Map;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import com.hirain.pojo.Plan;
public interface PlanMapper {
@Insert("insert into plan (userId,lastWeek,currentWeek,problem,date) values(#{userid},#{lastweek},#{currentweek},#{problem},#{date})")
int insert(Plan plan);
@Select("select * from plan where userId=#{userid} and date=#{date}")
Plan findPlanByUserIdAndData(Map<String, Object> map);
@Update("update plan set userId=#{userid},lastWeek=#{lastweek},currentWeek=#{currentweek},problem=#{problem},date=#{date} where userId=#{userid} and date=#{date}")
int update(Plan plan);
} | [
"1269283796@qq.com"
] | 1269283796@qq.com |
eee8f8a626d50ab986a7ada3a11188fa15480e39 | b82dd1df2ae52e66766cea189efab7ecd5585ac3 | /achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/meta/EntityMetaColumnsForFunctionsCodeGen.java | f1cf5f6738f4495fc3868d824144b7224565fa04 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | romolodevito/Achilles | 34ce40fbcdcc7ebfedf74935f4569c18cb08e136 | 8b04609f42f2b7c83c48a69b55773f3b4bc3411a | refs/heads/master | 2020-04-10T13:18:43.069016 | 2018-12-09T14:36:57 | 2018-12-09T14:36:57 | 155,694,647 | 0 | 0 | Apache-2.0 | 2018-11-01T09:53:11 | 2018-11-01T09:53:11 | null | UTF-8 | Java | false | false | 3,592 | java | /*
* Copyright (C) 2012-2018 DuyHai DOAN
*
* 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 info.archinnov.achilles.internals.codegen.meta;
import static info.archinnov.achilles.internals.parser.TypeUtils.*;
import java.util.List;
import javax.lang.model.element.Modifier;
import com.squareup.javapoet.CodeBlock;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import info.archinnov.achilles.internals.metamodel.columns.ColumnType;
import info.archinnov.achilles.internals.parser.FieldParser.FieldMetaSignature;
import info.archinnov.achilles.internals.parser.TypeUtils;
import info.archinnov.achilles.internals.strategy.naming.SnakeCaseNaming;
public class EntityMetaColumnsForFunctionsCodeGen {
private static final SnakeCaseNaming SNAKE_CASE_NAMING = new SnakeCaseNaming();
public static final TypeSpec createColumnsClassForFunctionParam(List<FieldMetaSignature> parsingResults) {
final TypeSpec.Builder builder = TypeSpec.classBuilder(COLUMNS_FOR_FUNCTIONS_CLASS)
.addJavadoc("Utility class to expose all fields with their CQL type for function call")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL);
parsingResults
.stream()
.filter(x -> x.context.columnType != ColumnType.COMPUTED)
.forEach(parsingResult -> builder.addField(buildField(parsingResult)));
return builder.build();
}
private static final FieldSpec buildField(FieldMetaSignature fieldMetaSignature) {
final TypeName typeNameForFunctionParam = TypeUtils.determineTypeForFunctionParam(fieldMetaSignature.sourceType);
final String fieldName = SNAKE_CASE_NAMING.apply(fieldMetaSignature.context.fieldName).toUpperCase();
final String cqlColumn = fieldMetaSignature.context.quotedCqlColumn;
return FieldSpec.builder(typeNameForFunctionParam, fieldName, Modifier.PUBLIC, Modifier.FINAL)
.addJavadoc("<br/>\n")
.addJavadoc("Field to be used for <em>manager.dsl().select().function(...)</em> call\n")
.addJavadoc("<br/>\n")
.addJavadoc("This is an alias for the field <strong>$S</strong>", fieldMetaSignature.context.fieldName)
.initializer(CodeBlock
.builder()
.add("new $T($T.empty()){\n", typeNameForFunctionParam, OPTIONAL)
.add(" @$T\n", OVERRIDE_ANNOTATION)
.beginControlFlow(" protected String cqlColumn()")
.addStatement(" return $S", cqlColumn)
.endControlFlow()
.add(" @$T\n", OVERRIDE_ANNOTATION)
.beginControlFlow(" public boolean isFunctionCall()")
.addStatement(" return false")
.endControlFlow()
.add(" }\n")
.build()
)
.build();
}
}
| [
"doanduyhai@gmail.com"
] | doanduyhai@gmail.com |
dfabedd43a5ed302c2aa8e5a065ab25afb59a7b1 | d7fe4c81e5f38bcc78f796add444cf09e035e005 | /app/src/main/java/com/example/user/thingstodo/MainActivity.java | 01c22b4518e6366ff99f3749360fd15212c21742 | [] | no_license | lhw1357/Android-Studio_Things-to-do-restart | 05451cce101dc24a44686a71a0fff0b287384541 | 6a55b9c639ad55f6f47ca69192f2a0716dafdfa5 | refs/heads/master | 2021-01-25T07:41:03.058451 | 2017-06-14T12:51:56 | 2017-06-14T12:51:56 | 93,654,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,227 | java | package com.example.user.thingstodo;
import android.content.Intent;
import android.media.Image;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
FloatingActionButton add;
Toolbar toolbar;
TextView first;
ImageView ifempty;
TextView ifempty2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
toolbar = (Toolbar) findViewById(R.id.toolbar);
add = (FloatingActionButton) findViewById(R.id.add);
setSupportActionBar(toolbar);
first = (TextView)findViewById(R.id.first);
ifempty = (ImageView)findViewById(R.id.ifempty);
ifempty2 = (TextView)findViewById(R.id.ifempty2);
first.setVisibility(View.INVISIBLE);
add.setOnClickListener(this);
Intent save = getIntent();
String todo = save.getStringExtra("todo");
int count=save.getIntExtra("1",0);
first.setText(todo);
if(count==1){
ifempty.setVisibility(View.INVISIBLE);
ifempty2.setVisibility(View.INVISIBLE);
first.setVisibility(View.VISIBLE);
}
}
@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, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}
@Override
public void onClick(View v) {
Intent addtodo = new Intent(this,addtodo.class);
switch (v.getId()){
case R.id.add :
startActivity(addtodo);
finish();
break;
}
}
}
| [
"lhw1357@naver.com"
] | lhw1357@naver.com |
6fe0fdfbf164a1944c7a2f3265d61cb3717d56d7 | 63e238d255d696cc9af997ec57f11dd4e6079f1a | /backend/src/main/java/com/rahul/ibcsprimax/controller/EmployeeController.java | 56c4174711410064e05a89ea2dc2ee83061c6dac | [] | no_license | rahul-cse/payroll | c0113523c36a25b59b90e81c46bd2771f65e5b5d | cae18ff4db359c239b4eaaaef52f4d9e63877fc1 | refs/heads/main | 2023-01-11T14:17:35.501227 | 2020-11-20T21:36:22 | 2020-11-20T21:36:22 | 314,246,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,808 | java | package com.rahul.ibcsprimax.controller;
import java.util.List;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.CrossOrigin;
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.RestController;
import com.rahul.ibcsprimax.entity.Employee;
import com.rahul.ibcsprimax.service.EmployeeService;
@CrossOrigin("*")
@RestController
@RequestMapping("/emp")
@Transactional
public class EmployeeController {
@Autowired
EmployeeService employeeService;
@GetMapping("")
public List<Employee> getAllEmployees() {
return employeeService.getAll();
}
@GetMapping("/{strId}")
public Employee getEmployee(@PathVariable String strId) throws Exception {
Long id = null;
try {
id = Long.parseLong(strId);
}
catch(Exception ex) {
throw new Exception();
}
return employeeService.getById(id);
}
@PostMapping("/create")
public ResponseEntity<?> saveEmployee(@RequestBody @Valid Employee employee) {
employeeService.save(employee);
return ResponseEntity.ok(HttpStatus.CREATED);
}
@PutMapping("/update")
public ResponseEntity<?> updateEmployee(@RequestBody @Valid Employee employee){
employeeService.update(employee);
return ResponseEntity.ok(HttpStatus.OK);
}
}
| [
"rahul.ctg62@gmail.com"
] | rahul.ctg62@gmail.com |
5c5155858e8c48f29b9b728c60ff5580f6223ae9 | de3eb812d5d91cbc5b81e852fc32e25e8dcca05f | /branches/crux/4.0.0/Crux/src/ui/gwt/org/cruxframework/crux/gwt/rebind/RichTextAreaFactory.java | c628128d04fb5b50a08f96c12afbe335df3f07a0 | [] | no_license | svn2github/crux-framework | 7dd52a951587d4635112987301c88db23325c427 | 58bcb4821752b405a209cfc21fb83e3bf528727b | refs/heads/master | 2016-09-06T13:33:41.975737 | 2015-01-22T08:03:25 | 2015-01-22T08:03:25 | 13,135,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,875 | java | /*
* Copyright 2011 cruxframework.org.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.cruxframework.crux.gwt.rebind;
import org.cruxframework.crux.core.client.collection.FastMap;
import org.cruxframework.crux.core.client.utils.EscapeUtils;
import org.cruxframework.crux.core.rebind.CruxGeneratorException;
import org.cruxframework.crux.core.rebind.screen.widget.ViewFactoryCreator;
import org.cruxframework.crux.core.rebind.screen.widget.WidgetCreatorContext;
import org.cruxframework.crux.core.rebind.screen.widget.ViewFactoryCreator.SourcePrinter;
import org.cruxframework.crux.core.rebind.screen.widget.creator.HasHTMLFactory;
import org.cruxframework.crux.core.rebind.screen.widget.creator.HasInitializeHandlersFactory;
import org.cruxframework.crux.core.rebind.screen.widget.creator.children.WidgetChildProcessor;
import org.cruxframework.crux.core.rebind.screen.widget.creator.children.WidgetChildProcessor.HTMLTag;
import org.cruxframework.crux.core.rebind.screen.widget.declarative.DeclarativeFactory;
import org.cruxframework.crux.core.rebind.screen.widget.declarative.TagAttributeDeclaration;
import org.cruxframework.crux.core.rebind.screen.widget.declarative.TagAttributesDeclaration;
import org.cruxframework.crux.core.rebind.screen.widget.declarative.TagChild;
import org.cruxframework.crux.core.rebind.screen.widget.declarative.TagChildren;
import org.cruxframework.crux.core.rebind.screen.widget.declarative.TagConstraints;
import com.google.gwt.user.client.ui.RichTextArea;
import com.google.gwt.user.client.ui.RichTextArea.FontSize;
import com.google.gwt.user.client.ui.RichTextArea.Formatter;
import com.google.gwt.user.client.ui.RichTextArea.Justification;
class RichTextAreaContext extends WidgetCreatorContext
{
protected FastMap<String> declaredProperties;
}
/**
* Represents a rich text area component
* @author Thiago Bustamante
*/
@DeclarativeFactory(id="richTextArea", library="gwt", targetWidget=RichTextArea.class)
@TagAttributesDeclaration({
@TagAttributeDeclaration("backColor"),
@TagAttributeDeclaration("fontName"),
@TagAttributeDeclaration(value="fontSize", type=Integer.class),
@TagAttributeDeclaration("foreColor"),
@TagAttributeDeclaration("justification"),
@TagAttributeDeclaration(value="bold", type=Boolean.class),
@TagAttributeDeclaration(value="italic", type=Boolean.class),
@TagAttributeDeclaration(value="subscript", type=Boolean.class),
@TagAttributeDeclaration(value="superscript", type=Boolean.class),
@TagAttributeDeclaration(value="underline", type=Boolean.class),
@TagAttributeDeclaration(value="strikethrough", type=Boolean.class)
})
@TagChildren({
@TagChild(value=RichTextAreaFactory.ContentProcessor.class, autoProcess=false)
})
public class RichTextAreaFactory extends FocusWidgetFactory<RichTextAreaContext>
implements HasHTMLFactory<RichTextAreaContext>, HasInitializeHandlersFactory<RichTextAreaContext>
{
@Override
public void processAttributes(SourcePrinter out, final RichTextAreaContext context) throws CruxGeneratorException
{
super.processAttributes(out, context);
context.declaredProperties = readDeclaredProperties(context);
}
@Override
public void postProcess(SourcePrinter out, RichTextAreaContext context) throws CruxGeneratorException
{
super.postProcess(out, context);
String widget = context.getWidget();
// We need to give UI thread time to render the textArea before try to focus it
printlnPostProcessing(widget+".setFocus(true);");// Necessary to work around a bug in mozzila
printFormatterOptions(context);
}
/**
* Reads all declared properties in the component span tag. These properties will be used
* to initialise the basic formatter. It will be done by method initBasicFormatterOptions
* @param element
*/
protected FastMap<String> readDeclaredProperties(WidgetCreatorContext context)
{
FastMap<String> declaredProperties = new FastMap<String>();
String backColor = context.readWidgetProperty("backColor");
if (backColor != null && backColor.length() > 0)
{
declaredProperties.put("backColor",backColor);
}
String fontName = context.readWidgetProperty("fontName");
if (fontName != null && fontName.length() > 0)
{
declaredProperties.put("fontName",fontName);
}
String fontSize = context.readWidgetProperty("fontSize");
if (fontSize != null && fontSize.length() > 0)
{
declaredProperties.put("fontSize",fontSize);
}
String foreColor = context.readWidgetProperty("foreColor");
if (foreColor != null && foreColor.length() > 0)
{
declaredProperties.put("foreColor",foreColor);
}
String justification = context.readWidgetProperty("justification");
if (justification != null && justification.length() > 0)
{
declaredProperties.put("justification",justification);
}
String bold = context.readWidgetProperty("bold");
if (bold != null && bold.length() > 0)
{
declaredProperties.put("bold",bold);
}
String italic = context.readWidgetProperty("italic");
if (italic != null && italic.length() > 0)
{
declaredProperties.put("italic",italic);
}
String subscript = context.readWidgetProperty("subscript");
if (subscript != null && subscript.length() > 0)
{
declaredProperties.put("subscript",subscript);
}
String superscript = context.readWidgetProperty("superscript");
if (superscript != null && superscript.length() > 0)
{
declaredProperties.put("superscript",superscript);
}
String underline = context.readWidgetProperty("underline");
if (underline != null && underline.length() > 0)
{
declaredProperties.put("underline",underline);
}
String strikethrough = context.readWidgetProperty("strikethrough");
if (strikethrough != null && strikethrough.length() > 0)
{
declaredProperties.put("strikethrough",strikethrough);
}
return declaredProperties;
}
/**
* Render basic formatter options
*/
protected void printFormatterOptions(RichTextAreaContext context)
{
String formatter = ViewFactoryCreator.createVariableName("formatter");
printlnPostProcessing(Formatter.class.getCanonicalName()+" "+formatter+" = "+context.getWidget()+".getFormatter();");
printlnPostProcessing("if (formatter != null){");
if (context.declaredProperties.containsKey("backColor"))
{
printlnPostProcessing(formatter+".setBackColor("+EscapeUtils.quote(context.declaredProperties.get("backColor"))+");");
}
if (context.declaredProperties.containsKey("fontName"))
{
printlnPostProcessing(formatter+".setFontName("+EscapeUtils.quote(context.declaredProperties.get("fontName"))+");");
}
if (context.declaredProperties.containsKey("fontSize"))
{
switch (Integer.parseInt(context.declaredProperties.get("fontSize")))
{
case 1:
printlnPostProcessing(formatter+".setFontSize("+FontSize.class.getCanonicalName()+".XX_SMALL);");
break;
case 2:
printlnPostProcessing(formatter+".setFontSize("+FontSize.class.getCanonicalName()+".X_SMALL);");
break;
case 3:
printlnPostProcessing(formatter+".setFontSize("+FontSize.class.getCanonicalName()+".SMALL);");
break;
case 4:
printlnPostProcessing(formatter+".setFontSize("+FontSize.class.getCanonicalName()+".MEDIUM);");
break;
case 5:
printlnPostProcessing(formatter+".setFontSize("+FontSize.class.getCanonicalName()+".LARGE);");
break;
case 6:
printlnPostProcessing(formatter+".setFontSize("+FontSize.class.getCanonicalName()+".X_LARGE);");
break;
case 7:
printlnPostProcessing(formatter+".setFontSize("+FontSize.class.getCanonicalName()+".XX_LARGE);");
break;
default:
printlnPostProcessing(formatter+".setFontSize("+FontSize.class.getCanonicalName()+".MEDIUM);");
}
printlnPostProcessing("}");
if (context.declaredProperties.containsKey("foreColor"))
{
printlnPostProcessing(formatter+".setForeColor("+EscapeUtils.quote(context.declaredProperties.get("foreColor"))+");");
}
if (context.declaredProperties.containsKey("justification"))
{
String justification = context.declaredProperties.get("justification");
if (justification.equalsIgnoreCase("center"))
{
printlnPostProcessing(formatter+".setJustification("+Justification.class.getCanonicalName()+".CENTER);");
}
else if (justification.equalsIgnoreCase("left"))
{
printlnPostProcessing(formatter+".setJustification("+Justification.class.getCanonicalName()+".LEFT);");
}
else if (justification.equalsIgnoreCase("right"))
{
printlnPostProcessing(formatter+".setJustification("+Justification.class.getCanonicalName()+".RIGHT);");
}
}
if (context.declaredProperties.containsKey("bold") && Boolean.parseBoolean(context.declaredProperties.get("bold")))
{
printlnPostProcessing(formatter+".toggleBold();");
}
if (context.declaredProperties.containsKey("italic") && Boolean.parseBoolean(context.declaredProperties.get("italic")))
{
printlnPostProcessing(formatter+".toggleItalic();");
}
if (context.declaredProperties.containsKey("subscript") && Boolean.parseBoolean(context.declaredProperties.get("subscript")))
{
printlnPostProcessing(formatter+".toggleSubscript();");
}
if (context.declaredProperties.containsKey("superscript") && Boolean.parseBoolean(context.declaredProperties.get("superscript")))
{
printlnPostProcessing(formatter+".toggleSuperscript();");
}
if (context.declaredProperties.containsKey("underline") && Boolean.parseBoolean(context.declaredProperties.get("underline")))
{
printlnPostProcessing(formatter+".toggleUnderline();");
}
if (context.declaredProperties.containsKey("strikethrough") && Boolean.parseBoolean(context.declaredProperties.get("strikethrough")))
{
printlnPostProcessing(formatter+".toggleStrikethrough();");
}
}
}
@TagConstraints(minOccurs="0", maxOccurs="unbounded", type=HTMLTag.class)
public static class ContentProcessor extends WidgetChildProcessor<RichTextAreaContext> {}
@Override
public RichTextAreaContext instantiateContext()
{
return new RichTextAreaContext();
}
}
| [
"thiago@cruxframework.org@a5d2bbaa-053c-11de-b17c-0f1ef23b492c"
] | thiago@cruxframework.org@a5d2bbaa-053c-11de-b17c-0f1ef23b492c |
213d63904fdd60c871bc421db5580de503777437 | c0bd30b9543d61c01354dda07b59afc7743b707a | /src/test/java/com/example/LearnABirdServer/LearnABirdServerApplicationTests.java | 523ea22c169edf0b4d7c265c65cf0d551f44b774 | [] | no_license | hiranthaA/LearnABirdServer | 527eeabe8e228dcedd04a8511627430094d94258 | e22072fed9b3669afe7967557d986091219fa7e2 | refs/heads/master | 2020-05-20T05:00:01.829650 | 2019-05-07T12:20:34 | 2019-05-07T12:20:34 | 185,393,730 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.example.LearnABirdServer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class LearnABirdServerApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"hiranthaathapaththu@gmail.com"
] | hiranthaathapaththu@gmail.com |
46d1c1b3254a49e4f30aa6004b3ed90b37741573 | de09f920de3a0a884afa9ef851c9c22db99c9ca6 | /src/main/java/xin/dztyh/personal/SpringAop/ArchivesLogAspect.java | a3f4083ac5ff79b17f8df8b1db0bf83098232d39 | [] | no_license | fluoritess/blogsphere | ee7d24b77001e1e5c9c55822b08b0bb866407bbd | 01e8d651863a02b68a56d843001ec27e91ea6c69 | refs/heads/master | 2020-06-18T19:37:39.239150 | 2019-08-20T13:49:58 | 2019-08-20T13:49:58 | 196,421,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package xin.dztyh.personal.SpringAop;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
import xin.dztyh.personal.util.LogInfo;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
/**
* @author tyh
* @Package xin.dztyh.personal.SpringAop
* @Description:
* @date 19-5-20 下午3:53
*/
@Component
@Aspect
public class ArchivesLogAspect {
private long startTimeMillis = 0; // 开始时间
private long endTimeMillis = 0; // 结束时间
@Pointcut("execution(* xin.dztyh.personal.controller..*Controller.*(..)) && !execution(* xin.dztyh.personal.controller.MainController.get*(..))")
public void userLog(){}
@Before("userLog()")
public void before(){
//记录时间
startTimeMillis=System.currentTimeMillis();
}
@After("userLog()")
public void after(JoinPoint joinPoint){
//获取类名
String targetName=joinPoint.getTarget().getClass().getName();
//获取方法名
String methodName=joinPoint.getSignature().getName();
Object[] arguments=joinPoint.getArgs();
Class targetClass=null;
try {
targetClass=Class.forName(targetName);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
//获得方法列表
Method[] methods=targetClass.getMethods();
String operationName="";
//遍历方法列表,取得方法对象
for(Method method:methods){
if(method.getName().equals(methodName)){
//获得方法的形参类型
Class[] classes=method.getParameterTypes();
//验证是否符合要求
if(classes!=null&&classes.length==arguments.length&&method.getAnnotation(ArchivesLog.class)!=null){
//取得注释
operationName=method.getAnnotation(ArchivesLog.class).operationName();
break;
}
}
}
endTimeMillis=System.currentTimeMillis();
//格式化开始时间
String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startTimeMillis);
//格式化结束时间
String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(endTimeMillis);
LogInfo.logger.info(" 操作方法: "+operationName+" 操作开始时间: "+startTime +" 操作结束时间: "+endTime);
}
}
| [
"dztangyinhao@126.com"
] | dztangyinhao@126.com |
8eca47682ceccef7b803577d52bcaabf92c6db30 | 65eea008ef58ac86559af0d87c8957a0965f56dc | /src/XmlParser.java | 9a0ac440254cc73177199eca7d19170cbd462943 | [] | no_license | mir-jalal/CurrencyConverter | ab8d4c1ce89a470bc38436acb09740564d16baf1 | 279c000c34ec754bf5b89fccf294142870c76903 | refs/heads/master | 2022-11-17T18:44:01.697825 | 2020-07-16T21:33:05 | 2020-07-16T21:33:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,007 | java | import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.Attribute;
import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class XmlParser {
static final String VALUTE = "Valute";
static final String CODE = "Code";
static final String NAME = "Name";
static final String VALUE = "Value";
static final String NOMINAL = "Nominal";
static final String DESCRIPTION = "Description";
static final String VALCURS = "ValCurs";
public List<Currency> readCurrencies(String currencyURL) {
List<Currency> currencies = new ArrayList<Currency>();
try {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
InputStream inputStream = new URL(currencyURL).openStream();
XMLEventReader eventReader = inputFactory.createXMLEventReader(inputStream);
Currency currency = null;
String description = null;
while (eventReader.hasNext()) {
XMLEvent event = eventReader.nextEvent();
if (event.isStartElement()) {
StartElement startElement = event.asStartElement();
String elementName = startElement.getName().getLocalPart();
switch (elementName) {
case VALCURS:
Iterator<Attribute> att = startElement.getAttributes();
while (att.hasNext()) {
Attribute attribute = att.next();
if (attribute.getName().toString().equals(DESCRIPTION)) {
description = attribute.getValue();
}
}
break;
case VALUTE:
currency = new Currency(description);
Iterator<Attribute> attributes = startElement.getAttributes();
while (attributes.hasNext()) {
Attribute attribute = attributes.next();
if (attribute.getName().toString().equals(CODE)) {
currency.setCode(attribute.getValue());
}
}
break;
case NOMINAL:
event = eventReader.nextEvent();
currency.setNominal(event.asCharacters().getData());
break;
case NAME:
event = eventReader.nextEvent();
currency.setName(event.asCharacters().getData());
break;
case VALUE:
event = eventReader.nextEvent();
currency.setChangeRate(event.asCharacters().getData());
break;
}
}
if (event.isEndElement()) {
EndElement endElement = event.asEndElement();
if (endElement.getName().getLocalPart().equals(VALUTE)) {
currencies.add(currency);
}
}
}
} catch (FileNotFoundException | XMLStreamException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return currencies;
}
}
| [
"mircelal99@gmail.com"
] | mircelal99@gmail.com |
e27c0809cb3924bc42f380522948fce165a660f3 | 9873d41fb45ddc470d9471e40981694838b8d0b0 | /app/src/main/java/com/mj/gpsclient/adapter/DeviceAdapter.java | 5067ff4a69b2ef6d80fb1e28e53b14e228bb0de9 | [] | no_license | al0ng/gpsclient | de10a1fa515f50795a648a1b4cb7b1d18eeae3e7 | 2385b25c2dcc12554a624289a0e0c572195a7f9c | refs/heads/master | 2020-12-30T02:13:10.206744 | 2018-01-18T06:47:51 | 2018-01-18T06:47:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,024 | java | package com.mj.gpsclient.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.ImageView;
import android.widget.TextView;
import com.mj.gpsclient.Activity.PubUtil;
import com.mj.gpsclient.R;
import com.mj.gpsclient.Utils.PublicUtils;
import com.mj.gpsclient.global.DebugLog;
import com.mj.gpsclient.model.Devices;
import java.util.ArrayList;
import java.util.List;
public class DeviceAdapter extends BaseAdapter implements Filterable {
public List<Devices> array;
public List<Devices> devicelist;
public Context context;
private LayoutInflater mLayoutInfalater;
private MyFilter mFilter;
private boolean selected;// 是否需要将iv_item_device控件显示
private String Tag = "DeviceAdapter";
public DeviceAdapter(Context Context) {
this.context = Context;
mLayoutInfalater = LayoutInflater.from(Context);
}
public void setOriginalData(List<Devices> List) {
devicelist = List;
}
public void setData(List<Devices> List) {
array = List;
notifyDataSetChanged();
}
public void setLayout(boolean selected) {
this.selected = selected;
}
@Override
public int getCount() {
DebugLog.e("sgsfgdfgdf=");
return array == null ? 0 : array.size();
}
@Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return array.get(arg0);
}
@Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
@Override
public View getView(int arg0, View convertView, ViewGroup arg2) {
ViewHolder viewHolder = null;
final Devices bean = array.get(arg0);
if (convertView == null) {
convertView = mLayoutInfalater.inflate(R.layout.item_list_devices,
null);
viewHolder = new ViewHolder(convertView);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
final ImageView iv_item_device = (ImageView) convertView
.findViewById(R.id.iv_item_device);
if (selected) {// select为true,表示进入编辑状态
// 跟踪列表选择编辑状态
iv_item_device.setVisibility(View.VISIBLE);
iv_item_device.setBackgroundResource(R.drawable.check);
} else {
iv_item_device.setVisibility(View.GONE);
iv_item_device.setBackgroundResource(R.drawable.check);
}
if (!PubUtil.followHash.isEmpty()) {
if (PubUtil.followHash.containsKey(bean.getIMEI())) {
iv_item_device.setBackgroundResource(R.drawable.checked);
} else {
iv_item_device.setBackgroundResource(R.drawable.check);
}
}
if (!PubUtil.split_sHash.isEmpty()) {
if (PubUtil.split_sHash.containsKey(bean.getIMEI())) {
iv_item_device.setBackgroundResource(R.drawable.checked);
} else {
iv_item_device.setBackgroundResource(R.drawable.check);
}
}
if (!PubUtil.followHash2.isEmpty()) {
if (PubUtil.followHash2.containsKey(bean.getIMEI())) {
iv_item_device.setBackgroundResource(R.drawable.checked);
} else {
iv_item_device.setBackgroundResource(R.drawable.check);
}
}
if (!PubUtil.split_sHash2.isEmpty()) {
if (PubUtil.split_sHash2.containsKey(bean.getIMEI())) {
iv_item_device.setBackgroundResource(R.drawable.checked);
} else {
iv_item_device.setBackgroundResource(R.drawable.check);
}
}
Devices devices = array.get(arg0);
if (devices != null) {
viewHolder.mTextName.setText(devices.getName());
if (devices.getLineStatus().equals("离线")) {
viewHolder.mOnoffline.setText("离线");
viewHolder.mHeard.setImageDrawable(context.getResources()
.getDrawable(R.drawable.carofflineimage));
} else {
viewHolder.mOnoffline.setText("在线");
viewHolder.mHeard.setImageDrawable(context.getResources()
.getDrawable(R.drawable.carstaticimage));
}
}
return convertView;
}
static class ViewHolder {
TextView mTextName;
ImageView mHeard;
TextView mOnoffline;
ViewHolder(View view) {
mTextName = (TextView) view.findViewById(R.id.device_name);
mHeard = (ImageView) view.findViewById(R.id.heard_icon);
mOnoffline = (TextView) view.findViewById(R.id.devices_onoffline);
}
}
@Override
public Filter getFilter() {
if (null == mFilter) {
mFilter = new MyFilter();
}
return mFilter;
}
// 自定义Filter类
class MyFilter extends Filter {
@Override
// 该方法在子线程中执行
// 自定义过滤规则
protected FilterResults performFiltering(CharSequence constraint) {
FilterResults results = new FilterResults();
DebugLog.e("performFiltering=" + constraint);
List<Devices> newValues = new ArrayList<Devices>();
String filterString = constraint.toString().trim().toLowerCase();
Log.i(Tag, filterString + "++++++++++++");
newValues.clear();
// 如果搜索框内容为空,就恢复原始数据
if (TextUtils.isEmpty(filterString)) {
newValues.addAll(devicelist);
Log.i(Tag, devicelist.size() + "---------------");
} else {
// 过滤出新数据
for (Devices devices : devicelist) {
// DebugLog.e("devices.getName()=" + devices.getName());
if (-1 != devices.getName().trim().toLowerCase()
.indexOf(filterString)) {
newValues.add(devices);
}
}
}
results.values = newValues;
results.count = newValues.size();
return results;
}
@Override
protected void publishResults(CharSequence constraint,
FilterResults results) {
// devicesList = (List<Devices>) results.values;
array.clear();
array.addAll((List<Devices>) results.values);
array = PublicUtils.SetOrderForDevices(array);
DebugLog.e("publishResults=" + results.count);
notifyDataSetChanged();
}
}
}
| [
"18701403668@163.com"
] | 18701403668@163.com |
e2b73cb04ac02a4121af9ca7205834923e0f5e02 | ab286d8308766b202abce27452919cf972a7730d | /src/com/tony/selene/util/SqliteUtils.java | 8f12a04b5fe68a9462d42f1593b621daa5805d03 | [] | no_license | solaris0403/Selene | 146c538a9ba42bbe98db753d8ca7a831d477d243 | 8de7608887081399475f4c846fda181c791ee4c8 | refs/heads/master | 2021-01-10T21:53:27.317932 | 2015-10-08T09:41:35 | 2015-10-08T09:41:35 | 39,326,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 903 | java | package com.tony.selene.util;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
/**
* SqliteUtils
*
* @author <a href="http://www.trinea.cn" target="_blank">Trinea</a> 2013-10-21
*/
public class SqliteUtils {
private static volatile SqliteUtils instance;
private DbHelper dbHelper;
private SQLiteDatabase db;
private SqliteUtils(Context context) {
dbHelper = new DbHelper(context);
db = dbHelper.getWritableDatabase();
}
public static SqliteUtils getInstance(Context context) {
if (instance == null) {
synchronized (SqliteUtils.class) {
if (instance == null) {
instance = new SqliteUtils(context);
}
}
}
return instance;
}
public SQLiteDatabase getDb() {
return db;
}
}
| [
"tonycao@augmentum.com.cn"
] | tonycao@augmentum.com.cn |
33b8bda890ef53206337b3ed0b754fb809a14bde | 7e86d160d32b8388f6c7094c7b905cffae19d5bb | /src/main/java/br/com/polovinskycode/strategy/Calculator.java | e480253fc56e109507398bacaad424f2ae114810 | [] | no_license | diegorramos/ObjectOriented | ba48fbf2409e21da76de17c6202f54fa58936170 | 5c46ad30f4587bd93b51438a39ea19313b256b47 | refs/heads/master | 2021-05-30T12:23:24.932344 | 2016-02-17T03:16:11 | 2016-02-17T03:16:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 121 | java | package br.com.polovinskycode.strategy;
public interface Calculator {
Long calc(Long numberOne, Long numberTwo);
}
| [
"diegopolovinsky@gmail.com"
] | diegopolovinsky@gmail.com |
1b88748a949aa6712ddc4253ce7f22526cf8a76d | 52abb3f9d6f5747ba9a7abeda455767f524a0898 | /sp/src/main/java/com/sp/web/alexa/coachme/AbstractIntentHander.java | c0d8246c374a7d28bbae8d6df168fc8df7b22776 | [] | no_license | srayapatipolarits/ECSandCFN | 251e474be9e76126bdd9244a480087eb9e28c039 | 1c16f7eebc6856afc47ad712fe7c1d160ffd3e84 | refs/heads/master | 2020-03-17T06:32:43.155453 | 2018-05-01T13:19:34 | 2018-05-01T13:19:34 | 133,360,061 | 1 | 0 | null | 2018-05-14T12:51:34 | 2018-05-14T12:51:34 | null | UTF-8 | Java | false | false | 7,639 | java | package com.sp.web.alexa.coachme;
import com.amazon.speech.slu.Slot;
import com.amazon.speech.speechlet.IntentRequest;
import com.amazon.speech.speechlet.Session;
import com.amazon.speech.speechlet.SpeechletResponse;
import com.amazon.speech.ui.PlainTextOutputSpeech;
import com.amazon.speech.ui.Reprompt;
import com.amazon.speech.ui.SimpleCard;
import com.sp.web.alexa.AlexaIntentHandler;
import com.sp.web.alexa.AlexaIntentType;
import com.sp.web.alexa.SPIntentRequest;
import com.sp.web.alexa.insights.InsightsSteps;
import com.sp.web.model.User;
import com.sp.web.user.UserFactory;
import com.sp.web.utils.MessagesHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import java.util.List;
public abstract class AbstractIntentHander implements AlexaIntentHandler {
private static final Logger log = Logger.getLogger(AbstractIntentHander.class);
@Override
public SpeechletResponse execute(SPIntentRequest intentRequest) {
Session session = intentRequest.getSession();
// validate intent
switch (intentRequest.getAlexaIntentType()) {
case No:
case Yes:
Slot slot = intentRequest.getIntentRequest().getIntent().getSlot("Literal");
String value = slot.getValue();
if (StringUtils.isEmpty(value)
|| !(StringUtils.containsIgnoreCase(value, "absolutely")
|| StringUtils.containsIgnoreCase(value, "of course")
|| StringUtils.containsIgnoreCase(value, "not now")
|| StringUtils.containsIgnoreCase(value, "no thank you")
|| StringUtils.containsIgnoreCase(value, "nope")
|| StringUtils.containsIgnoreCase(value, "no")
|| StringUtils.containsIgnoreCase(value, "yup")
|| StringUtils.containsIgnoreCase(value, "I don't know")
|| StringUtils.containsIgnoreCase(value, "yup")
|| StringUtils.containsIgnoreCase(value, "please") || StringUtils.containsIgnoreCase(
value, "yes"))) {
log.info("Invalid , yes or no intent , slot value " + value);
String speechText = MessagesHelper.getMessage("alexa.yes.no.validate", intentRequest
.getUser().getFirstName());
// Create reprompt
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt);
}
break;
case AskName:
/* check if correct intent is requsted */
switch (intentRequest.getActionType()) {
case CoachMe:
String stepString = (String) session.getAttribute("nextStep");
CoacheMeSteps step;
if (stepString == null) {
step = CoacheMeSteps.WelcomeStep;
session.setAttribute("nextStep", step.toString());
} else {
step = CoacheMeSteps.valueOf(stepString);
}
AlexaIntentType[] intentInocation = step.getIntentInocation();
if (!ArrayUtils.contains(intentInocation, AlexaIntentType.AskName)) {
String speechText = MessagesHelper.getMessage("alexa.yes.no.validate", intentRequest
.getUser().getFirstName());
// Create reprompt
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt);
}
break;
case Insights:
String stepInsightsString = (String) session.getAttribute("nextStep");
InsightsSteps insightStep;
if (stepInsightsString == null) {
insightStep = InsightsSteps.WelcomeStep;
session.setAttribute("nextStep", insightStep.toString());
} else {
insightStep = InsightsSteps.valueOf(stepInsightsString);
}
AlexaIntentType[] intentInsightsInocation = insightStep.getAlexaIntentTypes();
if (!ArrayUtils.contains(intentInsightsInocation, AlexaIntentType.AskName)) {
String speechText = MessagesHelper.getMessage("alexa.yes.no.validate", intentRequest
.getUser().getFirstName());
// Create reprompt
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt);
}
default:
break;
}
default:
break;
}
// Validate correct request.
return executeHandler(intentRequest);
}
/**
* Creates a {@code SpeechletResponse} for the help intent.
*
* @return SpeechletResponse spoken and visual response for the given intent
*/
protected SpeechletResponse getAskCollegueName(Session session, User user) {
String collegeAskCountString = (String) session.getAttribute("nameAskCount");
int collegeAskCount;
if (collegeAskCountString == null) {
collegeAskCount = 1;
} else {
collegeAskCount = Integer.valueOf(collegeAskCountString);
}
String key = "alexa.relationship.welcome.nointent." + collegeAskCount;
if (collegeAskCount < 3) {
collegeAskCount += 1;
}
session.setAttribute("nameAskCount", String.valueOf(collegeAskCount));
String speechText = MessagesHelper.getMessage(key, user.getFirstName());
// Create the Simple card content.
SimpleCard card = new SimpleCard();
card.setTitle("Ask College Name ");
card.setContent(speechText);
// Create the plain text output.
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
// Create reprompt
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
/**
* isFullOrPartialEvent method tells whether the intent is full or partial intent.
*
* @param user
* logged in user.
* @param request
* alexa request.
* @param alexaIntentType
* alexaIntent type.
* @param session
* session.
* @return true or false;
*/
protected boolean isFullOrPartialEvent(User user, final IntentRequest request,
AlexaIntentType alexaIntentType, Session session, UserFactory userFactory) {
switch (alexaIntentType) {
case CoachMe:
case Insights:
case AskName:
Slot slot = request.getIntent().getSlot("Name");
if (slot != null) {
String value = slot.getValue();
if (value == null) {
return false;
}
log.info("check value " + value);
List<User> users = userFactory.findUserByName(value, user.getCompanyId());
log.info("Total users" + users + ",: user " + user.getCompanyId());
if (CollectionUtils.isEmpty(users)) {
return false;
} else if (users.size() > 1) {
return false;
} else {
User user2 = users.get(0);
session.setAttribute("userid", user2.getId());
return true;
}
} else {
return false;
}
default:
return false;
}
}
protected abstract SpeechletResponse executeHandler(SPIntentRequest intentRequest);
}
| [
"root@ip-10-0-1-253.ec2.internal"
] | root@ip-10-0-1-253.ec2.internal |
86bdd5544b9d1b5205280bb153fddd6b917e0729 | 0a78fae5bf256306f9496217d843ff6a2aa27595 | /src/client/MapleBuffStat.java | 694a076bba9d29ab53bea3aeee5ef09f2e3757e2 | [] | no_license | seizethegap/msheroes | e75f17d2613ed91638b33f54faf010ea7ca96c17 | 3d74bd3081cca16f833b74448c1e41ce89766e4b | refs/heads/master | 2022-12-01T01:58:57.257181 | 2020-08-12T20:53:38 | 2020-08-12T20:53:38 | 287,114,351 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,728 | java | package client;
import java.io.Serializable;
import net.LongValueHolder;
public enum MapleBuffStat implements LongValueHolder, Serializable {
MORPH(0x2),
RECOVERY(0x4),
MAPLE_WARRIOR(0x8),
STANCE(0x10),
SHARP_EYES(0x20),
MANA_REFLECTION(0x40),
SHADOW_CLAW(0x100),
INFINITY(0x200),
HOLY_SHIELD(0x400),
HAMSTRING(0x800),
BLIND(0x1000),
CONCENTRATE(0x2000), // another no op buff
ECHO_OF_HERO(0x8000),
GHOST_MORPH(0x20000), // ??? Morphs you into a ghost - no idea what for
MONSTER_RIDING(0x40000000),
WATK(0x100000000L),
WDEF(0x200000000L),
MATK(0x400000000L),
MDEF(0x800000000L),
ACC(0x1000000000L),
AVOID(0x2000000000L),
HANDS(0x4000000000L),
SPEED(0x8000000000L),
JUMP(0x10000000000L),
MAGIC_GUARD(0x20000000000L),
DARKSIGHT(0x40000000000L), // also used by gm hide
BOOSTER(0x80000000000L),
POWERGUARD(0x100000000000L),
HYPERBODYHP(0x200000000000L),
HYPERBODYMP(0x400000000000L),
INVINCIBLE(0x800000000000L),
SOULARROW(0x1000000000000L),
STUN(0x2000000000000L),
POISON(0x4000000000000L),
SEAL(0x8000000000000L),
DARKNESS(0x10000000000000L),
COMBO(0x20000000000000L),
SUMMON(0x20000000000000L), //hack buffstat for summons
WK_CHARGE(0x40000000000000L),
DRAGONBLOOD(0x80000000000000L), // another funny buffstat
HOLY_SYMBOL(0x100000000000000L),
MESOUP(0x200000000000000L),
SHADOWPARTNER(0x400000000000000L),
PICKPOCKET(0x800000000000000L),
PUPPET(0x800000000000000L), // shares buffmask with pickpocket
MESOGUARD(0x1000000000000000L),
WEAKEN(0x4000000000000000L),
DASH(0x30000000),
AURA(0x40000),
;
static final long serialVersionUID = 0L;
private final long i;
private MapleBuffStat(long i) {
this.i = i;
}
@Override
public long getValue() {
return i;
}
}
| [
"phokingandy@gmail.com"
] | phokingandy@gmail.com |
802214ec36af498ff5f9656f9dc46b92e8bd356d | 34f8d4ba30242a7045c689768c3472b7af80909c | /JDK10-Java SE Development Kit 10/src/jdk.localedata/sun/util/resources/cldr/ext/CurrencyNames_seh.java | b5a4743a8c8d3ecaf04ada7400f8d66fb69dc76a | [
"Apache-2.0"
] | permissive | lovelycheng/JDK | 5b4cc07546f0dbfad15c46d427cae06ef282ef79 | 19a6c71e52f3ecd74e4a66be5d0d552ce7175531 | refs/heads/master | 2023-04-08T11:36:22.073953 | 2022-09-04T01:53:09 | 2022-09-04T01:53:09 | 227,544,567 | 0 | 0 | null | 2019-12-12T07:18:30 | 2019-12-12T07:18:29 | null | UTF-8 | Java | false | false | 6,305 | java | /*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* COPYRIGHT AND PERMISSION NOTICE
*
* Copyright (C) 1991-2016 Unicode, Inc. All rights reserved.
* Distributed under the Terms of Use in
* http://www.unicode.org/copyright.html.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of the Unicode data files and any associated documentation
* (the "Data Files") or Unicode software and any associated documentation
* (the "Software") to deal in the Data Files or Software
* without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, and/or sell copies of
* the Data Files or Software, and to permit persons to whom the Data Files
* or Software are furnished to do so, provided that
* (a) this copyright and permission notice appear with all copies
* of the Data Files or Software,
* (b) this copyright and permission notice appear in associated
* documentation, and
* (c) there is clear notice in each modified Data File or in the Software
* as well as in the documentation associated with the Data File(s) or
* Software that the data or software has been modified.
*
* THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
* ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT OF THIRD PARTY RIGHTS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
* NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
* DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THE DATA FILES OR SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in these Data Files or Software without prior
* written authorization of the copyright holder.
*/
package sun.util.resources.cldr.ext;
import sun.util.resources.OpenListResourceBundle;
public class CurrencyNames_seh extends OpenListResourceBundle {
@Override
protected final Object[][] getContents() {
final Object[][] data = new Object[][] {
{ "MZN", "MTn" },
{ "aed", "Dir\u00e9m dos Emirados \u00c1rabes Unidos" },
{ "aoa", "Cuanza angolano" },
{ "aud", "D\u00f3lar australiano" },
{ "bhd", "Dinar bareinita" },
{ "bif", "Franco do Burundi" },
{ "bwp", "Pula botsuanesa" },
{ "cad", "D\u00f3lar canadense" },
{ "cdf", "Franco congol\u00eas" },
{ "chf", "Franco su\u00ed\u00e7o" },
{ "cny", "Yuan Renminbi chin\u00eas" },
{ "cve", "Escudo cabo-verdiano" },
{ "djf", "Franco do Djibuti" },
{ "dzd", "Dinar argelino" },
{ "egp", "Libra eg\u00edpcia" },
{ "ern", "Nakfa da Eritr\u00e9ia" },
{ "etb", "Birr et\u00edope" },
{ "eur", "Euro" },
{ "gbp", "Libra brit\u00e2nica" },
{ "ghc", "Cedi de Gana (1979\u20132007)" },
{ "gmd", "Dalasi de G\u00e2mbia" },
{ "gns", "Syli da Guin\u00e9" },
{ "inr", "R\u00fapia indiana" },
{ "jpy", "Iene japon\u00eas" },
{ "kes", "Xelim queniano" },
{ "kmf", "Franco de Comores" },
{ "lrd", "D\u00f3lar liberiano" },
{ "lsl", "Loti do Lesoto" },
{ "lyd", "Dinar l\u00edbio" },
{ "mad", "Dir\u00e9m marroquino" },
{ "mga", "Franco de Madagascar" },
{ "mro", "Ouguiya da Maurit\u00e2nia" },
{ "mur", "Rupia de Maur\u00edcio" },
{ "mwk", "Cuacha do Mal\u00e1ui" },
{ "mzm", "Metical antigo de Mo\u00e7ambique" },
{ "mzn", "Metical de Mo\u00e7ambique" },
{ "nad", "D\u00f3lar da Nam\u00edbia" },
{ "ngn", "Naira nigeriana" },
{ "rwf", "Franco ruand\u00eas" },
{ "sar", "Rial saudita" },
{ "scr", "Rupia das Seychelles" },
{ "sdg", "Dinar sudan\u00eas" },
{ "sdp", "Libra sudanesa antiga" },
{ "shp", "Libra de Santa Helena" },
{ "sll", "Leone de Serra Leoa" },
{ "sos", "Xelim somali" },
{ "std", "Dobra de S\u00e3o Tom\u00e9 e Pr\u00edncipe" },
{ "szl", "Lilangeni da Suazil\u00e2ndia" },
{ "tnd", "Dinar tunisiano" },
{ "tzs", "Xelim da Tanz\u00e2nia" },
{ "ugx", "Xelim ugandense (1966\u20131987)" },
{ "usd", "D\u00f3lar norte-americano" },
{ "xaf", "Franco CFA BEAC" },
{ "xof", "Franco CFA BCEAO" },
{ "zar", "Rand sul-africano" },
{ "zmk", "Cuacha zambiano (1968\u20132012)" },
{ "zmw", "Cuacha zambiano" },
{ "zwd", "D\u00f3lar do Zimb\u00e1bue" },
};
return data;
}
}
| [
"zeng-dream@live.com"
] | zeng-dream@live.com |
94f46c5eac0b511ceab34615df417468181c8959 | 30a619d2ccfd60d44f8aa8f52be02e1fb98a184c | /Qualyzer_2.0/main/ca.mcgill.cs.swevo.qualyzer/src/ca/mcgill/cs/swevo/qualyzer/providers/CodeBarChart.java | 9a311ff526c38d164cfecea36b64e6fbd703f826 | [] | no_license | hchuphal/Javac | 84ce9bd2a73ec3f6247d9c3ebc29636671b73251 | 130ef558d3f16c6fa7390ef7c2d616fe73bca7fa | refs/heads/master | 2020-09-06T16:26:42.476456 | 2019-12-18T21:46:09 | 2019-12-18T21:46:09 | 220,478,324 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,766 | java | package ca.mcgill.cs.swevo.qualyzer.providers;
import ca.mcgill.cs.swevo.qualyzer.editors.MarkTextAction;
import ca.mcgill.cs.swevo.qualyzer.editors.RTFSourceViewer;
import ca.mcgill.cs.swevo.qualyzer.editors.inputs.CodeEditorInput;
import ca.mcgill.cs.swevo.qualyzer.editors.inputs.CodeTableInput;
import ca.mcgill.cs.swevo.qualyzer.editors.inputs.CodeTableInput.CodeTableRow;
import ca.mcgill.cs.swevo.qualyzer.model.Code;
import ca.mcgill.cs.swevo.qualyzer.model.PersistenceManager;
import ca.mcgill.cs.swevo.qualyzer.model.Project;
import ca.mcgill.cs.swevo.qualyzer.providers.Barchart;
import java.awt.*;
import javax.swing.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.forms.editor.FormEditor;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.awt.event.*;
public class CodeBarChart {
public CodeBarChart(Project project, CodeTableRow[] row) {
JFrame frame = new JFrame();
frame.setSize(600, 500);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation(dim.width/2-frame.getSize().width/2, dim.height/2-frame.getSize().height/2);
double[] codeFrequency = new double[row.length];
String[] codeName = new String[row.length];
Color[] color = new Color [row.length];
//Random random = new Random();
for (int i = 0; i < row.length; i++) {
codeFrequency[i] = row[i].getFrequency();
codeName[i] = row[i].getName();
//float r = random.nextFloat();
//float g = random.nextFloat();
//float b = random.nextFloat();
Code currentCode = row[i].getCode();
ArrayList<Integer> codeColour = RTFSourceViewer.getCodes().get(currentCode);
//Color randomColor = new Color(r, g, b);
//color[i] = randomColor;
if (codeColour != null) {
System.out.println("Not null");
float fR = codeColour.get(0) / 255.0F;
float fG = codeColour.get(1) / 255.0F;
float fB = codeColour.get(2) / 255.0F;
Color randomColor = new Color(fR, fG, fB);
color[i] = randomColor;
} else {
System.out.println("Null");
Color randomColor = new Color(1, 0, 0);
color[i] = randomColor;
}
}
frame.getContentPane().add(new Barchart(codeFrequency, codeName, color, "Code Barchart"));
WindowListener winListener = new WindowAdapter() {
public void windowClosing(WindowEvent event) {
}
};
frame.addWindowListener(winListener);
frame.setVisible(true);
}
}
| [
"himanshu.chuphal07@gmail.com"
] | himanshu.chuphal07@gmail.com |
5dec47698b21c0ea8835ec9c54310d0b1d245b54 | 088f85c0f187697b084e00c924b1c22c54868c1b | /bos-test-1/src/main/java/com/czxy/bos/itextpdf/ITextTest01.java | 0826dd2450852c8ce199da7a9cd46a165e293fce | [] | no_license | sunpeilun/bos | 9dc1d39d7d1ee370ab9ce24e43f4e6fd7865b501 | fee4d42a417081316f61c1ea1132f80867dcb398 | refs/heads/master | 2020-04-07T11:48:27.251432 | 2018-11-20T07:58:07 | 2018-11-20T07:58:07 | 158,341,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 798 | java | package com.czxy.bos.itextpdf;
import com.itextpdf.text.Document;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.File;
import java.io.FileOutputStream;
public class ITextTest01 {
public static void main(String[] args) throws Exception{
//1 创建文档对象
Document document = new Document();
//2 设置输出位置
// 第一个参数:文档数据
// 第二个参数:输出位置
PdfWriter.getInstance(document,new FileOutputStream(new File("d:\\java1.pdf")));
//3 打开文档
document.open();
//4 写入内容
document.add(new Paragraph("czdx,一统江湖,千秋万代,yi tong jiang hu"));
//5 关闭文档
document.close();
}
}
| [
"915315779@qq.com"
] | 915315779@qq.com |
55c2129bbd928e1202ddbd420aa1b75783bac638 | 52f0658086402b602758008a0cfe2c4db5569f67 | /app/src/androidTest/java/fr/esilv/lagrange_nguyen_finalproject/ExampleInstrumentedTest.java | 6db1e8d87ae8cfb0de17fffd849f3cb58fcb4782 | [] | no_license | justinelgr/LAGRANGE_NGUYEN_FinalProject | e61ff0a3840b8a7be14f5b2dd24ba70e6b2bd709 | 18864eac072112078edad746be772a3896a6732e | refs/heads/master | 2021-02-10T13:43:04.911935 | 2020-03-24T22:19:09 | 2020-03-24T22:19:09 | 244,386,968 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 790 | java | package fr.esilv.lagrange_nguyen_finalproject;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("fr.esilv.lagrange_nguyen_finalproject", appContext.getPackageName());
}
}
| [
"jlagrange98@gmail.com"
] | jlagrange98@gmail.com |
55cbd9b345c89837525a350bc32e6bcfbb550226 | a26e3bbcced5dafe2966fa771634dca2b9901827 | /src/main/java/edu/miu/authserver/util/payload/response/UserAccessResponse.java | 4cca6458f6744dfab1070ebeb380a8ad708024b1 | [] | no_license | MintuTF/Authservice-CICD | e3fbd545e7f15cf502f90fab6ff26c037ce106a7 | 022a5e6f04c270d4ad3bfee876de902009a6a8cf | refs/heads/main | 2023-07-17T12:33:47.766502 | 2021-08-31T00:12:13 | 2021-08-31T00:12:13 | 401,151,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 522 | java | package edu.miu.authserver.util.payload.response;
import lombok.Data;
@Data
public class UserAccessResponse {
private long id;
private String username;
private String name;
private String password;
private String email;
// private String role;
public UserAccessResponse(long id,String username, String name, String password, String email) {
this.id=id;
this.username = username;
this.name = name;
this.password = password;
this.email = email;
}
}
| [
"mintefikr4@gmail.com"
] | mintefikr4@gmail.com |
cef42d6a4a35ddc73954ae589bb7d927a402ad4d | 5937ebcce79ee1ce937967597a3e884a27cd7ddd | /src/info/photoorganizer/database/xml/elementhandlers/DatabaseHandler.java | bb79781464bc2a9c4f70c997a8e55521f3f3b158 | [] | no_license | mikaelsvensson/photoorganizer-core | 97cf323d6203a74a35c5863257459ff6b404733f | 462471f7ecb95ee9e6a5df6e5ae35c7edbf5bf91 | refs/heads/master | 2020-12-25T19:03:45.577597 | 2011-10-01T20:03:15 | 2011-10-01T20:03:15 | 1,772,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,774 | java | package info.photoorganizer.database.xml.elementhandlers;
import info.photoorganizer.database.Database;
import info.photoorganizer.database.DatabaseStorageException;
import info.photoorganizer.database.xml.StorageContext;
import info.photoorganizer.database.xml.XMLDatabaseStorageStrategy;
import info.photoorganizer.util.XMLUtilities;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class DatabaseHandler extends DatabaseObjectHandler<Database>
{
private static final String ATTRIBUTENAME_NAME = "name";
public static final String ELEMENTNAME_TAGDEFINITIONS = "TagDefinitions";
public static final String ELEMENTNAME_PHOTOS = "Photos";
public static final String ELEMENTNAME_INDEXINGCONFIGURATIONS = "IndexingConfigurations";
public DatabaseHandler(StorageContext context)
{
super(Database.class, context);
}
@Override
public void readElement(Database o, Element el)
{
o.setName(XMLUtilities.getTextAttribute(el, ATTRIBUTENAME_NAME, "untitled"));
// readTagDefinitionElements(o, el);
// readImageElements(o, el);
// Iterator<KeywordTagDefinition> keywords = _converter.fromElementChildren(el, KeywordTagDefinition.class).iterator();
// if (keywords.hasNext())
// {
// o.setRootKeyword(keywords.next());
// }
super.readElement(o, el);
}
// private void readTagDefinitionElements(Database o, Element el)
// {
// Iterator<TagDefinition> i = _converter.fromElementChildren(XMLUtilities.getNamedChild(el, ELEMENTNAME_TAGDEFINITIONS), TagDefinition.class).iterator();
// while (i.hasNext())
// {
// o.getTagDefinitions().add(i.next());
// }
// }
// private void readImageElements(Database o, Element el)
// {
// Iterator<Image> i = _converter.fromElementChildren(XMLUtilities.getNamedChild(el, ELEMENTNAME_IMAGES), Image.class).iterator();
// while (i.hasNext())
// {
// o.getImages().add(i.next());
// }
// }
@Override
public void writeElement(Database o, Element el)
{
XMLDatabaseStorageStrategy.setUUIDAttribute(el, ATTRIBUTENAME_NAME, o.getId());
Document owner = el.getOwnerDocument();
Element tagDefinitionsEl = createElement(ELEMENTNAME_TAGDEFINITIONS, owner);
el.appendChild(tagDefinitionsEl);
XMLUtilities.appendChildren(tagDefinitionsEl, _context.toElements(o.getTagDefinitions()));
Element keywordTranslatorsEl = createElement(ELEMENTNAME_INDEXINGCONFIGURATIONS, owner);
el.appendChild(keywordTranslatorsEl);
XMLUtilities.appendChildren(keywordTranslatorsEl, _context.toElements(o.getIndexingConfigurations()));
Element imagesEl = createElement(ELEMENTNAME_PHOTOS, owner);
el.appendChild(imagesEl);
XMLUtilities.appendChildren(imagesEl, _context.toElements(o.getPhotos()));
// KeywordTagDefinition rootKeyword = o.getRootKeyword();
// if (null != rootKeyword)
// {
// el.appendChild(_converter.toElement(owner, rootKeyword));
// }
super.writeElement(o, el);
}
@Override
public Database createObject(Element el)
{
return new Database(_context.getStrategy());
}
@Override
public void storeElement(Database o) throws DatabaseStorageException
{
throw new DatabaseStorageException("Feature to store database not implemented. Store each database item, such as keyword definitions and images, separately.");
}
}
| [
"github@mikaelsvensson.info"
] | github@mikaelsvensson.info |
276a6f41b610bf3b69376e46bb2773ad0e5d9afa | 82d520573d0b44c4458c68e21e4ad37707bd99bd | /src/com/gamer/core/service/impl/CollectionServiceImpl.java | cb6658780a6c03925b42483f662ce417c41d2658 | [] | no_license | MrRaindrop8289/RetinaProject | 7b98b7240c963e1d8d1721bf52af912ea9906db0 | e1bca31084268ac55e91c77f291d25f89e4ebf49 | refs/heads/master | 2020-04-23T21:08:58.523385 | 2019-02-19T11:13:14 | 2019-02-19T11:13:14 | 171,460,771 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,602 | java | package com.gamer.core.service.impl;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.gamer.common.utils.DateFormat;
import com.gamer.core.dao.CollectionDao;
import com.gamer.core.dao.PictureDao;
import com.gamer.core.po.*;
import com.gamer.core.service.CollectionService;
@Service("CollectionService")
@Transactional
public class CollectionServiceImpl implements CollectionService {
@Autowired
private CollectionDao dao;
@Autowired
private PictureDao PDao;
@Override
public List<Picture> findAllCollection(Integer UserId) {
// TODO Auto-generated method stub
List<Collections> lPictureId = dao.findAllCollectionByPicture(UserId);
List<Picture> lPicture = new ArrayList<Picture>();
for (Collections i:lPictureId) {
Picture p = this.PDao.findPictureById(i.getPicture_id());
p.setDateS(DateFormat.Transform(i.getDate()));
lPicture.add(p);
}
return lPicture;
}
@Override
public void addCollection(Integer UserId, Integer PictureId) {
// TODO Auto-generated method stub
this.dao.addCollection(UserId, PictureId,new Date());
}
@Override
public void removeCollection(Integer UserId, Integer PictureId) {
// TODO Auto-generated method stub
this.dao.removeCollection(UserId, PictureId);
}
@Override
public List<Integer> findPictureByUserId(Integer userid) {
// TODO Auto-generated method stub
return dao.findPictureByUserId(userid);
}
}
| [
"635880154@qq.com"
] | 635880154@qq.com |
b45d8bf14187c75a28e95a709d5bcbf04b3879ae | dc5189c7f3a89ddc48319a34d977feccb6619227 | /BackendCENS/censbackend/src/main/java/com/cens/backend/censbackend/dto/user/CreateUserRequestDTO.java | 7a70e3d16aca31a265b93acf338eba2163c91b58 | [] | no_license | mauricioandrango/UISRAEL_CENS | f3c8f345ea04b2bc7d3fa2d9fb6e3ae0aeb88a87 | 8374e3296a467e4694d72d4655c0fa24b257d7c4 | refs/heads/master | 2023-03-26T16:34:52.370010 | 2021-03-23T21:26:42 | 2021-03-23T21:26:42 | 350,859,709 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,086 | java | package com.cens.backend.censbackend.dto.user;
import java.io.Serializable;
public class CreateUserRequestDTO implements Serializable {
private static final long serialVersionUID = -1960540553108217628L;
private Integer id;
private String username;
private String password;
private String nombres;
private String apellidos;
private String mail;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getNombres() {
return nombres;
}
public void setNombres(String nombres) {
this.nombres = nombres;
}
public String getApellidos() {
return apellidos;
}
public void setApellidos(String apellidos) {
this.apellidos = apellidos;
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
}
| [
"58314069+mauricioandrango@users.noreply.github.com"
] | 58314069+mauricioandrango@users.noreply.github.com |
f8578bfee3ebdf88240bd62508dfcc4ae08cec89 | fc8f75ad0d09004398e97a29027ab9acda690306 | /ArtistCms/src/main/java/com/artist/cms/jms/WithoutTMJmsConfiguration.java | 473108960bff799eae71fc1368bc08767df25a8a | [] | no_license | hackerbetter/artist | 34dfa19ccacb9558fd0d80d7d55a4549412f9b83 | d512922b3910e67c8412079f226b84bf50c978a3 | refs/heads/master | 2022-12-23T14:04:09.045702 | 2014-10-10T04:24:16 | 2014-10-10T04:24:16 | 19,810,237 | 0 | 0 | null | 2022-12-16T00:39:57 | 2014-05-15T07:22:35 | JavaScript | UTF-8 | Java | false | false | 33,141 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.artist.cms.jms;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.component.jms.*;
import org.apache.camel.util.ObjectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.task.TaskExecutor;
import org.springframework.jms.connection.JmsTransactionManager;
import org.springframework.jms.core.JmsOperations;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import org.springframework.jms.support.converter.MessageConverter;
import org.springframework.jms.support.destination.DestinationResolver;
import org.springframework.transaction.PlatformTransactionManager;
import javax.jms.*;
import static org.apache.camel.component.jms.JmsMessageHelper.normalizeDestinationName;
/**
* @version
*/
public class WithoutTMJmsConfiguration extends JmsConfiguration {
public static final String QUEUE_PREFIX = "queue:";
public static final String TOPIC_PREFIX = "topic:";
public static final String TEMP_QUEUE_PREFIX = "temp:queue:";
public static final String TEMP_TOPIC_PREFIX = "temp:topic:";
private static final transient Logger LOG = LoggerFactory.getLogger(WithoutTMJmsConfiguration.class);
private JmsOperations jmsOperations;
private DestinationResolver destinationResolver;
private ConnectionFactory connectionFactory;
private ConnectionFactory templateConnectionFactory;
private ConnectionFactory listenerConnectionFactory;
private int acknowledgementMode = -1;
private String acknowledgementModeName;
// Used to configure the spring Container
private ExceptionListener exceptionListener;
private boolean autoStartup = true;
private boolean acceptMessagesWhileStopping;
private String clientId;
private String durableSubscriptionName;
private boolean subscriptionDurable;
private boolean exposeListenerSession = true;
private TaskExecutor taskExecutor;
private boolean pubSubNoLocal;
private int concurrentConsumers = 1;
private int maxMessagesPerTask = -1;
private int cacheLevel = -1;
private String cacheLevelName;
private long recoveryInterval = -1;
private long receiveTimeout = -1;
private long requestTimeout = 20000L;
private int idleTaskExecutionLimit = 1;
private int maxConcurrentConsumers;
// JmsTemplate only
private Boolean explicitQosEnabled;
private boolean deliveryPersistent = true;
private boolean replyToDeliveryPersistent = true;
private long timeToLive = -1;
private MessageConverter messageConverter;
private boolean mapJmsMessage = true;
private boolean messageIdEnabled = true;
private boolean messageTimestampEnabled = true;
private int priority = -1;
// Transaction related configuration
private boolean transacted;
private boolean transactedInOut;
private boolean lazyCreateTransactionManager = true;
private PlatformTransactionManager transactionManager;
private String transactionName;
private int transactionTimeout = -1;
private boolean preserveMessageQos;
private boolean disableReplyTo;
private boolean eagerLoadingOfProperties;
// Always make a JMS message copy when it's passed to Producer
private boolean alwaysCopyMessage;
private boolean useMessageIDAsCorrelationID;
private JmsProviderMetadata providerMetadata = new JmsProviderMetadata();
private JmsOperations metadataJmsOperations;
private String replyToDestination;
private String replyToDestinationSelectorName;
private JmsMessageType jmsMessageType;
private JmsKeyFormatStrategy jmsKeyFormatStrategy;
private boolean transferExchange;
private boolean transferException;
private boolean testConnectionOnStartup;
// if the message is a JmsMessage and mapJmsMessage=false, force the
// producer to send the javax.jms.Message body to the next JMS destination
private boolean forceSendOriginalMessage;
// to force disabling time to live (works in both in-only or in-out mode)
private boolean disableTimeToLive;
public WithoutTMJmsConfiguration() {
LOG.info("use WithoutTMJmsConfiguration");
}
public WithoutTMJmsConfiguration(ConnectionFactory connectionFactory) {
this.connectionFactory = connectionFactory;
}
/**
* Returns a copy of this configuration
*/
public JmsConfiguration copy() {
try {
return (JmsConfiguration) clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeCamelException(e);
}
}
/**
* Creates a {@link org.springframework.jms.core.JmsOperations} object used for request/response using a request timeout value
*/
public JmsOperations createInOutTemplate(JmsEndpoint endpoint, boolean pubSubDomain, String destination, long requestTimeout) {
JmsOperations answer = createInOnlyTemplate(endpoint, pubSubDomain, destination);
if (answer instanceof JmsTemplate && requestTimeout > 0) {
JmsTemplate jmsTemplate = (JmsTemplate) answer;
jmsTemplate.setExplicitQosEnabled(true);
// prefer to use timeToLive over requestTimeout if both specified
long ttl = timeToLive > 0 ? timeToLive : requestTimeout;
if (ttl > 0 && !isDisableTimeToLive()) {
// only use TTL if not disabled
jmsTemplate.setTimeToLive(ttl);
}
jmsTemplate.setSessionTransacted(isTransactedInOut());
if (isTransactedInOut()) {
jmsTemplate.setSessionAcknowledgeMode(Session.SESSION_TRANSACTED);
} else {
if (acknowledgementMode >= 0) {
jmsTemplate.setSessionAcknowledgeMode(acknowledgementMode);
} else if (acknowledgementModeName != null) {
jmsTemplate.setSessionAcknowledgeModeName(acknowledgementModeName);
} else {
// default to AUTO
jmsTemplate.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);
}
}
}
return answer;
}
/**
* Creates a {@link org.springframework.jms.core.JmsOperations} object used for one way messaging
*/
public JmsOperations createInOnlyTemplate(JmsEndpoint endpoint, boolean pubSubDomain, String destination) {
if (jmsOperations != null) {
return jmsOperations;
}
ConnectionFactory factory = getTemplateConnectionFactory();
JmsTemplate template = new CamelJmsTemplate(this, factory);
template.setPubSubDomain(pubSubDomain);
if (destinationResolver != null) {
template.setDestinationResolver(destinationResolver);
if (endpoint instanceof DestinationEndpoint) {
LOG.debug("You are overloading the destinationResolver property on a DestinationEndpoint; are you sure you want to do that?");
}
} else if (endpoint instanceof DestinationEndpoint) {
DestinationEndpoint destinationEndpoint = (DestinationEndpoint) endpoint;
template.setDestinationResolver(createDestinationResolver(destinationEndpoint));
}
template.setDefaultDestinationName(destination);
template.setExplicitQosEnabled(isExplicitQosEnabled());
template.setDeliveryPersistent(deliveryPersistent);
if (messageConverter != null) {
template.setMessageConverter(messageConverter);
}
template.setMessageIdEnabled(messageIdEnabled);
template.setMessageTimestampEnabled(messageTimestampEnabled);
if (priority >= 0) {
template.setPriority(priority);
}
template.setPubSubNoLocal(pubSubNoLocal);
if (receiveTimeout >= 0) {
template.setReceiveTimeout(receiveTimeout);
}
// only set TTL if we have a positive value and it has not been disabled
if (timeToLive >= 0 && !isDisableTimeToLive()) {
template.setTimeToLive(timeToLive);
}
template.setSessionTransacted(transacted);
if (transacted) {
template.setSessionAcknowledgeMode(Session.SESSION_TRANSACTED);
} else {
// This is here for completeness, but the template should not get
// used for receiving messages.
if (acknowledgementMode >= 0) {
template.setSessionAcknowledgeMode(acknowledgementMode);
} else if (acknowledgementModeName != null) {
template.setSessionAcknowledgeModeName(acknowledgementModeName);
}
}
return template;
}
public DefaultMessageListenerContainer createMessageListenerContainer(JmsEndpoint endpoint) throws Exception {
DefaultMessageListenerContainer container = new JmsMessageListenerContainer(endpoint);
configureMessageListenerContainer(container, endpoint);
return container;
}
// Properties
// -------------------------------------------------------------------------
public ConnectionFactory getConnectionFactory() {
if (connectionFactory == null) {
connectionFactory = createConnectionFactory();
}
return connectionFactory;
}
/**
* Sets the default connection factory to be used if a connection factory is
* not specified for either
* {@link #setTemplateConnectionFactory(javax.jms.ConnectionFactory)} or
* {@link #setListenerConnectionFactory(javax.jms.ConnectionFactory)}
*
* @param connectionFactory the default connection factory to use
*/
public void setConnectionFactory(ConnectionFactory connectionFactory) {
this.connectionFactory = connectionFactory;
}
public ConnectionFactory getListenerConnectionFactory() {
if (listenerConnectionFactory == null) {
listenerConnectionFactory = createListenerConnectionFactory();
}
return listenerConnectionFactory;
}
/**
* Sets the connection factory to be used for consuming messages
*
* @param listenerConnectionFactory the connection factory to use for
* consuming messages
*/
public void setListenerConnectionFactory(ConnectionFactory listenerConnectionFactory) {
this.listenerConnectionFactory = listenerConnectionFactory;
}
public ConnectionFactory getTemplateConnectionFactory() {
if (templateConnectionFactory == null) {
templateConnectionFactory = createTemplateConnectionFactory();
}
return templateConnectionFactory;
}
/**
* Sets the connection factory to be used for sending messages via the
* {@link org.springframework.jms.core.JmsTemplate} via {@link #createInOnlyTemplate(org.apache.camel.component.jms.JmsEndpoint,boolean, String)}
*
* @param templateConnectionFactory the connection factory for sending messages
*/
public void setTemplateConnectionFactory(ConnectionFactory templateConnectionFactory) {
this.templateConnectionFactory = templateConnectionFactory;
}
public boolean isAutoStartup() {
return autoStartup;
}
public void setAutoStartup(boolean autoStartup) {
this.autoStartup = autoStartup;
}
public boolean isAcceptMessagesWhileStopping() {
return acceptMessagesWhileStopping;
}
public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping) {
this.acceptMessagesWhileStopping = acceptMessagesWhileStopping;
}
public String getClientId() {
return clientId;
}
public void setClientId(String consumerClientId) {
this.clientId = consumerClientId;
}
public String getDurableSubscriptionName() {
return durableSubscriptionName;
}
public void setDurableSubscriptionName(String durableSubscriptionName) {
this.durableSubscriptionName = durableSubscriptionName;
}
public ExceptionListener getExceptionListener() {
return exceptionListener;
}
public void setExceptionListener(ExceptionListener exceptionListener) {
this.exceptionListener = exceptionListener;
}
@Deprecated
public boolean isSubscriptionDurable() {
return subscriptionDurable;
}
@Deprecated
public void setSubscriptionDurable(boolean subscriptionDurable) {
this.subscriptionDurable = subscriptionDurable;
}
public String getAcknowledgementModeName() {
return acknowledgementModeName;
}
public void setAcknowledgementModeName(String consumerAcknowledgementMode) {
this.acknowledgementModeName = consumerAcknowledgementMode;
this.acknowledgementMode = -1;
}
public boolean isExposeListenerSession() {
return exposeListenerSession;
}
public void setExposeListenerSession(boolean exposeListenerSession) {
this.exposeListenerSession = exposeListenerSession;
}
public TaskExecutor getTaskExecutor() {
return taskExecutor;
}
public void setTaskExecutor(TaskExecutor taskExecutor) {
this.taskExecutor = taskExecutor;
}
public boolean isPubSubNoLocal() {
return pubSubNoLocal;
}
public void setPubSubNoLocal(boolean pubSubNoLocal) {
this.pubSubNoLocal = pubSubNoLocal;
}
public int getConcurrentConsumers() {
return concurrentConsumers;
}
public void setConcurrentConsumers(int concurrentConsumers) {
this.concurrentConsumers = concurrentConsumers;
}
public int getMaxMessagesPerTask() {
return maxMessagesPerTask;
}
public void setMaxMessagesPerTask(int maxMessagesPerTask) {
this.maxMessagesPerTask = maxMessagesPerTask;
}
public int getCacheLevel() {
return cacheLevel;
}
public void setCacheLevel(int cacheLevel) {
this.cacheLevel = cacheLevel;
}
public String getCacheLevelName() {
return cacheLevelName;
}
public void setCacheLevelName(String cacheName) {
this.cacheLevelName = cacheName;
}
public long getRecoveryInterval() {
return recoveryInterval;
}
public void setRecoveryInterval(long recoveryInterval) {
this.recoveryInterval = recoveryInterval;
}
public long getReceiveTimeout() {
return receiveTimeout;
}
public void setReceiveTimeout(long receiveTimeout) {
this.receiveTimeout = receiveTimeout;
}
public PlatformTransactionManager getTransactionManager() {
if (transactionManager == null && isTransacted() && isLazyCreateTransactionManager()) {
transactionManager = createTransactionManager();
}
return transactionManager;
}
public void setTransactionManager(PlatformTransactionManager transactionManager) {
this.transactionManager = transactionManager;
}
public String getTransactionName() {
return transactionName;
}
public void setTransactionName(String transactionName) {
this.transactionName = transactionName;
}
public int getTransactionTimeout() {
return transactionTimeout;
}
public void setTransactionTimeout(int transactionTimeout) {
this.transactionTimeout = transactionTimeout;
}
public int getIdleTaskExecutionLimit() {
return idleTaskExecutionLimit;
}
public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit) {
this.idleTaskExecutionLimit = idleTaskExecutionLimit;
}
public int getMaxConcurrentConsumers() {
return maxConcurrentConsumers;
}
public void setMaxConcurrentConsumers(int maxConcurrentConsumers) {
this.maxConcurrentConsumers = maxConcurrentConsumers;
}
public boolean isExplicitQosEnabled() {
return explicitQosEnabled != null ? explicitQosEnabled : false;
}
public void setExplicitQosEnabled(boolean explicitQosEnabled) {
this.explicitQosEnabled = explicitQosEnabled;
}
public boolean isDeliveryPersistent() {
return deliveryPersistent;
}
public void setDeliveryPersistent(boolean deliveryPersistent) {
this.deliveryPersistent = deliveryPersistent;
configuredQoS();
}
public boolean isReplyToDeliveryPersistent() {
return replyToDeliveryPersistent;
}
public void setReplyToDeliveryPersistent(boolean replyToDeliveryPersistent) {
this.replyToDeliveryPersistent = replyToDeliveryPersistent;
}
public long getTimeToLive() {
return timeToLive;
}
public void setTimeToLive(long timeToLive) {
this.timeToLive = timeToLive;
configuredQoS();
}
public MessageConverter getMessageConverter() {
return messageConverter;
}
public void setMessageConverter(MessageConverter messageConverter) {
this.messageConverter = messageConverter;
}
public boolean isMapJmsMessage() {
return mapJmsMessage;
}
public void setMapJmsMessage(boolean mapJmsMessage) {
this.mapJmsMessage = mapJmsMessage;
}
public boolean isMessageIdEnabled() {
return messageIdEnabled;
}
public void setMessageIdEnabled(boolean messageIdEnabled) {
this.messageIdEnabled = messageIdEnabled;
}
public boolean isMessageTimestampEnabled() {
return messageTimestampEnabled;
}
public void setMessageTimestampEnabled(boolean messageTimestampEnabled) {
this.messageTimestampEnabled = messageTimestampEnabled;
}
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
configuredQoS();
}
public int getAcknowledgementMode() {
return acknowledgementMode;
}
public void setAcknowledgementMode(int consumerAcknowledgementMode) {
this.acknowledgementMode = consumerAcknowledgementMode;
this.acknowledgementModeName = null;
}
public boolean isTransacted() {
return transacted;
}
public void setTransacted(boolean consumerTransacted) {
this.transacted = consumerTransacted;
}
/**
* Should InOut operations (request reply) default to using transacted mode?
* <p/>
* By default this is false as you need to commit the outgoing request before you can consume the input
*/
@Deprecated
public boolean isTransactedInOut() {
return transactedInOut;
}
@Deprecated
public void setTransactedInOut(boolean transactedInOut) {
this.transactedInOut = transactedInOut;
}
public boolean isLazyCreateTransactionManager() {
return lazyCreateTransactionManager;
}
public void setLazyCreateTransactionManager(boolean lazyCreating) {
this.lazyCreateTransactionManager = lazyCreating;
}
public boolean isEagerLoadingOfProperties() {
return eagerLoadingOfProperties;
}
/**
* Enables eager loading of JMS properties as soon as a message is loaded
* which generally is inefficient as the JMS properties may not be required
* but sometimes can catch early any issues with the underlying JMS provider
* and the use of JMS properties
*
* @param eagerLoadingOfProperties whether or not to enable eager loading of
* JMS properties on inbound messages
*/
public void setEagerLoadingOfProperties(boolean eagerLoadingOfProperties) {
this.eagerLoadingOfProperties = eagerLoadingOfProperties;
}
public boolean isDisableReplyTo() {
return disableReplyTo;
}
/**
* Disables the use of the JMSReplyTo header for consumers so that inbound
* messages are treated as InOnly rather than InOut requests.
*
* @param disableReplyTo whether or not to disable the use of JMSReplyTo
* header indicating an InOut
*/
public void setDisableReplyTo(boolean disableReplyTo) {
this.disableReplyTo = disableReplyTo;
}
/**
* Set to true if you want to send message using the QoS settings specified
* on the message. Normally the QoS settings used are the one configured on
* this Object.
*/
public void setPreserveMessageQos(boolean preserveMessageQos) {
this.preserveMessageQos = preserveMessageQos;
}
public JmsOperations getJmsOperations() {
return jmsOperations;
}
public void setJmsOperations(JmsOperations jmsOperations) {
this.jmsOperations = jmsOperations;
}
public DestinationResolver getDestinationResolver() {
return destinationResolver;
}
public void setDestinationResolver(DestinationResolver destinationResolver) {
this.destinationResolver = destinationResolver;
}
public JmsProviderMetadata getProviderMetadata() {
return providerMetadata;
}
/**
* Allows the provider metadata to be explicitly configured. Typically this is not required
* and Camel will auto-detect the provider metadata from the underlying provider.
*/
public void setProviderMetadata(JmsProviderMetadata providerMetadata) {
this.providerMetadata = providerMetadata;
}
public JmsOperations getMetadataJmsOperations(JmsEndpoint endpoint) {
if (metadataJmsOperations == null) {
metadataJmsOperations = getJmsOperations();
if (metadataJmsOperations == null) {
metadataJmsOperations = createInOnlyTemplate(endpoint, false, null);
}
}
return metadataJmsOperations;
}
/**
* Sets the {@link org.springframework.jms.core.JmsOperations} used to deduce the {@link org.apache.camel.component.jms.JmsProviderMetadata} details which if none
* is customized one is lazily created on demand
*/
public void setMetadataJmsOperations(JmsOperations metadataJmsOperations) {
this.metadataJmsOperations = metadataJmsOperations;
}
// Implementation methods
// -------------------------------------------------------------------------
public static DestinationResolver createDestinationResolver(final DestinationEndpoint destinationEndpoint) {
return new DestinationResolver() {
public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException {
return destinationEndpoint.getJmsDestination(session);
}
};
}
protected void configureMessageListenerContainer(DefaultMessageListenerContainer container,
JmsEndpoint endpoint) throws Exception {
container.setConnectionFactory(getListenerConnectionFactory());
if (endpoint instanceof DestinationEndpoint) {
container.setDestinationResolver(createDestinationResolver((DestinationEndpoint) endpoint));
} else if (destinationResolver != null) {
container.setDestinationResolver(destinationResolver);
}
container.setAutoStartup(autoStartup);
if (durableSubscriptionName != null) {
container.setDurableSubscriptionName(durableSubscriptionName);
container.setSubscriptionDurable(true);
}
if (clientId != null) {
container.setClientId(clientId);
}
if (exceptionListener != null) {
container.setExceptionListener(exceptionListener);
}
container.setAcceptMessagesWhileStopping(acceptMessagesWhileStopping);
container.setExposeListenerSession(exposeListenerSession);
container.setSessionTransacted(transacted);
if (endpoint.getSelector() != null && endpoint.getSelector().length() != 0) {
container.setMessageSelector(endpoint.getSelector());
}
if (concurrentConsumers >= 0) {
container.setConcurrentConsumers(concurrentConsumers);
}
if (cacheLevel >= 0) {
container.setCacheLevel(cacheLevel);
} else if (cacheLevelName != null) {
container.setCacheLevelName(cacheLevelName);
} else {
container.setCacheLevel(defaultCacheLevel(endpoint));
}
if (idleTaskExecutionLimit >= 0) {
container.setIdleTaskExecutionLimit(idleTaskExecutionLimit);
}
if (maxConcurrentConsumers > 0) {
if (maxConcurrentConsumers < concurrentConsumers) {
throw new IllegalArgumentException("Property maxConcurrentConsumers: " + maxConcurrentConsumers
+ " must be higher than concurrentConsumers: " + concurrentConsumers);
}
container.setMaxConcurrentConsumers(maxConcurrentConsumers);
}
if (maxMessagesPerTask >= 0) {
container.setMaxMessagesPerTask(maxMessagesPerTask);
}
container.setPubSubNoLocal(pubSubNoLocal);
if (receiveTimeout >= 0) {
container.setReceiveTimeout(receiveTimeout);
}
if (recoveryInterval >= 0) {
container.setRecoveryInterval(recoveryInterval);
}
if (taskExecutor != null) {
container.setTaskExecutor(taskExecutor);
}
if (transactionName != null) {
container.setTransactionName(transactionName);
}
if (transactionTimeout >= 0) {
container.setTransactionTimeout(transactionTimeout);
}
}
public void configure(EndpointMessageListener listener) {
if (isDisableReplyTo()) {
listener.setDisableReplyTo(true);
}
if (isEagerLoadingOfProperties()) {
listener.setEagerLoadingOfProperties(true);
}
if (getReplyTo() != null) {
listener.setReplyToDestination(getReplyTo());
}
// TODO: REVISIT: We really ought to change the model and let JmsProducer
// and JmsConsumer have their own JmsConfiguration instance
// This way producer's and consumer's QoS can differ and be
// independently configured
JmsOperations operations = listener.getTemplate();
if (operations instanceof JmsTemplate) {
JmsTemplate template = (JmsTemplate) operations;
template.setDeliveryPersistent(isReplyToDeliveryPersistent());
}
}
/**
* Defaults the JMS cache level if none is explicitly specified.
* <p/>
* Will return <tt>CACHE_AUTO</tt> which will pickup and use <tt>CACHE_NONE</tt>
* if transacted has been enabled, otherwise it will use <tt>CACHE_CONSUMER</tt>
* which is the most efficient.
*
* @param endpoint the endpoint
* @return the cache level
*/
protected int defaultCacheLevel(JmsEndpoint endpoint) {
return DefaultMessageListenerContainer.CACHE_AUTO;
}
/**
* Factory method which allows derived classes to customize the lazy
* creation
*/
protected ConnectionFactory createConnectionFactory() {
ObjectHelper.notNull(connectionFactory, "connectionFactory");
return null;
}
/**
* Factory method which allows derived classes to customize the lazy
* creation
*/
protected ConnectionFactory createListenerConnectionFactory() {
return getConnectionFactory();
}
/**
* Factory method which allows derived classes to customize the lazy
* creation
*/
protected ConnectionFactory createTemplateConnectionFactory() {
return getConnectionFactory();
}
/**
* Factory method which which allows derived classes to customize the lazy
* transcationManager creation
*/
protected PlatformTransactionManager createTransactionManager() {
JmsTransactionManager answer = new JmsTransactionManager();
answer.setConnectionFactory(getConnectionFactory());
return answer;
}
public boolean isPreserveMessageQos() {
return preserveMessageQos;
}
/**
* When one of the QoS properties are configured such as {@link #setDeliveryPersistent(boolean)},
* {@link #setPriority(int)} or {@link #setTimeToLive(long)} then we should auto default the
* setting of {@link #setExplicitQosEnabled(boolean)} if its not been configured yet
*/
protected void configuredQoS() {
if (explicitQosEnabled == null) {
explicitQosEnabled = true;
}
}
public boolean isAlwaysCopyMessage() {
return alwaysCopyMessage;
}
public void setAlwaysCopyMessage(boolean alwaysCopyMessage) {
this.alwaysCopyMessage = alwaysCopyMessage;
}
public boolean isUseMessageIDAsCorrelationID() {
return useMessageIDAsCorrelationID;
}
public void setUseMessageIDAsCorrelationID(boolean useMessageIDAsCorrelationID) {
this.useMessageIDAsCorrelationID = useMessageIDAsCorrelationID;
}
public long getRequestTimeout() {
return requestTimeout;
}
/**
* Sets the timeout in milliseconds which requests should timeout after
*/
public void setRequestTimeout(long requestTimeout) {
this.requestTimeout = requestTimeout;
}
public String getReplyTo() {
return replyToDestination;
}
public void setReplyTo(String replyToDestination) {
this.replyToDestination = normalizeDestinationName(replyToDestination);
}
public String getReplyToDestinationSelectorName() {
return replyToDestinationSelectorName;
}
public void setReplyToDestinationSelectorName(String replyToDestinationSelectorName) {
this.replyToDestinationSelectorName = replyToDestinationSelectorName;
// in case of consumer -> producer and a named replyTo correlation selector
// message pass through is impossible as we need to set the value of selector into
// outgoing message, which would be read-only if pass through were to remain enabled
if (replyToDestinationSelectorName != null) {
setAlwaysCopyMessage(true);
}
}
public JmsMessageType getJmsMessageType() {
return jmsMessageType;
}
public void setJmsMessageType(JmsMessageType jmsMessageType) {
if (jmsMessageType == JmsMessageType.Blob && !supportBlobMessage()) {
throw new IllegalArgumentException("BlobMessage is not supported by this implementation");
}
this.jmsMessageType = jmsMessageType;
}
/**
* Should get overridden by implementations which support BlobMessages
*
* @return false
*/
protected boolean supportBlobMessage() {
return false;
}
public JmsKeyFormatStrategy getJmsKeyFormatStrategy() {
if (jmsKeyFormatStrategy == null) {
jmsKeyFormatStrategy = new DefaultJmsKeyFormatStrategy();
}
return jmsKeyFormatStrategy;
}
public void setJmsKeyFormatStrategy(JmsKeyFormatStrategy jmsKeyFormatStrategy) {
this.jmsKeyFormatStrategy = jmsKeyFormatStrategy;
}
public boolean isTransferExchange() {
return transferExchange;
}
public void setTransferExchange(boolean transferExchange) {
this.transferExchange = transferExchange;
}
public boolean isTransferException() {
return transferException;
}
public void setTransferException(boolean transferException) {
this.transferException = transferException;
}
public boolean isTestConnectionOnStartup() {
return testConnectionOnStartup;
}
public void setTestConnectionOnStartup(boolean testConnectionOnStartup) {
this.testConnectionOnStartup = testConnectionOnStartup;
}
public void setForceSendOriginalMessage(boolean forceSendOriginalMessage) {
this.forceSendOriginalMessage = forceSendOriginalMessage;
}
public boolean isForceSendOriginalMessage() {
return forceSendOriginalMessage;
}
public boolean isDisableTimeToLive() {
return disableTimeToLive;
}
public void setDisableTimeToLive(boolean disableTimeToLive) {
this.disableTimeToLive = disableTimeToLive;
}
}
| [
"zhanghuan@boyacai.com"
] | zhanghuan@boyacai.com |
a2c6635470e2912cf6e4ae46b6d51f3ecab57a6e | 1f90f71802f67bd789d161a352c172d7a81aa9a8 | /lib-app-volley/src/main/java/com/android/volley/toolbox/OkHttpStack.java | 75c96b68c65a5e83f9a1f9925150ab050c688cc1 | [] | no_license | hayukleung/app | c4fd75c6932df6d58eb4d0a4cdade2cd1ae8d4ce | a15962a984d00b712090eac47ddd965c8faa55ff | refs/heads/master | 2021-01-14T02:29:52.201441 | 2017-03-30T09:57:48 | 2017-03-30T09:57:48 | 41,923,161 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,286 | java | package com.android.volley.toolbox;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkTask;
import com.android.volley.http.HttpEntityEnclosingRequest;
import com.android.volley.http.HttpRequestBase;
import com.android.volley.http.HttpResponse;
import com.android.volley.http.entity.Header;
import com.android.volley.http.entity.HttpEntity;
import com.android.volley.http.entity.InputStreamEntity;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactory;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.util.HashMap;
import java.util.Map;
public class OkHttpStack implements HttpStack {
private OkUrlFactory mUrlFactory;
public OkHttpStack() {
mUrlFactory = new OkUrlFactory(new OkHttpClient());
}
@Override
public HttpResponse performRequest(NetworkTask httprequest, Map<String, String> additionalHeaders)
throws IOException, AuthFailureError {
HttpRequestBase request = httprequest.getRequest();
HttpURLConnection connection = mUrlFactory.open(request.getURL());
int timeoutMs = httprequest.getTimeoutMs();
connection.setConnectTimeout(timeoutMs);
connection.setReadTimeout(timeoutMs);
HashMap<String, String> map = new HashMap<String, String>();
map.putAll(additionalHeaders);
map.putAll(httprequest.getHeaders());
for (String headerName : map.keySet()) {
connection.addRequestProperty(headerName, map.get(headerName));
}
connection.setRequestMethod(request.getMethod());
for (Header header : request.getAllHeaders()) {
connection.addRequestProperty(header.getName(), header.getValue());
}
// Stream the request body.
if (request instanceof HttpEntityEnclosingRequest) {
HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
if (entity != null) {
connection.setDoOutput(true);
Header type = entity.getContentType();
if (type != null) {
connection.addRequestProperty(type.getName(), type.getValue());
}
Header encoding = entity.getContentEncoding();
if (encoding != null) {
connection.addRequestProperty(encoding.getName(), encoding.getValue());
}
if (entity.getContentLength() < 0) {
connection.setChunkedStreamingMode(0);
} else if (entity.getContentLength() <= 8192) {
// Buffer short, fixed-length request bodies. This costs memory, but permits the request
// to be transparently retried if there is a connection failure.
connection.addRequestProperty("Content-Length", Long.toString(entity.getContentLength()));
} else {
connection.setFixedLengthStreamingMode((int) entity.getContentLength());
}
entity.writeTo(connection.getOutputStream());
}
}
// Read the response headers.
int responseCode = connection.getResponseCode();
String message = connection.getResponseMessage();
HttpResponse response = new HttpResponse(responseCode, message);
// Get the response body ready to stream.
InputStream responseBody = responseCode < HttpURLConnection.HTTP_BAD_REQUEST ? connection.getInputStream()
: connection.getErrorStream();
InputStreamEntity entity = new InputStreamEntity(responseBody, connection.getContentLength());
for (int i = 0; true; i++) {
String name = connection.getHeaderFieldKey(i);
if (name == null) {
break;
}
Header header = new Header(name, connection.getHeaderField(i));
response.addHeader(header);
if (name.equalsIgnoreCase("Content-Type")) {
entity.setContentType(header);
} else if (name.equalsIgnoreCase("Content-Encoding")) {
entity.setContentEncoding(header);
}
}
response.setEntity(entity);
return response;
}
}
| [
"hayukleung@gmail.com"
] | hayukleung@gmail.com |
f8cb2ee351ac418f3dc7054a92a0dee6ef31bb14 | 72b5fcaf14d5af5f20c19126347d76c752f6b7e1 | /SmartCityPlatform/src/main/java/org/gs1/source/tsd/StringRangeType.java | 18874e41295e612fd5d9fae628fb7188add4d7f5 | [] | no_license | hyeeunzz/smartcity | b836d7abbeb08320fbabb240c943b9ef62057469 | 922774ed1f1523fdc072abe39dc3f71c24b5f7d0 | refs/heads/master | 2021-01-11T02:39:47.670132 | 2017-01-13T02:13:41 | 2017-01-13T02:13:41 | 70,913,693 | 0 | 1 | null | null | null | null | UHC | Java | false | false | 2,477 | java | //
// 이 파일은 JAXB(JavaTM Architecture for XML Binding) 참조 구현 2.2.8-b130911.1802 버전을 통해 생성되었습니다.
// <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>를 참조하십시오.
// 이 파일을 수정하면 소스 스키마를 재컴파일할 때 수정 사항이 손실됩니다.
// 생성 날짜: 2015.07.30 시간 02:38:18 PM KST
//
package org.gs1.source.tsd;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>StringRangeType complex type에 대한 Java 클래스입니다.
*
* <p>다음 스키마 단편이 이 클래스에 포함되는 필요한 콘텐츠를 지정합니다.
*
* <pre>
* <complexType name="StringRangeType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="maximumValue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="minimumValue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "StringRangeType", propOrder = {
"maximumValue",
"minimumValue"
})
public class StringRangeType {
protected String maximumValue;
protected String minimumValue;
/**
* maximumValue 속성의 값을 가져옵니다.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMaximumValue() {
return maximumValue;
}
/**
* maximumValue 속성의 값을 설정합니다.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMaximumValue(String value) {
this.maximumValue = value;
}
/**
* minimumValue 속성의 값을 가져옵니다.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMinimumValue() {
return minimumValue;
}
/**
* minimumValue 속성의 값을 설정합니다.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMinimumValue(String value) {
this.minimumValue = value;
}
}
| [
"ch200234@naver.com"
] | ch200234@naver.com |
19e7349a4aa2e0b199f8821735b3bc5252c419bd | af773926947e79f4135c95fa477e4ce3c7208ceb | /src/main/java/br/com/cinq/spring/data/sample/resource/SampleCountries.java | cab67f70664a48e272004ee599c650ae54824d3f | [] | no_license | gabrielandr/spring-jpa-jersey | bb938e4b45bfb375dc48e59d5ebee86d2d9b54b2 | f959480ca5cec0f2607c18a47977dd5efc1b6def | refs/heads/master | 2020-06-02T20:23:25.402896 | 2017-06-12T14:48:37 | 2017-06-12T14:48:37 | 94,105,477 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,540 | java | package br.com.cinq.spring.data.sample.resource;
import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import br.com.cinq.spring.data.sample.entity.Country;
import br.com.cinq.spring.data.sample.service.CountryService;
/**
* Sample class implementing a Jersey webservice
*
* @author AndradeGabriel
*
*/
@Path("/")
public class SampleCountries {
static Logger logger = LoggerFactory.getLogger(SampleCountries.class);
@Autowired
private CountryService countryService;
@Path("countries")
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response findCities() {
List<Country> result = null;
try {
logger.info("Retrieving countries");
result = countryService.listCountries();
} catch (Exception e) {
logger.error("An exception occurred while retrieving cities", e);
return Response.status(Status.INTERNAL_SERVER_ERROR).entity("exception").build();
}
return Response.ok().entity(result).build();
}
public CountryService getCountryService() {
return countryService;
}
public void setCountryService(CountryService countryService) {
this.countryService = countryService;
}
}
| [
"gabrielandr@gmail.com"
] | gabrielandr@gmail.com |
614913ee549a3b6842b27138c71c891a90e5aa24 | a0b7a10bf03d3062542b45d7f35b43c426ed9fda | /src/ApiJar/src/facturoporti/api/cfdi/EmisorCFDI.java | cda67166b07aabf5495aa55c6370a1b694942e77 | [] | no_license | facturoporti/factura-electronica-Dll-Java-Jar-Api-Rest | 360e06f7d4b56a9a578c298783c8c5d2dceb9949 | 4950520aa056a2df53555ea24ee6e0c8402c4fbc | refs/heads/master | 2021-07-13T11:49:14.248510 | 2021-03-08T18:54:08 | 2021-03-08T18:54:08 | 237,715,288 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 812 | java | package facturoporti.api.cfdi;
import java.util.*;
public class EmisorCFDI
{
private String RFC;
public final String getRFC()
{
return RFC;
}
public final void setRFC(String value)
{
RFC = value;
}
private String NombreRazonSocial;
public final String getNombreRazonSocial()
{
return NombreRazonSocial;
}
public final void setNombreRazonSocial(String value)
{
NombreRazonSocial = value;
}
private String RegimenFiscal;
public final String getRegimenFiscal()
{
return RegimenFiscal;
}
public final void setRegimenFiscal(String value)
{
RegimenFiscal = value;
}
private ArrayList<DireccionCFDI> Direccion;
public final ArrayList<DireccionCFDI> getDireccion()
{
return Direccion;
}
public final void setDireccion(ArrayList<DireccionCFDI> value)
{
Direccion = value;
}
} | [
"aorozco-at-480905434626"
] | aorozco-at-480905434626 |
9e9ef4adeaa6746df97489711c5c32ce9f97c38b | 6732796da80d70456091ec1c3cc1ee9748b97cc5 | /TS/jackson-databind/src/test/java/com/fasterxml/jackson/databind/util/ByteBufferUtilsTest.java | bb713b2875c822874f4d072cf8e6e4a646a8d252 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | nharrand/argo | f88c13a1fb759f44fab6dbc6614de3c0c0554549 | c09fccba668e222a1b349b95d34177b5964e78e1 | refs/heads/main | 2023-08-13T10:39:48.526694 | 2021-10-13T09:40:19 | 2021-10-13T09:40:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,024 | java | package com.fasterxml.jackson.databind.util;
import java.nio.ByteBuffer;
import com.fasterxml.jackson.databind.BaseMapTest;
public class ByteBufferUtilsTest extends BaseMapTest
{
public void testByteBufferInput() throws Exception {
byte[] input = new byte[] { 1, 2, 3 };
ByteBufferBackedInputStream wrapped = new ByteBufferBackedInputStream(ByteBuffer.wrap(input));
//ARGO_PLACEBO
assertEquals(3, wrapped.available());
//ARGO_PLACEBO
assertEquals(1, wrapped.read());
byte[] buffer = new byte[10];
//ARGO_PLACEBO
assertEquals(2, wrapped.read(buffer, 0, 5));
wrapped.close();
}
public void testByteBufferOutput() throws Exception {
ByteBuffer b = ByteBuffer.wrap(new byte[10]);
ByteBufferBackedOutputStream wrappedOut = new ByteBufferBackedOutputStream(b);
wrappedOut.write(1);
wrappedOut.write(new byte[] { 2, 3 });
//ARGO_PLACEBO
assertEquals(3, b.position());
//ARGO_PLACEBO
assertEquals(7, b.remaining());
wrappedOut.close();
}
}
| [
"nicolas.harrand@gmail.com"
] | nicolas.harrand@gmail.com |
db2369056dd4ddc15f8c663ba6e53fdc4ee56f41 | 7426c52f9419c9fede043d31f10aceba1a8a104b | /src/com/tharindu/moodlloid/MessagesFragment.java | e8af0e769f33f53937cf74f7223ca12c95c8cac1 | [] | no_license | TharinduMunasinge/Moodlloid | 98d14b72ef6686a8e5e08213c88d3d474be515dd | 0496ed29dddc0d84fc49d18834404d1fbe579c83 | refs/heads/master | 2016-09-02T09:14:22.924721 | 2014-09-17T21:11:54 | 2014-09-17T21:11:54 | 30,195,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | package com.tharindu.moodlloid;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class MessagesFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View rootView = inflater .inflate(R.layout.explanations_fragment, container, false);
return rootView;
}
}
| [
"munasinghetharindu@gmail.com"
] | munasinghetharindu@gmail.com |
f6ded3f0020190eca7d8e9b6efee74002a9acdf8 | 11708f8be96adefb20eda1d26272b607ca2e38ff | /Spring 12day/Spring-Boot-Communiy-web2/src/main/java/com/kwangmin/domain/User.java | 80ab829c2111dbf50776dfcff6d98d5441fdddd9 | [] | no_license | rhkd4560/Study-SpringBoot | a90538f0bd44f83cc5618ce9e8ac1f3ef391111d | 1552672d8b015a0cb6e610c3fd2cd9612f77f62d | refs/heads/master | 2020-04-15T04:42:08.176736 | 2019-03-12T20:16:24 | 2019-03-12T20:16:24 | 164,392,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 913 | java | package com.kwangmin.domain;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
@Getter
@NoArgsConstructor
@Entity
@Table
public class User implements Serializable {
@Id
@Column
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long idx;
@Column
private String name;
@Column
private String password;
@Column
private String email;
@Column
private LocalDateTime createdDate;
@Column
private LocalDateTime updatedDate;
@Builder
public User(String name, String password, String email, LocalDateTime createdDate, LocalDateTime updatedDate) {
this.name = name;
this.password = password;
this.email = email;
this.createdDate = createdDate;
this.updatedDate = updatedDate;
}
}
| [
"rhkd4560@naver.com"
] | rhkd4560@naver.com |
870c1ad5f3f3c112b5ab6635b01c3e63eed20f4f | f31600ea214d09d8b594b6d97bef9677812f254b | /jan20sec/src/Strings/togglechars.java | 836b39c3b79b48e6d6601eeae54ab9dfce32eebf | [] | no_license | GauravChauhan37/Eclipse | 0272555ed7961d17e647c8d937b778068c8aeec6 | db12d634ea941ef18669df6c988ef569653b2d16 | refs/heads/master | 2020-03-16T21:14:30.985317 | 2018-10-03T03:56:51 | 2018-10-03T03:56:51 | 132,990,516 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package Strings;
import java.util.Scanner;
public class togglechars {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
StringBuilder a = new StringBuilder();
char c;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) >= 'A' && s.charAt(i) <= 'Z') {
c = (char) (s.charAt(i) + 'a' - 'A');
a.append(c);
} else if (s.charAt(i) >= 'a' && s.charAt(i) <= 'z') {
c = (char) (s.charAt(i) + 'A' - 'a');
a.append(c);
}
}
System.out.println(a);
}
}
| [
"Gaurav Chauhan@Gaurav"
] | Gaurav Chauhan@Gaurav |
40f618ccd183d2baad41d7a3ed01ec6dc5af5867 | bc2d8fa7526b5b036f55f94b3704c231662a90e2 | /src/tetris/Tetris.java | 4a4209920d2df70b791733a626aa91ebd6d9be9e | [] | no_license | pepa99/tetris_game | ff94048d16de0e88606c92c9ca5b8d7d81cac6e0 | d1aadad4c9c32e4c28fe081733712d2d94556e23 | refs/heads/main | 2023-01-03T22:38:56.455628 | 2020-11-05T21:08:41 | 2020-11-05T21:08:41 | 310,417,584 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,493 | java | package tetris;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import tetris.Pozicija.Smer;
public class Tetris extends Frame implements ActionListener {
Label poeni=new Label("Ponei: ");
Label figure=new Label("Figura: ");
private Tabla tabla;
private Panel panel;
private Panel p2;
private Button kreni=new Button("Kreni");
private Button stani=new Button("Stani");
private Label xy=new Label("x, y");
private TextField x=new TextField();
private TextField y=new TextField();
private int m=5;
private int n=10;
private boolean utoku;
private Menu akcija=new Menu("Akcija");
public Tetris() {
super("Tetris");
setSize(500,800);
dodajKompon();
addWindowListener(new WindowAdapter () {public void windowClosing(WindowEvent e) {dispose();}});
tabla.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if(e.getKeyCode()==KeyEvent.VK_RIGHT) {
tabla.pomeri(Smer.DESNO);
}
if(e.getKeyCode()==KeyEvent.VK_LEFT) {
tabla.pomeri(Smer.LEVO);
}
if(e.getKeyCode()==KeyEvent.VK_DOWN) {
tabla.pomeri(Smer.DOLE);
}
}
});
setVisible(true);
}
public void dodajKompon() {
panel=new Panel();
panel.setBounds(0, 0, 400, 600);
tabla=new Tabla(10,20);
panel.add(tabla);
add(panel);
p2=new Panel();
figure=tabla.figure;
poeni=tabla.poenil;
p2.add(kreni);
p2.add(poeni);
p2.add(figure);
p2.add(stani);
p2.add(xy);
p2.add(x);
p2.add(y);
MenuBar traka=new MenuBar();
traka.add(akcija);
akcija.add("Nova Igra");
akcija.add("Zavrsi");
akcija.addActionListener(this);
setMenuBar(traka);
x.addActionListener(this);
y.addActionListener(this);
add(p2,"South");
kreni.addActionListener(this);
stani.addActionListener(this);
}
public static void main(String[] args) {
new Tetris();
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==kreni) {
tabla.kreni();
utoku=true;
}
if(e.getSource()==stani) {
tabla.zaustavi();
utoku=false;
}
if(e.getSource()==x) {
if(!utoku) {
m=Integer.parseInt(x.getText());
//tabla.postavim(Integer.parseInt(x.getText()));
}
}
if(e.getSource()==y) {
if(!utoku) {
n=Integer.parseInt(y.getText());
//tabla.postavim(Integer.parseInt(y.getText()));
}
}
if(e.getActionCommand().equals("Nova Igra")) {
panel.remove(tabla);
tabla=new Tabla(m,n);
p2.remove(figure);
p2.remove(poeni);
figure=tabla.figure;
poeni=tabla.poenil;
p2.add(figure);
p2.add(poeni);
panel.add(tabla);
tabla.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if(e.getKeyCode()==KeyEvent.VK_RIGHT) {
tabla.pomeri(Smer.DESNO);
}
if(e.getKeyCode()==KeyEvent.VK_LEFT) {
tabla.pomeri(Smer.LEVO);
}
if(e.getKeyCode()==KeyEvent.VK_DOWN) {
tabla.pomeri(Smer.DOLE);
}
}
});
revalidate();
}
}
}
| [
"pepa1999@bk.ru"
] | pepa1999@bk.ru |
1a3cf3bd1f4adfd23cc68dd16fdd395c2586f052 | 07405736e7393e446cc99c9744eb14fcd5f3dfe9 | /src/main/java/org/aeonbits/owner/Reloadable.java | b0555ff7a9b5be598c438f4e2f88223e685e6ae5 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | mikeChampagne/owner | 7e15bfe64e6f4b38a40105db8d21a8e39e57d127 | 70216f401e6df54455d224e280c043e80bd43055 | refs/heads/master | 2021-01-18T16:40:20.483873 | 2013-09-18T21:42:26 | 2013-09-18T23:14:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,889 | java | /*
* Copyright (c) 2013, Luigi R. Viggiano
* All rights reserved.
*
* This software is distributable under the BSD license.
* See the terms of the BSD license in the documentation provided with this software.
*/
package org.aeonbits.owner;
import org.aeonbits.owner.event.ReloadListener;
/**
* <p>Allows a <tt>Config</tt> object to implement the reloading of the properties at runtime.</p>
*
* <p>Example:</p>
*
* <pre>
* public interface MyConfig extends Config, Reloadable {
* int someProperty();
* }
*
* public void doSomething() {
*
* // loads the properties from the files for the first time.
* MyConfig cfg = ConfigFactory.create(MyConfig.class);
* int before = cfg.someProperty();
*
* // after changing the local files...
* cfg.reload();
* int after = cfg.someProperty();
*
* // before and after may differ now.
* if (before != after) { ... }
* }
* </pre>
*
* <p>The reload method will reload the properties using the same sources used when it was instantiated the first time.
* This can be useful to programmatically reload the configuration after the configuration files were changed.</p>
*
* @author Luigi R. Viggiano
* @since 1.0.4
*/
public interface Reloadable extends Config {
/**
* Reloads the properties using the same logic as when the object was instantiated by {@link
* ConfigFactory#create(Class, java.util.Map[])}.
*
* @since 1.0.4
*/
void reload();
/**
* Add a ReloadListener.
* @param listener the listener to be added
*
* @since 1.0.4
*/
void addReloadListener(ReloadListener listener);
/**
* Remove a ReloadListener.
* @param listener the listener to be removed
*
* @since 1.0.4
*/
void removeReloadListener(ReloadListener listener);
}
| [
"luigi.viggiano@newinstance.it"
] | luigi.viggiano@newinstance.it |
fa23b02948c706f2385f0232b22b0ed260b8aa1e | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/scribejava/2017/12/DefaultApi10a.java | b7167a86e722e0826064b0de653b7f7b6fad3533 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 4,780 | java | package com.github.scribejava.core.builder.api;
import com.github.scribejava.core.extractors.BaseStringExtractor;
import com.github.scribejava.core.extractors.BaseStringExtractorImpl;
import com.github.scribejava.core.extractors.HeaderExtractor;
import com.github.scribejava.core.extractors.HeaderExtractorImpl;
import com.github.scribejava.core.extractors.OAuth1AccessTokenExtractor;
import com.github.scribejava.core.extractors.OAuth1RequestTokenExtractor;
import com.github.scribejava.core.model.OAuthConfig;
import com.github.scribejava.core.model.Verb;
import com.github.scribejava.core.oauth.OAuth10aService;
import com.github.scribejava.core.services.HMACSha1SignatureService;
import com.github.scribejava.core.services.SignatureService;
import com.github.scribejava.core.services.TimestampService;
import com.github.scribejava.core.services.TimestampServiceImpl;
import com.github.scribejava.core.extractors.TokenExtractor;
import com.github.scribejava.core.model.OAuth1AccessToken;
import com.github.scribejava.core.model.OAuth1RequestToken;
/**
* Default implementation of the OAuth protocol, version 1.0a
*
* This class is meant to be extended by concrete implementations of the API, providing the endpoints and
* endpoint-http-verbs.
*
* If your Api adheres to the 1.0a protocol correctly, you just need to extend this class and define the getters for
* your endpoints.
*
* If your Api does something a bit different, you can override the different extractors or services, in order to
* fine-tune the process. Please read the javadocs of the interfaces to get an idea of what to do.
*
*/
public abstract class DefaultApi10a implements BaseApi<OAuth10aService> {
/**
* Returns the access token extractor.
*
* @return access token extractor
*/
public TokenExtractor<OAuth1AccessToken> getAccessTokenExtractor() {
return OAuth1AccessTokenExtractor.instance();
}
/**
* Returns the base string extractor.
*
* @return base string extractor
*/
public BaseStringExtractor getBaseStringExtractor() {
return new BaseStringExtractorImpl();
}
/**
* Returns the header extractor.
*
* @return header extractor
*/
public HeaderExtractor getHeaderExtractor() {
return new HeaderExtractorImpl();
}
/**
* Returns the request token extractor.
*
* @return request token extractor
*/
public TokenExtractor<OAuth1RequestToken> getRequestTokenExtractor() {
return OAuth1RequestTokenExtractor.instance();
}
/**
* Returns the signature service.
*
* @return signature service
*/
public SignatureService getSignatureService() {
return new HMACSha1SignatureService();
}
/**
* @return the signature type, choose between header, querystring, etc. Defaults to Header
*/
public OAuth1SignatureType getSignatureType() {
return OAuth1SignatureType.Header;
}
/**
* Returns the timestamp service.
*
* @return timestamp service
*/
public TimestampService getTimestampService() {
return new TimestampServiceImpl();
}
/**
* Returns the verb for the access token endpoint (defaults to POST)
*
* @return access token endpoint verb
*/
public Verb getAccessTokenVerb() {
return Verb.POST;
}
/**
* Returns the verb for the request token endpoint (defaults to POST)
*
* @return request token endpoint verb
*/
public Verb getRequestTokenVerb() {
return Verb.POST;
}
/**
* Returns the URL that receives the request token requests.
*
* @return request token URL
*/
public abstract String getRequestTokenEndpoint();
/**
* Returns the URL that receives the access token requests.
*
* @return access token URL
*/
public abstract String getAccessTokenEndpoint();
/**
* Returns the URL where you should redirect your users to authenticate your application.
*
* @param requestToken the request token you need to authorize
* @return the URL where you should redirect your users
*/
public abstract String getAuthorizationUrl(OAuth1RequestToken requestToken);
@Override
public OAuth10aService createService(OAuthConfig config) {
return new OAuth10aService(this, config);
}
/**
* http://tools.ietf.org/html/rfc5849 says that "The client MAY omit the empty "oauth_token" protocol parameter from
* the request", but not all oauth servers are good boys.
*
* @return whether to inlcude empty oauth_token param to the request
*/
public boolean isEmptyOAuthTokenParamIsRequired() {
return false;
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
9cc385318b11474e2f3eb6b161b22f1b2f492e54 | 289ccab4d3f159ff8fbd3bb8ade62515c7c6f978 | /fut-desktop-app-backend/fut-domain/src/main/java/com/fut/desktop/app/domain/UserDataInfo.java | edc9cc3baebf02aa33d379ef5076561929df833b | [] | no_license | Majed93/FUT-Desktop-App | 36c39c395332d2a706996a1f06fec110185f9254 | 19e988bf8cd2817a50437bceedf3a28783cef7d6 | refs/heads/master | 2023-02-28T17:11:51.813057 | 2021-02-09T21:10:02 | 2021-02-09T21:10:02 | 284,470,498 | 0 | 1 | null | 2020-08-02T16:26:38 | 2020-08-02T13:48:27 | Java | UTF-8 | Java | false | false | 448 | java | package com.fut.desktop.app.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
@JsonFormat
public class UserDataInfo {
private String displayName;
private String lastLogin;
private String lastLogout;
private String nucPersId;
private String nucUserId;
private List<UserDataInfoSettings> settings;
private String sku;
}
| [
"majed_monem@hotmail.com"
] | majed_monem@hotmail.com |
a66af1a2db1de29b054ebb550cc23921fd5a0c22 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/ExoPlayer/2019/8/ExoMediaDrm.java | ca776267aa83f0561f9982dcb8d6103c44eb59d5 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 8,380 | 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.google.android.exoplayer2.drm;
import android.media.DeniedByServerException;
import android.media.MediaCryptoException;
import android.media.MediaDrm;
import android.media.MediaDrmException;
import android.media.NotProvisionedException;
import android.os.Handler;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.drm.DrmInitData.SchemeData;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* Used to obtain keys for decrypting protected media streams. See {@link android.media.MediaDrm}.
*/
public interface ExoMediaDrm<T extends ExoMediaCrypto> {
/**
* @see MediaDrm#EVENT_KEY_REQUIRED
*/
@SuppressWarnings("InlinedApi")
int EVENT_KEY_REQUIRED = MediaDrm.EVENT_KEY_REQUIRED;
/**
* @see MediaDrm#EVENT_KEY_EXPIRED
*/
@SuppressWarnings("InlinedApi")
int EVENT_KEY_EXPIRED = MediaDrm.EVENT_KEY_EXPIRED;
/**
* @see MediaDrm#EVENT_PROVISION_REQUIRED
*/
@SuppressWarnings("InlinedApi")
int EVENT_PROVISION_REQUIRED = MediaDrm.EVENT_PROVISION_REQUIRED;
/**
* @see MediaDrm#KEY_TYPE_STREAMING
*/
@SuppressWarnings("InlinedApi")
int KEY_TYPE_STREAMING = MediaDrm.KEY_TYPE_STREAMING;
/**
* @see MediaDrm#KEY_TYPE_OFFLINE
*/
@SuppressWarnings("InlinedApi")
int KEY_TYPE_OFFLINE = MediaDrm.KEY_TYPE_OFFLINE;
/**
* @see MediaDrm#KEY_TYPE_RELEASE
*/
@SuppressWarnings("InlinedApi")
int KEY_TYPE_RELEASE = MediaDrm.KEY_TYPE_RELEASE;
/**
* @see android.media.MediaDrm.OnEventListener
*/
interface OnEventListener<T extends ExoMediaCrypto> {
/**
* Called when an event occurs that requires the app to be notified
*
* @param mediaDrm The {@link ExoMediaDrm} object on which the event occurred.
* @param sessionId The DRM session ID on which the event occurred.
* @param event Indicates the event type.
* @param extra A secondary error code.
* @param data Optional byte array of data that may be associated with the event.
*/
void onEvent(
ExoMediaDrm<? extends T> mediaDrm,
@Nullable byte[] sessionId,
int event,
int extra,
@Nullable byte[] data);
}
/**
* @see android.media.MediaDrm.OnKeyStatusChangeListener
*/
interface OnKeyStatusChangeListener<T extends ExoMediaCrypto> {
/**
* Called when the keys in a session change status, such as when the license is renewed or
* expires.
*
* @param mediaDrm The {@link ExoMediaDrm} object on which the event occurred.
* @param sessionId The DRM session ID on which the event occurred.
* @param exoKeyInformation A list of {@link KeyStatus} that contains key ID and status.
* @param hasNewUsableKey Whether a new key became usable.
*/
void onKeyStatusChange(
ExoMediaDrm<? extends T> mediaDrm,
byte[] sessionId,
List<KeyStatus> exoKeyInformation,
boolean hasNewUsableKey);
}
/** @see android.media.MediaDrm.KeyStatus */
final class KeyStatus {
private final int statusCode;
private final byte[] keyId;
public KeyStatus(int statusCode, byte[] keyId) {
this.statusCode = statusCode;
this.keyId = keyId;
}
public int getStatusCode() {
return statusCode;
}
public byte[] getKeyId() {
return keyId;
}
}
/** @see android.media.MediaDrm.KeyRequest */
final class KeyRequest {
private final byte[] data;
private final String licenseServerUrl;
public KeyRequest(byte[] data, String licenseServerUrl) {
this.data = data;
this.licenseServerUrl = licenseServerUrl;
}
public byte[] getData() {
return data;
}
public String getLicenseServerUrl() {
return licenseServerUrl;
}
}
/** @see android.media.MediaDrm.ProvisionRequest */
final class ProvisionRequest {
private final byte[] data;
private final String defaultUrl;
public ProvisionRequest(byte[] data, String defaultUrl) {
this.data = data;
this.defaultUrl = defaultUrl;
}
public byte[] getData() {
return data;
}
public String getDefaultUrl() {
return defaultUrl;
}
}
/**
* @see MediaDrm#setOnEventListener(MediaDrm.OnEventListener)
*/
void setOnEventListener(OnEventListener<? super T> listener);
/**
* @see MediaDrm#setOnKeyStatusChangeListener(MediaDrm.OnKeyStatusChangeListener, Handler)
*/
void setOnKeyStatusChangeListener(OnKeyStatusChangeListener<? super T> listener);
/**
* @see MediaDrm#openSession()
*/
byte[] openSession() throws MediaDrmException;
/**
* @see MediaDrm#closeSession(byte[])
*/
void closeSession(byte[] sessionId);
/**
* Generates a key request.
*
* @param scope If {@code keyType} is {@link #KEY_TYPE_STREAMING} or {@link #KEY_TYPE_OFFLINE},
* the session id that the keys will be provided to. If {@code keyType} is {@link
* #KEY_TYPE_RELEASE}, the keySetId of the keys to release.
* @param schemeDatas If key type is {@link #KEY_TYPE_STREAMING} or {@link #KEY_TYPE_OFFLINE}, a
* list of {@link SchemeData} instances extracted from the media. Null otherwise.
* @param keyType The type of the request. Either {@link #KEY_TYPE_STREAMING} to acquire keys for
* streaming, {@link #KEY_TYPE_OFFLINE} to acquire keys for offline usage, or {@link
* #KEY_TYPE_RELEASE} to release acquired keys. Releasing keys invalidates them for all
* sessions.
* @param optionalParameters Are included in the key request message to allow a client application
* to provide additional message parameters to the server. This may be {@code null} if no
* additional parameters are to be sent.
* @return The generated key request.
* @see MediaDrm#getKeyRequest(byte[], byte[], String, int, HashMap)
*/
KeyRequest getKeyRequest(
byte[] scope,
@Nullable List<SchemeData> schemeDatas,
int keyType,
@Nullable HashMap<String, String> optionalParameters)
throws NotProvisionedException;
/** @see MediaDrm#provideKeyResponse(byte[], byte[]) */
@Nullable
byte[] provideKeyResponse(byte[] scope, byte[] response)
throws NotProvisionedException, DeniedByServerException;
/**
* @see MediaDrm#getProvisionRequest()
*/
ProvisionRequest getProvisionRequest();
/**
* @see MediaDrm#provideProvisionResponse(byte[])
*/
void provideProvisionResponse(byte[] response) throws DeniedByServerException;
/**
* @see MediaDrm#queryKeyStatus(byte[])
*/
Map<String, String> queryKeyStatus(byte[] sessionId);
/**
* @see MediaDrm#release()
*/
void release();
/**
* @see MediaDrm#restoreKeys(byte[], byte[])
*/
void restoreKeys(byte[] sessionId, byte[] keySetId);
/**
* @see MediaDrm#getPropertyString(String)
*/
String getPropertyString(String propertyName);
/**
* @see MediaDrm#getPropertyByteArray(String)
*/
byte[] getPropertyByteArray(String propertyName);
/**
* @see MediaDrm#setPropertyString(String, String)
*/
void setPropertyString(String propertyName, String value);
/**
* @see MediaDrm#setPropertyByteArray(String, byte[])
*/
void setPropertyByteArray(String propertyName, byte[] value);
/**
* @see android.media.MediaCrypto#MediaCrypto(UUID, byte[])
* @param sessionId The DRM session ID.
* @return An object extends {@link ExoMediaCrypto}, using opaque crypto scheme specific data.
* @throws MediaCryptoException If the instance can't be created.
*/
T createMediaCrypto(byte[] sessionId) throws MediaCryptoException;
/** Returns the {@link ExoMediaCrypto} type created by {@link #createMediaCrypto(byte[])}. */
Class<T> getExoMediaCryptoType();
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
2a75a706cde2179d824123d129cf06951fbfc66b | 3e2d9327ea2b56e3e4bad33c1831c979d68087dc | /src/test/java/io/refugeescode/hackboard/web/rest/errors/ExceptionTranslatorIntTest.java | 60f41343ff26cc54d4a5e52ba9ec82e4784c9ca7 | [] | no_license | ImgBotApp/hackboard | 96504cd52faec5beb9aaf8c9623d2a8e485c517b | 85fe78964f0a8606ae90ac1579760b1791b2edda | refs/heads/master | 2021-06-29T18:31:27.626471 | 2018-06-22T11:59:37 | 2018-06-22T11:59:37 | 138,436,233 | 6 | 2 | null | 2020-10-01T15:09:48 | 2018-06-23T21:56:42 | Java | UTF-8 | Java | false | false | 6,513 | java | package io.refugeescode.hackboard.web.rest.errors;
import io.refugeescode.hackboard.HackboardApp;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.zalando.problem.spring.web.advice.MediaTypes;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Test class for the ExceptionTranslator controller advice.
*
* @see ExceptionTranslator
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = HackboardApp.class)
public class ExceptionTranslatorIntTest {
@Autowired
private ExceptionTranslatorTestController controller;
@Autowired
private ExceptionTranslator exceptionTranslator;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
private MockMvc mockMvc;
@Before
public void setup() {
mockMvc = MockMvcBuilders.standaloneSetup(controller)
.setControllerAdvice(exceptionTranslator)
.setMessageConverters(jacksonMessageConverter)
.build();
}
@Test
public void testConcurrencyFailure() throws Exception {
mockMvc.perform(get("/test/concurrency-failure"))
.andExpect(status().isConflict())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE));
}
@Test
public void testMethodArgumentNotValid() throws Exception {
mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION))
.andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO"))
.andExpect(jsonPath("$.fieldErrors.[0].field").value("test"))
.andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull"));
}
@Test
public void testParameterizedError() throws Exception {
mockMvc.perform(get("/test/parameterized-error"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("test parameterized error"))
.andExpect(jsonPath("$.params.param0").value("param0_value"))
.andExpect(jsonPath("$.params.param1").value("param1_value"));
}
@Test
public void testParameterizedError2() throws Exception {
mockMvc.perform(get("/test/parameterized-error2"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("test parameterized error"))
.andExpect(jsonPath("$.params.foo").value("foo_value"))
.andExpect(jsonPath("$.params.bar").value("bar_value"));
}
@Test
public void testMissingServletRequestPartException() throws Exception {
mockMvc.perform(get("/test/missing-servlet-request-part"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("error.http.400"));
}
@Test
public void testMissingServletRequestParameterException() throws Exception {
mockMvc.perform(get("/test/missing-servlet-request-parameter"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("error.http.400"));
}
@Test
public void testAccessDenied() throws Exception {
mockMvc.perform(get("/test/access-denied"))
.andExpect(status().isForbidden())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("error.http.403"))
.andExpect(jsonPath("$.detail").value("test access denied!"));
}
@Test
public void testUnauthorized() throws Exception {
mockMvc.perform(get("/test/unauthorized"))
.andExpect(status().isUnauthorized())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("error.http.401"))
.andExpect(jsonPath("$.path").value("/test/unauthorized"))
.andExpect(jsonPath("$.detail").value("test authentication failed!"));
}
@Test
public void testMethodNotSupported() throws Exception {
mockMvc.perform(post("/test/access-denied"))
.andExpect(status().isMethodNotAllowed())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("error.http.405"))
.andExpect(jsonPath("$.detail").value("Request method 'POST' not supported"));
}
@Test
public void testExceptionWithResponseStatus() throws Exception {
mockMvc.perform(get("/test/response-status"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("error.http.400"))
.andExpect(jsonPath("$.title").value("test response status"));
}
@Test
public void testInternalServerError() throws Exception {
mockMvc.perform(get("/test/internal-server-error"))
.andExpect(status().isInternalServerError())
.andExpect(content().contentType(MediaTypes.PROBLEM))
.andExpect(jsonPath("$.message").value("error.http.500"))
.andExpect(jsonPath("$.title").value("Internal Server Error"));
}
}
| [
"rainer.hahnekamp@gmail.com"
] | rainer.hahnekamp@gmail.com |
d62a42bea809d87ec63f5ed25d936c3a76ee9338 | d4a865d00a85c9192d065f5e49013ffa66a13029 | /app/src/main/java/com/frank/gameoflife/utils/GameConfig.java | d28e0cedfe0de37bc522dc19b32366c007651e7b | [] | no_license | FrankNT/GameOfLife | 774227867c3c6abd8391319ac1780670eab271b7 | f546cb6f6e05bec35e23565627b30e71093f2593 | refs/heads/master | 2021-01-10T17:16:22.276734 | 2016-04-25T16:37:55 | 2016-04-25T16:37:55 | 53,074,482 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | package com.frank.gameoflife.utils;
/**
* Created by TrongPhuc on 2/27/16.
*/
public class GameConfig {
public static final long SLEEP_TIME = 400L;
public static final int WIDTH = 20;
public static final int HEIGHT = 20;
}
| [
"mrtrongphuc@gmail.com"
] | mrtrongphuc@gmail.com |
4a314b30f678fe6eae8f22b5e217cbe3792da3bf | e648967466e2f6f3df17b5ea0139fd19444a9503 | /CNN/src/test/java/testhomepage/TestHomePage.java | 2f40fdb6787f1becf38cfbe36de93b94fb483a4d | [] | no_license | zashuvro/Team-1_WebAutomationFramework | b6c20e273ed5b6279c3c7dba40549c852590c0cb | eb4d30120a393b74afde20c7005f2d300853c947 | refs/heads/master | 2022-07-10T00:08:26.469354 | 2020-02-19T06:56:21 | 2020-02-19T06:56:21 | 238,089,553 | 0 | 0 | null | 2021-04-26T19:56:08 | 2020-02-04T00:18:58 | Java | UTF-8 | Java | false | false | 11,671 | java | package testhomepage;
import common.WebAPI;
import homepage.pageobject.HomePage;
import org.apache.poi.ss.formula.functions.T;
import org.openqa.selenium.support.PageFactory;
import org.testng.annotations.Test;
public class TestHomePage extends HomePage {
public static void initElements (){
PageFactory.initElements(driver, HomePage.class);
}
@Test(priority = 1)
public static void testManuButton() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
}
@Test(priority = 2)
public static void testliveTvButton() throws InterruptedException {
initElements();
clickLiveTvButton();
Thread.sleep(2000);
}
@Test(priority = 3)
public static void testSearchButton() throws InterruptedException {
initElements();
clickSearchButton();
Thread.sleep(2000);
//navigateBack();
}
@Test(priority = 4)
public static void testUSButton() throws InterruptedException {
initElements();
clickUSbutton();
Thread.sleep(2000);
}
@Test(priority = 5)
public static void testWorldButton() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
}
@Test(priority = 6)
public static void testPoliticesbutton() throws InterruptedException {
initElements();
clickPoliticesButton();
Thread.sleep(2000);
}
@Test(priority = 7)
public static void testBusinessButton() throws InterruptedException {
initElements();
clickBusinessButton();
Thread.sleep(2000);
}
@Test(priority = 8)
public static void testOpinionButton() throws InterruptedException {
initElements();
clickOpinionButton();
Thread.sleep(20000);
}
@Test(priority = 9)
public static void testHealthButton() throws InterruptedException {
initElements();
clickHealthButton();
Thread.sleep(2000);
}
@Test(priority = 10)
public static void testEnterteinmentButton() throws InterruptedException {
initElements();
clickEntertenmentButton();
Thread.sleep(2000);
}
@Test(priority = 11)
public static void testStyleButton() throws InterruptedException {
initElements();
clickStyleButton();
Thread.sleep(2000);
}
@Test(priority = 12)
public static void testTravelButton () throws InterruptedException {
initElements();
clickTravelButton();
Thread.sleep(2000);
}
@Test(priority = 13)
public static void testSportsButton() throws InterruptedException {
initElements();
clickSportsButton();
Thread.sleep(2000);
}
@Test(priority = 14)
public static void testVideoButton() throws InterruptedException {
initElements();
clickVideoButton();
Thread.sleep(2000);
}
@Test(priority = 15)
public static void testEditionTab() throws InterruptedException {
initElements();
clickEditionTab();
Thread.sleep(2000);
}
@Test(priority = 16)
public static void testEditionUS() throws InterruptedException {
initElements();
clickEditionTab();
Thread.sleep(2000);
clickEditionUS();
Thread.sleep(2000);
}
@Test(priority = 17)
public static void testEditionInternational() throws InterruptedException {
initElements();
clickEditionTab();
Thread.sleep(2000);
clickEditionInternational();
Thread.sleep(2000);
}
@Test(priority = 18)
public static void testEditionArabic() throws InterruptedException {
initElements();
clickEditionTab();
Thread.sleep(2000);
clickEditionArabic();
Thread.sleep(2000);
}
@Test(priority = 19)
public static void testEditionEspanol() throws InterruptedException {
initElements();
clickEditionTab();
Thread.sleep(200);
clickeditionEspanol();
Thread.sleep(2000);
}
@Test(priority = 20)
public static void testManuButtonSearchBar() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickmanuButtonSearchBar();
}
@Test(priority = 21)
public static void testWorldAfrica() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
clickWorldAfrica();
Thread.sleep(2000);
}
@Test(priority = 22)
public static void testWorldAmericans() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
clickWorldAmericas();
Thread.sleep(2000);
}
@Test(priority = 23)
public static void testWorldAsia() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
clickWorldAsia();
Thread.sleep(2000);
}
@Test(priority = 24)
public static void testWorldAustralia() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
clickWorldAustralia();
Thread.sleep(2000);
}
@Test(priority = 25)
public static void testWorldChina() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
clickWorldChina();
Thread.sleep(2000);
}
@Test(priority = 26)
public static void testWorldEurope() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
clickWorldEurope();
Thread.sleep(2000);
}
@Test(priority = 27)
public static void testWorldIndia() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
cickWorldIndia();
Thread.sleep(2000);
}
@Test(priority = 28)
public static void testWorldMiddleEast() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
clickWorldMiddleEast();
Thread.sleep(2000);
}
@Test(priority = 29)
public static void testWorldUnitedKingdome() throws InterruptedException {
initElements();
clickWorldButton();
Thread.sleep(2000);
clickWrldUnitedKingdome();
Thread.sleep(2000);
}
@Test(priority = 30)
public static void testManuButtonSearchBar1() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickmanuButtonSearchBar1();
Thread.sleep(2000);
}
@Test(priority = 31)
public static void testManuButtonSearchBar2() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickmanuButtonSearchBar2();
Thread.sleep(2000);
}
@Test(priority = 32)
public static void testManuButtonSearchBar3() throws InterruptedException {
initElements();
//scrollUpDown(2800);
clickManuButton();
Thread.sleep(2000);
//scrollUpDown(-2800);
clickmanuButtonSearchBar3();
Thread.sleep(2000);
}
@Test(priority = 33)
public static void testManuBarSearchBar4() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickManuButtonsearchBar4();
Thread.sleep(2000);
}
@Test(priority = 34)
public static void testBoxOfFooterStyle() throws InterruptedException {
initElements();
scrollUpDown(4000);
listOfBoxFooterStyle();
Thread.sleep(3000);
System.out.println(getBoxOfFooterStyle().getText());
}
@Test(priority = 35)
public static void testBoxOfHeadderStyle() throws InterruptedException {
initElements();
checkAndListOfBoxHeadderStyle();
Thread.sleep(2000);
System.out.println(getBoxOfHeadderStyle().getText());
}
@Test(priority = 36)
public static void testFooterBoxInUSBox() throws InterruptedException {
initElements();
scrollUpDown(4000);
listOFFooterBoxInUS();
Thread.sleep(2000);
System.out.println(getFooterBoxInUSbox().getText());
}
@Test(priority = 37)
public static void testmanuBarUSCrimeJastic() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickmanuBarUSCrimeJastic();
Thread.sleep(200);
}
@Test(priority = 38)
public static void testmanuBUSEnergyEnviroment() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickmanuBUSEnergyEnviroment();
Thread.sleep(2000);
}
@Test(priority = 39)
public static void testManubarFood() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickManubarFood();
Thread.sleep(2000);
}
@Test(priority = 40)
public static void testManubar45() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickmanuBar45();
Thread.sleep(2000);
}
@Test(priority = 41)
public static void tesMnueBarCNNStore() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickmanubarCNNStore();
Thread.sleep(2000);
}
@Test(priority = 42)
public static void testmanuBarPhotos() throws InterruptedException {
initElements();
clickManuButton();
Thread.sleep(2000);
clickmanuBarPhotos();
Thread.sleep(2000);
}
@Test(priority = 43)
public static void testlastFooterBox() throws InterruptedException {
initElements();
scrollUpDown(4800);
Thread.sleep(2000);
seelastFooterBox();
System.out.println(getLastFooterBox().getText());
}
@Test(priority = 44)
public static void testcnnLinklist() throws InterruptedException {
initElements();
//scrollUpDown(4800);
//Thread.sleep(2000);
seecnnLinklist();
Thread.sleep(2000);
System.out.println(getCnnLinklist().getText());
}
@Test(priority = 45)
public static void testlinkStyleTearm() throws InterruptedException {
initElements();
//scrollUpDown(4800);
seecnnLinklist();
Thread.sleep(2000);
clicklinkStyleTearm();
Thread.sleep(2000);
}
@Test(priority = 46)
public static void testlinkStylePrivecy(){
initElements();
scrollUpDown(4800);
getLinkStylePrivecy().click();
}
@Test(priority = 47)
public static void testlinkFoNotSellMyPersonalStuff(){
initElements();
scrollUpDown(4800);
getLinkFoNotSellMyPersonalStuff().click();
}
@Test(priority = 48)
public static void testlinkAddChoic() throws InterruptedException {
initElements();
scrollUpDown(4800);
clicklinkAddChoic();
Thread.sleep(2000);
}
@Test(priority = 49)
public static void testlinkAboutUs() throws InterruptedException {
initElements();
scrollUpDown(4800);
clicklinkAboutUs();
Thread.sleep(2000);
}
@Test(priority = 50)
public static void testlinkLicenceFotege() throws InterruptedException {
initElements();
scrollUpDown(4800);
clicklinkLicenceFotege();
Thread.sleep(2000);
}
}
| [
"mdshuvro0183@gmail.com"
] | mdshuvro0183@gmail.com |
1f83cd06fb02b09f8c9e4c35fc497d75ef494ffa | fb62880dab2320a60c408e319a87edc9ee9412c2 | /app/src/main/java/orders/appup_kw/newsapp/adaper/ViewPagerAdapter.java | b36b601be59c104925a37f5ab409f887226f73d5 | [] | no_license | Danila-software-engineer/News-app | af0b3d45ff48141e5b910ce72017828ea7b48eb1 | b152296571a6df6c16fef5faa1f16c0be1b67978 | refs/heads/master | 2023-02-25T23:08:56.526573 | 2021-01-28T12:56:10 | 2021-01-28T12:56:10 | 332,864,125 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package orders.appup_kw.newsapp.adaper;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import java.util.List;
import orders.appup_kw.newsapp.fragment.ScreenSlidePageFragment;
public class ViewPagerAdapter extends FragmentStatePagerAdapter {
List<String> imageList;
public ViewPagerAdapter(FragmentManager fm, int amount, List<String> imageList) {
super(fm, amount);
this.imageList = imageList;
}
@Override
public Fragment getItem(int position) {
return ScreenSlidePageFragment.launchFragment(imageList.get(position));
}
@Override
public int getCount() {
return imageList.size();
}
}
| [
"dendor0101@gmail.com"
] | dendor0101@gmail.com |
72ce1725f5c681810419da33d84a1e6fce2823a4 | 3ff8a408c819e39ef41caedc2553de148bd66af1 | /SDK MODIFICADAS/ICueSDKCorsair/src/ca/fiercest/cuesdk/enums/LedId.java | e6d6a098c5d73157b4fe5b7583eeef27a7490143 | [] | no_license | claudineiw/RGB-Sync | 4ade3b3cf0aa76e739c95816750d94e3196a646c | a25bd024aa12c9c883454c3cee567834a588410f | refs/heads/master | 2023-05-08T05:05:19.304364 | 2021-05-29T00:17:07 | 2021-05-29T00:17:07 | 351,955,378 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 28,417 | java | package ca.fiercest.cuesdk.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public enum LedId
{
CLI_Invalid(0),
CLK_Escape(1),
CLK_F1(2),
CLK_F2(3),
CLK_F3(4),
CLK_F4(5),
CLK_F5(6),
CLK_F6(7),
CLK_F7(8),
CLK_F8(9),
CLK_F9(10),
CLK_F10(11),
CLK_F11(12),
CLK_GraveAccentAndTilde(13),
CLK_1(14),
CLK_2(15),
CLK_3(16),
CLK_4(17),
CLK_5(18),
CLK_6(19),
CLK_7(20),
CLK_8(21),
CLK_9(22),
CLK_0(23),
CLK_MinusAndUnderscore(24),
CLK_Tab(25),
CLK_Q(26),
CLK_W(27),
CLK_E(28),
CLK_R(29),
CLK_T(30),
CLK_Y(31),
CLK_U(32),
CLK_I(33),
CLK_O(34),
CLK_P(35),
CLK_BracketLeft(36),
CLK_CapsLock(37),
CLK_A(38),
CLK_S(39),
CLK_D(40),
CLK_F(41),
CLK_G(42),
CLK_H(43),
CLK_J(44),
CLK_K(45),
CLK_L(46),
CLK_SemicolonAndColon(47),
CLK_ApostropheAndDoubleQuote(48),
CLK_LeftShift(49),
CLK_NonUsBackslash(50),
CLK_Z(51),
CLK_X(52),
CLK_C(53),
CLK_V(54),
CLK_B(55),
CLK_N(56),
CLK_M(57),
CLK_CommaAndLessThan(58),
CLK_PeriodAndBiggerThan(59),
CLK_SlashAndQuestionMark(60),
CLK_LeftCtrl(61),
CLK_LeftGui(62),
CLK_LeftAlt(63),
CLK_Lang2(64),
CLK_Space(65),
CLK_Lang1(66),
CLK_International2(67),
CLK_RightAlt(68),
CLK_RightGui(69),
CLK_Application(70),
CLK_LedProgramming(71),
CLK_Brightness(72),
CLK_F12(73),
CLK_PrintScreen(74),
CLK_ScrollLock(75),
CLK_PauseBreak(76),
CLK_Insert(77),
CLK_Home(78),
CLK_PageUp(79),
CLK_BracketRight(80),
CLK_Backslash(81),
CLK_NonUsTilde(82),
CLK_Enter(83),
CLK_International1(84),
CLK_EqualsAndPlus(85),
CLK_International3(86),
CLK_Backspace(87),
CLK_Delete(88),
CLK_End(89),
CLK_PageDown(90),
CLK_RightShift(91),
CLK_RightCtrl(92),
CLK_UpArrow(93),
CLK_LeftArrow(94),
CLK_DownArrow(95),
CLK_RightArrow(96),
CLK_WinLock(97),
CLK_Mute(98),
CLK_Stop(99),
CLK_ScanPreviousTrack(100),
CLK_PlayPause(101),
CLK_ScanNextTrack(102),
CLK_NumLock(103),
CLK_KeypadSlash(104),
CLK_KeypadAsterisk(105),
CLK_KeypadMinus(106),
CLK_KeypadPlus(107),
CLK_KeypadEnter(108),
CLK_Keypad7(109),
CLK_Keypad8(110),
CLK_Keypad9(111),
CLK_KeypadComma(112),
CLK_Keypad4(113),
CLK_Keypad5(114),
CLK_Keypad6(115),
CLK_Keypad1(116),
CLK_Keypad2(117),
CLK_Keypad3(118),
CLK_Keypad0(119),
CLK_KeypadPeriodAndDelete(120),
CLK_G1(121),
CLK_G2(122),
CLK_G3(123),
CLK_G4(124),
CLK_G5(125),
CLK_G6(126),
CLK_G7(127),
CLK_G8(128),
CLK_G9(129),
CLK_G10(130),
CLK_VolumeUp(131),
CLK_VolumeDown(132),
CLK_MR(133),
CLK_M1(134),
CLK_M2(135),
CLK_M3(136),
CLK_G11(137),
CLK_G12(138),
CLK_G13(139),
CLK_G14(140),
CLK_G15(141),
CLK_G16(142),
CLK_G17(143),
CLK_G18(144),
CLK_International5(145),
CLK_International4(146),
CLK_Fn(147),
CLM_1(148),
CLM_2(149),
CLM_3(150),
CLM_4(151),
CLH_LeftLogo(152),
CLH_RightLogo(153),
CLK_Logo(154),
CLMM_Zone1(155),
CLMM_Zone2(156),
CLMM_Zone3(157),
CLMM_Zone4(158),
CLMM_Zone5(159),
CLMM_Zone6(160),
CLMM_Zone7(161),
CLMM_Zone8(162),
CLMM_Zone9(163),
CLMM_Zone10(164),
CLMM_Zone11(165),
CLMM_Zone12(166),
CLMM_Zone13(167),
CLMM_Zone14(168),
CLMM_Zone15(169),
CLKLP_Zone1(170),
CLKLP_Zone2(171),
CLKLP_Zone3(172),
CLKLP_Zone4(173),
CLKLP_Zone5(174),
CLKLP_Zone6(175),
CLKLP_Zone7(176),
CLKLP_Zone8(177),
CLKLP_Zone9(178),
CLKLP_Zone10(179),
CLKLP_Zone11(180),
CLKLP_Zone12(181),
CLKLP_Zone13(182),
CLKLP_Zone14(183),
CLKLP_Zone15(184),
CLKLP_Zone16(185),
CLKLP_Zone17(186),
CLKLP_Zone18(187),
CLKLP_Zone19(188),
CLM_5(189),
CLM_6(190),
CLHSS_Zone1(191),
CLHSS_Zone2(192),
CLHSS_Zone3(193),
CLHSS_Zone4(194),
CLHSS_Zone5(195),
CLHSS_Zone6(196),
CLHSS_Zone7(197),
CLHSS_Zone8(198),
CLHSS_Zone9(199),
CLD_C1_1(200),
CLD_C1_2(201),
CLD_C1_3(202),
CLD_C1_4(203),
CLD_C1_5(204),
CLD_C1_6(205),
CLD_C1_7(206),
CLD_C1_8(207),
CLD_C1_9(208),
CLD_C1_10(209),
CLD_C1_11(210),
CLD_C1_12(211),
CLD_C1_13(212),
CLD_C1_14(213),
CLD_C1_15(214),
CLD_C1_16(215),
CLD_C1_17(216),
CLD_C1_18(217),
CLD_C1_19(218),
CLD_C1_20(219),
CLD_C1_21(220),
CLD_C1_22(221),
CLD_C1_23(222),
CLD_C1_24(223),
CLD_C1_25(224),
CLD_C1_26(225),
CLD_C1_27(226),
CLD_C1_28(227),
CLD_C1_29(228),
CLD_C1_30(229),
CLD_C1_31(230),
CLD_C1_32(231),
CLD_C1_33(232),
CLD_C1_34(233),
CLD_C1_35(234),
CLD_C1_36(235),
CLD_C1_37(236),
CLD_C1_38(237),
CLD_C1_39(238),
CLD_C1_40(239),
CLD_C1_41(240),
CLD_C1_42(241),
CLD_C1_43(242),
CLD_C1_44(243),
CLD_C1_45(244),
CLD_C1_46(245),
CLD_C1_47(246),
CLD_C1_48(247),
CLD_C1_49(248),
CLD_C1_50(249),
CLD_C1_51(250),
CLD_C1_52(251),
CLD_C1_53(252),
CLD_C1_54(253),
CLD_C1_55(254),
CLD_C1_56(255),
CLD_C1_57(256),
CLD_C1_58(257),
CLD_C1_59(258),
CLD_C1_60(259),
CLD_C1_61(260),
CLD_C1_62(261),
CLD_C1_63(262),
CLD_C1_64(263),
CLD_C1_65(264),
CLD_C1_66(265),
CLD_C1_67(266),
CLD_C1_68(267),
CLD_C1_69(268),
CLD_C1_70(269),
CLD_C1_71(270),
CLD_C1_72(271),
CLD_C1_73(272),
CLD_C1_74(273),
CLD_C1_75(274),
CLD_C1_76(275),
CLD_C1_77(276),
CLD_C1_78(277),
CLD_C1_79(278),
CLD_C1_80(279),
CLD_C1_81(280),
CLD_C1_82(281),
CLD_C1_83(282),
CLD_C1_84(283),
CLD_C1_85(284),
CLD_C1_86(285),
CLD_C1_87(286),
CLD_C1_88(287),
CLD_C1_89(288),
CLD_C1_90(289),
CLD_C1_91(290),
CLD_C1_92(291),
CLD_C1_93(292),
CLD_C1_94(293),
CLD_C1_95(294),
CLD_C1_96(295),
CLD_C1_97(296),
CLD_C1_98(297),
CLD_C1_99(298),
CLD_C1_100(299),
CLD_C1_101(300),
CLD_C1_102(301),
CLD_C1_103(302),
CLD_C1_104(303),
CLD_C1_105(304),
CLD_C1_106(305),
CLD_C1_107(306),
CLD_C1_108(307),
CLD_C1_109(308),
CLD_C1_110(309),
CLD_C1_111(310),
CLD_C1_112(311),
CLD_C1_113(312),
CLD_C1_114(313),
CLD_C1_115(314),
CLD_C1_116(315),
CLD_C1_117(316),
CLD_C1_118(317),
CLD_C1_119(318),
CLD_C1_120(319),
CLD_C1_121(320),
CLD_C1_122(321),
CLD_C1_123(322),
CLD_C1_124(323),
CLD_C1_125(324),
CLD_C1_126(325),
CLD_C1_127(326),
CLD_C1_128(327),
CLD_C1_129(328),
CLD_C1_130(329),
CLD_C1_131(330),
CLD_C1_132(331),
CLD_C1_133(332),
CLD_C1_134(333),
CLD_C1_135(334),
CLD_C1_136(335),
CLD_C1_137(336),
CLD_C1_138(337),
CLD_C1_139(338),
CLD_C1_140(339),
CLD_C1_141(340),
CLD_C1_142(341),
CLD_C1_143(342),
CLD_C1_144(343),
CLD_C1_145(344),
CLD_C1_146(345),
CLD_C1_147(346),
CLD_C1_148(347),
CLD_C1_149(348),
CLD_C1_150(349),
CLD_C2_1(350),
CLD_C2_2(351),
CLD_C2_3(352),
CLD_C2_4(353),
CLD_C2_5(354),
CLD_C2_6(355),
CLD_C2_7(356),
CLD_C2_8(357),
CLD_C2_9(358),
CLD_C2_10(359),
CLD_C2_11(360),
CLD_C2_12(361),
CLD_C2_13(362),
CLD_C2_14(363),
CLD_C2_15(364),
CLD_C2_16(365),
CLD_C2_17(366),
CLD_C2_18(367),
CLD_C2_19(368),
CLD_C2_20(369),
CLD_C2_21(370),
CLD_C2_22(371),
CLD_C2_23(372),
CLD_C2_24(373),
CLD_C2_25(374),
CLD_C2_26(375),
CLD_C2_27(376),
CLD_C2_28(377),
CLD_C2_29(378),
CLD_C2_30(379),
CLD_C2_31(380),
CLD_C2_32(381),
CLD_C2_33(382),
CLD_C2_34(383),
CLD_C2_35(384),
CLD_C2_36(385),
CLD_C2_37(386),
CLD_C2_38(387),
CLD_C2_39(388),
CLD_C2_40(389),
CLD_C2_41(390),
CLD_C2_42(391),
CLD_C2_43(392),
CLD_C2_44(393),
CLD_C2_45(394),
CLD_C2_46(395),
CLD_C2_47(396),
CLD_C2_48(397),
CLD_C2_49(398),
CLD_C2_50(399),
CLD_C2_51(400),
CLD_C2_52(401),
CLD_C2_53(402),
CLD_C2_54(403),
CLD_C2_55(404),
CLD_C2_56(405),
CLD_C2_57(406),
CLD_C2_58(407),
CLD_C2_59(408),
CLD_C2_60(409),
CLD_C2_61(410),
CLD_C2_62(411),
CLD_C2_63(412),
CLD_C2_64(413),
CLD_C2_65(414),
CLD_C2_66(415),
CLD_C2_67(416),
CLD_C2_68(417),
CLD_C2_69(418),
CLD_C2_70(419),
CLD_C2_71(420),
CLD_C2_72(421),
CLD_C2_73(422),
CLD_C2_74(423),
CLD_C2_75(424),
CLD_C2_76(425),
CLD_C2_77(426),
CLD_C2_78(427),
CLD_C2_79(428),
CLD_C2_80(429),
CLD_C2_81(430),
CLD_C2_82(431),
CLD_C2_83(432),
CLD_C2_84(433),
CLD_C2_85(434),
CLD_C2_86(435),
CLD_C2_87(436),
CLD_C2_88(437),
CLD_C2_89(438),
CLD_C2_90(439),
CLD_C2_91(440),
CLD_C2_92(441),
CLD_C2_93(442),
CLD_C2_94(443),
CLD_C2_95(444),
CLD_C2_96(445),
CLD_C2_97(446),
CLD_C2_98(447),
CLD_C2_99(448),
CLD_C2_100(449),
CLD_C2_101(450),
CLD_C2_102(451),
CLD_C2_103(452),
CLD_C2_104(453),
CLD_C2_105(454),
CLD_C2_106(455),
CLD_C2_107(456),
CLD_C2_108(457),
CLD_C2_109(458),
CLD_C2_110(459),
CLD_C2_111(460),
CLD_C2_112(461),
CLD_C2_113(462),
CLD_C2_114(463),
CLD_C2_115(464),
CLD_C2_116(465),
CLD_C2_117(466),
CLD_C2_118(467),
CLD_C2_119(468),
CLD_C2_120(469),
CLD_C2_121(470),
CLD_C2_122(471),
CLD_C2_123(472),
CLD_C2_124(473),
CLD_C2_125(474),
CLD_C2_126(475),
CLD_C2_127(476),
CLD_C2_128(477),
CLD_C2_129(478),
CLD_C2_130(479),
CLD_C2_131(480),
CLD_C2_132(481),
CLD_C2_133(482),
CLD_C2_134(483),
CLD_C2_135(484),
CLD_C2_136(485),
CLD_C2_137(486),
CLD_C2_138(487),
CLD_C2_139(488),
CLD_C2_140(489),
CLD_C2_141(490),
CLD_C2_142(491),
CLD_C2_143(492),
CLD_C2_144(493),
CLD_C2_145(494),
CLD_C2_146(495),
CLD_C2_147(496),
CLD_C2_148(497),
CLD_C2_149(498),
CLD_C2_150(499),
CLI_Oem1(500),
CLI_Oem2(501),
CLI_Oem3(502),
CLI_Oem4(503),
CLI_Oem5(504),
CLI_Oem6(505),
CLI_Oem7(506),
CLI_Oem8(507),
CLI_Oem9(508),
CLI_Oem10(509),
CLI_Oem11(510),
CLI_Oem12(511),
CLI_Oem13(512),
CLI_Oem14(513),
CLI_Oem15(514),
CLI_Oem16(515),
CLI_Oem17(516),
CLI_Oem18(517),
CLI_Oem19(518),
CLI_Oem20(519),
CLI_Oem21(520),
CLI_Oem22(521),
CLI_Oem23(522),
CLI_Oem24(523),
CLI_Oem25(524),
CLI_Oem26(525),
CLI_Oem27(526),
CLI_Oem28(527),
CLI_Oem29(528),
CLI_Oem30(529),
CLI_Oem31(530),
CLI_Oem32(531),
CLI_Oem33(532),
CLI_Oem34(533),
CLI_Oem35(534),
CLI_Oem36(535),
CLI_Oem37(536),
CLI_Oem38(537),
CLI_Oem39(538),
CLI_Oem40(539),
CLI_Oem41(540),
CLI_Oem42(541),
CLI_Oem43(542),
CLI_Oem44(543),
CLI_Oem45(544),
CLI_Oem46(545),
CLI_Oem47(546),
CLI_Oem48(547),
CLI_Oem49(548),
CLI_Oem50(549),
CLI_Oem51(550),
CLI_Oem52(551),
CLI_Oem53(552),
CLI_Oem54(553),
CLI_Oem55(554),
CLI_Oem56(555),
CLI_Oem57(556),
CLI_Oem58(557),
CLI_Oem59(558),
CLI_Oem60(559),
CLI_Oem61(560),
CLI_Oem62(561),
CLI_Oem63(562),
CLI_Oem64(563),
CLI_Oem65(564),
CLI_Oem66(565),
CLI_Oem67(566),
CLI_Oem68(567),
CLI_Oem69(568),
CLI_Oem70(569),
CLI_Oem71(570),
CLI_Oem72(571),
CLI_Oem73(572),
CLI_Oem74(573),
CLI_Oem75(574),
CLI_Oem76(575),
CLI_Oem77(576),
CLI_Oem78(577),
CLI_Oem79(578),
CLI_Oem80(579),
CLI_Oem81(580),
CLI_Oem82(581),
CLI_Oem83(582),
CLI_Oem84(583),
CLI_Oem85(584),
CLI_Oem86(585),
CLI_Oem87(586),
CLI_Oem88(587),
CLI_Oem89(588),
CLI_Oem90(589),
CLI_Oem91(590),
CLI_Oem92(591),
CLI_Oem93(592),
CLI_Oem94(593),
CLI_Oem95(594),
CLI_Oem96(595),
CLI_Oem97(596),
CLI_Oem98(597),
CLI_Oem99(598),
CLI_Oem100(599),
CLDRAM_1(600),
CLDRAM_2(601),
CLDRAM_3(602),
CLDRAM_4(603),
CLDRAM_5(604),
CLDRAM_6(605),
CLDRAM_7(606),
CLDRAM_8(607),
CLDRAM_9(608),
CLDRAM_10(609),
CLDRAM_11(610),
CLDRAM_12(611),
CLD_C3_1(612),
CLD_C3_2(613),
CLD_C3_3(614),
CLD_C3_4(615),
CLD_C3_5(616),
CLD_C3_6(617),
CLD_C3_7(618),
CLD_C3_8(619),
CLD_C3_9(620),
CLD_C3_10(621),
CLD_C3_11(622),
CLD_C3_12(623),
CLD_C3_13(624),
CLD_C3_14(625),
CLD_C3_15(626),
CLD_C3_16(627),
CLD_C3_17(628),
CLD_C3_18(629),
CLD_C3_19(630),
CLD_C3_20(631),
CLD_C3_21(632),
CLD_C3_22(633),
CLD_C3_23(634),
CLD_C3_24(635),
CLD_C3_25(636),
CLD_C3_26(637),
CLD_C3_27(638),
CLD_C3_28(639),
CLD_C3_29(640),
CLD_C3_30(641),
CLD_C3_31(642),
CLD_C3_32(643),
CLD_C3_33(644),
CLD_C3_34(645),
CLD_C3_35(646),
CLD_C3_36(647),
CLD_C3_37(648),
CLD_C3_38(649),
CLD_C3_39(650),
CLD_C3_40(651),
CLD_C3_41(652),
CLD_C3_42(653),
CLD_C3_43(654),
CLD_C3_44(655),
CLD_C3_45(656),
CLD_C3_46(657),
CLD_C3_47(658),
CLD_C3_48(659),
CLD_C3_49(660),
CLD_C3_50(661),
CLD_C3_51(662),
CLD_C3_52(663),
CLD_C3_53(664),
CLD_C3_54(665),
CLD_C3_55(666),
CLD_C3_56(667),
CLD_C3_57(668),
CLD_C3_58(669),
CLD_C3_59(670),
CLD_C3_60(671),
CLD_C3_61(672),
CLD_C3_62(673),
CLD_C3_63(674),
CLD_C3_64(675),
CLD_C3_65(676),
CLD_C3_66(677),
CLD_C3_67(678),
CLD_C3_68(679),
CLD_C3_69(680),
CLD_C3_70(681),
CLD_C3_71(682),
CLD_C3_72(683),
CLD_C3_73(684),
CLD_C3_74(685),
CLD_C3_75(686),
CLD_C3_76(687),
CLD_C3_77(688),
CLD_C3_78(689),
CLD_C3_79(690),
CLD_C3_80(691),
CLD_C3_81(692),
CLD_C3_82(693),
CLD_C3_83(694),
CLD_C3_84(695),
CLD_C3_85(696),
CLD_C3_86(697),
CLD_C3_87(698),
CLD_C3_88(699),
CLD_C3_89(700),
CLD_C3_90(701),
CLD_C3_91(702),
CLD_C3_92(703),
CLD_C3_93(704),
CLD_C3_94(705),
CLD_C3_95(706),
CLD_C3_96(707),
CLD_C3_97(708),
CLD_C3_98(709),
CLD_C3_99(710),
CLD_C3_100(711),
CLD_C3_101(712),
CLD_C3_102(713),
CLD_C3_103(714),
CLD_C3_104(715),
CLD_C3_105(716),
CLD_C3_106(717),
CLD_C3_107(718),
CLD_C3_108(719),
CLD_C3_109(720),
CLD_C3_110(721),
CLD_C3_111(722),
CLD_C3_112(723),
CLD_C3_113(724),
CLD_C3_114(725),
CLD_C3_115(726),
CLD_C3_116(727),
CLD_C3_117(728),
CLD_C3_118(729),
CLD_C3_119(730),
CLD_C3_120(731),
CLD_C3_121(732),
CLD_C3_122(733),
CLD_C3_123(734),
CLD_C3_124(735),
CLD_C3_125(736),
CLD_C3_126(737),
CLD_C3_127(738),
CLD_C3_128(739),
CLD_C3_129(740),
CLD_C3_130(741),
CLD_C3_131(742),
CLD_C3_132(743),
CLD_C3_133(744),
CLD_C3_134(745),
CLD_C3_135(746),
CLD_C3_136(747),
CLD_C3_137(748),
CLD_C3_138(749),
CLD_C3_139(750),
CLD_C3_140(751),
CLD_C3_141(752),
CLD_C3_142(753),
CLD_C3_143(754),
CLD_C3_144(755),
CLD_C3_145(756),
CLD_C3_146(757),
CLD_C3_147(758),
CLD_C3_148(759),
CLD_C3_149(760),
CLD_C3_150(761),
CLLC_C1_1(762),
CLLC_C1_2(763),
CLLC_C1_3(764),
CLLC_C1_4(765),
CLLC_C1_5(766),
CLLC_C1_6(767),
CLLC_C1_7(768),
CLLC_C1_8(769),
CLLC_C1_9(770),
CLLC_C1_10(771),
CLLC_C1_11(772),
CLLC_C1_12(773),
CLLC_C1_13(774),
CLLC_C1_14(775),
CLLC_C1_15(776),
CLLC_C1_16(777),
CLLC_C1_17(778),
CLLC_C1_18(779),
CLLC_C1_19(780),
CLLC_C1_20(781),
CLLC_C1_21(782),
CLLC_C1_22(783),
CLLC_C1_23(784),
CLLC_C1_24(785),
CLLC_C1_25(786),
CLLC_C1_26(787),
CLLC_C1_27(788),
CLLC_C1_28(789),
CLLC_C1_29(790),
CLLC_C1_30(791),
CLLC_C1_31(792),
CLLC_C1_32(793),
CLLC_C1_33(794),
CLLC_C1_34(795),
CLLC_C1_35(796),
CLLC_C1_36(797),
CLLC_C1_37(798),
CLLC_C1_38(799),
CLLC_C1_39(800),
CLLC_C1_40(801),
CLLC_C1_41(802),
CLLC_C1_42(803),
CLLC_C1_43(804),
CLLC_C1_44(805),
CLLC_C1_45(806),
CLLC_C1_46(807),
CLLC_C1_47(808),
CLLC_C1_48(809),
CLLC_C1_49(810),
CLLC_C1_50(811),
CLLC_C1_51(812),
CLLC_C1_52(813),
CLLC_C1_53(814),
CLLC_C1_54(815),
CLLC_C1_55(816),
CLLC_C1_56(817),
CLLC_C1_57(818),
CLLC_C1_58(819),
CLLC_C1_59(820),
CLLC_C1_60(821),
CLLC_C1_61(822),
CLLC_C1_62(823),
CLLC_C1_63(824),
CLLC_C1_64(825),
CLLC_C1_65(826),
CLLC_C1_66(827),
CLLC_C1_67(828),
CLLC_C1_68(829),
CLLC_C1_69(830),
CLLC_C1_70(831),
CLLC_C1_71(832),
CLLC_C1_72(833),
CLLC_C1_73(834),
CLLC_C1_74(835),
CLLC_C1_75(836),
CLLC_C1_76(837),
CLLC_C1_77(838),
CLLC_C1_78(839),
CLLC_C1_79(840),
CLLC_C1_80(841),
CLLC_C1_81(842),
CLLC_C1_82(843),
CLLC_C1_83(844),
CLLC_C1_84(845),
CLLC_C1_85(846),
CLLC_C1_86(847),
CLLC_C1_87(848),
CLLC_C1_88(849),
CLLC_C1_89(850),
CLLC_C1_90(851),
CLLC_C1_91(852),
CLLC_C1_92(853),
CLLC_C1_93(854),
CLLC_C1_94(855),
CLLC_C1_95(856),
CLLC_C1_96(857),
CLLC_C1_97(858),
CLLC_C1_98(859),
CLLC_C1_99(860),
CLLC_C1_100(861),
CLLC_C1_101(862),
CLLC_C1_102(863),
CLLC_C1_103(864),
CLLC_C1_104(865),
CLLC_C1_105(866),
CLLC_C1_106(867),
CLLC_C1_107(868),
CLLC_C1_108(869),
CLLC_C1_109(870),
CLLC_C1_110(871),
CLLC_C1_111(872),
CLLC_C1_112(873),
CLLC_C1_113(874),
CLLC_C1_114(875),
CLLC_C1_115(876),
CLLC_C1_116(877),
CLLC_C1_117(878),
CLLC_C1_118(879),
CLLC_C1_119(880),
CLLC_C1_120(881),
CLLC_C1_121(882),
CLLC_C1_122(883),
CLLC_C1_123(884),
CLLC_C1_124(885),
CLLC_C1_125(886),
CLLC_C1_126(887),
CLLC_C1_127(888),
CLLC_C1_128(889),
CLLC_C1_129(890),
CLLC_C1_130(891),
CLLC_C1_131(892),
CLLC_C1_132(893),
CLLC_C1_133(894),
CLLC_C1_134(895),
CLLC_C1_135(896),
CLLC_C1_136(897),
CLLC_C1_137(898),
CLLC_C1_138(899),
CLLC_C1_139(900),
CLLC_C1_140(901),
CLLC_C1_141(902),
CLLC_C1_142(903),
CLLC_C1_143(904),
CLLC_C1_144(905),
CLLC_C1_145(906),
CLLC_C1_146(907),
CLLC_C1_147(908),
CLLC_C1_148(909),
CLLC_C1_149(910),
CLLC_C1_150(911),
CLD_C1_151(912),
CLD_C1_152(913),
CLD_C1_153(914),
CLD_C1_154(915),
CLD_C1_155(916),
CLD_C1_156(917),
CLD_C1_157(918),
CLD_C1_158(919),
CLD_C1_159(920),
CLD_C1_160(921),
CLD_C1_161(922),
CLD_C1_162(923),
CLD_C1_163(924),
CLD_C1_164(925),
CLD_C1_165(926),
CLD_C1_166(927),
CLD_C1_167(928),
CLD_C1_168(929),
CLD_C1_169(930),
CLD_C1_170(931),
CLD_C1_171(932),
CLD_C1_172(933),
CLD_C1_173(934),
CLD_C1_174(935),
CLD_C1_175(936),
CLD_C1_176(937),
CLD_C1_177(938),
CLD_C1_178(939),
CLD_C1_179(940),
CLD_C1_180(941),
CLD_C1_181(942),
CLD_C1_182(943),
CLD_C1_183(944),
CLD_C1_184(945),
CLD_C1_185(946),
CLD_C1_186(947),
CLD_C1_187(948),
CLD_C1_188(949),
CLD_C1_189(950),
CLD_C1_190(951),
CLD_C1_191(952),
CLD_C1_192(953),
CLD_C1_193(954),
CLD_C1_194(955),
CLD_C1_195(956),
CLD_C1_196(957),
CLD_C1_197(958),
CLD_C1_198(959),
CLD_C1_199(960),
CLD_C1_200(961),
CLD_C1_201(962),
CLD_C1_202(963),
CLD_C1_203(964),
CLD_C1_204(965),
CLD_C1_205(966),
CLD_C1_206(967),
CLD_C1_207(968),
CLD_C1_208(969),
CLD_C1_209(970),
CLD_C1_210(971),
CLD_C1_211(972),
CLD_C1_212(973),
CLD_C1_213(974),
CLD_C1_214(975),
CLD_C1_215(976),
CLD_C1_216(977),
CLD_C1_217(978),
CLD_C1_218(979),
CLD_C1_219(980),
CLD_C1_220(981),
CLD_C1_221(982),
CLD_C1_222(983),
CLD_C1_223(984),
CLD_C1_224(985),
CLD_C1_225(986),
CLD_C1_226(987),
CLD_C1_227(988),
CLD_C1_228(989),
CLD_C1_229(990),
CLD_C1_230(991),
CLD_C1_231(992),
CLD_C1_232(993),
CLD_C1_233(994),
CLD_C1_234(995),
CLD_C1_235(996),
CLD_C1_236(997),
CLD_C1_237(998),
CLD_C1_238(999),
CLD_C1_239(1000),
CLD_C1_240(1001),
CLD_C1_241(1002),
CLD_C1_242(1003),
CLD_C1_243(1004),
CLD_C1_244(1005),
CLD_C1_245(1006),
CLD_C1_246(1007),
CLD_C1_247(1008),
CLD_C1_248(1009),
CLD_C1_249(1010),
CLD_C1_250(1011),
CLD_C1_251(1012),
CLD_C1_252(1013),
CLD_C1_253(1014),
CLD_C1_254(1015),
CLD_C1_255(1016),
CLD_C1_256(1017),
CLD_C1_257(1018),
CLD_C1_258(1019),
CLD_C1_259(1020),
CLD_C1_260(1021),
CLD_C1_261(1022),
CLD_C1_262(1023),
CLD_C1_263(1024),
CLD_C1_264(1025),
CLD_C1_265(1026),
CLD_C1_266(1027),
CLD_C1_267(1028),
CLD_C1_268(1029),
CLD_C1_269(1030),
CLD_C1_270(1031),
CLD_C1_271(1032),
CLD_C1_272(1033),
CLD_C1_273(1034),
CLD_C1_274(1035),
CLD_C1_275(1036),
CLD_C1_276(1037),
CLD_C1_277(1038),
CLD_C1_278(1039),
CLD_C1_279(1040),
CLD_C1_280(1041),
CLD_C1_281(1042),
CLD_C1_282(1043),
CLD_C1_283(1044),
CLD_C1_284(1045),
CLD_C1_285(1046),
CLD_C1_286(1047),
CLD_C1_287(1048),
CLD_C1_288(1049),
CLD_C1_289(1050),
CLD_C1_290(1051),
CLD_C1_291(1052),
CLD_C1_292(1053),
CLD_C1_293(1054),
CLD_C1_294(1055),
CLD_C1_295(1056),
CLD_C1_296(1057),
CLD_C1_297(1058),
CLD_C1_298(1059),
CLD_C1_299(1060),
CLD_C1_300(1061),
CLD_C2_151(1062),
CLD_C2_152(1063),
CLD_C2_153(1064),
CLD_C2_154(1065),
CLD_C2_155(1066),
CLD_C2_156(1067),
CLD_C2_157(1068),
CLD_C2_158(1069),
CLD_C2_159(1070),
CLD_C2_160(1071),
CLD_C2_161(1072),
CLD_C2_162(1073),
CLD_C2_163(1074),
CLD_C2_164(1075),
CLD_C2_165(1076),
CLD_C2_166(1077),
CLD_C2_167(1078),
CLD_C2_168(1079),
CLD_C2_169(1080),
CLD_C2_170(1081),
CLD_C2_171(1082),
CLD_C2_172(1083),
CLD_C2_173(1084),
CLD_C2_174(1085),
CLD_C2_175(1086),
CLD_C2_176(1087),
CLD_C2_177(1088),
CLD_C2_178(1089),
CLD_C2_179(1090),
CLD_C2_180(1091),
CLD_C2_181(1092),
CLD_C2_182(1093),
CLD_C2_183(1094),
CLD_C2_184(1095),
CLD_C2_185(1096),
CLD_C2_186(1097),
CLD_C2_187(1098),
CLD_C2_188(1099),
CLD_C2_189(1100),
CLD_C2_190(1101),
CLD_C2_191(1102),
CLD_C2_192(1103),
CLD_C2_193(1104),
CLD_C2_194(1105),
CLD_C2_195(1106),
CLD_C2_196(1107),
CLD_C2_197(1108),
CLD_C2_198(1109),
CLD_C2_199(1110),
CLD_C2_200(1111),
CLD_C2_201(1112),
CLD_C2_202(1113),
CLD_C2_203(1114),
CLD_C2_204(1115),
CLD_C2_205(1116),
CLD_C2_206(1117),
CLD_C2_207(1118),
CLD_C2_208(1119),
CLD_C2_209(1120),
CLD_C2_210(1121),
CLD_C2_211(1122),
CLD_C2_212(1123),
CLD_C2_213(1124),
CLD_C2_214(1125),
CLD_C2_215(1126),
CLD_C2_216(1127),
CLD_C2_217(1128),
CLD_C2_218(1129),
CLD_C2_219(1130),
CLD_C2_220(1131),
CLD_C2_221(1132),
CLD_C2_222(1133),
CLD_C2_223(1134),
CLD_C2_224(1135),
CLD_C2_225(1136),
CLD_C2_226(1137),
CLD_C2_227(1138),
CLD_C2_228(1139),
CLD_C2_229(1140),
CLD_C2_230(1141),
CLD_C2_231(1142),
CLD_C2_232(1143),
CLD_C2_233(1144),
CLD_C2_234(1145),
CLD_C2_235(1146),
CLD_C2_236(1147),
CLD_C2_237(1148),
CLD_C2_238(1149),
CLD_C2_239(1150),
CLD_C2_240(1151),
CLD_C2_241(1152),
CLD_C2_242(1153),
CLD_C2_243(1154),
CLD_C2_244(1155),
CLD_C2_245(1156),
CLD_C2_246(1157),
CLD_C2_247(1158),
CLD_C2_248(1159),
CLD_C2_249(1160),
CLD_C2_250(1161),
CLD_C2_251(1162),
CLD_C2_252(1163),
CLD_C2_253(1164),
CLD_C2_254(1165),
CLD_C2_255(1166),
CLD_C2_256(1167),
CLD_C2_257(1168),
CLD_C2_258(1169),
CLD_C2_259(1170),
CLD_C2_260(1171),
CLD_C2_261(1172),
CLD_C2_262(1173),
CLD_C2_263(1174),
CLD_C2_264(1175),
CLD_C2_265(1176),
CLD_C2_266(1177),
CLD_C2_267(1178),
CLD_C2_268(1179),
CLD_C2_269(1180),
CLD_C2_270(1181),
CLD_C2_271(1182),
CLD_C2_272(1183),
CLD_C2_273(1184),
CLD_C2_274(1185),
CLD_C2_275(1186),
CLD_C2_276(1187),
CLD_C2_277(1188),
CLD_C2_278(1189),
CLD_C2_279(1190),
CLD_C2_280(1191),
CLD_C2_281(1192),
CLD_C2_282(1193),
CLD_C2_283(1194),
CLD_C2_284(1195),
CLD_C2_285(1196),
CLD_C2_286(1197),
CLD_C2_287(1198),
CLD_C2_288(1199),
CLD_C2_289(1200),
CLD_C2_290(1201),
CLD_C2_291(1202),
CLD_C2_292(1203),
CLD_C2_293(1204),
CLD_C2_294(1205),
CLD_C2_295(1206),
CLD_C2_296(1207),
CLD_C2_297(1208),
CLD_C2_298(1209),
CLD_C2_299(1210),
CLD_C2_300(1211),
CLD_C3_151(1212),
CLD_C3_152(1213),
CLD_C3_153(1214),
CLD_C3_154(1215),
CLD_C3_155(1216),
CLD_C3_156(1217),
CLD_C3_157(1218),
CLD_C3_158(1219),
CLD_C3_159(1220),
CLD_C3_160(1221),
CLD_C3_161(1222),
CLD_C3_162(1223),
CLD_C3_163(1224),
CLD_C3_164(1225),
CLD_C3_165(1226),
CLD_C3_166(1227),
CLD_C3_167(1228),
CLD_C3_168(1229),
CLD_C3_169(1230),
CLD_C3_170(1231),
CLD_C3_171(1232),
CLD_C3_172(1233),
CLD_C3_173(1234),
CLD_C3_174(1235),
CLD_C3_175(1236),
CLD_C3_176(1237),
CLD_C3_177(1238),
CLD_C3_178(1239),
CLD_C3_179(1240),
CLD_C3_180(1241),
CLD_C3_181(1242),
CLD_C3_182(1243),
CLD_C3_183(1244),
CLD_C3_184(1245),
CLD_C3_185(1246),
CLD_C3_186(1247),
CLD_C3_187(1248),
CLD_C3_188(1249),
CLD_C3_189(1250),
CLD_C3_190(1251),
CLD_C3_191(1252),
CLD_C3_192(1253),
CLD_C3_193(1254),
CLD_C3_194(1255),
CLD_C3_195(1256),
CLD_C3_196(1257),
CLD_C3_197(1258),
CLD_C3_198(1259),
CLD_C3_199(1260),
CLD_C3_200(1261),
CLD_C3_201(1262),
CLD_C3_202(1263),
CLD_C3_203(1264),
CLD_C3_204(1265),
CLD_C3_205(1266),
CLD_C3_206(1267),
CLD_C3_207(1268),
CLD_C3_208(1269),
CLD_C3_209(1270),
CLD_C3_210(1271),
CLD_C3_211(1272),
CLD_C3_212(1273),
CLD_C3_213(1274),
CLD_C3_214(1275),
CLD_C3_215(1276),
CLD_C3_216(1277),
CLD_C3_217(1278),
CLD_C3_218(1279),
CLD_C3_219(1280),
CLD_C3_220(1281),
CLD_C3_221(1282),
CLD_C3_222(1283),
CLD_C3_223(1284),
CLD_C3_224(1285),
CLD_C3_225(1286),
CLD_C3_226(1287),
CLD_C3_227(1288),
CLD_C3_228(1289),
CLD_C3_229(1290),
CLD_C3_230(1291),
CLD_C3_231(1292),
CLD_C3_232(1293),
CLD_C3_233(1294),
CLD_C3_234(1295),
CLD_C3_235(1296),
CLD_C3_236(1297),
CLD_C3_237(1298),
CLD_C3_238(1299),
CLD_C3_239(1300),
CLD_C3_240(1301),
CLD_C3_241(1302),
CLD_C3_242(1303),
CLD_C3_243(1304),
CLD_C3_244(1305),
CLD_C3_245(1306),
CLD_C3_246(1307),
CLD_C3_247(1308),
CLD_C3_248(1309),
CLD_C3_249(1310),
CLD_C3_250(1311),
CLD_C3_251(1312),
CLD_C3_252(1313),
CLD_C3_253(1314),
CLD_C3_254(1315),
CLD_C3_255(1316),
CLD_C3_256(1317),
CLD_C3_257(1318),
CLD_C3_258(1319),
CLD_C3_259(1320),
CLD_C3_260(1321),
CLD_C3_261(1322),
CLD_C3_262(1323),
CLD_C3_263(1324),
CLD_C3_264(1325),
CLD_C3_265(1326),
CLD_C3_266(1327),
CLD_C3_267(1328),
CLD_C3_268(1329),
CLD_C3_269(1330),
CLD_C3_270(1331),
CLD_C3_271(1332),
CLD_C3_272(1333),
CLD_C3_273(1334),
CLD_C3_274(1335),
CLD_C3_275(1336),
CLD_C3_276(1337),
CLD_C3_277(1338),
CLD_C3_278(1339),
CLD_C3_279(1340),
CLD_C3_280(1341),
CLD_C3_281(1342),
CLD_C3_282(1343),
CLD_C3_283(1344),
CLD_C3_284(1345),
CLD_C3_285(1346),
CLD_C3_286(1347),
CLD_C3_287(1348),
CLD_C3_288(1349),
CLD_C3_289(1350),
CLD_C3_290(1351),
CLD_C3_291(1352),
CLD_C3_292(1353),
CLD_C3_293(1354),
CLD_C3_294(1355),
CLD_C3_295(1356),
CLD_C3_296(1357),
CLD_C3_297(1358),
CLD_C3_298(1359),
CLD_C3_299(1360),
CLD_C3_300(1361),
CLMB_Zone1(1362),
CLMB_Zone2(1363),
CLMB_Zone3(1364),
CLMB_Zone4(1365),
CLMB_Zone5(1366),
CLMB_Zone6(1367),
CLMB_Zone7(1368),
CLMB_Zone8(1369),
CLMB_Zone9(1370),
CLMB_Zone10(1371),
CLMB_Zone11(1372),
CLMB_Zone12(1373),
CLMB_Zone13(1374),
CLMB_Zone14(1375),
CLMB_Zone15(1376),
CLMB_Zone16(1377),
CLMB_Zone17(1378),
CLMB_Zone18(1379),
CLMB_Zone19(1380),
CLMB_Zone20(1381),
CLMB_Zone21(1382),
CLMB_Zone22(1383),
CLMB_Zone23(1384),
CLMB_Zone24(1385),
CLMB_Zone25(1386),
CLMB_Zone26(1387),
CLMB_Zone27(1388),
CLMB_Zone28(1389),
CLMB_Zone29(1390),
CLMB_Zone30(1391),
CLMB_Zone31(1392),
CLMB_Zone32(1393),
CLMB_Zone33(1394),
CLMB_Zone34(1395),
CLMB_Zone35(1396),
CLMB_Zone36(1397),
CLMB_Zone37(1398),
CLMB_Zone38(1399),
CLMB_Zone39(1400),
CLMB_Zone40(1401),
CLMB_Zone41(1402),
CLMB_Zone42(1403),
CLMB_Zone43(1404),
CLMB_Zone44(1405),
CLMB_Zone45(1406),
CLMB_Zone46(1407),
CLMB_Zone47(1408),
CLMB_Zone48(1409),
CLMB_Zone49(1410),
CLMB_Zone50(1411),
CLMB_Zone51(1412),
CLMB_Zone52(1413),
CLMB_Zone53(1414),
CLMB_Zone54(1415),
CLMB_Zone55(1416),
CLMB_Zone56(1417),
CLMB_Zone57(1418),
CLMB_Zone58(1419),
CLMB_Zone59(1420),
CLMB_Zone60(1421),
CLMB_Zone61(1422),
CLMB_Zone62(1423),
CLMB_Zone63(1424),
CLMB_Zone64(1425),
CLMB_Zone65(1426),
CLMB_Zone66(1427),
CLMB_Zone67(1428),
CLMB_Zone68(1429),
CLMB_Zone69(1430),
CLMB_Zone70(1431),
CLMB_Zone71(1432),
CLMB_Zone72(1433),
CLMB_Zone73(1434),
CLMB_Zone74(1435),
CLMB_Zone75(1436),
CLMB_Zone76(1437),
CLMB_Zone77(1438),
CLMB_Zone78(1439),
CLMB_Zone79(1440),
CLMB_Zone80(1441),
CLMB_Zone81(1442),
CLMB_Zone82(1443),
CLMB_Zone83(1444),
CLMB_Zone84(1445),
CLMB_Zone85(1446),
CLMB_Zone86(1447),
CLMB_Zone87(1448),
CLMB_Zone88(1449),
CLMB_Zone89(1450),
CLMB_Zone90(1451),
CLMB_Zone91(1452),
CLMB_Zone92(1453),
CLMB_Zone93(1454),
CLMB_Zone94(1455),
CLMB_Zone95(1456),
CLMB_Zone96(1457),
CLMB_Zone97(1458),
CLMB_Zone98(1459),
CLMB_Zone99(1460),
CLMB_Zone100(1461),
CLGPU_Zone1(1462),
CLGPU_Zone2(1463),
CLGPU_Zone3(1464),
CLGPU_Zone4(1465),
CLGPU_Zone5(1466),
CLGPU_Zone6(1467),
CLGPU_Zone7(1468),
CLGPU_Zone8(1469),
CLGPU_Zone9(1470),
CLGPU_Zone10(1471),
CLGPU_Zone11(1472),
CLGPU_Zone12(1473),
CLGPU_Zone13(1474),
CLGPU_Zone14(1475),
CLGPU_Zone15(1476),
CLGPU_Zone16(1477),
CLGPU_Zone17(1478),
CLGPU_Zone18(1479),
CLGPU_Zone19(1480),
CLGPU_Zone20(1481),
CLGPU_Zone21(1482),
CLGPU_Zone22(1483),
CLGPU_Zone23(1484),
CLGPU_Zone24(1485),
CLGPU_Zone25(1486),
CLGPU_Zone26(1487),
CLGPU_Zone27(1488),
CLGPU_Zone28(1489),
CLGPU_Zone29(1490),
CLGPU_Zone30(1491),
CLGPU_Zone31(1492),
CLGPU_Zone32(1493),
CLGPU_Zone33(1494),
CLGPU_Zone34(1495),
CLGPU_Zone35(1496),
CLGPU_Zone36(1497),
CLGPU_Zone37(1498),
CLGPU_Zone38(1499),
CLGPU_Zone39(1500),
CLGPU_Zone40(1501),
CLGPU_Zone41(1502),
CLGPU_Zone42(1503),
CLGPU_Zone43(1504),
CLGPU_Zone44(1505),
CLGPU_Zone45(1506),
CLGPU_Zone46(1507),
CLGPU_Zone47(1508),
CLGPU_Zone48(1509),
CLGPU_Zone49(1510),
CLGPU_Zone50(1511),
CLKLP_Zone20(1512),
CLKLP_Zone21(1513),
CLKLP_Zone22(1514),
CLKLP_Zone23(1515),
CLKLP_Zone24(1516),
CLKLP_Zone25(1517),
CLKLP_Zone26(1518),
CLKLP_Zone27(1519),
CLKLP_Zone28(1520),
CLKLP_Zone29(1521),
CLKLP_Zone30(1522),
CLKLP_Zone31(1523),
CLKLP_Zone32(1524),
CLKLP_Zone33(1525),
CLKLP_Zone34(1526),
CLKLP_Zone35(1527),
CLKLP_Zone36(1528),
CLKLP_Zone37(1529),
CLKLP_Zone38(1530),
CLKLP_Zone39(1531),
CLKLP_Zone40(1532),
CLKLP_Zone41(1533),
CLKLP_Zone42(1534),
CLKLP_Zone43(1535),
CLKLP_Zone44(1536),
CLKLP_Zone45(1537),
CLKLP_Zone46(1538),
CLKLP_Zone47(1539),
CLKLP_Zone48(1540),
CLKLP_Zone49(1541),
CLKLP_Zone50(1542),
CLK_Profile(1543),
CLI_Last(1543);
private final int id;
public static LedId byOrdinal(int ordinal)
{
return (ordinal >= 0 && values().length > ordinal) ? values()[ordinal] : null;
}
}
| [
"claudineiwickert@gmail.com"
] | claudineiwickert@gmail.com |
3f43be48a00bcccbce7599f85e2e9a208889d003 | 694d574b989e75282326153d51bd85cb8b83fb9f | /google-ads/src/main/java/com/google/ads/googleads/v2/enums/FeedMappingCriterionTypeEnumOrBuilder.java | b423d8eda454ddab81aadc23e109bb70a0c7453f | [
"Apache-2.0"
] | permissive | tikivn/google-ads-java | 99201ef20efd52f884d651755eb5a3634e951e9b | 1456d890e5c6efc5fad6bd276b4a3cd877175418 | refs/heads/master | 2023-08-03T13:02:40.730269 | 2020-07-17T16:33:40 | 2020-07-17T16:33:40 | 280,845,720 | 0 | 0 | Apache-2.0 | 2023-07-23T23:39:26 | 2020-07-19T10:51:35 | null | UTF-8 | Java | false | true | 398 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v2/enums/feed_mapping_criterion_type.proto
package com.google.ads.googleads.v2.enums;
public interface FeedMappingCriterionTypeEnumOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.ads.googleads.v2.enums.FeedMappingCriterionTypeEnum)
com.google.protobuf.MessageOrBuilder {
}
| [
"devchas@google.com"
] | devchas@google.com |
40c6dcc566db196b0a201ff50e3aa216aa025f7d | 16558dfe1930c4cb7ec8a52ec086d1d1a7b1a565 | /video_admin/src/main/java/org/n3r/idworker/RandomCodeStrategy.java | f3195e7543c98a81f4408777b54eaee676bc4c55 | [] | no_license | xuhuiling00/spring_study | 5a6559be624bc822a1f9e33ce0102aafa84cae16 | 47718ba84a84abdec9af62ed890c8a5e75d7334e | refs/heads/master | 2023-03-13T19:18:10.186299 | 2021-03-06T14:35:36 | 2021-03-06T14:35:36 | 336,457,779 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 140 | java | package org.n3r.idworker;
public interface RandomCodeStrategy {
void init();
int prefix();
int next();
void release();
}
| [
"68549255+xuhuiling00@users.noreply.github.com"
] | 68549255+xuhuiling00@users.noreply.github.com |
6e7c5074ed3a4764890005c936297572372a33a9 | 4fdb8a52a5251c3757fa3b739c9b36138d7f9302 | /CodingStudy/src/Chapter7/Question9/CircularArray.java | e989db02c433453f6d5f7bace7e9b37a886ad7d6 | [] | no_license | dkyou7/CodingStudy | b9cca607a143430490e4496a439302a332a6e023 | b4708b0877d92c1195339553b18b720d031b0853 | refs/heads/master | 2021-10-10T00:29:43.751342 | 2018-12-09T09:35:30 | 2018-12-09T09:35:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,216 | java | package Chapter7.Question9;
import java.util.Iterator;
public class CircularArray<T> implements Iterable<T>{
private T[] items;
private int head =0;
public CircularArray(int size) {
items = (T[])new Object[size];
}
private int convert(int index) {
if(index < 0) {
index += items.length;
}
return (head + index) % items.length;
}
public void rotate(int shiftRight) {
head = convert(shiftRight);
}
public T get(int i) {
if(i < 0 || i >= items.length) {
throw new java.lang.IndexOutOfBoundsException("Index " + i + " is out of bounds");
}
return items[convert(i)];
}
public void set(int i, T item) {
items[convert(i)] = item;
}
public Iterator<T> iterator() {
return new CircularArrayIterator();
}
private class CircularArrayIterator implements Iterator<T>{
private int _current = -1;
public CircularArrayIterator() {}
@Override
public boolean hasNext() {
return _current < items.length -1;
}
@Override
public T next() {
_current++;
return (T)items[convert(_current)];
}
@Override
public void remove() {
throw new UnsupportedOperationException("Remove is not supported by CircularArray");
}
}
}
| [
"koola97620@nate.com"
] | koola97620@nate.com |
84c64d825a04704ee20548803e4ca9365cf6112e | 668f48c793537392b36a48e031edb27aa6ecd0aa | /src/smalljvm/classfile/instruction/store/LASTORE.java | 3b640fde9b89c9584afa60c3e7d33ebbe884bd54 | [] | no_license | linlinjava/smalljvm | f4bae2981be15e6e704a9276186cab0d7d2c4aad | 7f3ebc0618522dac7580da7f20e8ba4e43bddbd3 | refs/heads/master | 2021-08-29T17:20:37.584110 | 2017-10-17T08:51:18 | 2017-10-17T08:51:20 | 114,249,025 | 7 | 2 | null | null | null | null | UTF-8 | Java | false | false | 489 | java | package smalljvm.classfile.instruction.store;
import smalljvm.classfile.Instruction;
/**
* Created by junling on 2017/3/31.
*/
public class LASTORE implements Instruction {
public byte op;
@Override
public byte opcode(){
return 0x50;
}
@Override
public String strcode (){
return "lastore";
}
@Override
public String toString() {
return strcode();
}
@Override
public int length() {
return 1;
}
}
| [
"linlinjavaer@gmail.com"
] | linlinjavaer@gmail.com |
fb299df94b8bb8e1da6e05e0d6cef9f514aaa206 | bdc69e64a6ef7a843a819fdb315eb4928dc77ce9 | /library/src/main/java/com/eqdd/library/base/CommonActivity.java | f3060da23b5ba51a5e64ac2f0161d02dc75d132b | [] | no_license | lvzhihao100/Project | f1d3f0d535ceae42db9415b368b6fe9aa7ee6200 | 9d7fe365c92cc7500b89e2febcfd4c7a666d251a | refs/heads/master | 2021-01-25T08:13:35.673848 | 2017-06-08T10:18:22 | 2017-06-08T10:18:22 | 93,736,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package com.eqdd.library.base;
import android.os.Bundle;
import com.eqdd.common.base.BaseActivity;
import com.eqdd.library.bean.User;
import com.eqdd.library.utils.GreenDaoUtil;
/**
* Created by lvzhihao on 17-5-30.
*/
public abstract class CommonActivity extends BaseActivity {
public User user;
private Bundle savedInstanceState;
@Override
protected void onCreate(Bundle savedInstanceState) {
user = GreenDaoUtil.getUser();
this.savedInstanceState = savedInstanceState;
super.onCreate(savedInstanceState);
}
public Bundle getSavedInstanceState() {
return savedInstanceState;
}
}
| [
"1030753080@qq.com"
] | 1030753080@qq.com |
a2d67a140df37204a5db6915c24f9e6d1deb6583 | f08e9024b9139a1b5b90e26411ca2ac926d57123 | /src/main/java/codingtest/main/TestApplication.java | 692c5c07b6d0c1612da3de312044e06e91ac7bb2 | [] | no_license | NblYb/CodeTest | c5bc4a6704787abbcf1782193ec5a66374b43ca3 | 68ca85d6be9b54cfe13e2d7bbc3feb0b5e47bccc | refs/heads/main | 2023-07-18T19:51:47.266586 | 2021-09-27T02:27:36 | 2021-09-27T02:27:36 | 409,911,814 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package codingtest.main;
import codingtest.main.methods.IOMethods;
import codingtest.main.methods.MatchingMethod;
import codingtest.main.pojo.Record;
import codingtest.main.pojo.Result;
import java.io.*;
import java.text.ParseException;
import java.util.*;
public class TestApplication {
public static void main(String[] args) throws IOException, ParseException {
IOMethods ioMethods = new IOMethods();
MatchingMethod matchingMethod = new MatchingMethod();
List<Record> records = ioMethods.readFile();
HashMap<String, List<Record>> recordGroup = matchingMethod.divideRecordsIntoHashedGroups(records);
List<Result> results = matchingMethod.calculateResults(recordGroup);
ioMethods.writeFile(results);
}
}
| [
"NbYb@users.noreply.github.com"
] | NbYb@users.noreply.github.com |
fd2f46a4a2ec55f18023a3db3e74f3f072c436d3 | 829a84ecd7ad2782591e7a54fdbff6af07546728 | /src/polymorphism/music/Wind.java | 481cd6eafa9bb1210f3e5c8b3110480db4cf6895 | [] | no_license | oubl23/thinkinginjava | 24a3c8d9b2e96f52b289b9ad42a6f1762e1cd017 | b1be7e063b3332d151db1a2afa0be5b69656f5fc | refs/heads/master | 2021-01-11T11:17:55.755828 | 2016-11-17T14:21:48 | 2016-11-17T14:21:48 | 72,738,511 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 186 | java | package polymorphism.music;
/**
* Created by dabao on 2016/10/27.
*/
public class Wind extends Instrument {
public void play(Note n)
{
System.out.println("Wind.play()" + n);
}
}
| [
"1059210376@qq.com"
] | 1059210376@qq.com |
fc2bd5e417e256cd6141d58a94b0742bef4589e7 | 128d8aaf1cbec7d40ef163fdac2a90d4a1bb9b6b | /src/day23_Arrays/ArraysUtility.java | f7e7887f62ed0a894ac5aedd64ee1339d20e6c7f | [] | no_license | ikramazim/JavaProgramming_B23 | 5131cf3d7ef254d5e94d5d9ab543f948220b9a65 | f3dfbf5cc3e5bdc3f4a72300b96409ea96b84fc5 | refs/heads/master | 2023-06-25T14:37:28.695319 | 2021-07-26T17:09:33 | 2021-07-26T17:09:33 | 389,715,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,950 | java | package day23_Arrays;
import java.util.Arrays;
public class ArraysUtility {
public static void main(String[] args) {
// toString
int[] array = {1,2,3,4,5,6};
System.out.println(array);
System.out.println( Arrays.toString(array) );
String[] array2 = new String[5];
System.out.println(array2);
System.out.println( Arrays.toString(array2) );
double[] nums = new double[5];
System.out.println(Arrays.toString(nums));
// sort(): sorts the elemnts of the array in ascending order
String[] students = {"Boburbek", "Aysu", "Abbos", "Sabir"};
System.out.println( Arrays.toString(students));
Arrays.sort(students); // the array is sorted inascending order (a to z
System.out.println( Arrays.toString(students));
int[] numbers = {9,10,4,1,3,-1,0,1,2};
System.out.println( Arrays.toString(numbers) );
Arrays.sort(numbers);
System.out.println( Arrays.toString(numbers) );
System.out.println("Minimum number: "+numbers[0]);
System.out.println("Maximum Number: "+numbers[numbers.length-1] );
char[] chars = {'z', 'b', 'k', 'a', 'c', 'y', 'x'};
System.out.println( Arrays.toString(chars) );
Arrays.sort(chars);
System.out.println( Arrays.toString(chars) );
// equals(arr1, arr2)
int[] num1 = {1,2,3};
int[] num2 = {1,2,3};
int[] num3 = {3,2,1};
int[] num4 = {2,3,1};
boolean r1 = Arrays.equals(num1, num2);
boolean r2 = Arrays.equals(num2, num3);
Arrays.sort(num3); // num3 will be in ascending order, {1,2,3}
Arrays.sort(num4); // num4 will be in ascending order, {1,2,3}
boolean r3 = Arrays.equals(num3, num4);
System.out.println("r1 = " + r1);
System.out.println("r2 = " + r2);
System.out.println("r3 = " + r3);
}
}
| [
"ikramazim@hotmail.com"
] | ikramazim@hotmail.com |
e012eeeb25a369f2eaa80bf786e939bfb2b45485 | 678eba9d03b2404bda49eeb8f979a8ca793246cf | /game/src/main/java/lujgame/anno/net/packet/NetPacketProcImpl.java | 1d02915be6dbd199cb61e599bf9453bbc8c53859 | [] | no_license | lowZoom/LujGame | 7456b6c36ce8b97a5b755c78686830bad3fb47cd | 5675751183e62449866317f17c63e21a523e6176 | refs/heads/master | 2020-04-05T08:53:27.638143 | 2018-03-25T10:12:55 | 2018-03-25T10:12:55 | 81,704,611 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 8,885 | java | package lujgame.anno.net.packet;
import com.google.common.collect.ImmutableMap;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.processing.Filer;
import javax.annotation.processing.Messager;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.tools.Diagnostic;
import lujgame.anno.core.generate.GenerateTool;
import lujgame.anno.net.packet.input.FieldItem;
import lujgame.anno.net.packet.input.PacketItem;
import lujgame.anno.net.packet.output.FieldType;
import lujgame.game.server.net.packet.NetPacketCodec;
import lujgame.game.server.net.packet.PacketImpl;
import lujgame.game.server.type.JInt;
import lujgame.game.server.type.JStr;
import lujgame.game.server.type.Z1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Component
public class NetPacketProcImpl {
public void process(TypeElement elem, Elements elemUtil,
Filer filer, Messager msg) throws IOException {
PacketItem item = createPacketItem(elem, elemUtil);
if (!checkPacketItem(item, msg)) {
return;
}
JavaFile jsonFile = makeJsonFile(item);
_generateTool.writeTo(jsonFile, filer);
generatePacketImpl(item, filer, jsonFile.typeSpec);
generateCodec(item, filer);
}
private PacketItem createPacketItem(TypeElement elem, Elements elemUtil) {
List<FieldItem> fieldList = elem.getEnclosedElements().stream()
.map(e -> toPacketField((ExecutableElement) e))
.collect(Collectors.toList());
return new PacketItem(elemUtil.getPackageOf(elem).getQualifiedName().toString(),
elem.getSimpleName().toString(), elem.asType(), fieldList);
}
private boolean checkPacketItem(PacketItem item, Messager msg) {
List<FieldItem> invalidList = item.getFieldList().stream()
.filter(f -> FIELD_MAP.get(f.getSpec().type) == null)
.collect(Collectors.toList());
invalidList.forEach(f -> {
TypeName type = f.getSpec().type;
msg.printMessage(Diagnostic.Kind.ERROR, "无法识别的字段类型:" + type, f.getElem());
});
return invalidList.isEmpty();
}
private FieldItem toPacketField(ExecutableElement elem) {
return new FieldItem(elem, FieldSpec.builder(TypeName.get(elem.getReturnType()),
elem.getSimpleName().toString()).build());
}
/**
* 生成包json类
*/
private JavaFile makeJsonFile(PacketItem item) {
List<FieldSpec> fieldList = item.getFieldList().stream()
.map(this::toJsonField)
.collect(Collectors.toList());
return JavaFile.builder(item.getPackageName(), TypeSpec
.classBuilder(getJsonName(item))
.addModifiers(Modifier.FINAL)
.addFields(fieldList)
.addMethods(fieldList.stream()
.map(this::jsFieldToGetter)
.collect(Collectors.toList()))
.addMethods(fieldList.stream()
.map(this::jsFieldToSetter)
.collect(Collectors.toList()))
.build()).build();
}
private String getJsonName(PacketItem item) {
return item.getClassName() + "Json";
}
private FieldSpec toJsonField(FieldItem packetField) {
FieldSpec spec = packetField.getSpec();
FieldType newType = FIELD_MAP.get(spec.type);
if (newType == null) {
return spec;
}
return FieldSpec.builder(newType.getValueType(), '_' + spec.name).build();
}
private MethodSpec jsFieldToGetter(FieldSpec field) {
return MethodSpec.methodBuilder(_generateTool.nameOfProperty("get", field.name))
.addModifiers(Modifier.PUBLIC)
.returns(field.type)
.addStatement("return $L", field.name)
.build();
}
private MethodSpec jsFieldToSetter(FieldSpec field) {
String paramName = field.name.substring(1, 2);
return MethodSpec.methodBuilder(_generateTool.nameOfProperty("set", field.name))
.addModifiers(Modifier.PUBLIC)
.addParameter(field.type, paramName)
.addStatement("$L = $L", field.name, paramName)
.build();
}
/**
* 生成包实现类
*/
private void generatePacketImpl(PacketItem item,
Filer filer, TypeSpec jsonType) throws IOException {
GenerateTool t = _generateTool;
List<FieldSpec> fieldList = item.getFieldList().stream()
.map(f -> t.makeBeanField(f.getSpec()))
.collect(Collectors.toList());
String internalParam = "i";
String jsonParam = "j";
ClassName valueType = ClassName.bestGuess(jsonType.name);
MethodSpec construct = fillConstruct(MethodSpec
.constructorBuilder(), fieldList, internalParam, jsonParam)
.addParameter(TypeName.get(Z1.class), internalParam)
.addParameter(valueType, jsonParam)
.build();
List<MethodSpec> propertyList = fieldList.stream()
.map(t::makeBeanProperty)
.collect(Collectors.toList());
t.writeTo(JavaFile.builder(item.getPackageName(), TypeSpec
.classBuilder(getImplName(item))
.addModifiers(Modifier.FINAL)
.superclass(ParameterizedTypeName.get(ClassName.get(PacketImpl.class), valueType))
.addSuperinterface(TypeName.get(item.getPacketType()))
.addMethod(construct)
.addMethods(propertyList)
.addFields(fieldList)
.build()).build(), filer);
}
private String getImplName(PacketItem item) {
return item.getClassName() + "Impl";
}
private MethodSpec.Builder fillConstruct(MethodSpec.Builder builder,
List<FieldSpec> fieldList, String internalName, String jsonName) {
GenerateTool t = _generateTool;
builder.addStatement("super($1L)", jsonName);
for (FieldSpec f : fieldList) {
FieldType fieldType = FIELD_MAP.get(f.type);
builder.addStatement("$1L = $2L.$3L($4L::$5L, $4L::$6L)", f.name,
internalName, fieldType.getMaker(), jsonName,
t.nameOfProperty("get", f.name), t.nameOfProperty("set", f.name));
}
return builder;
}
/**
* 生成编解码器类
*/
private void generateCodec(PacketItem item, Filer filer) throws IOException {
GenerateTool t = _generateTool;
String internalName = "i";
TypeMirror packetType = item.getPacketType();
MethodSpec create = t.overrideBuilder("createPacket")
.addModifiers(Modifier.PUBLIC)
.addParameter(TypeName.get(Z1.class), internalName)
.returns(PacketImpl.class)
.addStatement("return new $L($L, new $L())",
getImplName(item), internalName, getJsonName(item))
.build();
String dataName = "data";
MethodSpec decode = t.overrideBuilder("decodePacket")
.addModifiers(Modifier.PUBLIC)
.addParameter(TypeName.get(Z1.class), internalName)
.addParameter(byte[].class, dataName)
.returns(TypeName.get(packetType))
.addStatement("return new $L($L, readJson($L, $L.class))",
getImplName(item), internalName, dataName, getJsonName(item))
.build();
String packetName = "packet";
MethodSpec encode = t.overrideBuilder("encodePacket")
.addModifiers(Modifier.PUBLIC)
.addParameter(TypeName.get(Object.class), packetName)
.returns(byte[].class)
.addStatement("return writeJson($L)", packetName)
.build();
t.writeTo(JavaFile.builder(item.getPackageName(), TypeSpec
.classBuilder(item.getClassName() + "Codec")
.addAnnotation(Service.class)
.addModifiers(Modifier.PUBLIC, Modifier.FINAL)
.superclass(NetPacketCodec.class)
.addMethod(buildPacketType(packetType))
.addMethod(create)
.addMethod(decode)
.addMethod(encode)
.build()).build(), filer);
}
private MethodSpec buildPacketType(TypeMirror packetType) {
return MethodSpec.methodBuilder("packetType")
.addAnnotation(Override.class)
.addModifiers(Modifier.PUBLIC)
.returns(ParameterizedTypeName.get(ClassName.get(Class.class), TypeName.get(packetType)))
.addStatement("return $L.class", packetType)
.build();
}
private static final Map<TypeName, FieldType> FIELD_MAP = ImmutableMap.<TypeName, FieldType>builder()
.put(TypeName.get(JInt.class), FieldType.of(int.class, "newInt"))
.put(TypeName.get(JStr.class), FieldType.of(String.class, "newStr"))
.build();
@Autowired
private GenerateTool _generateTool;
}
| [
"david_lu_st@163.com"
] | david_lu_st@163.com |
ef353da7d95b69288982150cf50d15f97ba1c936 | 076634b253da21a5d3ad40b30790e5f441313c93 | /VotingCentral/JavaSource/com/votingcentral/model/enums/VCUserLinkStateEnum.java | 2c859d7265d2f0f88fa3027bc38db5c40dfcf176 | [] | no_license | hnalagandla/votingcentral | ac5cc64cbaa8910ed8921f557715720e423a829a | bb6570fea2ee0e90ebef9c0cfcda2471f9312acf | refs/heads/master | 2021-01-13T02:08:18.239901 | 2014-01-23T21:32:59 | 2014-01-23T21:32:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,627 | java | /*
* Created on May 22, 2007
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.votingcentral.model.enums;
import java.util.Iterator;
import java.util.ListIterator;
import com.votingcentral.util.enums.BaseEnum;
/**
* @author harishn
*
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
public class VCUserLinkStateEnum extends BaseEnum {
public static final VCUserLinkStateEnum INITIATED = new VCUserLinkStateEnum(
"INITIATED", 0);
public static final VCUserLinkStateEnum ACCEPTED = new VCUserLinkStateEnum(
"ACCEPTED", 1);
public static final VCUserLinkStateEnum REJECTED = new VCUserLinkStateEnum(
"REJECTED", 2);
public static final VCUserLinkStateEnum BROKEN = new VCUserLinkStateEnum(
"BROKEN", 3);
public static final VCUserLinkStateEnum RE_ESTABLISHED = new VCUserLinkStateEnum(
"RE_ESTABLISHED", 4);
public static final VCUserLinkStateEnum RECALL = new VCUserLinkStateEnum(
"RECALL", 5);
public static VCUserLinkStateEnum get(String name) {
Iterator iter = iterator();
while (iter.hasNext()) {
VCUserLinkStateEnum roles = (VCUserLinkStateEnum) iter.next();
if (roles.getName().equalsIgnoreCase(name)) {
return roles;
}
}
return null;
}
// Add new instances above this line
//-----------------------------------------------------------------//
// Template code follows....do not modify other than to replace //
// enumeration class name with the name of this class. //
//-----------------------------------------------------------------//
private VCUserLinkStateEnum(String name, int intValue) {
super(intValue, name);
}
// ------- Type specific interfaces -------------------------------//
/** Get the enumeration instance for a given value or null */
public static VCUserLinkStateEnum get(int key) {
return (VCUserLinkStateEnum) getEnum(VCUserLinkStateEnum.class, key);
}
/**
* Get the enumeration instance for a given value or return the elseEnum
* default.
*/
public static VCUserLinkStateEnum getElseReturn(int key,
VCUserLinkStateEnum elseEnum) {
return (VCUserLinkStateEnum) getElseReturnEnum(
VCUserLinkStateEnum.class, key, elseEnum);
}
/**
* Return an bidirectional iterator that traverses the enumeration instances
* in the order they were defined.
*/
public static ListIterator iterator() {
return getIterator(VCUserLinkStateEnum.class);
}
} | [
"harish_ng@yahoo.com"
] | harish_ng@yahoo.com |
0756e3c70e0c50c93b6e7978a4643814b7e2ea94 | 94039628301a2c19604cfba4aaeeec55c2af21a8 | /src/main/java/com/camelone/excalibur/FileMessageStore.java | 77a75189dec3577b4a3b1194d6c15d65831de38a | [] | no_license | hzbarcea/camelone | 3399b5ad73018de0b10deb18834bd2d582daa1e4 | 0b5448321b107dc1f51ddf83aaf98283472bc4db | refs/heads/master | 2021-01-01T20:12:28.329750 | 2013-06-12T19:03:45 | 2013-06-12T19:03:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,044 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.camelone.excalibur;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Expression;
import org.apache.camel.spi.DataFormat;
import com.camelone.claimcheck.MessageStore;
public class FileMessageStore implements MessageStore {
private Map<String, Exchange> store = new ConcurrentHashMap<String, Exchange>();
private File location;
private DataFormat df;
private Expression reader;
private Endpoint endpoint;
public FileMessageStore(File location, DataFormat df, CamelContext context, Expression reader) {
this.location = location;
this.df = df;
this.reader = reader;
endpoint = context.getEndpoint("file:" + location.getAbsolutePath());
refresh();
}
public void refresh() {
store.clear();
for (File msg : location.listFiles()) {
if (msg.isFile()) {
Exchange exchange = fromStorage(msg);
store.put(reader.evaluate(exchange, String.class), exchange);
}
}
}
@Override
public void clear() {
clearStorage();
store.clear();
}
@Override
public boolean containsKey(Object key) {
return store.containsKey(key);
}
@Override
public boolean containsValue(Object value) {
return store.containsValue(value);
}
@Override
public Set<java.util.Map.Entry<String, Exchange>> entrySet() {
return store.entrySet();
}
@Override
public Exchange get(Object key) {
return store.get(key);
}
@Override
public boolean isEmpty() {
return store.isEmpty();
}
@Override
public Set<String> keySet() {
return store.keySet();
}
@Override
public Exchange put(String key, Exchange value) {
toStorage(value);
return store.put(key, value);
}
@Override
public void putAll(Map<? extends String, ? extends Exchange> other) {
for (Map.Entry<? extends String, ? extends Exchange> entry : other.entrySet()) {
store.put(entry.getKey(), entry.getValue());
}
}
@Override
public Exchange remove(Object key) {
Exchange ex = store.get(key);
File f = new File(location, ex.getExchangeId());
f.delete();
return store.remove(key);
}
@Override
public int size() {
return store.size();
}
@Override
public Collection<Exchange> values() {
return store.values();
}
private void clearStorage() {
for (File msg : location.listFiles()) {
if (msg.isFile()) {
msg.delete();
}
}
}
private void toStorage(Exchange exchange) {
try {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
df.marshal(exchange, exchange.getIn().getBody(), stream);
stream.writeTo(new FileOutputStream(new File(location, exchange.getExchangeId())));
} catch (Exception e) {
// ignore
}
}
private Exchange fromStorage(File message) {
Exchange exchange = null;
try {
exchange = endpoint.createExchange();
exchange.setExchangeId(message.getName());
exchange.getIn().setBody(df.unmarshal(exchange, new FileInputStream(message)));
} catch (Exception e) {
// ignore
}
return exchange;
}
}
| [
"hzbarcea@gmail.com"
] | hzbarcea@gmail.com |
06be3f747a34086c953bf88a29a16d232934d23b | efa88f2206d92262c5aeced76f2e1ff4fa9670c1 | /src/studio/hdr/lms/dao/IBaseHibernateDAO.java | a324534ce8a1659e87f664580f41c9af59257c51 | [] | no_license | hdr33265/LMS | 961f179dbaeaf4fb356f8218f9e87cb7261778ec | fe46a6d7cc8b5138aa7b2b409c34390fedada5ad | refs/heads/master | 2016-08-11T01:03:30.749757 | 2013-03-31T04:39:16 | 2013-03-31T04:39:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package studio.hdr.lms.dao;
import org.hibernate.Session;
/**
* Data access interface for domain model
* @author MyEclipse Persistence Tools
*/
public interface IBaseHibernateDAO {
public Session getSession();
} | [
"huangdunren@sina.com"
] | huangdunren@sina.com |
9532663c1b60362815190be04322537f0d6be313 | 74e72d6e52673882b276e8b296a037481f490abc | /src/com/manage/service/impl/OrderService.java | 2f0dcc2c6b6d4fd2c5645a36d5dd97e6713cf011 | [] | no_license | javalipan/CS_ShopManage | 22524b2c4220bbad8ba06b014bb51a5a7a55834f | 5a7ed1094265f76c3ff44b9fe77c5caed24f01ce | refs/heads/master | 2021-08-07T23:38:35.713586 | 2020-04-11T13:31:05 | 2020-04-11T13:31:05 | 150,222,860 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,191 | java | package com.manage.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.manage.dao.mapper.OrderMapper;
import com.manage.dao.model.Order;
import com.manage.dao.model.OrderExample;
import com.manage.query.mapper.OrderQueryMapper;
import com.manage.query.model.OrderQuery;
import com.manage.service.IOrderService;
@Service
public class OrderService implements IOrderService {
@Autowired
private OrderMapper orderMapper;
@Autowired
private OrderQueryMapper orderQueryMapper;
public int countByExample(OrderExample example) {
return orderMapper.countByExample(example);
}
public int deleteByExample(OrderExample example) {
return orderMapper.deleteByExample(example);
}
public int deleteByPrimaryKey(Long id) {
return orderMapper.deleteByPrimaryKey(id);
}
public int insertSelective(Order record) {
return orderMapper.insertSelective(record);
}
public List<Order> selectByExample(OrderExample example) {
return orderMapper.selectByExample(example);
}
public Order selectByPrimaryKey(Long id) {
return orderMapper.selectByPrimaryKey(id);
}
public int updateByExampleSelective(Order record, OrderExample example) {
return orderMapper.updateByExampleSelective(record, example);
}
public int updateByPrimaryKeySelective(Order record) {
return orderMapper.updateByPrimaryKeySelective(record);
}
public OrderQuery selectOrderQueryById(Long id) {
return orderQueryMapper.selectOrderQueryById(id);
}
public OrderQuery selectOrderQueryByCode(String code) {
return orderQueryMapper.selectOrderQueryByCode(code);
}
public List<OrderQuery> selectByOrderQuery(OrderQuery orderQuery) {
return orderQueryMapper.selectByOrderQuery(orderQuery);
}
public Integer countByOrderQuery(OrderQuery orderQuery) {
return orderQueryMapper.countByOrderQuery(orderQuery);
}
public Map<String, Object> sumOrder(OrderQuery orderQuery) {
return orderQueryMapper.sumOrder(orderQuery);
}
public List<Map<String, Object>> sumByOldOrNew(String year) {
return orderQueryMapper.sumByOldOrNew(year);
}
public List<Map<String, Object>> sumBrand(String startTime, String endTime,
Long brandid) {
return orderQueryMapper.sumBrand(startTime, endTime, brandid);
}
public List<Map<String, Object>> sumColor(String startTime, String endTime,
Long brandid) {
return orderQueryMapper.sumColor(startTime, endTime, brandid);
}
public List<Map<String, Object>> sumSize(String startTime, String endTime,
Long brandid) {
return orderQueryMapper.sumSize(startTime, endTime, brandid);
}
public List<Map<String, Object>> sumStyle(String startTime, String endTime,
Long brandid) {
return orderQueryMapper.sumStyle(startTime, endTime, brandid);
}
public List<OrderQuery> selectByOrderQuery2(OrderQuery orderQuery) {
return orderQueryMapper.selectByOrderQuery2(orderQuery);
}
public Integer countByOrderQuery2(OrderQuery orderQuery) {
return orderQueryMapper.countByOrderQuery2(orderQuery);
}
}
| [
"javalipan@qq.com"
] | javalipan@qq.com |
b3c4e1057df2b4a4e8ddfa380b551d5ec6747b9c | 7e90a7dcf87b77e7f38659aea946551162cf6a40 | /modules/flowable-app-rest/src/main/java/org/flowable/rest/servlet/ContentDispatcherServletConfiguration.java | 9bc416bc038ebeeebead912eaa008293a1bdb28a | [
"Apache-2.0"
] | permissive | propersoft-cn/flowable-engine | a09e8b2493bb1c4bbdbf83bad085135a317c80ee | fc31003d2f32f6954565502dc8a4cc505500c147 | refs/heads/proper-6.2.1 | 2021-05-09T21:56:51.854651 | 2018-11-15T08:37:30 | 2018-11-15T08:37:30 | 118,738,227 | 0 | 8 | Apache-2.0 | 2019-06-06T01:49:22 | 2018-01-24T08:49:14 | Java | UTF-8 | Java | false | false | 1,139 | java | /* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.rest.servlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
@Configuration
@ComponentScan({ "org.flowable.rest.content.service.api" })
@EnableAsync
public class ContentDispatcherServletConfiguration extends BaseDispatcherServletConfiguration {
protected static final Logger LOGGER = LoggerFactory.getLogger(ContentDispatcherServletConfiguration.class);
}
| [
"tijs.rademakers@gmail.com"
] | tijs.rademakers@gmail.com |
a9d47502c9819fd412b40fbd416f65d755800d61 | 27e5eb73bafde21167cd66b61a91ff27e39c639b | /src/main/java/org/fergonco/music/mjargon/model/SongLine.java | f7aed1d9379c29ae7c1a028952b27469ce53fe41 | [] | no_license | fergonco/MusicJargon | 1ef1a2010dd89004a135dcf6db7d402ade4b79a0 | c5de7d5e5ba078570c58bb7108b49e32cff0f3b5 | refs/heads/master | 2021-01-20T11:47:51.983436 | 2019-04-14T20:15:47 | 2019-04-14T20:15:47 | 101,690,324 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 365 | java | package org.fergonco.music.mjargon.model;
import org.fergonco.music.midi.Dynamic;
public interface SongLine {
boolean isBarline();
Bar[] getBars();
boolean isTempo();
double getTempo();
boolean isRepeat();
int getTarget();
boolean isDynamics();
Dynamic[] getDynamics();
void validate(Model model, int songlineIndex) throws SemanticException;
}
| [
"fernando.gonzalez@geomati.co"
] | fernando.gonzalez@geomati.co |
6c2585af490b4f5fc2585ff2e0f55adb92b14896 | 0b93651bf4c4be26f820702985bd41089026e681 | /modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201802/ContentMetadataTargetingErrorReason.java | 5394f361a5a96278065b3b4c7d3de2ccd06cd15b | [
"Apache-2.0"
] | permissive | cmcewen-postmedia/googleads-java-lib | adf36ccaf717ab486e982b09d69922ddd09183e1 | 75724b4a363dff96e3cc57b7ffc443f9897a9da9 | refs/heads/master | 2021-10-08T16:50:38.364367 | 2018-12-14T22:10:58 | 2018-12-14T22:10:58 | 106,611,378 | 0 | 0 | Apache-2.0 | 2018-12-14T22:10:59 | 2017-10-11T21:26:49 | Java | UTF-8 | Java | false | false | 1,986 | java | // Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.api.ads.dfp.jaxws.v201802;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ContentMetadataTargetingError.Reason.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="ContentMetadataTargetingError.Reason">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="VALUES_DO_NOT_BELONG_TO_A_HIERARCHY"/>
* <enumeration value="UNKNOWN"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "ContentMetadataTargetingError.Reason")
@XmlEnum
public enum ContentMetadataTargetingErrorReason {
/**
*
* One or more of the values specified in a {@code ContentMetadataHierarchyTargeting}
* do not belong to the keys defined in any of the hierarchies on the network.
*
*
*/
VALUES_DO_NOT_BELONG_TO_A_HIERARCHY,
/**
*
* The value returned if the actual value is not exposed by the requested API version.
*
*
*/
UNKNOWN;
public String value() {
return name();
}
public static ContentMetadataTargetingErrorReason fromValue(String v) {
return valueOf(v);
}
}
| [
"api.cseeley@gmail.com"
] | api.cseeley@gmail.com |
583d176d05fbe8efa2bc7a099839833e140ea7be | 689a573e6f76d06f8ee7dc992b114d266027c0cf | /mobile/src/main/java/com/example/kimbe/sunshine/MainActivity.java | 89a255d4a51f77c0fafc94046fbef23ff9811b82 | [] | no_license | littlesparksf/Sunshine | 78ce14a4c760e55467ae23d0f557d77d03f650ea | 542a1f64f45f8b7b77001dfa7c4dfccd3cab8a02 | refs/heads/master | 2021-01-10T08:44:58.944681 | 2016-04-09T04:57:46 | 2016-04-09T04:57:46 | 55,826,824 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,945 | java | /*
* Copyright (C) 2014 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.kimbe.sunshine;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new ForecastFragment())
.commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
} | [
"kimberly@littlesparkmedia.com"
] | kimberly@littlesparkmedia.com |
e9c818e643c6a63ecd95f651d8c88a321ba4a6fe | 078fa13d52ccbbb8aade6dbd5206078cfff50003 | /deweyHis/src/com/dewey/his/param/dao/ChargeRuleSettingDAO.java | fa88b6252567e70792a627c56bab27dff65da643 | [] | no_license | kevonz/dewey | c30e18c118bf0d27b385f0d25e042c76ea53b458 | b7155b96a28d5354651a8f88b0bd68ed3e1212a9 | refs/heads/master | 2021-01-18T08:55:34.894327 | 2012-10-27T08:59:10 | 2012-10-27T08:59:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | package com.dewey.his.param.dao;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import com.dewey.his.param.model.ChargeRuleSetting;
import common.base.dao.hibernate3.Hibernate3Dao;
@Repository("chargeRuleSettingDAO")
public class ChargeRuleSettingDAO extends Hibernate3Dao{
public ChargeRuleSetting getByMerId(long merId) {
String queryString = "from ChargeRuleSetting as model where model.mer.id= ?";
Query queryObject = this.getSessionFactory().getCurrentSession().createQuery(queryString);
queryObject.setParameter(0, merId);
return (ChargeRuleSetting)queryObject.uniqueResult();
}
} | [
"kevonz@live.com"
] | kevonz@live.com |
539f5c93c6a0ee46079a2ba9bbebf8076694b19f | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-14227-4-12-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/migration/AbstractDataMigrationManager_ESTest.java | e4e3327e0084785f50b9587875b895c60cdee49b | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 592 | java | /*
* This file was automatically generated by EvoSuite
* Sat Jan 18 18:29:39 UTC 2020
*/
package com.xpn.xwiki.store.migration;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class AbstractDataMigrationManager_ESTest extends AbstractDataMigrationManager_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
e5595ba83952d2febe3964a1f04b1a884b273674 | 7de3c619f6b10f2b36ccdf5f4e864bf0d3e3c1f5 | /app/src/main/java/com/nerdcastle/nazmul/pettycash/Util.java | 93a95a2f48d77afe3c2586a0838440fa575a9482 | [] | no_license | mdNazmulHasan/PettyCash | e891d859103758da7b608feb819fb481eb1033f0 | 1ccafbe29d014506925177950d190e8e3a5374eb | refs/heads/master | 2021-01-21T13:41:20.548124 | 2016-05-03T05:21:39 | 2016-05-03T05:21:39 | 53,309,990 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 190 | java | package com.nerdcastle.nazmul.pettycash;
/**
* Created by Nazmul on 3/8/2016.
*/
public class Util {
public static final String baseURL="http://dotnet.nerdcastlebd.com/PettyCash/";
}
| [
"najmul.hasan10@gmail.com"
] | najmul.hasan10@gmail.com |
18bb3495c807309061322bd459e96c99feb609f2 | 50ee0e449f842c70c756bcca1af845dfe3701072 | /src/Campaign.java | 2aa9249071c8e0437795f877fc2df36ca0d8c24e | [] | no_license | andvlin/ExHTTPClient | 6f78e1ea661012e02711719a12f31cce3390e63f | c7e176292b65d89d663175fadb8c3b2b59f091d6 | refs/heads/master | 2020-03-23T10:09:25.616938 | 2018-07-18T11:53:42 | 2018-07-18T11:53:42 | 141,428,258 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | public class Campaign {
public float cpm;
public int id;
public String start_date;
public String name;
public int clicks;
public int views;
public Campaign(float cpm, int id, String name, String start_date) {
this.cpm = cpm;
this.id = id;
this.name = name;
this.start_date = start_date;
}
public String getRevenueStr() {
float revenue = (cpm * views) / 1000;
return String.format("%.2f", revenue);
}
}
| [
"andyvlin@gmail.com"
] | andyvlin@gmail.com |
442f9b40a7d711bbd96253c2b30c4509a1c6782a | ca8843436b3151ed6de8053fb577446a7ae2e424 | /src/main/java/org/healthship/jira/client/model/ContainerForRegisteredWebhooks.java | 9618ec17d4768523a2ca46b402909b02db0a49dd | [] | no_license | HealthSHIP/hs-os | f69c08e4af1dac68464eecbdefb000c4fda806b3 | a00c64940076437f3d110d5d8ac8b6316d4a79c7 | refs/heads/master | 2022-12-28T02:35:04.714619 | 2020-10-16T13:02:39 | 2020-10-16T13:02:39 | 304,629,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,290 | java | /*
* Copyright (c) 2020 Ronald MacDonald <ronald@rmacd.com>
*
* 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.
*/
/*
* The Jira Cloud platform REST API
* Jira Cloud platform REST API documentation
*
* The version of the OpenAPI document: 1001.0.0-SNAPSHOT
* Contact: ecosystem@atlassian.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.healthship.jira.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Container for a list of registered webhooks. Webhook details are returned in the same order as the request.
*/
@ApiModel(description = "Container for a list of registered webhooks. Webhook details are returned in the same order as the request.")
@JsonPropertyOrder({
ContainerForRegisteredWebhooks.JSON_PROPERTY_WEBHOOK_REGISTRATION_RESULT
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-03-29T15:40:13.931673+01:00[Europe/London]")
public class ContainerForRegisteredWebhooks {
public static final String JSON_PROPERTY_WEBHOOK_REGISTRATION_RESULT = "webhookRegistrationResult";
private List<RegisteredWebhook> webhookRegistrationResult = null;
public ContainerForRegisteredWebhooks webhookRegistrationResult(List<RegisteredWebhook> webhookRegistrationResult) {
this.webhookRegistrationResult = webhookRegistrationResult;
return this;
}
public ContainerForRegisteredWebhooks addWebhookRegistrationResultItem(RegisteredWebhook webhookRegistrationResultItem) {
if (this.webhookRegistrationResult == null) {
this.webhookRegistrationResult = new ArrayList<>();
}
this.webhookRegistrationResult.add(webhookRegistrationResultItem);
return this;
}
/**
* A list of registered webhooks.
* @return webhookRegistrationResult
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "A list of registered webhooks.")
@JsonProperty(JSON_PROPERTY_WEBHOOK_REGISTRATION_RESULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<RegisteredWebhook> getWebhookRegistrationResult() {
return webhookRegistrationResult;
}
public void setWebhookRegistrationResult(List<RegisteredWebhook> webhookRegistrationResult) {
this.webhookRegistrationResult = webhookRegistrationResult;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContainerForRegisteredWebhooks containerForRegisteredWebhooks = (ContainerForRegisteredWebhooks) o;
return Objects.equals(this.webhookRegistrationResult, containerForRegisteredWebhooks.webhookRegistrationResult);
}
@Override
public int hashCode() {
return Objects.hash(webhookRegistrationResult);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContainerForRegisteredWebhooks {\n");
sb.append(" webhookRegistrationResult: ").append(toIndentedString(webhookRegistrationResult)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"ronald@rm-mba.local"
] | ronald@rm-mba.local |
8297f115791bec08dee79fd792e4688359a9e649 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Gson-16/com.google.gson.internal.$Gson$Types/BBC-F0-opt-70/tests/27/com/google/gson/internal/$Gson$Types_ESTest.java | 73b81795572fde6821b337b02ebac12898581ef6 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 637 | java | /*
* This file was automatically generated by EvoSuite
* Sat Oct 23 04:58:28 GMT 2021
*/
package com.google.gson.internal;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class $Gson$Types_ESTest extends $Gson$Types_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
2ec50bf8350840b39d47e66b549e57272103a60b | 6baa09045c69b0231c35c22b06cdf69a8ce227d6 | /modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201603/cm/AdCustomizerFeedServiceInterfaceget.java | b1c9212cdf0f2708cf551c741fe13f6f2dbea6d2 | [
"Apache-2.0"
] | permissive | remotejob/googleads-java-lib | f603b47117522104f7df2a72d2c96ae8c1ea011d | a330df0799de8d8de0dcdddf4c317d6b0cd2fe10 | refs/heads/master | 2020-12-11T01:36:29.506854 | 2016-07-28T22:13:24 | 2016-07-28T22:13:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,920 | java |
package com.google.api.ads.adwords.jaxws.v201603.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* Returns a list of AdCustomizerFeeds that meet the selector criteria.
*
* @param selector Determines which AdCustomizerFeeds to return. If empty, all AdCustomizerFeeds
* are returned.
* @return The list of AdCustomizerFeeds.
* @throws ApiException Indicates a problem with the request.
*
*
* <p>Java class for get element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="get">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="selector" type="{https://adwords.google.com/api/adwords/cm/v201603}Selector" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"selector"
})
@XmlRootElement(name = "get")
public class AdCustomizerFeedServiceInterfaceget {
protected Selector selector;
/**
* Gets the value of the selector property.
*
* @return
* possible object is
* {@link Selector }
*
*/
public Selector getSelector() {
return selector;
}
/**
* Sets the value of the selector property.
*
* @param value
* allowed object is
* {@link Selector }
*
*/
public void setSelector(Selector value) {
this.selector = value;
}
}
| [
"jradcliff@users.noreply.github.com"
] | jradcliff@users.noreply.github.com |
33a5f669f74f1f39f25ebb267620108ebbe3a4c8 | 8233fd0f7800f7341987ec4072867412c64d133c | /server/common/dao/src/main/java/org/kaaproject/kaa/server/common/dao/impl/LogSchemaDao.java | 101e25750dc97c96ac66a679313c9b8e1b8b1214 | [
"Apache-2.0"
] | permissive | aiyi/kaa | 73e2ab0216f4d2406e82d8e3870c1ea02fcb9903 | 0ba0ee9d5513751e1cf25baa33f273fb4e863acd | refs/heads/master | 2020-12-24T13:52:57.960839 | 2014-08-04T14:55:22 | 2014-08-04T15:03:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,688 | java | /*
* Copyright 2014 CyberVision, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kaaproject.kaa.server.common.dao.impl;
import java.util.List;
/**
* The interface Log Schema dao.
* @param <T> the type parameter
*/
public interface LogSchemaDao<T> extends Dao<T> {
/**
* Find all Log Schemas for Application with specific id
*
* @param applicationId the id of Application
* @return List of Log Schemas
*/
List<T> findByApplicationId(String applicationId);
/**
* Find Log Schema by application id and version.
*
* @param applicationId the application id
* @param version the version of profile schema
* @return the Log Schema
*/
T findByApplicationIdAndVersion(String applicationId, int version);
/**
* Remove by application id.
*
* @param applicationId the application id
*/
void removeByApplicationId(String applicationId);
/**
* Find latest log schema by application id.
*
* @param applicationId the application id
* @return the notification schema
*/
T findLatestLogSchemaByAppId(String applicationId);
}
| [
"ashvayka@cybervisiontech.com"
] | ashvayka@cybervisiontech.com |
d842ee8a24379c55fb7009732f444eca6a2fe989 | 6b544d1fb7640e1f81916ba2f8f9083f9b77ced5 | /KitapOneriUzmanSistem_1_1/src/kitaponeriuzmansistem/KitapOneriUzmanSistem.java | a6658263ef452e4c06c2678c1d988a30e5f5e5ab | [] | no_license | muhendisaysee/kitap-oneri-uzman-sistem | 551f3019f4c8be0ca05d65998a05d4ffe982f009 | 337efe08146680d57c8aceea91f135c9bb133638 | refs/heads/master | 2021-03-26T17:33:54.943706 | 2020-03-16T14:48:25 | 2020-03-16T14:48:25 | 247,726,462 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 949 | 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 kitaponeriuzmansistem;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
*
* @author ayse
*/
public class KitapOneriUzmanSistem extends Application {
//Program başladığında FXMLDocument.fxml arayüzüne yönlendiren function
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
| [
"56216719+muhendisaysee@users.noreply.github.com"
] | 56216719+muhendisaysee@users.noreply.github.com |
62c203dd3496eb5e87c432f8fc2943d82b768bf1 | c5ca42f9de6a0d743bf2f9b4f3af8d391741b6fe | /SistemaConsultas3/src/main/java/br/ufscar/dc/dsw/controller/ProfissionalRestController.java | a44968f1dee7cf8b906e98fe40f0feb725068fbe | [] | no_license | amandapmn/Web1 | f44f9d661a82f81df74e88fb0c56bc8507db9e93 | 14d6b422200540baac73568b033452508568de11 | refs/heads/main | 2023-06-08T06:30:48.261714 | 2021-06-30T10:01:08 | 2021-06-30T10:01:08 | 366,761,844 | 0 | 2 | null | 2021-05-25T12:13:57 | 2021-05-12T15:23:28 | Java | UTF-8 | Java | false | false | 4,462 | java | package br.ufscar.dc.dsw.controller;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.databind.ObjectMapper;
import br.ufscar.dc.dsw.domain.Profissional;
import br.ufscar.dc.dsw.service.spec.IProfissionalService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@RestController
public class ProfissionalRestController {
@Autowired
private IProfissionalService profissionalService;
@Autowired
BCryptPasswordEncoder encoder;
private boolean isJSONValid(String jsonInString) {
try {
return new ObjectMapper().readTree(jsonInString) != null;
} catch (IOException e) {
return false;
}
}
@SuppressWarnings("unchecked")
private void parse(Profissional profissional, JSONObject json) {
profissional.setEmail((String) json.get("email"));
profissional.setSenha(encoder.encode((String) json.get("senha")));
profissional.setCpf((String) json.get("cpf"));
profissional.setPrimeiroNome((String) json.get("primeiroNome"));
profissional.setSobrenome((String) json.get("sobrenome"));
profissional.setPapel("PROFISSIONAL");
profissional.setEspecialidade((String) json.get("especialidade"));
profissional.setQualificacoes((String) json.get("qualificacoes"));
}
@GetMapping(path = "/profissionais")
public ResponseEntity<List<Profissional>> lista() {
List<Profissional> lista = profissionalService.buscarTodos();
if (lista.isEmpty()) {
return ResponseEntity.notFound().build();
}
return ResponseEntity.ok(lista);
}
@GetMapping(path = "/profissionais/{id}")
public ResponseEntity<Profissional> lista(@PathVariable("id") long id) {
Profissional profissional = profissionalService.buscarPorId(id);
if (profissional == null) {
return ResponseEntity.notFound().build();
}
return ResponseEntity.ok(profissional);
}
@GetMapping(path = "/profissionais/especialidades/{nome}")
public ResponseEntity<List<Profissional>> listaEspecialidades(@PathVariable String nome) {
List<Profissional> lista = profissionalService.buscarPorEspecialidade(nome + "%");
if (lista == null) {
return ResponseEntity.notFound().build();
}
return ResponseEntity.ok(lista);
}
@PostMapping(path = "/profissionais")
@ResponseBody
public ResponseEntity<Profissional> cria(@RequestBody JSONObject json) {
try {
if (isJSONValid(json.toString())) {
Profissional profissional = new Profissional();
parse(profissional, json);
profissionalService.salvar(profissional);
return ResponseEntity.ok(profissional);
} else {
return ResponseEntity.badRequest().body(null);
}
} catch (Exception e) {
e.printStackTrace();
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(null);
}
}
@PutMapping(path = "/profissionais/{id}")
public ResponseEntity<Profissional> atualiza(@PathVariable("id") long id, @RequestBody JSONObject json) {
try {
if (isJSONValid(json.toString())) {
Profissional profissional = profissionalService.buscarPorId(id);
if (profissional == null) {
return ResponseEntity.notFound().build();
} else {
parse(profissional, json);
profissionalService.salvar(profissional);
return ResponseEntity.ok(profissional);
}
} else {
return ResponseEntity.badRequest().body(null);
}
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(null);
}
}
@DeleteMapping(path = "/profissionais/{id}")
public ResponseEntity<Boolean> remove(@PathVariable("id") long id) {
Profissional profissional = profissionalService.buscarPorId(id);
if (profissional == null) {
return ResponseEntity.notFound().build();
} else {
profissionalService.excluir(id);
return ResponseEntity.noContent().build();
}
}
}
| [
"nathan.oliveirasc17@gmail.com"
] | nathan.oliveirasc17@gmail.com |
8f9b9399ab7ba033a6830f3cb6238835f98b45f0 | c15a55caac69b0f99e54d8c15a2b0abf32e68099 | /launcher3/src/main/java/com/android/launcher3/allapps/AllAppsContainerView.java | 931e58dd6475c393fdc647d46fe403221b36c963 | [
"Apache-2.0"
] | permissive | xiejin740640431/ElderlyLauncher | b13a85bc6e020884fb4191adbb0c0c05b8cdb434 | 13fe007563f6d3a8c51913f5cf06e54073ff464b | refs/heads/master | 2020-04-09T06:34:02.428418 | 2018-12-03T02:18:20 | 2018-12-03T02:18:20 | 160,118,355 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 24,562 | java | /*
* Copyright (C) 2015 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.android.launcher3.allapps;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.InsetDrawable;
import android.support.v7.widget.RecyclerView;
import android.text.Selection;
import android.text.SpannableStringBuilder;
import android.text.method.TextKeyListener;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.android.launcher3.AppInfo;
import com.android.launcher3.BaseContainerView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeleteDropTarget;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DragSource;
import com.android.launcher3.DropTarget;
import com.android.launcher3.Folder;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherTransitionable;
import cn.colorfuline.elderlylauncher.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.Thunk;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* A merge algorithm that merges every section indiscriminately.
*/
final class FullMergeAlgorithm implements AlphabeticalAppsList.MergeAlgorithm {
@Override
public boolean continueMerging(AlphabeticalAppsList.SectionInfo section,
AlphabeticalAppsList.SectionInfo withSection,
int sectionAppCount, int numAppsPerRow, int mergeCount) {
// Don't merge the predicted apps
if (section.firstAppItem.viewType != AllAppsGridAdapter.ICON_VIEW_TYPE) {
return false;
}
// Otherwise, merge every other section
return true;
}
}
/**
* The logic we use to merge multiple sections. We only merge sections when their final row
* contains less than a certain number of icons, and stop at a specified max number of merges.
* In addition, we will try and not merge sections that identify apps from different scripts.
*/
final class SimpleSectionMergeAlgorithm implements AlphabeticalAppsList.MergeAlgorithm {
private int mMinAppsPerRow;
private int mMinRowsInMergedSection;
private int mMaxAllowableMerges;
private CharsetEncoder mAsciiEncoder;
public SimpleSectionMergeAlgorithm(int minAppsPerRow, int minRowsInMergedSection, int maxNumMerges) {
mMinAppsPerRow = minAppsPerRow;
mMinRowsInMergedSection = minRowsInMergedSection;
mMaxAllowableMerges = maxNumMerges;
mAsciiEncoder = Charset.forName("US-ASCII").newEncoder();
}
@Override
public boolean continueMerging(AlphabeticalAppsList.SectionInfo section,
AlphabeticalAppsList.SectionInfo withSection,
int sectionAppCount, int numAppsPerRow, int mergeCount) {
// Don't merge the predicted apps
if (section.firstAppItem.viewType != AllAppsGridAdapter.ICON_VIEW_TYPE) {
return false;
}
// Continue merging if the number of hanging apps on the final row is less than some
// fixed number (ragged), the merged rows has yet to exceed some minimum row count,
// and while the number of merged sections is less than some fixed number of merges
int rows = sectionAppCount / numAppsPerRow;
int cols = sectionAppCount % numAppsPerRow;
// Ensure that we do not merge across scripts, currently we only allow for english and
// native scripts so we can test if both can just be ascii encoded
boolean isCrossScript = false;
if (section.firstAppItem != null && withSection.firstAppItem != null) {
isCrossScript = mAsciiEncoder.canEncode(section.firstAppItem.sectionName) !=
mAsciiEncoder.canEncode(withSection.firstAppItem.sectionName);
}
return (0 < cols && cols < mMinAppsPerRow) &&
rows < mMinRowsInMergedSection &&
mergeCount < mMaxAllowableMerges &&
!isCrossScript;
}
}
/**
* The all apps view container.
*/
public class AllAppsContainerView extends BaseContainerView implements DragSource,
LauncherTransitionable, View.OnTouchListener, View.OnLongClickListener,
AllAppsSearchBarController.Callbacks {
private static final int MIN_ROWS_IN_MERGED_SECTION_PHONE = 3;
private static final int MAX_NUM_MERGES_PHONE = 2;
@Thunk
Launcher mLauncher;
@Thunk
AlphabeticalAppsList mApps;
private AllAppsGridAdapter mAdapter;
private RecyclerView.LayoutManager mLayoutManager;
private RecyclerView.ItemDecoration mItemDecoration;
@Thunk
View mContent;
@Thunk
View mContainerView;
@Thunk
View mRevealView;
/**
* 全部
*/
@Thunk
AllAppsRecyclerView mAppsRecyclerView;
@Thunk
AllAppsSearchBarController mSearchBarController;
/**
* 搜索框容器
*/
private ViewGroup mSearchBarContainerView;
private View mSearchBarView;
private SpannableStringBuilder mSearchQueryBuilder = null;
private int mSectionNamesMargin;
private int mNumAppsPerRow;
private int mNumPredictedAppsPerRow;
private int mRecyclerViewTopBottomPadding;
// This coordinate is relative to this container view
private final Point mBoundsCheckLastTouchDownPos = new Point(-1, -1);
// This coordinate is relative to its parent
private final Point mIconLastTouchPos = new Point();
private View.OnClickListener mSearchClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent searchIntent = (Intent) v.getTag();
mLauncher.startActivitySafely(v, searchIntent, null);
}
};
public AllAppsContainerView(Context context) {
this(context, null);
}
public AllAppsContainerView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public AllAppsContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
Resources res = context.getResources();
mLauncher = (Launcher) context;
mSectionNamesMargin = res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin);
mApps = new AlphabeticalAppsList(context);
mAdapter = new AllAppsGridAdapter(mLauncher, mApps, this, mLauncher, this);
mApps.setAdapter(mAdapter);
mLayoutManager = mAdapter.getLayoutManager();
mItemDecoration = mAdapter.getItemDecoration();
mRecyclerViewTopBottomPadding =
res.getDimensionPixelSize(R.dimen.all_apps_list_top_bottom_padding);
mSearchQueryBuilder = new SpannableStringBuilder();
Selection.setSelection(mSearchQueryBuilder, 0);
}
/**
* Sets the current set of predicted apps.
*/
public void setPredictedApps(List<ComponentKey> apps) {
mApps.setPredictedApps(apps);
}
/**
* Sets the current set of apps.
*/
public void setApps(List<AppInfo> apps) {
mApps.setApps(apps);
}
/**
* Adds new apps to the list.
*/
public void addApps(List<AppInfo> apps) {
mApps.addApps(apps);
}
/**
* Updates existing apps in the list
*/
public void updateApps(List<AppInfo> apps) {
mApps.updateApps(apps);
}
/**
* Removes some apps from the list.
*/
public void removeApps(List<AppInfo> apps) {
mApps.removeApps(apps);
}
/**
* Sets the search bar that shows above the a-z list.
*/
public void setSearchBarController(AllAppsSearchBarController searchController) {
if (mSearchBarController != null) {
throw new RuntimeException("Expected search bar controller to only be set once");
}
mSearchBarController = searchController;
mSearchBarController.initialize(mApps, this);
// Add the new search view to the layout
View searchBarView = searchController.getView(mSearchBarContainerView);
mSearchBarContainerView.addView(searchBarView);
mSearchBarContainerView.setVisibility(View.GONE);
mSearchBarView = searchBarView;
setHasSearchBar();
updateBackgroundAndPaddings();
}
/**
* Scrolls this list view to the top.
*/
public void scrollToTop() {
mAppsRecyclerView.scrollToTop();
}
/**
* Returns the content view used for the launcher transitions.
*/
public View getContentView() {
return mContainerView;
}
/**
* Returns the all apps search view.
*/
public View getSearchBarView() {
return mSearchBarView;
}
/**
* Returns the reveal view used for the launcher transitions.
*/
public View getRevealView() {
return mRevealView;
}
/**
* Returns an new instance of the default app search controller.
*/
public AllAppsSearchBarController newDefaultAppSearchController() {
return new DefaultAppSearchController(getContext(), this, mAppsRecyclerView);
}
/**
* Focuses the search field and begins an app search.
*/
public void startAppsSearch() {
if (mSearchBarController != null) {
mSearchBarController.focusSearchField();
}
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
boolean isRtl = Utilities.isRtl(getResources());
mAdapter.setRtl(isRtl);
mContent = findViewById(R.id.content);
// This is a focus listener that proxies focus from a view into the list view. This is to
// work around the search box from getting first focus and showing the cursor.
View.OnFocusChangeListener focusProxyListener = new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
mAppsRecyclerView.requestFocus();
}
}
};
mSearchBarContainerView = (ViewGroup) findViewById(R.id.search_box_container);
mSearchBarContainerView.setOnFocusChangeListener(focusProxyListener);
mContainerView = findViewById(R.id.all_apps_container);
mContainerView.setOnFocusChangeListener(focusProxyListener);
mRevealView = findViewById(R.id.all_apps_reveal);
// Load the all apps recycler view
mAppsRecyclerView = (AllAppsRecyclerView) findViewById(R.id.apps_list_view);
mAppsRecyclerView.setApps(mApps);
mAppsRecyclerView.setLayoutManager(mLayoutManager);
mAppsRecyclerView.setAdapter(mAdapter);
mAppsRecyclerView.setHasFixedSize(true);
if (mItemDecoration != null) {
mAppsRecyclerView.addItemDecoration(mItemDecoration);
}
updateBackgroundAndPaddings();
}
@Override
public void onBoundsChanged(Rect newBounds) {
mLauncher.updateOverlayBounds(newBounds);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// Update the number of items in the grid before we measure the view
int availableWidth = !mContentBounds.isEmpty() ? mContentBounds.width() :
MeasureSpec.getSize(widthMeasureSpec);
DeviceProfile grid = mLauncher.getDeviceProfile();
grid.updateAppsViewNumCols(getResources(), availableWidth);
if (mNumAppsPerRow != grid.allAppsNumCols ||
mNumPredictedAppsPerRow != grid.allAppsNumPredictiveCols) {
mNumAppsPerRow = grid.allAppsNumCols;
mNumPredictedAppsPerRow = grid.allAppsNumPredictiveCols;
// If there is a start margin to draw section names, determine how we are going to merge
// app sections
boolean mergeSectionsFully = mSectionNamesMargin == 0 || !grid.isPhone;
AlphabeticalAppsList.MergeAlgorithm mergeAlgorithm = mergeSectionsFully ?
new FullMergeAlgorithm() :
new SimpleSectionMergeAlgorithm((int) Math.ceil(mNumAppsPerRow / 2f),
MIN_ROWS_IN_MERGED_SECTION_PHONE, MAX_NUM_MERGES_PHONE);
mAppsRecyclerView.setNumAppsPerRow(grid, mNumAppsPerRow);
mAdapter.setNumAppsPerRow(mNumAppsPerRow);
mApps.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow, mergeAlgorithm);
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
/**
* Update the background and padding of the Apps view and children. Instead of insetting the
* container view, we inset the background and padding of the recycler view to allow for the
* recycler view to handle touch events (for fast scrolling) all the way to the edge.
*/
@Override
protected void onUpdateBackgroundAndPaddings(Rect searchBarBounds, Rect padding) {
boolean isRtl = Utilities.isRtl(getResources());
// TODO: Use quantum_panel instead of quantum_panel_shape
InsetDrawable background = new InsetDrawable(
getResources().getDrawable(R.drawable.quantum_panel_shape), padding.left, 0,
padding.right, 0);
Rect bgPadding = new Rect();
background.getPadding(bgPadding);
mContainerView.setBackground(background);
mRevealView.setBackground(background.getConstantState().newDrawable());
mAppsRecyclerView.updateBackgroundPadding(bgPadding);
mAdapter.updateBackgroundPadding(bgPadding);
// Hack: We are going to let the recycler view take the full width, so reset the padding on
// the container to zero after setting the background and apply the top-bottom padding to
// the content view instead so that the launcher transition clips correctly.
mContent.setPadding(0, padding.top, 0, padding.bottom);
mContainerView.setPadding(0, 0, 0, 0);
// Pad the recycler view by the background padding plus the start margin (for the section
// names)
// int startInset = Math.max(mSectionNamesMargin, mAppsRecyclerView.getMaxScrollbarWidth());
// int topBottomPadding = mRecyclerViewTopBottomPadding;
// if (isRtl) {
// mAppsRecyclerView.setPadding(padding.left + mAppsRecyclerView.getMaxScrollbarWidth(),
// topBottomPadding, padding.right + startInset, topBottomPadding);
// } else {
// mAppsRecyclerView.setPadding(padding.left + startInset, topBottomPadding,
// padding.right + mAppsRecyclerView.getMaxScrollbarWidth(), topBottomPadding);
// }
// Inset the search bar to fit its bounds above the container
if (mSearchBarView != null) {
Rect backgroundPadding = new Rect();
if (mSearchBarView.getBackground() != null) {
mSearchBarView.getBackground().getPadding(backgroundPadding);
}
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
mContent.getLayoutParams();
lp.leftMargin = searchBarBounds.left;
lp.topMargin = searchBarBounds.top;
lp.rightMargin = (getMeasuredWidth() - searchBarBounds.right);
mContent.requestLayout();
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// Determine if the key event was actual text, if so, focus the search bar and then dispatch
// the key normally so that it can process this key event
if (!mSearchBarController.isSearchFieldFocused() &&
event.getAction() == KeyEvent.ACTION_DOWN) {
final int unicodeChar = event.getUnicodeChar();
final boolean isKeyNotWhitespace = unicodeChar > 0 &&
!Character.isWhitespace(unicodeChar) && !Character.isSpaceChar(unicodeChar);
if (isKeyNotWhitespace) {
boolean gotKey = TextKeyListener.getInstance().onKeyDown(this, mSearchQueryBuilder,
event.getKeyCode(), event);
if (gotKey && mSearchQueryBuilder.length() > 0) {
mSearchBarController.focusSearchField();
}
}
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return handleTouchEvent(ev);
}
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent ev) {
return handleTouchEvent(ev);
}
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent ev) {
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE:
mIconLastTouchPos.set((int) ev.getX(), (int) ev.getY());
break;
}
return false;
}
@Override
public boolean onLongClick(View v) {
// Return early if this is not initiated from a touch
if (!v.isInTouchMode()) return false;
// When we have exited all apps or are in transition, disregard long clicks
if (!mLauncher.isAppsViewVisible() ||
mLauncher.getWorkspace().isSwitchingState()) return false;
// Return if global dragging is not enabled
if (!mLauncher.isDraggingEnabled()) return false;
// Start the drag
mLauncher.getWorkspace().beginDragShared(v, mIconLastTouchPos, this, false);
// Enter spring loaded mode
mLauncher.enterSpringLoadedDragMode();
return false;
}
@Override
public boolean supportsFlingToDelete() {
return true;
}
@Override
public boolean supportsAppInfoDropTarget() {
return true;
}
@Override
public boolean supportsDeleteDropTarget() {
return false;
}
@Override
public float getIntrinsicIconScaleFactor() {
DeviceProfile grid = mLauncher.getDeviceProfile();
return (float) grid.allAppsIconSizePx / grid.iconSizePx;
}
@Override
public void onFlingToDeleteCompleted() {
// We just dismiss the drag when we fling, so cleanup here
mLauncher.exitSpringLoadedDragModeDelayed(true,
Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT, null);
mLauncher.unlockScreenOrientation(false);
}
@Override
public void onDropCompleted(View target, DropTarget.DragObject d, boolean isFlingToDelete,
boolean success) {
if (isFlingToDelete || !success || (target != mLauncher.getWorkspace() &&
!(target instanceof DeleteDropTarget) && !(target instanceof Folder))) {
// Exit spring loaded mode if we have not successfully dropped or have not handled the
// drop in Workspace
mLauncher.exitSpringLoadedDragModeDelayed(true,
Launcher.EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT, null);
}
mLauncher.unlockScreenOrientation(false);
// Display an error message if the drag failed due to there not being enough space on the
// target layout we were dropping on.
if (!success) {
boolean showOutOfSpaceMessage = false;
if (target instanceof Workspace) {
int currentScreen = mLauncher.getCurrentWorkspaceScreen();
Workspace workspace = (Workspace) target;
CellLayout layout = (CellLayout) workspace.getChildAt(currentScreen);
ItemInfo itemInfo = (ItemInfo) d.dragInfo;
if (layout != null) {
showOutOfSpaceMessage =
!layout.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY);
}
}
if (showOutOfSpaceMessage) {
mLauncher.showOutOfSpaceMessage(false);
}
d.deferDragViewCleanupPostAnimation = false;
}
}
@Override
public void onLauncherTransitionPrepare(Launcher l, boolean animated, boolean toWorkspace) {
// Do nothing
}
@Override
public void onLauncherTransitionStart(Launcher l, boolean animated, boolean toWorkspace) {
// Do nothing
}
@Override
public void onLauncherTransitionStep(Launcher l, float t) {
// Do nothing
}
@Override
public void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace) {
if (toWorkspace) {
// Reset the search bar and base recycler view after transitioning home
mSearchBarController.reset();
mAppsRecyclerView.reset();
}
}
/**
* Handles the touch events to dismiss all apps when clicking outside the bounds of the
* recycler view.
*/
private boolean handleTouchEvent(MotionEvent ev) {
DeviceProfile grid = mLauncher.getDeviceProfile();
int x = (int) ev.getX();
int y = (int) ev.getY();
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
if (!mContentBounds.isEmpty()) {
// Outset the fixed bounds and check if the touch is outside all apps
Rect tmpRect = new Rect(mContentBounds);
tmpRect.inset(-grid.allAppsIconSizePx / 2, 0);
if (ev.getX() < tmpRect.left || ev.getX() > tmpRect.right) {
mBoundsCheckLastTouchDownPos.set(x, y);
return true;
}
} else {
// Check if the touch is outside all apps
if (ev.getX() < getPaddingLeft() ||
ev.getX() > (getWidth() - getPaddingRight())) {
mBoundsCheckLastTouchDownPos.set(x, y);
return true;
}
}
break;
case MotionEvent.ACTION_UP:
if (mBoundsCheckLastTouchDownPos.x > -1) {
ViewConfiguration viewConfig = ViewConfiguration.get(getContext());
float dx = ev.getX() - mBoundsCheckLastTouchDownPos.x;
float dy = ev.getY() - mBoundsCheckLastTouchDownPos.y;
float distance = (float) Math.hypot(dx, dy);
if (distance < viewConfig.getScaledTouchSlop()) {
// The background was clicked, so just go home
Launcher launcher = (Launcher) getContext();
launcher.showWorkspace(true);
return true;
}
}
// Fall through
case MotionEvent.ACTION_CANCEL:
mBoundsCheckLastTouchDownPos.set(-1, -1);
break;
}
return false;
}
@Override
public void onSearchResult(String query, ArrayList<ComponentKey> apps) {
if (apps != null) {
mApps.setOrderedFilter(apps);
mAdapter.setLastSearchQuery(query);
mAppsRecyclerView.onSearchResultsChanged();
}
}
@Override
public void clearSearchResult() {
mApps.setOrderedFilter(null);
mAppsRecyclerView.onSearchResultsChanged();
// Clear the search query
mSearchQueryBuilder.clear();
mSearchQueryBuilder.clearSpans();
Selection.setSelection(mSearchQueryBuilder, 0);
}
}
| [
"740640431@qq.com"
] | 740640431@qq.com |
5198f3bc491c5e942a2e51ddb14e85325bed5537 | 31b23283e8f6be897b4dfc79e615acec1c39b234 | /src/main/java/com/obd/mapper/pid/PIDInformationMaker.java | e31d18e68aa732e62e4df2ffeea324970fbaaba8 | [
"Unlicense"
] | permissive | deshanchathusanka/obd-java-kit | 135cbd56373a587a2e6fd4171f771d5e83f41cdd | 81d4b85d62f016a2489c86d3a5bfd434d504bb36 | refs/heads/master | 2022-05-26T13:00:38.186311 | 2020-03-01T06:26:51 | 2020-03-01T06:26:51 | 242,566,718 | 0 | 0 | Unlicense | 2022-05-20T21:28:46 | 2020-02-23T18:13:49 | Java | UTF-8 | Java | false | false | 9,460 | java | package com.obd.mapper.pid;
import com.obd.mapper.VehicleDetailsStoreMan;
import com.obd.mapper.operation.HexUtils;
import org.apache.commons.codec.binary.Hex;
/**
* Created by Deshan on 10/13/16.
*/
public class PIDInformationMaker {
String[] obdRequirmentArray={
"",
"OBD II (California ARB)",
"OBD (Federal EPA)",
"OBD and OBD II",
"OBD I",
"Not OBD compliant",
"EOBD",
"EOBD and OBD II",
"EOBD and OBD",
"EOBD, OBD and OBD II",
"JOBD",
"JOBD and OBD II",
"JOBD and EOBD",
"JOBD, EOBD, and OBD II",
"Heavy Duty Vehicles (EURO IV) B1",
"Heavy Duty Vehicles (EURO V) B2",
"Heavy Duty Vehicles (EURO EEC)",
"Engine Manufacturer Diagnostics (EMD)"
};
private VehicleDetailsStoreMan vehicleDetailsStoreMan;
public PIDInformationMaker(VehicleDetailsStoreMan vehicleDetailsStoreMan){
this.vehicleDetailsStoreMan = vehicleDetailsStoreMan;
}
public void setPidInformation(String pidStr, String pidDataStr){
char[] pidStrChar = pidStr.toCharArray();
pidStrChar[1] = Character.toLowerCase(pidStrChar[1]);
pidStr = String.valueOf(pidStrChar);
if ("04".equals(pidStr)) {
vehicleDetailsStoreMan.setCalculatedLoadValue_percentage(getCalculatedLoadValue(pidDataStr));
} else if ("05".equals(pidStr)) {
vehicleDetailsStoreMan.setEngineCoolentTemperature(getEngineCoolentTemperature(pidDataStr));
} else if ("0a".equals(pidStr)) {
vehicleDetailsStoreMan.setFuelRailPressure(getFuelRailPressure(pidDataStr));
} else if ("0b".equals(pidStr)) {
vehicleDetailsStoreMan.setIntakeManifoldAbsoluteTemperature(getIntakeManifoldAbsoluteTemperature(pidDataStr));
} else if ("0c".equals(pidStr)) {
vehicleDetailsStoreMan.setEngineRPM(getEngineRPM(pidDataStr));
} else if ("0d".equals(pidStr)) {
vehicleDetailsStoreMan.setSpeed(getVehicleSpeed(pidDataStr));
} else if ("0f".equals(pidStr)) {
vehicleDetailsStoreMan.setIntakeAirTemparature(getIntakeAirTemparature(pidDataStr));
} else if ("10".equals(pidStr)) {
vehicleDetailsStoreMan.setMafAirFlowRat(getMAFAirFlowRate(pidDataStr));
} else if ("11".equals(pidStr)) {
vehicleDetailsStoreMan.setAbsoluteThrottlePosition(getAbsoluteThrottlePosition(pidDataStr));
} else if ("1c".equals(pidStr)) {
vehicleDetailsStoreMan.setObdRequirement(getOBDRequirment(pidDataStr));
} else if ("1f".equals(pidStr)) {
vehicleDetailsStoreMan.setTimeSinceEngineStart(getTimeSinceEngineStart(pidDataStr));
} else if ("21".equals(pidStr)) {
vehicleDetailsStoreMan.setDistanceTraveledWhileMILisActivated(getDistanceTraveledWhileMILisActivated(pidDataStr));
} else if ("2f".equals(pidStr)) {
vehicleDetailsStoreMan.setFuelLevel(getFuelLevelInput(pidDataStr));
} else if ("30".equals(pidStr)) {
vehicleDetailsStoreMan.setNoOfWarmUpsSinceDTCsCleared(getNoOfWarmUpsSinceDTCsCleared(pidDataStr));
} else if ("31".equals(pidStr)) {
vehicleDetailsStoreMan.setDistanceTraveledSinceDTCsCleared(getDistanceTraveledSinceDTCsCleared(pidDataStr));
} else if ("33".equals(pidStr)) {
vehicleDetailsStoreMan.setBarometricPressure(getBarometricPressure(pidDataStr));
} else if ("42".equals(pidStr)) {
vehicleDetailsStoreMan.setControlModuleVoltage(getControlModuleVoltage(pidDataStr));
} else if ("43".equals(pidStr)) {
vehicleDetailsStoreMan.setAbsoluteLoadValue(getAbsoluteLoadValue(pidDataStr));
} else if ("46".equals(pidStr)) {
vehicleDetailsStoreMan.setAmbientAirTemperature(getAmbientAirTemperature(pidDataStr));
} else if ("4c".equals(pidStr)) {
vehicleDetailsStoreMan.setCommandedThrottleActuatorControl(getCommandedThrottleActuatorControl(pidDataStr));
} else if ("4d".equals(pidStr)) {
vehicleDetailsStoreMan.setEngineRunTimeWhileMILON(getEngineRunTimeWhileMILON(pidDataStr));
} else if ("4e".equals(pidStr)) {
vehicleDetailsStoreMan.setEngineRunTimeSinceDTCsCleared(getEngineRunTimeSinceDTCsCleared(pidDataStr));
} else if ("52".equals(pidStr)) {
vehicleDetailsStoreMan.setAlcoholFuelPercentage(getAlcoholFuelPercentage(pidDataStr));
}
}
private String getEngineCoolentTemperature(String pidDataStr) {
String engineCoolentTemperature = Integer.toString(Integer.parseInt(pidDataStr,16));
return engineCoolentTemperature;
}
private String getIntakeManifoldAbsoluteTemperature(String pidDataStr){
String intakeManifoldAbsoluteTemperature = Integer.toString(Integer.parseInt(pidDataStr,16));
return intakeManifoldAbsoluteTemperature;
}
private String getEngineRPM(String pidDataStr){
String engineRPM = Integer.toString(Integer.parseInt(HexUtils.getReverseOrderedHexString(pidDataStr),16));
return engineRPM;
}
private String getVehicleSpeed(String pidDataStr){
String speed = Integer.toString(Integer.parseInt(pidDataStr,16));
return speed;
}
private String getIntakeAirTemparature(String pidDataStr){
String intakeAirTemparature = Integer.toString(Integer.parseInt(pidDataStr,16));
return intakeAirTemparature;
}
private String getMAFAirFlowRate(String pidDataStr){
String mafAirFlowRate = Double.toString(Integer.parseInt(pidDataStr,16)*0.01);
return mafAirFlowRate;
}
private String getCalculatedLoadValue(String pidDataStr){
String calculatedLoadValue=Integer.toString(Integer.parseInt(pidDataStr,16));
return calculatedLoadValue;
}
private String getFuelRailPressure(String pidDataStr){
String fuelRailPressure=Integer.toString(Integer.parseInt(HexUtils.getReverseOrderedHexString(pidDataStr),16));
return fuelRailPressure;
}
private String getAbsoluteThrottlePosition(String pidDataStr){
String absoluteThrottlePosition=Integer.toString(Integer.parseInt(pidDataStr,16));
return absoluteThrottlePosition;
}
private String getOBDRequirment(String pidDataStr){
String obdRequirment=obdRequirmentArray[Integer.parseInt(pidDataStr,16)];
return obdRequirment;
}
private String getTimeSinceEngineStart(String pidDataStr){
String timeSinceEngineStart=Integer.toString(Integer.parseInt(HexUtils.getReverseOrderedHexString(pidDataStr),16));
return timeSinceEngineStart;
}
private String getDistanceTraveledWhileMILisActivated(String pidDataStr){
String distanceTraveledWhileMILisActivated=Integer.toString(Integer.parseInt(HexUtils.getReverseOrderedHexString(pidDataStr),16));
return distanceTraveledWhileMILisActivated;
}
private String getFuelLevelInput(String pidDataStr){
String fuelLevelInput=Integer.toString(Integer.parseInt(pidDataStr,16));
return fuelLevelInput;
}
private String getNoOfWarmUpsSinceDTCsCleared(String pidDataStr){
String noOfWarmUpsSinceDTCsCleared=Integer.toString(Integer.parseInt(pidDataStr,16));
return noOfWarmUpsSinceDTCsCleared;
}
private String getDistanceTraveledSinceDTCsCleared(String pidDataStr){
String distanceTraveledSinceDTCsCleared=Integer.toString(Integer.parseInt(HexUtils.getReverseOrderedHexString(pidDataStr),16));
return distanceTraveledSinceDTCsCleared;
}
private String getBarometricPressure(String pidDataStr){
String barometricPressure=Integer.toString(Integer.parseInt(pidDataStr,16));
return barometricPressure;
}
private String getControlModuleVoltage(String pidDataStr){
String controlModuleVoltage=Double.toString(Integer.parseInt(HexUtils.getReverseOrderedHexString(pidDataStr),16)/1000.0);
return controlModuleVoltage;
}
private String getAbsoluteLoadValue(String pidDataStr){
String absoluteLoadValue=Integer.toString(Integer.parseInt(pidDataStr,16));
return absoluteLoadValue;
}
private String getAmbientAirTemperature(String pidDataStr){
String ambientAirTemperature=Integer.toString(Integer.parseInt(pidDataStr,16));
return ambientAirTemperature;
}
private String getCommandedThrottleActuatorControl(String pidDataStr){
String commandedThrottleActuatorControl=Integer.toString(Integer.parseInt(pidDataStr,16));
return commandedThrottleActuatorControl;
}
private String getEngineRunTimeWhileMILON(String pidDataStr){
String engineRunTimeWhileMILOn=Integer.toString(Integer.parseInt(HexUtils.getReverseOrderedHexString(pidDataStr),16));
return engineRunTimeWhileMILOn;
}
private String getEngineRunTimeSinceDTCsCleared(String pidDataStr){
String engineRunTimeSinceDTCsCleared=Integer.toString(Integer.parseInt(HexUtils.getReverseOrderedHexString(pidDataStr),16));
return engineRunTimeSinceDTCsCleared;
}
private String getAlcoholFuelPercentage(String pidDataStr){
String alcoholFuelPercentage=Integer.toString(Integer.parseInt(pidDataStr,16));
return alcoholFuelPercentage;
}
}
| [
"d.chathusanka@gmail.com"
] | d.chathusanka@gmail.com |
43eed3bf2da6fc703657d19521c9fca9d6a75460 | 02ea43c90973437de5e9776b48e0ecbd5e54d790 | /src/DecoratorPattern/Decorator.java | df5be83e6e0a5ab71e28e008f78874928be625bb | [] | no_license | glumes/DesignPattern | bdc68ed2620e79dc0c63611ad65456a5e8a09644 | 5af79a2aa92b3fac247aa80db2a7290b8ed965c5 | refs/heads/master | 2021-01-12T12:16:20.277141 | 2017-01-18T03:04:07 | 2017-01-18T03:04:07 | 72,402,820 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package DecoratorPattern;
/**
* Created by zhaoying on 2016/12/16.
*/
public abstract class Decorator implements Component{
private Component mComponent ;
public Decorator(Component mComponent) {
this.mComponent = mComponent;
}
@Override
public void operate() {
mComponent.operate();
}
}
| [
"zhaoying9402@gmail.com"
] | zhaoying9402@gmail.com |
a1cdf57488810f7cf1b16e923369a7db7e309306 | 5fe8047266a1147e6ce5a2ce21be93468db0dd4f | /src/test/java/com/example/library/mode/repository/BookRepositoryTest.java | 4c4aa9646ae5a44c2a578fa729cf7368e6afe818 | [] | no_license | caiusmuniz/library-api | 1963d81eeb501ffe05623403c4117cbc94cafef3 | ca377def05a7f0ee6cd8da0d5113119f0e8cbbf1 | refs/heads/master | 2023-05-27T21:22:13.113709 | 2021-06-10T18:12:18 | 2021-06-10T18:12:18 | 375,771,785 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,838 | java | package com.example.library.mode.repository;
import com.example.library.model.entity.Book;
import com.example.library.model.repository.BookRepository;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(SpringExtension.class)
@ActiveProfiles("test")
@DataJpaTest
public class BookRepositoryTest {
@Autowired
TestEntityManager entityManager;
@Autowired
BookRepository repository;
@Test
@DisplayName("Deve retornar verdadeiro quando existir um livro na base com o ISBN informado.")
public void returnTrueWhenIsbnExists() {
// cenario
String isbn = "123";
Book book = createNewBook(isbn);
entityManager.persist(book);
// execução
boolean exists = repository.existsByIsbn(isbn);
// verificação
assertThat(exists).isTrue();
}
@Test
@DisplayName("Deve retornar falso quando existir um livro na base com o ISBN informado.")
public void returnFalseWhenIsbnExists() {
// cenario
String isbn = "123";
// execução
boolean exists = repository.existsByIsbn(isbn);
// verificação
assertThat(exists).isFalse();
}
@Test
@DisplayName("Deve obter um livro por Id.")
public void findByIdTest() {
// cenário
Book book = createNewBook("123");
entityManager.persist(book);
// execução
Optional<Book> foundBook = repository.findById(book.getId());
// verificação
assertThat(foundBook.isPresent()).isTrue();
}
@Test
@DisplayName("Deve salvar um livro.")
public void saveBookTest() {
Book book = createNewBook("123");
Book savedBook = repository.save(book);
assertThat(savedBook.getId()).isNotNull();
}
@Test
@DisplayName("Deve excluir um livro.")
public void deleteBookTest() {
Book book = createNewBook("123");
entityManager.persist(book);
Book foundBook = entityManager.find(Book.class, book.getId());
repository.delete(foundBook);
Book deletedBook = entityManager.find(Book.class, book.getId());
assertThat(deletedBook).isNull();
}
public static Book createNewBook(String isbn) {
return Book.builder().author("Author").title("Title").isbn(isbn).build();
}
}
| [
"caius.muniz@gmail.com"
] | caius.muniz@gmail.com |
7b5410e4c114715ee964d1effead688df473ec1c | 5887acadd7a0f2e042c39338e41e3eb962398b16 | /Discrete Mathematics/Lab05_Automata/A_WordAcceptDka.java | 5d84c75b9d8867f1102a8acd8bf10bd9f58a6200 | [] | no_license | andrey-star/itmo-labs | bd23560c2873245cfde96b9b5d49766036850740 | 79bb67dc2a4134355dec9fa8ce5f82840fc72a99 | refs/heads/master | 2023-01-06T12:11:26.824877 | 2022-12-28T20:08:46 | 2022-12-28T20:08:46 | 218,313,068 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,428 | java | import java.io.*;
import java.util.Arrays;
public class A_WordAcceptDka {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream("problem1.in")));
String s = in.readLine();
String[] line = in.readLine().trim().split(" +");
int n = Integer.parseInt(line[0]);
int m = Integer.parseInt(line[1]);
int k = Integer.parseInt(line[2]);
int[][] g = new int[n]['z' - 'a' + 1];
for (int[] ints : g) {
Arrays.fill(ints, -1);
}
int[] term = new int[k];
line = in.readLine().trim().split(" +");
for (int i = 0; i < k; i++) {
term[i] = Integer.parseInt(line[i]) - 1;
}
for (int i = 0; i < m; i++) {
line = in.readLine().trim().split(" +");
int a = Integer.parseInt(line[0]) - 1;
int b = Integer.parseInt(line[1]) - 1;
char c = line[2].charAt(0);
g[a][c - 'a'] = b;
}
int cur = 0;
boolean ok = true;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (g[cur][c - 'a'] == -1) {
ok = false;
break;
}
cur = g[cur][c - 'a'];
}
PrintWriter out = new PrintWriter(new File("problem1.out"));
if (!ok) {
out.println("Rejects");
} else {
ok = false;
for (int i = 0; i < k; i++) {
if (term[i] == cur) {
ok = true;
break;
}
}
if (ok) {
out.println("Accepts");
} else {
out.println("Rejects");
}
}
out.close();
}
}
| [
"fastrazor2000@gmail.com"
] | fastrazor2000@gmail.com |
b79c630ce8c52522a282b1e43e8e434bbe49e970 | 1cbefa0d6358368cd40c130eabb4ab7120822c63 | /app/src/androidTest/java/com/smasite/mimascota/ExampleInstrumentedTest.java | 79b9a22c37f99b243064730421a75ce2e393094f | [] | no_license | JuanAraiza/MiMascota130517 | 273c506750e67330adc24289a3894f69ec8945d2 | f58505d579bdcf991823c7a62465703c44e7a0cd | refs/heads/master | 2020-12-30T15:54:34.149009 | 2017-05-13T15:22:24 | 2017-05-13T15:22:24 | 91,183,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 746 | java | package com.smasite.mimascota;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.smasite.mimascota", appContext.getPackageName());
}
}
| [
"jaraza15@gmail.com"
] | jaraza15@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.