blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bdad1c861012d5b18a0d9f0e266f73d728f711d8 | e82c1473b49df5114f0332c14781d677f88f363f | /MED-CLOUD/med-service/src/test/java/nta/med/service/integration/inps/INP1003U00grdInpReserGridColumnChangeddtReserTest.java | 4653cecea757be649ee60a7c12d60760802427dd | [] | no_license | zhiji6/mih | fa1d2279388976c901dc90762bc0b5c30a2325fc | 2714d15853162a492db7ea8b953d5b863c3a8000 | refs/heads/master | 2023-08-16T18:35:19.836018 | 2017-12-28T09:33:19 | 2017-12-28T09:33:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package nta.med.service.integration.inps;
import org.junit.Test;
import nta.med.common.remoting.rpc.protobuf.Rpc;
import nta.med.service.ihis.proto.InpsServiceProto;
import nta.med.service.integration.MessageRequestTest;
/**
* @author vnc.tuyen
*/
public class INP1003U00grdInpReserGridColumnChangeddtReserTest extends MessageRequestTest {
@Test
public void test () throws Exception{
InpsServiceProto.INP1003U00grdInpReserGridColumnChangeddtReserRequest request = InpsServiceProto.INP1003U00grdInpReserGridColumnChangeddtReserRequest.newBuilder()
.setHospCode("323")
.setBunho("000048256")
.build();
sentRequestToMedApp(request, InpsServiceProto.getDescriptor().getOptions().getExtension(Rpc.service));
}
}
| [
"duc_nt@nittsusystem-vn.com"
] | duc_nt@nittsusystem-vn.com |
1e7fd1d1a1ae15137b00b2a35884e776eb47caf8 | 45e1992ffe47469624b93fe1937dbdb4f541600f | /src/main/java/com/youyuan/topic/persist/JmsProducer.java | c88446f67b2c51ef7f37c50063b01606bdffe5ea | [] | no_license | zhangyu2046196/ActiveMQ_Demo | bd7cda7109846638f16588edd61cbde12b691e28 | 9db64a3c5bb5d2f0baad058e30acac9bd35a6a81 | refs/heads/master | 2022-11-19T15:38:13.952231 | 2020-01-05T02:34:08 | 2020-01-05T02:34:08 | 231,857,451 | 0 | 0 | null | 2022-10-19T01:52:05 | 2020-01-05T02:32:42 | Java | UTF-8 | Java | false | false | 1,852 | java | package com.youyuan.topic.persist;
import org.apache.activemq.ActiveMQConnectionFactory;
import javax.jms.*;
/**
* @author zhangy
* @version 1.0
* @description 测试持久化的topic,当订阅者topicSubscribe注册到topic后关机,开机后还能收到生产者发送的消息
* @date 2019/12/26 8:46
*/
public class JmsProducer {
//定义服务器IP
private final static String HOST = "192.168.1.18";
//定义服务器端口号
private final static int PORT = 61616;
//定义服务器地址
private final static String ACTIVEMQ_URL = "tcp://" + HOST + ":" + PORT;
//定义topic名称
private final static String TOPIC_NAME = "topic-youyuan01";
public static void main(String[] args) throws JMSException {
//1、创建ConnectionFactory
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(ACTIVEMQ_URL);
//2、创建Connection
Connection connection = connectionFactory.createConnection();
//3、创建Session 第一个参数是否开启事务 第二个参数是否自动应答
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
//4、创建topic
Topic topic = session.createTopic(TOPIC_NAME);
//5、创建生产者
MessageProducer producer = session.createProducer(topic);
//6、打开连接
connection.start();
for (int i = 1; i <= 3; i++) {
//7、循环发送数据
TextMessage textMessage = session.createTextMessage("这是持久化topic-youyuan01的topic的" + i + "记录");
producer.send(textMessage);
}
//8、关闭资源
producer.close();
session.close();
connection.close();
System.out.println("生产者发送消息到持久化topic的MQ");
}
}
| [
"zhangyu2046196@163.com"
] | zhangyu2046196@163.com |
58cb1a66999a1ec589fc571edb22dee41347cd35 | ee4c1b5038be80569c394dc8c342ba9e5bdfa545 | /filescanner/src/main/java/com/gerenvip/filescaner/FileScanner.java | e6aa9ac516e282e32bf2a58cf5871669f0c11431 | [] | no_license | zhiaixinyang/EasyCopy | b48966f9a97408b10f18be265638ea4dbf2c8089 | 2c23015ef59e315170f5d4f406d7158dfeb503e4 | refs/heads/master | 2020-03-25T17:44:49.927783 | 2018-10-11T09:47:34 | 2018-10-11T09:47:34 | 143,993,362 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,288 | java | package com.gerenvip.filescaner;
import android.content.Context;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.gerenvip.filescaner.log.Logger;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
/**
* 文件扫描入口类
*
* @author wangwei on 2017/11/2.
* wangwei@jiandaola.com
*/
public class FileScanner {
public static final String TAG = "FileScanner";
/**
* 大文件
*/
public static final int SUPPORT_FILE_TYPE_LARGEFILE = 1;
/**
* 音频文件
*/
public static final int SUPPORT_FILE_TYPE_AUDIO = 2;
/**
* 视频文件
*/
public static final int SUPPORT_FILE_TYPE_VIDEO = 3;
/**
* 图片
*/
public static final int SUPPORT_FILE_TYPE_IMAGE = 4;
/**
* Apk
*/
public static final int SUPPORT_FILE_TYPE_APK = 5;
private IFileScanFilter mFilter;
/**
* 每一种支持类型都会独立拥有一个数据库表
*/
@IntDef(value = {SUPPORT_FILE_TYPE_LARGEFILE, SUPPORT_FILE_TYPE_AUDIO, SUPPORT_FILE_TYPE_VIDEO, SUPPORT_FILE_TYPE_IMAGE, SUPPORT_FILE_TYPE_APK})
@Retention(RetentionPolicy.SOURCE)
public @interface SupportFileType {
}
public static final int SCANNER_TYPE_ADD = 1;
public static final int SCANNER_TYPE_DEL = 2;
@IntDef(value = {SCANNER_TYPE_ADD, SCANNER_TYPE_DEL})
@Retention(RetentionPolicy.SOURCE)
public @interface ScannerType {
}
private Context mContext;
@SupportFileType
private int mCurrentType = SUPPORT_FILE_TYPE_LARGEFILE;
private FileScannerListener mScanListener;
public FileScanner(@NonNull Context context, @SupportFileType int supportType) {
this(context, supportType, null);
}
public FileScanner(@NonNull Context context, @SupportFileType int supportType, @Nullable FileScannerListener listener) {
mContext = context;
ScannerConfig.sGlobalAppContext = context.getApplicationContext();
mCurrentType = supportType;
mScanListener = listener;
initType();
}
private void initType() {
switch (mCurrentType) {
case SUPPORT_FILE_TYPE_LARGEFILE:
FilterUtil.sFileSizeFilter = ScannerConfig.DEFAULT_LARGE_FILE_FILE_SIZE_THRESHOLD;
break;
case SUPPORT_FILE_TYPE_AUDIO:
FilterUtil.sFileSizeFilter = ScannerConfig.DEFAULT_AUDIO_FILE_SIZE_THRESHOLD;
break;
case SUPPORT_FILE_TYPE_VIDEO:
FilterUtil.sFileSizeFilter = ScannerConfig.DEFAULT_VIDEO_FILE_SIZE_THRESHOLD;
break;
case SUPPORT_FILE_TYPE_IMAGE:
FilterUtil.sFileSizeFilter = ScannerConfig.DEFAULT_IMG_FILE_SIZE_THRESHOLD;
break;
case SUPPORT_FILE_TYPE_APK:
FilterUtil.sFileSizeFilter = ScannerConfig.DEFAULT_APK_FILE_FILE_SIZE_THRESHOLD;
break;
}
}
public void setFileScannerListener(FileScannerListener listener) {
mScanListener = listener;
}
/**
* 设置扫描过滤器。注意 只有调用{@link #scan(boolean)}}后 扫描拦截器才生效
*
* @param filter
*/
public void setScanFilter(IFileScanFilter filter) {
mFilter = filter;
}
public void setFileFilterSizeThreshold(long threshold) {
FilterUtil.sFileSizeFilter = threshold;
}
/**
* 设置是否跳过对隐藏文件夹的扫描
*
* @param filterHidden
*/
public void setFilterHiddenDir(boolean filterHidden) {
FilterUtil.setFilterHiddenDir(filterHidden);
}
public boolean isScanning() {
return LocalFileCacheManager.getInstance(mContext).getScanStatus() == LocalFileCacheManager.STATUS_SCAN_ING;
}
public void stop() {
LocalFileCacheManager.getInstance(mContext).stop();
mFilter = null;
}
public void clear() {
LocalFileCacheManager.getInstance(mContext).clear();
}
public void scan(boolean scanAll) {
if (isScanning()) {
//停止之前的
stop();
}
//设置目标数据类型
LocalFileCacheManager.getInstance(mContext).setSupportType(mCurrentType);
//设置回调
LocalFileCacheManager.getInstance(mContext).setCommonListener(mCommonListener);
LocalFileCacheManager.getInstance(mContext).setFilter(mFilter);
boolean bool = isNeedToScannerAll();
if (bool || scanAll) {
//全盘扫描
Logger.i(TAG, "start: 全盘扫描");
ScannerUtil.scanAllDirAsync(mContext);
} else {
//增量扫描
Logger.i(TAG, "start: 增量扫描");
ScannerUtil.updateAllDirAsync(mContext);
}
}
/**
* 获取该类型的所有文件
*
* @return
*/
public List<FileInfo> getAllFiles() {
return LocalFileCacheManager.getInstance(mContext).getAllFiles(mCurrentType);
}
private boolean isNeedToScannerAll() {
return ScannerUtil.isNeedToScannerAll(mContext);
}
private FileScannerListener mCommonListener = new FileScannerListener() {
@Override
public void onScanBegin() {
if (mScanListener != null) {
mScanListener.onScanBegin();
}
}
@Override
public void onScanEnd(List<FileInfo> allFiles) {
if (mScanListener != null) {
mScanListener.onScanEnd(getAllFiles());
}
}
@Override
public void onScanning(String dirPath, int progress) {
if (mScanListener != null) {
mScanListener.onScanning(dirPath, progress);
}
}
@Override
public void onScanningChangedFile(FileInfo info, int type) {
if (mScanListener != null) {
mScanListener.onScanningChangedFile(info, type);
}
}
@Override
public void onScanCancel() {
if (mScanListener != null) {
mScanListener.onScanCancel();
}
}
};
}
| [
"1024624013@qq.com"
] | 1024624013@qq.com |
f034b20868b97076ea48d9c4fd988d5b126d8b56 | ac3a7a8d120d4e281431329c8c9d388fcfb94342 | /src/main/java/com/leetcode/algorithm/medium/braceexpansion/Solution.java | 7d022e29adeb179120b8fbc42f8098ea46b5578a | [
"MIT"
] | permissive | paulxi/LeetCodeJava | c69014c24cda48f80a25227b7ac09c6c5d6cfadc | 10b4430629314c7cfedaae02c7dc4c2318ea6256 | refs/heads/master | 2021-04-03T08:03:16.305484 | 2021-03-02T06:20:24 | 2021-03-02T06:20:24 | 125,126,097 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package com.leetcode.algorithm.medium.braceexpansion;
import java.util.*;
class Solution {
public String[] expand(String str) {
char[] charArr = str.toCharArray();
Queue<Character> queue = new LinkedList<>();
for (char c : charArr) {
queue.offer(c);
}
List<String> res = helper(queue);
Collections.sort(res);
return res.toArray(new String[res.size()]);
}
private List<String> helper(Queue<Character> queue) {
List<String> res = new ArrayList<>();
res.add("");
boolean inBrace = false;
while (!queue.isEmpty()) {
char c = queue.poll();
if (c == '{') {
List<String> list = helper(queue);
List<String> newList = new ArrayList<>();
for (String s : res) {
for (String l : list) {
newList.add(s + l);
}
}
res = newList;
} else if (c == '}') {
break;
} else if (c == ',') {
inBrace = true;
} else {
if (inBrace) {
res.add("" + c);
} else {
for (int i = 0; i < res.size(); i++) {
res.set(i, res.get(i) + c);
}
}
}
}
return res;
}
}
| [
"paulxi@gmail.com"
] | paulxi@gmail.com |
6dd8b47591f170d36612588661e19f76dfa05f9f | ca7db97caf3e30ac299785d3139383a3de070c3c | /src/pampa/message/consensus/ZombiesDeadConsensus.java | fd2dc2403168c8bf97577086a1602acec55a6a46 | [] | no_license | gopenshaw/battlecode-2016 | ef35370def3eb87d881c05e78469efa0c45cb44b | f8e692ede157dadf549c4183c2d4627b70b10fae | refs/heads/master | 2021-01-09T07:01:29.586323 | 2016-02-01T20:41:53 | 2016-02-01T20:41:53 | 49,037,792 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,587 | java | package pampa.message.consensus;
import battlecode.common.GameConstants;
import battlecode.common.RobotController;
import pampa.message.Subject;
public class ZombiesDeadConsensus extends ConsensusManager {
private int[] zombieMemory = new int[GameConstants.GAME_DEFAULT_ROUNDS + 1];
private final int ZOMBIE_EXISTS_ROUNDS = 130;
public ZombiesDeadConsensus(RobotController rc) {
super(rc);
}
@Override
protected int getRetryDelay() {
return 100;
}
@Override
protected Subject getSubject() {
return Subject.ZOMBIES_DEAD;
}
@Override
protected int getMinimumAgeToPropose() {
return 300;
}
@Override
protected int getMinimumAgeToDeny() {
return 5;
}
@Override
protected boolean shouldPropose(int currentRound) {
int beginRound = currentRound - ZOMBIE_EXISTS_ROUNDS;
if (beginRound < 0) beginRound = 0;
for (int i = beginRound; i <= currentRound; i++) {
if (zombieMemory[i] > 0) {
return false;
}
}
return true;
}
@Override
protected boolean shouldDeny(int currentRound) {
int beginRound = currentRound - ZOMBIE_EXISTS_ROUNDS;
if (beginRound < 0) beginRound = 0;
for (int i = beginRound; i <= currentRound; i++) {
if (zombieMemory[i] > 0) {
return true;
}
}
return false;
}
public void updateZombieCount(int count, int currentRound) {
zombieMemory[currentRound] = count;
}
}
| [
"garrett.j.openshaw@gmail.com"
] | garrett.j.openshaw@gmail.com |
5809d5d8d4c2382189699ba62297b1b05bb30648 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/18/18_02ea9907ef8715ca6fd7505ca8c508a056af4613/onPlayerDeathEvent/18_02ea9907ef8715ca6fd7505ca8c508a056af4613_onPlayerDeathEvent_t.java | 83b5216900d1d5ef3e1a596415949283174b4cc7 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,667 | java | package jp.tsuttsu305;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Wolf;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.inventory.ItemStack;
public class onPlayerDeathEvent implements Listener {
// * メインクラスのインスタンス
// このクラスのインスタンスが生成される際に、メインクラスのインスタンスを設定する
// メインクラスの動的フィールド・メソッドにアクセスする時は main.hogehoge のように使う
private Main main = null;
/**
* onPlayerDeathEventクラスのコンストラクタ
* @param main メインクラスのインスタンス
*/
public onPlayerDeathEvent(Main main){
this.main = main;
}
//TODO:main.getMessage() これを何とかする必要あり
//Main Main = jp.tsuttsu305.Main.plugin;
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event){
// プレイヤーとプレイヤーが最後に受けたダメージイベントを取得
Player deader = event.getEntity();
final EntityDamageEvent cause = event.getEntity().getLastDamageCause();
// 死亡メッセージ
String deathMessage = event.getDeathMessage();
String name = deader.getName();
// ダメージイベントを受けずに死んだ 死因不明
if (cause == null){
deathMessage = main.getMessage("unknown"); // Unknown
}
// ダメージイベントあり 原因によってメッセージ変更
else{
// ダメージイベントがEntityDamageByEntityEvent(エンティティが原因のダメージイベント)かどうかチェック
if (cause instanceof EntityDamageByEntityEvent) {
Entity killer = ((EntityDamageByEntityEvent) cause).getDamager(); // EntityDamageByEventのgetDamagerメソッドから原因となったエンティティを取得
// エンティティの型チェック 特殊な表示の仕方が必要
if (killer instanceof Player){
// この辺に倒したプレイヤー名取得
Player killerP = deader.getKiller();
//killerが持ってたアイテム
ItemStack hand = killerP.getItemInHand();
deathMessage = main.getMessage("pvp");
deathMessage = deathMessage.replace("%k", killerP.getName());
deathMessage = deathMessage.replace("%i", hand.getType().toString());
}
// 飼われている狼
else if (killer instanceof Wolf && ((Wolf) killer).isTamed()){
// 飼い主取得
String tamer = ((Wolf)killer).getOwner().getName();
deathMessage = main.getMessage("tamewolf");
deathMessage = deathMessage.replace("%o", tamer);
}
// プレイヤーが投げた弓や雪玉など
else if (killer instanceof Projectile && ((Projectile) killer).getShooter() instanceof Player) {
// 投げたプレイヤー取得
Player sh = (Player) ((Projectile)killer).getShooter();
//仕様です。こんなものなかった
//ItemStack pass = deader.getKiller().getItemInHand();
deathMessage = main.getMessage("throw");
//仕様です。こんなものなかった
//deathMessage = deathMessage.replace("%i", pass.getType().toString());
deathMessage = deathMessage.replace("%k", sh.getName());
}
// そのほかのMOBは直接設定ファイルから取得
else{
//Mainクラスの main.plugin.Main.getMessage メソッドを呼ぶ
deader.sendMessage(killer.getType().getName().toLowerCase());
deathMessage = main.getMessage(killer.getType().getName().toLowerCase());
}
}
// エンティティ以外に倒されたメッセージは別に設定
else{
switch (cause.getCause()){
case CONTACT:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case DROWNING:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case FALL:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case FIRE:
case FIRE_TICK:
deathMessage = main.getMessage("fire");
break;
case LAVA:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case LIGHTNING:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case POISON:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case STARVATION:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case SUFFOCATION:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case SUICIDE:
deathMessage = main.getMessage(cause.getCause().toString());
break;
case VOID:
deathMessage = main.getMessage(cause.getCause().toString());
break;
// それ以外は不明
default:
deathMessage = main.getMessage("unknown"); // Unknown
break;
}
}
}
// 設定ファイルから読み込むなら最後に一括変換したほうがスマートかも
deathMessage = deathMessage.replace("%p", name);
event.setDeathMessage(deathMessage);
return;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1135481687928bfa726f1c27bf732eb2abb7c8a0 | a8378b15a6907870056c1696ae463e950a46fbe5 | /src/alg517/Solution.java | 9d39005a5909f17a366fd04998a3536c78829eb9 | [] | no_license | CourageDz/LeetCodePro | 38a90ad713d46911b64c893c7fcae04fb0b20791 | d0dfeab630357c8172395ff8533e38b5fb9498c5 | refs/heads/master | 2020-03-28T14:18:58.656373 | 2020-03-18T05:00:12 | 2020-03-18T05:00:12 | 148,476,780 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,548 | java | package alg517;
import sun.font.FontRunIterator;
import java.util.Arrays;
public class Solution {
//time limit exceeded
public int findMinMoves(int[] machines) {
int sum=0,avg=0;
int n=machines.length;
for (int i = 0; i <n ; i++) {
sum+=machines[i];
}
if(sum%n!=0)
return -1;
else
avg=sum/n;
int count=0;
int addNum[]=new int[n];
Arrays.fill(addNum,0);
while (true){
boolean flag=true;
for (int i = 0; i <n ; i++) {
machines[i]+=addNum[i];
if(machines[i]!=avg)
flag=false;
}
if(flag)
return count;
Arrays.fill(addNum,0);
int left= 0;
count++;
for (int i = 0; i <n ; i++) {
left+=machines[i]-avg;
if(left<0 && machines[i+1]>0){
addNum[i]++;
addNum[i+1]--;
}
if(left>0 && addNum[i]!=-1){
addNum[i]--;
addNum[i+1]++;
}
}
}
}
public static void main(String[] args) {
Solution sol =new Solution();
int []param={1,0,5};
int result=sol.findMinMoves(param);
System.out.println(result);
}
}
| [
"39013348@qq.com"
] | 39013348@qq.com |
a4e72cfa355afb5211fc48ebfb33247c7fe7b1f2 | 129f58086770fc74c171e9c1edfd63b4257210f3 | /src/testcases/CWE129_Improper_Validation_of_Array_Index/CWE129_Improper_Validation_of_Array_Index__Property_array_read_check_min_75b.java | 6bab3ed5c67e8d717e8d00bb8f22c8f85f9bed83 | [] | no_license | glopezGitHub/Android23 | 1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba | 6215d0684c4fbdc7217ccfbedfccfca69824cc5e | refs/heads/master | 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 | Java | UTF-8 | Java | false | false | 6,737 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE129_Improper_Validation_of_Array_Index__Property_array_read_check_min_75b.java
Label Definition File: CWE129_Improper_Validation_of_Array_Index.label.xml
Template File: sources-sinks-75b.tmpl.java
*/
/*
* @description
* CWE: 129 Improper Validation of Array Index
* BadSource: Property Read data from a system property
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: array_read_check_min
* GoodSink: Read from array after verifying that data is at least 0 and less than array.length
* BadSink : Read from array after verifying that data is at least 0 (but not verifying that data less than array.length)
* Flow Variant: 75 Data flow: data passed in a serialized object from one method to another in different source files in the same package
*
* */
package testcases.CWE129_Improper_Validation_of_Array_Index;
import testcasesupport.*;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.sql.*;
import javax.servlet.http.*;
public class CWE129_Improper_Validation_of_Array_Index__Property_array_read_check_min_75b
{
public void bad_sink(byte[] data_serialized ) throws Throwable
{
// unserialize data
ByteArrayInputStream bais = null;
ObjectInputStream in = null;
try {
bais = new ByteArrayInputStream(data_serialized);
in = new ObjectInputStream(bais);
int data = (Integer)in.readObject();
/* Need to ensure that the array is of size > 3 and < 101 due to the GoodSource and the large_fixed BadSource */
int array[] = { 0, 1, 2, 3, 4 };
/* POTENTIAL FLAW: Verify that data >= 0, but don't verify that data < array.length, so may be attempting to read out of the array bounds */
if(data >= 0)
{
IO.writeLine(array[data]);
}
else {
IO.writeLine("Array index out of bounds");
}
}
catch (IOException e)
{
IO.logger.log(Level.WARNING, "IOException in deserialization", e);
}
catch (ClassNotFoundException e)
{
IO.logger.log(Level.WARNING, "ClassNotFoundException in deserialization", e);
}
finally {
// clean up stream reading objects
try {
if (in != null)
{
in.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ObjectInputStream", ioe);
}
try {
if (bais != null)
{
bais.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ByteArrayInputStream", ioe);
}
}
}
/* goodG2B() - use GoodSource and BadSink */
public void goodG2B_sink(byte[] data_serialized ) throws Throwable
{
// unserialize data
ByteArrayInputStream bais = null;
ObjectInputStream in = null;
try {
bais = new ByteArrayInputStream(data_serialized);
in = new ObjectInputStream(bais);
int data = (Integer)in.readObject();
/* Need to ensure that the array is of size > 3 and < 101 due to the GoodSource and the large_fixed BadSource */
int array[] = { 0, 1, 2, 3, 4 };
/* POTENTIAL FLAW: Verify that data >= 0, but don't verify that data < array.length, so may be attempting to read out of the array bounds */
if(data >= 0)
{
IO.writeLine(array[data]);
}
else {
IO.writeLine("Array index out of bounds");
}
}
catch (IOException e)
{
IO.logger.log(Level.WARNING, "IOException in deserialization", e);
}
catch (ClassNotFoundException e)
{
IO.logger.log(Level.WARNING, "ClassNotFoundException in deserialization", e);
}
finally {
// clean up stream reading objects
try {
if (in != null)
{
in.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ObjectInputStream", ioe);
}
try {
if (bais != null)
{
bais.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ByteArrayInputStream", ioe);
}
}
}
/* goodB2G() - use BadSource and GoodSink */
public void goodB2G_sink(byte[] data_serialized ) throws Throwable
{
// unserialize data
ByteArrayInputStream bais = null;
ObjectInputStream in = null;
try {
bais = new ByteArrayInputStream(data_serialized);
in = new ObjectInputStream(bais);
int data = (Integer)in.readObject();
/* Need to ensure that the array is of size > 3 and < 101 due to the GoodSource and the large_fixed BadSource */
int array[] = { 0, 1, 2, 3, 4 };
/* FIX: Fully verify data before reading from array at location data */
if(data >= 0 && data < array.length)
{
IO.writeLine(array[data]);
}
else {
IO.writeLine("Array index out of bounds");
}
}
catch (IOException e)
{
IO.logger.log(Level.WARNING, "IOException in deserialization", e);
}
catch (ClassNotFoundException e)
{
IO.logger.log(Level.WARNING, "ClassNotFoundException in deserialization", e);
}
finally {
// clean up stream reading objects
try {
if (in != null)
{
in.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ObjectInputStream", ioe);
}
try {
if (bais != null)
{
bais.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ByteArrayInputStream", ioe);
}
}
}
}
| [
"guillermo.pando@gmail.com"
] | guillermo.pando@gmail.com |
df4d4d808628e47224398cdf80170abb7272028a | 1d5d6f298aad8242f0c4c0f86a666b7e2033d196 | /spring-boot-2.1.7.RELEASE/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/ExecutableArchiveLauncher.java | ce5e24a63c02f307f18c56961fd479e5bdfc4453 | [
"Apache-2.0"
] | permissive | kongq1983/opensourcecode | b0a2c951e24220c22dae3136d1cc5ed7e5230ed9 | 96242fe545e65c41b1a1a3bc9230e49792fa348b | refs/heads/master | 2023-03-06T08:35:13.730272 | 2022-11-15T15:14:57 | 2022-11-15T15:14:57 | 193,943,067 | 0 | 0 | Apache-2.0 | 2023-02-22T07:31:30 | 2019-06-26T16:42:03 | Java | UTF-8 | Java | false | false | 2,696 | java | /*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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.springframework.boot.loader;
import java.util.ArrayList;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.Manifest;
import org.springframework.boot.loader.archive.Archive;
/**
* Base class for executable archive {@link Launcher}s.
*
* @author Phillip Webb
* @author Andy Wilkinson
* @since 1.0.0
*/
public abstract class ExecutableArchiveLauncher extends Launcher {
private final Archive archive;
public ExecutableArchiveLauncher() {
try {
this.archive = createArchive();
}
catch (Exception ex) {
throw new IllegalStateException(ex);
}
}
protected ExecutableArchiveLauncher(Archive archive) {
this.archive = archive;
}
protected final Archive getArchive() {
return this.archive;
}
@Override
protected String getMainClass() throws Exception {
Manifest manifest = this.archive.getManifest();
String mainClass = null;
if (manifest != null) { // /META-INF/MANIFEST.MF
mainClass = manifest.getMainAttributes().getValue("Start-Class"); //注意Start-Class是mainClass
}
if (mainClass == null) {
throw new IllegalStateException("No 'Start-Class' manifest entry specified in " + this);
}
return mainClass;
}
@Override
protected List<Archive> getClassPathArchives() throws Exception {
List<Archive> archives = new ArrayList<>(this.archive.getNestedArchives(this::isNestedArchive));
postProcessClassPathArchives(archives);
return archives;
}
/**
* Determine if the specified {@link JarEntry} is a nested item that should be added
* to the classpath. The method is called once for each entry.
* @param entry the jar entry
* @return {@code true} if the entry is a nested item (jar or folder)
*/
protected abstract boolean isNestedArchive(Archive.Entry entry);
/**
* Called to post-process archive entries before they are used. Implementations can
* add and remove entries.
* @param archives the archives
* @throws Exception if the post processing fails
*/
protected void postProcessClassPathArchives(List<Archive> archives) throws Exception {
}
}
| [
"king@qq.com"
] | king@qq.com |
03676875f83dea2cfb290e6e9be6eb1cedd88079 | aca457909ef8c4eb989ba23919de508c490b074a | /DialerJADXDecompile/defpackage/dlz.java | 46f11f10c4934b8f2aceed3542097afdd6bd0a1d | [] | no_license | KHikami/ProjectFiCallingDeciphered | bfccc1e1ba5680d32a4337746de4b525f1911969 | cc92bf6d4cad16559a2ecbc592503d37a182dee3 | refs/heads/master | 2021-01-12T17:50:59.643861 | 2016-12-08T01:20:34 | 2016-12-08T01:23:04 | 71,650,754 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,001 | java | package defpackage;
import java.io.OutputStream;
/* compiled from: PG */
/* renamed from: dlz */
final class dlz implements dmg {
private /* synthetic */ dmi a;
private /* synthetic */ OutputStream b;
dlz(dmi dmi, OutputStream outputStream) {
this.a = dmi;
this.b = outputStream;
}
public final void a_(dlu dlu, long j) {
dmk.a(dlu.b, 0, j);
while (j > 0) {
this.a.e();
dme dme = dlu.a;
int min = (int) Math.min(j, (long) (dme.c - dme.b));
this.b.write(dme.a, dme.b, min);
dme.b += min;
j -= (long) min;
dlu.b -= (long) min;
if (dme.b == dme.c) {
dlu.a = dme.a();
dmf.a(dme);
}
}
}
public final void flush() {
this.b.flush();
}
public final void close() {
this.b.close();
}
public final String toString() {
return "sink(" + this.b + ")";
}
}
| [
"chu.rachelh@gmail.com"
] | chu.rachelh@gmail.com |
325082a1245ee7bf17e40ec2784be5b24a8d9084 | f52981eb9dd91030872b2b99c694ca73fb2b46a8 | /Source/Plugins/Core/com.equella.core/src/com/tle/core/connectors/canvas/beans/CanvasModuleItemBean.java | 987e92a85d9eef92f620f325bc247421512a6ee3 | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"LicenseRef-scancode-jdom",
"GPL-1.0-or-later",
"ICU",
"CDDL-1.0",
"LGPL-3.0-only",
"LicenseRef-scancode-other-permissive",
"CPL-1.0",
"MIT",
"GPL-2.0-only",
"Apache-2.0",
"NetCDF",
"Apache-1.1",
"EPL-1.0",
"Classpath-exception-2.0",
"CDDL-1.1",
"LicenseRef-scancode-freemarker"
] | permissive | phette23/Equella | baa41291b91d666bf169bf888ad7e9f0b0db9fdb | 56c0d63cc1701a8a53434858a79d258605834e07 | refs/heads/master | 2020-04-19T20:55:13.609264 | 2019-01-29T03:27:40 | 2019-01-29T22:31:24 | 168,427,559 | 0 | 0 | Apache-2.0 | 2019-01-30T22:49:08 | 2019-01-30T22:49:08 | null | UTF-8 | Java | false | false | 1,261 | java | /*
* Copyright 2017 Apereo
*
* 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.tle.core.connectors.canvas.beans;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonProperty;
@XmlRootElement
public class CanvasModuleItemBean
{
private String id;
private String title;
@JsonProperty(value = "external_url")
private String equellaUrl;
public String getTitle()
{
return title;
}
public void setTitle(String title)
{
this.title = title;
}
public String getId()
{
return id;
}
public void setId(String id)
{
this.id = id;
}
public String getEquellaUrl()
{
return equellaUrl;
}
public void setEquellaUrl(String equellaUrl)
{
this.equellaUrl = equellaUrl;
}
}
| [
"doolse@gmail.com"
] | doolse@gmail.com |
66f2c5c644ebed67442a9d0dd1c5c2e5fa8843f1 | fa9dd0f223ff8285089e8d3021373e989818be05 | /Solutions/src/com/rajaraghvendra/solutions/_1381.java | c36a33791659ecec459ebbf05613e5937c3ea438 | [] | no_license | rajaraghvendra/Leetcode | 36e2c9aca3428f39e18c840c401a3cb639bc1b28 | 616cf3b04e961cada6a6d13788d372cea3e260d8 | refs/heads/master | 2021-05-02T16:25:09.761450 | 2020-06-11T02:47:13 | 2020-06-11T02:47:13 | 62,503,993 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,376 | java | package com.rajaraghvendra.solutions;
import java.util.ArrayList;
import java.util.List;
/**
* 1381. Design a Stack With Increment Operation
*
* Design a stack which supports the following operations.
*
* Implement the CustomStack class:
*
* CustomStack(int maxSize) Initializes the object with maxSize which is the maximum number of elements in the stack or do nothing if the stack reached the maxSize.
* void push(int x) Adds x to the top of the stack if the stack hasn't reached the maxSize.
* int pop() Pops and returns the top of stack or -1 if the stack is empty.
* void inc(int k, int val) Increments the bottom k elements of the stack by val. If there are less than k elements in the stack, just increment all the elements in the stack.
*
* Example 1:
*
* Input
* ["CustomStack","push","push","pop","push","push","push","increment","increment","pop","pop","pop","pop"]
* [[3],[1],[2],[],[2],[3],[4],[5,100],[2,100],[],[],[],[]]
* Output
* [null,null,null,2,null,null,null,null,null,103,202,201,-1]
* Explanation
* CustomStack customStack = new CustomStack(3); // Stack is Empty []
* customStack.push(1); // stack becomes [1]
* customStack.push(2); // stack becomes [1, 2]
* customStack.pop(); // return 2 --> Return top of the stack 2, stack becomes [1]
* customStack.push(2); // stack becomes [1, 2]
* customStack.push(3); // stack becomes [1, 2, 3]
* customStack.push(4); // stack still [1, 2, 3], Don't add another elements as size is 4
* customStack.increment(5, 100); // stack becomes [101, 102, 103]
* customStack.increment(2, 100); // stack becomes [201, 202, 103]
* customStack.pop(); // return 103 --> Return top of the stack 103, stack becomes [201, 202]
* customStack.pop(); // return 202 --> Return top of the stack 102, stack becomes [201]
* customStack.pop(); // return 201 --> Return top of the stack 101, stack becomes []
* customStack.pop(); // return -1 --> Stack is empty return -1.
*
* Constraints:
* 1 <= maxSize <= 1000
* 1 <= x <= 1000
* 1 <= k <= 1000
* 0 <= val <= 100
* At most 1000 calls will be made to each method of increment, push and pop each separately.
* */
public class _1381 {
public static class Solution1 {
public static class CustomStack {
List<Integer> list;
int maxSize;
public CustomStack(int maxSize) {
this.list = new ArrayList<>();
this.maxSize = maxSize;
}
public void push(int x) {
if (list.size() >= maxSize) {
return;
} else {
list.add(x);
}
}
public int pop() {
if (!list.isEmpty()) {
return list.remove(list.size() - 1);
} else {
return -1;
}
}
public void increment(int k, int val) {
for (int i = 0; i < k && i < list.size(); i++) {
list.set(i, list.get(i) + val);
}
}
}
}
}
| [
"rajaraghvendra@gmail.com"
] | rajaraghvendra@gmail.com |
3112daea60974068f3c1092ee97fe41207248449 | bea9ac524d47bdfad36543b3930a0d60bb184627 | /trunk/lilydap-utils/src/main/java/com/lily/dap/util/zip/ZipingFilter.java | fc024ffcd82394ebd237d1c9fc5c6c5efb57e22b | [] | no_license | BGCX261/zouxuemo-project-svn-to-git | 6fcfe50defca1b0d6da4a0a563a2b8db847de665 | eed4ebd4c25bb64993d92c1a7f7a382af8e6f05d | refs/heads/master | 2021-01-19T22:28:51.707753 | 2015-08-25T15:17:01 | 2015-08-25T15:17:01 | 41,596,488 | 0 | 1 | null | null | null | null | GB18030 | Java | false | false | 543 | java | /**
*
*/
package com.lily.dap.util.zip;
/**
* @author xuemozou
*
* 压缩和解压缩过滤器,控制文件是否需要压缩/解压缩
*/
public interface ZipingFilter {
/**
* 是否允许文件压缩/解压缩,true:允许压缩/解压缩;false:不允许压缩/解压缩
*
* @param pathname
* 文件在压缩文件中相对路径名
* @param isDirectory
* 文件是否为目录
* @return
*/
public boolean filter(String pathname, boolean isDirectory);
}
| [
"you@example.com"
] | you@example.com |
f5bbc159715666cd59759babdd452ffbd81c077b | b23404e272db01f2bf46320565c11b9e02cf0c61 | /new/pas/src/main/java/framework/com/hunthawk/framework/security/PermissionCheck.java | 3aa31fc397ad39fe08fe129f3d7f19300dfac01c | [] | no_license | brucesq/brucedamon001 | 95ab98798f1c29d722a397681956c24ff4091385 | 92ab181f90005afffb354d10768921545912119c | refs/heads/master | 2021-05-29T09:35:05.115101 | 2011-12-20T05:42:28 | 2011-12-20T05:42:28 | 32,131,555 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 625 | java | /**
*
*/
package com.hunthawk.framework.security;
/**
* @author sunquanzhi
*
*/
public class PermissionCheck {
private String name;
private String action;
private boolean granted;
public PermissionCheck(String name, String action)
{
this.name = name;
this.action = action;
this.granted = false;
}
public String getName()
{
return name;
}
public String getAction()
{
return action;
}
public void grant()
{
this.granted = true;
}
public boolean isGranted()
{
return granted;
}
}
| [
"quanzhi@8cf3193c-f4eb-11de-8355-bf90974c4141"
] | quanzhi@8cf3193c-f4eb-11de-8355-bf90974c4141 |
ae6676c8b491692de12e451f30580d3b23eedbe2 | e77dfcec514ace3b4f9dc9c951a218c5f1cefe0a | /src/com/fob/bitmap/BitmapUtil.java | ab8cd43cf33be53882ebae685657cf8cffa2fb29 | [] | no_license | niucong/FriendsOfTheBall | c881252fe63850766e5f6310b42425fdf2e16639 | 3007b60bb202a46e81771b1c77df356974b1ad6c | refs/heads/master | 2021-01-20T18:52:27.110398 | 2016-05-27T10:00:15 | 2016-05-27T10:00:15 | 59,824,819 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,857 | java | package com.fob.bitmap;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
public class BitmapUtil
{
private final static String TAG = "BitmapUtil";
public final static String generateKey(String s)
{
long hashcode = s.hashCode();
if(hashcode < 0)
{
hashcode = - hashcode;
}
return String.valueOf(hashcode);
}
public static byte[] bitmapToByte(Bitmap bitmap)
{
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
return stream.toByteArray();
}
public static byte[] bitmapToJpeg(Bitmap bitmap,int quality)
{
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, quality, stream);
bitmap.recycle();
bitmap = null;
return stream.toByteArray();
}
public static Bitmap optimizeBitmap(byte[] data, int maxWidth, int maxHeight)
{
if(maxWidth == 0)
{
maxWidth = BitmapConst.BITMAP_MAX_W;
}
if(maxHeight == 0)
{
maxHeight = BitmapConst.BITMAP_MAX_H;
}
Bitmap result = null;
int length = data.length;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
result = BitmapFactory.decodeByteArray(data, 0, length, options);
int widthRatio = (int) Math.ceil(options.outWidth / maxWidth);
int heightRatio = (int) Math.ceil(options.outHeight / maxHeight);
if(widthRatio > 1 || heightRatio > 1)
{
if(widthRatio > heightRatio)
{
options.inSampleSize = widthRatio;
}
else
{
options.inSampleSize = heightRatio;
}
}
options.inJustDecodeBounds = false;
result = BitmapFactory.decodeByteArray(data, 0, length, options);
return result;
}
public static Bitmap optimizeBitmap(String filepath, int maxWidth, int maxHeight)
{
int degree = readPictureDegree(filepath);
if(maxWidth == 0)
{
maxWidth = BitmapConst.BITMAP_MAX_W;
}
if(maxHeight == 0)
{
maxHeight = BitmapConst.BITMAP_MAX_H;
}
try
{
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
FileInputStream is = new FileInputStream(filepath);
if(is != null)
{
BitmapFactory.decodeStream(is, null, options);
is.close();
}
int widthRatio = (int) Math.ceil((double)options.outWidth / (double)maxWidth);
int heightRatio = (int) Math.ceil((double)options.outHeight / (double)maxHeight);
if(widthRatio > 1 || heightRatio > 1)
{
if(widthRatio > heightRatio)
{
options.inSampleSize = widthRatio;
}
else
{
options.inSampleSize = heightRatio;
}
}
options.inJustDecodeBounds = false;
is = new FileInputStream(filepath);
if(is != null)
{
Bitmap img = BitmapFactory.decodeStream(is, null, options);
is.close();
img = angleMatrixBitmap(img,degree);
return img;
}
}
catch (Exception e)
{
}
return null;
}
public static Bitmap angleMatrixBitmap(Bitmap img,int degree) {
if(degree > 0){
Matrix m = new Matrix();
int width = img.getWidth();
int height = img.getHeight();
m.setRotate(degree);
img = Bitmap.createBitmap(img, 0, 0, width, height,m, true);
}
return img;
}
public static void preloadBitmaps(String[] urls,BitmapLoader bitmapLoader,final BitmapsLoadListener listener)
{
class RecordCount
{
int finishNum;
int successNum;
synchronized void finishNumAdd()
{
finishNum++;
}
synchronized void successNumAdd()
{
successNum++;
}
int getFinishNum()
{
return finishNum;
}
int getSuccessNum()
{
return successNum;
}
}
final BitmapLoader loader;
final boolean isInnerLoader;
if(bitmapLoader==null)
{
isInnerLoader = true;
loader = new BitmapLoader();
loader.setBitmapHolder(new BitmapHolder(12, 12));
}
else
{
isInnerLoader = false;
loader = bitmapLoader;
}
if(urls!=null && urls.length > 0)
{
final int len = urls.length;
final RecordCount record = new RecordCount();
for(int i = 0; i < len; i++)
{
String imageUrl = urls[i];
if(imageUrl!=null && imageUrl.length()>0)
{
BitmapLoaderInfoBase loadInfo = new BitmapLoaderInfoBase();
loadInfo.setListener(new BitmapLoadListener()
{
@Override
public void onLoadFinish(Bitmap bitmap)
{
record.finishNumAdd();
if(bitmap!=null)
{
record.successNumAdd();
}
if(record.getFinishNum()>=len)
{
listener.onLoadFinish(record.getFinishNum(), record.getSuccessNum());
if(isInnerLoader)
{
loader.shutDown();
}
}
}
@Override
public void onLoadStart()
{
}
});
loader.loadBitmap(imageUrl,loadInfo.getListener());
}
else
{
record.finishNumAdd();
}
}
if(record.getFinishNum()>=len)
{
listener.onLoadFinish(record.getFinishNum(), record.getSuccessNum());
if(isInnerLoader)
{
loader.shutDown();
}
}
}
else
{
listener.onLoadFinish(0, 0);
}
}
public static int readPictureDegree(String path)
{
int degree = 0;
try
{
ExifInterface exifInterface = new ExifInterface(path);
int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
switch (orientation)
{
case ExifInterface.ORIENTATION_ROTATE_90:
degree = 90;
break;
case ExifInterface.ORIENTATION_ROTATE_180:
degree = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_270:
degree = 270;
break;
}
}
catch (IOException e)
{
}
return degree;
}
}
| [
"niucong@julong.cc"
] | niucong@julong.cc |
190fba987239e8c602aa3903192b6e4a9eca885d | f673856d905c8dd32dd16f1c77d539e8aa025860 | /app/src/main/java/com/lulian/Zaiyunbao/di/module/HttpModule.java | 8c615c94659e7dd377c8341f4ecfbf3a652bd45e | [] | no_license | sy707919626/Zaiyunbao | ea28c05ec2c45ae7597d35283132c4d639d6cdbc | 0b9944ff48fbc9ac83b2810bf622119cb11dc8ac | refs/heads/master | 2020-04-19T09:54:54.352638 | 2019-09-09T09:38:27 | 2019-09-09T09:38:27 | 168,124,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,920 | java | package com.lulian.Zaiyunbao.di.module;
import android.util.Log;
import com.google.gson.Gson;
import com.lulian.Zaiyunbao.MyApplication;
import com.lulian.Zaiyunbao.common.http.util.SSLSocketClient;
import com.lulian.Zaiyunbao.data.http.ApiService;
import com.lulian.Zaiyunbao.di.component.Constants;
import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;
@Module
public class HttpModule {
private static final String TAG = "HttpModule";
@Provides
@Singleton
OkHttpClient provideOkHttpClient(Gson gson, MyApplication context) {
//新建log拦截器
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
@Override
public void log(String message) {
Log.e("RxRetrofit", "Retrofit====Message:" + message);
}
});
//开发模式记录整个body
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
// 开发模式记录整个body,否则只记录基本信息如返回200,http协议版本等
OkHttpClient.Builder okClient = new OkHttpClient.Builder()
//HeadInterceptor实现了Interceptor,用来往Request Header添加一些业务相关数据,如APP版本,token信息
// .addInterceptor(new HeadInterceptor())
// .addInterceptor(commonParamsInterceptor)
//.addInterceptor(new LoggingInterceptor())
.addInterceptor(logging)
// 连接超时时间设置
.connectTimeout(10, TimeUnit.SECONDS)
// 读取超时时间设置
.readTimeout(10, TimeUnit.SECONDS)
.sslSocketFactory(SSLSocketClient.getSSLSocketFactory())
.hostnameVerifier(SSLSocketClient.getHostnameVerifier());
return okClient.build();
}
@Provides
@Singleton
Retrofit provodeRetrofit(OkHttpClient okHttpClient) {
Retrofit.Builder builder = new Retrofit.Builder()
.baseUrl(Constants.BASE_URL)
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.client(okHttpClient);
return builder.build();
}
@Provides
@Singleton
ApiService provideApiService(Retrofit retrofit) {
// LogUtil.e( "provideApiService: " + retrofit);
return retrofit.create(ApiService.class);
}
}
| [
"707919626@qq.com"
] | 707919626@qq.com |
235510db374a9a6f69381702976725e25d91a923 | 2292fede67397ba1a99d5f74f9e3c0882f1b857a | /qvcse-gui/src/main/java/com/qumasoft/guitools/qwin/FileFiltersComboModel.java | 597e60db9215ffc7c2dd7ee084e5c6915abe6053 | [
"Apache-2.0"
] | permissive | joshualambert/qvcsos | cbc294942c7edeb2ac9552ea8a01e55ce5c677b2 | a3529b44c97ac0b2104a5a60650dd3305262891a | refs/heads/master | 2021-01-18T08:42:53.467413 | 2014-04-15T00:45:53 | 2014-04-15T00:45:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,852 | java | // Copyright 2004-2014 Jim Voris
//
// 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.qumasoft.guitools.qwin;
import javax.swing.DefaultComboBoxModel;
/**
* File filters combo model.
* @author Jim Voris
*/
public class FileFiltersComboModel extends DefaultComboBoxModel<FilterCollection> {
private static final long serialVersionUID = -1852138274614689333L;
FileFiltersComboModel() {
FilterCollection[] filterCollections = FilterManager.getFilterManager().listFilterCollections();
if (filterCollections != null) {
for (FilterCollection filterCollection : filterCollections) {
addElement(filterCollection);
}
}
}
FileFiltersComboModel(String projectName) {
FilterCollection[] filterCollections = FilterManager.getFilterManager().listFilterCollections();
if (filterCollections != null) {
for (FilterCollection filterCollection : filterCollections) {
if (filterCollection.getAssociatedProjectName().equals(QWinFrame.GLOBAL_PROJECT_NAME)) {
addElement(filterCollection);
} else if (filterCollection.getAssociatedProjectName().equals(projectName)) {
addElement(filterCollection);
}
}
}
}
}
| [
"jimv@comcast.net"
] | jimv@comcast.net |
a5eaf70963946e907843d654fe7f4b099649e556 | ef0405bf15034450fc9e9f16faa7283e23206719 | /src/main/java/cn/wolfcode/crm/web/controller/SafetymechanismController.java | 992381fd82a9866c9d8bac5227e44a7fffa306e7 | [] | no_license | fhlbjay/carinsurance-luanshuailing- | f4210a7fae25a725081825111b7b0d1d5d69f0a6 | c2be725c95cfb8535bb8d3b9fe05a0bf1f630e53 | refs/heads/master | 2021-05-05T21:01:51.205168 | 2017-12-27T13:51:56 | 2017-12-27T13:51:56 | 115,525,916 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,643 | java | package cn.wolfcode.crm.web.controller;
import cn.wolfcode.crm.domain.Safetymechanism;
import cn.wolfcode.crm.page.PageResult;
import cn.wolfcode.crm.query.SafeQueryObject;
import cn.wolfcode.crm.service.ISafetymechanismService;
import cn.wolfcode.crm.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("safe")
public class SafetymechanismController {
@Autowired
private ISafetymechanismService service;
@RequestMapping("view")
public String view() throws Exception {
return "safetymechanism/view";
}
@RequestMapping("query")
@ResponseBody
public PageResult query(SafeQueryObject qo) throws Exception {
return service.query(qo);
}
@RequestMapping("list")
@ResponseBody
public List<Safetymechanism> list() throws Exception {
return service.selectAll();
}
@RequestMapping("saveOrUpdate")
@ResponseBody
public JsonResult saveOrUpdate(Safetymechanism safetymechanism) {
Long id = safetymechanism.getId();
try {
if (id == null) {
service.insert(safetymechanism);
} else {
service.updateByPrimaryKey(safetymechanism);
}
return new JsonResult(true,"保存成功");
} catch (Exception e) {
e.printStackTrace();
}
return new JsonResult(false, "操作失败!");
}
}
| [
"790787580@qq.com"
] | 790787580@qq.com |
a8d3192d223aede60e5216ac475499a3a3757fe5 | 147fa24bc83a2f6952ce4ae2861f6d8973bbf528 | /src/vnmrj/src/vnmr/admin/vobj/WCheck.java | 7e651b33aaf5630c8277d1276effd8d3061bcc60 | [] | no_license | rodrigobmg/ovj3 | 6860c19f0469b8ddc51bee208b3c3a00e36af27d | ab92686b5d8f1eec98021acdd08688cfee651e7f | refs/heads/master | 2021-01-23T13:37:06.107967 | 2016-02-29T01:13:25 | 2016-02-29T01:13:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,419 | java | /*
* Copyright (C) 2015 University of Oregon
*
* You may distribute under the terms of either the GNU General Public
* License or the Apache License, as specified in the README file.
*
* For more information, see the README file.
*/
package vnmr.admin.vobj;
import java.io.*;
import java.util.*;
import vnmr.bo.*;
import vnmr.ui.*;
import vnmr.util.*;
/**
* Title: WCheck
* Description: This class is extended from VCheck, and has some additional
* variables and methods implemented for the Wanda interface.
* Copyright: Copyright (c) 2002
*/
public class WCheck extends VCheck implements WObjIF
{
protected String m_strKeyWord = null;
protected String m_strValue = null;
protected String m_strEdit = null;
public WCheck(SessionShare ss, ButtonIF vif, String typ)
{
super(ss, vif, typ);
}
public boolean isRequestFocusEnabled()
{
return true;
}
public String getAttribute(int nAttr)
{
switch (nAttr)
{
case KEYWORD:
return m_strKeyWord;
case EDITABLE:
return m_strEdit;
default:
return super.getAttribute(nAttr);
}
}
public void setAttribute(int nAttr, String strAttr)
{
switch(nAttr)
{
case KEYWORD:
m_strKeyWord = strAttr;
break;
case EDITABLE:
if (strAttr.equals("yes") || strAttr.equals("true"))
{
setEnabled(true);
m_strEdit = "yes";
}
else
{
setEnabled(false);
m_strEdit = "no";
}
break;
default:
super.setAttribute(nAttr, strAttr);
break;
}
}
public String getValue()
{
String strValue = " ";
if (isSelected())
strValue = getAttribute(LABEL);
return strValue;
}
public void setValue(String strValue)
{
m_strValue = strValue;
if (strValue != null)
{
if (strValue.trim().equals(label))
setSelected(true);
else
setSelected(false);
}
}
}
| [
"timburrow@me.com"
] | timburrow@me.com |
65c3c6fc92b9469966333f09cd6e4b4cff607b8b | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_23536.java | 1632dc17371dfc52341a4fb89cff4903e897a59b | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 597 | java | /**
* Handles parsing ellipse and circle tags.
* @param circle true if this is a circle and not an ellipse
*/
protected void parseEllipse(boolean circle){
kind=ELLIPSE;
family=PRIMITIVE;
params=new float[4];
params[0]=getFloatWithUnit(element,"cx",svgWidth);
params[1]=getFloatWithUnit(element,"cy",svgHeight);
float rx, ry;
if (circle) {
rx=ry=getFloatWithUnit(element,"r",svgSizeXY);
}
else {
rx=getFloatWithUnit(element,"rx",svgWidth);
ry=getFloatWithUnit(element,"ry",svgHeight);
}
params[0]-=rx;
params[1]-=ry;
params[2]=rx * 2;
params[3]=ry * 2;
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
d030c94a96043b0e59c02f1e5ab4aeebfb2c25ac | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_cf0f38b2cf3734121415eee12f0cc842ce7bbfce/Numbers/5_cf0f38b2cf3734121415eee12f0cc842ce7bbfce_Numbers_s.java | c16ea393f3ef46133821f6b16bd4caead21ef322 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,491 | java | package net.meisen.general.genmisc.types;
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* Helper methods to deal with numbers.
*/
public class Numbers {
/**
* Maps the specified value to the number specified by the {@code clazz}.
*
* @param value
* the value to be mapped
* @param clazz
* the class to map the specified value to
*
* @return the mapped value or {@code null} if it cannot be mapped to the
* number
*/
@SuppressWarnings("unchecked")
public static <D> D mapToDataType(final Object value, final Class<D> clazz) {
if (value == null) {
return null;
}
if (clazz.equals(value.getClass())) {
return (D) value;
} else if (Number.class.isAssignableFrom(clazz)) {
final Class<? extends Number> numClazz = (Class<? extends Number>) clazz;
final Number number = (Number) value;
final Number result = Numbers.castToNumber(number, numClazz);
// check the result
if (result != null) {
final Class<?> srcClazz = number.getClass();
final Number cmpNumber = Numbers.castToNumber(result,
number.getClass());
if (cmpNumber.equals(number)) {
return (D) result;
}
/*
* There is a problem with the BigDecimal the equality depends
* on how it is created, i.e. using new BigDecimal(...) or
* BigDecimal.valueOf(...). The castToNumber method uses the
* valueOf, therefore here we check the constructor.
*/
else if (BigDecimal.class.equals(srcClazz)
&& new BigDecimal(result.doubleValue()).equals(number)) {
return (D) result;
}
}
}
// if we came so far there is no hope
return null;
}
/**
* Method which maps a {@code number} to the specified {@code clazz}. The
* specified {@code clazz} is another {@code Number}.
*
* @param number
* the number to be casted
* @param clazz
* the {@code Number}-class to cast the {@code number} to
*
* @return the casted {@code number} or {@code null} if a cast wasn't
* possible
*/
public static Number castToNumber(final Number number,
final Class<? extends Number> clazz) {
final Number result;
if (number == null) {
return null;
} else if (number.getClass().equals(clazz)) {
return number;
} else if (Byte.class.equals(clazz)) {
result = number.byteValue();
} else if (Short.class.equals(clazz)) {
result = number.shortValue();
} else if (Integer.class.equals(clazz)) {
result = number.intValue();
} else if (Long.class.equals(clazz)) {
result = number.longValue();
} else if (Float.class.equals(clazz)) {
result = number.floatValue();
} else if (Double.class.equals(clazz)) {
result = number.doubleValue();
} else if (BigInteger.class.equals(clazz)) {
result = BigInteger.valueOf(number.longValue());
} else if (BigDecimal.class.equals(clazz)) {
result = BigDecimal.valueOf(number.doubleValue());
} else {
return null;
}
return result;
}
/**
* Cast the value to an integer.
*
* @param b
* the value to be casted
* @return the result
*/
public static int castToInt(final byte b) {
return (int) b;
}
/**
* Cast the value to an integer.
*
* @param s
* the value to be casted
* @return the result
*/
public static int castToInt(final short s) {
return (short) s;
}
/**
* Cast the value to an integer.
*
* @param l
* the value to be casted
* @return the result
*
* @throws ArithmeticException
* if the value doesn't fit into an integer
*/
public static int castToInt(final long l) {
if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) {
throw new ArithmeticException("Cannot convert the long value '" + l
+ "' to an integer.");
} else {
return (int) l;
}
}
/**
* Cast the value to a short.
*
* @param b
* the value to be casted
* @return the result
*/
public static short castToShort(final byte b) {
return (short) b;
}
/**
* Cast the value to a short.
*
* @param i
* the value to be casted
* @return the result
*
* @throws ArithmeticException
* if the value doesn't fit into a short
*/
public static short castToShort(final int i) {
if (i < Short.MIN_VALUE || i > Short.MAX_VALUE) {
throw new ArithmeticException("Cannot convert the integer value '"
+ i + "' to a short.");
} else {
return (short) i;
}
}
/**
* Cast the value to a short.
*
* @param l
* the value to be casted
* @return the result
*
* @throws ArithmeticException
* if the value doesn't fit into a short
*/
public static short castToShort(final long l) {
if (l < Short.MIN_VALUE || l > Short.MAX_VALUE) {
throw new ArithmeticException("Cannot convert the long value '" + l
+ "' to a short.");
} else {
return (short) l;
}
}
/**
* Cast the value to a byte.
*
* @param s
* the value to be casted
* @return the result
*
* @throws ArithmeticException
* if the value doesn't fit into a byte
*/
public static byte castToByte(final short s) {
if (s < Byte.MIN_VALUE || s > Byte.MAX_VALUE) {
throw new ArithmeticException("Cannot convert the short value '"
+ s + "' to a byte.");
} else {
return (byte) s;
}
}
/**
* Cast the value to a byte.
*
* @param i
* the value to be casted
* @return the result
*
* @throws ArithmeticException
* if the value doesn't fit into a byte
*/
public static byte castToByte(final int i) {
if (i < Short.MIN_VALUE || i > Short.MAX_VALUE) {
throw new ArithmeticException("Cannot convert the integer value '"
+ i + "' to a byte.");
} else {
return (byte) i;
}
}
/**
* Cast the value to a byte.
*
* @param l
* the value to be casted
* @return the result
*
* @throws ArithmeticException
* if the value doesn't fit into a byte
*/
public static byte castToByte(final long l) {
if (l < Short.MIN_VALUE || l > Short.MAX_VALUE) {
throw new ArithmeticException("Cannot convert the long value '" + l
+ "' to a byte.");
} else {
return (byte) l;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
3e8c1f4104424b4c96da459504d9ed9a0ddb2c42 | 069db98b04c2c2b306ca6d0911ecfaa9d3484291 | /BS-PHIS2.322/src/main/java/phis/application/cfg/source/ConfigCommBusPermissionService.java | 90a7111e01fd3c9c25ab9969e1b1e7f4269ed86e | [] | no_license | zhouhui521/his | 59270696d3667c8c6eb8f7104af0a9501a90942a | 8d26b62e73d6ec95111eff66ab9d7aee61674f73 | refs/heads/master | 2023-02-03T16:20:57.561243 | 2020-12-24T06:33:46 | 2020-12-24T06:33:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,389 | java | /**
* @(#)AdvancedSearchService.java Created on 2009-8-10 下午04:08:08
*
* 版权:版权所有 bsoft.com.cn 保留所有权力。
*/
package phis.application.cfg.source;
import java.util.List;
import java.util.Map;
import phis.source.BSPHISEntryNames;
import phis.source.BaseDAO;
import phis.source.PersistentDataOperationException;
import phis.source.service.AbstractActionService;
import phis.source.service.DAOSupportable;
import phis.source.service.ServiceCode;
import ctd.account.UserRoleToken;
import ctd.service.core.ServiceException;
import ctd.util.context.Context;
/**
* @description 统一业务权限维护Service
*
* @author yangl 2012.06
*/
public class ConfigCommBusPermissionService extends AbstractActionService
implements DAOSupportable {
/**
* 保存统一业务权限
*
* @param jsonReq
* @param jsonRes
* @param dao
* @param ctx
* @throws ServiceException
*/
@SuppressWarnings("unchecked")
protected void doSavePermission(Map<String, Object> jsonReq,
Map<String, Object> jsonRes, BaseDAO dao, Context ctx)
throws ServiceException {
String busType = (String) jsonReq.get("busType");
Long ksdm = Long.parseLong(jsonReq.get("ksdm").toString());
UserRoleToken user = UserRoleToken.getCurrent();
String manageUnit = user.getManageUnit().getId();
List<Map<String, Object>> body = (List<Map<String, Object>>) jsonReq
.get("body");
try {
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("tableName", BSPHISEntryNames.GY_QXKZ);
// params.put("YWLB", busType);
// params.put("JGID", manageUnit);
// params.put("KSDM", ksdm);
dao.doUpdate("delete from GY_QXKZ where YWLB='" + busType + "' and JGID='" + manageUnit
+ "' and KSDM=" + ksdm + "", null);
for (int i = 0; i < body.size(); i++) {
Map<String, Object> qxkz = body.get(i);
if (qxkz.get("MRBZ") == null || qxkz.get("MRBZ").equals(""))
qxkz.put("MRBZ", 0);
qxkz.put("YWLB", busType);
qxkz.put("JGID", manageUnit);
qxkz.put("KSDM", ksdm);
qxkz.put("YGDM", qxkz.get("PERSONID"));
dao.doSave("create", BSPHISEntryNames.GY_QXKZ, qxkz, false);
}
} catch (PersistentDataOperationException e) {
throw new ServiceException("业务权限设置失败,请联系管理员!", e);
}
jsonRes.put(RES_CODE, ServiceCode.CODE_OK);
jsonRes.put(RES_MESSAGE, "Success");
}
}
| [
"renw1@bsoft.com.cn"
] | renw1@bsoft.com.cn |
868c580a244809be9d33314f1b1ea27f29219efe | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /paistudio-20210202/src/main/java/com/aliyun/paistudio20210202/models/GetAlgoTreeResponseBody.java | 07a778fd2aee071be52b84d5e1037b6bebd54601 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 939 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.paistudio20210202.models;
import com.aliyun.tea.*;
public class GetAlgoTreeResponseBody extends TeaModel {
@NameInMap("Data")
public java.util.Map<String, ?> data;
@NameInMap("RequestId")
public String requestId;
public static GetAlgoTreeResponseBody build(java.util.Map<String, ?> map) throws Exception {
GetAlgoTreeResponseBody self = new GetAlgoTreeResponseBody();
return TeaModel.build(map, self);
}
public GetAlgoTreeResponseBody setData(java.util.Map<String, ?> data) {
this.data = data;
return this;
}
public java.util.Map<String, ?> getData() {
return this.data;
}
public GetAlgoTreeResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
effb9f84c6fad665684b0f4e9b3507cf95041b81 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Chart/4/org/jfree/chart/renderer/xy/XYItemRenderer_getItemPaint_375.java | 744ba0504965236ea42bc50551a2aa9ae3771748 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 2,359 | java |
org jfree chart render
interfac render visual represent singl item
link plot xyplot
support clone chart recommend render implement
link cloneabl code public cloneabl publicclon code interfac
item render xyitemrender legend item sourc legenditemsourc
return paint fill data item drawn
param row row seri index base
param column column categori index base
param select item select
paint code code
paint item paint getitempaint row column select
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
7443282727612fd6eba3496b7dbf94f4ef5cd7f0 | 3be20db29b79f99176b2fe46547c321d2a632bc8 | /app/src/main/java/joe/com/cnode/model/entity/TopicSimple.java | 9d124070daebd530636ae864dc466a95b40cafef | [] | no_license | goosling/CNode | 1eacd6e2805a96d2b3d2ad0c4915908027b90d18 | ed23425063ea3ebc9cc2587ba824b79e2c894e2c | refs/heads/master | 2020-04-06T07:07:37.723252 | 2016-09-10T06:49:27 | 2016-09-10T06:49:27 | 64,759,618 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 912 | java | package joe.com.cnode.model.entity;
import com.google.gson.annotations.SerializedName;
import org.joda.time.DateTime;
/**
* Created by JOE on 2016/8/5.
*/
public class TopicSimple {
private String id;
private String title;
private Author author;
@SerializedName("last_reply_at")
private DateTime lastReplyAt;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Author getAuthor() {
return author;
}
public void setAuthor(Author author) {
this.author = author;
}
public DateTime getLastReplyAt() {
return lastReplyAt;
}
public void setLastReplyAt(DateTime lastReplyAt) {
this.lastReplyAt = lastReplyAt;
}
}
| [
"xiaoliu920@163.com"
] | xiaoliu920@163.com |
11857d15fff75b696a2eac2375003e469a4b9cc3 | a6ee43db1ecf659c47967d3334ba15e504947a5e | /src/main/java/com/leetcode/Reverse_Integer/Solution2.java | dccc780ce5708462fe200df5431ce97fd565bf49 | [
"MIT"
] | permissive | magnetic1/leetcode | fa3d640b640b4626705272bbcafc31c082fa6138 | 4577439aac13f095bc1f20adec5521520b3bef70 | refs/heads/master | 2023-04-21T10:28:10.320263 | 2021-05-06T12:22:57 | 2021-05-06T12:22:57 | 230,269,263 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,524 | java | /**
* Leetcode - Reverse_Integer
*/
package com.leetcode.Reverse_Integer;
import java.util.*;
import com.ciaoshen.leetcode.util.*;
/**
* log instance is defined in Solution interface
* this is how slf4j will work in this class:
* =============================================
* if (log.isDebugEnabled()) {
* log.debug("a + b = {}", sum);
* }
* =============================================
*/
class Solution2 implements Solution {
public int myAtoi(String str) {
if (str == null) return 0;
str = str.trim();
if (str.length() == 0) return 0;
char[] chArray = str.toCharArray();
int sign = 1;
int i = 0;
if (chArray[0] == '+') {
sign = 1;
i++;
} else if (chArray[0] == '-') {
sign = -1;
i++;
}
int result = 0;
while (i < chArray.length) {
int digit = chArray[i] - '0';
if (digit < 0 || digit > 9) {
return sign * result;
}
if (result > Integer.MAX_VALUE / 10 || (result == Integer.MAX_VALUE / 10 && Integer.MAX_VALUE % 10 < digit)) {
return sign == 1 ? Integer.MAX_VALUE : Integer.MIN_VALUE;
}
result = result * 10 + digit;
i++;
}
return sign * result;
}
public static void main(String[] args) {
Solution2 solution1 = new Solution2();
System.out.println(solution1.myAtoi("-2147483648"));
}
}
| [
"1228740123@qq.com"
] | 1228740123@qq.com |
482d45c5086207f20ae8253ac3f785783b226294 | d0694e2ed8da9393758f90f071579baa044c0bd0 | /NetworkOfficeService/src/main/java/com/tecsun/sisp/net/modules/entity/response/MatterFile.java | b60be618dd375224c3027f006534e135bb94a0fe | [] | no_license | rulerlwx/Mestudy | 453e6e07629bd2f2952006cf34bf620b34ea736f | 6fba097ec97bbdb976cefd58f4f4d41ec5f07507 | refs/heads/master | 2021-10-19T07:36:42.720695 | 2019-02-19T07:49:16 | 2019-02-19T07:49:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package com.tecsun.sisp.net.modules.entity.response;
/**
* Created by Administrator on 2018/8/9 0009.
*/
public class MatterFile {
private long id;
private String name;
private String matterid;
private String filecode;
public String getFilecode() {
return filecode;
}
public void setFilecode(String filecode) {
this.filecode = filecode;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMatterid() {
return matterid;
}
public void setMatterid(String matterid) {
this.matterid = matterid;
}
}
| [
"zengyunhuago@163.com"
] | zengyunhuago@163.com |
ebcfffb3d82d71f8854d9d600de1d91f5c77803e | f909ec612f17254be491c3ef9cdc1f0b186e8daf | /java_plugin/jun_jdk/jun_javase/src/main/java/com/java1234/chap02/sec05/Demo7.java | 12651df0c6b67c34a51ca79896cbf074c58e2eb6 | [] | no_license | kingking888/jun_java_plugin | 8853f845f242ce51aaf01dc996ed88784395fd83 | f57e31fa496d488fc96b7e9bab3c245f90db5f21 | refs/heads/master | 2023-06-04T19:30:29.554726 | 2021-06-24T17:19:55 | 2021-06-24T17:19:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 199 | java | package com.java1234.chap02.sec05;
public class Demo7 {
public static void main(String[] args) {
for(int i=0;i<10;i++){
if(i==4){
continue;
}
System.out.print("i="+i+" ");
}
}
}
| [
"wujun728@hotmail.com"
] | wujun728@hotmail.com |
18747378f909e9fad29283f3f21b99ebdaf6fa04 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_336/Testnull_33558.java | 5ee21492e5622c25b6731969f447a77cbc89b996 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 308 | java | package org.gradle.test.performancenull_336;
import static org.junit.Assert.*;
public class Testnull_33558 {
private final Productionnull_33558 production = new Productionnull_33558("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
867dac7c9049a4a47390ccbe80fadc42d5c15ea7 | a2d4bec9812e129e28a63507da7b3aa3f96f5787 | /com/facebook/UiLifecycleHelper.java | a56737e93dcc538486fd306f692117ad6f570969 | [] | no_license | achoraev/RealRacingSource | c5720b4a4437e96c356e88e225a8d0f812e3520a | 9bc98f4708c8f67c388b35d756e3c3517572163e | refs/heads/master | 2020-04-17T16:47:58.342025 | 2015-04-22T06:52:40 | 2015-04-22T06:52:40 | 34,332,999 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,996 | java | package com.facebook;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import com.facebook.internal.NativeProtocol;
import com.facebook.widget.FacebookDialog;
import com.facebook.widget.FacebookDialog.Callback;
import com.facebook.widget.FacebookDialog.PendingCall;
import java.util.UUID;
public class UiLifecycleHelper
{
private static final String ACTIVITY_NULL_MESSAGE = "activity cannot be null";
private static final String DIALOG_CALL_BUNDLE_SAVE_KEY = "com.facebook.UiLifecycleHelper.pendingFacebookDialogCallKey";
private final Activity activity;
private AppEventsLogger appEventsLogger;
private final LocalBroadcastManager broadcastManager;
private final Session.StatusCallback callback;
private FacebookDialog.PendingCall pendingFacebookDialogCall;
private final BroadcastReceiver receiver;
public UiLifecycleHelper(Activity paramActivity, Session.StatusCallback paramStatusCallback)
{
if (paramActivity == null) {
throw new IllegalArgumentException("activity cannot be null");
}
this.activity = paramActivity;
this.callback = paramStatusCallback;
this.receiver = new ActiveSessionBroadcastReceiver(null);
this.broadcastManager = LocalBroadcastManager.getInstance(paramActivity);
Settings.sdkInitialize(paramActivity);
Settings.loadDefaultsFromMetadataIfNeeded(paramActivity);
}
private void cancelPendingAppCall(FacebookDialog.Callback paramCallback)
{
if (paramCallback != null)
{
Intent localIntent1 = this.pendingFacebookDialogCall.getRequestIntent();
Intent localIntent2 = new Intent();
localIntent2.putExtra("com.facebook.platform.protocol.CALL_ID", localIntent1.getStringExtra("com.facebook.platform.protocol.CALL_ID"));
localIntent2.putExtra("com.facebook.platform.protocol.PROTOCOL_ACTION", localIntent1.getStringExtra("com.facebook.platform.protocol.PROTOCOL_ACTION"));
localIntent2.putExtra("com.facebook.platform.protocol.PROTOCOL_VERSION", localIntent1.getIntExtra("com.facebook.platform.protocol.PROTOCOL_VERSION", 0));
localIntent2.putExtra("com.facebook.platform.status.ERROR_TYPE", "UnknownError");
FacebookDialog.handleActivityResult(this.activity, this.pendingFacebookDialogCall, this.pendingFacebookDialogCall.getRequestCode(), localIntent2, paramCallback);
}
this.pendingFacebookDialogCall = null;
}
private boolean handleFacebookDialogActivityResult(int paramInt1, int paramInt2, Intent paramIntent, FacebookDialog.Callback paramCallback)
{
if ((this.pendingFacebookDialogCall == null) || (this.pendingFacebookDialogCall.getRequestCode() != paramInt1)) {
return false;
}
if (paramIntent == null)
{
cancelPendingAppCall(paramCallback);
return true;
}
UUID localUUID = NativeProtocol.getCallIdFromIntent(paramIntent);
if ((localUUID != null) && (this.pendingFacebookDialogCall.getCallId().equals(localUUID))) {
FacebookDialog.handleActivityResult(this.activity, this.pendingFacebookDialogCall, paramInt1, paramIntent, paramCallback);
}
for (;;)
{
this.pendingFacebookDialogCall = null;
return true;
cancelPendingAppCall(paramCallback);
}
}
public AppEventsLogger getAppEventsLogger()
{
Session localSession = Session.getActiveSession();
if (localSession == null) {
return null;
}
if ((this.appEventsLogger == null) || (!this.appEventsLogger.isValidForSession(localSession)))
{
if (this.appEventsLogger != null) {
AppEventsLogger.onContextStop();
}
this.appEventsLogger = AppEventsLogger.newLogger(this.activity, localSession);
}
return this.appEventsLogger;
}
public void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
{
onActivityResult(paramInt1, paramInt2, paramIntent, null);
}
public void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent, FacebookDialog.Callback paramCallback)
{
Session localSession = Session.getActiveSession();
if (localSession != null) {
localSession.onActivityResult(this.activity, paramInt1, paramInt2, paramIntent);
}
handleFacebookDialogActivityResult(paramInt1, paramInt2, paramIntent, paramCallback);
}
public void onCreate(Bundle paramBundle)
{
Session localSession = Session.getActiveSession();
if (localSession == null)
{
if (paramBundle != null) {
localSession = Session.restoreSession(this.activity, null, this.callback, paramBundle);
}
if (localSession == null) {
localSession = new Session(this.activity);
}
Session.setActiveSession(localSession);
}
if (paramBundle != null) {
this.pendingFacebookDialogCall = ((FacebookDialog.PendingCall)paramBundle.getParcelable("com.facebook.UiLifecycleHelper.pendingFacebookDialogCallKey"));
}
}
public void onDestroy() {}
public void onPause()
{
this.broadcastManager.unregisterReceiver(this.receiver);
if (this.callback != null)
{
Session localSession = Session.getActiveSession();
if (localSession != null) {
localSession.removeCallback(this.callback);
}
}
}
public void onResume()
{
Session localSession = Session.getActiveSession();
if (localSession != null)
{
if (this.callback != null) {
localSession.addCallback(this.callback);
}
if (SessionState.CREATED_TOKEN_LOADED.equals(localSession.getState())) {
localSession.openForRead(null);
}
}
IntentFilter localIntentFilter = new IntentFilter();
localIntentFilter.addAction("com.facebook.sdk.ACTIVE_SESSION_SET");
localIntentFilter.addAction("com.facebook.sdk.ACTIVE_SESSION_UNSET");
this.broadcastManager.registerReceiver(this.receiver, localIntentFilter);
}
public void onSaveInstanceState(Bundle paramBundle)
{
Session.saveSession(Session.getActiveSession(), paramBundle);
paramBundle.putParcelable("com.facebook.UiLifecycleHelper.pendingFacebookDialogCallKey", this.pendingFacebookDialogCall);
}
public void onStop() {}
public void trackPendingDialogCall(FacebookDialog.PendingCall paramPendingCall)
{
if (this.pendingFacebookDialogCall != null)
{
Log.i("Facebook", "Tracking new app call while one is still pending; canceling pending call.");
cancelPendingAppCall(null);
}
this.pendingFacebookDialogCall = paramPendingCall;
}
private class ActiveSessionBroadcastReceiver
extends BroadcastReceiver
{
private ActiveSessionBroadcastReceiver() {}
public void onReceive(Context paramContext, Intent paramIntent)
{
if ("com.facebook.sdk.ACTIVE_SESSION_SET".equals(paramIntent.getAction()))
{
Session localSession2 = Session.getActiveSession();
if ((localSession2 != null) && (UiLifecycleHelper.this.callback != null)) {
localSession2.addCallback(UiLifecycleHelper.this.callback);
}
}
Session localSession1;
do
{
do
{
return;
} while (!"com.facebook.sdk.ACTIVE_SESSION_UNSET".equals(paramIntent.getAction()));
localSession1 = Session.getActiveSession();
} while ((localSession1 == null) || (UiLifecycleHelper.this.callback == null));
localSession1.removeCallback(UiLifecycleHelper.this.callback);
}
}
}
/* Location: E:\Dropbox\Dropbox\RealRacingHack\Decompile\install_dex2jar.jar
* Qualified Name: com.facebook.UiLifecycleHelper
* JD-Core Version: 0.7.0.1
*/ | [
"audulin@gmail.com"
] | audulin@gmail.com |
7ae5bf79eb64e5b9179927241319459747b3a2bb | 07251556dde22700fe4828a7aaf85c27787b2fcf | /src/main/java/com/jm/business/service/shop/CommonQrcodeDetailService.java | 48d1ab91d1dbe1bfcd1d4cc1ba58e5a64ce0414a | [] | no_license | wanghonghong/mygit | 0a45dc9e7efa2bcc14b3279c6071dd73fc86da36 | d0f0e40e8897f30042a58a42ea772f887ab1551b | refs/heads/master | 2020-12-02T23:51:40.346895 | 2017-07-02T02:11:26 | 2017-07-02T02:11:26 | 95,954,161 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,525 | java | package com.jm.business.service.shop;
import com.google.zxing.common.BitMatrix;
import com.jm.mvc.vo.shop.commQrcode.CommonQrcodeCo;
import com.jm.repository.client.ImageClient;
import com.jm.repository.client.dto.CosResourceDto;
import com.jm.repository.client.dto.CosUrlDto;
import com.jm.repository.jpa.shop.CommonQrcodeDetailRepository;
import com.jm.repository.po.shop.CommonQrcode;
import com.jm.repository.po.shop.CommonQrcodeDetail;
import com.jm.staticcode.util.FileUtil;
import com.jm.staticcode.util.ImgUtil;
import com.jm.staticcode.util.Toolkit;
import com.jm.staticcode.util.ZxingUtil;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* <p>通用商品条码</p>
*/
@Log4j
@Service
public class CommonQrcodeDetailService {
@Autowired
private CommonQrcodeDetailRepository commonQrcodeDetailRepository;
@Autowired
private ImageClient imageClient;
@Autowired
private CommonQrcodeService commonQrcodeService;
public void save(CommonQrcodeDetail detail){
commonQrcodeDetailRepository.save(detail);
}
public void save(List<CommonQrcodeDetail> details){
commonQrcodeDetailRepository.save(details);
}
/**
* 保存通码详情 并生成图片
* @param commonQrcode
* @param co
*/
public void saveDetailAndImg(final CommonQrcode commonQrcode,CommonQrcodeCo co,final String basePath,final int shopId){
final int count = co.getCount();
//启动线程
ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
cachedThreadPool.execute(new Runnable() {
public void run() {
try {
String path = this.getClass().getResource("/temp/qrcode").getPath();
File[] srcfile = new File[count];
int detailId = 0;
for (int i= 0;i<count;i++){
CommonQrcodeDetail detail = new CommonQrcodeDetail();
detail.setCommonQrcodeId(commonQrcode.getId());
detail.setProductId(commonQrcode.getProductId());
commonQrcodeDetailRepository.save(detail);
detailId = detail.getId();
//生成二维码
String url = basePath+"/commonQrcode/entrance/"+detail.getId()+"?shopId="+shopId;
BitMatrix bi = ZxingUtil.toQRCodeMatrix(url, null, null);
BufferedImage ImageOne = ZxingUtil.writeToFile(bi);
File file = new File(path+"/"+detail.getId()+".jpg");
ImageIO.write(ImageOne, "jpg", file);
srcfile[i]=file;
}
File zipfile = new File(path+"\\3.zip");
FileUtil.zipFiles(srcfile, zipfile);//压缩文件
CosResourceDto cos = imageClient.uploadCosRes("qrcode","zip",Toolkit.File2byte(path+"\\3.zip"));//上传zip包
CosUrlDto data = cos.getData();
commonQrcode.setZipUrl(ImgUtil.substringUrl(data.getAccessUrl()));
commonQrcode.setDetailNum(detailId-count+1+"-"+detailId);
commonQrcodeService.save(commonQrcode);
FileUtil.delAllFile(path);//清空二维码文件夹底下的文件
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
});
}
public CommonQrcodeDetail getCommonQrcodeDetail(Integer id){
return commonQrcodeDetailRepository.findOne(id);
}
public List<CommonQrcodeDetail> findCommonQrcodeDetails(List<Integer> ids){
return commonQrcodeDetailRepository.findAll(ids);
}
}
| [
"445605976@qq.com"
] | 445605976@qq.com |
0884a9421a317c8dc4d8a73fed88d2fae6585e31 | 6253283b67c01a0d7395e38aeeea65e06f62504b | /decompile/framework/boot/sun/net/www/protocol/http/BasicAuthentication.java | df52b34256f3a08bd73675151cd98b0ed51cf448 | [] | no_license | sufadi/decompile-hw | 2e0457a0a7ade103908a6a41757923a791248215 | 4c3efd95f3e997b44dd4ceec506de6164192eca3 | refs/heads/master | 2023-03-15T15:56:03.968086 | 2017-11-08T03:29:10 | 2017-11-08T03:29:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,429 | java | package sun.net.www.protocol.http;
import java.io.UnsupportedEncodingException;
import java.net.PasswordAuthentication;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import sun.misc.BASE64Encoder;
import sun.net.www.HeaderParser;
class BasicAuthentication extends AuthenticationInfo {
static final /* synthetic */ boolean -assertionsDisabled = (!BasicAuthentication.class.desiredAssertionStatus());
private static final long serialVersionUID = 100;
String auth;
private class BasicBASE64Encoder extends BASE64Encoder {
private BasicBASE64Encoder() {
}
protected int bytesPerLine() {
return 10000;
}
}
public BasicAuthentication(boolean isProxy, String host, int port, String realm, PasswordAuthentication pw) {
super(isProxy ? AuthenticationInfo.PROXY_AUTHENTICATION : AuthenticationInfo.SERVER_AUTHENTICATION, AuthScheme.BASIC, host, port, realm);
byte[] nameBytes = null;
try {
nameBytes = (pw.getUserName() + ":").getBytes("ISO-8859-1");
} catch (UnsupportedEncodingException e) {
if (!-assertionsDisabled) {
throw new AssertionError();
}
}
char[] passwd = pw.getPassword();
byte[] passwdBytes = new byte[passwd.length];
for (int i = 0; i < passwd.length; i++) {
passwdBytes[i] = (byte) passwd[i];
}
byte[] concat = new byte[(nameBytes.length + passwdBytes.length)];
System.arraycopy(nameBytes, 0, concat, 0, nameBytes.length);
System.arraycopy(passwdBytes, 0, concat, nameBytes.length, passwdBytes.length);
this.auth = "Basic " + new BasicBASE64Encoder().encode(concat);
this.pw = pw;
}
public BasicAuthentication(boolean isProxy, String host, int port, String realm, String auth) {
super(isProxy ? AuthenticationInfo.PROXY_AUTHENTICATION : AuthenticationInfo.SERVER_AUTHENTICATION, AuthScheme.BASIC, host, port, realm);
this.auth = "Basic " + auth;
}
public BasicAuthentication(boolean isProxy, URL url, String realm, PasswordAuthentication pw) {
super(isProxy ? AuthenticationInfo.PROXY_AUTHENTICATION : AuthenticationInfo.SERVER_AUTHENTICATION, AuthScheme.BASIC, url, realm);
byte[] nameBytes = null;
try {
nameBytes = (pw.getUserName() + ":").getBytes("ISO-8859-1");
} catch (UnsupportedEncodingException e) {
if (!-assertionsDisabled) {
throw new AssertionError();
}
}
char[] passwd = pw.getPassword();
byte[] passwdBytes = new byte[passwd.length];
for (int i = 0; i < passwd.length; i++) {
passwdBytes[i] = (byte) passwd[i];
}
byte[] concat = new byte[(nameBytes.length + passwdBytes.length)];
System.arraycopy(nameBytes, 0, concat, 0, nameBytes.length);
System.arraycopy(passwdBytes, 0, concat, nameBytes.length, passwdBytes.length);
this.auth = "Basic " + new BasicBASE64Encoder().encode(concat);
this.pw = pw;
}
public BasicAuthentication(boolean isProxy, URL url, String realm, String auth) {
super(isProxy ? AuthenticationInfo.PROXY_AUTHENTICATION : AuthenticationInfo.SERVER_AUTHENTICATION, AuthScheme.BASIC, url, realm);
this.auth = "Basic " + auth;
}
public boolean supportsPreemptiveAuthorization() {
return true;
}
public boolean setHeaders(HttpURLConnection conn, HeaderParser p, String raw) {
conn.setAuthenticationProperty(getHeaderName(), getHeaderValue(null, null));
return true;
}
public String getHeaderValue(URL url, String method) {
return this.auth;
}
public boolean isAuthorizationStale(String header) {
return false;
}
static String getRootPath(String npath, String opath) {
int index = 0;
try {
npath = new URI(npath).normalize().getPath();
opath = new URI(opath).normalize().getPath();
} catch (URISyntaxException e) {
}
while (index < opath.length()) {
int toindex = opath.indexOf(47, index + 1);
if (toindex == -1 || !opath.regionMatches(0, npath, 0, toindex + 1)) {
return opath.substring(0, index + 1);
}
index = toindex;
}
return npath;
}
}
| [
"liming@droi.com"
] | liming@droi.com |
aaa5f134c2dd3da59da5e560bad6fcfb186a75c6 | 6d01d0b0ed45a318ca3f4eb1baa215cbe458139e | /programprocessor/experiment-dataset/CodeSource/MyCodeCompletion/cn/yyx/contentassist/codeutils/classOrInterfaceType.java | 21e2dcceae05cd0ca3cb001350239610149ac08d | [] | no_license | yangyixiaof/gitcrawler | 83444de5de1e0e0eb1cb2f1e2f39309f10b52eb5 | f07f0525bcb33c054820cf27e9ff73aa591ed3e0 | refs/heads/master | 2022-09-16T20:07:56.380308 | 2020-04-12T17:03:02 | 2020-04-12T17:03:02 | 46,218,938 | 0 | 1 | null | 2022-09-01T22:36:18 | 2015-11-15T13:36:48 | Java | UTF-8 | Java | false | false | 2,721 | java | package cn.yyx.contentassist.codeutils;
import java.util.List;
import cn.yyx.contentassist.codepredict.CodeSynthesisException;
import cn.yyx.contentassist.codesynthesis.CSFlowLineQueue;
import cn.yyx.contentassist.codesynthesis.CodeSynthesisHelper;
import cn.yyx.contentassist.codesynthesis.data.CSFlowLineData;
import cn.yyx.contentassist.codesynthesis.flowline.FlowLineNode;
import cn.yyx.contentassist.codesynthesis.statementhandler.CSStatementHandler;
import cn.yyx.contentassist.commonutils.SimilarityHelper;
public class classOrInterfaceType extends type{
List<type> tps = null;
public classOrInterfaceType(List<type> result) {
this.tps = result;
}
@Override
public boolean CouldThoughtSame(OneCode t) {
if (t instanceof classOrInterfaceType)
{
return SimilarityHelper.CouldThoughtListsOfTypeSame(tps, ((classOrInterfaceType) t).tps);
}
return false;
}
@Override
public double Similarity(OneCode t) {
if (t instanceof classOrInterfaceType)
{
return SimilarityHelper.ComputeListsOfTypeSimilarity(tps, ((classOrInterfaceType) t).tps);
}
return 0;
}
/*@Override
public boolean HandleCodeSynthesis(CodeSynthesisQueue squeue, Stack<TypeCheck> expected, SynthesisHandler handler,
CSNode result, AdditionalInfo ai) {
Iterator<type> itr = tps.iterator();
while (itr.hasNext())
{
type t = itr.next();
CSNode ttp = new CSNode(CSNodeType.TempUsed);
boolean conflict = t.HandleCodeSynthesis(squeue, expected, handler, ttp, null);
if (conflict)
{
return true;
}
result.setDatas(CSNodeHelper.ConcatTwoNodesDatas(ttp, result, ".", -1));
}
CSNodeHelper.HandleTypeByTypeCodes(result);
return false;
}*/
@Override
public List<FlowLineNode<CSFlowLineData>> HandleCodeSynthesis(CSFlowLineQueue squeue, CSStatementHandler smthandler)
throws CodeSynthesisException {
List<FlowLineNode<CSFlowLineData>> result = null;
type tp = tps.iterator().next();
result = tp.HandleCodeSynthesis(squeue, smthandler);
/*Iterator<type> itr = reveredtps.iterator();
while (itr.hasNext())
{
type tp = itr.next();
List<FlowLineNode<CSFlowLineData>> tpls = tp.HandleCodeSynthesis(squeue, smthandler);
if (tpls == null || tpls.size() == 0)
{
continue;
}
if (result == null)
{
result = tpls;
}
else
{
if (result.size() == 0)
{
break;
}
result = CodeSynthesisHelper.HandleTypeSpecificationInfer(result, tpls, squeue, smthandler);
}
}*/
if (result == null || result.size() == 0)
{
return CodeSynthesisHelper.HandleMultipleConcateType(squeue, smthandler, tps, ".");
}
return result;
}
} | [
"yyx@ubuntu"
] | yyx@ubuntu |
6c2abfa50584306b55a547fa8d42b4d0b5401c32 | c32e30b903e3b58454093cd8ee5c7bba7fb07365 | /source/Class_6113.java | 717f278ce343d3bdaa2bf6cf92d3ac838ce3d8dd | [] | no_license | taiwan902/bp-src | 0ee86721545a647b63848026a995ddb845a62969 | 341a34ebf43ab71bea0becf343795e241641ef6a | refs/heads/master | 2020-12-20T09:17:11.506270 | 2020-01-24T15:15:30 | 2020-01-24T15:15:30 | 236,025,046 | 1 | 1 | null | 2020-01-24T15:10:30 | 2020-01-24T15:10:29 | null | UTF-8 | Java | false | false | 1,087 | java | /*
* Decompiled with CFR 0.145.
*/
public interface Class_6113 {
public void Method_6114(String var1, Object var2);
public void Method_6115(String var1, Object var2, Object var3);
public void Method_6116(String var1, Throwable var2);
public void Method_6117(String var1);
public void Method_6118(String var1, Object var2, Object var3);
public boolean Method_6119();
public void Method_6120(String var1, Object ... var2);
public void Method_6121(String var1, Throwable var2);
public void Method_6122(String var1, Object var2, Object var3);
public void Method_6123(String var1, Object var2, Object var3);
public void Method_6124(String var1, Object ... var2);
public void Method_6125(String var1, Object var2);
public void Method_6126(String var1);
public void Method_6127(String var1, Throwable var2);
public boolean Method_6128();
public void Method_6129(String var1, Object var2);
public void Method_6130(String var1);
public boolean Method_6131();
public void Method_6132(String var1);
}
| [
"szymex73@gmail.com"
] | szymex73@gmail.com |
3d9996acb1ea4c3ab565eef5407a86739d705973 | 129f58086770fc74c171e9c1edfd63b4257210f3 | /src/testcases/CWE643_Xpath_Injection/CWE643_Xpath_Injection__getQueryString_Servlet_51a.java | 4e7a47e1a1974be9710732160a16a914e101b74d | [] | no_license | glopezGitHub/Android23 | 1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba | 6215d0684c4fbdc7217ccfbedfccfca69824cc5e | refs/heads/master | 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 | Java | UTF-8 | Java | false | false | 3,967 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE643_Xpath_Injection__getQueryString_Servlet_51a.java
Label Definition File: CWE643_Xpath_Injection.label.xml
Template File: sources-sinks-51a.tmpl.java
*/
/*
* @description
* CWE: 643 Xpath Injection
* BadSource: getQueryString_Servlet Parse id param out of the URL query string (without using getParameter())
* GoodSource: A hardcoded string
* Sinks: unvalidatedXPath
* GoodSink: validate input through StringEscapeUtils
* BadSink : user input is used without validate
* Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package
*
* */
package testcases.CWE643_Xpath_Injection;
import testcasesupport.*;
import java.io.*;
import javax.xml.xpath.*;
import javax.servlet.http.*;
import org.xml.sax.InputSource;
import org.apache.commons.lang.StringEscapeUtils;
import javax.servlet.http.*;
import java.util.StringTokenizer;
public class CWE643_Xpath_Injection__getQueryString_Servlet_51a extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
data = ""; /* initialize data in case id is not in query string */
/* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParameter()) */
{
StringTokenizer st = new StringTokenizer(request.getQueryString(), "&");
while (st.hasMoreTokens())
{
String token = st.nextToken(); /* a token will be like "id=foo" */
if(token.startsWith("id=")) /* check if we have the "id" parameter" */
{
data = token.substring(3); /* set data to "foo" */
break; /* exit while loop */
}
}
}
(new CWE643_Xpath_Injection__getQueryString_Servlet_51b()).bad_sink(data , request, response );
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
goodB2G(request, response);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* FIX: Use a hardcoded string */
data = "foo";
(new CWE643_Xpath_Injection__getQueryString_Servlet_51b()).goodG2B_sink(data , request, response );
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
data = ""; /* initialize data in case id is not in query string */
/* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParameter()) */
{
StringTokenizer st = new StringTokenizer(request.getQueryString(), "&");
while (st.hasMoreTokens())
{
String token = st.nextToken(); /* a token will be like "id=foo" */
if(token.startsWith("id=")) /* check if we have the "id" parameter" */
{
data = token.substring(3); /* set data to "foo" */
break; /* exit while loop */
}
}
}
(new CWE643_Xpath_Injection__getQueryString_Servlet_51b()).goodB2G_sink(data , request, response );
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"guillermo.pando@gmail.com"
] | guillermo.pando@gmail.com |
09159bfa3f48e9496eac1cbc5bbfeb8ea53ed9dc | 835e64825c05e493bb2d3f4ffd2498747b2c2649 | /canna/src/main/java/com/voole/gxt/client/service/ClientServiceFactory.java | bb7596d4cc5b442404ddab7520716d8828f791bb | [] | no_license | wowcinder/canna | 9120419d44d8010740a57f4d8ff6a1ebc503838e | 61ac897a5812f2941c79d5c36776fd79859026b7 | refs/heads/master | 2021-01-02T09:38:07.170089 | 2013-10-15T13:39:28 | 2013-10-15T13:39:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | package com.voole.gxt.client.service;
import java.util.HashMap;
import java.util.Map;
import com.google.gwt.core.shared.GWT;
public class ClientServiceFactory {
private static final ClientServiceFinder finder = GWT
.create(ClientServiceFinder.class);
private static Map<Class<?>, Object> maps = new HashMap<Class<?>, Object>();
@SuppressWarnings("unchecked")
public static <T> T getService(Class<?> clazz) {
if (!maps.containsKey(clazz)) {
createService(clazz);
}
return (T) maps.get(clazz);
}
private static void createService(Class<?> clazz) {
Object service = finder.createService(clazz);
maps.put(clazz, service);
}
}
| [
"xuehuihe.java@gmail.com"
] | xuehuihe.java@gmail.com |
9c2b7a64afdafa1fd7b9cadb87a76080d9bea019 | 87ffe6cef639e2b96b8d5236b5ace57e16499491 | /app/src/main/java/com/boohee/food/BaseActivity.java | 6bad5e178394e72edcf35663deac5599b5dfeeeb | [] | no_license | leerduo/FoodsNutrition | 24ffeea902754b84a2b9fbd3299cf4fceb38da3f | a448a210e54f789201566da48cc44eceb719b212 | refs/heads/master | 2020-12-11T05:45:34.531682 | 2015-08-28T04:35:05 | 2015-08-28T04:35:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,158 | java | package com.boohee.food;
import android.app.ActionBar;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.MenuItem;
import com.boohee.food.fragment.LoadingFragment;
import com.boohee.food.volley.RequestManager;
import com.umeng.analytics.MobclickAgent;
import de.keyboardsurfer.android.widget.crouton.Crouton;
public abstract class BaseActivity extends FragmentActivity {
protected Context a;
private LoadingFragment b;
private void a() {
ActionBar localActionBar = getActionBar();
localActionBar.setDisplayHomeAsUpEnabled(true);
localActionBar.setDisplayShowHomeEnabled(true);
localActionBar.setIcon(17170445);
localActionBar.setHomeButtonEnabled(true);
}
public void a(Class paramClass) {
startActivity(new Intent(this, paramClass));
}
public void c() {
try {
if (this.b == null) {
this.b = LoadingFragment.a();
}
if (!this.b.isAdded()) {
getSupportFragmentManager().beginTransaction().remove(this.b).commitAllowingStateLoss();
this.b.show(getSupportFragmentManager(), "loading");
}
return;
} catch (Exception localException) {
localException.printStackTrace();
}
}
public void d() {
try {
if ((this.b != null) && (this.b.isAdded())) {
this.b.dismiss();
}
return;
} catch (Exception localException) {
localException.printStackTrace();
}
}
protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent) {
super.onActivityResult(paramInt1, paramInt2, paramIntent);
}
public void onBackPressed() {
if (!((FoodApplication) getApplication()).b()) {
Intent localIntent = new Intent(this, MainActivity.class);
localIntent.setFlags(67108864);
startActivity(localIntent);
finish();
return;
}
super.onBackPressed();
}
protected void onCreate(Bundle paramBundle) {
super.onCreate(paramBundle);
this.a = this;
a();
}
protected void onDestroy() {
super.onDestroy();
RequestManager.a(this);
Crouton.a();
}
public boolean onOptionsItemSelected(MenuItem paramMenuItem) {
switch (paramMenuItem.getItemId()) {
default:
return super.onOptionsItemSelected(paramMenuItem);
}
onBackPressed();
return true;
}
public void onPause() {
super.onPause();
MobclickAgent.onPause(this);
}
public void onResume() {
super.onResume();
MobclickAgent.onResume(this);
}
}
/* Location: D:\15036015\反编译\shiwuku\classes_dex2jar.jar
* Qualified Name: com.boohee.food.BaseActivity
* JD-Core Version: 0.7.0-SNAPSHOT-20130630
*/ | [
"1060221762@qq.com"
] | 1060221762@qq.com |
6efcdd29577304ac622227d1a32b4bfc2cd6aeb2 | 725b0c33af8b93b557657d2a927be1361256362b | /com/planet_ink/coffee_mud/Abilities/Spells/Spell_FlamingEnsnarement.java | 573630eb0c27893d91471cfbb94dcf02042504c3 | [
"Apache-2.0"
] | permissive | mcbrown87/CoffeeMud | 7546434750d1ae0418ac2c76d27f872106d2df97 | 0d4403d466271fe5d75bfae8f33089632ac1ddd6 | refs/heads/master | 2020-12-30T19:23:07.758257 | 2014-06-25T00:01:20 | 2014-06-25T00:01:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,385 | java | package com.planet_ink.coffee_mud.Abilities.Spells;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2000-2014 Bo Zimmerman
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.
*/
@SuppressWarnings("rawtypes")
public class Spell_FlamingEnsnarement extends Spell
{
@Override public String ID() { return "Spell_FlamingEnsnarement"; }
private final static String localizedName = CMLib.lang()._("Flaming Ensnarement");
@Override public String name() { return localizedName; }
private final static String localizedStaticDisplay = CMLib.lang()._("(Ensnared in Fire)");
@Override public String displayText() { return localizedStaticDisplay; }
@Override public int maxRange(){return adjustedMaxInvokerRange(5);}
@Override public int minRange(){return 1;}
@Override public int abstractQuality(){return Ability.QUALITY_MALICIOUS;}
@Override protected int canAffectCode(){return CAN_MOBS;}
@Override public int classificationCode(){ return Ability.ACODE_SPELL|Ability.DOMAIN_CONJURATION;}
@Override public long flags(){return Ability.FLAG_BINDING|Ability.FLAG_FIREBASED|Ability.FLAG_HEATING;}
public int amountRemaining=0;
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return true;
final MOB mob=(MOB)affected;
// when this spell is on a MOBs Affected list,
// it should consistantly prevent the mob
// from trying to do ANYTHING except sleep
if(msg.amISource(mob))
{
switch(msg.sourceMinor())
{
case CMMsg.TYP_ENTER:
case CMMsg.TYP_ADVANCE:
case CMMsg.TYP_LEAVE:
case CMMsg.TYP_FLEE:
if(mob.location().show(mob,null,CMMsg.MSG_OK_ACTION,_("<S-NAME> struggle(s) against the flaming ensnarement.")))
{
amountRemaining-=mob.phyStats().level();
if(amountRemaining<0)
unInvoke();
}
return false;
}
}
return super.okMessage(myHost,msg);
}
@Override
public void affectPhyStats(Physical affected, PhyStats affectableStats)
{
super.affectPhyStats(affected,affectableStats);
affectableStats.setDisposition((int)(affectableStats.disposition()&(PhyStats.ALLMASK-PhyStats.IS_FLYING)));
}
@Override
public void unInvoke()
{
// undo the affects of this spell
if(!(affected instanceof MOB))
return;
final MOB mob=(MOB)affected;
super.unInvoke();
if(canBeUninvoked())
mob.location().show(mob,null,CMMsg.MSG_NOISYMOVEMENT,_("<S-NAME> manage(s) to break <S-HIS-HER> way free of the burning ensnarement."));
}
@Override
public boolean tick(Tickable ticking, int tickID)
{
if((tickID==Tickable.TICKID_MOB)
&&(affected!=null)
&&(affected instanceof MOB))
{
final MOB M=(MOB)affected;
if((!M.amDead())&&(M.location()!=null))
{
CMLib.combat().postDamage(invoker,M,this,CMLib.dice().roll(2,4+super.getXLEVELLevel(invoker())+(2*super.getX1Level(invoker())),0),CMMsg.TYP_FIRE,-1,"<T-NAME> get(s) singed from <T-HIS-HER> flaming ensnarement!");
if((!M.isInCombat())&&(M!=invoker)&&(M.location()!=null)&&(M.location().isInhabitant(invoker))&&(CMLib.flags().canBeSeenBy(invoker,M)))
CMLib.combat().postAttack(M,invoker,M.fetchWieldedItem());
}
}
return super.tick(ticking,tickID);
}
@Override
public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel)
{
final Set<MOB> h=properTargets(mob,givenTarget,auto);
if(h==null)
{
mob.tell(_("There doesn't appear to be anyone here worth ensnaring."));
return false;
}
// the invoke method for spells receives as
// parameters the invoker, and the REMAINING
// command line parameters, divided into words,
// and added as String objects to a vector.
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
boolean success=proficiencyCheck(mob,0,auto);
if(success)
{
if(mob.location().show(mob,null,this,verbalCastCode(mob,null,auto),auto?"":_("^S<S-NAME> speak(s) and wave(s) <S-HIS-HER> fingers at the ground.^?")))
for (final Object element : h)
{
final MOB target=(MOB)element;
// it worked, so build a copy of this ability,
// and add it to the affects list of the
// affected MOB. Then tell everyone else
// what happened.
final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),null);
if((mob.location().okMessage(mob,msg))&&(target.fetchEffect(this.ID())==null))
{
mob.location().send(mob,msg);
if(msg.value()<=0)
{
amountRemaining=60;
if(target.location()==mob.location())
{
success=maliciousAffect(mob,target,asLevel,0,-1);
target.location().show(target,null,CMMsg.MSG_OK_ACTION,_("<S-NAME> become(s) ensnared in the flaming tendrils erupting from the ground, and is unable to move <S-HIS-HER> feet!"));
}
}
}
}
}
else
return maliciousFizzle(mob,null,_("<S-NAME> speak(s) and wave(s) <S-HIS-HER> fingers, but the spell fizzles."));
// return whether it worked
return success;
}
}
| [
"bo@0d6f1817-ed0e-0410-87c9-987e46238f29"
] | bo@0d6f1817-ed0e-0410-87c9-987e46238f29 |
3e8a7ca828cd9a015e36195fa7e597407a9d78a3 | a7b7cff0cffbb773fe6580bbe92d2d11d2411cd3 | /notice-manager/src/main/java/com/sixliu/credit/notice/dto/NoticeMessageDTO.java | e641bcac51297d96e20f3e3af747131a9071ec34 | [] | no_license | linghouwen/credit-loan | 00c16307729a97cc6978e75484cd64a425218e29 | 6c812f21fa34389434b07feeb3ec1a3bb7f8434b | refs/heads/master | 2020-07-13T15:26:54.866517 | 2018-08-13T01:56:24 | 2018-08-13T01:56:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 654 | java | package com.sixliu.credit.notice.dto;
import java.util.List;
import javax.validation.constraints.NotBlank;
import com.sixliu.credit.common.dto.BaseWriteDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*@author:MG01867
*@date:2018年7月5日
*@E-mail:359852326@qq.com
*@version:
*@describe //TODO
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class NoticeMessageDTO extends BaseWriteDTO{
/**
* 消息模版key
*/
@NotBlank(message="The NoticeMessage's templateKey must be not blank")
private String templateKey;
/**
* 消息模版变量集合
*/
private List<String> variable;
}
| [
"359852326@qq.com"
] | 359852326@qq.com |
30fda0adeac891e534a8fb2aa3627c58d0778512 | 9725f230d1330703a963fba3ba6f369a10887526 | /aliyun-java-sdk-drds/src/main/java/com/aliyuncs/drds/model/v20171016/DescribeDrdsDBRequest.java | d4046bb05a31864f4152c2549beb7a7578db47f8 | [
"Apache-2.0"
] | permissive | czy95czy/aliyun-openapi-java-sdk | 21e74b8f23cced2f65fb3a1f34648c7bf01e3c48 | 5410bde6a54fe40a471b43e50696f991f5df25aa | refs/heads/master | 2020-07-13T02:18:08.645626 | 2019-08-29T03:16:37 | 2019-08-29T03:16:37 | 204,966,560 | 0 | 0 | NOASSERTION | 2019-08-28T23:38:50 | 2019-08-28T15:38:50 | null | UTF-8 | Java | false | false | 1,542 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.drds.model.v20171016;
import com.aliyuncs.RpcAcsRequest;
/**
* @author auto create
* @version
*/
public class DescribeDrdsDBRequest extends RpcAcsRequest<DescribeDrdsDBResponse> {
public DescribeDrdsDBRequest() {
super("Drds", "2017-10-16", "DescribeDrdsDB", "drds");
}
private String dbName;
private String drdsInstanceId;
public String getDbName() {
return this.dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName;
if(dbName != null){
putQueryParameter("DbName", dbName);
}
}
public String getDrdsInstanceId() {
return this.drdsInstanceId;
}
public void setDrdsInstanceId(String drdsInstanceId) {
this.drdsInstanceId = drdsInstanceId;
if(drdsInstanceId != null){
putQueryParameter("DrdsInstanceId", drdsInstanceId);
}
}
@Override
public Class<DescribeDrdsDBResponse> getResponseClass() {
return DescribeDrdsDBResponse.class;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
46c2c9076900a13e78301c51426f87dd10aaf92b | c7bdefcaa4b2c7d1a857bfd5253c556df0159cbc | /SLOTGAMES/src/test/java/stepDefinition_VegasMania/VegasMania_Navigate_HomeScreen.java | 3a901609bc65f028fe2779d3982fc81ef8019057 | [] | no_license | pavanysecit/SLOTGAMES_MOBILES | 62a97bded1f4d0df0f50fc2176e473ce3dac267b | 80bb25d81feda93b3f9137080bd2f0922e882da6 | refs/heads/master | 2021-02-15T04:56:59.388043 | 2021-01-07T09:36:44 | 2021-01-07T09:36:44 | 244,863,982 | 0 | 0 | null | 2020-10-13T20:03:05 | 2020-03-04T09:52:42 | Java | UTF-8 | Java | false | false | 2,187 | java | package stepDefinition_VegasMania;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.ScreenOrientation;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
public class VegasMania_Navigate_HomeScreen {
AppiumDriver<MobileElement> driver;
public VegasMania_Navigate_HomeScreen() throws InterruptedException {
this.driver = VegasMania_URL_Login.getDriver();
//this.driver = VegasMania_URL_TryNow.getDriver();
}
@Given("^Chrome browser, valid URL, valid login details, Vegas Mania slot game and home button$")
public void chrome_browser_valid_URL_valid_login_details_Vegas_Mania_slot_game_and_home_button() throws Throwable {
WebDriverWait wait1 = new WebDriverWait(driver, 80);
wait1.until(ExpectedConditions.visibilityOfElementLocated(By.id("hud_Hud_txtBalance1")));
}
@When("^Open the Vegas Mania slot game by entering the valid URL in browser, enter the valid login details, transfer the balance and click on home button$")
public void open_the_Vegas_Mania_slot_game_by_entering_the_valid_URL_in_browser_enter_the_valid_login_details_transfer_the_balance_and_click_on_home_button() throws Throwable {
// change the orientation of the screen
driver.rotate(ScreenOrientation.LANDSCAPE);
driver.findElement(By.id("hud_btnHome")).click();
Thread.sleep(4000);
String expected= driver.findElement(By.id("com.android.chrome:id/url_bar")).getText();
//String expected = driver.findElement(By.xpath("/html/body/div[3]/div[1]/ui-view/section/section[1]/h3")).getText();
String actual = "demo.ysecit.in:82/SlotGames/slotsgame";
Assert.assertEquals(expected, actual);
}
@Then("^System should take the player to Home page after clicking on home button from Vegas Mania game$")
public void system_should_take_the_player_to_Home_page_after_clicking_on_home_button_from_Vegas_Mania_game() throws Throwable {
Thread.sleep(2000);
driver.quit();
}
}
| [
"pavan.kumar@ysecit.com"
] | pavan.kumar@ysecit.com |
2278d894b5106f2a256a98004145db87778f0150 | 27155dc0554a947ef912bf93d15e84a0d504f977 | /src/main/src/com/founder/xy/app/ApkUtils.java | ec5ead39922935ae15ade7267fed276518f8d2d2 | [] | no_license | nolan124/xy6.0-xzw | 75dee8c32e005c4bebffb05a0e1a22b8389cc430 | 86b702fa4517a153857fe8bfd3df8f907417b856 | refs/heads/master | 2023-03-17T11:41:18.327201 | 2019-03-13T05:01:17 | 2019-03-13T05:01:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,725 | java | package com.founder.xy.app;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.springframework.stereotype.Component;
/**
*
* @author Feng 解析apk包公共类
*/
@Component
public class ApkUtils {
/**
* 根据apk读取xml中的某信息
*
* @throws IOException
*/
@SuppressWarnings("rawtypes")
public static Map getApkInfo(String apkPath){
SAXReader builder = new SAXReader ();
Document document = null;
try{
document = builder.read(getXmlInputStream(apkPath));
}catch (Exception e) {
e.printStackTrace();
}
Element root = document.getRootElement();//跟节点-->manifest
String s = root.attributes().toString();
String c[] = s.split(",");
String versionCode = null;
String versionName = null;
for(String a: c){
if(a.contains("versionCode")){
versionCode = a.substring(a.indexOf("versionCode")+19, a.lastIndexOf("\""));
}
if(a.contains("versionName")){
versionName = a.substring(a.indexOf("versionName")+19, a.lastIndexOf("\""));
}
}
Map<String,String> info = new HashMap<>();
info.put("versionCode", versionCode);
info.put("versionName", versionName);
return info;
}
private static InputStream getXmlInputStream(String apkPath) {
InputStream inputStream = null;
InputStream xmlInputStream = null;
ZipFile zipFile = null;
try {
zipFile = new ZipFile(apkPath);
ZipEntry zipEntry = new ZipEntry("AndroidManifest.xml");
inputStream = zipFile.getInputStream(zipEntry);
AXMLPrinter xmlPrinter = new AXMLPrinter();
xmlPrinter.startPrinf(inputStream);
xmlInputStream = new ByteArrayInputStream(xmlPrinter.getBuf().toString().getBytes("UTF-8"));
} catch (IOException e) {
e.printStackTrace();
try {
inputStream.close();
zipFile.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
return xmlInputStream;
}
/*
public String getMd5(File file) throws FileNotFoundException {
String value = null;
FileInputStream in = null;
try {
in = new FileInputStream(file);
MappedByteBuffer byteBuffer = in.getChannel().map(
FileChannel.MapMode.READ_ONLY, 0, file.length());
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(byteBuffer);
BigInteger bi = new BigInteger(1, md5.digest());
value = bi.toString(16);
clean(byteBuffer);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (null != in) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return value;
}*/
/* // publishTo发布在拷贝文件后 buffer仍然有源文件的句柄,文件处于不可删除状态,需要clean
@SuppressWarnings("unchecked")
public static void clean(final Object buffer) throws Exception {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
try {
Method getCleanerMethod = buffer.getClass().getMethod(
"cleaner", new Class[0]);
getCleanerMethod.setAccessible(true);
sun.misc.Cleaner cleaner = (sun.misc.Cleaner) getCleanerMethod
.invoke(buffer, new Object[0]);
cleaner.clean();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
});
}*/
}
| [
"2491042435@qq.com"
] | 2491042435@qq.com |
a0cb1eef536ba457d4f649348d8fb5567ffa3c6d | e087ef4984a8658c287d955276f08f06da358397 | /src/com/javarush/test/level07/lesson12/home06/Solution.java | bc3849de2d7e36c0f609c6c8b3b343459149d36d | [] | no_license | YuriiLosinets/javacore | f08fd93623bc5c90fcb4eb13a03a3360b702a5fb | 552117fd18a96ff99c6bd5455f16f4bb234d2bdc | refs/heads/master | 2021-01-10T14:39:57.494858 | 2016-03-25T08:40:31 | 2016-03-25T08:40:31 | 53,958,241 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,952 | java | package com.javarush.test.level07.lesson12.home06;
/* Семья
Создай класс Human с полями имя(String), пол(boolean),возраст(int), отец(Human), мать(Human). Создай объекты и заполни их так, чтобы получилось: Два дедушки, две бабушки, отец, мать, трое детей. Вывести объекты на экран.
Примечание:
Если написать свой метод String toString() в классе Human, то именно он будет использоваться при выводе объекта на экран.
Пример вывода:
Имя: Аня, пол: женский, возраст: 21, отец: Павел, мать: Катя
Имя: Катя, пол: женский, возраст: 55
Имя: Игорь, пол: мужской, возраст: 2, отец: Михаил, мать: Аня
…
*/
public class Solution
{
public static void main(String[] args)
{
Human Ded1 = new Human("Ded1", true, 76);
Human Ded2 = new Human("Ded2", true, 78);
Human Babka1 = new Human("Babaka1", false, 72);
Human Babka2 = new Human("Babaka2", false, 74);
Human Dad = new Human("Dad", true, 50, Ded1, Babka1);
Human Mom = new Human("Mom", false, 45, Ded2, Babka2);
Human Son1 = new Human("Son1", true, 25, Dad, Mom);
Human Son2 = new Human("Son2", true, 30, Dad, Mom);
Human Don = new Human("Don", false, 22, Dad, Mom);
System.out.println(Ded1);
System.out.println(Ded2);
System.out.println(Babka1);
System.out.println(Babka2);
System.out.println(Dad);
System.out.println(Mom);
System.out.println(Son1);
System.out.println(Son2);
System.out.println(Don);
}
public static class Human
{
private String name;
private boolean sex;
private int age;
private Human father;
private Human mother;
public Human(String name, boolean sex, int age)
{
this.name = name;
this.sex = sex;
this.age = age;
}
public Human(String name, boolean sex, int age, Human father, Human mother)
{
this.name = name;
this.sex = sex;
this.age = age;
this.father = father;
this.mother = mother;
}
public String toString()
{
String text = "";
text += "Имя: " + this.name;
text += ", пол: " + (this.sex ? "мужской" : "женский");
text += ", возраст: " + this.age;
if (this.father != null)
text += ", отец: " + this.father.name;
if (this.mother != null)
text += ", мать: " + this.mother.name;
return text;
}
}
}
| [
"yuri.losinets@gmail.com"
] | yuri.losinets@gmail.com |
f7f136b9e0517f5d9e84bc13286073d80d69d5d2 | d93a47a7c64fae6e5fa62184ca95f7831c3c20ed | /src/net/authorize/api/contract/v1/CreateCustomerProfileResponse.java | 5f5d6e0e47f2c7491bee1b589ec0b0e456797d87 | [] | no_license | cfy202/intertrips | b5ace01f0c7f7ab4f9753be4f3ab5d457102d263 | f3810e8018b5c3f15c2f72b281e9a462fe0d4cb0 | refs/heads/master | 2020-04-29T11:37:20.753331 | 2019-12-04T03:12:11 | 2019-12-04T03:12:11 | 176,105,219 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,796 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.05.26 at 11:27:57 AM PDT
//
package net.authorize.api.contract.v1;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <extension base="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}ANetApiResponse">
* <sequence>
* <element name="customerProfileId" type="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}numericString" minOccurs="0"/>
* <element name="customerPaymentProfileIdList" type="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfNumericString"/>
* <element name="customerShippingAddressIdList" type="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfNumericString"/>
* <element name="validationDirectResponseList" type="{AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfString"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"customerProfileId",
"customerPaymentProfileIdList",
"customerShippingAddressIdList",
"validationDirectResponseList"
})
@XmlRootElement(name = "createCustomerProfileResponse")
public class CreateCustomerProfileResponse
extends ANetApiResponse
{
protected String customerProfileId;
@XmlElement(required = true)
protected ArrayOfNumericString customerPaymentProfileIdList;
@XmlElement(required = true)
protected ArrayOfNumericString customerShippingAddressIdList;
@XmlElement(required = true)
protected ArrayOfString validationDirectResponseList;
/**
* Gets the value of the customerProfileId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCustomerProfileId() {
return customerProfileId;
}
/**
* Sets the value of the customerProfileId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCustomerProfileId(String value) {
this.customerProfileId = value;
}
/**
* Gets the value of the customerPaymentProfileIdList property.
*
* @return
* possible object is
* {@link ArrayOfNumericString }
*
*/
public ArrayOfNumericString getCustomerPaymentProfileIdList() {
return customerPaymentProfileIdList;
}
/**
* Sets the value of the customerPaymentProfileIdList property.
*
* @param value
* allowed object is
* {@link ArrayOfNumericString }
*
*/
public void setCustomerPaymentProfileIdList(ArrayOfNumericString value) {
this.customerPaymentProfileIdList = value;
}
/**
* Gets the value of the customerShippingAddressIdList property.
*
* @return
* possible object is
* {@link ArrayOfNumericString }
*
*/
public ArrayOfNumericString getCustomerShippingAddressIdList() {
return customerShippingAddressIdList;
}
/**
* Sets the value of the customerShippingAddressIdList property.
*
* @param value
* allowed object is
* {@link ArrayOfNumericString }
*
*/
public void setCustomerShippingAddressIdList(ArrayOfNumericString value) {
this.customerShippingAddressIdList = value;
}
/**
* Gets the value of the validationDirectResponseList property.
*
* @return
* possible object is
* {@link ArrayOfString }
*
*/
public ArrayOfString getValidationDirectResponseList() {
return validationDirectResponseList;
}
/**
* Sets the value of the validationDirectResponseList property.
*
* @param value
* allowed object is
* {@link ArrayOfString }
*
*/
public void setValidationDirectResponseList(ArrayOfString value) {
this.validationDirectResponseList = value;
}
}
| [
"cfy871222@163.com"
] | cfy871222@163.com |
380faf6aa18a81206878b4496e1cd0f0abc483be | faf3abeb4171d37d48f6491277173db12a123bad | /lecturasElfec/src/main/java/com/elfec/lecturas/helpers/ManejadorJSON.java | 6db80430b3edb2e54286d7f814809e06e0a4dca4 | [] | no_license | diegoRodriguezAguila/Elfec.Lecturas | 690ef4c6f3b00ad995819ffd696b31afe73320a1 | c2bf794a4f7b9984a0dd603ae768b4995d1368f6 | refs/heads/master | 2020-12-25T16:48:48.966110 | 2016-11-11T15:53:06 | 2016-11-11T15:53:06 | 34,345,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,440 | java | package com.elfec.lecturas.helpers;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Types;
import org.json.JSONException;
import org.json.JSONObject;
import com.elfec.lecturas.settings.ConstantesDeEntorno;
import android.os.Environment;
import android.util.Log;
/**
* Se encarga de operaciones con JSON, como los archivos de parametros y su conversion
* @author drodriguez
*
*/
public class ManejadorJSON {
/**
* Convierte un resultset en un objeto JSON
* @param rs
* @return
* @throws SQLException
* @throws JSONException
*/
public static JSONObject convertirResultSetAJSON(ResultSet rs) throws SQLException, JSONException
{
ResultSetMetaData rsmd = rs.getMetaData();
int numCols = rsmd.getColumnCount();
JSONObject obj = new JSONObject();
String nombreColumna;
int tipo;
for (int i = 1; i <= numCols; i++)
{
nombreColumna = rsmd.getColumnName(i);
tipo = rsmd.getColumnType(i);
if(tipo==Types.BIGINT || tipo==Types.INTEGER || tipo==Types.SMALLINT || tipo==Types.TINYINT)
{
obj.put(nombreColumna, rs.getLong(nombreColumna));
}
else if(tipo==Types.DECIMAL || tipo==Types.NUMERIC || tipo==Types.DOUBLE || tipo==Types.FLOAT)
{
obj.put(nombreColumna, rs.getDouble(nombreColumna));
}
else if(tipo==Types.BOOLEAN)
{
obj.put(nombreColumna, rs.getBoolean(nombreColumna));
}
else
{
obj.put(nombreColumna, rs.getString(nombreColumna));
}
}
return obj;
}
/**
* Guarda una cadena en formato JSON en el archivo con el nombre proporcionado (SIN LA EXTENSION .JS, el nombre plano)
* en el directorio principal de almacenamiento interno de la aplicación definido en las constantes de entorno como "directorioAplicacion"
* @param jsonStr
* @param nombreArch
* @see ConstantesDeEntorno.directorioAplicacion
* @return
*/
public static boolean guardarJSONEnArchivo(String jsonStr, String nombreArch)
{
try {
File mediaStorageDir = new File(Environment.getExternalStorageDirectory()+File.separator+ConstantesDeEntorno.directorioAplicacion);
if (! mediaStorageDir.exists()){
if (! mediaStorageDir.mkdirs()){
Log.d("Elfec Lecturas", "failed to create directory");
return false;
}
}
File mediaFile = new File(mediaStorageDir.getPath() + File.separator +nombreArch+".js");
FileOutputStream fOut = new FileOutputStream(mediaFile);
OutputStreamWriter osw = new OutputStreamWriter(fOut);
osw.write(jsonStr);
osw.flush();
osw.close();
return true;
} catch (FileNotFoundException e) {
Log.println(1, "FileNotFoundException", e.getMessage());
e.printStackTrace();
} catch (IOException e) {
Log.println(1, "IOException", e.getMessage());
e.printStackTrace();
}
return false;
}
public static String LeerArchivoJSON(String nombreArch)
{
try {
File mediaStorageDir = new File(Environment.getExternalStorageDirectory()+File.separator+ConstantesDeEntorno.directorioAplicacion);
if (! mediaStorageDir.exists()){
if (! mediaStorageDir.mkdirs()){
Log.d("Elfec Lecturas", "failed to create directory");
return null;
}
}
File mediaFile = new File(mediaStorageDir.getPath() + File.separator +nombreArch+".js");
FileInputStream fIn = new FileInputStream(mediaFile);
InputStreamReader isr = new InputStreamReader(fIn);
char[] buffer = new char[5000];
isr.read(buffer);
String cad = new String(buffer);
isr.close();
return cad;
} catch (FileNotFoundException e) {
Log.println(1, "FileNotFoundException", e.getMessage());
e.printStackTrace();
} catch (IOException e) {
Log.println(1, "IOException", e.getMessage());
e.printStackTrace();
}
return null;
}
public static boolean eliminarArchivoJSON(String nombreArch)
{
File mediaStorageDir = new File(Environment.getExternalStorageDirectory()+File.separator+ConstantesDeEntorno.directorioAplicacion);
if (! mediaStorageDir.exists())
{
return true;
}
File mediaFile = new File(mediaStorageDir.getPath() + File.separator +nombreArch+".js");
return mediaFile.delete();
}
}
| [
"diroag@gmail.com"
] | diroag@gmail.com |
a7910e799d6bfbb61ccf1283ae48e5ecdd53a676 | 4b2c63d13f24585a3542576cdf64bd01db67c1ae | /platform/jsip/jain-sip-impl/src/main/java/org/freeims/javax/sip/header/WarningList.java | 2d3264ae8e0678e1477c73de19ef7e5de49510b1 | [] | no_license | gugu-lee/freeims | ce1d0d92ab79c93dfc356971363f0faf6d228461 | bbe2de872deb074531e12cf74204b7a29c91c354 | refs/heads/master | 2022-12-01T08:47:38.326261 | 2019-11-02T10:14:33 | 2019-11-02T10:14:33 | 58,299,201 | 0 | 0 | null | 2022-11-24T01:41:17 | 2016-05-08T06:11:46 | Java | UTF-8 | Java | false | false | 1,960 | java | /*
* Conditions Of Use
*
* This software was developed by employees of the National Institute of
* Standards and Technology (NIST), an agency of the Federal Government.
* Pursuant to title 15 Untied States Code Section 105, works of NIST
* employees are not subject to copyright protection in the United States
* and are considered to be in the public domain. As a result, a formal
* license is not needed to use the software.
*
* This software is provided by NIST as a service and is expressly
* provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY. NIST does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement
*
* .
*
*/
/*******************************************************************************
* Product of NIST/ITL Advanced Networking Technologies Division (ANTD). *
*******************************************************************************/
package org.freeims.javax.sip.header;
import javax.sip.header.*;
/**
* A list of Warning headers.
*
* @version 1.2 $Revision: 1.6 $ $Date: 2009-07-17 18:57:41 $
*
* @author M. Ranganathan <br/>
*
*
*
*/
public class WarningList extends SIPHeaderList<Warning> {
/**
* Comment for <code>serialVersionUID</code>
*/
private static final long serialVersionUID = -1423278728898430175L;
public Object clone() {
WarningList retval = new WarningList();
return retval.clonehlist(this.hlist);
}
/**
* Constructor.
*/
public WarningList() {
super(Warning.class, Warning.NAME);
}
}
| [
"seven.stone.2012@gmail.com"
] | seven.stone.2012@gmail.com |
680d4f3ffb49ea4186cad7b258bfb626235fadcd | 117057cd1b042f67d208da4bfaee2f7f5925f8da | /common/src/main/java/io/github/lxgaming/analysis/common/integration/minecraft/entity/Version.java | 8e322a5a640ba253eacc5fe2f1c35b9f666dd39f | [
"Apache-2.0"
] | permissive | LXGaming/MinecraftAnalysis | db9f56725876e58e1ac9644151525967d8aac711 | aa8a5e147ff92406d5062f8d262fb4eaa83e72c5 | refs/heads/master | 2023-08-23T08:07:29.795035 | 2023-08-05T11:19:55 | 2023-08-05T11:19:55 | 294,954,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java | /*
* Copyright 2020 Alex Thomson
*
* 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 io.github.lxgaming.analysis.common.integration.minecraft.entity;
import com.google.gson.annotations.SerializedName;
public class Version {
@SerializedName("id")
private String id;
@SerializedName("type")
private String type;
@SerializedName("url")
private String url;
@SerializedName("time")
private String time;
@SerializedName("releaseTime")
private String releaseTime;
public String getId() {
return id;
}
public String getType() {
return type;
}
public String getUrl() {
return url;
}
public String getTime() {
return time;
}
public String getReleaseTime() {
return releaseTime;
}
} | [
"LXGaming@users.noreply.github.com"
] | LXGaming@users.noreply.github.com |
8060dcde6ed9832fa89a5b39531db37a60ca6147 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13141-3-19-PESA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiCacheStore_ESTest.java | 9a9226e2c79801b1e87d9e0795d256f9519da540 | [] | 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 | 556 | java | /*
* This file was automatically generated by EvoSuite
* Mon Jan 20 00:08:16 UTC 2020
*/
package com.xpn.xwiki.store;
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 XWikiCacheStore_ESTest extends XWikiCacheStore_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
70a7c7d26b307270a56ab59545953997c667cc6c | e46e4a59ee504e2e5507f89cc9bf2e357a9ff4b3 | /arc-core/src/arc/graphics/TextureData.java | d5425c405f1625c54fed462a55cf1f9ed867c9ed | [] | no_license | netorody/Arc | 6f85a9562834237abc8d4687e309a11535b28326 | 2be8dfe555b6aa4e5307ce56a92e24d8fee39a0b | refs/heads/master | 2020-12-11T17:11:29.435079 | 2020-01-14T15:32:28 | 2020-01-14T15:32:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,656 | java | package arc.graphics;
import arc.files.Fi;
import arc.graphics.Pixmap.Format;
import arc.graphics.gl.FileTextureData;
import arc.graphics.gl.MipMapGenerator;
/**
* Used by a {@link Texture} to load the pixel data. A TextureData can either return a {@link Pixmap} or upload the pixel data
* itself. It signals it's type via {@link #getType()} to the Texture that's using it. The Texture will then either invoke
* {@link #consumePixmap()} or {@link #consumeCustomData(int)}. These are the first methods to be called by Texture. After that
* the Texture will invoke the other methods to find out about the size of the image data, the format, whether mipmaps should be
* generated and whether the TextureData is able to manage the pixel data if the OpenGL ES context is lost.</p>
* <p>
* In case the TextureData implementation has the type {@link TextureDataType#Custom}, the implementation has to generate the
* mipmaps itself if necessary. See {@link MipMapGenerator}.</p>
* <p>
* Before a call to either {@link #consumePixmap()} or {@link #consumeCustomData(int)}, Texture will bind the OpenGL ES
* texture.</p>
* <p>
* Look at {@link FileTextureData} for example implementations of this interface.
* @author mzechner
*/
public interface TextureData{
/** @return the {@link TextureDataType} */
TextureDataType getType();
/** @return whether the TextureData is prepared or not. */
boolean isPrepared();
/**
* Prepares the TextureData for a call to {@link #consumePixmap()} or {@link #consumeCustomData(int)}. This method can be
* called from a non OpenGL thread and should thus not interact with OpenGL.
*/
void prepare();
/**
* Returns the {@link Pixmap} for upload by Texture. A call to {@link #prepare()} must precede a call to this method. Any
* internal data structures created in {@link #prepare()} should be disposed of here.
* @return the pixmap.
*/
Pixmap consumePixmap();
/** @return whether the caller of {@link #consumePixmap()} should dispose the Pixmap returned by {@link #consumePixmap()} */
boolean disposePixmap();
/**
* Uploads the pixel data to the OpenGL ES texture. The caller must bind an OpenGL ES texture. A call to {@link #prepare()}
* must preceed a call to this method. Any internal data structures created in {@link #prepare()} should be disposed of here.
*/
void consumeCustomData(int target);
/** @return the width of the pixel data */
int getWidth();
/** @return the height of the pixel data */
int getHeight();
/** @return the {@link Format} of the pixel data */
Format getFormat();
/** @return whether to generate mipmaps or not. */
boolean useMipMaps();
/** @return whether this implementation can cope with a EGL context loss. */
boolean isManaged();
/**
* The type of this {@link TextureData}.
* @author mzechner
*/
enum TextureDataType{
Pixmap, Custom
}
/**
* Provides static method to instantiate the right implementation (Pixmap, ETC1, KTX).
* @author Vincent Bousquet
*/
class Factory{
public static TextureData loadFromFile(Fi file, boolean useMipMaps){
return loadFromFile(file, null, useMipMaps);
}
public static TextureData loadFromFile(Fi file, Format format, boolean useMipMaps){
if(file == null) return null;
if(file.name().endsWith(".cim")) return new FileTextureData(file, PixmapIO.readCIM(file), format, useMipMaps);
return new FileTextureData(file, new Pixmap(file), format, useMipMaps);
}
}
}
| [
"arnukren@gmail.com"
] | arnukren@gmail.com |
91a7c426d569134aad6dc8cfe71cd1d517254174 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module1440_public/tests/more/src/java/module1440_public_tests_more/a/Foo2.java | 5528ef60e5d692db458f4328761ac9246ae7cdba | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,690 | java | package module1440_public_tests_more.a;
import java.nio.file.*;
import java.sql.*;
import java.util.logging.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see javax.annotation.processing.Completion
* @see javax.lang.model.AnnotatedConstruct
* @see javax.management.Attribute
*/
@SuppressWarnings("all")
public abstract class Foo2<C> extends module1440_public_tests_more.a.Foo0<C> implements module1440_public_tests_more.a.IFoo2<C> {
javax.naming.directory.DirContext f0 = null;
javax.net.ssl.ExtendedSSLSession f1 = null;
javax.rmi.ssl.SslRMIClientSocketFactory f2 = null;
public C element;
public static Foo2 instance;
public static Foo2 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return module1440_public_tests_more.a.Foo0.create(input);
}
public String getName() {
return module1440_public_tests_more.a.Foo0.getInstance().getName();
}
public void setName(String string) {
module1440_public_tests_more.a.Foo0.getInstance().setName(getName());
return;
}
public C get() {
return (C)module1440_public_tests_more.a.Foo0.getInstance().get();
}
public void set(Object element) {
this.element = (C)element;
module1440_public_tests_more.a.Foo0.getInstance().set(this.element);
}
public C call() throws Exception {
return (C)module1440_public_tests_more.a.Foo0.getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
ea706481446cb2c8e444091228ba8a760bb8aa66 | 30fb57d45aa33af600898998f30924185ea21872 | /src/main/java/it/unimi/dsi/fastutil/objects/Reference2ObjectSortedMap.java | 2851932501c1e5a44493e0dbe5a79a8beed2e85e | [
"Apache-2.0"
] | permissive | mrfsong363/fastutil | 7fb632c577360a44d9787feaf2bcfc6617287770 | 4609803e953926e0670e59335a75624f74388e2a | refs/heads/master | 2021-09-24T08:14:41.094887 | 2018-10-05T14:34:55 | 2018-10-05T14:35:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,519 | java |
/*
* Copyright (C) 2002-2017 Sebastiano Vigna
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package it.unimi.dsi.fastutil.objects;
import java.util.Comparator;
import java.util.Map;
import java.util.SortedMap;
/** A type-specific {@link SortedMap}; provides some additional methods that use polymorphism to avoid (un)boxing.
*
* <p>Additionally, this interface strengthens {@link #entrySet()},
* {@link #keySet()}, {@link #values()},
* {@link #comparator()}, {@link SortedMap#subMap(Object,Object)}, {@link SortedMap#headMap(Object)} and {@link SortedMap#tailMap(Object)}.
*
* @see SortedMap
*/
public interface Reference2ObjectSortedMap <K,V> extends Reference2ObjectMap <K,V>, SortedMap<K, V> {
/** Returns a view of the portion of this sorted map whose keys range from {@code fromKey}, inclusive, to {@code toKey}, exclusive.
*
* <p>Note that this specification strengthens the one given in {@link SortedMap#subMap(Object,Object)}.
*
* @see SortedMap#subMap(Object,Object)
*/
@Override
Reference2ObjectSortedMap <K,V> subMap(K fromKey, K toKey);
/** Returns a view of the portion of this sorted map whose keys are strictly less than {@code toKey}.
*
* <p>Note that this specification strengthens the one given in {@link SortedMap#headMap(Object)}.
*
* @see SortedMap#headMap(Object)
*/
@Override
Reference2ObjectSortedMap <K,V> headMap(K toKey);
/** Returns a view of the portion of this sorted map whose keys are greater than or equal to {@code fromKey}.
*
* <p>Note that this specification strengthens the one given in {@link SortedMap#tailMap(Object)}.
*
* @see SortedMap#tailMap(Object)
*/
@Override
Reference2ObjectSortedMap <K,V> tailMap(K fromKey);
/** A sorted entry set providing fast iteration.
*
* <p>In some cases (e.g., hash-based classes) iteration over an entry set requires the creation
* of a large number of entry objects. Some {@code fastutil}
* maps might return {@linkplain #entrySet() entry set} objects of type {@code FastSortedEntrySet}: in this case, {@link #fastIterator() fastIterator()}
* will return an iterator that is guaranteed not to create a large number of objects, <em>possibly
* by returning always the same entry</em> (of course, mutated).
*/
interface FastSortedEntrySet <K,V> extends ObjectSortedSet<Reference2ObjectMap.Entry <K,V> >, FastEntrySet <K,V> {
/** {@inheritDoc}
*/
@Override
ObjectBidirectionalIterator<Reference2ObjectMap.Entry <K,V> > fastIterator();
/** Returns a fast iterator over this entry set, starting from a given element of the domain (optional operation);
* the iterator might return always the same entry instance, suitably mutated.
*
* @param from an element to start from.
* @return a fast iterator over this sorted entry set starting at {@code from}; the iterator might return always the same entry object, suitably mutated.
*/
ObjectBidirectionalIterator<Reference2ObjectMap.Entry <K,V> > fastIterator(Reference2ObjectMap.Entry <K,V> from);
}
/** Returns a sorted-set view of the mappings contained in this map.
* <p>Note that this specification strengthens the one given in the
* corresponding type-specific unsorted map.
*
* @return a sorted-set view of the mappings contained in this map.
* @see Map#entrySet()
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
default ObjectSortedSet<Map.Entry<K, V>> entrySet() {
return (ObjectSortedSet)reference2ObjectEntrySet();
}
/** Returns a type-specific sorted-set view of the mappings contained in this map.
* <p>Note that this specification strengthens the one given in the
* corresponding type-specific unsorted map.
*
* @return a type-specific sorted-set view of the mappings contained in this map.
* @see #entrySet()
*/
@Override
ObjectSortedSet<Reference2ObjectMap.Entry <K,V> > reference2ObjectEntrySet();
/** Returns a type-specific sorted-set view of the keys contained in this map.
* <p>Note that this specification strengthens the one given in the
* corresponding type-specific unsorted map.
*
* @return a sorted-set view of the keys contained in this map.
* @see SortedMap#keySet()
*/
@Override
ReferenceSortedSet <K> keySet();
/** Returns a type-specific set view of the values contained in this map.
* <p>Note that this specification strengthens the one given in {@link Map#values()},
* which was already strengthened in the corresponding type-specific class,
* but was weakened by the fact that this interface extends {@link SortedMap}.
*
* @return a set view of the values contained in this map.
* @see SortedMap#values()
*/
@Override
ObjectCollection <V> values();
/** Returns the comparator associated with this sorted set, or null if it uses its keys' natural ordering.
*
* <p>Note that this specification strengthens the one given in {@link SortedMap#comparator()}.
*
* @see SortedMap#comparator()
*/
@Override
Comparator <? super K> comparator();
}
| [
"lysongfei@gmail.com"
] | lysongfei@gmail.com |
5325e2e8b66eb27773b94d1646fdbce60653a13a | 67c1ea547f0639340220d922196ad7dc7e5b9b18 | /src/main/java/com/dobo/modules/oa/entity/Leave.java | fb695968d581cc958e75ec941e718697763a6f84 | [
"Apache-2.0"
] | permissive | 249910119/dobo | 852f459ee9f67b8d7816f9e656498235ea3a25d4 | 56e42bd03fc1a78c80bdad72a062affdaf1e1213 | refs/heads/master | 2020-05-17T04:09:06.692185 | 2019-04-25T19:43:06 | 2019-04-25T19:43:06 | 183,499,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,820 | java | /**
* There are <a href="https://github.com/thinkgem/jeesite">dobo</a> code generation
*/
package com.dobo.modules.oa.entity;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.hibernate.validator.constraints.Length;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.dobo.common.persistence.DataEntity;
import com.dobo.common.utils.StringUtils;
import com.dobo.modules.sys.entity.User;
import com.dobo.modules.sys.utils.DictUtils;
/**
* 请假Entity
* @author liuj
* @version 2013-04-05
*/
public class Leave extends DataEntity<Leave> {
private static final long serialVersionUID = 1L;
private String reason; // 请假原因
private String processInstanceId; // 流程实例编号
private Date startTime; // 请假开始日期
private Date endTime; // 请假结束日期
private Date realityStartTime; // 实际开始时间
private Date realityEndTime; // 实际结束时间
private String leaveType; // 假种
private String ids;
private Date createDateStart;
private Date createDateEnd;
//-- 临时属性 --//
// 流程任务
private Task task;
private Map<String, Object> variables;
// 运行中的流程实例
private ProcessInstance processInstance;
// 历史的流程实例
private HistoricProcessInstance historicProcessInstance;
// 流程定义
private ProcessDefinition processDefinition;
public Leave() {
super();
}
public Leave(String id){
super();
}
public String getLeaveType() {
return leaveType;
}
public void setLeaveType(String leaveType) {
this.leaveType = leaveType;
}
public String getLeaveTypeDictLabel() {
return DictUtils.getDictLabel(leaveType, "oa_leave_type", "");
}
@Length(min=1, max=255)
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getProcessInstanceId() {
return processInstanceId;
}
public void setProcessInstanceId(String processInstanceId) {
this.processInstanceId = processInstanceId;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getRealityStartTime() {
return realityStartTime;
}
public void setRealityStartTime(Date realityStartTime) {
this.realityStartTime = realityStartTime;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getRealityEndTime() {
return realityEndTime;
}
public void setRealityEndTime(Date realityEndTime) {
this.realityEndTime = realityEndTime;
}
public User getUser() {
return createBy;
}
public void setUser(User user) {
this.createBy = user;
}
public Task getTask() {
return task;
}
public void setTask(Task task) {
this.task = task;
}
public Map<String, Object> getVariables() {
return variables;
}
public void setVariables(Map<String, Object> variables) {
this.variables = variables;
}
public ProcessInstance getProcessInstance() {
return processInstance;
}
public void setProcessInstance(ProcessInstance processInstance) {
this.processInstance = processInstance;
}
public HistoricProcessInstance getHistoricProcessInstance() {
return historicProcessInstance;
}
public void setHistoricProcessInstance(HistoricProcessInstance historicProcessInstance) {
this.historicProcessInstance = historicProcessInstance;
}
public ProcessDefinition getProcessDefinition() {
return processDefinition;
}
public void setProcessDefinition(ProcessDefinition processDefinition) {
this.processDefinition = processDefinition;
}
public String getIds() {
List<String> idList = Lists.newArrayList();
if (StringUtils.isNotBlank(ids)){
String ss = ids.trim().replace(" ", ",").replace(" ",",").replace(",", ",").replace("'", "");
for(String s : ss.split(",")) {
// if(s.matches("\\d*")) {
idList.add("'"+s+"'");
// }
}
}
return StringUtils.join(idList, ",");
}
public void setIds(String ids) {
this.ids = ids;
}
public Date getCreateDateStart() {
return createDateStart;
}
public void setCreateDateStart(Date createDateStart) {
this.createDateStart = createDateStart;
}
public Date getCreateDateEnd() {
return createDateEnd;
}
public void setCreateDateEnd(Date createDateEnd) {
this.createDateEnd = createDateEnd;
}
}
| [
"249910119@qq.com"
] | 249910119@qq.com |
633f8ca3ae98fb06d57c335e92dd65031aed7d16 | 133f0936e0e3b9e4753ce0d679fa293969543eee | /emgui_beSa/JAVA 2/Bai tap/Bai tap tong hop/File_and_JDBC/src/file_and_jdbc/insertIntoTable.java | e85aa4103b1dc769587e8635ebab1f05f91af1ac | [] | no_license | trandai201/StudyJS | 95ab6ea28b3e07608ba64d1041faf35559e24ef9 | a22952e1c0acf696be9f260432c69ed213074ec7 | refs/heads/main | 2023-07-10T21:07:52.236664 | 2021-08-15T06:35:35 | 2021-08-15T06:35:35 | 390,725,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,341 | 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 file_and_jdbc;
import static file_and_jdbc.File_and_JDBC.DATABASENAME;
import static file_and_jdbc.File_and_JDBC.DB_URL;
import static file_and_jdbc.File_and_JDBC.DUONGDANFILETXT;
import static file_and_jdbc.File_and_JDBC.JDBC_DRIVER;
import static file_and_jdbc.File_and_JDBC.PASS;
import static file_and_jdbc.File_and_JDBC.USER;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* @author nguyenducthao
*/
public class insertIntoTable {
static void insert_Into_Table() throws IOException {
String contentFileTXT = "";
// String tentable = "";
contentFileTXT = readFileTXT.read_FileTXT(DUONGDANFILETXT);
Connection conn = null;
Statement stmt = null;
try {
//STEP 2: Register JDBC driver
Class.forName(JDBC_DRIVER);
//STEP 3: Open a connection
System.out.println("Connecting to database...");
conn = DriverManager.getConnection(DB_URL + DATABASENAME + USER + PASS);
//STEP 4: Execute a query
System.out.println("Inserting data into table...");
stmt = conn.createStatement();
// String sql = "CREATE DATABASE QUANLYMAYBAY1";
String sql = contentFileTXT;
stmt.executeUpdate(sql);
System.out.println("Insert data to table successfully...");
} catch (SQLException se) {
//Handle errors for JDBC
se.printStackTrace();
} catch (Exception e) {
//Handle errors for Class.forName
e.printStackTrace();
} finally {
//finally block used to close resources
try {
if (stmt != null) {
stmt.close();
}
} catch (SQLException se2) {
}// nothing we can do
try {
if (conn != null) {
conn.close();
}
} catch (SQLException se) {
se.printStackTrace();
}//end finally try
}//end try
}
}
| [
"="
] | = |
c0fc522f95ad26ca54064d37a33f957a6a401ac6 | 8f0d508be866a9a5c515c1bbbc5bf85693ef3ffd | /java/src/main/java/soupply/java/protocol/play_clientbound/OpenSignEditor.java | 4ec9fc9be72b6b27806be2da385127d1d65928ec | [
"MIT"
] | permissive | hanbule/java | 83e7e1e2725b48370b0151a2ac1ec222b5e99264 | 40fecf30625bdbdc71cce4c6e3222022c0387c6e | refs/heads/master | 2021-09-21T22:43:25.890116 | 2018-09-02T09:28:23 | 2018-09-02T09:28:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | package soupply.java.protocol.play_clientbound;
import java.util.*;
import soupply.util.*;
public class OpenSignEditor extends soupply.java.Packet
{
public static final int ID = 44;
public long position;
public OpenSignEditor()
{
}
public OpenSignEditor(long position)
{
this.position = position;
}
@Override
public int getId()
{
return ID;
}
@Override
public void encodeBody(Buffer _buffer)
{
_buffer.writeBigEndianLong(position);
}
@Override
public void decodeBody(Buffer _buffer) throws DecodeException
{
position = _buffer.readBigEndianLong();
}
public static OpenSignEditor fromBuffer(byte[] buffer)
{
OpenSignEditor packet = new OpenSignEditor();
packet.safeDecode(buffer);
return packet;
}
}
| [
"selutils@mail.com"
] | selutils@mail.com |
6295b526ef032fa589801774d5f0ef1fa2bc1d1b | f7a820c3b1532fea080919fe54500c98e29e1d47 | /IF/API/eu.supersede.if.api/src/main/java/eu/supersede/integration/api/dm/proxies/IDecisionMakingSystem.java | fe2cdee7dc920b126ba27154947d4dbcb05016fe | [
"Apache-2.0"
] | permissive | supersede-project/integration | 9c45d1bccb30e8a6f6610bc0af4c33cf3adeca01 | 1317d6739ee333146be613930828c77a4b63f25a | refs/heads/master | 2023-04-27T02:39:21.013262 | 2023-04-12T15:42:52 | 2023-04-12T15:42:52 | 51,436,147 | 1 | 2 | null | 2020-10-13T06:39:43 | 2016-02-10T11:05:29 | Java | UTF-8 | Java | false | false | 1,122 | java | /*******************************************************************************
* Copyright (c) 2016 ATOS Spain S.A.
* 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.
*
* Contributors:
* Yosu Gorroñogoitia (ATOS) - main development
*
* Initially developed in the context of SUPERSEDE EU project www.supersede.eu
*******************************************************************************/
package eu.supersede.integration.api.dm.proxies;
import eu.supersede.integration.api.dm.types.Alert;
public interface IDecisionMakingSystem {
public boolean notifyAlert( Alert alert );
}
| [
"jesus.gorronogoitia@atos.net"
] | jesus.gorronogoitia@atos.net |
ad6d18a37a6057079375fd5a2f3fc438b51998e9 | 09b7f281818832efb89617d6f6cab89478d49930 | /root/projects/remote-api/source/java/org/alfresco/repo/web/scripts/transfer/TransferWebScript.java | cf95257fe629161c9dd096cf77cca462b749b58e | [] | no_license | verve111/alfresco3.4.d | 54611ab8371a6e644fcafc72dc37cdc3d5d8eeea | 20d581984c2d22d5fae92e1c1674552c1427119b | refs/heads/master | 2023-02-07T14:00:19.637248 | 2020-12-25T10:19:17 | 2020-12-25T10:19:17 | 323,932,520 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,908 | java | /*
* Copyright (C) 2009-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.transfer;
import java.io.IOException;
import java.util.Map;
import java.util.TreeMap;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.transfer.TransferException;
import org.alfresco.util.json.ExceptionJsonSerializer;
import org.alfresco.util.json.JsonSerializer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONObject;
import org.springframework.extensions.webscripts.AbstractWebScript;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
/**
* @author brian
*
*/
public class TransferWebScript extends AbstractWebScript
{
private static final Log log = LogFactory.getLog(TransferWebScript.class);
private boolean enabled = true;
private Map<String, CommandProcessor> processors = new TreeMap<String, CommandProcessor>();
private JsonSerializer<Throwable, JSONObject> errorSerializer = new ExceptionJsonSerializer();
public void setEnabled(boolean enabled)
{
this.enabled = enabled;
}
public void setCommandProcessors(Map<String, CommandProcessor> processors)
{
this.processors = new TreeMap<String,CommandProcessor>(processors);
}
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScript#execute(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse)
*/
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException
{
if (enabled)
{
log.debug("Transfer webscript invoked by user: " + AuthenticationUtil.getFullyAuthenticatedUser() +
" running as " + AuthenticationUtil.getRunAsAuthentication().getName());
processCommand(req.getServiceMatch().getTemplateVars().get("command"), req, res);
}
else
{
res.setStatus(Status.STATUS_NOT_FOUND);
}
}
/**
* @param command
* @param req
* @param res
*/
private void processCommand(String command, WebScriptRequest req, WebScriptResponse res)
{
log.debug("Received request to process transfer command: " + command);
if (command == null || (command = command.trim()).length() == 0)
{
log.warn("Empty or null command received by the transfer script. Returning \"Not Found\"");
res.setStatus(Status.STATUS_NOT_FOUND);
}
else
{
CommandProcessor processor = processors.get(command);
if (processor != null)
{
log.debug("Found appropriate command processor: " + processor);
try
{
processor.process(req, res);
log.debug("command processed");
}
catch (TransferException ex)
{
try
{
log.debug("transfer exception caught", ex);
res.setStatus(Status.STATUS_INTERNAL_SERVER_ERROR);
JSONObject errorObject = errorSerializer.serialize(ex);
String error = errorObject.toString();
res.setContentType("application/json");
res.setContentEncoding("UTF-8");
int length = error.getBytes("UTF-8").length;
res.addHeader("Content-Length", "" + length);
res.getWriter().write(error);
}
catch (Exception e)
{
//nothing to do at this point really.
}
}
}
else
{
log.warn("No processor found for requested command: " + command + ". Returning \"Not Found\"");
res.setStatus(Status.STATUS_NOT_FOUND);
}
}
}
}
| [
"verve111@mail.ru"
] | verve111@mail.ru |
a86298379c49179febbbe3e945bc3e736211cb9c | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/model_seeding/79_twfbplayer-de.outstare.fortbattleplayer.statistics.RoundStatGenerator-0.5-4/de/outstare/fortbattleplayer/statistics/RoundStatGenerator_ESTest_scaffolding.java | 1609f4811b36febabcfa10dfa3bfe6ad3df451f5 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 564 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Oct 29 12:19:10 GMT 2019
*/
package de.outstare.fortbattleplayer.statistics;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class RoundStatGenerator_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
7ea70da12b3ab215856a2eb72f3c3d558a975e58 | fd8ff83f7e4ddb03e7943ba7ae7e438ea594fe79 | /src/basics/VariablesDemo.java | e037d13c17f2ca85031fed4805e3c4935937ebdf | [] | no_license | automationtrainingcenter/sony_java | 2db3e9a26c5812dba2a27e5d1b2472beffac4616 | 8692ef1370f34ec59df1759b4a6d97ec1cea1606 | refs/heads/master | 2020-07-01T19:42:57.434462 | 2019-10-18T14:27:07 | 2019-10-18T14:27:07 | 201,276,449 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,460 | java | package basics;
/*
* Variable is a reference to the memory location where we store the data
* we have 3 types of variables in Java
* 1. local variables
* 2. instance variables
* 3. static variables
*
* if we want to make any variable as constant then use "final" keyword.
*
* Types of variables
*
* 1.Instance variables
* It is a variable which is declared inside the class but outside of any method.
* These are object level. We can access these variables directly inside the class
* instance methods and by creating an object of the class in same class static methods
* and outside the class.
* Variable declaration
* access_modifier data_type var_name;
* accessing variable
* object_name.var_name = value;
* Initialization variable: At the time of variable declaration we are going to assign some value
* access_modifier data_type var_name = value;
*
* 2.static variables
* It is a variable which declared inside the class and outside of any method
* but declared using 'static' keyword. These are class level i.e. object to object these
* variables will share the information. We can access these variables directly inside the
* class and by using class_name outside the class.
* Variable declaration
* access_modifier static data_type var_name;
* accessing variable
* class_name.var_name = value;
* Initialization
* access_modifier static data_type var_name = value;
*
* 3.local variables
* It is variable which is declared inside any method. we can
* access this variable inside the method only.
* Variable declaration
* data_type var_name;
* accessing variable
* var_name = value;
* Initialization
* data_type var_name = value;
*
* | var type | inside the class instance method | inside the class static method | outside the class |
* | instance | directly | by creating object | by creating object |
* | static | directly | directly or by class name | by class name |
*
*
* Creating an object of the class
*
* Class_name obj_name = new Class_name()
*/
public class VariablesDemo {
// instance variable
int i = 10;
// static variable
static int s = 20;
public static void main(String[] args) {
// local variable
int l = 30;
System.out.println(l);
// accessing static variable
System.out.println(VariablesDemo.s);
// accessing instance variable
VariablesDemo obj1 = new VariablesDemo();
System.out.println(obj1.i);
}
}
| [
"atcsurya@gmail.com"
] | atcsurya@gmail.com |
f7c9777bb074f16b30da43e707dc81e8acfc3776 | d77964aa24cfdca837fc13bf424c1d0dce9c70b9 | /spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java | 45d3d609a00df5430b611628e3c607c453030d7a | [] | no_license | Suryakanta97/Springboot-Project | 005b230c7ebcd2278125c7b731a01edf4354da07 | 50f29dcd6cea0c2bc6501a5d9b2c56edc6932d62 | refs/heads/master | 2023-01-09T16:38:01.679446 | 2018-02-04T01:22:03 | 2018-02-04T01:22:03 | 119,914,501 | 0 | 1 | null | 2022-12-27T14:52:20 | 2018-02-02T01:21:45 | Java | UTF-8 | Java | false | false | 4,442 | java | /*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.ldap;
import org.junit.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.ldap.core.ContextSource;
import org.springframework.ldap.core.support.LdapContextSource;
import org.springframework.test.util.ReflectionTestUtils;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link LdapAutoConfiguration}.
*
* @author Eddú Meléndez
* @author Stephane Nicoll
*/
public class LdapAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(LdapAutoConfiguration.class));
@Test
public void contextSourceWithDefaultUrl() {
this.contextRunner.run((context) -> {
LdapContextSource contextSource = context.getBean(LdapContextSource.class);
String[] urls = (String[]) ReflectionTestUtils.getField(contextSource,
"urls");
assertThat(urls).containsExactly("ldap://localhost:389");
assertThat(contextSource.isAnonymousReadOnly()).isFalse();
});
}
@Test
public void contextSourceWithSingleUrl() {
this.contextRunner.withPropertyValues("spring.ldap.urls:ldap://localhost:123")
.run((context) -> {
ContextSource contextSource = context.getBean(ContextSource.class);
String[] urls = (String[]) ReflectionTestUtils.getField(contextSource,
"urls");
assertThat(urls).containsExactly("ldap://localhost:123");
});
}
@Test
public void contextSourceWithSeveralUrls() {
this.contextRunner
.withPropertyValues(
"spring.ldap.urls:ldap://localhost:123,ldap://mycompany:123")
.run((context) -> {
ContextSource contextSource = context.getBean(ContextSource.class);
LdapProperties ldapProperties = context.getBean(LdapProperties.class);
String[] urls = (String[]) ReflectionTestUtils.getField(contextSource,
"urls");
assertThat(urls).containsExactly("ldap://localhost:123",
"ldap://mycompany:123");
assertThat(ldapProperties.getUrls()).hasSize(2);
});
}
@Test
public void contextSourceWithExtraCustomization() {
this.contextRunner
.withPropertyValues("spring.ldap.urls:ldap://localhost:123",
"spring.ldap.username:root", "spring.ldap.password:secret",
"spring.ldap.anonymous-read-only:true",
"spring.ldap.base:cn=SpringDevelopers",
"spring.ldap.baseEnvironment.java.naming.security.authentication:DIGEST-MD5")
.run((context) -> {
LdapContextSource contextSource = context
.getBean(LdapContextSource.class);
assertThat(contextSource.getUserDn()).isEqualTo("root");
assertThat(contextSource.getPassword()).isEqualTo("secret");
assertThat(contextSource.isAnonymousReadOnly()).isTrue();
assertThat(contextSource.getBaseLdapPathAsString())
.isEqualTo("cn=SpringDevelopers");
LdapProperties ldapProperties = context.getBean(LdapProperties.class);
assertThat(ldapProperties.getBaseEnvironment()).containsEntry(
"java.naming.security.authentication", "DIGEST-MD5");
});
}
}
| [
"suryakanta97@github.com"
] | suryakanta97@github.com |
2cb6dc028dc33b2d2cc284c71cf55e24f10ebc93 | 63e36d35f51bea83017ec712179302a62608333e | /OnePlusCamera/com/oneplus/gallery2/media/AlbumManagerBuilder.java | d934582d428059ae0c03190456b80467c8a5b3bf | [] | no_license | hiepgaf/oneplus_blobs_decompiled | 672aa002fa670bdcba8fdf34113bc4b8e85f8294 | e1ab1f2dd111f905ff1eee18b6a072606c01c518 | refs/heads/master | 2021-06-26T11:24:21.954070 | 2017-08-26T12:45:56 | 2017-08-26T12:45:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package com.oneplus.gallery2.media;
import com.oneplus.base.BaseAppComponentBuilder;
import com.oneplus.base.BaseApplication;
import com.oneplus.base.component.Component;
import com.oneplus.base.component.ComponentCreationPriority;
public final class AlbumManagerBuilder
extends BaseAppComponentBuilder
{
public AlbumManagerBuilder()
{
super(ComponentCreationPriority.ON_DEMAND, AlbumManager.class);
}
protected Component create(BaseApplication paramBaseApplication)
{
return new AlbumManager(paramBaseApplication);
}
}
/* Location: /Users/joshua/Desktop/system_framework/classes-dex2jar.jar!/com/oneplus/gallery2/media/AlbumManagerBuilder.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"joshuous@gmail.com"
] | joshuous@gmail.com |
e02d3f3794abf40f7d0028435ce636fa18cdefe1 | 7c20e36b535f41f86b2e21367d687ea33d0cb329 | /Capricornus/src/com/jet/apps/databrowser/action/SaveSqlAction.java | 05b5c275ce90ce776bcf5d99a7f7316777b46ca5 | [] | no_license | fazoolmail89/gopawpaw | 50c95b924039fa4da8f309e2a6b2ebe063d48159 | b23ccffce768a3d58d7d71833f30b85186a50cc5 | refs/heads/master | 2016-09-08T02:00:37.052781 | 2014-05-14T11:46:18 | 2014-05-14T11:46:18 | 35,091,153 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,962 | java | package com.jet.apps.databrowser.action;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import com.jet.apps.databrowser.model.DBSession;
import com.jet.apps.databrowser.event.*;
import com.jet.utils.filesystem.*;
import com.jet.utils.properties.EProperties;
import com.jet.utils.ui.MessageWindow;
import com.jet.utils.filesystem.FileUtil;
import com.jet.utils.ui.ExceptionDebugger;
/*
* $Log: SaveSqlAction.java,v $
* Revision 1.4 2006/12/18 03:20:49 bemocvs
* 3.4.2
*
* Revision 1.3 2003/09/09 10:25:39 bemocvs
* Bug fixes.
*
* Revision 1.2 2003/08/21 16:30:37 bemocvs
* autocommit, sql editing
*
* Revision 1.1.1.1 2002/12/05 00:08:01 bemocvs
* initial checkin
*
* Revision 1.1 2002/04/21 00:55:29 bemocvs
* db3 initial checkin
*
*/
/**
* This is the 'DefaultAction'.
* @author Paul Bemowski
*/
public class SaveSqlAction extends DefaultAction implements Observer, DBEvents
{
String currentFile=null;
String shortName=null;
/** */
public SaveSqlAction(DBSession session, JFrame parent) {
super("Save SQL to ", session, parent);
session.addObserver(this);
this.setEnabled(false);
}
/** */
public void actionPerformed(ActionEvent ae) {
log.writeDebug(4, "SaveSqlAction");
String file=currentFile;
boolean success=false;
try {
StringBuffer sb=new StringBuffer();
sb.append(session.getAllEditorText());
success=FileUtil.saveToFile(file, sb);
} catch (Exception ex) {
log.printStackTrace(ex);
// MessageWindow.showWarning(parent, "Unable to read from file "+
// file, ex);
ExceptionDebugger.debug(parent, "Unable to read from file "+
file, ex);
return;
}
if (success) { //inform the user
MessageWindow.showMessage(parent, "Editor window SQL saved to "+
file);
}
else {
MessageWindow.showWarning(parent, "An unknown error has occured "+
"saving "+file);
}
}
/** */
public void update(Observable o, Object obj) {
DBEvent event=(DBEvent) obj;
int code=event.getCode();
switch (code) {
case (FILE_OPEN):
currentFile=(String)event.getData();
setShortName(currentFile);
putValue(Action.NAME, "Save SQL to "+shortName);
setEnabled(true);
break;
case (FILE_CLOSED):
currentFile=null;
shortName=null;
putValue(Action.NAME, "Save SQL to ...");
setEnabled(false);
break;
default:
}
}
/** */
void setShortName(String filename) {
filename=FileUtil.unixSlashify(filename);
shortName="..."+filename.substring(filename.lastIndexOf("/"));
}
}
| [
"ahuaness@b3021582-c689-11de-ba9a-9db95b2bc6c5"
] | ahuaness@b3021582-c689-11de-ba9a-9db95b2bc6c5 |
3183f44b49a2d1ec38d8fb7266178fac6884d7ce | 1ed0e7930d6027aa893e1ecd4c5bba79484b7c95 | /gacha/source/java/jp/gmotech/smaad/video/ad/a/g.java | 331f000f777af1f78880463c689a774deca56a8c | [] | no_license | AnKoushinist/hikaru-bottakuri-slot | 36f1821e355a76865057a81221ce2c6f873f04e5 | 7ed60c6d53086243002785538076478c82616802 | refs/heads/master | 2021-01-20T05:47:00.966573 | 2017-08-26T06:58:25 | 2017-08-26T06:58:25 | 101,468,394 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,139 | java | package jp.gmotech.smaad.video.ad.a;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import jp.gmotech.smaad.video.ad.b.a;
class g implements RejectedExecutionHandler {
final /* synthetic */ d a;
g(d dVar) {
this.a = dVar;
}
public void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor) {
a.c("RequestHandler", "[rejectedExecution] Runnable : " + runnable.toString());
a.c("RequestHandler", "[rejectedExecution] activeCount : " + threadPoolExecutor.getActiveCount());
a.c("RequestHandler", "[rejectedExecution] corepoolsize : " + threadPoolExecutor.getCorePoolSize());
a.c("RequestHandler", "[rejectedExecution] largestpoolsize : " + threadPoolExecutor.getLargestPoolSize());
a.c("RequestHandler", "[rejectedExecution] maxpoolsize : " + threadPoolExecutor.getMaximumPoolSize());
a.c("RequestHandler", "[rejectedExecution] poolsize : " + threadPoolExecutor.getPoolSize());
a.c("RequestHandler", "[rejectedExecution] taskCount : " + threadPoolExecutor.getTaskCount());
}
}
| [
"09f713c@sigaint.org"
] | 09f713c@sigaint.org |
3a11239d4f46149dc565c46760ffe56d3b3cee44 | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /Honor5C-7.0/src/main/java/android/icu/impl/Trie2_32.java | d475cf8443bef7f16215d0cd77ee342ba8827945 | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,767 | java | package android.icu.impl;
import android.icu.text.UTF16;
import android.icu.text.UnicodeSet;
import com.android.dex.DexFormat;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import org.w3c.dom.traversal.NodeFilter;
public class Trie2_32 extends Trie2 {
Trie2_32() {
}
public static Trie2_32 createFromSerialized(ByteBuffer bytes) throws IOException {
return (Trie2_32) Trie2.createFromSerialized(bytes);
}
public final int get(int codePoint) {
if (codePoint >= 0) {
if (codePoint < UTF16.SURROGATE_MIN_VALUE || (codePoint > UTF16.LEAD_SURROGATE_MAX_VALUE && codePoint <= DexFormat.MAX_TYPE_IDX)) {
return this.data32[(this.index[codePoint >> 5] << 2) + (codePoint & 31)];
} else if (codePoint <= DexFormat.MAX_TYPE_IDX) {
return this.data32[(this.index[((codePoint - UTF16.SURROGATE_MIN_VALUE) >> 5) + NodeFilter.SHOW_NOTATION] << 2) + (codePoint & 31)];
} else if (codePoint < this.highStart) {
return this.data32[(this.index[this.index[(codePoint >> 11) + 2080] + ((codePoint >> 5) & 63)] << 2) + (codePoint & 31)];
} else if (codePoint <= UnicodeSet.MAX_VALUE) {
return this.data32[this.highValueIndex];
}
}
return this.errorValue;
}
public int getFromU16SingleLead(char codeUnit) {
return this.data32[(this.index[codeUnit >> 5] << 2) + (codeUnit & 31)];
}
public int serialize(OutputStream os) throws IOException {
DataOutputStream dos = new DataOutputStream(os);
int bytesWritten = serializeHeader(dos) + 0;
for (int i = 0; i < this.dataLength; i++) {
dos.writeInt(this.data32[i]);
}
return bytesWritten + (this.dataLength * 4);
}
public int getSerializedLength() {
return ((this.header.indexLength * 2) + 16) + (this.dataLength * 4);
}
int rangeEnd(int startingCP, int limit, int value) {
int cp = startingCP;
loop0:
while (cp < limit) {
int index2Block;
int block;
if (cp < UTF16.SURROGATE_MIN_VALUE || (cp > UTF16.LEAD_SURROGATE_MAX_VALUE && cp <= DexFormat.MAX_TYPE_IDX)) {
index2Block = 0;
block = this.index[cp >> 5] << 2;
} else if (cp < DexFormat.MAX_TYPE_IDX) {
index2Block = NodeFilter.SHOW_NOTATION;
block = this.index[((cp - UTF16.SURROGATE_MIN_VALUE) >> 5) + NodeFilter.SHOW_NOTATION] << 2;
} else if (cp < this.highStart) {
index2Block = this.index[(cp >> 11) + 2080];
block = this.index[((cp >> 5) & 63) + index2Block] << 2;
} else if (value == this.data32[this.highValueIndex]) {
cp = limit;
}
if (index2Block == this.index2NullOffset) {
if (value != this.initialValue) {
break;
}
cp += NodeFilter.SHOW_NOTATION;
} else if (block == this.dataNullOffset) {
if (value != this.initialValue) {
break;
}
cp += 32;
} else {
int startIx = block + (cp & 31);
int limitIx = block + 32;
for (int ix = startIx; ix < limitIx; ix++) {
if (this.data32[ix] != value) {
cp += ix - startIx;
break loop0;
}
}
cp += limitIx - startIx;
}
}
if (cp > limit) {
cp = limit;
}
return cp - 1;
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
5bb692788ec19023debbaf6b19a68b39df3dc15c | 419f3eaed329f1ebb0b87597f1f70f492c44dc80 | /src/SuperLongSums.java | 0849b01d20267284f4d3d700defb919956d4fdd4 | [] | no_license | thisAAY/UVA | 2329f4d30faa0f4e03e365585fde3d6f8a590c28 | 85de4dc27ae2e3bf6863619badbbd8fd7f8cf4c3 | refs/heads/master | 2020-03-08T17:01:13.168218 | 2015-03-07T16:30:33 | 2015-03-07T16:30:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,777 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.util.*;
/**
*
* @author allegea
*/
public class SuperLongSums {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException{
//BufferedReader in = new BufferedReader(new FileReader("pruebas.txt"));
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = in.readLine();
int cases = Integer.parseInt(line);
int act = 0;
while (act++<cases)
{
in.readLine();
int size = Integer.parseInt(in.readLine());
char[][] numbers = new char[3][size];
for(int i=0;i<size;i++)
{
StringTokenizer aux = new StringTokenizer(in.readLine());
numbers[0][i]=aux.nextToken().charAt(0);
numbers[1][i]=aux.nextToken().charAt(0);
}
int acca = 0;
for(int i=size-1;i>=0;i--)
{
int num = (numbers[0][i]-48)+(numbers[1][i]-48)+acca;
numbers[2][i]=(char)(num%10+48);
acca=num/10;
//System.out.println(numbers[2][i]+" "+acca);
}
System.out.println(numbers[2]);
if(act!=cases)System.out.println();
}
in.close();
System.exit(0);
}
}
| [
"allegea@gmail.com"
] | allegea@gmail.com |
4b6e7ed0a575403a92869eb294d7595aaceaa2de | 609140092450877f08012806e3c42c47261f99b9 | /wx-proxy/src/main/java/com/ez/wx/message/processor/WxSubscribeEvent.java | 2ecccd35290808a4e6e0c1d96a333f0084218e2a | [] | no_license | newyuliuyu/wx | 8837ac9b45fc2603cc49b353d670423d75650035 | 096ce5d3bb269631316629e5d1e1a2a00c49aadb | refs/heads/master | 2022-12-23T06:59:40.422682 | 2019-12-06T07:57:39 | 2019-12-06T07:57:39 | 205,312,040 | 0 | 0 | null | 2022-12-16T00:41:33 | 2019-08-30T05:39:34 | JavaScript | UTF-8 | Java | false | false | 1,372 | java | package com.ez.wx.message.processor;
import com.ez.common.wx.bean.WxXmlMessage;
import com.ez.common.wx.bean.WxXmlOutMessage;
import com.ez.common.wx.bean.WxXmlOutNewsMessage;
import com.ez.wx.message.process.WxEvent;
import com.ez.wx.message.process.WxProcessInvokeMethod;
/**
* ClassName: WxSubscribeEvent <br/>
* Function: ADD FUNCTION. <br/>
* Reason: ADD REASON(可选). <br/>
* date: 18-7-30 下午5:51 <br/>
*
* @author liuyu
* @version v1.0
* @since JDK 1.7+
*/
@WxEvent(value = "subscribe", validateClass = MatchMessage.class, validateInvokeMethod = "subscribeEvent")
public class WxSubscribeEvent {
@WxProcessInvokeMethod
public WxXmlOutMessage subscribe(WxXmlMessage inMsg) {
WxXmlOutNewsMessage.Item item = new WxXmlOutNewsMessage.Item();
item.setTitle("亲,终于等到您了。个性练习提分数,加油!");
item.setUrl("http://tfkclass.com/wxhelp.html");
item.setDescription("点击查看大图");
item.setPicUrl("http://tfkclass.com/wxhelp2.jpg");
WxXmlOutNewsMessage msg = WxXmlOutNewsMessage.NEWS().fromUser(inMsg.getToUserName()).toUser(inMsg.getFromUserName()).addArticle(item).build();
return msg;
// return WxXmlOutTextMessage.TEXT().content("欢迎来我们的公众号!").fromUser(inMsg.getToUserName()).toUser(inMsg.getFromUserName()).build();
}
}
| [
"306487103@qq.com"
] | 306487103@qq.com |
a7ae350f1bbcedb53d8503ec0a1179d2d1f1ac6d | 2c8931832908c4cdd18b0eb5aa314300449588b7 | /src/Day012_controlFlowStatements/LableStatement.java | 33f5c18ce27f5eeadc207d2243ff08d406dd64a3 | [] | no_license | KailibinuerAbuduaini/JavaStudyByKalbi | 46b3f4e4bb40230da73bf0b66309967e1afe40a2 | 37790f00294cb66ef61860bf91b5d7a73d5e0663 | refs/heads/master | 2020-09-08T22:40:30.172367 | 2020-05-03T22:22:27 | 2020-05-03T22:22:27 | 221,262,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 194 | java | package Day012_controlFlowStatements;
public class LableStatement{
public static void main(String[] args) {
double k=2.0;
do {
System.out.println(k);
}while(k-->0);
}
}
| [
"myEmail@Gmail.com"
] | myEmail@Gmail.com |
882def5d2604c6f0a136895dff526c4faf7cf867 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_39108.java | 6f8474d35b1f8f5701b2e4a9198971a345c65102 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 717 | java | public ActionRuntime lookup(final String method,final String[] pathChunks){
while (true) {
final ActionRuntime actionRuntime=_lookup(method,pathChunks);
if (actionRuntime != null) {
return actionRuntime;
}
if (actionsManager.isStrictRoutePaths()) {
return null;
}
final String lastPath=pathChunks[pathChunks.length - 1];
final int lastNdx=lastPath.lastIndexOf('.');
if (lastNdx == -1) {
return null;
}
final String pathExtension=lastPath.substring(lastNdx + 1);
if (StringUtil.equalsOne(pathExtension,actionsManager.getPathExtensionsToStrip()) == -1) {
return null;
}
pathChunks[pathChunks.length - 1]=lastPath.substring(0,lastNdx);
}
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
37b4a770424ed0b29663dd100619ae2beb4f6965 | 781e2692049e87a4256320c76e82a19be257a05d | /all_data/cs61bl/lab04/cs61bl-mz/ModNCounter.java | 8cb7d4ce75c8fe254679e58790797d44fc1ffe11 | [] | no_license | itsolutionscorp/AutoStyle-Clustering | 54bde86fe6dbad35b568b38cfcb14c5ffaab51b0 | be0e2f635a7558f56c61bc0b36c6146b01d1e6e6 | refs/heads/master | 2020-12-11T07:27:19.291038 | 2016-03-16T03:18:00 | 2016-03-16T03:18:42 | 59,454,921 | 4 | 0 | null | 2016-05-23T05:40:56 | 2016-05-23T05:40:56 | null | UTF-8 | Java | false | false | 304 | java | public class ModNCounter {
private int myCount;
private int myN;
public ModNCounter(int N) {
myCount = 0;
myN = N;
}
public void increment() {
myCount++;
if (myCount == myN) {
myCount = 0;
}
}
public void reset() {
myCount = 0;
}
public int value() {
return myCount;
}
}
| [
"moghadam.joseph@gmail.com"
] | moghadam.joseph@gmail.com |
a41757faac833a24c12f6b434f55303850d65109 | cf5978cfd1cf9d36fc14cdfe927314ac509214e1 | /src/main/java/com/hellozjf/test/u8eai/domain/jaxb/transvouch/ObjectFactory.java | d870226c2730609f15870608f272eb37eef6c4b1 | [] | no_license | hellozjf/u8eai | 6c39502e96938ff4ddcea1863bc4e1cbcb081d57 | e38134795dfc704afb930ce9c1f6a2e07ae60fb8 | refs/heads/master | 2022-02-28T23:34:53.939698 | 2022-02-16T02:59:38 | 2022-02-16T02:59:38 | 105,213,525 | 11 | 6 | null | null | null | null | UTF-8 | Java | false | false | 2,590 | java | //
// 此文件是由 JavaTM Architecture for XML Binding (JAXB) 引用实现 v2.2.8-b130911.1802 生成的
// 请访问 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// 在重新编译源模式时, 对此文件的所有修改都将丢失。
// 生成时间: 2017.09.30 时间 06:27:33 PM CST
//
package com.hellozjf.test.u8eai.domain.jaxb.transvouch;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the com.hellozjf.test.u8eai.domain.jaxb.transvouch package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.hellozjf.test.u8eai.domain.jaxb.transvouch
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link Ufinterface }
*
*/
public Ufinterface createUfinterface() {
return new Ufinterface();
}
/**
* Create an instance of {@link Ufinterface.Transvouch }
*
*/
public Ufinterface.Transvouch createUfinterfaceTransvouch() {
return new Ufinterface.Transvouch();
}
/**
* Create an instance of {@link Ufinterface.Transvouch.Body }
*
*/
public Ufinterface.Transvouch.Body createUfinterfaceTransvouchBody() {
return new Ufinterface.Transvouch.Body();
}
/**
* Create an instance of {@link NewDataSet }
*
*/
public NewDataSet createNewDataSet() {
return new NewDataSet();
}
/**
* Create an instance of {@link Ufinterface.Transvouch.Header }
*
*/
public Ufinterface.Transvouch.Header createUfinterfaceTransvouchHeader() {
return new Ufinterface.Transvouch.Header();
}
/**
* Create an instance of {@link Ufinterface.Transvouch.Body.Entry }
*
*/
public Ufinterface.Transvouch.Body.Entry createUfinterfaceTransvouchBodyEntry() {
return new Ufinterface.Transvouch.Body.Entry();
}
}
| [
"908686171@qq.com"
] | 908686171@qq.com |
e3c6198f64417b5ead106ef42611470b631fdd4f | a7397709e9ff6eca5a8117b4479bcc64a4e41d4b | /components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/panel/PanelMXBeanTracker.java | f85b94da3fed64c50d1b1e9d3796ba42212b1317 | [] | no_license | alhazred/userland | 6fbd28d281c08cf76f59e41e1331fe49fea6bcf2 | 72ea01e9a0ea237c9a960b3533273dc0afe06ff2 | refs/heads/master | 2020-05-17T10:17:16.836583 | 2013-03-04T07:36:23 | 2013-03-04T07:36:23 | 8,550,473 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,618 | java | /*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
*/
package com.oracle.solaris.vp.panel.common.api.panel;
import javax.management.ObjectName;
import com.oracle.solaris.adr.Stability;
import com.oracle.solaris.vp.panel.common.*;
public class PanelMXBeanTracker extends MXBeanTracker<PanelMXBean> {
//
// Static data
//
private static final String DOMAIN = MBeanUtil.VP_DOMAIN + ".panel";
public static final ObjectName OBJECT_NAME =
MBeanUtil.makeObjectName(DOMAIN, "Panel");
//
// Constructors
//
public PanelMXBeanTracker() {
super(OBJECT_NAME, PanelMXBean.class, Stability.PRIVATE);
}
public PanelMXBeanTracker(ClientContext context)
throws TrackerException {
this();
setClientContext(context);
}
}
| [
"a.eremin@nexenta.com"
] | a.eremin@nexenta.com |
741c502aaa0b296ba79e4e3cdc11b3303c17f94f | b3ae616291a3a145e1702bb18fea0ce8b1dfb594 | /EmojiconDemo/src/com/rockerhieu/emojicon/EmojiconTextView.java | dbfb6798119fd878769302e066822e862e761989 | [] | no_license | xunleji/EmojiChatDemo | 5d3d3556602382f0454a4355bf8a178316e73352 | 29e7f535d39348862fb1cf2d0ae2438fc6d78063 | refs/heads/master | 2021-01-10T01:20:50.184470 | 2016-03-17T06:59:50 | 2016-03-17T06:59:50 | 54,095,830 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,253 | java | /*
* Copyright 2014 Hieu Rocker
*
* 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.rockerhieu.emojicon;
import com.example.emojicondemo.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.DynamicDrawableSpan;
import android.util.AttributeSet;
import android.widget.TextView;
/**
* @author Hieu Rocker (rockerhieu@gmail.com).
*/
public class EmojiconTextView extends TextView {
private int mEmojiconSize;
private int mEmojiconAlignment;
private int mEmojiconTextSize;
private int mTextStart = 0;
private int mTextLength = -1;
private boolean mUseSystemDefault = false;
public EmojiconTextView(Context context) {
super(context);
init(null);
}
public EmojiconTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
public EmojiconTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(attrs);
}
private void init(AttributeSet attrs) {
mEmojiconTextSize = (int) getTextSize();
if (attrs == null) {
mEmojiconSize = (int) getTextSize();
} else {
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.Emojicon);
mEmojiconSize = (int) a.getDimension(R.styleable.Emojicon_emojiconSize, getTextSize());
mEmojiconAlignment = a.getInt(R.styleable.Emojicon_emojiconAlignment, DynamicDrawableSpan.ALIGN_BASELINE);
mTextStart = a.getInteger(R.styleable.Emojicon_emojiconTextStart, 0);
mTextLength = a.getInteger(R.styleable.Emojicon_emojiconTextLength, -1);
mUseSystemDefault = a.getBoolean(R.styleable.Emojicon_emojiconUseSystemDefault, false);
a.recycle();
}
setText(getText());
}
@Override
public void setText(CharSequence text, BufferType type) {
if (!TextUtils.isEmpty(text)) {
SpannableStringBuilder builder = new SpannableStringBuilder(text);
EmojiconHandler.addEmojis(getContext(), builder, mEmojiconSize, mEmojiconAlignment, mEmojiconTextSize, mTextStart, mTextLength, mUseSystemDefault);
text = builder;
}
super.setText(text, type);
}
/**
* Set the size of emojicon in pixels.
*/
public void setEmojiconSize(int pixels) {
mEmojiconSize = pixels;
super.setText(getText());
}
/**
* Set whether to use system default emojicon
*/
public void setUseSystemDefault(boolean useSystemDefault) {
mUseSystemDefault = useSystemDefault;
}
}
| [
"you@example.com"
] | you@example.com |
a9e09f28ec69d750015197d0f1d29a6bb74b178b | 6b95be426d7c078cd4a7b70efef786e77131bc1a | /Portlet/VCMS-portlet/docroot/WEB-INF/src/com/vportal/portlet/vcms/model/impl/VcmsCategoryBaseImpl.java | 7edfc77b777e807158c828b54205e732abedb74a | [] | no_license | thaond/eGov_Portal | abf93cf2c04aff76f3833d2ab38db77b8b71d08e | 00071bb4f657b6ae8fe763308dc3391e6e58a49a | refs/heads/master | 2020-12-31T05:24:47.121867 | 2013-08-23T07:32:43 | 2013-08-23T07:32:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,842 | java | /**
* Copyright (c) Vietsoftware, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.vportal.portlet.vcms.model.impl;
import com.liferay.portal.kernel.exception.SystemException;
import com.vportal.portlet.vcms.model.VcmsCategory;
import com.vportal.portlet.vcms.service.VcmsCategoryLocalServiceUtil;
/**
* The extended model base implementation for the VcmsCategory service. Represents a row in the "VcmsCategory" database table, with each column mapped to a property of this class.
*
* <p>
* This class exists only as a container for the default extended model level methods generated by ServiceBuilder. Helper methods and all application logic should be put in {@link VcmsCategoryImpl}.
* </p>
*
* @author hai
* @see VcmsCategoryImpl
* @see com.vportal.portlet.vcms.model.VcmsCategory
* @generated
*/
public abstract class VcmsCategoryBaseImpl extends VcmsCategoryModelImpl
implements VcmsCategory {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this class directly. All methods that expect a vcms category model instance should use the {@link VcmsCategory} interface instead.
*/
public void persist() throws SystemException {
if (this.isNew()) {
VcmsCategoryLocalServiceUtil.addVcmsCategory(this);
}
else {
VcmsCategoryLocalServiceUtil.updateVcmsCategory(this);
}
}
} | [
"vuhuuphuong@gmail.com"
] | vuhuuphuong@gmail.com |
eea88562079dfd259abbb5e6c14f8396d8457651 | 0ffe5765b6a5ed454707fb5875ef174dbe576944 | /src/linked_list/Copy_List_with_Random_Pointer/Copy_List_with_Random_Pointer.java | 0000e6c30e9320604a3083d39c756e3ea7806011 | [] | no_license | liupenny/algorithms | 92b68c6de9abf95747dacda90d15f03791aa5ac5 | f42801c4a5881686905214eddbb8e8ac204fa90d | refs/heads/master | 2021-07-13T08:26:59.691297 | 2018-12-31T13:56:37 | 2018-12-31T13:56:37 | 116,551,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,797 | java | package linked_list.Copy_List_with_Random_Pointer;
import tools.RandomListNode;
import java.util.HashMap;
import java.util.Map;
/**
* Created by PennyLiu on 2017/10/18.
* 138. Copy List with Random Pointer
* 意思:要将原链表的关系赋值下来,所以重点在于怎么复制random这个关系。因为在遍历的时候,如果random指向后面的节点就无法指向random。
* 如下图,新建的链表先放在旧链表的每个节点后面,而不是单独另起炉灶搞个新摊子,每个新节点都跟在原来节点屁股后面,
* 这样新旧链表关系就非常密切,而不是割裂开来!等所有的新节点都放好后,就很容易把就链表的random指针复制到新链表,最后删除老节点即可!
*/
public class Copy_List_with_Random_Pointer {
public RandomListNode copyRandomList(RandomListNode head) {
RandomListNode iter = head, next;
// First round: make copy of each node,
// and link them together side-by-side in a single list.
while (iter != null) {
next = iter.next;
RandomListNode copy = new RandomListNode(iter.label);
iter.next = copy;
copy.next = next;
iter = next;
}
// Second round: assign random pointers for the copy nodes.
iter = head;
while (iter != null) {
if (iter.random != null) {
iter.next.random = iter.random.next;
}
iter = iter.next.next;
}
// Third round: restore the original list, and extract the copy list.
iter = head;
RandomListNode pseudoHead = new RandomListNode(0);
RandomListNode copy, copyIter = pseudoHead;
while (iter != null) {
next = iter.next.next;
// extract the copy
copy = iter.next;
copyIter.next = copy;
copyIter = copy;
// restore the original list
iter.next = next;
iter = next;
}
return pseudoHead.next;
}
public RandomListNode copyRandomList2(RandomListNode head) {
if (head == null) {
return null;
}
Map<RandomListNode, RandomListNode> map = new HashMap<RandomListNode, RandomListNode>();
// loop 1. copy all the nodes
RandomListNode node = head;
while (node != null) {
map.put(node, new RandomListNode(node.label));
node = node.next;
}
// loop 2. assign next and random pointers
node = head;
while (node != null) {
map.get(node).next = map.get(node.next);
map.get(node).random = map.get(node.random);
node = node.next;
}
return map.get(head);
}
public RandomListNode Clone(RandomListNode pHead)
{
if (pHead == null || pHead.next == null) {
return pHead;
}
clone(pHead);
connectSib(pHead);
return reconnect(pHead);
}
public void clone(RandomListNode pHead) {
RandomListNode node = pHead;
while (node != null) {
RandomListNode tmp = new RandomListNode(node.label);
tmp.next = node.next;
node.next = tmp;
node = tmp.next;
}
}
public void connectSib(RandomListNode pHead) {
RandomListNode node = pHead;
while (node != null) {
if (node.random != null) {
node.next.random = node.random.next;
}
node = node.next.next;
}
}
public RandomListNode reconnect(RandomListNode pHead){
RandomListNode cloneHead = pHead.next;
RandomListNode cloneNode = pHead.next;
RandomListNode node = pHead.next.next;
while (node != null) {
cloneNode.next = node.next;
cloneNode = cloneNode.next;
node.next = cloneNode.next;
node = node.next;
}
return cloneHead;
}
public static void main(String[] algs)
{
RandomListNode a1 = new RandomListNode(2);
RandomListNode a2 = new RandomListNode(4);
RandomListNode a3 = new RandomListNode(5);
RandomListNode a4 = new RandomListNode(9);
a1.next = a2;
a1.random = a3;
a2.next = a3;
a2.random = a4;
a3.next = a4;
a3.random = null;
a4.next = null;
a4.random = a1;
Copy_List_with_Random_Pointer t = new Copy_List_with_Random_Pointer();
// t.reverse(a2,a5);
//RandomListNode ans = t.copyRandomList(a1);
RandomListNode ans = t.Clone(a1);
while (ans!=null)
{
System.out.println(ans.label);
ans =ans.next;
}
}
}
| [
"651023146@qq.com"
] | 651023146@qq.com |
123c39b97454bc476b2d4514cf1c2eaf6d6e3f92 | da6ae5680258221d1c47c27a4ad6f4ac30f8bb5d | /src/main/java/com/infinityraider/agricraft/content/AgriBlockRegistry.java | 4a16c2bf3bc2e91987f975da6eeb69891d692dd4 | [
"MIT"
] | permissive | AgriCraft/AgriCraft | 8702eb2313d699af1ae00b38d6ed5b132036cc50 | e2779f836bf47fd44bf5fd2aa7b1c9cd3bdccd95 | refs/heads/master | 2023-08-25T06:15:15.071636 | 2023-08-08T06:22:07 | 2023-08-08T06:22:07 | 26,712,042 | 154 | 151 | MIT | 2023-08-08T06:22:08 | 2014-11-16T11:26:36 | Java | UTF-8 | Java | false | false | 3,363 | java | package com.infinityraider.agricraft.content;
import com.infinityraider.agricraft.api.v1.content.IAgriContent;
import com.infinityraider.agricraft.content.core.*;
import com.infinityraider.agricraft.content.decoration.*;
import com.infinityraider.agricraft.content.irrigation.*;
import com.infinityraider.agricraft.content.world.BlockGreenHouseAir;
import com.infinityraider.agricraft.content.world.BlockGreenHouseMonitor;
import com.infinityraider.infinitylib.utility.registration.ModContentRegistry;
import com.infinityraider.infinitylib.utility.registration.RegistryInitializer;
public final class AgriBlockRegistry extends ModContentRegistry implements IAgriContent.Blocks {
private static final AgriBlockRegistry INSTANCE = new AgriBlockRegistry();
public static AgriBlockRegistry getInstance() {
return INSTANCE;
}
// crop
public final RegistryInitializer<BlockCrop> crop;
// analyzer
public final RegistryInitializer<BlockSeedAnalyzer> seed_analyzer;
// irrigation
public final RegistryInitializer<BlockIrrigationTank> irrigation_tank;
public final RegistryInitializer<BlockIrrigationChannelNormal> irrigation_channel;
public final RegistryInitializer<BlockIrrigationChannelHollow> irrigation_channel_hollow;
public final RegistryInitializer<BlockSprinkler> sprinkler;
// Storage
//public final RegistryInitializer<BlockBase> SEED_STORAGE;
// Decoration
public final RegistryInitializer<BlockGrate> grate;
// World
public final RegistryInitializer<BlockGreenHouseAir> greenhouse_air;
public final RegistryInitializer<BlockGreenHouseMonitor> greenhouse_monitor;
private AgriBlockRegistry() {
super();
this.crop = this.block(BlockCrop::new);
this.seed_analyzer = this.block(BlockSeedAnalyzer::new);
this.irrigation_tank = this.block(BlockIrrigationTank::new);
this.irrigation_channel = this.block(BlockIrrigationChannelNormal::new);
this.irrigation_channel_hollow = this.block(BlockIrrigationChannelHollow::new);
this.sprinkler = this.block(BlockSprinkler::new);
this.grate = this.block(BlockGrate::new);
this.greenhouse_air = this.block(BlockGreenHouseAir::new);
this.greenhouse_monitor = this.block(BlockGreenHouseMonitor::new);
}
@Override
public BlockCrop getCropBlock() {
return this.crop.get();
}
@Override
public BlockSeedAnalyzer getSeedAnalyzerBlock() {
return this.seed_analyzer.get();
}
@Override
public BlockIrrigationTank getTankBlock() {
return this.irrigation_tank.get();
}
@Override
public BlockIrrigationChannelNormal getChannelBlock() {
return this.irrigation_channel.get();
}
@Override
public BlockIrrigationChannelHollow getHollowChannelBlock() {
return this.irrigation_channel_hollow.get();
}
@Override
public BlockSprinkler getSprinklerBlock() {
return this.sprinkler.get();
}
@Override
public BlockGrate getGrateBlock() {
return this.grate.get();
}
@Override
public BlockGreenHouseAir getGreenHouseAirBlock() {
return this.greenhouse_air.get();
}
@Override
public BlockGreenHouseMonitor getGreenHouseMonitorBlock() {
return this.greenhouse_monitor.get();
}
}
| [
"theoneandonlyraider@gmail.com"
] | theoneandonlyraider@gmail.com |
fcc5a85efd723e7b65492fb05f41fc1cf05c9ed3 | 26d4d6bbb096c964c88a4b955614a13e12dfd1f8 | /src/main/java/shadows/apotheosis/spawn/enchantment/CapturingEnchant.java | dbb336aa1d98fd387cf3e33e299b96e7d390ae91 | [
"MIT"
] | permissive | Aikini/Apotheosis | 82c1a0bea597c870ae2106651996d262ecd3fa4c | ae6926747331ad2541dba73c82b84345e73ed78c | refs/heads/1.18 | 2022-01-28T20:00:16.367681 | 2022-01-18T09:47:32 | 2022-01-18T09:47:32 | 386,188,244 | 0 | 0 | MIT | 2021-07-15T06:27:23 | 2021-07-15T06:27:23 | null | UTF-8 | Java | false | false | 636 | java | package shadows.apotheosis.spawn.enchantment;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentCategory;
public class CapturingEnchant extends Enchantment {
public CapturingEnchant() {
super(Rarity.VERY_RARE, EnchantmentCategory.WEAPON, new EquipmentSlot[] { EquipmentSlot.MAINHAND });
}
@Override
public int getMaxLevel() {
return 5;
}
@Override
public int getMinCost(int level) {
return 35 + (level - 1) * 15;
}
@Override
public int getMaxCost(int level) {
return this.getMinCost(level) + 15;
}
} | [
"Bward7864@gmail.com"
] | Bward7864@gmail.com |
201c3d824c0ff9d2f167de74d565096062573ce0 | 5f4927cb47ef2031876a0969dc34d20816c9b8ec | /hilos/Segundos.java | bb89f93e117cf560ad67653e0706ef6de1d8fa48 | [] | no_license | desabi/java-se | f5e072966c3db59c103668709290dbd5107411d7 | d8a8a2c90806981c9c6b2689bfbdc6d0b548c5c9 | refs/heads/master | 2022-12-04T12:01:39.160640 | 2020-08-20T15:45:20 | 2020-08-20T15:45:20 | 289,031,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 461 | java |
package classes;
public class Segundos implements Runnable{
private Thread segundos;
public Segundos(){
segundos = new Thread(this, "segundos");
segundos.start();
}
@Override
public void run(){
try {
while (true){
for (int s=1; s<10; s++){
System.out.println(s);
Thread.sleep(1000);
}
}
}catch (InterruptedException ex) {
System.out.println("Error: " + ex);
}
}
} | [
"desabi@live.com"
] | desabi@live.com |
690551328a1287b6dcf105cefe9cbfd8af59c539 | 6392035b0421990479baf09a3bc4ca6bcc431e6e | /projects/buck-1c7c03dd/prev/src/com/facebook/buck/event/listener/AbstractConsoleEventBusListener.java | ae2ccdc5b4e8c51ded3eea819820a31566a69ad8 | [] | no_license | ameyaKetkar/RMinerEvaluationTools | 4975130072bf1d4940f9aeb6583eba07d5fedd0a | 6102a69d1b78ae44c59d71168fc7569ac1ccb768 | refs/heads/master | 2020-09-26T00:18:38.389310 | 2020-05-28T17:34:39 | 2020-05-28T17:34:39 | 226,119,387 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,827 | java | /*
* Copyright 2013-present Facebook, 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 com.facebook.buck.event.listener;
import com.facebook.buck.cli.InstallEvent;
import com.facebook.buck.event.BuckEvent;
import com.facebook.buck.event.BuckEventListener;
import com.facebook.buck.event.ConsoleEvent;
import com.facebook.buck.json.ProjectBuildFileParseEvents;
import com.facebook.buck.model.BuildId;
import com.facebook.buck.parser.ParseEvent;
import com.facebook.buck.rules.ActionGraphEvent;
import com.facebook.buck.rules.BuildEvent;
import com.facebook.buck.rules.BuildRuleEvent;
import com.facebook.buck.timing.Clock;
import com.facebook.buck.util.Ansi;
import com.facebook.buck.util.Console;
import com.google.common.base.Optional;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
import com.google.common.eventbus.Subscribe;
import java.io.Closeable;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import javax.annotation.Nullable;
/**
* Base class for {@link BuckEventListener}s responsible for outputting information about the
* running build to {@code stderr}.
*/
public abstract class AbstractConsoleEventBusListener implements BuckEventListener, Closeable {
protected static final DecimalFormat TIME_FORMATTER = new DecimalFormat("0.0s");
protected static final long UNFINISHED_EVENT_PAIR = -1;
protected final Console console;
protected final Clock clock;
protected final Ansi ansi;
@Nullable
protected volatile ProjectBuildFileParseEvents.Started projectBuildFileParseStarted;
@Nullable
protected volatile ProjectBuildFileParseEvents.Finished projectBuildFileParseFinished;
@Nullable
protected volatile ParseEvent.Started parseStarted;
@Nullable
protected volatile ParseEvent.Finished parseFinished;
@Nullable
protected volatile ActionGraphEvent.Started actionGraphStarted;
@Nullable
protected volatile ActionGraphEvent.Finished actionGraphFinished;
@Nullable
protected volatile BuildEvent.Started buildStarted;
@Nullable
protected volatile BuildEvent.Finished buildFinished;
@Nullable
protected volatile InstallEvent.Started installStarted;
@Nullable
protected volatile InstallEvent.Finished installFinished;
protected volatile Optional<Integer> ruleCount = Optional.absent();
protected final AtomicInteger numRulesCompleted = new AtomicInteger();
public AbstractConsoleEventBusListener(Console console, Clock clock) {
this.console = console;
this.clock = clock;
this.ansi = console.getAnsi();
this.projectBuildFileParseStarted = null;
this.projectBuildFileParseFinished = null;
this.parseStarted = null;
this.parseFinished = null;
this.actionGraphStarted = null;
this.actionGraphFinished = null;
this.buildStarted = null;
this.buildFinished = null;
this.installStarted = null;
this.installFinished = null;
}
protected String formatElapsedTime(long elapsedTimeMs) {
return TIME_FORMATTER.format(elapsedTimeMs / 1000.0);
}
/**
* Adds a line about a pair of start and finished events to lines.
*
* @param prefix Prefix to print for this event pair.
* @param suffix Suffix to print for this event pair.
* @param currentMillis The current time in milliseconds.
* @param offsetMs Offset to remove from calculated time. Set this to a non-zero value if the
* event pair would contain another event. For example, build time includes parse time, but
* to make the events easier to reason about it makes sense to pull parse time out of build
* time.
* @param startEvent The started event.
* @param finishedEvent The finished event.
* @param lines The builder to append lines to.
* @return The amount of time between start and finished if finished is present,
* otherwise {@link AbstractConsoleEventBusListener#UNFINISHED_EVENT_PAIR}.
*/
protected long logEventPair(String prefix,
Optional<String> suffix,
long currentMillis,
long offsetMs,
@Nullable BuckEvent startEvent,
@Nullable BuckEvent finishedEvent,
ImmutableList.Builder<String> lines) {
long result = UNFINISHED_EVENT_PAIR;
if (startEvent == null) {
return result;
}
String parseLine = (finishedEvent != null ? "[-] " : "[+] ") + prefix + "...";
long elapsedTimeMs;
if (finishedEvent != null) {
elapsedTimeMs = finishedEvent.getTimestamp() - startEvent.getTimestamp();
parseLine += "FINISHED ";
result = elapsedTimeMs;
} else {
elapsedTimeMs = currentMillis - startEvent.getTimestamp();
}
parseLine += formatElapsedTime(elapsedTimeMs - offsetMs);
if (suffix.isPresent()) {
parseLine += " " + suffix.get();
}
lines.add(parseLine);
return result;
}
/**
* Formats a {@link ConsoleEvent} and adds it to {@code lines}.
*/
protected void formatConsoleEvent(ConsoleEvent logEvent, ImmutableList.Builder<String> lines) {
String formattedLine = "";
if (logEvent.getLevel().equals(Level.INFO)) {
formattedLine = logEvent.getMessage();
} else if (logEvent.getLevel().equals(Level.WARNING)) {
formattedLine = ansi.asWarningText(logEvent.getMessage());
} else if (logEvent.getLevel().equals(Level.SEVERE)) {
formattedLine = ansi.asErrorText(logEvent.getMessage());
}
if (!formattedLine.isEmpty()) {
// Split log messages at newlines and add each line individually to keep the line count
// consistent.
lines.addAll(Splitter.on("\n").split(formattedLine));
}
}
@Subscribe
public void projectBuildFileParseStarted(ProjectBuildFileParseEvents.Started started) {
projectBuildFileParseStarted = started;
}
@Subscribe
public void projectBuildFileParseFinished(ProjectBuildFileParseEvents.Finished finished) {
projectBuildFileParseFinished = finished;
}
@Subscribe
public void parseStarted(ParseEvent.Started started) {
parseStarted = started;
}
@Subscribe
public void parseFinished(ParseEvent.Finished finished) {
parseFinished = finished;
}
@Subscribe
public void actionGraphStarted(ActionGraphEvent.Started started) {
actionGraphStarted = started;
}
@Subscribe
public void actionGraphFinished(ActionGraphEvent.Finished finished) {
actionGraphFinished = finished;
}
@Subscribe
public void buildStarted(BuildEvent.Started started) {
buildStarted = started;
}
@Subscribe
public void ruleCountCalculated(BuildEvent.RuleCountCalculated calculated) {
ruleCount = Optional.of(calculated.getNumRules());
}
@Subscribe
public void incrementNumRulesCompleted(
@SuppressWarnings("unused") BuildRuleEvent.Finished finished) {
numRulesCompleted.getAndIncrement();
}
@Subscribe
public void buildFinished(BuildEvent.Finished finished) {
buildFinished = finished;
}
@Subscribe
public void installStarted(InstallEvent.Started started) {
installStarted = started;
}
@Subscribe
public void installFinished(InstallEvent.Finished finished) {
installFinished = finished;
}
@Override
public void outputTrace(BuildId buildId) {}
@Override
public void close() throws IOException {
}
}
| [
"ask1604@gmail.com"
] | ask1604@gmail.com |
37462fff7c42f4918584b4a397cf92f00970d551 | dec37b07175f1ba65820baf7bab5ed14e0dd31aa | /app/src/main/java/com/xiaojinzi/componentdemo/view/TestFragmentRouterFragment.java | b686c180f5abf59fde1f87975fc258a55fc454ae | [
"Apache-2.0"
] | permissive | EnjoyAndroid/Component | fcadec6b9ab78530418654cc919eeea4b10cba75 | 88a003676d33e5386c83ba89e14cc53aa26914a9 | refs/heads/master | 2020-05-31T06:28:46.250712 | 2019-06-03T02:04:25 | 2019-06-03T02:04:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,958 | java | package com.xiaojinzi.componentdemo.view;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.xiaojinzi.base.ModuleConfig;
import com.xiaojinzi.base.interceptor.DialogShowInterceptor;
import com.xiaojinzi.component.ComponentConfig;
import com.xiaojinzi.component.impl.Router;
import com.xiaojinzi.component.impl.RouterErrorResult;
import com.xiaojinzi.component.impl.RouterInterceptor;
import com.xiaojinzi.component.impl.RouterRequest;
import com.xiaojinzi.component.impl.RouterResult;
import com.xiaojinzi.component.impl.RxRouter;
import com.xiaojinzi.component.support.CallbackAdapter;
import com.xiaojinzi.componentdemo.R;
import io.reactivex.functions.Consumer;
/**
* time : 2018/12/27
*
* @author : xiaojinzi 30212
*/
public class TestFragmentRouterFragment extends Fragment implements View.OnClickListener {
private TextView tv_detail;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View contentView = inflater.inflate(R.layout.test_fragment_router_frag, null);
contentView.findViewById(R.id.normalJump).setOnClickListener(this);
contentView.findViewById(R.id.rxJumpGetData).setOnClickListener(this);
contentView.findViewById(R.id.testCallbackAfterFinish).setOnClickListener(this);
contentView.findViewById(R.id.testCallbackAfterFinishActivity).setOnClickListener(this);
contentView.findViewById(R.id.bt_clearInfo).setOnClickListener(this);
tv_detail = contentView.findViewById(R.id.tv_detail);
return contentView;
}
@Override
public void onClick(View v) {
int viewId = v.getId();
if (viewId == R.id.rxJumpGetData) {
rxJumpGetData();
} else if (viewId == R.id.normalJump) {
normalJump();
} else if (viewId == R.id.testCallbackAfterFinish) {
testCallbackAfterFinish();
} else if (viewId == R.id.testCallbackAfterFinishActivity) {
testCallbackAfterFinishActivity();
} else if (viewId == R.id.bt_clearInfo) {
tv_detail.setText("");
}
}
private void addInfo(@Nullable RouterResult routerResult, @Nullable Throwable error, @NonNull String url, @Nullable Integer requestCode) {
if (requestCode == null) {
if (routerResult != null) {
tv_detail.setText(tv_detail.getText() + "\n\n普通跳转成功,目标:" + url);
} else {
tv_detail.setText(tv_detail.getText() + "\n\n普通跳转失败,目标:" + url + ",error = " + error.getClass().getSimpleName() + " ,errorMsg = " + error.getMessage());
}
} else {
if (routerResult != null) {
tv_detail.setText(tv_detail.getText() + "\n\nRequestCode=" + requestCode + "普通跳转成功,目标:" + url);
} else {
tv_detail.setText(tv_detail.getText() + "\n\nRequestCode=" + requestCode + "普通跳转失败,目标:" + url + ",error = " + error.getClass().getSimpleName() + " ,errorMsg = " + error.getMessage());
}
}
}
private void rxJumpGetData(){
RxRouter
.with(this)
.host("component1")
.path("test")
.query("data", "rxJumpGetData")
.requestCode(456)
.intentCall()
.subscribe(new Consumer<Intent>() {
@Override
public void accept(Intent intent) throws Exception {
tv_detail.setText(tv_detail.getText() + "\n\nrequestCode=456,目标:component1/test?data=rxJumpGetData,获取目标页面数据成功啦:Data = " + intent.getStringExtra("data"));
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
tv_detail.setText(tv_detail.getText() + "\n\nrequestCode=456,目标:component1/test?data=rxJumpGetData,获取目标页面数据失败,error = " + throwable.getClass().getSimpleName() + " ,errorMsg = " + throwable.getMessage());
}
});
}
private void normalJump() {
Router
.with(this)
.host("component1")
.path("test")
.query("data", "normalJump")
.putString("name", "cxj1")
.putInt("age", 25)
.navigate(new CallbackAdapter() {
@Override
public void onSuccess(@NonNull RouterResult result) {
addInfo(result, null, "component1/test?data=normalJump", null);
}
@Override
public void onError(@NonNull RouterErrorResult errorResult) {
addInfo(null, errorResult.getError(), "component1/test?data=normalJump", null);
}
});
}
public void testCallbackAfterFinish() {
RxRouter
.with(this)
.host(ModuleConfig.System.NAME)
.path(ModuleConfig.System.CALL_PHONE)
.putString("tel", "xxx")
.interceptors(DialogShowInterceptor.class)
.navigate(new CallbackAdapter() {
@Override
public void onEvent(@Nullable RouterResult result, @Nullable RouterErrorResult errorResult) {
}
@Override
public void onCancel(@NonNull RouterRequest request) {
super.onCancel(request);
Toast.makeText(ComponentConfig.getApplication(), "被自动取消了", Toast.LENGTH_SHORT).show();
}
});
getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit();
}
public void testCallbackAfterFinishActivity() {
RxRouter
.with(this)
.host(ModuleConfig.System.NAME)
.path(ModuleConfig.System.CALL_PHONE)
.putString("tel", "xxx")
.interceptors(new RouterInterceptor() {
@Override
public void intercept(final Chain chain) throws Exception {
new Thread(){
@Override
public void run() {
super.run();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
chain.proceed(chain.request());
}
}.start();
}
})
.interceptors(DialogShowInterceptor.class)
.navigate(new CallbackAdapter(){
@Override
public void onEvent(@Nullable RouterResult result, @Nullable RouterErrorResult errorResult) {
Toast.makeText(ComponentConfig.getApplication(), "onEvent", Toast.LENGTH_SHORT).show();
}
@Override
public void onCancel(@NonNull RouterRequest request) {
super.onCancel(request);
Toast.makeText(ComponentConfig.getApplication(), "被自动取消了", Toast.LENGTH_SHORT).show();
}
});
getActivity().finish();
}
}
| [
"347837667@qq.com"
] | 347837667@qq.com |
d000afc1a05459beb59fe502e8ae8dc1b0db48e4 | 40cd4da5514eb920e6a6889e82590e48720c3d38 | /desktop/applis/apps/core/common/expressionlanguage/src/test/java/code/expressionlanguage/dbg/ProcessDbgEvalScopeTest.java | 42eebacf6d03c7b73fc5cc93332f8ba426da969f | [] | no_license | Cardman/projects | 02704237e81868f8cb614abb37468cebb4ef4b31 | 23a9477dd736795c3af10bccccb3cdfa10c8123c | refs/heads/master | 2023-08-17T11:27:41.999350 | 2023-08-15T07:09:28 | 2023-08-15T07:09:28 | 34,724,613 | 4 | 0 | null | 2020-10-13T08:08:38 | 2015-04-28T10:39:03 | Java | UTF-8 | Java | false | false | 2,884 | java | package code.expressionlanguage.dbg;
import code.expressionlanguage.analyze.AnalyzedPageEl;
import code.util.StringMap;
import org.junit.Test;
public final class ProcessDbgEvalScopeTest extends ProcessDbgCommon {
@Test
public void test1() {
StringBuilder xml_ = new StringBuilder();
xml_.append("public class pkg.Ex {\n");
xml_.append(" public static int exfield=1;\n");
xml_.append("}\n");
StringMap<String> files_ = new StringMap<String>();
files_.put("pkg/Ex", xml_.toString());
AnalyzedPageEl cont_ = scope(files_,"pkg/Ex",41);
assertEq(0,cont_.getInfosVars().size());
assertEq(0,cont_.getCache().getLocalVariables().size());
}
@Test
public void test2() {
StringBuilder xml_ = new StringBuilder();
xml_.append("public class pkg.Ex {\n");
xml_.append(" public int exfield=1;\n");
xml_.append("}\n");
StringMap<String> files_ = new StringMap<String>();
files_.put("pkg/Ex", xml_.toString());
AnalyzedPageEl cont_ = scope(files_,"pkg/Ex",34);
assertEq(0,cont_.getInfosVars().size());
assertEq(0,cont_.getCache().getLocalVariables().size());
}
@Test
public void test3() {
StringBuilder xml_ = new StringBuilder();
xml_.append("public class pkg.Ex {\n");
xml_.append(" public static int exmeth(int t, int u){\n");
xml_.append(" return Math.mod(t,u);\n");
xml_.append(" }\n");
xml_.append("}\n");
StringMap<String> files_ = new StringMap<String>();
files_.put("pkg/Ex", xml_.toString());
AnalyzedPageEl cont_ = scope(files_,"pkg/Ex",72);
assertEq(2,cont_.getInfosVars().size());
assertEq("int",cont_.getInfosVars().getVal("t").getClassName());
assertEq("int",cont_.getInfosVars().getVal("u").getClassName());
assertEq(0,cont_.getCache().getLocalVariables().size());
}
@Test
public void test4() {
StringBuilder xml_ = new StringBuilder();
xml_.append("public class pkg.Ex {\n");
xml_.append(" public static int exmeth(int t, int u){\n");
xml_.append(" return ((int t,int u:int)->Math.mod(t+#t,u+#u)).call(5,7);\n");
xml_.append(" }\n");
xml_.append("}\n");
StringMap<String> files_ = new StringMap<String>();
files_.put("pkg/Ex", xml_.toString());
AnalyzedPageEl cont_ = scope(files_,"pkg/Ex",92);
assertEq(2,cont_.getInfosVars().size());
assertEq("int",cont_.getInfosVars().getVal("t").getClassName());
assertEq("int",cont_.getInfosVars().getVal("u").getClassName());
assertEq(2,cont_.getCache().getLocalVariables().size());
assertEq("int",cont_.getCache().getLocalVar("t",0).getClassName());
assertEq("int",cont_.getCache().getLocalVar("u",0 ).getClassName());
}
}
| [
"f.desrochettes@gmail.com"
] | f.desrochettes@gmail.com |
c03e7f44f2cf9eef733d85b1acde096960d71b94 | a873a0a9cb2cbeccd40e1a903cf3542cc0758603 | /src/truco/plugin/cardlist/chain/raro/TiroDePrecisao.java | 82faf8df84c32afe3b41e3c77da58dcc32079046 | [] | no_license | FeldmannJR/CardWars | 889690e7a79596846ba073ad4a6927669f2540b8 | c0d9a0ab8f3d97e957be42276089899bb3af9669 | refs/heads/master | 2021-09-07T11:10:17.129193 | 2018-02-22T03:01:12 | 2018-02-22T03:01:12 | 110,623,615 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,790 | java | /*
* Nao roba não moço eu fiz isso
* Tem Direitos Autoriais Aqui Cuidado!
* Espero que os troxas acreditem ops.
*/
package truco.plugin.cardlist.chain.raro;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.EntityShootBowEvent;
import truco.plugin.cards.Carta.Raridade;
import truco.plugin.cards.Carta.Armadura;
import truco.plugin.cards.Carta;
import truco.plugin.cards.EventosCartas;
import truco.plugin.cards.skills.Skill;
import truco.plugin.cards.skills.skilltypes.TimedHit;
/**
*
* @author Carlos André Feldmann Júnior
*/
public class TiroDePrecisao extends Carta {
Skill skill = new Skill(this, 10, 40) {
@Override
public String getName() {
return "Flechada Monstra";
}
@Override
public boolean onCast(Player p) {
return TimedHit.hit.fazTimedHit(p, getName(), 20, 4);
}
};
@Override
public Raridade getRaridade() {
return Raridade.RARO;
}
@Override
public String getNome() {
return "Sniper Oculto de Braton";
}
@Override
public String[] getDesc() {
return new String[]{"Golpe epico para atirar flecha monstra"};
}
@Override
public Armadura getArmadura() {
return Armadura.CHAIN;
}
@Override
public Skill getSkill() {
return skill;
}
@Override
public void playerTocaFlecha(EntityShootBowEvent ev) {
if (TimedHit.hit.acertaTimed(((Player) ev.getEntity()), getSkill().getName())) {
((Player) ev.getEntity()).sendMessage(ChatColor.GREEN + "Voce atirou uma flecha mostra!");
EventosCartas.modificaDanoProjetil((Projectile) ev.getProjectile(), 10);
}
}
}
| [
"feldmannjunior@gmail.com"
] | feldmannjunior@gmail.com |
d841eaa7b888dea09bd38250fe4458d43da74360 | 5321081656b15cee17a2f83aedd90c3b1f033338 | /javaserver/src/main/java/com/jelly/rank/RankModel.java | 01084263839ca240498ed5ca508bd5e23d6fa294 | [] | no_license | wangxiangtao666/javaserver | f4ac8d38369cbfaebf17dda281a4974f4c7376bf | 83d80085a163fa41424ac9d52392f4663443be59 | refs/heads/master | 2021-05-30T18:49:52.547381 | 2016-01-22T11:38:37 | 2016-01-22T11:38:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,127 | java | package com.jelly.rank;
import io.nadron.app.Player;
import java.util.List;
import com.dol.cdf.common.DynamicJsonProperty;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.google.common.collect.Lists;
import com.jelly.node.datastore.mapper.RoleEntity;
public class RankModel {
/** 玩家id */
private String guid;
private List<RankRecord> records;
public RankModel() {
}
public RankModel(String guid) {
this.guid = guid;
}
public RankModel(Player player) {
super();
this.guid = player.getId().toString();
}
public RankModel(RoleEntity player) {
super();
this.guid = player.getGuid();
}
public List<RankRecord> getRecords() {
return records;
}
public void setRecords(List<RankRecord> records) {
this.records = records;
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((guid == null) ? 0 : guid.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RankModel other = (RankModel) obj;
if (guid == null) {
if (other.guid != null)
return false;
} else if (!guid.equals(other.guid))
return false;
return true;
}
public ArrayNode toJsonArray(RoleEntity e) {
ArrayNode array = DynamicJsonProperty.jackson.createArrayNode();
array.add(e.getName()).add(e.getLevel()).add(e.getCharId()).add(e.getPower());
return array;
}
public ArrayNode toUnionJsonArray() {
ArrayNode array = DynamicJsonProperty.jackson.createArrayNode();
array.add(this.getGuid());
array.add("");
return array;
}
public void addRecord(RankRecord rankRecord) {
if (this.records == null) {
this.records = Lists.newArrayList();
}
if (this.records.size() > 15) {
this.records.remove(0);
}
this.records.add(rankRecord);
}
}
| [
"dj2@macmini-dj2.local"
] | dj2@macmini-dj2.local |
25aaba684627cd801e184cd7c76f990fa4b9bdf8 | c8417895a7b071e7b2cc07a6791357c5bffc7889 | /com/google/android/gms/fitness/result/BleDevicesResult.java | b6f5a4dbb2a2d0f8fe253247d471866b9ee44d97 | [] | no_license | HansaTharuka/Explore | 70a610cac38469cddf2dc87c9f67dcd9a94f8d1a | b71eb84c57fb28b687ce6df4a69e14a3dcaf8458 | refs/heads/master | 2021-01-24T11:27:25.524180 | 2018-02-27T06:33:37 | 2018-02-27T06:33:37 | 123,083,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,006 | java | package com.google.android.gms.fitness.result;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.api.Result;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.fitness.data.BleDevice;
import com.google.android.gms.fitness.data.DataType;
import com.google.android.gms.internal.jv;
import com.google.android.gms.internal.jv.a;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class BleDevicesResult
implements Result, SafeParcelable
{
public static final Parcelable.Creator<BleDevicesResult> CREATOR = new a();
private final int CK;
private final Status Eb;
private final List<BleDevice> Wq;
BleDevicesResult(int paramInt, List<BleDevice> paramList, Status paramStatus)
{
this.CK = paramInt;
this.Wq = Collections.unmodifiableList(paramList);
this.Eb = paramStatus;
}
public BleDevicesResult(List<BleDevice> paramList, Status paramStatus)
{
this.CK = 3;
this.Wq = Collections.unmodifiableList(paramList);
this.Eb = paramStatus;
}
public static BleDevicesResult C(Status paramStatus)
{
return new BleDevicesResult(Collections.emptyList(), paramStatus);
}
private boolean b(BleDevicesResult paramBleDevicesResult)
{
return (this.Eb.equals(paramBleDevicesResult.Eb)) && (jv.equal(this.Wq, paramBleDevicesResult.Wq));
}
public int describeContents()
{
return 0;
}
public boolean equals(Object paramObject)
{
return (this == paramObject) || (((paramObject instanceof BleDevicesResult)) && (b((BleDevicesResult)paramObject)));
}
public List<BleDevice> getClaimedBleDevices()
{
return this.Wq;
}
public List<BleDevice> getClaimedBleDevices(DataType paramDataType)
{
ArrayList localArrayList = new ArrayList();
Iterator localIterator = this.Wq.iterator();
while (localIterator.hasNext())
{
BleDevice localBleDevice = (BleDevice)localIterator.next();
if (!localBleDevice.getDataTypes().contains(paramDataType))
continue;
localArrayList.add(localBleDevice);
}
return Collections.unmodifiableList(localArrayList);
}
public Status getStatus()
{
return this.Eb;
}
int getVersionCode()
{
return this.CK;
}
public int hashCode()
{
Object[] arrayOfObject = new Object[2];
arrayOfObject[0] = this.Eb;
arrayOfObject[1] = this.Wq;
return jv.hashCode(arrayOfObject);
}
public String toString()
{
return jv.h(this).a("status", this.Eb).a("bleDevices", this.Wq).toString();
}
public void writeToParcel(Parcel paramParcel, int paramInt)
{
a.a(this, paramParcel, paramInt);
}
}
/* Location: D:\Testing\hacking\dex2jar-0.0.9.15\dex2jar-0.0.9.15\classes_dex2jar.jar
* Qualified Name: com.google.android.gms.fitness.result.BleDevicesResult
* JD-Core Version: 0.6.0
*/ | [
"hansatharukarcg3@gmail.com"
] | hansatharukarcg3@gmail.com |
4f4bfccb46d8502b7a6283cb4265a4561b4111cb | 4593745686267f61e342731473c02a867ce36be7 | /src/main/java/com/teske/finance/web/rest/ProfileInfoResource.java | 6ac5cb51fc10c9d18839790b1624d2d70eb465d3 | [] | no_license | BulkSecurityGeneratorProject/FinancialTracking | a43cd73d2a9fd0de7046e9098c4571a7fd18e48d | 33cc48d47f43fd5160de0b727c99c09d40679806 | refs/heads/master | 2022-12-16T08:13:09.884475 | 2018-05-26T20:14:33 | 2018-05-26T20:14:33 | 296,606,342 | 0 | 0 | null | 2020-09-18T11:50:45 | 2020-09-18T11:50:44 | null | UTF-8 | Java | false | false | 2,035 | java | package com.teske.finance.web.rest;
import com.teske.finance.config.DefaultProfileUtil;
import io.github.jhipster.config.JHipsterProperties;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Resource to return information about the currently running Spring profiles.
*/
@RestController
@RequestMapping("/api")
public class ProfileInfoResource {
private final Environment env;
private final JHipsterProperties jHipsterProperties;
public ProfileInfoResource(Environment env, JHipsterProperties jHipsterProperties) {
this.env = env;
this.jHipsterProperties = jHipsterProperties;
}
@GetMapping("/profile-info")
public ProfileInfoVM getActiveProfiles() {
String[] activeProfiles = DefaultProfileUtil.getActiveProfiles(env);
return new ProfileInfoVM(activeProfiles, getRibbonEnv(activeProfiles));
}
private String getRibbonEnv(String[] activeProfiles) {
String[] displayOnActiveProfiles = jHipsterProperties.getRibbon().getDisplayOnActiveProfiles();
if (displayOnActiveProfiles == null) {
return null;
}
List<String> ribbonProfiles = new ArrayList<>(Arrays.asList(displayOnActiveProfiles));
List<String> springBootProfiles = Arrays.asList(activeProfiles);
ribbonProfiles.retainAll(springBootProfiles);
if (!ribbonProfiles.isEmpty()) {
return ribbonProfiles.get(0);
}
return null;
}
class ProfileInfoVM {
private String[] activeProfiles;
private String ribbonEnv;
ProfileInfoVM(String[] activeProfiles, String ribbonEnv) {
this.activeProfiles = activeProfiles;
this.ribbonEnv = ribbonEnv;
}
public String[] getActiveProfiles() {
return activeProfiles;
}
public String getRibbonEnv() {
return ribbonEnv;
}
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
014044112e15b496cb1e127f20f80508c038c5dc | 482a0fe6424b42de7f2768f7b64c4fd36dd24054 | /apps/gmail/gmail_uncompressed/app/src/com/google/api/client/googleapis/a.java | c087cda44247e229fa16d0356341d4a81e5bea7f | [] | no_license | dan7800/SoftwareTestingGradProjectTeamB | b96d10c6b42e2e554e51fc1d7fd7a7189afe79d6 | 0ad2d46d692c77bdc75f8a82162749e2e652c7ab | refs/heads/master | 2021-01-22T09:27:25.378594 | 2015-05-15T23:59:13 | 2015-05-15T23:59:13 | 30,304,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package com.google.api.client.googleapis;
public final class a
{
public static final String VERSION;
public static final Integer cvx;
public static final Integer cvy;
public static final Integer cvz;
static {
cvx = 1;
cvy = 16;
cvz = 0;
VERSION = (a.cvx + "." + a.cvy + "." + a.cvz + "-rc").toString();
}
}
| [
"mjthornton0112@gmail.com"
] | mjthornton0112@gmail.com |
70401f601daa630d5d5641e31f98c22cd29e2ed4 | ecafeff62ea0fbd55385b2187999c092f0ac2cf3 | /di/src/main/java/demo/DemoApplication.java | 2498119868b26773969af5724c3d4a7e054928cb | [] | no_license | vpondala/forklifting | ccc5c41dae3e622c48b8ac5e21f94de29a118466 | 5165da9ca103f1ab4b824adb1323ae6c3a863119 | refs/heads/master | 2021-07-11T23:49:07.707221 | 2017-10-11T11:50:04 | 2017-10-11T11:50:04 | 106,546,686 | 0 | 0 | null | 2017-10-11T11:42:44 | 2017-10-11T11:42:43 | null | UTF-8 | Java | false | false | 1,701 | java | package demo;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import javax.sql.DataSource;
import java.sql.ResultSet;
@SpringBootApplication
public class DemoApplication {
private Log log = LogFactory.getLog(getClass());
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@Bean
DataSource h2(@Value("${spring.datasource.url}") String url,
@Value("${spring.datasource.username}") String username,
@Value("${spring.datasource.password}") String pw) {
log.info(String.format(
"creating an embedded datasource, but we could as easily"
+ " have actually constructed a %s pointing to a real database",
javax.sql.DataSource.class.getName()));
log.info(String.format("\turl: '%s', username: '%s', password: '%s'", url,
username, pw));
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2).build();
}
@Bean
CommandLineRunner jdbc(JdbcTemplate template) {
return args -> template.query("select * from FTP_USER", (ResultSet rs) -> log
.info(String.format("username: %s, admin?: %s, enabled?: %s",
rs.getString("USERNAME"), rs.getString("ADMIN"), rs.getString("ENABLED"))));
}
} | [
"josh@joshlong.com"
] | josh@joshlong.com |
cbfc05d3649431353b2f756ee85d8ef6e11f20a9 | 280da3630f692c94472f2c42abd1051fb73d1344 | /src/net/minecraft/potion/PotionHealthBoost.java | 6799e3b92fa7e0e42068e32002012c865bab00fe | [] | no_license | MicrowaveClient/Clarinet | 7c35206c671eb28bc139ee52e503f405a14ccb5b | bd387bc30329e0febb6c1c1b06a836d9013093b5 | refs/heads/master | 2020-04-02T18:47:52.047731 | 2016-07-14T03:21:46 | 2016-07-14T03:21:46 | 63,297,767 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | package net.minecraft.potion;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.attributes.BaseAttributeMap;
import net.minecraft.util.ResourceLocation;
public class PotionHealthBoost extends Potion {
public PotionHealthBoost(int potionID, ResourceLocation location, boolean badEffect, int potionColor) {
super(potionID, location, badEffect, potionColor);
}
public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap p_111187_2_, int amplifier) {
super.removeAttributesModifiersFromEntity(entityLivingBaseIn, p_111187_2_, amplifier);
if (entityLivingBaseIn.getHealth() > entityLivingBaseIn.getMaxHealth()) {
entityLivingBaseIn.setHealth(entityLivingBaseIn.getMaxHealth());
}
}
}
| [
"justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704"
] | justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704 |
aa0e44aac5a9a2a5b49b038975d360788d7ef9d4 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_23487.java | 8572de00faec682162449f8430a8c2118e1e6190 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 544 | java | protected void setPath(int vcount,float[][] verts,int ccount,int[] codes){
if (verts == null || verts.length < vcount) return;
if (0 < ccount && (codes == null || codes.length < ccount)) return;
int ndim=verts[0].length;
vertexCount=vcount;
vertices=new float[vertexCount][ndim];
for (int i=0; i < vertexCount; i++) {
PApplet.arrayCopy(verts[i],vertices[i]);
}
vertexCodeCount=ccount;
if (0 < vertexCodeCount) {
vertexCodes=new int[vertexCodeCount];
PApplet.arrayCopy(codes,vertexCodes,vertexCodeCount);
}
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
25b481545e450ad8333a1811edbb15874aa7714e | 1137fb469028f50831d53ef47cdff66f09b4b685 | /app/src/main/java/pl/karol202/smartcontrol/behaviour/conditions/ActivityEditCondition.java | d9ec515ea189ad151df5f3b0659726c4339968c4 | [] | no_license | karol-202/SmartControl | e29369215b871449e4af84b5790fe56c2aa331e5 | 91dc56c9875ff582d8d0e77cb8e741dfea97d499 | refs/heads/master | 2020-04-11T08:58:48.214959 | 2016-10-14T19:49:11 | 2016-10-14T20:17:18 | 68,134,739 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,323 | java | package pl.karol202.smartcontrol.behaviour.conditions;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import pl.karol202.smartcontrol.R;
import pl.karol202.smartcontrol.activity.ActivityWithToolbar;
import pl.karol202.smartcontrol.behaviour.Behaviour;
import pl.karol202.smartcontrol.behaviour.BehavioursManager;
public abstract class ActivityEditCondition extends ActivityWithToolbar
{
protected int behaviourId;
protected int conditionId;
protected Condition condition;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
behaviourId = getIntent().getIntExtra("behaviourId", -1);
conditionId = getIntent().getIntExtra("conditionId", -1);
if(behaviourId == -1) throw new RuntimeException("behaviourId not passed to ActivityEditCondition");
Behaviour behaviour = BehavioursManager.getBehaviour(behaviourId);
if(conditionId == -1)
{
conditionId = behaviour.getConditionsLength();
behaviour.addCondition(createCondition(behaviourId, conditionId, behaviour));
BehavioursManager.saveBehaviours();
}
condition = behaviour.getCondition(conditionId);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_activity_edit_condition, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId())
{
case R.id.item_condition_delete:
showDeleteDialog();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void showDeleteDialog()
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.message_dialog_condition_delete);
builder.setPositiveButton(R.string.button_positive_dialog_condition_delete, (dialog, which) -> {
BehavioursManager.getBehaviour(behaviourId).removeCondition(conditionId);
BehavioursManager.saveBehaviours();
ActivityEditCondition.this.finish();
});
builder.setNegativeButton(R.string.button_negative_dialog_behaviour_delete, null);
builder.show();
}
protected abstract Condition createCondition(int behaviourId, int conditionId, Behaviour behaviour);
}
| [
"karoljurski1@gmail.com"
] | karoljurski1@gmail.com |
cdac5ac16e729968055a1fc34a59808e3d6b233f | d4896a7eb2ee39cca5734585a28ca79bd6cc78da | /sources/com/tappx/a/t0.java | d156f751f689879a5c1a4e61385a8187cbfe0480 | [] | no_license | zadweb/zadedu.apk | a235ad005829e6e34ac525cbb3aeca3164cf88be | 8f89db0590333929897217631b162e39cb2fe51d | refs/heads/master | 2023-08-13T03:03:37.015952 | 2021-10-12T21:22:59 | 2021-10-12T21:22:59 | 416,498,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,919 | java | package com.tappx.a;
import android.content.Context;
import com.tappx.a.m0;
import com.tappx.a.q0;
public class t0 extends m0<x1> {
private x1 f;
private q0 g;
/* access modifiers changed from: package-private */
public class a implements Runnable {
a() {
}
public void run() {
t0.this.d().a(t0.this.f.f());
}
}
public static final class b implements m0.b<x1> {
/* renamed from: a reason: collision with root package name */
private final t2 f821a;
public b(t2 t2Var) {
this.f821a = t2Var;
}
@Override // com.tappx.a.m0.b
public m0<x1> a() {
return new t0(this.f821a);
}
@Override // com.tappx.a.m0.b
public boolean a(u1 u1Var) {
return u1Var instanceof x1;
}
}
t0(t2 t2Var) {
super(t2Var);
}
/* access modifiers changed from: protected */
@Override // com.tappx.a.m0
public void e() {
q0 q0Var = this.g;
if (q0Var != null) {
w4.b(q0Var.a());
try {
this.g.a(null, null);
this.g.destroy();
} catch (Exception e) {
e.printStackTrace();
}
}
}
/* access modifiers changed from: protected */
/* renamed from: a */
public void b(Context context, m0.c cVar, x1 x1Var) {
j0.d("7qjY7245E0dfSy30XptPQ/SJdTfZfiiWf+eZ42wqMQY", new Object[0]);
this.f = x1Var;
String h = x1Var.h();
int k = x1Var.k();
int i = x1Var.i();
try {
q0 a2 = q0.a.a(context);
this.g = a2;
a2.a(h, k, i);
this.g.a(cVar, new a());
this.g.loadAd();
} catch (Exception | NoClassDefFoundError e) {
e.printStackTrace();
cVar.a(a2.NO_FILL);
}
}
}
| [
"midoekid@gmail.com"
] | midoekid@gmail.com |
34487a6870dbc757b2df3a5e2b66e36f11732233 | 87f420a0e7b23aefe65623ceeaa0021fb0c40c56 | /oauth/oauth-module-infra/oauth-module-infra-biz/src/main/java/cn/iocoder/oauth/module/infra/dal/mysql/logger/ApiErrorLogMapper.java | b3ac9764b4596be1a11c946ef38823807fe8fd13 | [] | no_license | xioxu-web/xioxu-web | 0361a292b675d8209578d99451598bf4a56f9b08 | 7fe3f9539e3679e1de9f5f614f3f9b7f41a28491 | refs/heads/master | 2023-05-05T01:59:43.228816 | 2023-04-28T07:44:58 | 2023-04-28T07:44:58 | 367,005,744 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,027 | java | package cn.iocoder.oauth.module.infra.dal.mysql.logger;
import cn.iocoder.oauth.framework.common.pojo.PageResult;
import cn.iocoder.oauth.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.oauth.framework.mybatis.core.query.QueryWrapperX;
import cn.iocoder.oauth.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExportReqVO;
import cn.iocoder.oauth.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO;
import cn.iocoder.oauth.module.infra.dal.dataobject.logger.ApiErrorLogDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* API 错误日志 Mapper
*
* @author xiaoxu
*/
@Mapper
public interface ApiErrorLogMapper extends BaseMapperX<ApiErrorLogDO> {
default PageResult<ApiErrorLogDO> selectPage(ApiErrorLogPageReqVO reqVO) {
return selectPage(reqVO, new QueryWrapperX<ApiErrorLogDO>()
.eqIfPresent("user_id", reqVO.getUserId())
.eqIfPresent("user_type", reqVO.getUserType())
.eqIfPresent("application_name", reqVO.getApplicationName())
.likeIfPresent("request_url", reqVO.getRequestUrl())
.betweenIfPresent("exception_time", reqVO.getBeginExceptionTime(), reqVO.getEndExceptionTime())
.eqIfPresent("process_status", reqVO.getProcessStatus())
.orderByDesc("id")
);
}
default List<ApiErrorLogDO> selectList(ApiErrorLogExportReqVO reqVO) {
return selectList(new QueryWrapperX<ApiErrorLogDO>()
.eqIfPresent("user_id", reqVO.getUserId())
.eqIfPresent("user_type", reqVO.getUserType())
.eqIfPresent("application_name", reqVO.getApplicationName())
.likeIfPresent("request_url", reqVO.getRequestUrl())
.betweenIfPresent("exception_time", reqVO.getBeginExceptionTime(), reqVO.getEndExceptionTime())
.eqIfPresent("process_status", reqVO.getProcessStatus())
.orderByDesc("id")
);
}
}
| [
"xb01049438@alibaba-inc.com"
] | xb01049438@alibaba-inc.com |
53b4e5b173a0bfc87197256d04dde52b1df56662 | 1f2693e57a8f6300993aee9caa847d576f009431 | /testleo/myfaces-skins2/shared-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/ClassResourceNameResolver.java | 70cb70deb6b427401a91a87f4ca6db262f742bdd | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | mr-sobol/myfaces-csi | ad80ed1daadab75d449ef9990a461d9c06d8c731 | c142b20012dda9c096e1384a46915171bf504eb8 | refs/heads/master | 2021-01-10T06:11:13.345702 | 2009-01-05T09:46:26 | 2009-01-05T09:46:26 | 43,557,323 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.myfaces.trinidadinternal.share.io;
import java.io.File;
import java.net.URL;
import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
/**
* NameResolver that locates files loaded relative to a class. Files
* will found using Class.getResource(). If no base Class is specified,
* ClassLoader.getResource() is used.
*
* <p>
* @version $Name: $ ($Revision$) $Date$
*/
public class ClassResourceNameResolver extends DefaultNameResolver
{
public ClassResourceNameResolver(Class<?> base)
{
super(null, null);
_base = base;
}
@Override
protected File getFile(String name)
{
return null;
}
@Override
protected URL getURL(String name)
{
if (_base == null)
return ClassLoaderUtils.getResource(name);
return _base.getResource(name);
}
private final Class<?> _base;
}
| [
"lu4242@ea1d4837-9632-0410-a0b9-156113df8070"
] | lu4242@ea1d4837-9632-0410-a0b9-156113df8070 |
80b7ae17914ef1189e49f881dbc353f9c7239c57 | 3144772be9d90dfc72346b6dec053730c804273d | /src/main/java/sul/protocol/bedrock141/play/ContainerSetData.java | fbdfe775bd65b0d3e7704d77a75f2d1323e0a3d6 | [
"MIT"
] | permissive | sel-utils/java | be42f04044674afd77808ae324515358995ba854 | 9b9cc88dfc6e871ceb7eddb3d7c6585756fe1e07 | refs/heads/master | 2021-01-23T05:57:03.737951 | 2018-02-05T12:12:02 | 2018-02-05T12:12:02 | 86,325,412 | 3 | 1 | null | 2017-06-14T20:36:36 | 2017-03-27T11:06:07 | Java | UTF-8 | Java | false | false | 1,708 | java | /*
* This file was automatically generated by sel-utils and
* released under the MIT License.
*
* License: https://github.com/sel-project/sel-utils/blob/master/LICENSE
* Repository: https://github.com/sel-project/sel-utils
* Generated from https://github.com/sel-project/sel-utils/blob/master/xml/protocol/bedrock141.xml
*/
package sul.protocol.bedrock141.play;
import sul.utils.*;
public class ContainerSetData extends Packet {
public static final int ID = (int)51;
public static final boolean CLIENTBOUND = true;
public static final boolean SERVERBOUND = false;
@Override
public int getId() {
return ID;
}
public byte window;
public int property;
public int value;
public ContainerSetData() {}
public ContainerSetData(byte window, int property, int value) {
this.window = window;
this.property = property;
this.value = value;
}
@Override
public int length() {
return Buffer.varintLength(property) + Buffer.varintLength(value) + 2;
}
@Override
public byte[] encode() {
this._buffer = new byte[this.length()];
this.writeVaruint(ID);
this.writeLittleEndianByte(window);
this.writeVarint(property);
this.writeVarint(value);
return this.getBuffer();
}
@Override
public void decode(byte[] buffer) {
this._buffer = buffer;
this.readVaruint();
window=readLittleEndianByte();
property=this.readVarint();
value=this.readVarint();
}
public static ContainerSetData fromBuffer(byte[] buffer) {
ContainerSetData ret = new ContainerSetData();
ret.decode(buffer);
return ret;
}
@Override
public String toString() {
return "ContainerSetData(window: " + this.window + ", property: " + this.property + ", value: " + this.value + ")";
}
} | [
"selutils@mail.com"
] | selutils@mail.com |
e607341220209fb3b57bc2c699a870183b534a45 | 0e9c5b3b125300d3156c0e33dbce33401f72e870 | /src/java/co/com/lavapp/servicio/ConsultarEstadoPedido.java | 3a3269f7d4417f9e532f90dddadb31cbf7465f0f | [] | no_license | CristianRestrepo/LavaapService | 3b025285ddb1dc53fb96ca88d71c4f1ce4ad9037 | 2cce3896bdf32a8e916d643de29e61f5721443ab | refs/heads/master | 2021-01-12T11:32:41.642721 | 2016-12-10T14:51:53 | 2016-12-10T14:51:53 | 72,950,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 427 | 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 co.com.lavapp.servicio;
import co.com.lavapp.modelo.dto.Estado_TO;
/**
*
* @author Desarrollo_Planit
*/
public interface ConsultarEstadoPedido {
public Estado_TO consultarEstadoPedido(int idPedido) throws Exception;
}
| [
"Cardenasg66@gmail.com"
] | Cardenasg66@gmail.com |
92dc34291c4098cf1c3a5c3aaa6ca7928d24bcd8 | ee3321b0804cb9987146be8419d11be35a067fc9 | /nd-arrays/src/main/java/de/javagl/nd/arrays/i/IntArrayND.java | e6a815d9e10b1978b513f54632a6f1bc0771565e | [
"MIT"
] | permissive | javagl/ND | bcac5a8c7493073c8ded5c2cbc6f6f0bab6ce945 | bcb655aaf5fc88af6194f73a27cca079186ff559 | refs/heads/master | 2021-01-10T08:55:21.619455 | 2016-02-04T21:16:43 | 2016-02-04T21:16:43 | 47,347,464 | 0 | 1 | null | 2016-05-10T15:28:56 | 2015-12-03T17:13:54 | Java | UTF-8 | Java | false | false | 3,121 | java | /*
* www.javagl.de - ND - Multidimensional primitive data structures
*
* Copyright (c) 2013-2015 Marco Hutter - http://www.javagl.de
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS 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. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
package de.javagl.nd.arrays.i;
import java.util.stream.IntStream;
import de.javagl.nd.arrays.ArrayND;
import de.javagl.nd.tuples.i.IntTuple;
/*
* Note: This class is automatically generated. Do not modify this class
* directly. See https://github.com/javagl/ND/tree/master/nd-gen/ for
* further information.
*/
/**
* Interface for multidimensional arrays of int values.
*/
public interface IntArrayND
extends ArrayND
{
/**
* Returns the value at the given position.<br>
* <br>
* This method may throw an IndexOutOfBoundsException if the indices
* are not within the {@link #getSize() size} of this array, but
* explicit bounds checking along each dimension is not guaranteed.
*
* @param indices The indices describing the position
* @return The value at the given position.
* @throws NullPointerException if the given indices are <code>null</code>
* @throws IllegalArgumentException If the given indices do not have
* the same {@link IntTuple#getSize() size} as the {@link #getSize()
* size} of this array.
* @throws IndexOutOfBoundsException May be thrown if the indices are
* not valid. That is, if <tt>fromIndex < 0</tt> or
* <tt>toIndex > size</tt> or <tt>fromIndex > toIndex</tt>
* for any dimension. But explicit bounds checking is not guaranteed.
*/
int get(IntTuple indices);
@Override
default IntArrayND subArray(
IntTuple fromIndices, IntTuple toIndices)
{
return IntArraysND.createSubArray(this, fromIndices, toIndices);
}
/**
* Returns a sequential {@code IntStream} with this array as its source.
*
* @return The stream
*/
default IntStream stream()
{
return coordinates().mapToInt(t -> get(t));
}
}
| [
"javagl@javagl.de"
] | javagl@javagl.de |
4de942af9c2a40aae952d80d2e17cb3b2357ff79 | c6a2ddd0afbdd7fbdab6f121c9dfe00e38ff3434 | /src/main/java/com/bs/pojo/Role.java | 107f6868329302c1f9870eb9b85d14041f35d1b3 | [] | no_license | huangcz3/rentcar | 3c298ea45cfe3dd461092f96afacf2d13240a880 | 3b33288106dd34e3181828edc623dd92646866bf | refs/heads/master | 2020-03-07T21:42:40.650388 | 2018-05-12T11:17:33 | 2018-05-12T11:17:33 | 127,733,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,077 | java | package com.bs.pojo;
/**
* 角色
*
* @author Administrator
*/
public class Role {
private int roleid; // 角色id
private String rolename; // 角色名称
private String username;
public Role(int roleid, String rolename, String username) {
super();
this.roleid = roleid;
this.rolename = rolename;
this.username = username;
}
public Role() {
super();
// TODO Auto-generated constructor stub
}
public int getRoleid() {
return roleid;
}
public void setRoleid(int roleid) {
this.roleid = roleid;
}
public String getRolename() {
return rolename;
}
public void setRolename(String rolename) {
this.rolename = rolename;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String toString() {
return "Role [roleid=" + roleid + ", rolename=" + rolename + ", username=" + username + "]";
}
}
| [
"273514614@qq.com"
] | 273514614@qq.com |
d613bbbad1b9a7425a8408cfbd87546964b8281d | 5cad59b093f6be43057e15754ad0edd101ed4f67 | /src/Tag/DP/LongestPalindromicSubsequence.java | 48955bcd80d5b2ae39c7f2847fead1ee7a71d770 | [] | no_license | GeeKoders/Algorithm | fe7e58687bbbca307e027558f6a1b4907ee338db | fe5c2fca66017b0a278ee12eaf8107c79aef2a14 | refs/heads/master | 2023-04-01T16:31:50.820152 | 2021-04-21T23:55:31 | 2021-04-21T23:55:31 | 276,102,037 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 892 | java | package Tag.DP;
public class LongestPalindromicSubsequence {
/*
* Longest Palindromic Subsequence (Medium)
*
* https://leetcode.com/problems/longest-palindromic-subsequence/
*
* reference: https://www.youtube.com/watch?v=tiKT7U8aF_4&ab_channel=happygirlzt
*
* Runtime: 34 ms, faster than 72.33% of Java online submissions for Longest Palindromic Subsequence.
* Memory Usage: 48.9 MB, less than 73.82% of Java online submissions for Longest Palindromic Subsequence.
*
*
*/
public int longestPalindromeSubseq(String s) {
int n = s.length();
int[][] dp = new int[n][n];
for (int i = n - 1; i >= 0; i--) {
dp[i][i] = 1;
for (int j = i + 1; j < n; j++) {
if (s.charAt(i) == s.charAt(j)) {
dp[i][j] = dp[i + 1][j - 1] + 2;
} else {
dp[i][j] = Math.max(dp[i + 1][j], dp[i][j - 1]);
}
}
}
return dp[0][n - 1];
}
}
| [
"iloveitone@gmail.com"
] | iloveitone@gmail.com |
f88a5b56b9679554c7854fd5f21b7f7475859af6 | 24e2555fff3ebf3e84ca01f234c84dc63eda10ff | /androidpn_client/libasmack/src/main/java/org/jivesoftware/smackx/pubsub/FormNode.java | e4dcb6907ae39de9a49e566955d8e8087678c0cc | [] | no_license | meijieman/androidpn | 850d24e0e463ec672092661a87afffe10a6efdfd | 896a20f4e04276623762619e68534cb47a0d9ad0 | refs/heads/master | 2021-09-06T10:03:14.144853 | 2018-02-05T09:09:54 | 2018-02-05T09:09:54 | 106,186,308 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,839 | java | /**
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.jivesoftware.smackx.pubsub;
import org.jivesoftware.smackx.Form;
/**
* Generic packet extension which represents any pubsub form that is
* parsed from the incoming stream or being sent out to the server.
*
* Form types are defined in {@link FormNodeType}.
*
* @author Robin Collier
*/
public class FormNode extends NodeExtension{
private Form configForm;
/**
* Create a {@link FormNode} which contains the specified form.
*
* @param formType The type of form being sent
* @param submitForm The form
*/
public FormNode(FormNodeType formType, Form submitForm){
super(formType.getNodeElement());
if(submitForm == null){
throw new IllegalArgumentException("Submit form cannot be null");
}
configForm = submitForm;
}
/**
* Create a {@link FormNode} which contains the specified form, which is
* associated with the specified node.
*
* @param formType The type of form being sent
* @param nodeId The node the form is associated with
* @param submitForm The form
*/
public FormNode(FormNodeType formType, String nodeId, Form submitForm){
super(formType.getNodeElement(), nodeId);
if(submitForm == null){
throw new IllegalArgumentException("Submit form cannot be null");
}
configForm = submitForm;
}
/**
* Get the Form that is to be sent, or was retrieved from the server.
*
* @return The form
*/
public Form getForm(){
return configForm;
}
@Override
public String toXML(){
if(configForm == null){
return super.toXML();
} else {
StringBuilder builder = new StringBuilder("<");
builder.append(getElementName());
if(getNode() != null){
builder.append(" node='");
builder.append(getNode());
builder.append("'>");
} else {
builder.append('>');
}
builder.append(configForm.getDataFormToSend().toXML());
builder.append("</");
builder.append(getElementName() + '>');
return builder.toString();
}
}
}
| [
"1558667079@qq.com"
] | 1558667079@qq.com |
d70174229742d17d45a7f1a825086ba1cfb1f036 | 69bdd30c92218a899d923c97b0b15bd1b5f3efe5 | /app/src/main/java/org/traccar/manager/model/Device.java | 0514eaac7052cd7993bff0f2af695e728994a2f9 | [
"Apache-2.0"
] | permissive | cabreu1981/traccar-manager-android | 5f2e09c58eb7d2299068724493d5cbc9250396de | d8f4d23d06245551c4b666250b0dcf6548a44341 | refs/heads/master | 2021-01-22T16:38:51.950126 | 2016-05-11T20:35:54 | 2016-05-11T20:35:54 | 58,329,600 | 2 | 0 | null | 2016-05-08T20:18:27 | 2016-05-08T20:18:26 | null | UTF-8 | Java | false | false | 1,728 | java | /*
* Copyright 2015 Anton Tananaev (anton.tananaev@gmail.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.
*/
package org.traccar.manager.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.Date;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Device {
private long id;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
private String uniqueId;
public String getUniqueId() {
return uniqueId;
}
public void setUniqueId(String uniqueId) {
this.uniqueId = uniqueId;
}
private String status;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
private Date lastUpdate;
public Date getLastUpdate() {
return lastUpdate;
}
public void setLastUpdate(Date lastUpdate) {
this.lastUpdate = lastUpdate;
}
@Override
public String toString() {
return name;
}
}
| [
"anton.tananaev@gmail.com"
] | anton.tananaev@gmail.com |
965f683923c300e5b8a985252c2a5fe5f791c058 | e8cd24201cbfadef0f267151ea5b8a90cc505766 | /group16/502059278/src/cn/mark/work0312/MutiDownload.java | 6fc01a785bb361d283914133ad05c74144fd7d0c | [] | no_license | XMT-CN/coding2017-s1 | 30dd4ee886dd0a021498108353c20360148a6065 | 382f6bfeeeda2e76ffe27b440df4f328f9eafbe2 | refs/heads/master | 2021-01-21T21:38:42.199253 | 2017-06-25T07:44:21 | 2017-06-25T07:44:21 | 94,863,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,472 | java | package cn.mark.work0312;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
/**
* 多线程下载
*/
public class MutiDownload {
/*线程数*/
private static final int THREAD_COUNT = 5;
/*下载资源*/
private static final String DOWNLOAD_URL = "http://cn.bing.com/az/hprichbg/rb/PlungeDiving_ZH-CN11143756334_1920x1080.jpg";
/*下载位置*/
private static final String FILE_NAME = "D:/down.jpg";
public static void main(String[] args) {
//文件大小
long fileSize;
HttpURLConnection connection = null;
try{
//打开一个链接
connection = (HttpURLConnection) new URL(DOWNLOAD_URL).openConnection();
//设置请求方式
connection.setRequestMethod("GET");
//连接超时
connection.setConnectTimeout(8000);
//读取超时
connection.setReadTimeout(8000);
if ( connection.getResponseCode() == 200 ){//请求成功返回200
//文件大小
fileSize = connection.getContentLength();
//每个线程要读取的块
long eachSize = fileSize / THREAD_COUNT;
//打开一个RandomAccessFile文件,打开方式为读写(rw)
RandomAccessFile raf = new RandomAccessFile(FILE_NAME,"rw");
//setLength是先在存储设备占用一块空间,防止下载到一半空间不足
raf.setLength(fileSize);
raf.close();
/*创建线程开始下载*/
for ( int i =0; i <THREAD_COUNT; i++ ){
long startIndex = i * eachSize;
long endIndex = (i+1) * eachSize -1;
if ( i == THREAD_COUNT -1 ){ //最后一个线程直接下到文件末尾
endIndex = fileSize;
}
new DownloadThread(DOWNLOAD_URL, FILE_NAME, i, startIndex, endIndex).start();
}
}
}catch(Exception e){
e.printStackTrace();
}finally{
if ( connection != null ){
connection.disconnect();
connection = null;
}
}
}
}
class DownloadThread extends Thread{
//下载地址
private String url;
//文件名
private String fileName;
//线程名
private int threadID;
//开始块
private long startIndex;
//结束块
private long endIndex;
//连接
private HttpURLConnection connection;
private RandomAccessFile raf;
private InputStream inputStream;
/**
* 构造方法
* @param url 下载路径
* @param fileName 下载文件名
* @param threadID 线程ID
* @param startIndex 开始块
* @param endIndex 结束块
*/
public DownloadThread(String url, String fileName, int threadID, long startIndex, long endIndex) {
this.url = url;
this.fileName = fileName;
this.threadID = threadID;
this.startIndex = startIndex;
this.endIndex = endIndex;
}
@Override
public void run() {
try {
connection = (HttpURLConnection)new URL(url+"?ts="+System.currentTimeMillis()).openConnection();
connection.setRequestMethod("GET");
connection.setConnectTimeout(8000);
connection.setReadTimeout(8000);
//设置请求范围
connection.setRequestProperty("RANGE", "bytes="+startIndex+"-"+endIndex);
//请求部分数据成功,返回200
int code = connection.getResponseCode();
if (code == 200 || code == 206){
inputStream = connection.getInputStream();
byte[] bs = new byte[1024];
int len;
raf = new RandomAccessFile(fileName, "rwd");
//把开始位置设置为startIndex,与请求数据一致
raf.seek(startIndex);
long total = 0;
while ( (len = inputStream.read(bs)) != -1 ){
total += len;
System.out.println("线程"+threadID+":"+total);
raf.write(bs,0,len);
}
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally{
if ( connection != null ){
connection.disconnect();
connection = null;
}
if ( raf != null ){
try {
raf.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if ( inputStream != null ){
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
| [
"542194147@qq.com"
] | 542194147@qq.com |
474ee3acdf7ba378015c006fd6941a583c1a8a44 | 7a00bba209de9fcc26ef692006d722bee0530a1a | /backend/n2o/n2o-config/src/test/java/net/n2oapp/framework/config/metadata/compile/control/PasswordJsonTest.java | e3b7bb25e9b71c72f55dcc8a7fd52ac889749350 | [
"Apache-2.0"
] | permissive | borispinus/n2o-framework | bb7c78bc195c4b01370fc2666d6a3b71ded950d7 | 215782a1e5251549b79c5dd377940ecabba0f1d7 | refs/heads/master | 2020-04-13T20:10:06.213241 | 2018-12-28T10:12:18 | 2018-12-28T10:12:18 | 163,422,862 | 1 | 0 | null | 2018-12-28T15:11:59 | 2018-12-28T15:11:58 | null | UTF-8 | Java | false | false | 1,285 | java | package net.n2oapp.framework.config.metadata.compile.control;
import net.n2oapp.framework.config.N2oApplicationBuilder;
import net.n2oapp.framework.config.metadata.pack.*;
import net.n2oapp.framework.config.test.JsonMetadataTestBase;
import org.junit.Before;
import org.junit.Test;
/**
* Тестирвоание маппинга java модели в json password input
*/
public class PasswordJsonTest extends JsonMetadataTestBase {
@Override
@Before
public void setUp() throws Exception {
super.setUp();
}
@Override
protected void configure(N2oApplicationBuilder builder) {
super.configure(builder);
builder.packs(new N2oPagesPack(), new N2oRegionsPack(), new N2oWidgetsPack(), new N2oFieldSetsPack(),
new N2oActionsPack(), new N2oAllDataPack(), new N2oControlsV2IOPack());
builder.compilers(new PasswordCompiler());
}
@Test
public void testPasswordInput() {
check("net/n2oapp/framework/config/mapping/testPasswordInput.widget.xml",
"components/controls/PasswordInput/PasswordInput.meta.json")
.cutXml("form.fieldsets[0].rows[0].cols[0].fields[0].control")
.exclude("src", "disabled", "style")
.assertEquals();
}
} | [
"iryabov@i-novus.ru"
] | iryabov@i-novus.ru |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.